From 50d9a620cb0b4e819a19c059c3fdad86716eee6e Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Mon, 1 Aug 2022 15:48:14 +0800 Subject: [PATCH 01/29] chore: Readjust the directory structure --- Directory.Build.props | 12 +- Masa.Contrib.sln | 1599 ------------ Masa.Framework.sln | 2142 +++++++++++++++++ src/BuildingBlocks/Directory.Build.props | 20 + src/BuildingBlocks/MASA.BuildingBlocks | 1 - src/BuildingBlocks/Masa.BuildingBlocks.sln | 285 +++ src/BuildingBlocks/README.md | 67 + src/BuildingBlocks/README.zh-CN.md | 65 + src/BuildingBlocks/design/CodeMap.dgml | 473 ++++ .../Caches/IApiResourceCache.cs | 19 + .../Caches/IApiScopeCache.cs | 19 + .../Caches/IClientCache.cs | 19 + .../Caches/IIdentityResourceCache.cs | 19 + ...ingBlocks.Authentication.Oidc.Cache.csproj | 14 + .../_Imports.cs | 5 + .../Constants/GrantTypeConsts.cs | 37 + .../Constants/GrantTypes.cs | 19 + .../Entities/Abstract/Property.cs | 11 + .../Entities/Abstract/Secret.cs | 15 + .../Entities/ApiResource.cs | 78 + .../Entities/ApiResourceClaim.cs | 21 + .../Entities/ApiResourceProperty.cs | 18 + .../Entities/ApiResourceScope.cs | 21 + .../Entities/ApiResourceSecret.cs | 12 + .../Entities/ApiScope.cs | 66 + .../Entities/ApiScopeClaim.cs | 20 + .../Entities/ApiScopeProperty.cs | 17 + .../Entities/Client.cs | 161 ++ .../Entities/ClientClaim.cs | 15 + .../Entities/ClientCorsOrigin.cs | 13 + .../Entities/ClientGrantType.cs | 19 + .../Entities/ClientIdPRestriction.cs | 13 + .../Entities/ClientPostLogoutRedirectUri.cs | 18 + .../Entities/ClientProperty.cs | 17 + .../Entities/ClientRedirectUri.cs | 19 + .../Entities/ClientScope.cs | 18 + .../Entities/ClientSecret.cs | 11 + .../Entities/DeviceFlowCodes.cs | 71 + .../Entities/IdentityResource.cs | 66 + .../Entities/IdentityResourceClaim.cs | 21 + .../Entities/IdentityResourceProperty.cs | 18 + .../Entities/PersistedGrant.cs | 25 + .../Entities/UserClaim.cs | 22 + .../Enums/ClientTypes.cs | 13 + .../Enums/TokenExpiration.cs | 20 + .../Enums/TokenUsage.cs | 20 + ...ngBlocks.Authentication.Oidc.Domain.csproj | 5 +- .../Repositories/IApiResourceRepository.cs | 8 + .../Repositories/IApiScopeRepository.cs | 8 + .../Repositories/IClientRepository.cs | 8 + .../IIdentityResourceRepository.cs | 9 + .../Repositories/IRepositoryBase.cs | 24 + .../Repositories/IUserClaimRepository.cs | 9 + .../_Imports.cs | 11 + .../Constans/GrantType.cs | 19 + .../Constans/GrantTypes.cs | 37 + .../Constans/StandardIdentityResources.cs | 104 + .../Constans/StandardUserClaims.cs | 78 + .../Enums/AccessTokenType.cs | 13 + .../Enums/TokenExpiration.cs | 13 + .../Enums/TokenUsage.cs | 13 + ...ngBlocks.Authentication.Oidc.Models.csproj | 9 + .../Models/ApiResourceModel.cs | 50 + .../Models/ApiScopeModel.cs | 46 + .../Models/ClientClaimModel.cs | 59 + .../Models/ClientModel.cs | 227 ++ .../Models/DeviceCodeModel.cs | 113 + .../Models/GrantType.cs | 22 + .../Models/IdentityResourceModel.cs | 48 + .../Models/PersistedGrantFilter.cs | 44 + .../Models/PersistedGrantModel.cs | 114 + .../Models/ResourceModel.cs | 23 + .../Models/ResourcesModel.cs | 45 + .../Models/SecretModel.cs | 40 + .../_Imports.cs | 9 + ...gBlocks.Authentication.Oidc.Storage.csproj | 16 + .../Stores/IClientStore.cs | 14 + .../Stores/IDeviceFlowStore.cs | 45 + .../Stores/IPersistedGrantStore.cs | 45 + .../Stores/IResourceStore.cs | 42 + .../_Imports.cs | 4 + .../Enum/GenderTypes.cs | 10 + .../Enum/StaffTypes.cs | 10 + .../Enum/SubjectTypes.cs | 12 + .../Enum/TeamTypes.cs | 9 + ...gBlocks.BasicAbility.Auth.Contracts.csproj | 9 + .../Model/AddUserModel.cs | 38 + .../Model/AddressValueModel.cs | 33 + .../Model/AppModel.cs | 19 + .../Model/CollectMenuModel.cs | 11 + .../Model/DisableUserModel.cs | 14 + .../Model/MenuModel.cs | 19 + .../Model/NavModel.cs | 17 + .../Model/ProjectModel.cs | 15 + .../Model/RoleModel.cs | 11 + .../Model/StaffDetailModel.cs | 16 + .../Model/StaffModel.cs | 80 + .../Model/SubjectModel.cs | 45 + .../Model/TeamDetailModel.cs | 49 + .../Model/TeamModel.cs | 19 + .../Model/TeamPersonnelModel.cs | 20 + .../Model/UpdateUserBasicInfoModel.cs | 19 + .../Model/UpdateUserPasswordModel.cs | 13 + .../Model/UpsertUserModel.cs | 38 + .../Model/UserModel.cs | 73 + .../Model/UserPortraitModel.cs | 17 + .../Model/UserSimpleModel.cs | 20 + .../Model/UserVisitedModel.cs | 11 + .../_Imports.cs | 4 + .../IAuthClient.cs | 18 + .../IEnvironmentProvider.cs | 9 + ...sa.BuildingBlocks.BasicAbility.Auth.csproj | 13 + .../Service/IPermissionService.cs | 29 + .../Service/IProjectService.cs | 9 + .../Service/ISubjectService.cs | 10 + .../Service/ITeamService.cs | 14 + .../Service/IUserService.cs | 52 + .../_Imports.cs | 5 + .../IDccClient.cs | 9 + ...asa.BuildingBlocks.BasicAbility.Dcc.csproj | 9 + .../Model/LabelModel.cs | 20 + .../Service/ILabelService.cs | 9 + .../_Imports.cs | 5 + .../Enum/ChannelTypes.cs | 11 + .../Enum/MessageTaskReceiverTypes.cs | 13 + .../Enum/MessageTaskSelectReceiverTypes.cs | 10 + .../Enum/MessageTaskSources.cs | 10 + .../Enum/MessageTaskStatuses.cs | 14 + .../Enum/MessageTemplateAuditStatuses.cs | 11 + .../Enum/MessageTemplateStates.cs | 10 + .../Enum/MessageTypes.cs | 10 + .../Enum/ReceiverGroupItemTypes.cs | 12 + .../Enum/SendTargets.cs | 10 + .../Enum/WebsiteMessageFilterType.cs | 10 + .../IMcClient.cs | 17 + .../ExtraPropertyDictionary.cs | 18 + ...Masa.BuildingBlocks.BasicAbility.Mc.csproj | 13 + .../Model/AuditEntityModel.cs | 15 + .../Model/ChannelModel.cs | 17 + .../Model/EntityModel.cs | 9 + .../Model/GetChannelModel.cs | 13 + .../Model/GetMessageTemplateModel.cs | 23 + .../Model/GetNoticeListModel.cs | 9 + .../Model/GetReceiverGroupModel.cs | 9 + .../Model/GetWebsiteMessageModel.cs | 15 + .../Model/MessageInfoModel.cs | 17 + .../Model/MessageInfoUpsertModel.cs | 17 + .../Model/MessageTaskModel.cs | 43 + .../Model/MessageTaskReceiverModel.cs | 21 + .../Model/MessageTemplateItemModel.cs | 15 + .../Model/MessageTemplateModel.cs | 50 + .../Model/PaginatedListModel.cs | 25 + .../Model/PaginatedOptionsModel.cs | 20 + .../Model/ReadAllWebsiteMessageModel.cs | 8 + .../Model/ReadWebsiteMessageModel.cs | 9 + .../Model/ReceiverGroupItemModel.cs | 21 + .../Model/ReceiverGroupModel.cs | 15 + .../Model/SendOrdinaryMessageModel.cs | 23 + .../Model/SendRuleModel.cs | 13 + .../Model/SendTemplateMessageModel.cs | 25 + .../Model/WebsiteMessageChannelModel.cs | 9 + .../Model/WebsiteMessageModel.cs | 31 + .../Service/IChannelService.cs | 11 + .../Service/IMessageTaskService.cs | 13 + .../Service/IMessageTemplateService.cs | 11 + .../Service/IReceiverGroupService.cs | 11 + .../Service/IWebsiteMessageService.cs | 27 + .../_Imports.cs | 8 + .../Enum/AppTypes.cs | 16 + .../Enum/ServiceTypes.cs | 13 + .../IPmClient.cs | 15 + ...Masa.BuildingBlocks.BasicAbility.Pm.csproj | 9 + .../Model/AppDetailModel.cs | 27 + .../Model/AppModel.cs | 29 + .../Model/BaseModel.cs | 15 + .../Model/ClusterDetailModel.cs | 15 + .../Model/ClusterModel.cs | 13 + .../Model/EnvironmentClusterModel.cs | 23 + .../Model/EnvironmentDetailModel.cs | 17 + .../Model/EnvironmentModel.cs | 13 + .../Model/ProjectAppsModel.cs | 28 + .../Model/ProjectDetailModel.cs | 21 + .../Model/ProjectModel.cs | 23 + .../Model/ProjectTypeModel.cs | 11 + .../Service/IAppService.cs | 17 + .../Service/IClusterService.cs | 15 + .../Service/IEnvironmentService.cs | 11 + .../Service/IProjectService.cs | 19 + .../_Imports.cs | 7 + .../Enum/HttpMethods.cs | 13 + .../Enum/HttpVerifyTypes.cs | 12 + .../Enum/JobTypes.cs | 11 + .../Enum/RunTimeoutStrategyTypes.cs | 10 + .../Enum/ScheduleBlockStrategyTypes.cs | 12 + .../Enum/ScheduleExpiredStrategyTypes.cs | 11 + .../ISchedulerClient.cs | 11 + .../ISchedulerJob.cs | 13 + ...ildingBlocks.BasicAbility.Scheduler.csproj | 9 + .../Model/JobContext.cs | 19 + .../Model/SchedulerJobAppConfig.cs | 17 + ...SchedulerJobDaprServiceInvocationConfig.cs | 15 + .../Model/SchedulerJobHttpConfig.cs | 21 + .../Request/AddSchedulerJobRequest.cs | 48 + .../Request/BaseSchedulerJobRequest.cs | 11 + .../Request/BaseSchedulerTaskRequest.cs | 11 + .../Request/ChangeEnabledStatusRequest.cs | 9 + .../Request/StartSchedulerTaskRequest.cs | 9 + .../Service/ISchedulerJobService.cs | 17 + .../Service/ISchedulerTaskService.cs | 11 + .../_Imports.cs | 7 + .../Enums/AggregationTypes.cs | 11 + .../ITscClient.cs | 11 + ...asa.BuildingBlocks.BasicAbility.Tsc.csproj | 9 + .../Model/Metric/LableValuesRequest.cs | 27 + .../Model/Metric/ValuesRequest.cs | 20 + .../Service/ILogService.cs | 13 + .../Service/IMetricService.cs | 13 + .../_Imports.cs | 7 + .../AbstractConfigurationRepository.cs | 42 + .../ConfigurationTypes.cs | 12 + .../IConfigurationApi.cs | 9 + .../IConfigurationApiClient.cs | 19 + .../IConfigurationApiManage.cs | 19 + .../IConfigurationRepository.cs | 15 + .../IMasaConfiguration.cs | 11 + .../IMasaConfigurationBuilder.cs | 15 + .../IRepositoryChangeListener.cs | 9 + .../Masa.BuildingBlocks.Configuration.csproj | 15 + .../Options/ConfigurationRelationOptions.cs | 18 + .../Options/IMasaConfigurationOptions.cs | 28 + .../Options/MasaConfigurationOptions.cs | 21 + .../Properties.cs | 73 + .../SectionTypes.cs | 10 + .../_Imports.cs | 9 + .../DataFiltering/IDataFilter.cs | 13 + .../DataFiltering/ISoftDelete.cs | 9 + .../Masa.BuildingBlocks.Data.Contracts.csproj | 13 + .../Paginated/BasePaginatedList.cs | 14 + .../_Imports.cs | 5 + .../IMapping.cs | 13 + .../Mapper.cs | 22 + .../Masa.BuildingBlocks.Data.Mapping.csproj | 13 + .../Options/Enum/MapMode.cs | 16 + .../Options/MapOptions.cs | 9 + .../_Imports.cs | 6 + ...ildingBlocks.Data.MappingExtensions.csproj | 13 + .../ObjectExtensions.cs | 19 + .../_Imports.cs | 5 + .../CommitState.cs | 16 + .../EntityState.cs | 10 + .../ITransaction.cs | 10 + .../IUnitOfWork.cs | 43 + .../IUnitOfWorkAccessor.cs | 12 + .../IUnitOfWorkManager.cs | 17 + .../Masa.BuildingBlocks.Data.UoW.csproj | 13 + .../Masa.BuildingBlocks.Data.UoW/_Imports.cs | 6 + .../BaseDbConnectionStringProvider.cs | 13 + .../DefaultConcurrencyStampProvider.cs | 9 + .../Concurrency/IConcurrencyStampProvider.cs | 9 + .../Concurrency/IHasConcurrencyStamp.cs | 9 + .../ConnectionStringNameAttribute.cs | 24 + .../ConnectionStrings.cs | 29 + .../Enum/SequentialGuidType.cs | 26 + .../Enum/TimestampType.cs | 10 + .../IConnectionStringProvider.cs | 21 + .../IDbConnectionStringProvider.cs | 9 + .../IDistributedLock.cs | 11 + .../IMasaDbContext.cs | 8 + .../IdGenerator/IGuidGenerator.cs | 8 + .../IdGenerator/IIdGenerator.cs | 11 + .../IdGenerator/ISequentialGuidGenerator.cs | 9 + .../IdGenerator/ISnowflakeGenerator.cs | 8 + .../IdGenerator/IdGeneratorFactory.cs | 36 + .../Masa.BuildingBlocks.Data.csproj | 13 + .../Options/MasaDbConnectionOptions.cs | 21 + .../MasaDbContextConfigurationOptions.cs | 11 + .../System/SequentialGuid.cs | 9 + .../System/Snowflake.cs | 9 + .../Data/Masa.BuildingBlocks.Data/_Imports.cs | 5 + .../Entities/AggregateRoot.cs | 80 + .../Entities/Auditing/AuditAggregateRoot.cs | 54 + .../Entities/Auditing/AuditEntity.cs | 54 + .../Entities/Auditing/IAuditAggregateRoot.cs | 14 + .../Entities/Auditing/IAuditEntity.cs | 19 + .../Entities/Entity.cs | 78 + .../Entities/Full/FullAggregateRoot.cs | 24 + .../Entities/Full/FullEntity.cs | 24 + .../Entities/Full/IFullAggregateRoot.cs | 14 + .../Entities/Full/IFullEntity.cs | 14 + .../Entities/IAggregateRoot.cs | 14 + .../Entities/IEntity.cs | 14 + .../Entities/IGenerateDomainEvents.cs | 11 + .../Events/DomainCommand.cs | 29 + .../Events/DomainEvent.cs | 29 + .../Events/DomainQuery.cs | 36 + .../Events/IDomainCommand.cs | 9 + .../Events/IDomainEvent.cs | 9 + .../Events/IDomainEventBus.cs | 14 + .../Events/IDomainQuery.cs | 10 + .../Events/IIntegrationDomainEvent.cs | 9 + .../Events/IntegrationDomainEvent.cs | 12 + .../Masa.BuildingBlocks.Ddd.Domain.csproj | 16 + .../Repositories/BaseRepository.cs | 163 ++ .../Repositories/IRepository.cs | 132 + .../Repositories/PaginatedList.cs | 9 + .../Repositories/PaginatedOptions.cs | 36 + .../SeedWork/Enumeration.cs | 72 + .../Services/IDomainService.cs | 9 + .../Specifications/BaseSpecification.cs | 30 + .../Specifications/ISpecification.cs | 20 + .../Values/ValueObject.cs | 38 + .../_Imports.cs | 16 + .../Event.cs | 26 + .../IDispatcherOptions.cs | 11 + .../IEvent.cs | 21 + .../IEventBus.cs | 14 + .../IEventBusBuilder.cs | 11 + .../IEventHandler.cs | 10 + .../IMiddleware.cs | 21 + .../ISagaEventHandler.cs | 10 + ...sa.BuildingBlocks.Dispatcher.Events.csproj | 13 + .../Middleware.cs | 11 + .../_Imports.cs | 5 + .../IDistributedDispatcherOptions.cs | 8 + .../IIntegrationEvent.cs | 8 + .../IIntegrationEventBus.cs | 9 + .../ITopic.cs | 9 + .../IntegrationEvent.cs | 32 + .../IntegrationEventStates.cs | 12 + .../Logs/IIntegrationEventLogService.cs | 33 + .../Logs/IntegrationEventLog.cs | 72 + ...Blocks.Dispatcher.IntegrationEvents.csproj | 14 + .../_Imports.cs | 9 + .../DefaultTypeConvertProvider.cs | 15 + .../Entities/IIdentityUser.cs | 13 + .../Entities/IdentityRole.cs | 11 + .../Entities/IdentityUser.cs | 13 + .../Isolation/IIsolatedIdentityUser.cs | 8 + .../IMultiEnvironmentIdentityUser.cs | 9 + .../Isolation/IMultiTenantIdentityUser.cs | 9 + .../Isolation/IsolatedIdentityUser.cs | 9 + .../Isolation/MultiEnvironmentIdentityUser.cs | 9 + .../Isolation/MultiTenantIdentityUser.cs | 9 + .../Enum/IdentityType.cs | 23 + .../IIsolatedUserContext.cs | 10 + .../IMultiEnvironmentUserContext.cs | 9 + .../IMultiTenantUserContext.cs | 11 + .../ITypeConvertProvider.cs | 9 + .../IUserContext.cs | 19 + .../IUserSetter.cs | 9 + .../Internal/DisposeAction.cs | 17 + ...ildingBlocks.Identity.IdentityModel.csproj | 9 + .../UserContext.cs | 56 + .../_Imports.cs | 5 + .../Environment/IEnvironmentContext.cs | 9 + .../Environment/IEnvironmentSetter.cs | 9 + .../Environment/IMultiEnvironment.cs | 12 + .../IConvertProvider.cs | 9 + .../IIsolation.cs | 13 + .../IIsolationBuilder.cs | 9 + .../IParserProvider.cs | 11 + .../Masa.BuildingBlocks.Isolation.csproj | 18 + .../Middleware/IIsolationMiddleware.cs | 9 + .../MultiTenant/IMultiTenant.cs | 16 + .../MultiTenant/ITenantContext.cs | 9 + .../MultiTenant/ITenantSetter.cs | 9 + .../MultiTenant/Tenant.cs | 21 + .../Options/IsolationDbConnectionOptions.cs | 9 + .../Options/IsolationOptions.cs | 20 + .../Parser/CookieParserProvider.cs | 25 + .../EnvironmentVariablesParserProvider.cs | 20 + .../Parser/FormParserProvider.cs | 27 + .../Parser/HeaderParserProvider.cs | 25 + .../Parser/HttpContextItemParserProvider.cs | 25 + .../Parser/QueryStringParserProvider.cs | 24 + .../Parser/RouteParserProvider.cs | 22 + .../Masa.BuildingBlocks.Isolation/_Imports.cs | 9 + .../Commands/Command.cs | 29 + .../Commands/ICommand.cs | 8 + .../Commands/ICommandHandler.cs | 9 + ...ildingBlocks.ReadWriteSpliting.Cqrs.csproj | 14 + .../Queries/IQuery.cs | 9 + .../Queries/IQueryHandler.cs | 9 + .../Queries/Query.cs | 29 + .../_Imports.cs | 6 + ...cks.ReadWriteSpliting.EventSourcing.csproj | 9 + .../AutoCompleteDocument.cs | 80 + .../BaseAutoCompleteClient.cs | 96 + .../IAutoCompleteClient.cs | 80 + .../IAutoCompleteFactory.cs | 11 + ...ingBlocks.SearchEngine.AutoComplete.csproj | 9 + .../Options/AutoCompleteOptions.cs | 47 + .../Options/SetOptions.cs | 14 + .../Response/DeleteMultiResponse.cs | 20 + .../Response/DeleteRangeResponseItems.cs | 20 + .../Response/DeleteResponse.cs | 11 + .../Response/GetResponse.cs | 25 + .../Response/ResponseBase.cs | 17 + .../Response/SetResponse.cs | 13 + .../Response/SetResponseItems.cs | 20 + .../SearchType.cs | 10 + .../_Imports.cs | 6 + .../AbstractCaller.cs | 391 +++ .../AddCallerExtensions.cs | 15 + .../CallerBase.cs | 31 + .../ICaller.cs | 219 ++ .../ICallerFactory.cs | 11 + .../IRequestMessage.cs | 11 + .../IResponseMessage.cs | 11 + .../ITypeConvertor.cs | 24 + .../Masa.BuildingBlocks.Service.Caller.csproj | 14 + .../Masa.Utils.Caller.Core.csproj | 19 + .../Options/CallerFactoryOptions.cs | 13 + .../Options/CallerOptions.cs | 36 + .../Options/CallerRelationOptions.cs | 20 + .../_Imports.cs | 8 + .../BaseMessage.cs | 14 + .../BaseRequest.cs | 8 + .../BaseResponse.cs | 30 + ...sa.BuildingBlocks.Service.Contracts.csproj | 9 + .../IService.cs | 15 + ....BuildingBlocks.Service.MinimalAPIs.csproj | 14 + .../_Imports.cs | 5 + .../BucketNameAttribute.cs | 24 + .../BucketNames.cs | 26 + .../DefaultClientContainer.cs | 51 + .../DefaultClientFactory.cs | 19 + .../IBucketNameProvider.cs | 11 + .../IClient.cs | 54 + .../IClientContainer.cs | 53 + .../IClientFactory.cs | 9 + ...uildingBlocks.Storage.ObjectStorage.csproj | 13 + .../Response/TemporaryCredentialsResponse.cs | 23 + .../StorageOptions.cs | 19 + .../_Imports.cs | 6 + ....BuildingBlocks.Configuration.Tests.csproj | 22 + .../TestProperties.cs | 66 + .../_Imports.cs | 4 + ...asa.BuildingBlocks.Ddd.Domain.Tests.csproj | 21 + .../TestEntity.cs | 64 + .../TestValueObject.cs | 52 + .../_Imports.cs | 5 + .../CustomAutoCompleteClient.cs | 28 + ...cks.SearchEngine.AutoComplete.Tests.csproj | 21 + .../TestAutoCompleteClient.cs | 28 + .../_Imports.cs | 6 + src/Contrib/Directory.Build.props | 21 + src/Contrib/README.md | 105 + src/Contrib/README.zh-CN.md | 104 + {docs => src/Contrib/docs}/LoadEvent.md | 0 ...b.Authentication.Oidc.Cache.Storage.csproj | 2 +- .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../Stores/ClientStore.cs | 0 .../Stores/DeviceFlowStore.cs | 0 .../Stores/PersistedGrantStore.cs | 0 .../Stores/ResourceStore.cs | 0 .../_Imports.cs | 0 .../Caches/ApiResourceCache.cs | 0 .../Caches/ApiScopeCache.cs | 0 .../Caches/ClientCache.cs | 0 .../Caches/IdentityResourceCache.cs | 0 ...a.Contrib.Authentication.Oidc.Cache.csproj | 2 +- .../Models/CacheKeyConstants.cs | 0 .../Models/Mapper.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../Utils/CollectionExtensions.cs | 0 .../_Imports.cs | 0 .../Caches/SyncCache.cs | 0 .../DbContexts/OidcDbContext.cs | 0 ...ApiResourceClaimEntityTypeConfiguration.cs | 0 .../ApiResourceEntityTypeConfiguration.cs | 0 ...ResourcePropertyEntityTypeConfiguration.cs | 0 ...ApiResourceScopeEntityTypeConfiguration.cs | 0 ...piResourceSecretEntityTypeConfiguration.cs | 0 .../ApiScopeClaimEntityTypeConfiguration.cs | 0 .../ApiScopeEntityTypeConfiguration.cs | 0 ...ApiScopePropertyEntityTypeConfiguration.cs | 0 .../ClientClaimEntityTypeConfiguration.cs | 0 ...ClientCorsOriginEntityTypeConfiguration.cs | 0 .../ClientEntityTypeConfiguration.cs | 0 .../ClientGrantTypeEntityTypeConfiguration.cs | 0 ...ntIdPRestrictionEntityTypeConfiguration.cs | 0 ...ogoutRedirectUriEntityTypeConfiguration.cs | 0 .../ClientPropertyEntityTypeConfiguration.cs | 0 ...lientRedirectUriEntityTypeConfiguration.cs | 0 .../ClientScopeEntityTypeConfiguration.cs | 0 .../ClientSecretEntityTypeConfiguration.cs | 0 .../DeviceFlowCodesEntityTypeConfiguration.cs | 0 ...ityResourceClaimEntityTypeConfiguration.cs | 0 ...IdentityResourceEntityTypeConfiguration.cs | 0 ...ResourcePropertyEntityTypeConfiguration.cs | 0 .../PersistedGrantEntityTypeConfiguration.cs | 0 .../UserClaimEntityTypeConfiguration.cs | 0 ...entication.Oidc.EntityFrameworkCore.csproj | 4 +- .../Options/OidcDbContextOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../Repositories/ApiResourceRepository.cs | 0 .../Repositories/ApiScopeRepository.cs | 0 .../Repositories/ClientRepository.cs | 0 .../IdentityResourceRepository.cs | 0 .../Repositories/UserClaimRepository.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../AuthClient.cs | 0 .../Constants.cs | 0 .../EnvironmentProvider.cs | 0 .../HttpEnvironmentDelegatingHandler.cs | 0 .../Masa.Contrib.BasicAbility.Auth.csproj | 5 +- .../Masa.Contrib.BasicAbility.Auth/README.md | 0 .../README.zh-CN.md | 0 .../Service/PermissionService.cs | 0 .../Service/ProjectService.cs | 0 .../Service/SubjectService.cs | 0 .../Service/TeamService.cs | 0 .../Service/UserService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../DccClient.cs | 0 .../Internal/Constants.cs | 0 .../Masa.Contrib.BasicAbility.Dcc.csproj | 2 +- .../Masa.Contrib.BasicAbility.Dcc/README.md | 0 .../README.zh-CN.md | 0 .../Service/LabelService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.BasicAbility.Dcc/_Imports.cs | 0 .../Masa.Contrib.BasicAbility.Mc/Constants.cs | 0 ...ttpClientAuthorizationDelegatingHandler.cs | 0 .../Extensions/DictionaryExtensions.cs | 0 .../Extensions/ExtraPropertiesExtensions.cs | 0 .../Infrastructure/Helper/TypeHelper.cs | 0 .../Masa.Contrib.BasicAbility.Mc.csproj | 4 +- .../Masa.Contrib.BasicAbility.Mc/McClient.cs | 0 .../Service/ChannelService.cs | 0 .../Service/MessageTaskService.cs | 0 .../Service/MessageTemplateService.cs | 0 .../Service/ReceiverGroupService.cs | 0 .../Service/WebsiteMessageService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.BasicAbility.Mc/_Imports.cs | 0 .../Masa.Contrib.BasicAbility.Pm/Constants.cs | 0 .../Masa.Contrib.BasicAbility.Pm.csproj | 2 +- .../Masa.Contrib.BasicAbility.Pm/PmClient.cs | 0 .../Masa.Contrib.BasicAbility.Pm/README.md | 0 .../README.zh-CN.md | 0 .../Service/AppService.cs | 0 .../Service/ClusterService.cs | 0 .../Service/EnvironmentService.cs | 0 .../Service/ProjectService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.BasicAbility.Pm/_Imports.cs | 0 .../Constants.cs | 0 ...ttpClientAuthorizationDelegatingHandler.cs | 0 ...Masa.Contrib.BasicAbility.Scheduler.csproj | 6 +- .../README.md | 0 .../README.zh-CN.md | 0 .../SchedulerClient.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Services/SchedulerJobService.cs | 0 .../Services/SchedulerTaskService.cs | 0 .../_Imports.cs | 0 .../Extensions/CallerProviderExtensions.cs | 0 .../Extensions/ServiceExtensions.cs | 0 .../Extensions/StreamExtensions.cs | 0 .../Logging/OpenTelemetryLoggingExtensions.cs | 0 .../Masa.Contrib.BasicAbility.Tsc.csproj | 2 +- .../MasaObservableOptions.cs | 0 .../Metrics/MasaServiceExtensions.cs | 0 .../OpenTelemetryAttributeName.cs | 0 .../OpenTemetry/ResourceBuilderExtenstions.cs | 0 .../Masa.Contrib.BasicAbility.Tsc/README.md | 0 .../README.zh-CN.md | 0 .../Service/LogService.cs | 0 .../Service/MetricService.cs | 0 .../Tracing/ActivityExtensions.cs | 0 ...NetCoreInstrumentationOptionsExtensions.cs | 0 .../Tracing/MasaServiceExtensions.cs | 0 .../OpenTelemetryInstrumentationOptions.cs | 0 .../TscClient.cs | 0 .../Masa.Contrib.BasicAbility.Tsc/_Imports.cs | 0 .../ConfigurationApiClient.cs | 0 .../ConfigurationApiExtensions.cs | 0 .../ConfigurationApiManage.cs | 0 .../Internal/ConfigFormats.cs | 0 .../Internal/ConfigurationApiBase.cs | 0 .../Internal/Constants.cs | 0 .../Internal/DccConfigurationRepository.cs | 0 .../Internal/DccFactory.cs | 0 .../Internal/Model/Property.cs | 0 .../Internal/Model/PublishRelease.cs | 0 .../Internal/Model/StaticConfig.cs | 0 .../Internal/Options/DccOptions.cs | 0 .../Parser/JsonConfigurationParser.cs | 0 .../Parser/PropertyConfigurationParser.cs | 0 .../Internal/Parser/XmlConfigurationParser.cs | 0 ....Configuration.ConfigurationApi.Dcc.csproj | 2 +- .../MasaConfigurationExtensions.cs | 0 ...onfigurationApiMasaConfigurationOptions.cs | 0 .../Options/DccConfigurationOptions.cs | 0 .../Options/DccExpandSectionOptions.cs | 0 .../Options/DccSectionOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../ConfigurationOptions.cs | 0 .../DefaultConfigurationApi.cs | 0 .../DefaultMasaConfiguration.cs | 0 .../DefaultMasaConfigurationSourceProvider.cs | 0 .../IMasaConfigurationSourceProvider.cs | 0 .../Internal/ConfigurationExtensions.cs | 0 .../LocalMasaConfigurationOptions.cs | 0 .../LocalMasaConfigurationRepository.cs | 0 .../Masa.Contrib.Configuration.csproj | 2 +- .../MasaConfigurationBuilder.cs | 0 .../MasaConfigurationExtensions.cs | 0 .../MasaConfigurationProvider.cs | 0 .../MasaConfigurationSource.cs | 0 .../MasaRelationOptions.cs | 0 .../Masa.Contrib.Configuration/README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../WebApplicationBuilderExtensions.cs | 0 .../Masa.Contrib.Configuration/_Imports.cs | 0 .../DefaultLocalDistributedLock.cs | 0 .../ArgumentNullOrWhiteSpaceException.cs | 0 .../Internal/DisposeAction.cs | 0 ....Contrib.Data.DistributedLock.Local.csproj | 2 +- .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 ...ata.DistributedLock.Medallion.Azure.csproj | 0 .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...istributedLock.Medallion.FileSystem.csproj | 0 .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...ata.DistributedLock.Medallion.MySql.csproj | 4 +- .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...ta.DistributedLock.Medallion.Oracle.csproj | 2 +- .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...istributedLock.Medallion.PostgreSql.csproj | 2 +- .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../ConfigurationOptionsExtensions.cs | 0 ...ata.DistributedLock.Medallion.Redis.csproj | 0 .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...DistributedLock.Medallion.SqlServer.csproj | 2 +- .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...stributedLock.Medallion.WaitHandles.csproj | 0 .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...DistributedLock.Medallion.ZooKeeper.csproj | 0 .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../DefaultMedallionDistributedLock.cs | 0 .../ArgumentNullOrWhiteSpaceException.cs | 0 .../Internal/DisposeAction.cs | 0 ...trib.Data.DistributedLock.Medallion.csproj | 2 +- .../MedallionBuilder.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../Internal/Parser.cs | 0 ...rib.Data.EntityFrameworkCore.Cosmos.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...b.Data.EntityFrameworkCore.InMemory.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...trib.Data.EntityFrameworkCore.MySql.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...rib.Data.EntityFrameworkCore.Oracle.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...ta.EntityFrameworkCore.Pomelo.MySql.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...Data.EntityFrameworkCore.PostgreSql.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ....Data.EntityFrameworkCore.SqlServer.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...rib.Data.EntityFrameworkCore.Sqlite.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../DbConnectionStringProvider.cs | 0 .../DefaultConnectionStringProvider.cs | 0 .../EntityTypeBuilderExtensions.cs | 0 .../Filters/ISaveChangesFilter.cs | 0 .../Filters/SaveChangeFilter.cs | 0 .../IModelCreatingProvider.cs | 0 ...sa.Contrib.Data.EntityFrameworkCore.csproj | 24 + .../MasaDbContext.cs | 0 .../MasaDbContextBuilder.cs | 0 .../MasaDbContextOptions.cs | 0 .../MasaDbContextOptionsBuilder.cs | 0 .../MasaDbContextOptionsBuilder`.cs | 0 .../MasaDbContextOptions`.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 ...Contrib.Data.IdGenerator.NormalGuid.csproj | 4 +- .../NormalGuidGenerator.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 ...rib.Data.IdGenerator.SequentialGuid.csproj | 4 +- .../README.md | 0 .../README.zh-CN.md | 0 .../SequentialGuidGenerator.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../BaseRedis.cs | 0 .../DistributedIdGeneratorOptions.cs | 0 .../DistributedWorkerProvider.cs | 0 .../IdGeneratorOptionsExtensions.cs | 0 .../Internal/SnowflakeExtensions.cs | 0 .../MachineClockIdGenerator.cs | 0 ...nerator.Snowflake.Distributed.Redis.csproj | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../BaseIdGenerator.cs | 0 .../DefaultWorkerProvider.cs | 0 .../IWorkerProvider.cs | 0 .../IdGeneratorOptions.cs | 0 .../Internal/Const.cs | 0 .../Internal/EnironmentExtensions.cs | 0 .../Internal/SnowflakeExtensions.cs | 0 .../Internal/SnowflakeIdGenerator.cs | 0 .../Internal/WorkerIdBackgroundServices.cs | 0 .../MachineClockIdGenerator.cs | 0 ....Contrib.Data.IdGenerator.Snowflake.csproj | 2 +- .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../DefaultMapper.cs | 0 .../DefaultMappingConfigProvider.cs | 0 .../IMappingConfigProvider.cs | 0 .../Internal/InvokeBuilder.cs | 0 .../Internal/Options/MapTypeOptions.cs | 0 .../Internal/TypeAdapterSetterExpand.cs | 0 .../Masa.Contrib.Data.Mapping.Mapster.csproj | 2 +- .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../DataFiltering/DataFilter.cs | 0 .../SoftDeleteSaveChangesFilter.cs | 0 .../Internal/DataFilterState.cs | 0 .../Internal/DisposeAction.cs | 0 .../Internal/InstanceBuilder.cs | 0 .../Internal/NullDisposable.cs | 0 .../Masa.Contrib.Data.Contracts.EF.csproj | 7 +- .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../Options/FilterOptions.cs | 0 .../_Imports.cs | 0 .../DefaultConnectionStringProvider.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../Internal/Const.cs | 0 .../Masa.Contrib.Data.UoW.EF.csproj | 20 + .../Data/Masa.Contrib.Data.UoW.EF/README.md | 0 .../Masa.Contrib.Data.UoW.EF/README.zh-CN.md | 0 .../Masa.Contrib.Data.UoW.EF/Transaction.cs | 0 .../Masa.Contrib.Data.UoW.EF/UnitOfWork.cs | 0 .../UnitOfWorkAccessor.cs | 0 .../UnitOfWorkManager.cs | 0 .../Data/Masa.Contrib.Data.UoW.EF/_Imports.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../Internal/LinqExtensions.cs | 0 .../ServiceCollectionRepositoryExtensions.cs | 0 .../Internal/TypeExtensions.cs | 0 ...sa.Contrib.Ddd.Domain.Repository.EF.csproj | 2 +- .../README.md | 0 .../README.zh-CN.md | 0 .../Repository.cs | 0 .../_Imports.cs | 0 .../Masa.Contrib.Ddd.Domain/DomainEventBus.cs | 0 .../Masa.Contrib.Ddd.Domain/DomainService.cs | 0 .../Masa.Contrib.Ddd.Domain.csproj | 2 +- .../Options/DispatcherOptions.cs | 0 .../Ddd/Masa.Contrib.Ddd.Domain/README.md | 0 .../Masa.Contrib.Ddd.Domain/README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../Ddd/Masa.Contrib.Ddd.Domain/_Imports.cs | 0 .../DefaultExceptionStrategyProvider.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../Enums/FailureLevels.cs | 0 .../EventBus.cs | 0 .../EventBusBuilder.cs | 0 .../EventHandlerAttribute.cs | 0 .../IExceptionStrategyProvider.cs | 0 .../IInitializeServiceProvider.cs | 0 .../Dispatch/DispatchRelationNetwork.cs | 0 .../Internal/Dispatch/Dispatcher.cs | 0 .../Internal/Dispatch/DispatcherBase.cs | 0 .../Internal/Dispatch/SagaDispatcher.cs | 0 .../Internal/DispatcherExtensions.cs | 0 .../Internal/Expressions/InvokeBuilder.cs | 0 .../Internal/InitializeServiceProvider.cs | 0 .../Middleware/TransactionMiddleware.cs | 0 .../Masa.Contrib.Dispatcher.Events.csproj | 6 +- .../Options/DispatchRelationOptions.cs | 0 .../Options/DispatcherOptions.cs | 0 .../Masa.Contrib.Dispatcher.Events/README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../Strategies/ExecutionStrategy.cs | 0 .../Strategies/IExecutionStrategy.cs | 0 .../Strategies/StrategyOptions.cs | 0 .../_Imports.cs | 0 .../DispatcherOptionsExtensions.cs | 0 ...b.Dispatcher.IntegrationEvents.Dapr.csproj | 0 .../Options/DispatcherOptions.cs | 0 .../Publisher.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../IntegrationEventLogContext.cs | 0 ...egrationEventLogEntityTypeConfiguration.cs | 0 ...ntegrationEventLogModelCreatingProvider.cs | 0 .../IntegrationEventLogService.cs | 0 ...cher.IntegrationEvents.EventLogs.EF.csproj | 4 +- .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../IProcessingServer.cs | 0 .../IProcessor.cs | 0 .../IPublisher.cs | 0 .../IntegrationEventBus.cs | 0 .../IntegrationEventHostedService.cs | 0 .../Internal/IntegrationEventLogItem.cs | 0 .../Internal/LocalQueueProcessor.cs | 0 ...ontrib.Dispatcher.IntegrationEvents.csproj | 5 +- .../Options/DispatcherOptions.cs | 0 .../DeleteLocalQueueExpiresProcessor.cs | 0 .../DeletePublishedExpireEventProcessor.cs | 0 .../Processor/InfiniteLoopProcessor.cs | 0 .../Processor/ProcessorBase.cs | 0 .../Processor/RetryByDataProcessor.cs | 0 .../Processor/RetryByLocalQueueProcessor.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../Servers/DefaultHostedService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../ClaimExtensions.cs | 0 .../Const/ClaimType.cs | 0 .../DefaultIsolatedUserContext.cs | 0 .../DefaultMultiEnvironmentUserContext.cs | 0 .../DefaultMultiTenantUserContext.cs | 0 .../DefaultUserContext.cs | 0 .../HttpContextCurrentPrincipalAccessor.cs | 0 .../ICurrentPrincipalAccessor.cs | 0 .../IdentityClaimOptions.cs | 0 ...Masa.Contrib.Identity.IdentityModel.csproj | 2 +- .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../ThreadCurrentPrincipalAccessor.cs | 0 .../_Imports.cs | 0 .../EnvironmentContext.cs | 0 .../IsolationBuilderExtensions.cs | 0 ....Contrib.Isolation.MultiEnvironment.csproj | 14 + .../Middleware/MultiEnvironmentMiddleware.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../ConvertProvider.cs | 0 .../IsolationBuilderExtensions.cs | 0 .../Masa.Contrib.Isolation.MultiTenant.csproj | 14 + .../Middleware/MultiTenantMiddleware.cs | 0 .../MultiTenantOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../TenantContext.cs | 0 .../_Imports.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../Internal/TypeExtensions.cs | 0 .../IsolationDbContext.cs | 0 .../IsolationSaveChangesFilter.cs | 0 .../Masa.Contrib.Isolation.UoW.EF.csproj | 1 - .../Masa.Contrib.Isolation.UoW.EF/README.md | 0 .../README.zh-CN.md | 0 .../Masa.Contrib.Isolation.UoW.EF/_Imports.cs | 0 ...efaultIsolationConnectionStringProvider.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../IsolationBuilder.cs | 0 .../IsolationBuilderExtensions.cs | 0 .../IsolationDbContextProvider.cs | 0 .../Masa.Contrib.Isolation.csproj | 21 + .../Middleware/IsolationMiddleware.cs | 0 .../Masa.Contrib.Isolation/README.md | 0 .../Masa.Contrib.Isolation/README.zh-CN.md | 0 .../Masa.Contrib.Isolation/_Imports.cs | 0 .../Commands/CommandHandler.cs | 0 ...Masa.Contrib.ReadWriteSpliting.Cqrs.csproj | 3 +- .../Queries/QueryHandler.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../AutoCompleteClient.cs | 0 .../AutoCompleteFactory.cs | 0 ...chEngine.AutoComplete.ElasticSearch.csproj | 2 +- .../Options/AutoCompleteOptions.cs | 0 .../Options/AutoCompleteRelationsOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../CallerOptionsExtensions.cs | 0 .../DaprCaller.cs | 0 .../DaprCallerBase.cs | 0 .../DefaultDaprClientBuilder.cs | 0 .../HttpMessageHandlerBuilder.cs | 0 .../IDaprRequestMessage.cs | 0 ...a.Contrib.Service.Caller.DaprClient.csproj | 2 +- .../MasaDaprClientBuilder.cs | 0 .../MasaDaprClientBuilderExtensions.cs | 0 .../Options/CallerDaprClientOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../CallerOptionsExtensions.cs | 0 .../HttpClientCaller.cs | 0 .../HttpClientCallerBase.cs | 0 ...a.Contrib.Service.Caller.HttpClient.csproj | 4 +- .../MasaHttpClientBuilder.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../DefaultCallerFactory.cs | 0 .../DefaultRequestMessage.cs | 0 .../DefaultResponseMessage.cs | 0 .../DefaultTypeConvertor.cs | 0 .../Internal/CallerDependExtensions.cs | 0 .../Internal/ErrorMessages.cs | 0 .../Internal/Options/PropertyInfoMember.cs | 0 .../Internal/XmlUtils.cs | 0 .../JsonRequestMessage.cs | 0 .../Masa.Contrib.Service.Caller.csproj | 6 +- .../Masa.Contrib.Service.Caller/README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../XmlRequestMessage.cs | 0 .../Masa.Contrib.Service.Caller/_Imports.cs | 0 .../Masa.Contrib.Service.MinimalAPIs.csproj | 2 +- .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceBase.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../BaseClient.cs | 0 .../BucketNameProvider.cs | 0 .../DefaultCredentialProvider.cs | 0 .../DefaultOssClientFactory.cs | 0 .../DefaultStorageClient.cs | 0 .../IAliyunStorageOptionProvider.cs | 0 .../ICredentialProvider.cs | 0 .../IOssClientFactory.cs | 0 .../Internal/Const.cs | 0 .../DefaultAliyunStorageOptionProvider.cs | 0 .../Internal/ObjectStorageExtensions.cs | 0 .../Internal/Response/UploadObjectResponse.cs | 0 ...ontrib.Storage.ObjectStorage.Aliyun.csproj | 4 +- .../Options/AliyunOptions.cs | 0 .../Options/AliyunStorageConfigureOptions.cs | 0 .../Options/AliyunStorageOptions.cs | 0 .../Options/AliyunStsOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../AuthClientTest.cs | 0 ...asa.Contrib.BasicAbility.Auth.Tests.csproj | 27 + .../PermissionServiceTest.cs | 0 .../ProjectServiceTest.cs | 0 .../SubjectServiceTest.cs | 0 .../TeamServiceTest.cs | 0 .../UserServiceTest.cs | 0 .../_Imports.cs | 0 .../DccClientTest.cs | 0 .../LabelServiceTest.cs | 0 ...Masa.Contrib.BasicAbility.Dcc.Tests.csproj | 6 +- .../_Imports.cs | 0 .../appsettings.json | 0 .../ChannelServiceTest.cs | 0 .../Masa.Contrib.BasicAbility.Mc.Tests.csproj | 5 +- .../McClientTest.cs | 0 .../MessageTaskServiceTest.cs | 0 .../MessageTemplateServiceTest.cs | 0 .../ReceiverGroupServiceTest.cs | 0 .../WebsiteMessageServiceTest.cs | 0 .../_Imports.cs | 0 .../AppServiceTest.cs | 0 .../ClusterServiceTest.cs | 0 .../EnvironmentServiceTest.cs | 0 .../Masa.Contrib.BasicAbility.Pm.Tests.csproj | 5 +- .../PmClientTest.cs | 0 .../ProjectServiceTest.cs | 0 .../_Imports.cs | 0 ...ontrib.BasicAbility.Scheduler.Tests.csproj | 5 +- .../SchedulerClientTest.cs | 0 .../SchedulerJobServiceTest.cs | 0 .../SchedulerTaskServiceTest.cs | 0 .../_Imports.cs | 0 .../CallerProviderExtensionsTests.cs | 0 ...Masa.Contrib.BasicAbility.Tsc.Tests.csproj | 4 +- .../Service/LogServiceTests.cs | 0 .../Service/MetricServiceTests.cs | 0 .../_Imports.cs | 0 .../EsOptions.cs | 0 ...AutoMap.NoArgumentConstructor.Tests.csproj | 2 +- .../CustomMemoryCacheClientFactory.cs | 0 .../DccClientTest.cs | 0 .../DccManageTest.cs | 0 .../DccTest.cs | 0 .../Internal/Common/SerializeCommon.cs | 0 .../Internal/Config/Property.cs | 0 .../Internal/Config/PublishRelease.cs | 0 .../Internal/CustomConfigurationApiClient.cs | 0 .../Internal/CustomTrigger.cs | 0 .../Internal/Enum/ConfigFormats.cs | 0 .../Internal/Model/Brands.cs | 0 ...guration.ConfigurationApi.Dcc.Tests.csproj | 4 +- .../_Imports.cs | 0 .../appsettings.json | 0 .../expandSections.json | 0 .../KafkaOptions.cs | 0 ...iguration.ErrorSectionAutoMap.Tests.csproj | 2 +- ...tion.MountErrorSectionAutoMap.Tests.csproj | 2 +- .../MountSectionRedisOptions.cs | 0 .../_Imports.cs | 0 .../Config/RabbitMqOptions.cs | 0 .../Config/RedisOptions.cs | 0 .../Config/SystemOptions.cs | 0 .../ConfigurationTest.cs | 0 .../Masa.Contrib.Configuration.Tests.csproj | 18 +- .../_Imports.cs | 0 .../appsettings.json | 0 .../customAppConfig.json | 0 .../rabbitMq.json | 0 .../redis.json | 0 .../LocalDistributedLockTest.cs | 0 ...ib.Data.DistributedLock.Local.Tests.csproj | 21 + .../_Imports.cs | 0 .../DefaultMedallionDistributedLockTest.cs | 0 ...ata.DistributedLock.Medallion.Tests.csproj | 21 + .../_Imports.cs | 0 ...ta.IdGenerator.SequentialGuid.Tests.csproj | 20 + .../SequentialGuidGeneratorTest.cs | 0 .../_Imports.cs | 0 .../Benchmarks.cs | 0 .../DistributedBenchmarks.cs | 0 ...tor.Snowflake.BenchmarkDotnet.Tests.csproj | 3 +- .../Program.cs | 0 .../_Imports.cs | 0 .../CustomDistributedWorkerProvider.cs | 0 .../IdGeneratorTest.cs | 0 ...ib.Data.IdGenerator.Snowflake.Tests.csproj | 3 +- .../_Imports.cs | 0 .../BaseMappingTest.cs | 0 .../Domain/Aggregates/Orders/Order.cs | 0 .../Domain/Aggregates/Orders/OrderItem.cs | 0 .../Domain/Aggregates/Users/User.cs | 0 .../Domain/ValueObjects/AddressItem.cs | 0 .../MappingExtensionsTest.cs | 0 .../MappingFormTest.cs | 0 .../MappingTest.cs | 0 ....Contrib.Data.Mapping.Mapster.Tests.csproj | 4 +- .../Requests/AddressItemRequest.cs | 0 .../Requests/Orders/OrderItemRequest.cs | 0 .../Requests/Orders/OrderMultiRequest.cs | 0 .../Requests/Orders/OrderRequest.cs | 0 .../Requests/Users/CreateFullUserRequest.cs | 0 .../Requests/Users/CreateUserRequest.cs | 0 .../_Imports.cs | 0 .../DataFilterTest.cs | 0 ...asa.Contrib.Data.Contracts.EF.Tests.csproj | 2 +- .../_Imports.cs | 0 .../CustomDbContext.cs | 0 .../DbContextTest.cs | 0 .../DefaultConnectionStringProviderTest.cs | 0 .../Internal/PaginatedOptions.cs | 0 .../Internal/Repository.cs | 0 ...trib.Data.EntityFrameworkCore.Tests.csproj | 7 +- .../Models/Address.cs | 0 .../Models/Hobby.cs | 0 .../Models/Student.cs | 0 .../TestBase.cs | 0 .../_Imports.cs | 0 .../CustomDbContext.cs | 0 .../Masa.Contrib.Data.UoW.EF.Tests.csproj | 12 +- .../TestBase.cs | 0 .../TestUnitOfWork.cs | 0 .../_Imports.cs | 0 .../appsettings.json | 0 .../DomainEvents/RegisterUserDomainEvent.cs | 0 .../DomainEvents/UpdateUserDomainEvent.cs | 0 .../Events/RegisterUserEvent.cs | 0 ...a.Contrib.Ddd.Domain.Entities.Tests.csproj | 2 +- .../User.cs | 0 .../_Imports.cs | 0 .../CustomDbContext.cs | 0 .../DomainEventTest.cs | 0 .../Handlers/UserHandler.cs | 0 ...Contrib.Ddd.Domain.Integrated.Tests.csproj | 14 +- .../_Imports.cs | 0 .../Entities/User.cs | 0 ...epository.EF.CustomRepository.Tests.csproj | 14 + .../Repositories/IUserRepository.cs | 0 .../_Imports.cs | 0 .../BaseRepositoryTest.cs | 0 .../Domain/Entities/Address.cs | 0 .../Domain/Entities/OrderItem.cs | 0 .../Domain/Entities/Orders.cs | 0 .../Domain/Repositories/IOrderRepository.cs | 0 .../Infrastructure/CustomDbContext.cs | 0 .../Repositories/OrderRepository.cs | 0 ...trib.Ddd.Domain.Repository.EF.Tests.csproj | 6 +- .../RepositoryTest.cs | 0 .../TestBase.cs | 0 .../_Imports.cs | 0 .../DomainEventBusTest.cs | 0 .../DomainIntegrationEventBusTest.cs | 0 .../Events/AddUserIntegrationDomainEvent.cs | 0 .../Events/CreateProductDomainCommand.cs | 0 .../Events/CustomDomainCommand.cs | 0 .../Events/CustomDomainEvent.cs | 0 .../Events/ForgetPasswordEvent.cs | 0 .../PaymentFailedIntegrationDomainEvent.cs | 0 .../Events/PaymentSucceededDomainEvent.cs | 0 .../PaymentSucceededIntegraionDomainEvent.cs | 0 .../Events/ProductItemDomainQuery.cs | 0 ...sterUserSucceededDomainIntegrationEvent.cs | 0 .../PaymentSucceededDomainEventHandller.cs | 0 .../Masa.Contrib.Ddd.Domain.Tests.csproj | 4 +- .../Services/UserDomainService.cs | 0 .../Masa.Contrib.Ddd.Domain.Tests/_Imports.cs | 0 .../Benchmarks.cs | 0 .../AddShoppingCartEventHandler.cs | 0 .../Extensions/EventHandlers/CouponHandler.cs | 0 .../Extensions/Events/AddShoppingCartEvent.cs | 0 .../Extensions/Events/RegisterUserEvent.cs | 0 .../Middleware/LoggingMiddleware.cs | 0 ...atcher.Events.BenchmarkDotnet.Tests.csproj | 2 +- .../Program.cs | 0 .../_Imports.cs | 0 .../EventHandlers/AddGoodsHandler.cs | 0 .../Events/AddGoodsEvent.cs | 0 ....Events.CheckMethodsParameter.Tests.csproj | 4 +- .../_Imports.cs | 0 .../EventHandlers/DeleteGoodsHandler.cs | 0 .../Events/DeleteGoodsEvent.cs | 0 ....CheckMethodsParameterNotNull.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/AddCatalogHandler.cs | 0 .../Events/AddCatalogEvent.cs | 0 ...nts.CheckMethodsParameterType.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/AddBasketHandler.cs | 0 .../Events/AddBasketEvent.cs | 0 ...tcher.Events.CheckMethodsType.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/Handler.cs | 0 .../Events/CalculateEvent.cs | 0 ...ispatcher.Events.HandlerOrder.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/UserEventHandler.cs | 0 .../Events/BindPhoneNumberEvent.cs | 0 ...cher.Events.OnlyCancelHandler.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/EditCategoryHandler.cs | 0 .../Events/EditCategoryEvent.cs | 0 ...tcher.Events.OrderEqualBySaga.Tests.csproj | 2 +- .../_Imports.cs | 0 .../AssemblyResolutionTests.cs | 0 .../ChoreTest.cs | 0 .../CustomDbContext.cs | 0 .../ChangePasswordEventHandler.cs | 0 .../EventHandlers/CouponHandler.cs | 0 .../EventHandlers/MarketingEventHandler.cs | 0 .../OrderPaymentSucceededEventHandler.cs | 0 .../EventHandlers/RegisterUserEventHandler.cs | 0 .../EventHandlers/ShipOrderEventHandler.cs | 0 .../EventHandlers/ShoppingCardEventHandler.cs | 0 .../EventHandlers/TransferEventHandler.cs | 0 .../Events/AddShoppingCartEvent.cs | 0 .../Events/AddUserEvent.cs | 0 .../Events/ChangePasswordEvent.cs | 0 .../Events/ComputeEvent.cs | 0 .../Events/DeductionMoneyEvent.cs | 0 .../Events/IncreaseMoneyEvent.cs | 0 .../OrderPaymentFailedIntegrationEvent.cs | 0 .../Events/OrderPaymentSucceededEvent.cs | 0 .../Events/RegisterUserEvent.cs | 0 .../Events/SendCouponEvent.cs | 0 .../Events/ShipOrderEvent.cs | 0 .../Events/TransferEvent.cs | 0 .../FeaturesTest.cs | 0 ...asa.Contrib.Dispatcher.Events.Tests.csproj | 13 +- .../Middleware/LoggingMiddleware.cs | 0 .../SagaTest.cs | 0 .../TestBase.cs | 0 .../_Imports.cs | 0 .../DispatcherOptionTest.cs | 0 .../IntegrationEventBusTest.cs | 0 ...atcher.IntegrationEvents.Dapr.Tests.csproj | 3 +- .../ProcessorTest.cs | 0 .../_Imports.cs | 0 .../Domain/Entities/User.cs | 0 .../Events/IntegrationEvent.cs | 0 .../OrderPaymentSucceededIntegrationEvent.cs | 0 .../Infrastructure/CustomDbContext.cs | 0 .../IntegrationEventLogContextTest.cs | 0 .../IntegrationEventLogServiceTest.cs | 0 ...ntegrationEvents.EventLogs.EF.Tests.csproj | 4 +- .../TestBase.cs | 0 .../_Imports.cs | 0 .../BackgroundServiceTest.cs | 0 .../DispatcherOptionTest.cs | 0 .../Events/CreateUserEvent.cs | 0 .../Events/PaySuccessedIntegrationEvent.cs | 0 .../Events/RegisterUserIntegrationEvent.cs | 0 .../CustomIntegrationEventHostedService.cs | 0 .../CustomIntegrationEventLogService.cs | 0 .../Infrastructure/CustomProcessor.cs | 0 .../IntegrationEventBusTest.cs | 0 ....Dispatcher.IntegrationEvents.Tests.csproj | 2 +- .../ProcessorTest.cs | 0 .../_Imports.cs | 0 .../Command/RegisterUserCommand.cs | 0 .../Events/AddGoodsIntegrationEvent.cs | 0 .../Application/Events/RegisterUserEvent.cs | 0 .../Application/Queries/CheckUserQuery.cs | 0 .../Queries/CheckUserQueryValidator.cs | 0 .../Application/Queries/UserAgeQuery.cs | 0 .../Queries/UserAgeQueryValidator.cs | 0 .../Application/UserHandler.cs | 0 .../Domain/Aggregate/User.cs | 0 .../Infrastructure/CustomDbContext.cs | 0 .../Extensions/DefaultPublisher.cs | 0 .../Extensions/DispatcherOptionsExtensions.cs | 0 .../Middleware/RecordMiddleware.cs | 0 .../Middleware/ValidatorMiddleware.cs | 0 .../Masa.Contrib.Dispatcher.Tests.csproj | 35 + .../Masa.Contrib.Dispatcher.Tests/TestBase.cs | 0 .../TestDispatcher.cs | 0 .../Masa.Contrib.Dispatcher.Tests/_Imports.cs | 0 ...ontrib.Identity.IdentityModel.Tests.csproj | 2 +- .../TestIdentity.cs | 0 .../_Imports.cs | 0 ...ib.Isolation.MultiEnvironment.Tests.csproj | 2 +- .../TestEnvironment.cs | 0 .../TestMiddleware.cs | 0 .../_Imports.cs | 0 ...Contrib.Isolation.MultiTenant.Tests.csproj | 2 +- .../TestMiddleware.cs | 0 .../TestTenant.cs | 0 .../_Imports.cs | 0 .../Masa.Contrib.Isolation.Tests.csproj | 6 +- .../RequestCookieCollection.cs | 0 ...TestDbIsolationConnectionStringProvider.cs | 0 .../TestIsolation.cs | 0 .../TestParserProvider.cs | 0 .../UnitOfWorkAccessor.cs | 0 .../Masa.Contrib.Isolation.Tests/_Imports.cs | 0 .../CustomDbContext.cs | 0 ...Masa.Contrib.Isolation.UoW.EF.Tests.csproj | 18 +- .../TestBase.cs | 0 .../TestIsolation.cs | 0 .../_Imports.cs | 0 .../appsettings.json | 0 .../CustomDbContext.cs | 0 .../EdgeDriverTest.cs | 0 .../EventHandlers/AddRoleEventHandler.cs | 0 .../EventHandlers/RegisterUserEventHandler.cs | 0 .../Events/AddRoleEvent.cs | 0 .../Events/RegisterUserEvent.cs | 0 ....Contrib.Isolation.UoW.EF.Web.Tests.csproj | 18 +- .../TestBase.cs | 0 .../_Imports.cs | 0 .../appsettings.json | 0 .../Commands/CreateProductionCommand.cs | 0 .../CqrsTest.cs | 0 .../CreateProductionCommandHandler.cs | 0 ...ontrib.ReadWriteSpliting.Cqrs.Tests.csproj | 4 +- .../ProductionQueryHandler.cs | 0 .../Queries/ProductionItemQuery.cs | 0 .../_Imports.cs | 0 .../AutoCompleteTest.cs | 0 ...ne.AutoComplete.ElasticSearch.Tests.csproj | 2 +- .../Model/Employee.cs | 0 .../_Imports.cs | 0 .../AutomaticCallerTest.cs | 0 .../CallerTest.cs | 0 .../Callers/DaprCaller.cs | 0 .../Callers/GithubCaller.cs | 0 .../Callers/RoleCaller.cs | 0 .../Callers/UserCaller.cs | 0 .../Callers/UserDaprCallerBase.cs | 0 .../DefaultDaprRequestMessage.cs | 0 ...ervice.Caller.AutomaticCaller.Tests.csproj | 6 +- .../_Imports.cs | 0 .../CallerTest.cs | 0 .../CustomHttpClientCaller.cs | 0 .../DefaultXmlResponseMessage.cs | 0 .../HttpClientCallerTest.cs | 0 .../Masa.Contrib.Service.Caller.Tests.csproj | 24 + .../Queries/UserDetailQuery.cs | 0 .../Queries/UserListQuery.cs | 0 .../Requesties/RegisterUser.cs | 0 .../Response/BaseResponse.cs | 0 .../TypeConvertTest.cs | 0 .../Utils/XmlUtils.cs | 0 .../_Imports.cs | 0 ...a.Contrib.Service.MinimalAPIs.Tests.csproj | 4 +- .../MinimalAPITest.cs | 0 .../Services/CustomService.cs | 0 .../_Imports.cs | 0 .../BaseTest.cs | 0 .../CustomCredentialProvider.cs | 0 .../CustomNullClient.cs | 0 .../CustomizeClient.cs | 0 ....Storage.ObjectStorage.Aliyun.Tests.csproj | 8 +- .../StorageContainer.cs | 0 .../TestALiYunStorageOptions.cs | 0 .../TestClient.cs | 0 .../TestCredentialProvider.cs | 0 .../TestStorage.cs | 0 .../_Imports.cs | 0 .../appsettings.json | 0 ...sa.Contrib.Data.EntityFrameworkCore.csproj | 24 - .../Masa.Contrib.Data.UoW.EF.csproj | 21 - ....Contrib.Isolation.MultiEnvironment.csproj | 14 - .../Masa.Contrib.Isolation.MultiTenant.csproj | 14 - .../Masa.Contrib.Isolation.csproj | 21 - src/Utils/Directory.Build.props | 18 + src/Utils/Masa.Utils.sln | 320 +++ src/Utils/README.md | 74 + src/Utils/README.zh-CN.md | 74 + .../DependencyInjection/CachingBuilder.cs | 24 + ...DistributedCacheClientBuilderExtensions.cs | 42 + .../DependencyInjection/ICachingBuilder.cs | 20 + .../DistributedCacheClientFactory.cs | 49 + ...DistributedCacheClientFactoryExtensions.cs | 25 + .../Helpers/SubscribeHelper.cs | 57 + .../Interfaces/ICacheClient.cs | 100 + .../Interfaces/ICacheClientFactory.cs | 19 + .../Interfaces/IDistributedCacheClient.cs | 85 + .../IDistributedCacheClientFactory.cs | 11 + .../Masa.Utils.Caching.Core.csproj} | 6 +- .../Models/CombinedCacheEntryOptions.cs | 55 + .../Models/SubscribeKeyTypes.cs | 16 + .../Models/SubscribeOperation.cs | 14 + .../Models/SubscribeOptions.cs | 25 + .../Masa.Utils.Caching.Core/_Imports.cs | 11 + .../MemoryCacheClientBuilderExtensions.cs | 33 + ...heClientFactoryCachingBuilderExtensions.cs | 56 + .../Interfaces/IMemoryCacheClient.cs | 26 + .../Interfaces/IMemoryCacheClientFactory.cs | 11 + ...asa.Utils.Caching.DistributedMemory.csproj | 19 + .../MemoryCacheClient.cs | 407 ++++ .../MemoryCacheClientFactory.cs | 63 + .../MemoryCacheClientFactoryExtensions.cs | 25 + .../Models/MasaMemoryCacheOptions.cs | 20 + .../_Imports.cs | 15 + .../Masa.Utils.Caching.Memory.csproj | 9 + .../Masa.Utils.Caching.Memory/MemoryCache.cs | 110 + .../Masa.Utils.Caching.Memory/_Imports.cs | 4 + ...lientFactoryServiceCollectionExtensions.cs | 111 + .../Extensions/JsonSerializerExtensions.cs | 558 +++++ .../Extensions/RedisExtensions.cs | 38 + .../Helpers/RedisHelper.cs | 122 + .../Internal/Enum/CompressMode.cs | 19 + .../Masa.Utils.Caching.Redis.csproj | 18 + .../Models/RedisConfigurationOptions.cs | 87 + .../Models/RedisServerOptions.cs | 73 + .../RedisCacheClient.cs | 576 +++++ .../RedisCacheClientFactory.cs | 44 + .../Masa.Utils.Caching.Redis/_Imports.cs | 24 + .../AbstractCallerProvider.cs | 391 +++ .../AddCallerExtensions.cs | 15 + .../Masa.Utils.Caller.Core/CallerBase.cs | 31 + .../Masa.Utils.Caller.Core/CallerOptions.cs | 36 + .../DefaultCallerFactory.cs | 31 + .../DefaultRequestIdGenerator.cs | 9 + .../DefaultRequestMessage.cs | 32 + .../DefaultResponseMessage.cs | 92 + .../DefaultTypeConvertProvider.cs | 98 + .../Masa.Utils.Caller.Core/ICallerFactory.cs | 11 + .../Masa.Utils.Caller.Core/ICallerProvider.cs | 219 ++ .../IRequestIdGenerator.cs | 9 + .../Masa.Utils.Caller.Core/IRequestMessage.cs | 11 + .../IResponseMessage.cs | 11 + .../ITypeConvertProvider.cs | 24 + .../Internal/CallerDependExtensions.cs | 89 + .../Internal/CallerRelations.cs | 20 + .../Masa.Utils.Caller.Core/Internal/Const.cs | 9 + .../Internal/Options/PropertyInfoMember.cs | 31 + .../JsonRequestMessage.cs | 29 + .../Masa.Utils.Caller.Core.csproj | 19 + .../Caller/Masa.Utils.Caller.Core/README.md | 36 + .../Masa.Utils.Caller.Core/README.zh-CN.md | 36 + .../ServiceCollectionExtensions.cs | 105 + .../Caller/Masa.Utils.Caller.Core/_Imports.cs | 19 + .../CallerOptionsExtensions.cs | 40 + .../DaprCallerBase.cs | 30 + .../DaprCallerProvider.cs | 46 + .../Masa.Utils.Caller.DaprClient.csproj | 17 + .../MasaDaprClientBuilder.cs | 70 + .../Masa.Utils.Caller.DaprClient/README.md | 101 + .../README.zh-CN.md | 101 + .../Masa.Utils.Caller.DaprClient/_Imports.cs | 6 + .../CallerOptionsExtensions.cs | 26 + .../HttpClientCallerBase.cs | 32 + .../HttpClientCallerProvider.cs | 72 + .../Masa.Utils.Caller.HttpClient.csproj | 19 + .../MasaHttpClientBuilder.cs | 62 + .../Masa.Utils.Caller.HttpClient/README.md | 110 + .../README.zh-CN.md | 110 + .../Masa.Utils.Caller.HttpClient/_Imports.cs | 5 + .../Masa.Utils.Configuration.Dcc.csproj | 9 + .../AppSettings.cs | 102 + .../JsonConfiguration.cs | 118 + .../JsonFileOptions.cs | 23 + .../Masa.Utils.Configuration.Json.csproj | 14 + .../DataAnnotations/MinCountAttribute.cs | 57 + .../DataAnnotations/NonDefaultAttribute.cs | 32 + .../Masa.Utils.Data.DataAnnotations.csproj | 9 + .../_Imports.cs | 5 + .../TokenFilters/IPinYinTokenFilter.cs | 106 + .../PinYinTokenFilterDescriptor.cs | 125 + .../Masa.Utils.Data.Elasticsearch/Const.cs | 9 + .../DefaultElasticsearchFactory.cs | 84 + .../DefaultMasaElasticClient.cs | 391 +++ .../ElasticsearchOptions.cs | 66 + .../ElasticsearchRelations.cs | 56 + .../IElasticsearchFactory.cs | 15 + .../IMasaElasticClient.cs | 153 ++ .../BulkOperation/BulkDeleteOperation.cs | 15 + .../Internal/DeleteMultiExtensions.cs | 30 + .../Masa.Utils.Data.Elasticsearch.csproj | 15 + .../MasaElasticsearchBuilder.cs | 20 + .../Options/Alias/BindAliasIndexOptions.cs | 27 + .../Options/Alias/UnBindAliasIndexOptions.cs | 27 + .../Options/ConnectionSettingsOptions.cs | 38 + .../Document/Count/CountDocumentRequest.cs | 11 + .../Create/CreateDocumentItemRequest.cs | 12 + .../Document/Create/CreateDocumentRequest.cs | 12 + .../Create/CreateMultiDocumentRequest.cs | 30 + .../Document/Delete/DeleteDocumentRequest.cs | 11 + .../Delete/DeleteMultiDocumentRequest.cs | 15 + .../Options/Document/DocumentOptions.cs | 17 + .../Document/Exist/ExistDocumentRequest.cs | 12 + .../Document/Get/GetDocumentRequest.cs | 11 + .../Document/Get/GetMultiDocumentRequest.cs | 15 + .../Document/Query/PaginatedOptions.cs | 44 + .../Document/Query/QueryBaseOptions.cs | 45 + .../Options/Document/Query/QueryOptions.cs | 19 + .../Set/SetDocumentItemBaseRequest.cs | 12 + .../Document/Set/SetDocumentRequest.cs | 30 + .../Document/SingleDocumentBaseRequest.cs | 17 + .../Update/UpdateDocumentBaseRequest.cs | 25 + .../Document/Update/UpdateDocumentRequest.cs | 15 + .../Update/UpdateMultiDocumentRequest.cs | 18 + .../Options/ElasticsearchRelationsOptions.cs | 20 + .../Options/Index/CreateIndexOptions.cs | 13 + .../Options/Index/DeleteIndexOptions.cs | 9 + .../Options/StaticConnectionPoolOptions.cs | 29 + .../Masa.Utils.Data.Elasticsearch/README.md | 89 + .../README.zh-CN.md | 89 + .../Response/Alias/BulkAliasResponse.cs | 11 + .../Response/Alias/GetAliasResponse.cs | 22 + .../Response/BulkResponse.cs | 14 + .../Response/BulkResponseItems.cs | 23 + .../Response/CreateMultiResponse.cs | 11 + .../Response/CreateResponse.cs | 11 + .../Response/DeleteMultiResponse.cs | 17 + .../Response/DeleteRangeResponseItems.cs | 20 + .../Response/DeleteResponse.cs | 11 + .../Document/ClearDocumentResponse.cs | 11 + .../Document/CountDocumentResponse.cs | 11 + .../Response/ExistsResponse.cs | 16 + .../Response/GetMultiResponse.cs | 15 + .../Response/GetMultiResponseItems.cs | 18 + .../Response/GetResponse.cs | 15 + .../Response/Index/CreateIndexResponse.cs | 11 + .../Response/Index/DeleteIndexResponse.cs | 19 + .../Response/Index/GetIndexByAliasResponse.cs | 14 + .../Response/Index/GetIndexResponse.cs | 14 + .../Response/ResponseBase.cs | 21 + .../Response/SearchPaginatedResponse.cs | 22 + .../Response/SearchResponse.cs | 15 + .../Response/SetResponse.cs | 11 + .../Response/UpdateMultiResponse.cs | 11 + .../Response/UpdateResponse.cs | 11 + .../ServiceCollectionExtensions.Extensions.cs | 30 + .../ServiceCollectionExtensions.cs | 75 + .../Masa.Utils.Data.Elasticsearch/_Imports.cs | 26 + .../Enums/ResultStatuses.cs | 10 + .../Enums/ResultTypes.cs | 15 + .../Extensions/CallerProviderExtensions.cs | 15 + .../Extensions/ObjectExtensions.cs | 142 ++ .../Extensions/StringExtensions.cs | 20 + .../IMasaPrometheusClient.cs | 19 + .../Masa.Utils.Data.Prometheus.csproj | 14 + .../MasaPrometheusClient.cs | 127 + .../Reponse/Exemplar/ExemplarDataModel.cs | 13 + .../Model/Reponse/Exemplar/ExemplarModel.cs | 11 + .../Exemplar/ExemplarResultResponse.cs | 9 + .../Reponse/MetaData/LabelResultResponse.cs | 9 + .../Reponse/MetaData/SeriesResultResponse.cs | 9 + .../Query/QueryResultCommonResponse.cs | 9 + .../Reponse/Query/QueryResultDataResponse.cs | 11 + .../Query/QueryResultInstantVectorResponse.cs | 11 + .../Query/QueryResultMatrixRangeResponse.cs | 11 + .../Model/Reponse/ResultBaseResponse.cs | 15 + .../Model/Request/LableValueQueryRequest.cs | 9 + .../Model/Request/MetaDataQueryRequest.cs | 13 + .../Model/Request/QueryExemplarRequest.cs | 14 + .../Model/Request/QueryRangeRequest.cs | 17 + .../Model/Request/QueryRequest.cs | 13 + .../Data/Masa.Utils.Data.Prometheus/README.md | 75 + .../README.zh-CN.md | 75 + .../ServiceCollectionExtensions.cs | 39 + .../Masa.Utils.Data.Prometheus/_Imports.cs | 15 + .../DaprBackgroundService.cs | 66 + .../DefaultAppPortProvider.cs | 42 + .../IAppPortProvider.cs | 9 + ...a.Utils.Development.Dapr.AspNetCore.csproj | 14 + .../README.md | 59 + .../README.zh-CN.md | 59 + .../ServiceCollectionExtensions.cs | 76 + .../_Imports.cs | 11 + .../CommandLineBuilder.cs | 29 + .../Configurations/DaprRuntimeOptions.cs | 28 + .../DaprExtensions.cs | 43 + .../DaprOptions.cs | 283 +++ .../DaprProcess.cs | 351 +++ .../DaprProvider.cs | 56 + .../EnvironmentExtensions.cs | 17 + .../IDaprProcess.cs | 18 + .../IDaprProvider.cs | 11 + .../Internal/CommandArgumentBuilder.cs | 55 + .../Internal/Const.cs | 28 + .../Internal/DaprCoreOptions.cs | 145 ++ .../Internal/DaprProcessStatus.cs | 13 + .../Internal/NetworkUtils.cs | 18 + .../Internal/ProcessUtils.cs | 107 + .../Masa.Utils.Development.Dapr/LogLevel.cs | 14 + .../Masa.Utils.Development.Dapr.csproj | 17 + .../Process/IProcess.cs | 17 + .../Process/IProcessProvider.cs | 33 + .../Process/ProcessProvider.cs | 181 ++ .../Process/SystemProcess.cs | 39 + .../Masa.Utils.Development.Dapr/Protocol.cs | 10 + .../Masa.Utils.Development.Dapr/README.md | 95 + .../README.zh-CN.md | 95 + .../ServiceCollectionExtensions.cs | 44 + .../Masa.Utils.Development.Dapr/_Imports.cs | 18 + .../BaseTypeProvider.cs | 28 + .../DefaultServiceRegister.cs | 41 + .../DefaultTypeProvider.cs | 73 + .../DependencyAttribute.cs | 18 + .../IAutoFireDependency.cs | 12 + .../IScopedDependency.cs | 21 + .../IServiceRegister.cs | 9 + .../ISingletonDependency.cs | 8 + .../ITransientDependency.cs | 9 + .../ITypeProvider.cs | 17 + .../IgnoreInjectionAttribute.cs | 15 + ...tils.Extensions.DependencyInjection.csproj | 14 + .../Options/ServiceDescriptorOptions.cs | 23 + .../README.md | 117 + .../README.zh-CN.md | 117 + .../ServiceCollectionDescriptorExtensions.cs | 122 + .../ServiceCollectionExtensions.cs | 135 ++ .../_Imports.cs | 6 + .../Masa.Utils.Extensions.DotNet.csproj | 9 + .../TypeExtensions.cs | 27 + .../EnumExtensions.cs | 36 + .../Masa.Utils.Extensions.Enums/EnumUtil.cs | 36 + .../Masa.Utils.Extensions.Enums.csproj | 9 + .../Model/EnumObject.cs | 11 + .../Masa.Utils.Extensions.Enums/_Enum.cs | 116 + .../Masa.Utils.Extensions.Enums/_Imports.cs | 5 + .../ExpressionExtensions.cs | 117 + .../Masa.Utils.Extensions.Expressions.csproj | 10 + .../_Imports.cs | 4 + .../FluentValidationExtensions.cs | 104 + ...nsions.Validations.FluentValidation.csproj | 13 + .../RegularHelper.cs | 21 + .../_Imports.cs | 4 + .../Entries/LdapAddress.cs | 19 + .../Entries/LdapUser.cs | 53 + .../Extensions/LdapAttributeSetExtensions.cs | 27 + .../Extensions/ServiceCollectionExtensions.cs | 27 + .../Masa.Utils.Ldap.Novell/ILdapFactory.cs | 9 + .../Masa.Utils.Ldap.Novell/ILdapProvider.cs | 25 + .../Masa.Utils.Ldap.Novell/LdapFactory.cs | 12 + .../Masa.Utils.Ldap.Novell/LdapOptions.cs | 49 + .../Masa.Utils.Ldap.Novell/LdapProvider.cs | 294 +++ .../Masa.Utils.Ldap.Novell.csproj | 17 + .../Ldap/Masa.Utils.Ldap.Novell/_Imports.cs | 10 + .../ApplicationBuilderExtensions.cs | 81 + .../Extensions/MvcBuilderExtensions.cs | 23 + .../Handlers/ExceptionHandlerMiddleware.cs | 80 + .../Handlers/ExceptionHandlingMiddleware.cs | 56 + .../Handlers/GlobalExceptionFilter.cs | 69 + .../IMasaExceptionHandler.cs | 9 + .../Internal/Constant.cs | 11 + .../Internal/ExceptionExtensions.cs | 18 + .../Internal/ExceptionHandlerExtensions.cs | 31 + .../Internal/HttpResponseExtensions.cs | 26 + .../Masa.Utils.Exceptions.csproj | 11 + .../Masa.Utils.Exceptions/MasaException.cs | 28 + .../MasaExceptionContext.cs | 47 + .../MasaHttpStatusCode.cs | 9 + .../Options/MasaExceptionHandlerOptions.cs | 18 + .../Options/MasaExceptionHandlingOptions.cs | 11 + .../MasaExceptionLogRelationOptions.cs | 23 + src/Utils/src/Masa.Utils.Exceptions/README.md | 130 + .../src/Masa.Utils.Exceptions/README.zh-CN.md | 130 + .../Results/DefaultExceptionResult.cs | 25 + .../InternalServerErrorObjectResult.cs | 13 + .../Results/UserFriendlyExceptionResult.cs | 19 + .../UserFriendlyException.cs | 12 + .../src/Masa.Utils.Exceptions/_Imports.cs | 16 + .../Masa.Utils.Models.Config/AppConfig.cs | 9 + .../Masa.Utils.Models.Config.csproj | 9 + ...curity.Authentication.OpenIdConnect.csproj | 15 + .../MasaOpenIdConnectOptions.cs | 15 + .../ServiceCollectionExtensions.cs | 96 + .../Attributes/MasaAuthorizeAttribute.cs | 15 + .../Constants/MasaClaimTypes.cs | 27 + .../Extensions/ClaimsIdentityExtensions.cs | 53 + .../ICurrentPrincipalAccessor.cs | 9 + .../Masa.Utils.Security.Authentication.csproj | 21 + .../MasaUser.cs | 47 + .../ThreadCurrentPrincipalAccessor.cs | 9 + .../_Imports.cs | 8 + .../AesUtils.cs | 529 ++++ .../Base64Utils.cs | 34 + .../DESEncryType.cs | 17 + .../DesUtils.cs | 415 ++++ .../EncryptBase.cs | 43 + .../EncryptType.cs | 13 + .../FillType.cs | 17 + .../GlobalConfigurationUtils.cs | 21 + .../HashAlgorithmBase.cs | 48 + .../MD5Utils.cs | 117 + .../Masa.Utils.Security.Cryptography.csproj | 9 + .../SHA1Utils.cs | 20 + .../SHA256Utils.cs | 20 + .../SHA384Utils.cs | 20 + .../SHA512Utils.cs | 20 + .../_Imports.cs | 5 + .../DefaultJwtProvider.cs | 85 + .../Masa.Utils.Security.Token/IJwtProvider.cs | 22 + .../Masa.Utils.Security.Token/JwtUtils.cs | 31 + .../Masa.Utils.Security.Token.csproj | 20 + .../Model/JwtConfigurationOptions.cs | 13 + .../ServiceCollectionExtensions.cs | 15 + .../Masa.Utils.Security.Token/_Imports.cs | 13 + .../ConvertToValueTest.cs | 115 + .../Masa.Utils.Caching.Redis.Tests.csproj | 11 +- .../_Imports.cs | 7 + .../CallerTest.cs | 204 ++ .../Callers/GithubCaller.cs | 13 + .../Masa.Utils.Caller.Core.Tests.csproj | 23 + .../Masa.Utils.Caller.Core.Tests/_Imports.cs | 8 + .../AutomaticCallerTest.cs | 56 + .../Callers/DaprCaller.cs | 16 + .../Callers/GithubCaller.cs | 20 + .../Callers/RoleCaller.cs | 11 + .../Callers/UserCaller.cs | 11 + .../Callers/UserDaprCallerBase.cs | 15 + .../Masa.Utils.Caller.IntegratedTests.csproj | 28 + .../_Imports.cs | 11 + .../Masa.Utils.Caller.Tests/CallerTest.cs | 138 ++ .../CustomHttpClientCallerProvider.cs | 14 + .../DefaultXmlResponseMessage.cs | 91 + .../HttpClientCallerTest.cs | 130 + .../Masa.Utils.Caller.Tests.csproj | 6 +- .../Queries/UserDetailQury.cs | 34 + .../Queries/UserListQury.cs | 18 + .../Requesties/RegisterUser.cs | 22 + .../Response/BaseResponse.cs | 16 + .../TypeConvertTest.cs | 30 + .../Masa.Utils.Caller.Tests/Utils/XmlUtils.cs | 23 + .../XmlRequestMessage.cs | 17 + .../test/Masa.Utils.Caller.Tests/_Imports.cs | 21 + ...sa.Utils.Data.DataAnnotations.Tests.csproj | 21 + .../MinCountAttributeTests.cs | 84 + .../NonDefaultAttributeTests.cs | 84 + .../DefaultMasaElasticClientTests.cs | 571 +++++ ...Masa.Utils.Data.Elasticsearch.Tests.csproj | 21 + .../Models/AutoCompleteDocument.cs | 30 + .../_Imports.cs | 19 + .../Extensions/ObjectExtensionsTests.cs | 171 ++ .../Extensions/StringExtensionsTests.cs | 30 + .../Masa.Utils.Data.Prometheus.Test.csproj | 22 + .../MasaPrometheusClientTests.cs | 154 ++ .../UserStruct.cs | 13 + .../_Imports.cs | 12 + .../BaseRepository.cs | 22 + .../IRepository.cs | 17 + ...ependencyInjection.Repository.Tests.csproj | 14 + .../UserDbContext.cs | 9 + .../_Imports.cs | 4 + .../DependencyInjectionTest.cs | 204 ++ .../IServices/ICalculateProviderService.cs | 9 + .../IServices/IClientFactory.cs | 9 + ...xtensions.DependencyInjection.Tests.csproj | 22 + .../Models/User.cs | 11 + .../Services/BaseService.cs | 19 + .../Services/CustomizeClientFactory.cs | 10 + .../Services/EmptyClientFactory.cs | 9 + .../Services/GoodsBaseService.cs | 12 + .../Services/GoodsService.cs | 14 + .../Services/NullCalculateProviderService.cs | 9 + .../Services/OrderBaseService.cs | 12 + .../Services/OrderService.cs | 8 + .../Services/UserBaseService.cs | 11 + .../Services/UserService.cs | 14 + .../_Imports.cs | 9 + .../Masa.Utils.Ldap.Novell.Tests/LdapTest.cs | 85 + .../Masa.Utils.Ldap.Novell.Tests.csproj | 30 + .../Masa.Utils.Ldap.Novell.Tests/_Imports.cs | 10 + .../appsettings.json | 12 + .../AesTest.cs | 30 + .../DesTest.cs | 30 + ...a.Utils.Security.Cryptography.Tests.csproj | 22 + .../_Imports.cs | 4 + ...asa.Contrib.BasicAbility.Auth.Tests.csproj | 24 - ...ib.Data.DistributedLock.Local.Tests.csproj | 21 - ...ata.DistributedLock.Medallion.Tests.csproj | 22 - .../Masa.Contrib.Dispatcher.Tests.csproj | 30 - 1799 files changed, 32546 insertions(+), 1980 deletions(-) delete mode 100644 Masa.Contrib.sln create mode 100644 Masa.Framework.sln create mode 100644 src/BuildingBlocks/Directory.Build.props delete mode 160000 src/BuildingBlocks/MASA.BuildingBlocks create mode 100644 src/BuildingBlocks/Masa.BuildingBlocks.sln create mode 100644 src/BuildingBlocks/README.md create mode 100644 src/BuildingBlocks/README.zh-CN.md create mode 100644 src/BuildingBlocks/design/CodeMap.dgml create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs rename test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj => src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj (59%) create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs create mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/GenderTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/StaffTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/SubjectTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/TeamTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddUserModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddressValueModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AppModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/CollectMenuModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/DisableUserModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/MenuModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/NavModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/ProjectModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/RoleModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffDetailModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/SubjectModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamDetailModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamPersonnelModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserPasswordModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpsertUserModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserPortraitModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserSimpleModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserVisitedModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/_Imports.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IAuthClient.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IEnvironmentProvider.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Masa.BuildingBlocks.BasicAbility.Auth.csproj create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IPermissionService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IProjectService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ISubjectService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ITeamService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IUserService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/_Imports.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/IDccClient.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Masa.BuildingBlocks.BasicAbility.Dcc.csproj create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Model/LabelModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Service/ILabelService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/_Imports.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ChannelTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskReceiverTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSelectReceiverTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSources.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskStatuses.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateAuditStatuses.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateStates.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ReceiverGroupItemTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/SendTargets.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/WebsiteMessageFilterType.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/IMcClient.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Masa.BuildingBlocks.BasicAbility.Mc.csproj create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/AuditEntityModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ChannelModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/EntityModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetChannelModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetMessageTemplateModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetNoticeListModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetReceiverGroupModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetWebsiteMessageModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoUpsertModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskReceiverModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateItemModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedListModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedOptionsModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadAllWebsiteMessageModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadWebsiteMessageModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupItemModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendOrdinaryMessageModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendRuleModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendTemplateMessageModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageChannelModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IChannelService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTaskService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTemplateService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IReceiverGroupService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IWebsiteMessageService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/_Imports.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/AppTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/ServiceTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/IPmClient.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Masa.BuildingBlocks.BasicAbility.Pm.csproj create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppDetailModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/BaseModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterDetailModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentClusterModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentDetailModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectAppsModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectDetailModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectTypeModel.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IAppService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IClusterService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IEnvironmentService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IProjectService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/_Imports.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpMethods.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpVerifyTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/JobTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/RunTimeoutStrategyTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleBlockStrategyTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerClient.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerJob.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Masa.BuildingBlocks.BasicAbility.Scheduler.csproj create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/JobContext.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobAppConfig.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobHttpConfig.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/AddSchedulerJobRequest.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerJobRequest.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerTaskRequest.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/ChangeEnabledStatusRequest.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/StartSchedulerTaskRequest.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerJobService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerTaskService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/_Imports.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Enums/AggregationTypes.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/ITscClient.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Masa.BuildingBlocks.BasicAbility.Tsc.csproj create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/LableValuesRequest.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/ValuesRequest.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/ILogService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/IMetricService.cs create mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/_Imports.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs create mode 100644 src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/IMapping.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Mapper.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/_Imports.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs create mode 100644 src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/_Imports.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs create mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj create mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs create mode 100644 src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs create mode 100644 src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs create mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs create mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs create mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs create mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj create mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs create mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs create mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs create mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs create mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs create mode 100644 src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj create mode 100644 src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs create mode 100644 src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs create mode 100644 src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs create mode 100644 src/Contrib/Directory.Build.props create mode 100644 src/Contrib/README.md create mode 100644 src/Contrib/README.zh-CN.md rename {docs => src/Contrib/docs}/LoadEvent.md (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj (79%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj (70%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.md (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj (57%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/AuthClient.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/Constants.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/EnvironmentProvider.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/HttpEnvironmentDelegatingHandler.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj (70%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/PermissionService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/ProjectService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/SubjectService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/TeamService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/UserService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Auth/_Imports.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Dcc/DccClient.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Internal/Constants.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj (76%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Service/LabelService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Dcc/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Dcc/_Imports.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Constants.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/HttpClientAuthorizationDelegatingHandler.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/DictionaryExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Helper/TypeHelper.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj (69%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/McClient.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ChannelService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTaskService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTemplateService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ReceiverGroupService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/WebsiteMessageService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Mc/_Imports.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/Constants.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj (82%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/PmClient.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/AppService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ClusterService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/EnvironmentService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ProjectService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Pm/_Imports.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Constants.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/HttpClientAuthorizationDelegatingHandler.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj (62%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/SchedulerClient.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerJobService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerTaskService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/_Imports.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/CallerProviderExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/ServiceExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/StreamExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Logging/OpenTelemetryLoggingExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj (90%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/MasaObservableOptions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Metrics/MasaServiceExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTelemetryAttributeName.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/LogService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/MetricService.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/ActivityExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/MasaServiceExtensions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/TscClient.cs (100%) rename src/{ => Contrib/src}/BasicAbility/Masa.Contrib.BasicAbility.Tsc/_Imports.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj (86%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj (67%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/README.md (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Configuration/Masa.Contrib.Configuration/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj (76%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj (75%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj (75%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj (75%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj (78%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj (77%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs (100%) create mode 100644 src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/README.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs (100%) rename src/{Data => Contrib/src/Data/EntityFrameworkCore}/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj (72%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj (72%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj (80%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.md (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj (78%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj (63%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.Contracts.EF/_Imports.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/Internal/Const.cs (100%) create mode 100644 src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/README.md (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/Transaction.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs (100%) rename src/{ => Contrib/src}/Data/Masa.Contrib.Data.UoW.EF/_Imports.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj (75%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain/DomainEventBus.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain/DomainService.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj (75%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain/README.md (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Ddd/Masa.Contrib.Ddd.Domain/_Imports.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj (59%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj (63%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj (74%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.md (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj (71%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/README.md (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs (100%) rename src/{ => Contrib/src}/Identity/Masa.Contrib.Identity.IdentityModel/_Imports.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs (100%) create mode 100644 src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs (100%) create mode 100644 src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj (81%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation.UoW.EF/_Imports.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs (100%) create mode 100644 src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation/README.md (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Isolation/Masa.Contrib.Isolation/_Imports.cs (100%) rename src/{ => Contrib/src}/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs (100%) rename src/{ => Contrib/src}/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj (56%) rename src/{ => Contrib/src}/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs (100%) rename src/{ => Contrib/src}/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md (100%) rename src/{ => Contrib/src}/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md (100%) rename src/{ => Contrib/src}/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs (100%) rename src/{ => Contrib/src}/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs (100%) rename src/{ => Contrib/src}/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs (100%) rename src/{ => Contrib/src}/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj (73%) rename src/{ => Contrib/src}/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs (100%) rename src/{ => Contrib/src}/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs (100%) rename src/{ => Contrib/src}/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md (100%) rename src/{ => Contrib/src}/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md (100%) rename src/{ => Contrib/src}/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj (67%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj (62%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj (67%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/README.md (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs (100%) rename src/{ => Contrib/src}/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs (100%) rename src/{ => Contrib/src}/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj (75%) rename src/{ => Contrib/src}/Service/Masa.Contrib.Service.MinimalAPIs/README.md (100%) rename src/{ => Contrib/src}/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs (100%) rename src/{ => Contrib/src}/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj (75%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs (100%) rename src/{ => Contrib/src}/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Auth.Tests/AuthClientTest.cs (100%) create mode 100644 src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Auth.Tests/PermissionServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Auth.Tests/ProjectServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Auth.Tests/SubjectServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Auth.Tests/TeamServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Auth.Tests/UserServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Auth.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/DccClientTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/LabelServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj (76%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/appsettings.json (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Mc.Tests/ChannelServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj (65%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Mc.Tests/McClientTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Mc.Tests/MessageTaskServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Mc.Tests/MessageTemplateServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Mc.Tests/ReceiverGroupServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Mc.Tests/WebsiteMessageServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Mc.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Pm.Tests/AppServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Pm.Tests/ClusterServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Pm.Tests/EnvironmentServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj (73%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Pm.Tests/PmClientTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Pm.Tests/ProjectServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Pm.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj (71%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerClientTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerJobServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerTaskServiceTest.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Scheduler.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj (69%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Tsc.Test/Service/LogServiceTests.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Tsc.Test/Service/MetricServiceTests.cs (100%) rename {test => src/Contrib/test/BasicAbility}/Masa.Contrib.BasicAbility.Tsc.Test/_Imports.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj (75%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj (85%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/KafkaOptions.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj (68%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj (62%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/MountSectionRedisOptions.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj (93%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/appsettings.json (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/customAppConfig.json (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/rabbitMq.json (100%) rename {test => src/Contrib/test/Configuration}/Masa.Contrib.Configuration.Tests/redis.json (100%) rename {test => src/Contrib/test/Data/DistributedLock}/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs (100%) create mode 100644 src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj rename {test => src/Contrib/test/Data/DistributedLock}/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Data/DistributedLock}/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs (100%) create mode 100644 src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj rename {test => src/Contrib/test/Data/DistributedLock}/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs (100%) create mode 100644 src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs (100%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Benchmarks.cs (100%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/DistributedBenchmarks.cs (100%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj (64%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Program.cs (100%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs (100%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs (100%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj (65%) rename {test => src/Contrib/test/Data/IdGenerator}/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj (70%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs (100%) rename {test => src/Contrib/test/Data/Mapping}/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj (90%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj (65%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj (82%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Data}/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/RegisterUserDomainEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/UpdateUserDomainEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Entities.Tests/Events/RegisterUserEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj (71%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Entities.Tests/User.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Entities.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Integrated.Tests/CustomDbContext.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Integrated.Tests/DomainEventTest.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Integrated.Tests/Handlers/UserHandler.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj (55%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Integrated.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Entities/User.cs (100%) create mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Repositories/IUserRepository.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/BaseRepositoryTest.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Repositories/IOrderRepository.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/CustomDbContext.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/Repositories/OrderRepository.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj (76%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/TestBase.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/DomainIntegrationEventBusTest.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/AddUserIntegrationDomainEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/CreateProductDomainCommand.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainCommand.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/ForgetPasswordEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentFailedIntegrationDomainEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededDomainEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededIntegraionDomainEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/ProductItemDomainQuery.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Events/RegisterUserSucceededDomainIntegrationEvent.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Handlers/PaymentSucceededDomainEventHandller.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj (85%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/Services/UserDomainService.cs (100%) rename {test => src/Contrib/test/Ddd}/Masa.Contrib.Ddd.Domain.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Benchmarks.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/AddShoppingCartEventHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/CouponHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/AddShoppingCartEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/RegisterUserEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Middleware/LoggingMiddleware.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj (85%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Program.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs (100%) rename test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj => src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj (67%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj (67%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj (67%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj (67%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj (67%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj (67%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj (67%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/CustomDbContext.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/CouponHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj (84%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj (89%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj (78%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj (89%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Application/Command/RegisterUserCommand.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Application/Events/AddGoodsIntegrationEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Application/Events/RegisterUserEvent.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQuery.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQueryValidator.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQuery.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQueryValidator.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Application/UserHandler.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Domain/Aggregate/User.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Infrastructure/CustomDbContext.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DefaultPublisher.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/RecordMiddleware.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/ValidatorMiddleware.cs (100%) create mode 100644 src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/TestBase.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/TestDispatcher.cs (100%) rename {test => src/Contrib/test/Dispatcher}/Masa.Contrib.Dispatcher.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Identity}/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj (90%) rename {test => src/Contrib/test/Identity}/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs (100%) rename {test => src/Contrib/test/Identity}/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj (88%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj (89%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj (74%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.Tests/TestIsolation.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.Tests/TestParserProvider.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj (61%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj (52%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Isolation}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json (100%) rename {test => src/Contrib/test/ReadWriteSpliting}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs (100%) rename {test => src/Contrib/test/ReadWriteSpliting}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs (100%) rename {test => src/Contrib/test/ReadWriteSpliting}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs (100%) rename {test => src/Contrib/test/ReadWriteSpliting}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj (80%) rename {test => src/Contrib/test/ReadWriteSpliting}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs (100%) rename {test => src/Contrib/test/ReadWriteSpliting}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs (100%) rename {test => src/Contrib/test/ReadWriteSpliting}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/SearchEngine}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs (100%) rename {test => src/Contrib/test/SearchEngine}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj (86%) rename {test => src/Contrib/test/SearchEngine}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs (100%) rename {test => src/Contrib/test/SearchEngine}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj (69%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/CallerTest.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs (100%) create mode 100644 src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs (100%) rename {test => src/Contrib/test/Service/Caller}/Masa.Contrib.Service.Caller.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Service}/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj (89%) rename {test => src/Contrib/test/Service}/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs (100%) rename {test => src/Contrib/test/Service}/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs (100%) rename {test => src/Contrib/test/Service}/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj (91%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs (100%) rename {test => src/Contrib/test/Storage}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json (100%) delete mode 100644 src/Data/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj delete mode 100644 src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj delete mode 100644 src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj delete mode 100644 src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj delete mode 100644 src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj create mode 100644 src/Utils/Directory.Build.props create mode 100644 src/Utils/Masa.Utils.sln create mode 100644 src/Utils/README.md create mode 100644 src/Utils/README.zh-CN.md create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs rename src/{Data/Masa.Contrib.Data.EntityFrameworkCore/Masa.Utils.Data.EntityFrameworkCore.csproj => Utils/src/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj} (61%) create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Core/_Imports.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Memory/_Imports.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClient.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs create mode 100644 src/Utils/src/Caching/Masa.Utils.Caching.Redis/_Imports.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerBase.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerOptions.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Const.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/README.md create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/README.zh-CN.md create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.Core/_Imports.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.md create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.md create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md create mode 100644 src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs create mode 100644 src/Utils/src/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj create mode 100644 src/Utils/src/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs create mode 100644 src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs create mode 100644 src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs create mode 100644 src/Utils/src/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj create mode 100644 src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj create mode 100644 src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Const.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.md create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.md create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/_Imports.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.md create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/CommandLineBuilder.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprExtensions.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprOptions.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProcess.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProvider.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProcess.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProvider.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/Const.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/LogLevel.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcess.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/SystemProcess.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/Protocol.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/README.md create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/README.zh-CN.md create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Development/Masa.Utils.Development.Dapr/_Imports.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj create mode 100644 src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs create mode 100644 src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs create mode 100644 src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj create mode 100644 src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs create mode 100644 src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj create mode 100644 src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Internal/Constant.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj create mode 100644 src/Utils/src/Masa.Utils.Exceptions/MasaException.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/MasaExceptionContext.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/README.md create mode 100644 src/Utils/src/Masa.Utils.Exceptions/README.zh-CN.md create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/UserFriendlyException.cs create mode 100644 src/Utils/src/Masa.Utils.Exceptions/_Imports.cs create mode 100644 src/Utils/src/Models/Masa.Utils.Models.Config/AppConfig.cs create mode 100644 src/Utils/src/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication/MasaUser.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Authentication/_Imports.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/AesUtils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/DesUtils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptType.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/FillType.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Cryptography/_Imports.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Token/IJwtProvider.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Token/JwtUtils.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs create mode 100644 src/Utils/src/Security/Masa.Utils.Security.Token/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs rename test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj => src/Utils/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj (65%) create mode 100644 src/Utils/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Core.Tests/CallerTest.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Core.Tests/Callers/GithubCaller.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Core.Tests/Masa.Utils.Caller.Core.Tests.csproj create mode 100644 src/Utils/test/Masa.Utils.Caller.Core.Tests/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/AutomaticCallerTest.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/DaprCaller.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/GithubCaller.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/RoleCaller.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserCaller.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserDaprCallerBase.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/Masa.Utils.Caller.IntegratedTests.csproj create mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/CustomHttpClientCallerProvider.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/DefaultXmlResponseMessage.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs rename test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj => src/Utils/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj (64%) create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserDetailQury.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserListQury.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/Requesties/RegisterUser.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/Response/BaseResponse.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/Utils/XmlUtils.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/XmlRequestMessage.cs create mode 100644 src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj create mode 100644 src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs create mode 100644 src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs create mode 100644 src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs create mode 100644 src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj create mode 100644 src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs create mode 100644 src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs create mode 100644 src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs create mode 100644 src/Utils/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj create mode 100644 src/Utils/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs create mode 100644 src/Utils/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs create mode 100644 src/Utils/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/BaseRepository.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/IRepository.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/UserDbContext.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/ICalculateProviderService.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/IClientFactory.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Models/User.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/BaseService.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/CustomizeClientFactory.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/EmptyClientFactory.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsBaseService.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsService.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/NullCalculateProviderService.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderBaseService.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderService.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserBaseService.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserService.cs create mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs create mode 100644 src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj create mode 100644 src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs create mode 100644 src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json create mode 100644 src/Utils/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs create mode 100644 src/Utils/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs create mode 100644 src/Utils/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj create mode 100644 src/Utils/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs delete mode 100644 test/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj delete mode 100644 test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj delete mode 100644 test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj delete mode 100644 test/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj diff --git a/Directory.Build.props b/Directory.Build.props index f653a61f8..904f99252 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -11,11 +11,13 @@ 1.5.0 3.19.1 1.0.4 - - 1.3.0 - 1.0.0-beta2 - 1.0.0-rc9.3 - + 11.1.0 + 11.1.2 + + 1.3.0 + 1.0.0-beta2 + 1.0.0-rc9.3 + $(AssemblyName) packageIcon.png masastack diff --git a/Masa.Contrib.sln b/Masa.Contrib.sln deleted file mode 100644 index 7c2b111b4..000000000 --- a/Masa.Contrib.sln +++ /dev/null @@ -1,1599 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31521.260 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{59DA3D5F-9E39-4173-8C31-126967CC189F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{FBD326D3-E59C-433E-A88E-14E179E3093D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "I18n", "I18n", "{EA2668AF-28E3-42C5-9FA5-8C9FF377180E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{022D6FF5-4B65-4213-9A97-C69E2B2F99E1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Observability", "Observability", "{75050CBC-A0F2-408A-A582-54EF37450B29}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{509BDB5A-5D32-478F-BF27-F0470C18C7C9}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{8C39C640-0E8A-43A7-890C-9742B6B70AA4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{593A3114-D1E0-47ED-BC37-58E08886175B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cqrs", "Cqrs", "{DA885E64-C5E2-4C22-8C2A-26E68A593F29}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{9F6F9899-D5F1-444A-BE56-64F949550D22}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - Directory.Build.props = Directory.Build.props - nuget.config = nuget.config - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{38E6C400-90C0-493E-9266-C1602E229F1B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Masa.Contrib.Dispatcher.Events", "Masa.Contrib.Dispatcher.Events", "{2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs", "src\Service\Masa.Contrib.Service.MinimalAPIs\Masa.Contrib.Service.MinimalAPIs.csproj", "{ED301FA5-4E70-460B-A0D4-1D79D135769F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{21180442-A6A5-4239-A2AD-33FF5BB80E72}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{E33ADF54-4D35-49B7-BDA6-412587CA39FF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events", "src\Dispatcher\Masa.Contrib.Dispatcher.Events\Masa.Contrib.Dispatcher.Events.csproj", "{1B44F2E7-28F5-4E88-B8A8-3F336800FD5C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests", "test\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj", "{D55A7D3B-9C24-4029-BC03-41B28AD11DB6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests", "test\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj", "{89B2A693-CD8A-4EA2-9991-2CEE44C4D04B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests", "test\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj", "{2E172027-1B85-474E-A238-21B2DBDB895F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests", "test\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj", "{62760E2C-D3D6-4824-997F-35033E6EB92C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests", "test\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj", "{965C85E2-D94E-43DE-BFC2-B9D157242EBB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests", "test\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj", "{7D083C64-FF32-43C4-A82C-32C4A4EC1414}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests", "test\Masa.Contrib.Dispatcher.Events.Tests\Masa.Contrib.Dispatcher.Events.Tests.csproj", "{3870E8F1-B269-425D-8B03-58835FD53610}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF", "src\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj", "{519A99D2-8094-48EC-A888-C0B4E017A4C1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr", "src\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj", "{E946A129-34ED-4069-B44E-EC7B98751006}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests", "test\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj", "{F3DA1941-3610-48F3-901A-E2E873979BFD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs", "src\ReadWriteSpliting\Cqrs\Masa.Contrib.ReadWriteSpliting.Cqrs\Masa.Contrib.ReadWriteSpliting.Cqrs.csproj", "{EA23C277-97E4-4FBC-A53B-37048813E14F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain", "src\Ddd\Masa.Contrib.Ddd.Domain\Masa.Contrib.Ddd.Domain.csproj", "{0FF64D9E-98D7-46B1-90FB-C0364C76D65A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF", "src\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF\Masa.Contrib.Ddd.Domain.Repository.EF.csproj", "{D375233D-8AAC-4234-BC0D-3D103C600C19}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Tests", "test\Masa.Contrib.Ddd.Domain.Tests\Masa.Contrib.Ddd.Domain.Tests.csproj", "{EAC0AA32-AE9B-4908-AF05-927B70A2B8A1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "test\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{E893C913-98A0-4BB3-A32B-3871BE3C5C53}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Tests", "test\Masa.Contrib.Dispatcher.IntegrationEvents.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj", "{761C3313-A669-465F-A384-9E118FCE4F89}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Masa.Contrib.Ddd.Domain", "Masa.Contrib.Ddd.Domain", "{13EDB361-AF88-4F89-B4AB-46622BCCBC37}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Masa.Contrib.Ddd.Domain.Repository.EF", "Masa.Contrib.Ddd.Domain.Repository.EF", "{880E8263-AECC-4793-BD28-7CD03650D124}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF.Tests", "test\Masa.Contrib.Data.UoW.EF.Tests\Masa.Contrib.Data.UoW.EF.Tests.csproj", "{1B16DD58-0847-45A7-AF93-53EBFBEDAAE7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration", "src\Configuration\Masa.Contrib.Configuration\Masa.Contrib.Configuration.csproj", "{C056C688-8FFC-42BC-B4EA-EF3808A8A12C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs.Tests", "test\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj", "{428CDAF3-957A-4017-82EA-70737F205546}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests", "test\Masa.Contrib.Configuration.Tests\Masa.Contrib.Configuration.Tests.csproj", "{DB93B639-899D-4B2C-AF8A-47B4BC6B3776}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Masa.Contrib.Configuration", "Masa.Contrib.Configuration", "{9EEE31DA-3165-4CB3-AAE9-27CC3A4DE669}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs.Tests", "test\Masa.Contrib.Service.MinimalAPIs.Tests\Masa.Contrib.Service.MinimalAPIs.Tests.csproj", "{A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Entities.Tests", "test\Masa.Contrib.Ddd.Domain.Entities.Tests\Masa.Contrib.Ddd.Domain.Entities.Tests.csproj", "{B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF.Tests", "test\Masa.Contrib.Data.Contracts.EF.Tests\Masa.Contrib.Data.Contracts.EF.Tests.csproj", "{5A163042-B03A-4063-85FF-22D4C5BB5B90}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests", "test\Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests\Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj", "{84EFF9E1-6852-458F-8D57-62E3F084EA0F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests", "test\Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests\Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj", "{427822F2-7A20-4E3A-B45C-43CE855003C1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests", "test\Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj", "{7909A736-6C1E-4622-9BE7-37EF0839FA05}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests", "test\Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests\Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj", "{1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildingBlocks", "BuildingBlocks", "{DC578D74-98F0-4F19-A230-CFA8DAEE0AF1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration", "src\BuildingBlocks\MASA.BuildingBlocks\src\Configuration\Masa.BuildingBlocks.Configuration\Masa.BuildingBlocks.Configuration.csproj", "{374B7E56-A815-4F56-A4C2-6094B5A97EE7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Contracts", "src\BuildingBlocks\MASA.BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.Contracts\Masa.BuildingBlocks.Data.Contracts.csproj", "{7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.UoW", "src\BuildingBlocks\MASA.BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.UoW\Masa.BuildingBlocks.Data.UoW.csproj", "{E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain", "src\BuildingBlocks\MASA.BuildingBlocks\src\Ddd\Masa.BuildingBlocks.Ddd.Domain\Masa.BuildingBlocks.Ddd.Domain.csproj", "{2971858E-2CCA-4688-B8CA-84F130AD5AA9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.Events", "src\BuildingBlocks\MASA.BuildingBlocks\src\Dispatcher\Masa.BuildingBlocks.Dispatcher.Events\Masa.BuildingBlocks.Dispatcher.Events.csproj", "{2503F67B-63BB-4364-8B31-1DD3049C92B7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.IntegrationEvents", "src\BuildingBlocks\MASA.BuildingBlocks\src\Dispatcher\Masa.BuildingBlocks.Dispatcher.IntegrationEvents\Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj", "{88BC8170-9123-48C0-A914-11D3CE805196}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.Cqrs", "src\BuildingBlocks\MASA.BuildingBlocks\src\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj", "{316B1D0A-9CF7-4E5C-A39A-8A389B075A19}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete", "src\BuildingBlocks\MASA.BuildingBlocks\src\SearchEngine\Masa.BuildingBlocks.SearchEngine.AutoComplete\Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj", "{2F4986D6-3F56-4C05-8A1D-399594F96093}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.MinimalAPIs", "src\BuildingBlocks\MASA.BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.MinimalAPIs\Masa.BuildingBlocks.Service.MinimalAPIs.csproj", "{E72E105D-B15F-4D69-9A13-CAA49D4889D6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests", "test\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj", "{4A052E17-4D9E-41EF-89A5-73B917053F8E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch", "src\SearchEngine\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj", "{3F8532EF-3DC9-45F8-9562-994ABE066585}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests", "test\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj", "{31262D61-26A4-4302-968D-52B8DA4558CD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolation", "src\BuildingBlocks\MASA.BuildingBlocks\src\Isolation\Masa.BuildingBlocks.Isolation\Masa.BuildingBlocks.Isolation.csproj", "{B689E82B-B3E8-4C83-B56C-D4C27206AAC6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation", "src\Isolation\Masa.Contrib.Isolation\Masa.Contrib.Isolation.csproj", "{F52E5BA6-C2D4-4797-AF71-6389FEC246B5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment", "src\Isolation\Masa.Contrib.Isolation.MultiEnvironment\Masa.Contrib.Isolation.MultiEnvironment.csproj", "{823D2A6E-20AB-45FF-AD07-5E7933FA6DE7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant", "src\Isolation\Masa.Contrib.Isolation.MultiTenant\Masa.Contrib.Isolation.MultiTenant.csproj", "{7C382E43-A515-4C67-9296-FB8A630C4A49}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF", "src\Isolation\Masa.Contrib.Isolation.UoW.EF\Masa.Contrib.Isolation.UoW.EF.csproj", "{95AF448B-F34C-4DF8-9E9B-DF499FABA099}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment.Tests", "test\Masa.Contrib.Isolation.MultiEnvironment.Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj", "{4C3307D4-2A6B-41E3-BE9E-2FD083578450}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant.Tests", "test\Masa.Contrib.Isolation.MultiTenant.Tests\Masa.Contrib.Isolation.MultiTenant.Tests.csproj", "{AA1993F7-5BAE-45F8-A8F5-31E88A25ED83}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.Tests", "test\Masa.Contrib.Isolation.Tests\Masa.Contrib.Isolation.Tests.csproj", "{F1826D84-1A16-41A4-A57B-F0DBB5A18745}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Tests", "test\Masa.Contrib.Isolation.UoW.EF.Tests\Masa.Contrib.Isolation.UoW.EF.Tests.csproj", "{2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Web.Tests", "test\Masa.Contrib.Isolation.UoW.EF.Web.Tests\Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj", "{F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Pm", "src\BasicAbility\Masa.Contrib.BasicAbility.Pm\Masa.Contrib.BasicAbility.Pm.csproj", "{118A91A6-6FBB-431A-B50D-076375AD6A63}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Storage.ObjectStorage", "src\BuildingBlocks\MASA.BuildingBlocks\src\Storage\Masa.BuildingBlocks.Storage.ObjectStorage\Masa.BuildingBlocks.Storage.ObjectStorage.csproj", "{74283F68-6B38-4CF4-B0CB-AAD65618ADB8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Pm", "src\BuildingBlocks\MASA.BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Pm\Masa.BuildingBlocks.BasicAbility.Pm.csproj", "{AB6FAB84-5218-48A8-8F94-03B02ECD098F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Pm.Tests", "test\Masa.Contrib.BasicAbility.Pm.Tests\Masa.Contrib.BasicAbility.Pm.Tests.csproj", "{C4DDEA6E-D6AF-4890-9713-C2862403E57C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun", "src\Storage\Masa.Contrib.Storage.ObjectStorage.Aliyun\Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj", "{86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests", "test\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj", "{97532A33-A591-4DF5-A2C0-72527B78ED82}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{165391A5-034E-4894-8084-8DF7D4AA7518}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests", "test\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj", "{B8358ED1-C95A-4EC0-9756-FB32C931F204}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Mapping", "src\BuildingBlocks\MASA.BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.Mapping\Masa.BuildingBlocks.Data.Mapping.csproj", "{5A3338F1-9963-4CAC-85A3-7AB263CB15B0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF", "src\Data\Masa.Contrib.Data.Contracts.EF\Masa.Contrib.Data.Contracts.EF.csproj", "{79D639DC-DDE4-45B1-884D-60B6908F528E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster.Tests", "test\Masa.Contrib.Data.Mapping.Mapster.Tests\Masa.Contrib.Data.Mapping.Mapster.Tests.csproj", "{834A12D0-FBED-45B3-86EA-5EA114C516B5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data", "src\BuildingBlocks\MASA.BuildingBlocks\src\Data\Masa.BuildingBlocks.Data\Masa.BuildingBlocks.Data.csproj", "{C3451307-3743-4911-A401-7F28889703D3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{4AC23B67-52F9-44E5-9586-79A1DB73E6F7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore", "src\Data\Masa.Contrib.Data.EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.csproj", "{87DD354D-4D48-4918-ACDE-A7FF62FA0DD8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster", "src\Data\Mapping\Masa.Contrib.Data.Mapping.Mapster\Masa.Contrib.Data.Mapping.Mapster.csproj", "{D5EA7A25-0FD2-4545-9C1C-FF96E5E35145}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Tests", "test\Masa.Contrib.Data.EntityFrameworkCore.Tests\Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj", "{E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Integrated.Tests", "test\Masa.Contrib.Ddd.Domain.Integrated.Tests\Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj", "{E868B34E-D1ED-412A-9382-954B84EDE80C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Cosmos", "src\Data\Masa.Contrib.Data.EntityFrameworkCore.Cosmos\Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj", "{C8A78B0F-BF6B-4317-8C22-535626C263EC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.InMemory", "src\Data\Masa.Contrib.Data.EntityFrameworkCore.InMemory\Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj", "{69778426-7179-4B0C-8398-2F3BECA0FE93}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.MySql", "src\Data\Masa.Contrib.Data.EntityFrameworkCore.MySql\Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj", "{0D50F5EB-D580-4041-A6FA-F5373EF10566}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Oracle", "src\Data\Masa.Contrib.Data.EntityFrameworkCore.Oracle\Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj", "{84A64849-AD9C-4618-BC87-07CCE7AD7FE2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql", "src\Data\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj", "{96B87330-1B65-4E79-A5AD-E2268A582434}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.PostgreSql", "src\Data\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj", "{124A4190-6B03-4A1C-B2BE-979DD1FB511F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Sqlite", "src\Data\Masa.Contrib.Data.EntityFrameworkCore.Sqlite\Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj", "{690D8379-B630-41FD-88F0-6D1EBB4BC3D4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.SqlServer", "src\Data\Masa.Contrib.Data.EntityFrameworkCore.SqlServer\Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj", "{7C7CEBAE-38A4-435D-BEC2-2425D58FABDC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Tsc", "src\BasicAbility\Masa.Contrib.BasicAbility.Tsc\Masa.Contrib.BasicAbility.Tsc.csproj", "{EB0F6BDA-C6AA-4859-834E-5613BB38862B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Contracts", "src\BuildingBlocks\MASA.BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.Contracts\Masa.BuildingBlocks.Service.Contracts.csproj", "{736F69E9-89D0-47E2-99AF-9412AAE1C6BB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth", "src\BuildingBlocks\MASA.BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth\Masa.BuildingBlocks.BasicAbility.Auth.csproj", "{4B818EE6-8E13-40DA-B99A-218BB228EE91}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdGenerator", "IdGenerator", "{6DB8780E-BA11-47CD-8FAB-D73A1F71B305}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Auth", "src\BasicAbility\Masa.Contrib.BasicAbility.Auth\Masa.Contrib.BasicAbility.Auth.csproj", "{CE1CABB0-B307-4709-84E0-583382FAAA29}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake", "src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake\Masa.Contrib.Data.IdGenerator.Snowflake.csproj", "{E7987CBB-8DDD-4AC5-B522-653E2F457C85}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests", "test\Masa.Contrib.Data.IdGenerator.Snowflake.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj", "{AD427256-9686-4289-A635-1B387BD56D15}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Auth.Tests", "test\Masa.Contrib.BasicAbility.Auth.Tests\Masa.Contrib.BasicAbility.Auth.Tests.csproj", "{2B644A8C-F0EE-4566-AB78-9E1C6D4185A3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{4995742C-033A-4147-89E7-7FFE7681C971}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis", "src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj", "{DC50078D-D706-4CB9-A301-F47CB3F46007}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdGenerator", "IdGenerator", "{E6363F59-2BA4-4AA7-8578-C433A2C2567F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests", "test\Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj", "{D8E85337-A779-48FC-B822-CE8A850661DC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.MappingExtensions", "src\BuildingBlocks\MASA.BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.MappingExtensions\Masa.BuildingBlocks.Data.MappingExtensions.csproj", "{30DC35DF-9D86-443C-B26C-9053E6FCA434}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.NormalGuid", "src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.NormalGuid\Masa.Contrib.Data.IdGenerator.NormalGuid.csproj", "{24E5BF57-33B6-4D5B-A32F-2F64D1A5954F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid", "src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.SequentialGuid\Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj", "{B15F4561-E511-42EA-A02E-F772BAF41E20}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests", "test\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj", "{32488758-25C9-4257-9B98-DAA034C19909}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Cache", "src\BuildingBlocks\MASA.BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Cache\Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj", "{4B94CAF6-134D-4F89-8F2D-72A4FB363B59}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\BuildingBlocks\MASA.BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{54936F20-EEFC-405B-8646-76F200A5C8F7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\BuildingBlocks\MASA.BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{546EE1A2-DB6B-49D3-8919-33624FEF2498}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\BuildingBlocks\MASA.BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{B603B92A-1203-4E28-9D15-2AF1CE4E9510}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache", "src\Authentication\Masa.Contrib.Authentication.Oidc.Cache\Masa.Contrib.Authentication.Oidc.Cache.csproj", "{FBF18906-7113-4036-BAEB-56E925F7D301}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache.Storage", "src\Authentication\Masa.Contrib.Authentication.Oidc.Cache.Storage\Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj", "{661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.EntityFrameworkCore", "src\Authentication\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj", "{F2E1018A-F423-4782-BE9D-6169C669AD43}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\MASA.BuildingBlocks\src\Identity\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DistributedLock", "DistributedLock", "{07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Local\Masa.Contrib.Data.DistributedLock.Local.csproj", "{338EA0ED-B7B2-44D8-9F34-235C484E3497}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.SqlServer", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj", "{933050A7-AB8A-4653-AB90-A7D5FBF38C7A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj", "{1B04884B-D903-42CD-A4EB-259068325653}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.MySql", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.MySql\Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj", "{91A0E44C-3F12-409B-8C2D-DA2689338D68}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Oracle", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Oracle\Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj", "{424FDF4D-198B-46FB-B1A9-F229EB80B195}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Azure", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Azure\Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj", "{D77650B4-A242-4686-820E-3863931E0229}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj", "{083933A9-5402-453E-851F-9095BFBB57FE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.FileSystem", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj", "{1AD38027-C406-4FA4-B8FD-23E6336C2C4C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj", "{8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{5F25960E-646D-4EA6-A648-3CAD284B6E38}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel", "src\Identity\Masa.Contrib.Identity.IdentityModel\Masa.Contrib.Identity.IdentityModel.csproj", "{AA7876FF-3EF9-40EC-B5FF-66AB748DB93E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DistributedLock", "DistributedLock", "{DB2B4DA3-EEF2-49AA-93A4-B00C25210A68}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc", "src\Configuration\Masa.Contrib.Configuration.ConfigurationApi.Dcc\Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj", "{23582B50-BAEA-4A2D-82A4-345A3C30124E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests", "test\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj", "{1371F22B-FDD7-43B0-8E7D-E68DA31F07F3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Dcc", "src\BuildingBlocks\MASA.BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Dcc\Masa.BuildingBlocks.BasicAbility.Dcc.csproj", "{FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Dcc", "src\BasicAbility\Masa.Contrib.BasicAbility.Dcc\Masa.Contrib.BasicAbility.Dcc.csproj", "{83FA668F-C838-4883-996D-AF2ECF00FDF8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Dcc.Tests", "test\Masa.Contrib.BasicAbility.Dcc.Tests\Masa.Contrib.BasicAbility.Dcc.Tests\Masa.Contrib.BasicAbility.Dcc.Tests.csproj", "{789ABED5-7C94-4F6F-ADCA-E97F3DFC9479}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth.Contracts", "src\BuildingBlocks\MASA.BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth.Contracts\Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj", "{981E883E-CCDC-400B-8FB1-76E1E65C32AF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{0D34A7F0-DC77-4789-A136-93089CBD15C3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Scheduler", "src\BuildingBlocks\MASA.BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Scheduler\Masa.BuildingBlocks.BasicAbility.Scheduler.csproj", "{0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Scheduler.Tests", "test\Masa.Contrib.BasicAbility.Scheduler.Tests\Masa.Contrib.BasicAbility.Scheduler.Tests.csproj", "{5980D054-E2F3-4143-93D1-01993A955AE7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Scheduler", "src\BasicAbility\Masa.Contrib.BasicAbility.Scheduler\Masa.Contrib.BasicAbility.Scheduler.csproj", "{8D84666E-C79E-4D49-B73D-360E62D312EF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents", "src\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.csproj", "{7C4B88FA-3681-4C29-BC3F-0FDB111C5681}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests", "test\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj", "{592297DE-DA72-452D-9D88-61EE882FE9A6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel.Tests", "test\Masa.Contrib.Identity.IdentityModel.Tests\Masa.Contrib.Identity.IdentityModel.Tests.csproj", "{4E237346-F948-46AC-801B-492545978280}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Mc", "src\BasicAbility\Masa.Contrib.BasicAbility.Mc\Masa.Contrib.BasicAbility.Mc.csproj", "{75A25CF6-9BA4-46F5-8BC3-90396230CB64}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Mc", "src\BuildingBlocks\MASA.BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Mc\Masa.BuildingBlocks.BasicAbility.Mc.csproj", "{DA816A33-F164-4456-92DD-A672BAD1A6B1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Mc.Tests", "test\Masa.Contrib.BasicAbility.Mc.Tests\Masa.Contrib.BasicAbility.Mc.Tests.csproj", "{23633E49-F11A-4D14-899A-E2599C8182CE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF", "src\Data\Masa.Contrib.Data.UoW.EF\Masa.Contrib.Data.UoW.EF.csproj", "{FC4E526A-DBFC-406A-8ED3-64983B67F688}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Redis", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Redis\Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj", "{AE3607C0-3278-46D7-97CD-4E6F37C120D3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion", "src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion\Masa.Contrib.Data.DistributedLock.Medallion.csproj", "{A1232A01-3927-4EDE-B7D4-657E08DEB36D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local.Tests", "test\Masa.Contrib.Data.DistributedLock.Local.Tests\Masa.Contrib.Data.DistributedLock.Local.Tests.csproj", "{2870B6BB-4188-45A0-A2D3-085834EBDC2A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Tests", "test\Masa.Contrib.Data.DistributedLock.Medallion.Tests\Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj", "{913DA066-8A23-4671-AC8F-B5B61134F8FE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Tests", "test\Masa.Contrib.Dispatcher.Tests\Masa.Contrib.Dispatcher.Tests.csproj", "{4CD3D849-7277-4C9C-9461-7ABB66F78629}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Tsc.Tests", "test\Masa.Contrib.BasicAbility.Tsc.Test\Masa.Contrib.BasicAbility.Tsc.Tests.csproj", "{FED315CF-7CA2-4653-AD37-BC0C1D7FFD22}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Tsc", "src\BuildingBlocks\MASA.BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Tsc\Masa.BuildingBlocks.BasicAbility.Tsc.csproj", "{C265268A-F311-4B6A-915E-C1AF9D1EB624}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Caller", "src\BuildingBlocks\MASA.BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{ABF6E41A-CBF9-49DE-87FC-9D88F440A104}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{F9DDEB6F-25F8-4505-8300-2E247564BD8B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.DaprClient", "src\Service\Caller\Masa.Contrib.Service.Caller.DaprClient\Masa.Contrib.Service.Caller.DaprClient.csproj", "{1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.HttpClient", "src\Service\Caller\Masa.Contrib.Service.Caller.HttpClient\Masa.Contrib.Service.Caller.HttpClient.csproj", "{00659C82-2E23-4E8F-BA34-EC41D78C87A1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller", "src\Service\Caller\Masa.Contrib.Service.Caller\Masa.Contrib.Service.Caller.csproj", "{28893415-0789-4FBB-A8B7-F0F9260CEDE3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{4AA6B450-D4AA-4474-9ECF-52A44935D8D9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.Tests", "test\Masa.Contrib.Service.Caller.Tests\Masa.Contrib.Service.Caller.Tests.csproj", "{D855894E-4C72-41DC-8F84-EF66CDE37453}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.AutomaticCaller.Tests", "test\Masa.Contrib.Service.Caller.AutomaticCaller.Tests\Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj", "{1EE45374-EF8E-4E9D-A74F-51C14DA58ED8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{7012AE14-D352-405F-8412-4B60A017AEC9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ED301FA5-4E70-460B-A0D4-1D79D135769F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ED301FA5-4E70-460B-A0D4-1D79D135769F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED301FA5-4E70-460B-A0D4-1D79D135769F}.Debug|x64.ActiveCfg = Debug|Any CPU - {ED301FA5-4E70-460B-A0D4-1D79D135769F}.Debug|x64.Build.0 = Debug|Any CPU - {ED301FA5-4E70-460B-A0D4-1D79D135769F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ED301FA5-4E70-460B-A0D4-1D79D135769F}.Release|Any CPU.Build.0 = Release|Any CPU - {ED301FA5-4E70-460B-A0D4-1D79D135769F}.Release|x64.ActiveCfg = Release|Any CPU - {ED301FA5-4E70-460B-A0D4-1D79D135769F}.Release|x64.Build.0 = Release|Any CPU - {1B44F2E7-28F5-4E88-B8A8-3F336800FD5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B44F2E7-28F5-4E88-B8A8-3F336800FD5C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B44F2E7-28F5-4E88-B8A8-3F336800FD5C}.Debug|x64.ActiveCfg = Debug|Any CPU - {1B44F2E7-28F5-4E88-B8A8-3F336800FD5C}.Debug|x64.Build.0 = Debug|Any CPU - {1B44F2E7-28F5-4E88-B8A8-3F336800FD5C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B44F2E7-28F5-4E88-B8A8-3F336800FD5C}.Release|Any CPU.Build.0 = Release|Any CPU - {1B44F2E7-28F5-4E88-B8A8-3F336800FD5C}.Release|x64.ActiveCfg = Release|Any CPU - {1B44F2E7-28F5-4E88-B8A8-3F336800FD5C}.Release|x64.Build.0 = Release|Any CPU - {D55A7D3B-9C24-4029-BC03-41B28AD11DB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D55A7D3B-9C24-4029-BC03-41B28AD11DB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D55A7D3B-9C24-4029-BC03-41B28AD11DB6}.Debug|x64.ActiveCfg = Debug|Any CPU - {D55A7D3B-9C24-4029-BC03-41B28AD11DB6}.Debug|x64.Build.0 = Debug|Any CPU - {D55A7D3B-9C24-4029-BC03-41B28AD11DB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D55A7D3B-9C24-4029-BC03-41B28AD11DB6}.Release|Any CPU.Build.0 = Release|Any CPU - {D55A7D3B-9C24-4029-BC03-41B28AD11DB6}.Release|x64.ActiveCfg = Release|Any CPU - {D55A7D3B-9C24-4029-BC03-41B28AD11DB6}.Release|x64.Build.0 = Release|Any CPU - {89B2A693-CD8A-4EA2-9991-2CEE44C4D04B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89B2A693-CD8A-4EA2-9991-2CEE44C4D04B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89B2A693-CD8A-4EA2-9991-2CEE44C4D04B}.Debug|x64.ActiveCfg = Debug|Any CPU - {89B2A693-CD8A-4EA2-9991-2CEE44C4D04B}.Debug|x64.Build.0 = Debug|Any CPU - {89B2A693-CD8A-4EA2-9991-2CEE44C4D04B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89B2A693-CD8A-4EA2-9991-2CEE44C4D04B}.Release|Any CPU.Build.0 = Release|Any CPU - {89B2A693-CD8A-4EA2-9991-2CEE44C4D04B}.Release|x64.ActiveCfg = Release|Any CPU - {89B2A693-CD8A-4EA2-9991-2CEE44C4D04B}.Release|x64.Build.0 = Release|Any CPU - {2E172027-1B85-474E-A238-21B2DBDB895F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E172027-1B85-474E-A238-21B2DBDB895F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E172027-1B85-474E-A238-21B2DBDB895F}.Debug|x64.ActiveCfg = Debug|Any CPU - {2E172027-1B85-474E-A238-21B2DBDB895F}.Debug|x64.Build.0 = Debug|Any CPU - {2E172027-1B85-474E-A238-21B2DBDB895F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E172027-1B85-474E-A238-21B2DBDB895F}.Release|Any CPU.Build.0 = Release|Any CPU - {2E172027-1B85-474E-A238-21B2DBDB895F}.Release|x64.ActiveCfg = Release|Any CPU - {2E172027-1B85-474E-A238-21B2DBDB895F}.Release|x64.Build.0 = Release|Any CPU - {62760E2C-D3D6-4824-997F-35033E6EB92C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {62760E2C-D3D6-4824-997F-35033E6EB92C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {62760E2C-D3D6-4824-997F-35033E6EB92C}.Debug|x64.ActiveCfg = Debug|Any CPU - {62760E2C-D3D6-4824-997F-35033E6EB92C}.Debug|x64.Build.0 = Debug|Any CPU - {62760E2C-D3D6-4824-997F-35033E6EB92C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {62760E2C-D3D6-4824-997F-35033E6EB92C}.Release|Any CPU.Build.0 = Release|Any CPU - {62760E2C-D3D6-4824-997F-35033E6EB92C}.Release|x64.ActiveCfg = Release|Any CPU - {62760E2C-D3D6-4824-997F-35033E6EB92C}.Release|x64.Build.0 = Release|Any CPU - {965C85E2-D94E-43DE-BFC2-B9D157242EBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {965C85E2-D94E-43DE-BFC2-B9D157242EBB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {965C85E2-D94E-43DE-BFC2-B9D157242EBB}.Debug|x64.ActiveCfg = Debug|Any CPU - {965C85E2-D94E-43DE-BFC2-B9D157242EBB}.Debug|x64.Build.0 = Debug|Any CPU - {965C85E2-D94E-43DE-BFC2-B9D157242EBB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {965C85E2-D94E-43DE-BFC2-B9D157242EBB}.Release|Any CPU.Build.0 = Release|Any CPU - {965C85E2-D94E-43DE-BFC2-B9D157242EBB}.Release|x64.ActiveCfg = Release|Any CPU - {965C85E2-D94E-43DE-BFC2-B9D157242EBB}.Release|x64.Build.0 = Release|Any CPU - {7D083C64-FF32-43C4-A82C-32C4A4EC1414}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D083C64-FF32-43C4-A82C-32C4A4EC1414}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D083C64-FF32-43C4-A82C-32C4A4EC1414}.Debug|x64.ActiveCfg = Debug|Any CPU - {7D083C64-FF32-43C4-A82C-32C4A4EC1414}.Debug|x64.Build.0 = Debug|Any CPU - {7D083C64-FF32-43C4-A82C-32C4A4EC1414}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D083C64-FF32-43C4-A82C-32C4A4EC1414}.Release|Any CPU.Build.0 = Release|Any CPU - {7D083C64-FF32-43C4-A82C-32C4A4EC1414}.Release|x64.ActiveCfg = Release|Any CPU - {7D083C64-FF32-43C4-A82C-32C4A4EC1414}.Release|x64.Build.0 = Release|Any CPU - {3870E8F1-B269-425D-8B03-58835FD53610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3870E8F1-B269-425D-8B03-58835FD53610}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3870E8F1-B269-425D-8B03-58835FD53610}.Debug|x64.ActiveCfg = Debug|Any CPU - {3870E8F1-B269-425D-8B03-58835FD53610}.Debug|x64.Build.0 = Debug|Any CPU - {3870E8F1-B269-425D-8B03-58835FD53610}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3870E8F1-B269-425D-8B03-58835FD53610}.Release|Any CPU.Build.0 = Release|Any CPU - {3870E8F1-B269-425D-8B03-58835FD53610}.Release|x64.ActiveCfg = Release|Any CPU - {3870E8F1-B269-425D-8B03-58835FD53610}.Release|x64.Build.0 = Release|Any CPU - {519A99D2-8094-48EC-A888-C0B4E017A4C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {519A99D2-8094-48EC-A888-C0B4E017A4C1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {519A99D2-8094-48EC-A888-C0B4E017A4C1}.Debug|x64.ActiveCfg = Debug|Any CPU - {519A99D2-8094-48EC-A888-C0B4E017A4C1}.Debug|x64.Build.0 = Debug|Any CPU - {519A99D2-8094-48EC-A888-C0B4E017A4C1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {519A99D2-8094-48EC-A888-C0B4E017A4C1}.Release|Any CPU.Build.0 = Release|Any CPU - {519A99D2-8094-48EC-A888-C0B4E017A4C1}.Release|x64.ActiveCfg = Release|Any CPU - {519A99D2-8094-48EC-A888-C0B4E017A4C1}.Release|x64.Build.0 = Release|Any CPU - {E946A129-34ED-4069-B44E-EC7B98751006}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E946A129-34ED-4069-B44E-EC7B98751006}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E946A129-34ED-4069-B44E-EC7B98751006}.Debug|x64.ActiveCfg = Debug|Any CPU - {E946A129-34ED-4069-B44E-EC7B98751006}.Debug|x64.Build.0 = Debug|Any CPU - {E946A129-34ED-4069-B44E-EC7B98751006}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E946A129-34ED-4069-B44E-EC7B98751006}.Release|Any CPU.Build.0 = Release|Any CPU - {E946A129-34ED-4069-B44E-EC7B98751006}.Release|x64.ActiveCfg = Release|Any CPU - {E946A129-34ED-4069-B44E-EC7B98751006}.Release|x64.Build.0 = Release|Any CPU - {F3DA1941-3610-48F3-901A-E2E873979BFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F3DA1941-3610-48F3-901A-E2E873979BFD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F3DA1941-3610-48F3-901A-E2E873979BFD}.Debug|x64.ActiveCfg = Debug|Any CPU - {F3DA1941-3610-48F3-901A-E2E873979BFD}.Debug|x64.Build.0 = Debug|Any CPU - {F3DA1941-3610-48F3-901A-E2E873979BFD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F3DA1941-3610-48F3-901A-E2E873979BFD}.Release|Any CPU.Build.0 = Release|Any CPU - {F3DA1941-3610-48F3-901A-E2E873979BFD}.Release|x64.ActiveCfg = Release|Any CPU - {F3DA1941-3610-48F3-901A-E2E873979BFD}.Release|x64.Build.0 = Release|Any CPU - {EA23C277-97E4-4FBC-A53B-37048813E14F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA23C277-97E4-4FBC-A53B-37048813E14F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA23C277-97E4-4FBC-A53B-37048813E14F}.Debug|x64.ActiveCfg = Debug|Any CPU - {EA23C277-97E4-4FBC-A53B-37048813E14F}.Debug|x64.Build.0 = Debug|Any CPU - {EA23C277-97E4-4FBC-A53B-37048813E14F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA23C277-97E4-4FBC-A53B-37048813E14F}.Release|Any CPU.Build.0 = Release|Any CPU - {EA23C277-97E4-4FBC-A53B-37048813E14F}.Release|x64.ActiveCfg = Release|Any CPU - {EA23C277-97E4-4FBC-A53B-37048813E14F}.Release|x64.Build.0 = Release|Any CPU - {0FF64D9E-98D7-46B1-90FB-C0364C76D65A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0FF64D9E-98D7-46B1-90FB-C0364C76D65A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0FF64D9E-98D7-46B1-90FB-C0364C76D65A}.Debug|x64.ActiveCfg = Debug|Any CPU - {0FF64D9E-98D7-46B1-90FB-C0364C76D65A}.Debug|x64.Build.0 = Debug|Any CPU - {0FF64D9E-98D7-46B1-90FB-C0364C76D65A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0FF64D9E-98D7-46B1-90FB-C0364C76D65A}.Release|Any CPU.Build.0 = Release|Any CPU - {0FF64D9E-98D7-46B1-90FB-C0364C76D65A}.Release|x64.ActiveCfg = Release|Any CPU - {0FF64D9E-98D7-46B1-90FB-C0364C76D65A}.Release|x64.Build.0 = Release|Any CPU - {D375233D-8AAC-4234-BC0D-3D103C600C19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D375233D-8AAC-4234-BC0D-3D103C600C19}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D375233D-8AAC-4234-BC0D-3D103C600C19}.Debug|x64.ActiveCfg = Debug|Any CPU - {D375233D-8AAC-4234-BC0D-3D103C600C19}.Debug|x64.Build.0 = Debug|Any CPU - {D375233D-8AAC-4234-BC0D-3D103C600C19}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D375233D-8AAC-4234-BC0D-3D103C600C19}.Release|Any CPU.Build.0 = Release|Any CPU - {D375233D-8AAC-4234-BC0D-3D103C600C19}.Release|x64.ActiveCfg = Release|Any CPU - {D375233D-8AAC-4234-BC0D-3D103C600C19}.Release|x64.Build.0 = Release|Any CPU - {EAC0AA32-AE9B-4908-AF05-927B70A2B8A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EAC0AA32-AE9B-4908-AF05-927B70A2B8A1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EAC0AA32-AE9B-4908-AF05-927B70A2B8A1}.Debug|x64.ActiveCfg = Debug|Any CPU - {EAC0AA32-AE9B-4908-AF05-927B70A2B8A1}.Debug|x64.Build.0 = Debug|Any CPU - {EAC0AA32-AE9B-4908-AF05-927B70A2B8A1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EAC0AA32-AE9B-4908-AF05-927B70A2B8A1}.Release|Any CPU.Build.0 = Release|Any CPU - {EAC0AA32-AE9B-4908-AF05-927B70A2B8A1}.Release|x64.ActiveCfg = Release|Any CPU - {EAC0AA32-AE9B-4908-AF05-927B70A2B8A1}.Release|x64.Build.0 = Release|Any CPU - {E893C913-98A0-4BB3-A32B-3871BE3C5C53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E893C913-98A0-4BB3-A32B-3871BE3C5C53}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E893C913-98A0-4BB3-A32B-3871BE3C5C53}.Debug|x64.ActiveCfg = Debug|Any CPU - {E893C913-98A0-4BB3-A32B-3871BE3C5C53}.Debug|x64.Build.0 = Debug|Any CPU - {E893C913-98A0-4BB3-A32B-3871BE3C5C53}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E893C913-98A0-4BB3-A32B-3871BE3C5C53}.Release|Any CPU.Build.0 = Release|Any CPU - {E893C913-98A0-4BB3-A32B-3871BE3C5C53}.Release|x64.ActiveCfg = Release|Any CPU - {E893C913-98A0-4BB3-A32B-3871BE3C5C53}.Release|x64.Build.0 = Release|Any CPU - {761C3313-A669-465F-A384-9E118FCE4F89}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {761C3313-A669-465F-A384-9E118FCE4F89}.Debug|Any CPU.Build.0 = Debug|Any CPU - {761C3313-A669-465F-A384-9E118FCE4F89}.Debug|x64.ActiveCfg = Debug|Any CPU - {761C3313-A669-465F-A384-9E118FCE4F89}.Debug|x64.Build.0 = Debug|Any CPU - {761C3313-A669-465F-A384-9E118FCE4F89}.Release|Any CPU.ActiveCfg = Release|Any CPU - {761C3313-A669-465F-A384-9E118FCE4F89}.Release|Any CPU.Build.0 = Release|Any CPU - {761C3313-A669-465F-A384-9E118FCE4F89}.Release|x64.ActiveCfg = Release|Any CPU - {761C3313-A669-465F-A384-9E118FCE4F89}.Release|x64.Build.0 = Release|Any CPU - {1B16DD58-0847-45A7-AF93-53EBFBEDAAE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B16DD58-0847-45A7-AF93-53EBFBEDAAE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B16DD58-0847-45A7-AF93-53EBFBEDAAE7}.Debug|x64.ActiveCfg = Debug|Any CPU - {1B16DD58-0847-45A7-AF93-53EBFBEDAAE7}.Debug|x64.Build.0 = Debug|Any CPU - {1B16DD58-0847-45A7-AF93-53EBFBEDAAE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B16DD58-0847-45A7-AF93-53EBFBEDAAE7}.Release|Any CPU.Build.0 = Release|Any CPU - {1B16DD58-0847-45A7-AF93-53EBFBEDAAE7}.Release|x64.ActiveCfg = Release|Any CPU - {1B16DD58-0847-45A7-AF93-53EBFBEDAAE7}.Release|x64.Build.0 = Release|Any CPU - {C056C688-8FFC-42BC-B4EA-EF3808A8A12C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C056C688-8FFC-42BC-B4EA-EF3808A8A12C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C056C688-8FFC-42BC-B4EA-EF3808A8A12C}.Debug|x64.ActiveCfg = Debug|Any CPU - {C056C688-8FFC-42BC-B4EA-EF3808A8A12C}.Debug|x64.Build.0 = Debug|Any CPU - {C056C688-8FFC-42BC-B4EA-EF3808A8A12C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C056C688-8FFC-42BC-B4EA-EF3808A8A12C}.Release|Any CPU.Build.0 = Release|Any CPU - {C056C688-8FFC-42BC-B4EA-EF3808A8A12C}.Release|x64.ActiveCfg = Release|Any CPU - {C056C688-8FFC-42BC-B4EA-EF3808A8A12C}.Release|x64.Build.0 = Release|Any CPU - {428CDAF3-957A-4017-82EA-70737F205546}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {428CDAF3-957A-4017-82EA-70737F205546}.Debug|Any CPU.Build.0 = Debug|Any CPU - {428CDAF3-957A-4017-82EA-70737F205546}.Debug|x64.ActiveCfg = Debug|Any CPU - {428CDAF3-957A-4017-82EA-70737F205546}.Debug|x64.Build.0 = Debug|Any CPU - {428CDAF3-957A-4017-82EA-70737F205546}.Release|Any CPU.ActiveCfg = Release|Any CPU - {428CDAF3-957A-4017-82EA-70737F205546}.Release|Any CPU.Build.0 = Release|Any CPU - {428CDAF3-957A-4017-82EA-70737F205546}.Release|x64.ActiveCfg = Release|Any CPU - {428CDAF3-957A-4017-82EA-70737F205546}.Release|x64.Build.0 = Release|Any CPU - {DB93B639-899D-4B2C-AF8A-47B4BC6B3776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DB93B639-899D-4B2C-AF8A-47B4BC6B3776}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DB93B639-899D-4B2C-AF8A-47B4BC6B3776}.Debug|x64.ActiveCfg = Debug|Any CPU - {DB93B639-899D-4B2C-AF8A-47B4BC6B3776}.Debug|x64.Build.0 = Debug|Any CPU - {DB93B639-899D-4B2C-AF8A-47B4BC6B3776}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DB93B639-899D-4B2C-AF8A-47B4BC6B3776}.Release|Any CPU.Build.0 = Release|Any CPU - {DB93B639-899D-4B2C-AF8A-47B4BC6B3776}.Release|x64.ActiveCfg = Release|Any CPU - {DB93B639-899D-4B2C-AF8A-47B4BC6B3776}.Release|x64.Build.0 = Release|Any CPU - {A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD}.Debug|x64.ActiveCfg = Debug|Any CPU - {A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD}.Debug|x64.Build.0 = Debug|Any CPU - {A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD}.Release|Any CPU.Build.0 = Release|Any CPU - {A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD}.Release|x64.ActiveCfg = Release|Any CPU - {A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD}.Release|x64.Build.0 = Release|Any CPU - {B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826}.Debug|x64.ActiveCfg = Debug|Any CPU - {B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826}.Debug|x64.Build.0 = Debug|Any CPU - {B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826}.Release|Any CPU.Build.0 = Release|Any CPU - {B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826}.Release|x64.ActiveCfg = Release|Any CPU - {B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826}.Release|x64.Build.0 = Release|Any CPU - {5A163042-B03A-4063-85FF-22D4C5BB5B90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5A163042-B03A-4063-85FF-22D4C5BB5B90}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5A163042-B03A-4063-85FF-22D4C5BB5B90}.Debug|x64.ActiveCfg = Debug|Any CPU - {5A163042-B03A-4063-85FF-22D4C5BB5B90}.Debug|x64.Build.0 = Debug|Any CPU - {5A163042-B03A-4063-85FF-22D4C5BB5B90}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5A163042-B03A-4063-85FF-22D4C5BB5B90}.Release|Any CPU.Build.0 = Release|Any CPU - {5A163042-B03A-4063-85FF-22D4C5BB5B90}.Release|x64.ActiveCfg = Release|Any CPU - {5A163042-B03A-4063-85FF-22D4C5BB5B90}.Release|x64.Build.0 = Release|Any CPU - {84EFF9E1-6852-458F-8D57-62E3F084EA0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84EFF9E1-6852-458F-8D57-62E3F084EA0F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84EFF9E1-6852-458F-8D57-62E3F084EA0F}.Debug|x64.ActiveCfg = Debug|Any CPU - {84EFF9E1-6852-458F-8D57-62E3F084EA0F}.Debug|x64.Build.0 = Debug|Any CPU - {84EFF9E1-6852-458F-8D57-62E3F084EA0F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84EFF9E1-6852-458F-8D57-62E3F084EA0F}.Release|Any CPU.Build.0 = Release|Any CPU - {84EFF9E1-6852-458F-8D57-62E3F084EA0F}.Release|x64.ActiveCfg = Release|Any CPU - {84EFF9E1-6852-458F-8D57-62E3F084EA0F}.Release|x64.Build.0 = Release|Any CPU - {427822F2-7A20-4E3A-B45C-43CE855003C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {427822F2-7A20-4E3A-B45C-43CE855003C1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {427822F2-7A20-4E3A-B45C-43CE855003C1}.Debug|x64.ActiveCfg = Debug|Any CPU - {427822F2-7A20-4E3A-B45C-43CE855003C1}.Debug|x64.Build.0 = Debug|Any CPU - {427822F2-7A20-4E3A-B45C-43CE855003C1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {427822F2-7A20-4E3A-B45C-43CE855003C1}.Release|Any CPU.Build.0 = Release|Any CPU - {427822F2-7A20-4E3A-B45C-43CE855003C1}.Release|x64.ActiveCfg = Release|Any CPU - {427822F2-7A20-4E3A-B45C-43CE855003C1}.Release|x64.Build.0 = Release|Any CPU - {7909A736-6C1E-4622-9BE7-37EF0839FA05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7909A736-6C1E-4622-9BE7-37EF0839FA05}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7909A736-6C1E-4622-9BE7-37EF0839FA05}.Debug|x64.ActiveCfg = Debug|Any CPU - {7909A736-6C1E-4622-9BE7-37EF0839FA05}.Debug|x64.Build.0 = Debug|Any CPU - {7909A736-6C1E-4622-9BE7-37EF0839FA05}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7909A736-6C1E-4622-9BE7-37EF0839FA05}.Release|Any CPU.Build.0 = Release|Any CPU - {7909A736-6C1E-4622-9BE7-37EF0839FA05}.Release|x64.ActiveCfg = Release|Any CPU - {7909A736-6C1E-4622-9BE7-37EF0839FA05}.Release|x64.Build.0 = Release|Any CPU - {1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C}.Debug|x64.ActiveCfg = Debug|Any CPU - {1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C}.Debug|x64.Build.0 = Debug|Any CPU - {1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C}.Release|Any CPU.Build.0 = Release|Any CPU - {1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C}.Release|x64.ActiveCfg = Release|Any CPU - {1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C}.Release|x64.Build.0 = Release|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|x64.ActiveCfg = Debug|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|x64.Build.0 = Debug|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|Any CPU.Build.0 = Release|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|x64.ActiveCfg = Release|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|x64.Build.0 = Release|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|x64.ActiveCfg = Debug|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|x64.Build.0 = Debug|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|Any CPU.Build.0 = Release|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|x64.ActiveCfg = Release|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|x64.Build.0 = Release|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|x64.ActiveCfg = Debug|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|x64.Build.0 = Debug|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|Any CPU.Build.0 = Release|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|x64.ActiveCfg = Release|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|x64.Build.0 = Release|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|x64.ActiveCfg = Debug|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|x64.Build.0 = Debug|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|Any CPU.Build.0 = Release|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|x64.ActiveCfg = Release|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|x64.Build.0 = Release|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|x64.ActiveCfg = Debug|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|x64.Build.0 = Debug|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|Any CPU.Build.0 = Release|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|x64.ActiveCfg = Release|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|x64.Build.0 = Release|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|x64.ActiveCfg = Debug|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|x64.Build.0 = Debug|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Release|Any CPU.Build.0 = Release|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Release|x64.ActiveCfg = Release|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Release|x64.Build.0 = Release|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|Any CPU.Build.0 = Debug|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|x64.ActiveCfg = Debug|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|x64.Build.0 = Debug|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|Any CPU.ActiveCfg = Release|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|Any CPU.Build.0 = Release|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|x64.ActiveCfg = Release|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|x64.Build.0 = Release|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|x64.ActiveCfg = Debug|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|x64.Build.0 = Debug|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|Any CPU.Build.0 = Release|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|x64.ActiveCfg = Release|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|x64.Build.0 = Release|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|x64.ActiveCfg = Debug|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|x64.Build.0 = Debug|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|Any CPU.Build.0 = Release|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|x64.ActiveCfg = Release|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|x64.Build.0 = Release|Any CPU - {4A052E17-4D9E-41EF-89A5-73B917053F8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A052E17-4D9E-41EF-89A5-73B917053F8E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A052E17-4D9E-41EF-89A5-73B917053F8E}.Debug|x64.ActiveCfg = Debug|Any CPU - {4A052E17-4D9E-41EF-89A5-73B917053F8E}.Debug|x64.Build.0 = Debug|Any CPU - {4A052E17-4D9E-41EF-89A5-73B917053F8E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A052E17-4D9E-41EF-89A5-73B917053F8E}.Release|Any CPU.Build.0 = Release|Any CPU - {4A052E17-4D9E-41EF-89A5-73B917053F8E}.Release|x64.ActiveCfg = Release|Any CPU - {4A052E17-4D9E-41EF-89A5-73B917053F8E}.Release|x64.Build.0 = Release|Any CPU - {3F8532EF-3DC9-45F8-9562-994ABE066585}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F8532EF-3DC9-45F8-9562-994ABE066585}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F8532EF-3DC9-45F8-9562-994ABE066585}.Debug|x64.ActiveCfg = Debug|Any CPU - {3F8532EF-3DC9-45F8-9562-994ABE066585}.Debug|x64.Build.0 = Debug|Any CPU - {3F8532EF-3DC9-45F8-9562-994ABE066585}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F8532EF-3DC9-45F8-9562-994ABE066585}.Release|Any CPU.Build.0 = Release|Any CPU - {3F8532EF-3DC9-45F8-9562-994ABE066585}.Release|x64.ActiveCfg = Release|Any CPU - {3F8532EF-3DC9-45F8-9562-994ABE066585}.Release|x64.Build.0 = Release|Any CPU - {31262D61-26A4-4302-968D-52B8DA4558CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {31262D61-26A4-4302-968D-52B8DA4558CD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {31262D61-26A4-4302-968D-52B8DA4558CD}.Debug|x64.ActiveCfg = Debug|Any CPU - {31262D61-26A4-4302-968D-52B8DA4558CD}.Debug|x64.Build.0 = Debug|Any CPU - {31262D61-26A4-4302-968D-52B8DA4558CD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {31262D61-26A4-4302-968D-52B8DA4558CD}.Release|Any CPU.Build.0 = Release|Any CPU - {31262D61-26A4-4302-968D-52B8DA4558CD}.Release|x64.ActiveCfg = Release|Any CPU - {31262D61-26A4-4302-968D-52B8DA4558CD}.Release|x64.Build.0 = Release|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|x64.ActiveCfg = Debug|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|x64.Build.0 = Debug|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|Any CPU.Build.0 = Release|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|x64.ActiveCfg = Release|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|x64.Build.0 = Release|Any CPU - {F52E5BA6-C2D4-4797-AF71-6389FEC246B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F52E5BA6-C2D4-4797-AF71-6389FEC246B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F52E5BA6-C2D4-4797-AF71-6389FEC246B5}.Debug|x64.ActiveCfg = Debug|Any CPU - {F52E5BA6-C2D4-4797-AF71-6389FEC246B5}.Debug|x64.Build.0 = Debug|Any CPU - {F52E5BA6-C2D4-4797-AF71-6389FEC246B5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F52E5BA6-C2D4-4797-AF71-6389FEC246B5}.Release|Any CPU.Build.0 = Release|Any CPU - {F52E5BA6-C2D4-4797-AF71-6389FEC246B5}.Release|x64.ActiveCfg = Release|Any CPU - {F52E5BA6-C2D4-4797-AF71-6389FEC246B5}.Release|x64.Build.0 = Release|Any CPU - {823D2A6E-20AB-45FF-AD07-5E7933FA6DE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {823D2A6E-20AB-45FF-AD07-5E7933FA6DE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {823D2A6E-20AB-45FF-AD07-5E7933FA6DE7}.Debug|x64.ActiveCfg = Debug|Any CPU - {823D2A6E-20AB-45FF-AD07-5E7933FA6DE7}.Debug|x64.Build.0 = Debug|Any CPU - {823D2A6E-20AB-45FF-AD07-5E7933FA6DE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {823D2A6E-20AB-45FF-AD07-5E7933FA6DE7}.Release|Any CPU.Build.0 = Release|Any CPU - {823D2A6E-20AB-45FF-AD07-5E7933FA6DE7}.Release|x64.ActiveCfg = Release|Any CPU - {823D2A6E-20AB-45FF-AD07-5E7933FA6DE7}.Release|x64.Build.0 = Release|Any CPU - {7C382E43-A515-4C67-9296-FB8A630C4A49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C382E43-A515-4C67-9296-FB8A630C4A49}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C382E43-A515-4C67-9296-FB8A630C4A49}.Debug|x64.ActiveCfg = Debug|Any CPU - {7C382E43-A515-4C67-9296-FB8A630C4A49}.Debug|x64.Build.0 = Debug|Any CPU - {7C382E43-A515-4C67-9296-FB8A630C4A49}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C382E43-A515-4C67-9296-FB8A630C4A49}.Release|Any CPU.Build.0 = Release|Any CPU - {7C382E43-A515-4C67-9296-FB8A630C4A49}.Release|x64.ActiveCfg = Release|Any CPU - {7C382E43-A515-4C67-9296-FB8A630C4A49}.Release|x64.Build.0 = Release|Any CPU - {95AF448B-F34C-4DF8-9E9B-DF499FABA099}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95AF448B-F34C-4DF8-9E9B-DF499FABA099}.Debug|Any CPU.Build.0 = Debug|Any CPU - {95AF448B-F34C-4DF8-9E9B-DF499FABA099}.Debug|x64.ActiveCfg = Debug|Any CPU - {95AF448B-F34C-4DF8-9E9B-DF499FABA099}.Debug|x64.Build.0 = Debug|Any CPU - {95AF448B-F34C-4DF8-9E9B-DF499FABA099}.Release|Any CPU.ActiveCfg = Release|Any CPU - {95AF448B-F34C-4DF8-9E9B-DF499FABA099}.Release|Any CPU.Build.0 = Release|Any CPU - {95AF448B-F34C-4DF8-9E9B-DF499FABA099}.Release|x64.ActiveCfg = Release|Any CPU - {95AF448B-F34C-4DF8-9E9B-DF499FABA099}.Release|x64.Build.0 = Release|Any CPU - {4C3307D4-2A6B-41E3-BE9E-2FD083578450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4C3307D4-2A6B-41E3-BE9E-2FD083578450}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C3307D4-2A6B-41E3-BE9E-2FD083578450}.Debug|x64.ActiveCfg = Debug|Any CPU - {4C3307D4-2A6B-41E3-BE9E-2FD083578450}.Debug|x64.Build.0 = Debug|Any CPU - {4C3307D4-2A6B-41E3-BE9E-2FD083578450}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4C3307D4-2A6B-41E3-BE9E-2FD083578450}.Release|Any CPU.Build.0 = Release|Any CPU - {4C3307D4-2A6B-41E3-BE9E-2FD083578450}.Release|x64.ActiveCfg = Release|Any CPU - {4C3307D4-2A6B-41E3-BE9E-2FD083578450}.Release|x64.Build.0 = Release|Any CPU - {AA1993F7-5BAE-45F8-A8F5-31E88A25ED83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA1993F7-5BAE-45F8-A8F5-31E88A25ED83}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA1993F7-5BAE-45F8-A8F5-31E88A25ED83}.Debug|x64.ActiveCfg = Debug|Any CPU - {AA1993F7-5BAE-45F8-A8F5-31E88A25ED83}.Debug|x64.Build.0 = Debug|Any CPU - {AA1993F7-5BAE-45F8-A8F5-31E88A25ED83}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA1993F7-5BAE-45F8-A8F5-31E88A25ED83}.Release|Any CPU.Build.0 = Release|Any CPU - {AA1993F7-5BAE-45F8-A8F5-31E88A25ED83}.Release|x64.ActiveCfg = Release|Any CPU - {AA1993F7-5BAE-45F8-A8F5-31E88A25ED83}.Release|x64.Build.0 = Release|Any CPU - {F1826D84-1A16-41A4-A57B-F0DBB5A18745}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F1826D84-1A16-41A4-A57B-F0DBB5A18745}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F1826D84-1A16-41A4-A57B-F0DBB5A18745}.Debug|x64.ActiveCfg = Debug|Any CPU - {F1826D84-1A16-41A4-A57B-F0DBB5A18745}.Debug|x64.Build.0 = Debug|Any CPU - {F1826D84-1A16-41A4-A57B-F0DBB5A18745}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F1826D84-1A16-41A4-A57B-F0DBB5A18745}.Release|Any CPU.Build.0 = Release|Any CPU - {F1826D84-1A16-41A4-A57B-F0DBB5A18745}.Release|x64.ActiveCfg = Release|Any CPU - {F1826D84-1A16-41A4-A57B-F0DBB5A18745}.Release|x64.Build.0 = Release|Any CPU - {2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38}.Debug|x64.ActiveCfg = Debug|Any CPU - {2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38}.Debug|x64.Build.0 = Debug|Any CPU - {2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38}.Release|Any CPU.Build.0 = Release|Any CPU - {2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38}.Release|x64.ActiveCfg = Release|Any CPU - {2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38}.Release|x64.Build.0 = Release|Any CPU - {F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F}.Debug|x64.ActiveCfg = Debug|Any CPU - {F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F}.Debug|x64.Build.0 = Debug|Any CPU - {F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F}.Release|Any CPU.Build.0 = Release|Any CPU - {F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F}.Release|x64.ActiveCfg = Release|Any CPU - {F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F}.Release|x64.Build.0 = Release|Any CPU - {118A91A6-6FBB-431A-B50D-076375AD6A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {118A91A6-6FBB-431A-B50D-076375AD6A63}.Debug|Any CPU.Build.0 = Debug|Any CPU - {118A91A6-6FBB-431A-B50D-076375AD6A63}.Debug|x64.ActiveCfg = Debug|Any CPU - {118A91A6-6FBB-431A-B50D-076375AD6A63}.Debug|x64.Build.0 = Debug|Any CPU - {118A91A6-6FBB-431A-B50D-076375AD6A63}.Release|Any CPU.ActiveCfg = Release|Any CPU - {118A91A6-6FBB-431A-B50D-076375AD6A63}.Release|Any CPU.Build.0 = Release|Any CPU - {118A91A6-6FBB-431A-B50D-076375AD6A63}.Release|x64.ActiveCfg = Release|Any CPU - {118A91A6-6FBB-431A-B50D-076375AD6A63}.Release|x64.Build.0 = Release|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|x64.ActiveCfg = Debug|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|x64.Build.0 = Debug|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|Any CPU.Build.0 = Release|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|x64.ActiveCfg = Release|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|x64.Build.0 = Release|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|x64.ActiveCfg = Debug|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|x64.Build.0 = Debug|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|Any CPU.Build.0 = Release|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|x64.ActiveCfg = Release|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|x64.Build.0 = Release|Any CPU - {C4DDEA6E-D6AF-4890-9713-C2862403E57C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C4DDEA6E-D6AF-4890-9713-C2862403E57C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C4DDEA6E-D6AF-4890-9713-C2862403E57C}.Debug|x64.ActiveCfg = Debug|Any CPU - {C4DDEA6E-D6AF-4890-9713-C2862403E57C}.Debug|x64.Build.0 = Debug|Any CPU - {C4DDEA6E-D6AF-4890-9713-C2862403E57C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C4DDEA6E-D6AF-4890-9713-C2862403E57C}.Release|Any CPU.Build.0 = Release|Any CPU - {C4DDEA6E-D6AF-4890-9713-C2862403E57C}.Release|x64.ActiveCfg = Release|Any CPU - {C4DDEA6E-D6AF-4890-9713-C2862403E57C}.Release|x64.Build.0 = Release|Any CPU - {86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE}.Debug|x64.ActiveCfg = Debug|Any CPU - {86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE}.Debug|x64.Build.0 = Debug|Any CPU - {86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE}.Release|Any CPU.Build.0 = Release|Any CPU - {86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE}.Release|x64.ActiveCfg = Release|Any CPU - {86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE}.Release|x64.Build.0 = Release|Any CPU - {97532A33-A591-4DF5-A2C0-72527B78ED82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97532A33-A591-4DF5-A2C0-72527B78ED82}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97532A33-A591-4DF5-A2C0-72527B78ED82}.Debug|x64.ActiveCfg = Debug|Any CPU - {97532A33-A591-4DF5-A2C0-72527B78ED82}.Debug|x64.Build.0 = Debug|Any CPU - {97532A33-A591-4DF5-A2C0-72527B78ED82}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97532A33-A591-4DF5-A2C0-72527B78ED82}.Release|Any CPU.Build.0 = Release|Any CPU - {97532A33-A591-4DF5-A2C0-72527B78ED82}.Release|x64.ActiveCfg = Release|Any CPU - {97532A33-A591-4DF5-A2C0-72527B78ED82}.Release|x64.Build.0 = Release|Any CPU - {B8358ED1-C95A-4EC0-9756-FB32C931F204}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B8358ED1-C95A-4EC0-9756-FB32C931F204}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B8358ED1-C95A-4EC0-9756-FB32C931F204}.Debug|x64.ActiveCfg = Debug|Any CPU - {B8358ED1-C95A-4EC0-9756-FB32C931F204}.Debug|x64.Build.0 = Debug|Any CPU - {B8358ED1-C95A-4EC0-9756-FB32C931F204}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B8358ED1-C95A-4EC0-9756-FB32C931F204}.Release|Any CPU.Build.0 = Release|Any CPU - {B8358ED1-C95A-4EC0-9756-FB32C931F204}.Release|x64.ActiveCfg = Release|Any CPU - {B8358ED1-C95A-4EC0-9756-FB32C931F204}.Release|x64.Build.0 = Release|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|x64.ActiveCfg = Debug|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|x64.Build.0 = Debug|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|Any CPU.Build.0 = Release|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|x64.ActiveCfg = Release|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|x64.Build.0 = Release|Any CPU - {79D639DC-DDE4-45B1-884D-60B6908F528E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {79D639DC-DDE4-45B1-884D-60B6908F528E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {79D639DC-DDE4-45B1-884D-60B6908F528E}.Debug|x64.ActiveCfg = Debug|Any CPU - {79D639DC-DDE4-45B1-884D-60B6908F528E}.Debug|x64.Build.0 = Debug|Any CPU - {79D639DC-DDE4-45B1-884D-60B6908F528E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {79D639DC-DDE4-45B1-884D-60B6908F528E}.Release|Any CPU.Build.0 = Release|Any CPU - {79D639DC-DDE4-45B1-884D-60B6908F528E}.Release|x64.ActiveCfg = Release|Any CPU - {79D639DC-DDE4-45B1-884D-60B6908F528E}.Release|x64.Build.0 = Release|Any CPU - {834A12D0-FBED-45B3-86EA-5EA114C516B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {834A12D0-FBED-45B3-86EA-5EA114C516B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {834A12D0-FBED-45B3-86EA-5EA114C516B5}.Debug|x64.ActiveCfg = Debug|Any CPU - {834A12D0-FBED-45B3-86EA-5EA114C516B5}.Debug|x64.Build.0 = Debug|Any CPU - {834A12D0-FBED-45B3-86EA-5EA114C516B5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {834A12D0-FBED-45B3-86EA-5EA114C516B5}.Release|Any CPU.Build.0 = Release|Any CPU - {834A12D0-FBED-45B3-86EA-5EA114C516B5}.Release|x64.ActiveCfg = Release|Any CPU - {834A12D0-FBED-45B3-86EA-5EA114C516B5}.Release|x64.Build.0 = Release|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Debug|x64.ActiveCfg = Debug|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Debug|x64.Build.0 = Debug|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Release|Any CPU.Build.0 = Release|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Release|x64.ActiveCfg = Release|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Release|x64.Build.0 = Release|Any CPU - {87DD354D-4D48-4918-ACDE-A7FF62FA0DD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {87DD354D-4D48-4918-ACDE-A7FF62FA0DD8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {87DD354D-4D48-4918-ACDE-A7FF62FA0DD8}.Debug|x64.ActiveCfg = Debug|Any CPU - {87DD354D-4D48-4918-ACDE-A7FF62FA0DD8}.Debug|x64.Build.0 = Debug|Any CPU - {87DD354D-4D48-4918-ACDE-A7FF62FA0DD8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {87DD354D-4D48-4918-ACDE-A7FF62FA0DD8}.Release|Any CPU.Build.0 = Release|Any CPU - {87DD354D-4D48-4918-ACDE-A7FF62FA0DD8}.Release|x64.ActiveCfg = Release|Any CPU - {87DD354D-4D48-4918-ACDE-A7FF62FA0DD8}.Release|x64.Build.0 = Release|Any CPU - {D5EA7A25-0FD2-4545-9C1C-FF96E5E35145}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5EA7A25-0FD2-4545-9C1C-FF96E5E35145}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5EA7A25-0FD2-4545-9C1C-FF96E5E35145}.Debug|x64.ActiveCfg = Debug|Any CPU - {D5EA7A25-0FD2-4545-9C1C-FF96E5E35145}.Debug|x64.Build.0 = Debug|Any CPU - {D5EA7A25-0FD2-4545-9C1C-FF96E5E35145}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5EA7A25-0FD2-4545-9C1C-FF96E5E35145}.Release|Any CPU.Build.0 = Release|Any CPU - {D5EA7A25-0FD2-4545-9C1C-FF96E5E35145}.Release|x64.ActiveCfg = Release|Any CPU - {D5EA7A25-0FD2-4545-9C1C-FF96E5E35145}.Release|x64.Build.0 = Release|Any CPU - {E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3}.Debug|x64.ActiveCfg = Debug|Any CPU - {E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3}.Debug|x64.Build.0 = Debug|Any CPU - {E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3}.Release|Any CPU.Build.0 = Release|Any CPU - {E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3}.Release|x64.ActiveCfg = Release|Any CPU - {E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3}.Release|x64.Build.0 = Release|Any CPU - {E868B34E-D1ED-412A-9382-954B84EDE80C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E868B34E-D1ED-412A-9382-954B84EDE80C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E868B34E-D1ED-412A-9382-954B84EDE80C}.Debug|x64.ActiveCfg = Debug|Any CPU - {E868B34E-D1ED-412A-9382-954B84EDE80C}.Debug|x64.Build.0 = Debug|Any CPU - {E868B34E-D1ED-412A-9382-954B84EDE80C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E868B34E-D1ED-412A-9382-954B84EDE80C}.Release|Any CPU.Build.0 = Release|Any CPU - {E868B34E-D1ED-412A-9382-954B84EDE80C}.Release|x64.ActiveCfg = Release|Any CPU - {E868B34E-D1ED-412A-9382-954B84EDE80C}.Release|x64.Build.0 = Release|Any CPU - {C8A78B0F-BF6B-4317-8C22-535626C263EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8A78B0F-BF6B-4317-8C22-535626C263EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8A78B0F-BF6B-4317-8C22-535626C263EC}.Debug|x64.ActiveCfg = Debug|Any CPU - {C8A78B0F-BF6B-4317-8C22-535626C263EC}.Debug|x64.Build.0 = Debug|Any CPU - {C8A78B0F-BF6B-4317-8C22-535626C263EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8A78B0F-BF6B-4317-8C22-535626C263EC}.Release|Any CPU.Build.0 = Release|Any CPU - {C8A78B0F-BF6B-4317-8C22-535626C263EC}.Release|x64.ActiveCfg = Release|Any CPU - {C8A78B0F-BF6B-4317-8C22-535626C263EC}.Release|x64.Build.0 = Release|Any CPU - {69778426-7179-4B0C-8398-2F3BECA0FE93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {69778426-7179-4B0C-8398-2F3BECA0FE93}.Debug|Any CPU.Build.0 = Debug|Any CPU - {69778426-7179-4B0C-8398-2F3BECA0FE93}.Debug|x64.ActiveCfg = Debug|Any CPU - {69778426-7179-4B0C-8398-2F3BECA0FE93}.Debug|x64.Build.0 = Debug|Any CPU - {69778426-7179-4B0C-8398-2F3BECA0FE93}.Release|Any CPU.ActiveCfg = Release|Any CPU - {69778426-7179-4B0C-8398-2F3BECA0FE93}.Release|Any CPU.Build.0 = Release|Any CPU - {69778426-7179-4B0C-8398-2F3BECA0FE93}.Release|x64.ActiveCfg = Release|Any CPU - {69778426-7179-4B0C-8398-2F3BECA0FE93}.Release|x64.Build.0 = Release|Any CPU - {0D50F5EB-D580-4041-A6FA-F5373EF10566}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D50F5EB-D580-4041-A6FA-F5373EF10566}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D50F5EB-D580-4041-A6FA-F5373EF10566}.Debug|x64.ActiveCfg = Debug|Any CPU - {0D50F5EB-D580-4041-A6FA-F5373EF10566}.Debug|x64.Build.0 = Debug|Any CPU - {0D50F5EB-D580-4041-A6FA-F5373EF10566}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D50F5EB-D580-4041-A6FA-F5373EF10566}.Release|Any CPU.Build.0 = Release|Any CPU - {0D50F5EB-D580-4041-A6FA-F5373EF10566}.Release|x64.ActiveCfg = Release|Any CPU - {0D50F5EB-D580-4041-A6FA-F5373EF10566}.Release|x64.Build.0 = Release|Any CPU - {84A64849-AD9C-4618-BC87-07CCE7AD7FE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84A64849-AD9C-4618-BC87-07CCE7AD7FE2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84A64849-AD9C-4618-BC87-07CCE7AD7FE2}.Debug|x64.ActiveCfg = Debug|Any CPU - {84A64849-AD9C-4618-BC87-07CCE7AD7FE2}.Debug|x64.Build.0 = Debug|Any CPU - {84A64849-AD9C-4618-BC87-07CCE7AD7FE2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84A64849-AD9C-4618-BC87-07CCE7AD7FE2}.Release|Any CPU.Build.0 = Release|Any CPU - {84A64849-AD9C-4618-BC87-07CCE7AD7FE2}.Release|x64.ActiveCfg = Release|Any CPU - {84A64849-AD9C-4618-BC87-07CCE7AD7FE2}.Release|x64.Build.0 = Release|Any CPU - {96B87330-1B65-4E79-A5AD-E2268A582434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {96B87330-1B65-4E79-A5AD-E2268A582434}.Debug|Any CPU.Build.0 = Debug|Any CPU - {96B87330-1B65-4E79-A5AD-E2268A582434}.Debug|x64.ActiveCfg = Debug|Any CPU - {96B87330-1B65-4E79-A5AD-E2268A582434}.Debug|x64.Build.0 = Debug|Any CPU - {96B87330-1B65-4E79-A5AD-E2268A582434}.Release|Any CPU.ActiveCfg = Release|Any CPU - {96B87330-1B65-4E79-A5AD-E2268A582434}.Release|Any CPU.Build.0 = Release|Any CPU - {96B87330-1B65-4E79-A5AD-E2268A582434}.Release|x64.ActiveCfg = Release|Any CPU - {96B87330-1B65-4E79-A5AD-E2268A582434}.Release|x64.Build.0 = Release|Any CPU - {124A4190-6B03-4A1C-B2BE-979DD1FB511F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {124A4190-6B03-4A1C-B2BE-979DD1FB511F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {124A4190-6B03-4A1C-B2BE-979DD1FB511F}.Debug|x64.ActiveCfg = Debug|Any CPU - {124A4190-6B03-4A1C-B2BE-979DD1FB511F}.Debug|x64.Build.0 = Debug|Any CPU - {124A4190-6B03-4A1C-B2BE-979DD1FB511F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {124A4190-6B03-4A1C-B2BE-979DD1FB511F}.Release|Any CPU.Build.0 = Release|Any CPU - {124A4190-6B03-4A1C-B2BE-979DD1FB511F}.Release|x64.ActiveCfg = Release|Any CPU - {124A4190-6B03-4A1C-B2BE-979DD1FB511F}.Release|x64.Build.0 = Release|Any CPU - {690D8379-B630-41FD-88F0-6D1EBB4BC3D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {690D8379-B630-41FD-88F0-6D1EBB4BC3D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {690D8379-B630-41FD-88F0-6D1EBB4BC3D4}.Debug|x64.ActiveCfg = Debug|Any CPU - {690D8379-B630-41FD-88F0-6D1EBB4BC3D4}.Debug|x64.Build.0 = Debug|Any CPU - {690D8379-B630-41FD-88F0-6D1EBB4BC3D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {690D8379-B630-41FD-88F0-6D1EBB4BC3D4}.Release|Any CPU.Build.0 = Release|Any CPU - {690D8379-B630-41FD-88F0-6D1EBB4BC3D4}.Release|x64.ActiveCfg = Release|Any CPU - {690D8379-B630-41FD-88F0-6D1EBB4BC3D4}.Release|x64.Build.0 = Release|Any CPU - {7C7CEBAE-38A4-435D-BEC2-2425D58FABDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C7CEBAE-38A4-435D-BEC2-2425D58FABDC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C7CEBAE-38A4-435D-BEC2-2425D58FABDC}.Debug|x64.ActiveCfg = Debug|Any CPU - {7C7CEBAE-38A4-435D-BEC2-2425D58FABDC}.Debug|x64.Build.0 = Debug|Any CPU - {7C7CEBAE-38A4-435D-BEC2-2425D58FABDC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C7CEBAE-38A4-435D-BEC2-2425D58FABDC}.Release|Any CPU.Build.0 = Release|Any CPU - {7C7CEBAE-38A4-435D-BEC2-2425D58FABDC}.Release|x64.ActiveCfg = Release|Any CPU - {7C7CEBAE-38A4-435D-BEC2-2425D58FABDC}.Release|x64.Build.0 = Release|Any CPU - {EB0F6BDA-C6AA-4859-834E-5613BB38862B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EB0F6BDA-C6AA-4859-834E-5613BB38862B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EB0F6BDA-C6AA-4859-834E-5613BB38862B}.Debug|x64.ActiveCfg = Debug|Any CPU - {EB0F6BDA-C6AA-4859-834E-5613BB38862B}.Debug|x64.Build.0 = Debug|Any CPU - {EB0F6BDA-C6AA-4859-834E-5613BB38862B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EB0F6BDA-C6AA-4859-834E-5613BB38862B}.Release|Any CPU.Build.0 = Release|Any CPU - {EB0F6BDA-C6AA-4859-834E-5613BB38862B}.Release|x64.ActiveCfg = Release|Any CPU - {EB0F6BDA-C6AA-4859-834E-5613BB38862B}.Release|x64.Build.0 = Release|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|x64.ActiveCfg = Debug|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|x64.Build.0 = Debug|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|Any CPU.Build.0 = Release|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|x64.ActiveCfg = Release|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|x64.Build.0 = Release|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|x64.ActiveCfg = Debug|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|x64.Build.0 = Debug|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|Any CPU.Build.0 = Release|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|x64.ActiveCfg = Release|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|x64.Build.0 = Release|Any CPU - {CE1CABB0-B307-4709-84E0-583382FAAA29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE1CABB0-B307-4709-84E0-583382FAAA29}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE1CABB0-B307-4709-84E0-583382FAAA29}.Debug|x64.ActiveCfg = Debug|Any CPU - {CE1CABB0-B307-4709-84E0-583382FAAA29}.Debug|x64.Build.0 = Debug|Any CPU - {CE1CABB0-B307-4709-84E0-583382FAAA29}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE1CABB0-B307-4709-84E0-583382FAAA29}.Release|Any CPU.Build.0 = Release|Any CPU - {CE1CABB0-B307-4709-84E0-583382FAAA29}.Release|x64.ActiveCfg = Release|Any CPU - {CE1CABB0-B307-4709-84E0-583382FAAA29}.Release|x64.Build.0 = Release|Any CPU - {E7987CBB-8DDD-4AC5-B522-653E2F457C85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E7987CBB-8DDD-4AC5-B522-653E2F457C85}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E7987CBB-8DDD-4AC5-B522-653E2F457C85}.Debug|x64.ActiveCfg = Debug|Any CPU - {E7987CBB-8DDD-4AC5-B522-653E2F457C85}.Debug|x64.Build.0 = Debug|Any CPU - {E7987CBB-8DDD-4AC5-B522-653E2F457C85}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E7987CBB-8DDD-4AC5-B522-653E2F457C85}.Release|Any CPU.Build.0 = Release|Any CPU - {E7987CBB-8DDD-4AC5-B522-653E2F457C85}.Release|x64.ActiveCfg = Release|Any CPU - {E7987CBB-8DDD-4AC5-B522-653E2F457C85}.Release|x64.Build.0 = Release|Any CPU - {AD427256-9686-4289-A635-1B387BD56D15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AD427256-9686-4289-A635-1B387BD56D15}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AD427256-9686-4289-A635-1B387BD56D15}.Debug|x64.ActiveCfg = Debug|Any CPU - {AD427256-9686-4289-A635-1B387BD56D15}.Debug|x64.Build.0 = Debug|Any CPU - {AD427256-9686-4289-A635-1B387BD56D15}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AD427256-9686-4289-A635-1B387BD56D15}.Release|Any CPU.Build.0 = Release|Any CPU - {AD427256-9686-4289-A635-1B387BD56D15}.Release|x64.ActiveCfg = Release|Any CPU - {AD427256-9686-4289-A635-1B387BD56D15}.Release|x64.Build.0 = Release|Any CPU - {2B644A8C-F0EE-4566-AB78-9E1C6D4185A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B644A8C-F0EE-4566-AB78-9E1C6D4185A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B644A8C-F0EE-4566-AB78-9E1C6D4185A3}.Debug|x64.ActiveCfg = Debug|Any CPU - {2B644A8C-F0EE-4566-AB78-9E1C6D4185A3}.Debug|x64.Build.0 = Debug|Any CPU - {2B644A8C-F0EE-4566-AB78-9E1C6D4185A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B644A8C-F0EE-4566-AB78-9E1C6D4185A3}.Release|Any CPU.Build.0 = Release|Any CPU - {2B644A8C-F0EE-4566-AB78-9E1C6D4185A3}.Release|x64.ActiveCfg = Release|Any CPU - {2B644A8C-F0EE-4566-AB78-9E1C6D4185A3}.Release|x64.Build.0 = Release|Any CPU - {DC50078D-D706-4CB9-A301-F47CB3F46007}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC50078D-D706-4CB9-A301-F47CB3F46007}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC50078D-D706-4CB9-A301-F47CB3F46007}.Debug|x64.ActiveCfg = Debug|Any CPU - {DC50078D-D706-4CB9-A301-F47CB3F46007}.Debug|x64.Build.0 = Debug|Any CPU - {DC50078D-D706-4CB9-A301-F47CB3F46007}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC50078D-D706-4CB9-A301-F47CB3F46007}.Release|Any CPU.Build.0 = Release|Any CPU - {DC50078D-D706-4CB9-A301-F47CB3F46007}.Release|x64.ActiveCfg = Release|Any CPU - {DC50078D-D706-4CB9-A301-F47CB3F46007}.Release|x64.Build.0 = Release|Any CPU - {D8E85337-A779-48FC-B822-CE8A850661DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D8E85337-A779-48FC-B822-CE8A850661DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D8E85337-A779-48FC-B822-CE8A850661DC}.Debug|x64.ActiveCfg = Debug|Any CPU - {D8E85337-A779-48FC-B822-CE8A850661DC}.Debug|x64.Build.0 = Debug|Any CPU - {D8E85337-A779-48FC-B822-CE8A850661DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D8E85337-A779-48FC-B822-CE8A850661DC}.Release|Any CPU.Build.0 = Release|Any CPU - {D8E85337-A779-48FC-B822-CE8A850661DC}.Release|x64.ActiveCfg = Release|Any CPU - {D8E85337-A779-48FC-B822-CE8A850661DC}.Release|x64.Build.0 = Release|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|Any CPU.Build.0 = Debug|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|x64.ActiveCfg = Debug|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|x64.Build.0 = Debug|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|Any CPU.ActiveCfg = Release|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|Any CPU.Build.0 = Release|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|x64.ActiveCfg = Release|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|x64.Build.0 = Release|Any CPU - {24E5BF57-33B6-4D5B-A32F-2F64D1A5954F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {24E5BF57-33B6-4D5B-A32F-2F64D1A5954F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {24E5BF57-33B6-4D5B-A32F-2F64D1A5954F}.Debug|x64.ActiveCfg = Debug|Any CPU - {24E5BF57-33B6-4D5B-A32F-2F64D1A5954F}.Debug|x64.Build.0 = Debug|Any CPU - {24E5BF57-33B6-4D5B-A32F-2F64D1A5954F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {24E5BF57-33B6-4D5B-A32F-2F64D1A5954F}.Release|Any CPU.Build.0 = Release|Any CPU - {24E5BF57-33B6-4D5B-A32F-2F64D1A5954F}.Release|x64.ActiveCfg = Release|Any CPU - {24E5BF57-33B6-4D5B-A32F-2F64D1A5954F}.Release|x64.Build.0 = Release|Any CPU - {B15F4561-E511-42EA-A02E-F772BAF41E20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B15F4561-E511-42EA-A02E-F772BAF41E20}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B15F4561-E511-42EA-A02E-F772BAF41E20}.Debug|x64.ActiveCfg = Debug|Any CPU - {B15F4561-E511-42EA-A02E-F772BAF41E20}.Debug|x64.Build.0 = Debug|Any CPU - {B15F4561-E511-42EA-A02E-F772BAF41E20}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B15F4561-E511-42EA-A02E-F772BAF41E20}.Release|Any CPU.Build.0 = Release|Any CPU - {B15F4561-E511-42EA-A02E-F772BAF41E20}.Release|x64.ActiveCfg = Release|Any CPU - {B15F4561-E511-42EA-A02E-F772BAF41E20}.Release|x64.Build.0 = Release|Any CPU - {32488758-25C9-4257-9B98-DAA034C19909}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {32488758-25C9-4257-9B98-DAA034C19909}.Debug|Any CPU.Build.0 = Debug|Any CPU - {32488758-25C9-4257-9B98-DAA034C19909}.Debug|x64.ActiveCfg = Debug|Any CPU - {32488758-25C9-4257-9B98-DAA034C19909}.Debug|x64.Build.0 = Debug|Any CPU - {32488758-25C9-4257-9B98-DAA034C19909}.Release|Any CPU.ActiveCfg = Release|Any CPU - {32488758-25C9-4257-9B98-DAA034C19909}.Release|Any CPU.Build.0 = Release|Any CPU - {32488758-25C9-4257-9B98-DAA034C19909}.Release|x64.ActiveCfg = Release|Any CPU - {32488758-25C9-4257-9B98-DAA034C19909}.Release|x64.Build.0 = Release|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|x64.ActiveCfg = Debug|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|x64.Build.0 = Debug|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|Any CPU.Build.0 = Release|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|x64.ActiveCfg = Release|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|x64.Build.0 = Release|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|x64.ActiveCfg = Debug|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|x64.Build.0 = Debug|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|Any CPU.Build.0 = Release|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|x64.ActiveCfg = Release|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|x64.Build.0 = Release|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|Any CPU.Build.0 = Debug|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|x64.ActiveCfg = Debug|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|x64.Build.0 = Debug|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|Any CPU.ActiveCfg = Release|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|Any CPU.Build.0 = Release|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|x64.ActiveCfg = Release|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|x64.Build.0 = Release|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|x64.ActiveCfg = Debug|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|x64.Build.0 = Debug|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|Any CPU.Build.0 = Release|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|x64.ActiveCfg = Release|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|x64.Build.0 = Release|Any CPU - {FBF18906-7113-4036-BAEB-56E925F7D301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FBF18906-7113-4036-BAEB-56E925F7D301}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBF18906-7113-4036-BAEB-56E925F7D301}.Debug|x64.ActiveCfg = Debug|Any CPU - {FBF18906-7113-4036-BAEB-56E925F7D301}.Debug|x64.Build.0 = Debug|Any CPU - {FBF18906-7113-4036-BAEB-56E925F7D301}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FBF18906-7113-4036-BAEB-56E925F7D301}.Release|Any CPU.Build.0 = Release|Any CPU - {FBF18906-7113-4036-BAEB-56E925F7D301}.Release|x64.ActiveCfg = Release|Any CPU - {FBF18906-7113-4036-BAEB-56E925F7D301}.Release|x64.Build.0 = Release|Any CPU - {661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0}.Debug|x64.ActiveCfg = Debug|Any CPU - {661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0}.Debug|x64.Build.0 = Debug|Any CPU - {661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0}.Release|Any CPU.Build.0 = Release|Any CPU - {661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0}.Release|x64.ActiveCfg = Release|Any CPU - {661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0}.Release|x64.Build.0 = Release|Any CPU - {F2E1018A-F423-4782-BE9D-6169C669AD43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F2E1018A-F423-4782-BE9D-6169C669AD43}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F2E1018A-F423-4782-BE9D-6169C669AD43}.Debug|x64.ActiveCfg = Debug|Any CPU - {F2E1018A-F423-4782-BE9D-6169C669AD43}.Debug|x64.Build.0 = Debug|Any CPU - {F2E1018A-F423-4782-BE9D-6169C669AD43}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F2E1018A-F423-4782-BE9D-6169C669AD43}.Release|Any CPU.Build.0 = Release|Any CPU - {F2E1018A-F423-4782-BE9D-6169C669AD43}.Release|x64.ActiveCfg = Release|Any CPU - {F2E1018A-F423-4782-BE9D-6169C669AD43}.Release|x64.Build.0 = Release|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|x64.ActiveCfg = Debug|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|x64.Build.0 = Debug|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|Any CPU.Build.0 = Release|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|x64.ActiveCfg = Release|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|x64.Build.0 = Release|Any CPU - {338EA0ED-B7B2-44D8-9F34-235C484E3497}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {338EA0ED-B7B2-44D8-9F34-235C484E3497}.Debug|Any CPU.Build.0 = Debug|Any CPU - {338EA0ED-B7B2-44D8-9F34-235C484E3497}.Debug|x64.ActiveCfg = Debug|Any CPU - {338EA0ED-B7B2-44D8-9F34-235C484E3497}.Debug|x64.Build.0 = Debug|Any CPU - {338EA0ED-B7B2-44D8-9F34-235C484E3497}.Release|Any CPU.ActiveCfg = Release|Any CPU - {338EA0ED-B7B2-44D8-9F34-235C484E3497}.Release|Any CPU.Build.0 = Release|Any CPU - {338EA0ED-B7B2-44D8-9F34-235C484E3497}.Release|x64.ActiveCfg = Release|Any CPU - {338EA0ED-B7B2-44D8-9F34-235C484E3497}.Release|x64.Build.0 = Release|Any CPU - {933050A7-AB8A-4653-AB90-A7D5FBF38C7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {933050A7-AB8A-4653-AB90-A7D5FBF38C7A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {933050A7-AB8A-4653-AB90-A7D5FBF38C7A}.Debug|x64.ActiveCfg = Debug|Any CPU - {933050A7-AB8A-4653-AB90-A7D5FBF38C7A}.Debug|x64.Build.0 = Debug|Any CPU - {933050A7-AB8A-4653-AB90-A7D5FBF38C7A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {933050A7-AB8A-4653-AB90-A7D5FBF38C7A}.Release|Any CPU.Build.0 = Release|Any CPU - {933050A7-AB8A-4653-AB90-A7D5FBF38C7A}.Release|x64.ActiveCfg = Release|Any CPU - {933050A7-AB8A-4653-AB90-A7D5FBF38C7A}.Release|x64.Build.0 = Release|Any CPU - {1B04884B-D903-42CD-A4EB-259068325653}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B04884B-D903-42CD-A4EB-259068325653}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B04884B-D903-42CD-A4EB-259068325653}.Debug|x64.ActiveCfg = Debug|Any CPU - {1B04884B-D903-42CD-A4EB-259068325653}.Debug|x64.Build.0 = Debug|Any CPU - {1B04884B-D903-42CD-A4EB-259068325653}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B04884B-D903-42CD-A4EB-259068325653}.Release|Any CPU.Build.0 = Release|Any CPU - {1B04884B-D903-42CD-A4EB-259068325653}.Release|x64.ActiveCfg = Release|Any CPU - {1B04884B-D903-42CD-A4EB-259068325653}.Release|x64.Build.0 = Release|Any CPU - {91A0E44C-3F12-409B-8C2D-DA2689338D68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91A0E44C-3F12-409B-8C2D-DA2689338D68}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91A0E44C-3F12-409B-8C2D-DA2689338D68}.Debug|x64.ActiveCfg = Debug|Any CPU - {91A0E44C-3F12-409B-8C2D-DA2689338D68}.Debug|x64.Build.0 = Debug|Any CPU - {91A0E44C-3F12-409B-8C2D-DA2689338D68}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91A0E44C-3F12-409B-8C2D-DA2689338D68}.Release|Any CPU.Build.0 = Release|Any CPU - {91A0E44C-3F12-409B-8C2D-DA2689338D68}.Release|x64.ActiveCfg = Release|Any CPU - {91A0E44C-3F12-409B-8C2D-DA2689338D68}.Release|x64.Build.0 = Release|Any CPU - {424FDF4D-198B-46FB-B1A9-F229EB80B195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {424FDF4D-198B-46FB-B1A9-F229EB80B195}.Debug|Any CPU.Build.0 = Debug|Any CPU - {424FDF4D-198B-46FB-B1A9-F229EB80B195}.Debug|x64.ActiveCfg = Debug|Any CPU - {424FDF4D-198B-46FB-B1A9-F229EB80B195}.Debug|x64.Build.0 = Debug|Any CPU - {424FDF4D-198B-46FB-B1A9-F229EB80B195}.Release|Any CPU.ActiveCfg = Release|Any CPU - {424FDF4D-198B-46FB-B1A9-F229EB80B195}.Release|Any CPU.Build.0 = Release|Any CPU - {424FDF4D-198B-46FB-B1A9-F229EB80B195}.Release|x64.ActiveCfg = Release|Any CPU - {424FDF4D-198B-46FB-B1A9-F229EB80B195}.Release|x64.Build.0 = Release|Any CPU - {D77650B4-A242-4686-820E-3863931E0229}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D77650B4-A242-4686-820E-3863931E0229}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D77650B4-A242-4686-820E-3863931E0229}.Debug|x64.ActiveCfg = Debug|Any CPU - {D77650B4-A242-4686-820E-3863931E0229}.Debug|x64.Build.0 = Debug|Any CPU - {D77650B4-A242-4686-820E-3863931E0229}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D77650B4-A242-4686-820E-3863931E0229}.Release|Any CPU.Build.0 = Release|Any CPU - {D77650B4-A242-4686-820E-3863931E0229}.Release|x64.ActiveCfg = Release|Any CPU - {D77650B4-A242-4686-820E-3863931E0229}.Release|x64.Build.0 = Release|Any CPU - {083933A9-5402-453E-851F-9095BFBB57FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {083933A9-5402-453E-851F-9095BFBB57FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {083933A9-5402-453E-851F-9095BFBB57FE}.Debug|x64.ActiveCfg = Debug|Any CPU - {083933A9-5402-453E-851F-9095BFBB57FE}.Debug|x64.Build.0 = Debug|Any CPU - {083933A9-5402-453E-851F-9095BFBB57FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {083933A9-5402-453E-851F-9095BFBB57FE}.Release|Any CPU.Build.0 = Release|Any CPU - {083933A9-5402-453E-851F-9095BFBB57FE}.Release|x64.ActiveCfg = Release|Any CPU - {083933A9-5402-453E-851F-9095BFBB57FE}.Release|x64.Build.0 = Release|Any CPU - {1AD38027-C406-4FA4-B8FD-23E6336C2C4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1AD38027-C406-4FA4-B8FD-23E6336C2C4C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1AD38027-C406-4FA4-B8FD-23E6336C2C4C}.Debug|x64.ActiveCfg = Debug|Any CPU - {1AD38027-C406-4FA4-B8FD-23E6336C2C4C}.Debug|x64.Build.0 = Debug|Any CPU - {1AD38027-C406-4FA4-B8FD-23E6336C2C4C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1AD38027-C406-4FA4-B8FD-23E6336C2C4C}.Release|Any CPU.Build.0 = Release|Any CPU - {1AD38027-C406-4FA4-B8FD-23E6336C2C4C}.Release|x64.ActiveCfg = Release|Any CPU - {1AD38027-C406-4FA4-B8FD-23E6336C2C4C}.Release|x64.Build.0 = Release|Any CPU - {8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D}.Debug|x64.ActiveCfg = Debug|Any CPU - {8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D}.Debug|x64.Build.0 = Debug|Any CPU - {8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D}.Release|Any CPU.Build.0 = Release|Any CPU - {8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D}.Release|x64.ActiveCfg = Release|Any CPU - {8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D}.Release|x64.Build.0 = Release|Any CPU - {AA7876FF-3EF9-40EC-B5FF-66AB748DB93E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA7876FF-3EF9-40EC-B5FF-66AB748DB93E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA7876FF-3EF9-40EC-B5FF-66AB748DB93E}.Debug|x64.ActiveCfg = Debug|Any CPU - {AA7876FF-3EF9-40EC-B5FF-66AB748DB93E}.Debug|x64.Build.0 = Debug|Any CPU - {AA7876FF-3EF9-40EC-B5FF-66AB748DB93E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA7876FF-3EF9-40EC-B5FF-66AB748DB93E}.Release|Any CPU.Build.0 = Release|Any CPU - {AA7876FF-3EF9-40EC-B5FF-66AB748DB93E}.Release|x64.ActiveCfg = Release|Any CPU - {AA7876FF-3EF9-40EC-B5FF-66AB748DB93E}.Release|x64.Build.0 = Release|Any CPU - {23582B50-BAEA-4A2D-82A4-345A3C30124E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23582B50-BAEA-4A2D-82A4-345A3C30124E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23582B50-BAEA-4A2D-82A4-345A3C30124E}.Debug|x64.ActiveCfg = Debug|Any CPU - {23582B50-BAEA-4A2D-82A4-345A3C30124E}.Debug|x64.Build.0 = Debug|Any CPU - {23582B50-BAEA-4A2D-82A4-345A3C30124E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23582B50-BAEA-4A2D-82A4-345A3C30124E}.Release|Any CPU.Build.0 = Release|Any CPU - {23582B50-BAEA-4A2D-82A4-345A3C30124E}.Release|x64.ActiveCfg = Release|Any CPU - {23582B50-BAEA-4A2D-82A4-345A3C30124E}.Release|x64.Build.0 = Release|Any CPU - {1371F22B-FDD7-43B0-8E7D-E68DA31F07F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1371F22B-FDD7-43B0-8E7D-E68DA31F07F3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1371F22B-FDD7-43B0-8E7D-E68DA31F07F3}.Debug|x64.ActiveCfg = Debug|Any CPU - {1371F22B-FDD7-43B0-8E7D-E68DA31F07F3}.Debug|x64.Build.0 = Debug|Any CPU - {1371F22B-FDD7-43B0-8E7D-E68DA31F07F3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1371F22B-FDD7-43B0-8E7D-E68DA31F07F3}.Release|Any CPU.Build.0 = Release|Any CPU - {1371F22B-FDD7-43B0-8E7D-E68DA31F07F3}.Release|x64.ActiveCfg = Release|Any CPU - {1371F22B-FDD7-43B0-8E7D-E68DA31F07F3}.Release|x64.Build.0 = Release|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|x64.ActiveCfg = Debug|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|x64.Build.0 = Debug|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|Any CPU.Build.0 = Release|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|x64.ActiveCfg = Release|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|x64.Build.0 = Release|Any CPU - {83FA668F-C838-4883-996D-AF2ECF00FDF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83FA668F-C838-4883-996D-AF2ECF00FDF8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83FA668F-C838-4883-996D-AF2ECF00FDF8}.Debug|x64.ActiveCfg = Debug|Any CPU - {83FA668F-C838-4883-996D-AF2ECF00FDF8}.Debug|x64.Build.0 = Debug|Any CPU - {83FA668F-C838-4883-996D-AF2ECF00FDF8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83FA668F-C838-4883-996D-AF2ECF00FDF8}.Release|Any CPU.Build.0 = Release|Any CPU - {83FA668F-C838-4883-996D-AF2ECF00FDF8}.Release|x64.ActiveCfg = Release|Any CPU - {83FA668F-C838-4883-996D-AF2ECF00FDF8}.Release|x64.Build.0 = Release|Any CPU - {789ABED5-7C94-4F6F-ADCA-E97F3DFC9479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {789ABED5-7C94-4F6F-ADCA-E97F3DFC9479}.Debug|Any CPU.Build.0 = Debug|Any CPU - {789ABED5-7C94-4F6F-ADCA-E97F3DFC9479}.Debug|x64.ActiveCfg = Debug|Any CPU - {789ABED5-7C94-4F6F-ADCA-E97F3DFC9479}.Debug|x64.Build.0 = Debug|Any CPU - {789ABED5-7C94-4F6F-ADCA-E97F3DFC9479}.Release|Any CPU.ActiveCfg = Release|Any CPU - {789ABED5-7C94-4F6F-ADCA-E97F3DFC9479}.Release|Any CPU.Build.0 = Release|Any CPU - {789ABED5-7C94-4F6F-ADCA-E97F3DFC9479}.Release|x64.ActiveCfg = Release|Any CPU - {789ABED5-7C94-4F6F-ADCA-E97F3DFC9479}.Release|x64.Build.0 = Release|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|x64.ActiveCfg = Debug|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|x64.Build.0 = Debug|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|Any CPU.Build.0 = Release|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|x64.ActiveCfg = Release|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|x64.Build.0 = Release|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|x64.ActiveCfg = Debug|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|x64.Build.0 = Debug|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|Any CPU.Build.0 = Release|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|x64.ActiveCfg = Release|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|x64.Build.0 = Release|Any CPU - {5980D054-E2F3-4143-93D1-01993A955AE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5980D054-E2F3-4143-93D1-01993A955AE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5980D054-E2F3-4143-93D1-01993A955AE7}.Debug|x64.ActiveCfg = Debug|Any CPU - {5980D054-E2F3-4143-93D1-01993A955AE7}.Debug|x64.Build.0 = Debug|Any CPU - {5980D054-E2F3-4143-93D1-01993A955AE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5980D054-E2F3-4143-93D1-01993A955AE7}.Release|Any CPU.Build.0 = Release|Any CPU - {5980D054-E2F3-4143-93D1-01993A955AE7}.Release|x64.ActiveCfg = Release|Any CPU - {5980D054-E2F3-4143-93D1-01993A955AE7}.Release|x64.Build.0 = Release|Any CPU - {8D84666E-C79E-4D49-B73D-360E62D312EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D84666E-C79E-4D49-B73D-360E62D312EF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D84666E-C79E-4D49-B73D-360E62D312EF}.Debug|x64.ActiveCfg = Debug|Any CPU - {8D84666E-C79E-4D49-B73D-360E62D312EF}.Debug|x64.Build.0 = Debug|Any CPU - {8D84666E-C79E-4D49-B73D-360E62D312EF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D84666E-C79E-4D49-B73D-360E62D312EF}.Release|Any CPU.Build.0 = Release|Any CPU - {8D84666E-C79E-4D49-B73D-360E62D312EF}.Release|x64.ActiveCfg = Release|Any CPU - {8D84666E-C79E-4D49-B73D-360E62D312EF}.Release|x64.Build.0 = Release|Any CPU - {7C4B88FA-3681-4C29-BC3F-0FDB111C5681}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C4B88FA-3681-4C29-BC3F-0FDB111C5681}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C4B88FA-3681-4C29-BC3F-0FDB111C5681}.Debug|x64.ActiveCfg = Debug|Any CPU - {7C4B88FA-3681-4C29-BC3F-0FDB111C5681}.Debug|x64.Build.0 = Debug|Any CPU - {7C4B88FA-3681-4C29-BC3F-0FDB111C5681}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C4B88FA-3681-4C29-BC3F-0FDB111C5681}.Release|Any CPU.Build.0 = Release|Any CPU - {7C4B88FA-3681-4C29-BC3F-0FDB111C5681}.Release|x64.ActiveCfg = Release|Any CPU - {7C4B88FA-3681-4C29-BC3F-0FDB111C5681}.Release|x64.Build.0 = Release|Any CPU - {592297DE-DA72-452D-9D88-61EE882FE9A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {592297DE-DA72-452D-9D88-61EE882FE9A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {592297DE-DA72-452D-9D88-61EE882FE9A6}.Debug|x64.ActiveCfg = Debug|Any CPU - {592297DE-DA72-452D-9D88-61EE882FE9A6}.Debug|x64.Build.0 = Debug|Any CPU - {592297DE-DA72-452D-9D88-61EE882FE9A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {592297DE-DA72-452D-9D88-61EE882FE9A6}.Release|Any CPU.Build.0 = Release|Any CPU - {592297DE-DA72-452D-9D88-61EE882FE9A6}.Release|x64.ActiveCfg = Release|Any CPU - {592297DE-DA72-452D-9D88-61EE882FE9A6}.Release|x64.Build.0 = Release|Any CPU - {4E237346-F948-46AC-801B-492545978280}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E237346-F948-46AC-801B-492545978280}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E237346-F948-46AC-801B-492545978280}.Debug|x64.ActiveCfg = Debug|Any CPU - {4E237346-F948-46AC-801B-492545978280}.Debug|x64.Build.0 = Debug|Any CPU - {4E237346-F948-46AC-801B-492545978280}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E237346-F948-46AC-801B-492545978280}.Release|Any CPU.Build.0 = Release|Any CPU - {4E237346-F948-46AC-801B-492545978280}.Release|x64.ActiveCfg = Release|Any CPU - {4E237346-F948-46AC-801B-492545978280}.Release|x64.Build.0 = Release|Any CPU - {75A25CF6-9BA4-46F5-8BC3-90396230CB64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75A25CF6-9BA4-46F5-8BC3-90396230CB64}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75A25CF6-9BA4-46F5-8BC3-90396230CB64}.Debug|x64.ActiveCfg = Debug|Any CPU - {75A25CF6-9BA4-46F5-8BC3-90396230CB64}.Debug|x64.Build.0 = Debug|Any CPU - {75A25CF6-9BA4-46F5-8BC3-90396230CB64}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75A25CF6-9BA4-46F5-8BC3-90396230CB64}.Release|Any CPU.Build.0 = Release|Any CPU - {75A25CF6-9BA4-46F5-8BC3-90396230CB64}.Release|x64.ActiveCfg = Release|Any CPU - {75A25CF6-9BA4-46F5-8BC3-90396230CB64}.Release|x64.Build.0 = Release|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|x64.ActiveCfg = Debug|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|x64.Build.0 = Debug|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|Any CPU.Build.0 = Release|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|x64.ActiveCfg = Release|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|x64.Build.0 = Release|Any CPU - {23633E49-F11A-4D14-899A-E2599C8182CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23633E49-F11A-4D14-899A-E2599C8182CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23633E49-F11A-4D14-899A-E2599C8182CE}.Debug|x64.ActiveCfg = Debug|Any CPU - {23633E49-F11A-4D14-899A-E2599C8182CE}.Debug|x64.Build.0 = Debug|Any CPU - {23633E49-F11A-4D14-899A-E2599C8182CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23633E49-F11A-4D14-899A-E2599C8182CE}.Release|Any CPU.Build.0 = Release|Any CPU - {23633E49-F11A-4D14-899A-E2599C8182CE}.Release|x64.ActiveCfg = Release|Any CPU - {23633E49-F11A-4D14-899A-E2599C8182CE}.Release|x64.Build.0 = Release|Any CPU - {FC4E526A-DBFC-406A-8ED3-64983B67F688}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FC4E526A-DBFC-406A-8ED3-64983B67F688}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FC4E526A-DBFC-406A-8ED3-64983B67F688}.Debug|x64.ActiveCfg = Debug|Any CPU - {FC4E526A-DBFC-406A-8ED3-64983B67F688}.Debug|x64.Build.0 = Debug|Any CPU - {FC4E526A-DBFC-406A-8ED3-64983B67F688}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FC4E526A-DBFC-406A-8ED3-64983B67F688}.Release|Any CPU.Build.0 = Release|Any CPU - {FC4E526A-DBFC-406A-8ED3-64983B67F688}.Release|x64.ActiveCfg = Release|Any CPU - {FC4E526A-DBFC-406A-8ED3-64983B67F688}.Release|x64.Build.0 = Release|Any CPU - {AE3607C0-3278-46D7-97CD-4E6F37C120D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AE3607C0-3278-46D7-97CD-4E6F37C120D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AE3607C0-3278-46D7-97CD-4E6F37C120D3}.Debug|x64.ActiveCfg = Debug|Any CPU - {AE3607C0-3278-46D7-97CD-4E6F37C120D3}.Debug|x64.Build.0 = Debug|Any CPU - {AE3607C0-3278-46D7-97CD-4E6F37C120D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AE3607C0-3278-46D7-97CD-4E6F37C120D3}.Release|Any CPU.Build.0 = Release|Any CPU - {AE3607C0-3278-46D7-97CD-4E6F37C120D3}.Release|x64.ActiveCfg = Release|Any CPU - {AE3607C0-3278-46D7-97CD-4E6F37C120D3}.Release|x64.Build.0 = Release|Any CPU - {A1232A01-3927-4EDE-B7D4-657E08DEB36D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1232A01-3927-4EDE-B7D4-657E08DEB36D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1232A01-3927-4EDE-B7D4-657E08DEB36D}.Debug|x64.ActiveCfg = Debug|Any CPU - {A1232A01-3927-4EDE-B7D4-657E08DEB36D}.Debug|x64.Build.0 = Debug|Any CPU - {A1232A01-3927-4EDE-B7D4-657E08DEB36D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1232A01-3927-4EDE-B7D4-657E08DEB36D}.Release|Any CPU.Build.0 = Release|Any CPU - {A1232A01-3927-4EDE-B7D4-657E08DEB36D}.Release|x64.ActiveCfg = Release|Any CPU - {A1232A01-3927-4EDE-B7D4-657E08DEB36D}.Release|x64.Build.0 = Release|Any CPU - {2870B6BB-4188-45A0-A2D3-085834EBDC2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2870B6BB-4188-45A0-A2D3-085834EBDC2A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2870B6BB-4188-45A0-A2D3-085834EBDC2A}.Debug|x64.ActiveCfg = Debug|Any CPU - {2870B6BB-4188-45A0-A2D3-085834EBDC2A}.Debug|x64.Build.0 = Debug|Any CPU - {2870B6BB-4188-45A0-A2D3-085834EBDC2A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2870B6BB-4188-45A0-A2D3-085834EBDC2A}.Release|Any CPU.Build.0 = Release|Any CPU - {2870B6BB-4188-45A0-A2D3-085834EBDC2A}.Release|x64.ActiveCfg = Release|Any CPU - {2870B6BB-4188-45A0-A2D3-085834EBDC2A}.Release|x64.Build.0 = Release|Any CPU - {913DA066-8A23-4671-AC8F-B5B61134F8FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {913DA066-8A23-4671-AC8F-B5B61134F8FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {913DA066-8A23-4671-AC8F-B5B61134F8FE}.Debug|x64.ActiveCfg = Debug|Any CPU - {913DA066-8A23-4671-AC8F-B5B61134F8FE}.Debug|x64.Build.0 = Debug|Any CPU - {913DA066-8A23-4671-AC8F-B5B61134F8FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {913DA066-8A23-4671-AC8F-B5B61134F8FE}.Release|Any CPU.Build.0 = Release|Any CPU - {913DA066-8A23-4671-AC8F-B5B61134F8FE}.Release|x64.ActiveCfg = Release|Any CPU - {913DA066-8A23-4671-AC8F-B5B61134F8FE}.Release|x64.Build.0 = Release|Any CPU - {4CD3D849-7277-4C9C-9461-7ABB66F78629}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CD3D849-7277-4C9C-9461-7ABB66F78629}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CD3D849-7277-4C9C-9461-7ABB66F78629}.Debug|x64.ActiveCfg = Debug|Any CPU - {4CD3D849-7277-4C9C-9461-7ABB66F78629}.Debug|x64.Build.0 = Debug|Any CPU - {4CD3D849-7277-4C9C-9461-7ABB66F78629}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4CD3D849-7277-4C9C-9461-7ABB66F78629}.Release|Any CPU.Build.0 = Release|Any CPU - {4CD3D849-7277-4C9C-9461-7ABB66F78629}.Release|x64.ActiveCfg = Release|Any CPU - {4CD3D849-7277-4C9C-9461-7ABB66F78629}.Release|x64.Build.0 = Release|Any CPU - {FED315CF-7CA2-4653-AD37-BC0C1D7FFD22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FED315CF-7CA2-4653-AD37-BC0C1D7FFD22}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FED315CF-7CA2-4653-AD37-BC0C1D7FFD22}.Debug|x64.ActiveCfg = Debug|Any CPU - {FED315CF-7CA2-4653-AD37-BC0C1D7FFD22}.Debug|x64.Build.0 = Debug|Any CPU - {FED315CF-7CA2-4653-AD37-BC0C1D7FFD22}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FED315CF-7CA2-4653-AD37-BC0C1D7FFD22}.Release|Any CPU.Build.0 = Release|Any CPU - {FED315CF-7CA2-4653-AD37-BC0C1D7FFD22}.Release|x64.ActiveCfg = Release|Any CPU - {FED315CF-7CA2-4653-AD37-BC0C1D7FFD22}.Release|x64.Build.0 = Release|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|x64.ActiveCfg = Debug|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|x64.Build.0 = Debug|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|Any CPU.Build.0 = Release|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|x64.ActiveCfg = Release|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|x64.Build.0 = Release|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|x64.ActiveCfg = Debug|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|x64.Build.0 = Debug|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|Any CPU.Build.0 = Release|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|x64.ActiveCfg = Release|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|x64.Build.0 = Release|Any CPU - {1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19}.Debug|x64.ActiveCfg = Debug|Any CPU - {1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19}.Debug|x64.Build.0 = Debug|Any CPU - {1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19}.Release|Any CPU.Build.0 = Release|Any CPU - {1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19}.Release|x64.ActiveCfg = Release|Any CPU - {1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19}.Release|x64.Build.0 = Release|Any CPU - {00659C82-2E23-4E8F-BA34-EC41D78C87A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {00659C82-2E23-4E8F-BA34-EC41D78C87A1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {00659C82-2E23-4E8F-BA34-EC41D78C87A1}.Debug|x64.ActiveCfg = Debug|Any CPU - {00659C82-2E23-4E8F-BA34-EC41D78C87A1}.Debug|x64.Build.0 = Debug|Any CPU - {00659C82-2E23-4E8F-BA34-EC41D78C87A1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {00659C82-2E23-4E8F-BA34-EC41D78C87A1}.Release|Any CPU.Build.0 = Release|Any CPU - {00659C82-2E23-4E8F-BA34-EC41D78C87A1}.Release|x64.ActiveCfg = Release|Any CPU - {00659C82-2E23-4E8F-BA34-EC41D78C87A1}.Release|x64.Build.0 = Release|Any CPU - {28893415-0789-4FBB-A8B7-F0F9260CEDE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28893415-0789-4FBB-A8B7-F0F9260CEDE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28893415-0789-4FBB-A8B7-F0F9260CEDE3}.Debug|x64.ActiveCfg = Debug|Any CPU - {28893415-0789-4FBB-A8B7-F0F9260CEDE3}.Debug|x64.Build.0 = Debug|Any CPU - {28893415-0789-4FBB-A8B7-F0F9260CEDE3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28893415-0789-4FBB-A8B7-F0F9260CEDE3}.Release|Any CPU.Build.0 = Release|Any CPU - {28893415-0789-4FBB-A8B7-F0F9260CEDE3}.Release|x64.ActiveCfg = Release|Any CPU - {28893415-0789-4FBB-A8B7-F0F9260CEDE3}.Release|x64.Build.0 = Release|Any CPU - {D855894E-4C72-41DC-8F84-EF66CDE37453}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D855894E-4C72-41DC-8F84-EF66CDE37453}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D855894E-4C72-41DC-8F84-EF66CDE37453}.Debug|x64.ActiveCfg = Debug|Any CPU - {D855894E-4C72-41DC-8F84-EF66CDE37453}.Debug|x64.Build.0 = Debug|Any CPU - {D855894E-4C72-41DC-8F84-EF66CDE37453}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D855894E-4C72-41DC-8F84-EF66CDE37453}.Release|Any CPU.Build.0 = Release|Any CPU - {D855894E-4C72-41DC-8F84-EF66CDE37453}.Release|x64.ActiveCfg = Release|Any CPU - {D855894E-4C72-41DC-8F84-EF66CDE37453}.Release|x64.Build.0 = Release|Any CPU - {1EE45374-EF8E-4E9D-A74F-51C14DA58ED8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EE45374-EF8E-4E9D-A74F-51C14DA58ED8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EE45374-EF8E-4E9D-A74F-51C14DA58ED8}.Debug|x64.ActiveCfg = Debug|Any CPU - {1EE45374-EF8E-4E9D-A74F-51C14DA58ED8}.Debug|x64.Build.0 = Debug|Any CPU - {1EE45374-EF8E-4E9D-A74F-51C14DA58ED8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EE45374-EF8E-4E9D-A74F-51C14DA58ED8}.Release|Any CPU.Build.0 = Release|Any CPU - {1EE45374-EF8E-4E9D-A74F-51C14DA58ED8}.Release|x64.ActiveCfg = Release|Any CPU - {1EE45374-EF8E-4E9D-A74F-51C14DA58ED8}.Release|x64.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {59DA3D5F-9E39-4173-8C31-126967CC189F} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {FBD326D3-E59C-433E-A88E-14E179E3093D} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {EA2668AF-28E3-42C5-9FA5-8C9FF377180E} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {022D6FF5-4B65-4213-9A97-C69E2B2F99E1} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {75050CBC-A0F2-408A-A582-54EF37450B29} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {509BDB5A-5D32-478F-BF27-F0470C18C7C9} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {8C39C640-0E8A-43A7-890C-9742B6B70AA4} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {593A3114-D1E0-47ED-BC37-58E08886175B} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {DA885E64-C5E2-4C22-8C2A-26E68A593F29} = {509BDB5A-5D32-478F-BF27-F0470C18C7C9} - {9F6F9899-D5F1-444A-BE56-64F949550D22} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {ED301FA5-4E70-460B-A0D4-1D79D135769F} = {593A3114-D1E0-47ED-BC37-58E08886175B} - {21180442-A6A5-4239-A2AD-33FF5BB80E72} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {E33ADF54-4D35-49B7-BDA6-412587CA39FF} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {1B44F2E7-28F5-4E88-B8A8-3F336800FD5C} = {FBD326D3-E59C-433E-A88E-14E179E3093D} - {D55A7D3B-9C24-4029-BC03-41B28AD11DB6} = {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} - {89B2A693-CD8A-4EA2-9991-2CEE44C4D04B} = {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} - {2E172027-1B85-474E-A238-21B2DBDB895F} = {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} - {62760E2C-D3D6-4824-997F-35033E6EB92C} = {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} - {965C85E2-D94E-43DE-BFC2-B9D157242EBB} = {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} - {7D083C64-FF32-43C4-A82C-32C4A4EC1414} = {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} - {3870E8F1-B269-425D-8B03-58835FD53610} = {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} - {519A99D2-8094-48EC-A888-C0B4E017A4C1} = {FBD326D3-E59C-433E-A88E-14E179E3093D} - {E946A129-34ED-4069-B44E-EC7B98751006} = {FBD326D3-E59C-433E-A88E-14E179E3093D} - {F3DA1941-3610-48F3-901A-E2E873979BFD} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {EA23C277-97E4-4FBC-A53B-37048813E14F} = {DA885E64-C5E2-4C22-8C2A-26E68A593F29} - {0FF64D9E-98D7-46B1-90FB-C0364C76D65A} = {21180442-A6A5-4239-A2AD-33FF5BB80E72} - {D375233D-8AAC-4234-BC0D-3D103C600C19} = {21180442-A6A5-4239-A2AD-33FF5BB80E72} - {EAC0AA32-AE9B-4908-AF05-927B70A2B8A1} = {13EDB361-AF88-4F89-B4AB-46622BCCBC37} - {E893C913-98A0-4BB3-A32B-3871BE3C5C53} = {880E8263-AECC-4793-BD28-7CD03650D124} - {761C3313-A669-465F-A384-9E118FCE4F89} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {13EDB361-AF88-4F89-B4AB-46622BCCBC37} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {880E8263-AECC-4793-BD28-7CD03650D124} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {1B16DD58-0847-45A7-AF93-53EBFBEDAAE7} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {C056C688-8FFC-42BC-B4EA-EF3808A8A12C} = {59DA3D5F-9E39-4173-8C31-126967CC189F} - {428CDAF3-957A-4017-82EA-70737F205546} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {DB93B639-899D-4B2C-AF8A-47B4BC6B3776} = {9EEE31DA-3165-4CB3-AAE9-27CC3A4DE669} - {9EEE31DA-3165-4CB3-AAE9-27CC3A4DE669} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {A5C1EF6B-A3B5-4D0C-8373-F854EE7EF4AD} = {4AA6B450-D4AA-4474-9ECF-52A44935D8D9} - {B29ABF5D-AFA8-4480-B74E-3ACB6FAAA826} = {13EDB361-AF88-4F89-B4AB-46622BCCBC37} - {5A163042-B03A-4063-85FF-22D4C5BB5B90} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {84EFF9E1-6852-458F-8D57-62E3F084EA0F} = {9EEE31DA-3165-4CB3-AAE9-27CC3A4DE669} - {427822F2-7A20-4E3A-B45C-43CE855003C1} = {9EEE31DA-3165-4CB3-AAE9-27CC3A4DE669} - {7909A736-6C1E-4622-9BE7-37EF0839FA05} = {880E8263-AECC-4793-BD28-7CD03650D124} - {1A86AE9B-A57D-43D2-9E8C-5ED0C1E6041C} = {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} - {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {374B7E56-A815-4F56-A4C2-6094B5A97EE7} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {2971858E-2CCA-4688-B8CA-84F130AD5AA9} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {2503F67B-63BB-4364-8B31-1DD3049C92B7} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {88BC8170-9123-48C0-A914-11D3CE805196} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {2F4986D6-3F56-4C05-8A1D-399594F96093} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {E72E105D-B15F-4D69-9A13-CAA49D4889D6} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {4A052E17-4D9E-41EF-89A5-73B917053F8E} = {2BE750A5-8AC7-457C-9BB2-6E3D5E2D23B8} - {3F8532EF-3DC9-45F8-9562-994ABE066585} = {8C39C640-0E8A-43A7-890C-9742B6B70AA4} - {31262D61-26A4-4302-968D-52B8DA4558CD} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {F52E5BA6-C2D4-4797-AF71-6389FEC246B5} = {022D6FF5-4B65-4213-9A97-C69E2B2F99E1} - {823D2A6E-20AB-45FF-AD07-5E7933FA6DE7} = {022D6FF5-4B65-4213-9A97-C69E2B2F99E1} - {7C382E43-A515-4C67-9296-FB8A630C4A49} = {022D6FF5-4B65-4213-9A97-C69E2B2F99E1} - {95AF448B-F34C-4DF8-9E9B-DF499FABA099} = {022D6FF5-4B65-4213-9A97-C69E2B2F99E1} - {4C3307D4-2A6B-41E3-BE9E-2FD083578450} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {AA1993F7-5BAE-45F8-A8F5-31E88A25ED83} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {F1826D84-1A16-41A4-A57B-F0DBB5A18745} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {2E1EEC9C-37C9-4C03-A4BC-58306F8B1C38} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {F4B8D71B-DAE4-4948-A1DC-42B42DE31D4F} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {118A91A6-6FBB-431A-B50D-076375AD6A63} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {AB6FAB84-5218-48A8-8F94-03B02ECD098F} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {86898E0C-D1C5-4A57-B5DD-69A4BC1F4ABE} = {165391A5-034E-4894-8084-8DF7D4AA7518} - {97532A33-A591-4DF5-A2C0-72527B78ED82} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {165391A5-034E-4894-8084-8DF7D4AA7518} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {B8358ED1-C95A-4EC0-9756-FB32C931F204} = {9EEE31DA-3165-4CB3-AAE9-27CC3A4DE669} - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {79D639DC-DDE4-45B1-884D-60B6908F528E} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {834A12D0-FBED-45B3-86EA-5EA114C516B5} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {C3451307-3743-4911-A401-7F28889703D3} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {4AC23B67-52F9-44E5-9586-79A1DB73E6F7} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {87DD354D-4D48-4918-ACDE-A7FF62FA0DD8} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {D5EA7A25-0FD2-4545-9C1C-FF96E5E35145} = {4AC23B67-52F9-44E5-9586-79A1DB73E6F7} - {E1096C8E-6EC1-45CB-9CA6-0ADD830CAAA3} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {E868B34E-D1ED-412A-9382-954B84EDE80C} = {13EDB361-AF88-4F89-B4AB-46622BCCBC37} - {C8A78B0F-BF6B-4317-8C22-535626C263EC} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {69778426-7179-4B0C-8398-2F3BECA0FE93} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {0D50F5EB-D580-4041-A6FA-F5373EF10566} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {84A64849-AD9C-4618-BC87-07CCE7AD7FE2} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {96B87330-1B65-4E79-A5AD-E2268A582434} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {124A4190-6B03-4A1C-B2BE-979DD1FB511F} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {690D8379-B630-41FD-88F0-6D1EBB4BC3D4} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {7C7CEBAE-38A4-435D-BEC2-2425D58FABDC} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {EB0F6BDA-C6AA-4859-834E-5613BB38862B} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {4B818EE6-8E13-40DA-B99A-218BB228EE91} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {6DB8780E-BA11-47CD-8FAB-D73A1F71B305} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {CE1CABB0-B307-4709-84E0-583382FAAA29} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {E7987CBB-8DDD-4AC5-B522-653E2F457C85} = {6DB8780E-BA11-47CD-8FAB-D73A1F71B305} - {AD427256-9686-4289-A635-1B387BD56D15} = {E6363F59-2BA4-4AA7-8578-C433A2C2567F} - {4995742C-033A-4147-89E7-7FFE7681C971} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {DC50078D-D706-4CB9-A301-F47CB3F46007} = {6DB8780E-BA11-47CD-8FAB-D73A1F71B305} - {E6363F59-2BA4-4AA7-8578-C433A2C2567F} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {D8E85337-A779-48FC-B822-CE8A850661DC} = {E6363F59-2BA4-4AA7-8578-C433A2C2567F} - {30DC35DF-9D86-443C-B26C-9053E6FCA434} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {24E5BF57-33B6-4D5B-A32F-2F64D1A5954F} = {6DB8780E-BA11-47CD-8FAB-D73A1F71B305} - {B15F4561-E511-42EA-A02E-F772BAF41E20} = {6DB8780E-BA11-47CD-8FAB-D73A1F71B305} - {32488758-25C9-4257-9B98-DAA034C19909} = {E6363F59-2BA4-4AA7-8578-C433A2C2567F} - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} - {54936F20-EEFC-405B-8646-76F200A5C8F7} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} - {546EE1A2-DB6B-49D3-8919-33624FEF2498} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} - {B603B92A-1203-4E28-9D15-2AF1CE4E9510} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} - {FBF18906-7113-4036-BAEB-56E925F7D301} = {4995742C-033A-4147-89E7-7FFE7681C971} - {661A5C41-A5DE-45C9-A7CF-B59C2B9B23E0} = {4995742C-033A-4147-89E7-7FFE7681C971} - {F2E1018A-F423-4782-BE9D-6169C669AD43} = {4995742C-033A-4147-89E7-7FFE7681C971} - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {338EA0ED-B7B2-44D8-9F34-235C484E3497} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {933050A7-AB8A-4653-AB90-A7D5FBF38C7A} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {1B04884B-D903-42CD-A4EB-259068325653} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {91A0E44C-3F12-409B-8C2D-DA2689338D68} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {424FDF4D-198B-46FB-B1A9-F229EB80B195} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {D77650B4-A242-4686-820E-3863931E0229} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {083933A9-5402-453E-851F-9095BFBB57FE} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {1AD38027-C406-4FA4-B8FD-23E6336C2C4C} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {8C5D0C99-59D7-4E79-9AE4-AF7AA7F2DB3D} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {5F25960E-646D-4EA6-A648-3CAD284B6E38} = {42DF7AAC-362C-48F4-B76A-BDEEEFF17CC9} - {AA7876FF-3EF9-40EC-B5FF-66AB748DB93E} = {5F25960E-646D-4EA6-A648-3CAD284B6E38} - {DB2B4DA3-EEF2-49AA-93A4-B00C25210A68} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {23582B50-BAEA-4A2D-82A4-345A3C30124E} = {59DA3D5F-9E39-4173-8C31-126967CC189F} - {1371F22B-FDD7-43B0-8E7D-E68DA31F07F3} = {9EEE31DA-3165-4CB3-AAE9-27CC3A4DE669} - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {83FA668F-C838-4883-996D-AF2ECF00FDF8} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {981E883E-CCDC-400B-8FB1-76E1E65C32AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {0D34A7F0-DC77-4789-A136-93089CBD15C3} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {8D84666E-C79E-4D49-B73D-360E62D312EF} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {7C4B88FA-3681-4C29-BC3F-0FDB111C5681} = {FBD326D3-E59C-433E-A88E-14E179E3093D} - {592297DE-DA72-452D-9D88-61EE882FE9A6} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {4E237346-F948-46AC-801B-492545978280} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {75A25CF6-9BA4-46F5-8BC3-90396230CB64} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {DA816A33-F164-4456-92DD-A672BAD1A6B1} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {FC4E526A-DBFC-406A-8ED3-64983B67F688} = {E33ADF54-4D35-49B7-BDA6-412587CA39FF} - {AE3607C0-3278-46D7-97CD-4E6F37C120D3} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {A1232A01-3927-4EDE-B7D4-657E08DEB36D} = {07BD7788-9DC0-4BD0-9861-0C9AC13B4EB8} - {2870B6BB-4188-45A0-A2D3-085834EBDC2A} = {DB2B4DA3-EEF2-49AA-93A4-B00C25210A68} - {913DA066-8A23-4671-AC8F-B5B61134F8FE} = {DB2B4DA3-EEF2-49AA-93A4-B00C25210A68} - {4CD3D849-7277-4C9C-9461-7ABB66F78629} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {C265268A-F311-4B6A-915E-C1AF9D1EB624} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {F9DDEB6F-25F8-4505-8300-2E247564BD8B} = {593A3114-D1E0-47ED-BC37-58E08886175B} - {1CDA9001-A29F-4EBE-BBEA-0B2E663B9A19} = {F9DDEB6F-25F8-4505-8300-2E247564BD8B} - {00659C82-2E23-4E8F-BA34-EC41D78C87A1} = {F9DDEB6F-25F8-4505-8300-2E247564BD8B} - {28893415-0789-4FBB-A8B7-F0F9260CEDE3} = {F9DDEB6F-25F8-4505-8300-2E247564BD8B} - {4AA6B450-D4AA-4474-9ECF-52A44935D8D9} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {D855894E-4C72-41DC-8F84-EF66CDE37453} = {4AA6B450-D4AA-4474-9ECF-52A44935D8D9} - {1EE45374-EF8E-4E9D-A74F-51C14DA58ED8} = {4AA6B450-D4AA-4474-9ECF-52A44935D8D9} - {7012AE14-D352-405F-8412-4B60A017AEC9} = {38E6C400-90C0-493E-9266-C1602E229F1B} - {2B644A8C-F0EE-4566-AB78-9E1C6D4185A3} = {7012AE14-D352-405F-8412-4B60A017AEC9} - {789ABED5-7C94-4F6F-ADCA-E97F3DFC9479} = {7012AE14-D352-405F-8412-4B60A017AEC9} - {23633E49-F11A-4D14-899A-E2599C8182CE} = {7012AE14-D352-405F-8412-4B60A017AEC9} - {C4DDEA6E-D6AF-4890-9713-C2862403E57C} = {7012AE14-D352-405F-8412-4B60A017AEC9} - {5980D054-E2F3-4143-93D1-01993A955AE7} = {7012AE14-D352-405F-8412-4B60A017AEC9} - {FED315CF-7CA2-4653-AD37-BC0C1D7FFD22} = {7012AE14-D352-405F-8412-4B60A017AEC9} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} - EndGlobalSection -EndGlobal diff --git a/Masa.Framework.sln b/Masa.Framework.sln new file mode 100644 index 000000000..9b24503d1 --- /dev/null +++ b/Masa.Framework.sln @@ -0,0 +1,2142 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31521.260 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildingBlocks", "BuildingBlocks", "{DC578D74-98F0-4F19-A230-CFA8DAEE0AF1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration", "src\BuildingBlocks\src\Configuration\Masa.BuildingBlocks.Configuration\Masa.BuildingBlocks.Configuration.csproj", "{374B7E56-A815-4F56-A4C2-6094B5A97EE7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Contracts", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.Contracts\Masa.BuildingBlocks.Data.Contracts.csproj", "{7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.UoW", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.UoW\Masa.BuildingBlocks.Data.UoW.csproj", "{E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain", "src\BuildingBlocks\src\Ddd\Masa.BuildingBlocks.Ddd.Domain\Masa.BuildingBlocks.Ddd.Domain.csproj", "{2971858E-2CCA-4688-B8CA-84F130AD5AA9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.Events", "src\BuildingBlocks\src\Dispatcher\Masa.BuildingBlocks.Dispatcher.Events\Masa.BuildingBlocks.Dispatcher.Events.csproj", "{2503F67B-63BB-4364-8B31-1DD3049C92B7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.IntegrationEvents", "src\BuildingBlocks\src\Dispatcher\Masa.BuildingBlocks.Dispatcher.IntegrationEvents\Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj", "{88BC8170-9123-48C0-A914-11D3CE805196}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.Cqrs", "src\BuildingBlocks\src\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj", "{316B1D0A-9CF7-4E5C-A39A-8A389B075A19}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete", "src\BuildingBlocks\src\SearchEngine\Masa.BuildingBlocks.SearchEngine.AutoComplete\Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj", "{2F4986D6-3F56-4C05-8A1D-399594F96093}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.MinimalAPIs", "src\BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.MinimalAPIs\Masa.BuildingBlocks.Service.MinimalAPIs.csproj", "{E72E105D-B15F-4D69-9A13-CAA49D4889D6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolation", "src\BuildingBlocks\src\Isolation\Masa.BuildingBlocks.Isolation\Masa.BuildingBlocks.Isolation.csproj", "{B689E82B-B3E8-4C83-B56C-D4C27206AAC6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Storage.ObjectStorage", "src\BuildingBlocks\src\Storage\Masa.BuildingBlocks.Storage.ObjectStorage\Masa.BuildingBlocks.Storage.ObjectStorage.csproj", "{74283F68-6B38-4CF4-B0CB-AAD65618ADB8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Pm", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Pm\Masa.BuildingBlocks.BasicAbility.Pm.csproj", "{AB6FAB84-5218-48A8-8F94-03B02ECD098F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Mapping", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.Mapping\Masa.BuildingBlocks.Data.Mapping.csproj", "{5A3338F1-9963-4CAC-85A3-7AB263CB15B0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data\Masa.BuildingBlocks.Data.csproj", "{C3451307-3743-4911-A401-7F28889703D3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Contracts", "src\BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.Contracts\Masa.BuildingBlocks.Service.Contracts.csproj", "{736F69E9-89D0-47E2-99AF-9412AAE1C6BB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth\Masa.BuildingBlocks.BasicAbility.Auth.csproj", "{4B818EE6-8E13-40DA-B99A-218BB228EE91}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.MappingExtensions", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.MappingExtensions\Masa.BuildingBlocks.Data.MappingExtensions.csproj", "{30DC35DF-9D86-443C-B26C-9053E6FCA434}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Cache", "src\BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Cache\Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj", "{4B94CAF6-134D-4F89-8F2D-72A4FB363B59}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{54936F20-EEFC-405B-8646-76F200A5C8F7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{546EE1A2-DB6B-49D3-8919-33624FEF2498}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{B603B92A-1203-4E28-9D15-2AF1CE4E9510}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\src\Identity\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Dcc", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Dcc\Masa.BuildingBlocks.BasicAbility.Dcc.csproj", "{FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth.Contracts", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth.Contracts\Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj", "{981E883E-CCDC-400B-8FB1-76E1E65C32AF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{0D34A7F0-DC77-4789-A136-93089CBD15C3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Scheduler", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Scheduler\Masa.BuildingBlocks.BasicAbility.Scheduler.csproj", "{0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Mc", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Mc\Masa.BuildingBlocks.BasicAbility.Mc.csproj", "{DA816A33-F164-4456-92DD-A672BAD1A6B1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Tsc", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Tsc\Masa.BuildingBlocks.BasicAbility.Tsc.csproj", "{C265268A-F311-4B6A-915E-C1AF9D1EB624}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Caller", "src\BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{ABF6E41A-CBF9-49DE-87FC-9D88F440A104}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{5944A182-13B8-4DA6-AEE2-0A01E64A9648}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{88740F49-00A1-40F8-B141-78EFA7CE2B4D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{801BB9FA-307C-4A93-A116-16BAEC637C1E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1F8E0520-6670-4561-B92B-37B725CBE243}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Configuration.Tests\Masa.BuildingBlocks.Configuration.Tests.csproj", "{B228589B-4106-4CF8-B165-26636B94BE2C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{355663A0-EF0B-4C26-92A4-1589A7FFC9E6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{D0BE0F45-2C77-45AB-B861-EBEE34C187B2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{77025FC5-67D5-49CE-8FA6-8FCB9D125B29}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{08649D7D-EF5A-4626-9959-935CA85DF770}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{8663AD83-4E2C-47EF-BF28-1427E82F1A36}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{FE0F37B3-7727-4A08-AEA1-437F53982658}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{4B812744-1CB5-4760-9719-2220EACC566C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing", "src\BuildingBlocks\src\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj", "{322F0F91-E181-4139-87DE-974CCF2339BA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{232840A6-183C-4D3A-A086-582FD449D300}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{7064C470-7D0B-4CE2-A80C-BEE376DDC956}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E8CE3469-6E0F-495C-937E-D9820DE3DA89}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{46C33E74-835B-4CB4-861D-42A781A2502C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching", "Caching", "{02B35A90-23DF-4341-89CF-E911ED210FBE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{BCDB0439-8542-4DE7-A8C2-9BB582AE8C42}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development", "{F262689D-5BE8-45E9-B090-0CFF81315FB9}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ldap", "Ldap", "{8A795434-6928-41F6-B8B1-3F6DAC62D1A0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{611ECFDA-B435-4106-BDB8-DD8C39FEBF08}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Exceptions", "src\Utils\src\Masa.Utils.Exceptions\Masa.Utils.Exceptions.csproj", "{46C86695-A597-47F3-944E-03C63CA678F4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Core", "src\Utils\src\Caching\Masa.Utils.Caching.Core\Masa.Utils.Caching.Core.csproj", "{DBD1137D-0208-4CF4-BB45-36FE023B4FED}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.DistributedMemory", "src\Utils\src\Caching\Masa.Utils.Caching.DistributedMemory\Masa.Utils.Caching.DistributedMemory.csproj", "{8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Memory", "src\Utils\src\Caching\Masa.Utils.Caching.Memory\Masa.Utils.Caching.Memory.csproj", "{A93D1699-A8B1-432E-8929-5800F4FE5AA7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis", "src\Utils\src\Caching\Masa.Utils.Caching.Redis\Masa.Utils.Caching.Redis.csproj", "{049430DA-664C-4C77-A679-0CF12217ABB2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Json", "src\Utils\src\Configuration\Masa.Utils.Configuration.Json\Masa.Utils.Configuration.Json.csproj", "{6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Dcc", "src\Utils\src\Configuration\Masa.Utils.Configuration.Dcc\Masa.Utils.Configuration.Dcc.csproj", "{64B72C9E-85BD-4C41-B67D-892157600F5B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations", "src\Utils\src\Data\Masa.Utils.Data.DataAnnotations\Masa.Utils.Data.DataAnnotations.csproj", "{354D1855-EE83-41EF-BFFC-1348F77A66DB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch", "src\Utils\src\Data\Masa.Utils.Data.Elasticsearch\Masa.Utils.Data.Elasticsearch.csproj", "{8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr", "src\Utils\src\Development\Masa.Utils.Development.Dapr\Masa.Utils.Development.Dapr.csproj", "{A88B4DB8-2441-488D-B097-68F02F18DECC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr.AspNetCore", "src\Utils\src\Development\Masa.Utils.Development.Dapr.AspNetCore\Masa.Utils.Development.Dapr.AspNetCore.csproj", "{3B5C4669-07C6-49F0-BC69-70A8980FC605}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Validations", "Validations", "{B1984322-509A-4E96-BFB0-A0D5DEDFB92D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Validations.FluentValidation", "src\Utils\src\Extensions\Validations\Masa.Utils.Extensions.Validations.FluentValidation\Masa.Utils.Extensions.Validations.FluentValidation.csproj", "{81618F3D-ED3C-44C5-9BAD-8F04CF601D42}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection", "src\Utils\src\Extensions\Masa.Utils.Extensions.DependencyInjection\Masa.Utils.Extensions.DependencyInjection.csproj", "{F6E5B615-A85D-4FB4-97D0-698098D7616F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DotNet", "src\Utils\src\Extensions\Masa.Utils.Extensions.DotNet\Masa.Utils.Extensions.DotNet.csproj", "{7A628B6A-AFE4-4235-95AA-9A711268B9B1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Expressions", "src\Utils\src\Extensions\Masa.Utils.Extensions.Expressions\Masa.Utils.Extensions.Expressions.csproj", "{E417DAE3-A1D2-430D-A6C7-C8BDE083D851}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Enums", "src\Utils\src\Extensions\Masa.Utils.Extensions.Enums\Masa.Utils.Extensions.Enums.csproj", "{9A6A3012-6A11-415B-BC58-E2268BE7022E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{7A8F1593-C00F-4D90-9029-11BF75B3C926}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core", "src\Utils\src\Caller\Masa.Utils.Caller.Core\Masa.Utils.Caller.Core.csproj", "{0F43C687-59EF-4164-B3A5-E53C3BF86892}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.DaprClient", "src\Utils\src\Caller\Masa.Utils.Caller.DaprClient\Masa.Utils.Caller.DaprClient.csproj", "{BE11C98A-5680-491E-86E9-93B0A83909EA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.HttpClient", "src\Utils\src\Caller\Masa.Utils.Caller.HttpClient\Masa.Utils.Caller.HttpClient.csproj", "{E2B9737D-9630-4705-B2DF-21C2EB607F65}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus", "src\Utils\src\Data\Masa.Utils.Data.Prometheus\Masa.Utils.Data.Prometheus.csproj", "{3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell", "src\Utils\src\Ldap\Masa.Utils.Ldap.Novell\Masa.Utils.Ldap.Novell.csproj", "{8C154ACF-ED6E-43C4-906E-2D36CBC8D112}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{1677DDFE-BBCF-4BA3-B5A7-9168BB27838E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Models.Config", "src\Utils\src\Models\Masa.Utils.Models.Config\Masa.Utils.Models.Config.csproj", "{CC117C03-267A-4145-B258-922C35484883}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication", "src\Utils\src\Security\Masa.Utils.Security.Authentication\Masa.Utils.Security.Authentication.csproj", "{1AD1F4E7-84DA-4CE8-BC69-7D713413560D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B9256C4D-86F4-4E67-8774-C3EF971EC811}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication.OpenIdConnect", "src\Utils\src\Security\Masa.Utils.Security.Authentication.OpenIdConnect\Masa.Utils.Security.Authentication.OpenIdConnect.csproj", "{9DEA348B-8915-4BAA-AE04-99BF5FC6131B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography", "src\Utils\src\Security\Masa.Utils.Security.Cryptography\Masa.Utils.Security.Cryptography.csproj", "{E85FA5C9-C7D9-4461-99DE-11675749E38E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Token", "src\Utils\src\Security\Masa.Utils.Security.Token\Masa.Utils.Security.Token.csproj", "{FB66887D-E08C-4551-B838-EAF49C1D1EE7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis.Tests", "src\Utils\test\Masa.Utils.Caching.Redis.Tests\Masa.Utils.Caching.Redis.Tests.csproj", "{D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core.Tests", "src\Utils\test\Masa.Utils.Caller.Core.Tests\Masa.Utils.Caller.Core.Tests.csproj", "{E8282BC0-5F46-4A96-80A6-1326F97E16C4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.IntegratedTests", "src\Utils\test\Masa.Utils.Caller.IntegratedTests\Masa.Utils.Caller.IntegratedTests.csproj", "{4428D240-7BF5-46BF-9FB7-EF531FA5C088}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Tests", "src\Utils\test\Masa.Utils.Caller.Tests\Masa.Utils.Caller.Tests.csproj", "{675D2886-B4E9-4B14-A02D-44B5204EE2E0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations.Tests", "src\Utils\test\Masa.Utils.Data.DataAnnotations.Tests\Masa.Utils.Data.DataAnnotations.Tests.csproj", "{2A57A40F-92F5-4ACE-95AA-763915578282}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch.Tests", "src\Utils\test\Masa.Utils.Data.Elasticsearch.Tests\Masa.Utils.Data.Elasticsearch.Tests.csproj", "{A89E129A-BBEA-431E-96D5-9AAEAA245A3C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus.Test", "src\Utils\test\Masa.Utils.Data.Prometheus.Test\Masa.Utils.Data.Prometheus.Test.csproj", "{B44F4054-5B66-4937-A99D-216DEFBAD0EF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Repository.Tests", "src\Utils\test\Masa.Utils.Extensions.DependencyInjection.Repository.Tests\Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj", "{072E41B5-B2BF-4493-9D26-15D4BB490318}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Tests", "src\Utils\test\Masa.Utils.Extensions.DependencyInjection.Tests\Masa.Utils.Extensions.DependencyInjection.Tests.csproj", "{A4F3852E-DC6B-43A8-A40A-899089546444}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell.Tests", "src\Utils\test\Masa.Utils.Ldap.Tests\Masa.Utils.Ldap.Novell.Tests\Masa.Utils.Ldap.Novell.Tests.csproj", "{CDA1B479-9B9A-43BD-A499-F8FAA6476F09}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography.Tests", "src\Utils\test\Masa.Utils.Security.Cryptography.Tests\Masa.Utils.Security.Cryptography.Tests.csproj", "{AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contrib", "Contrib", "{950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{53543535-E81D-4B28-8EB0-89E9A8FDD496}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E3F32658-290D-4A85-A123-11FF6169774D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{19999563-8BBA-48A3-A087-EDEC1185E5C8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun", "src\Contrib\src\Storage\Masa.Contrib.Storage.ObjectStorage.Aliyun\Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj", "{4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E38DF0DC-C0C9-4BB9-983C-F435A73334CF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs", "src\Contrib\src\Service\Masa.Contrib.Service.MinimalAPIs\Masa.Contrib.Service.MinimalAPIs.csproj", "{89B2A360-4806-41B2-9CE1-F2E556BB222D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{45B8C34E-A62D-4809-BA0F-6046AFAB2851}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller", "src\Contrib\src\Service\Caller\Masa.Contrib.Service.Caller\Masa.Contrib.Service.Caller.csproj", "{C72508E7-CEF3-4E36-BF39-F3908EE338B7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.DaprClient", "src\Contrib\src\Service\Caller\Masa.Contrib.Service.Caller.DaprClient\Masa.Contrib.Service.Caller.DaprClient.csproj", "{65605EB9-FA98-42CE-8F40-117D89D59786}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.HttpClient", "src\Contrib\src\Service\Caller\Masa.Contrib.Service.Caller.HttpClient\Masa.Contrib.Service.Caller.HttpClient.csproj", "{5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{7B9CD814-DD10-4C63-B442-2168A0E0B6DE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch", "src\Contrib\src\SearchEngine\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj", "{4F26D6F5-32FA-4EE6-8588-A325734E4386}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{0C5262F4-DC7E-493F-AB87-A72063ABCA00}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cqrs", "Cqrs", "{FE906D46-B113-4600-AC2C-7523937B96AB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs", "src\Contrib\src\ReadWriteSpliting\Cqrs\Masa.Contrib.ReadWriteSpliting.Cqrs\Masa.Contrib.ReadWriteSpliting.Cqrs.csproj", "{6FF949B6-F1C6-4056-B9DA-CC6120D427FC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{920E6762-32FE-4BEC-AD0C-6F28119C6804}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation", "src\Contrib\src\Isolation\Masa.Contrib.Isolation\Masa.Contrib.Isolation.csproj", "{36A7B94C-1CC6-4C12-AB47-240FEB02EECF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment", "src\Contrib\src\Isolation\Masa.Contrib.Isolation.MultiEnvironment\Masa.Contrib.Isolation.MultiEnvironment.csproj", "{E2115E04-198A-48A6-9DD0-F1F8335F3FD8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant", "src\Contrib\src\Isolation\Masa.Contrib.Isolation.MultiTenant\Masa.Contrib.Isolation.MultiTenant.csproj", "{85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF", "src\Contrib\src\Isolation\Masa.Contrib.Isolation.UoW.EF\Masa.Contrib.Isolation.UoW.EF.csproj", "{672C436B-ECE4-4722-8B7D-4EF1E45194B0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF", "src\Contrib\src\Data\Masa.Contrib.Data.UoW.EF\Masa.Contrib.Data.UoW.EF.csproj", "{5D9F3039-D6FE-4F2E-9752-486ADF970093}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF", "src\Contrib\src\Data\Masa.Contrib.Data.Contracts.EF\Masa.Contrib.Data.Contracts.EF.csproj", "{E99EB5EE-6C3A-4878-9407-BB4060F5E200}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Cosmos", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Cosmos\Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj", "{7A4F49AC-A597-4D41-B380-675787D00CCD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.InMemory", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.InMemory\Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj", "{39F57444-3DB4-458D-9CEB-6484069BD7E0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.MySql", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.MySql\Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj", "{8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Oracle", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Oracle\Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj", "{12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj", "{55887169-B044-47AA-8554-E5F51935FF38}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.PostgreSql", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj", "{90D60969-E01C-4993-9DC4-794180FF49E5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Sqlite", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Sqlite\Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj", "{12E3C29F-AE3A-4BC9-A7CE-904269223C3B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.SqlServer", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.SqlServer\Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj", "{430DC17D-B161-48D6-B4CE-17913C1AABBE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.csproj", "{76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DistributedLock", "DistributedLock", "{8910E0AA-9BFB-4E69-A821-A411FEDBAFD4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdGenerator", "IdGenerator", "{A9D8D7E4-591D-479B-B0A5-07F30F831199}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{14D3C601-C29B-48D2-8312-556319D04619}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Local\Masa.Contrib.Data.DistributedLock.Local.csproj", "{19C7B778-345C-407B-BE72-67BF04784F35}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion\Masa.Contrib.Data.DistributedLock.Medallion.csproj", "{7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Azure", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Azure\Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj", "{2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.FileSystem", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj", "{7DC7F500-F004-4DAC-9F16-D6878B3808E1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.MySql", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.MySql\Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj", "{9B615187-D90E-4334-BBD8-5973A12442F9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Oracle", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Oracle\Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj", "{F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj", "{8E00F570-6926-4304-BAE0-C9E7FA9A4213}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Redis", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Redis\Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj", "{89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.SqlServer", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj", "{A69815D7-1C4F-4484-8E0B-7E6765203AC0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj", "{FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj", "{524C5CA0-036E-480A-86E4-513232422F26}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.NormalGuid", "src\Contrib\src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.NormalGuid\Masa.Contrib.Data.IdGenerator.NormalGuid.csproj", "{1A3740CF-C51F-4E7A-BA27-6BF8652021BF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid", "src\Contrib\src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.SequentialGuid\Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj", "{217AB0A8-8750-4696-8E43-E11F82A191CB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake", "src\Contrib\src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake\Masa.Contrib.Data.IdGenerator.Snowflake.csproj", "{C92637A7-77FC-4995-8024-B28F6C58AEA8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis", "src\Contrib\src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj", "{87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster", "src\Contrib\src\Data\Mapping\Masa.Contrib.Data.Mapping.Mapster\Masa.Contrib.Data.Mapping.Mapster.csproj", "{2BDF6D68-91FF-4220-8D78-90AA024275C3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{542D8266-668F-49FA-BFE1-814AB96720DD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel", "src\Contrib\src\Identity\Masa.Contrib.Identity.IdentityModel\Masa.Contrib.Identity.IdentityModel.csproj", "{AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{83AA938C-9182-4E65-A42A-79CAE68888E9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events", "src\Contrib\src\Dispatcher\Masa.Contrib.Dispatcher.Events\Masa.Contrib.Dispatcher.Events.csproj", "{8A7A91C6-C2F5-4C68-A53F-555EF93DB592}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents", "src\Contrib\src\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.csproj", "{66DEC85C-7433-4902-B01A-8F98D1A87385}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr", "src\Contrib\src\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj", "{8BE42490-F83D-48D7-8C5D-1665AC84229C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF", "src\Contrib\src\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj", "{3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{BA74E50F-C553-40D6-8578-BCB4A3F5E585}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{32BC64A9-9BC9-44F3-8978-96D30CBC7A34}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain", "src\Contrib\src\Ddd\Masa.Contrib.Ddd.Domain\Masa.Contrib.Ddd.Domain.csproj", "{2DEE608F-965F-4298-9B71-D7B32CBA66BD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF", "src\Contrib\src\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF\Masa.Contrib.Ddd.Domain.Repository.EF.csproj", "{E7C80137-1D51-4215-BED7-C739BC663BE2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{DC9F9523-A2F9-47AA-B6D9-40AC14797548}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration", "src\Contrib\src\Configuration\Masa.Contrib.Configuration\Masa.Contrib.Configuration.csproj", "{4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc", "src\Contrib\src\Configuration\Masa.Contrib.Configuration.ConfigurationApi.Dcc\Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj", "{1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache", "src\Contrib\src\Authentication\Masa.Contrib.Authentication.Oidc.Cache\Masa.Contrib.Authentication.Oidc.Cache.csproj", "{B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache.Storage", "src\Contrib\src\Authentication\Masa.Contrib.Authentication.Oidc.Cache.Storage\Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj", "{1F04359A-64BB-4C86-8D2F-161C49F2CDEB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.EntityFrameworkCore", "src\Contrib\src\Authentication\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj", "{5A42D577-38AA-4A5B-866A-01FE1339F2AB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DistributedLock", "DistributedLock", "{89639A47-CA9E-46C6-8CFB-CFB4FC18785E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdGenerator", "IdGenerator", "{3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{C73BD9CA-4C96-44E8-8A19-AED45D50B0E8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj", "{B189564D-F638-4D3F-8AA6-B9C62D8F49BE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests\Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj", "{C517C235-8969-478B-941B-2E40897F4C71}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests\Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj", "{E7F0C1EC-A954-4325-8AA4-91148F334BEA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj", "{41817AD2-D1DA-4698-B87D-910524CE4B7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.Tests\Masa.Contrib.Configuration.Tests.csproj", "{36629279-FD56-452B-88C2-5C8271500042}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{8F668369-606C-4EC5-B0F5-8095D2720642}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Tests\Masa.Contrib.Ddd.Domain.Tests.csproj", "{CE986B6E-7B18-4E1C-AB35-7993193A56C0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Integrated.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Integrated.Tests\Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj", "{7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj", "{91A658A2-3326-4730-B039-73709697938B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Entities.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Entities.Tests\Masa.Contrib.Ddd.Domain.Entities.Tests.csproj", "{73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests\Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj", "{850FF743-77FF-49CB-BE4A-C4F561E1FDCA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj", "{40D7AED3-982D-440B-BCD5-C1EFFC59514D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj", "{87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj", "{A1D7408C-AB95-4CFF-89F8-24797A865DBF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj", "{7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj", "{8680EA03-13A7-4F4A-A579-EB2CB6411C21}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj", "{4CE930E3-12E4-4BFA-962E-3477B7AB6930}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj", "{8903DCD8-A68D-4164-83EE-DE07385DDDD6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.Tests\Masa.Contrib.Dispatcher.Events.Tests.csproj", "{E2E68FF1-9CB5-424F-9D91-130A48462E54}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj", "{7FFFE514-2221-4FB1-AD37-EE56A392C3E2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj", "{472122D3-114E-424D-AF47-B3D7E94057A8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj", "{B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Tests\Masa.Contrib.Dispatcher.Tests.csproj", "{AE626BF6-3202-46B2-BB1A-0E71ED462C84}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{985B71A9-DF28-4B70-9DA5-1D60B82E8551}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Auth", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Auth\Masa.Contrib.BasicAbility.Auth.csproj", "{140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Dcc", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Dcc\Masa.Contrib.BasicAbility.Dcc.csproj", "{EAAD274F-9C5D-4531-A4E5-A5764E9D644A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Mc", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Mc\Masa.Contrib.BasicAbility.Mc.csproj", "{F9C27912-F7EC-47B6-A385-064BD4B92EDA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Pm", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Pm\Masa.Contrib.BasicAbility.Pm.csproj", "{F346B708-0D1B-4BA7-AA86-1B977BA88FB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Scheduler", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Scheduler\Masa.Contrib.BasicAbility.Scheduler.csproj", "{332D590C-11EC-481D-AC55-6279548F1CF4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Tsc", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Tsc\Masa.Contrib.BasicAbility.Tsc.csproj", "{7BF99E7E-37EB-46D6-8808-2254430C3645}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Tsc.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Tsc.Test\Masa.Contrib.BasicAbility.Tsc.Tests.csproj", "{5EF602A6-3996-44D3-A6C0-5319C9BF8B21}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Dcc.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Dcc.Tests\Masa.Contrib.BasicAbility.Dcc.Tests\Masa.Contrib.BasicAbility.Dcc.Tests.csproj", "{7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Mc.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Mc.Tests\Masa.Contrib.BasicAbility.Mc.Tests.csproj", "{37138DEF-EEE4-4363-A307-0027B4C6ACD8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Auth.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Auth.Tests\Masa.Contrib.BasicAbility.Auth.Tests.csproj", "{A93F1887-0011-466C-8EB8-3A338AEA5A4B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Pm.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Pm.Tests\Masa.Contrib.BasicAbility.Pm.Tests.csproj", "{A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Scheduler.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Scheduler.Tests\Masa.Contrib.BasicAbility.Scheduler.Tests.csproj", "{9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{965C3DBE-2DF3-4BCF-A7BB-C26BEB2F8CCA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{58344864-F2A8-4C95-AB75-B5150C3A383A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.MultiEnvironment.Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj", "{CC7ED747-8BCE-4B49-8855-AE4697792A81}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.MultiTenant.Tests\Masa.Contrib.Isolation.MultiTenant.Tests.csproj", "{605A3653-C7E3-4EC2-8749-979E4A0227D0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.Tests\Masa.Contrib.Isolation.Tests.csproj", "{2D61CA3A-A40C-466D-9E87-59A32A86B7BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.UoW.EF.Tests\Masa.Contrib.Isolation.UoW.EF.Tests.csproj", "{50C13F5E-BA3A-4B04-A730-BAA584E051AB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Web.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.UoW.EF.Web.Tests\Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj", "{C8AD2261-D325-414D-9B2D-B2A9D27C242F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel.Tests", "src\Contrib\test\Identity\Masa.Contrib.Identity.IdentityModel.Tests\Masa.Contrib.Identity.IdentityModel.Tests.csproj", "{CC9C8421-68D2-4645-B97E-512FAC691703}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{16FABF17-EC86-4B86-9130-19D8635219C0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local.Tests", "src\Contrib\test\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Local.Tests\Masa.Contrib.Data.DistributedLock.Local.Tests.csproj", "{1551B2ED-9931-4A03-8853-1C3E5504C43D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Tests", "src\Contrib\test\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Tests\Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj", "{CB1F1533-E430-47C5-AD52-04922CC959A5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF.Tests", "src\Contrib\test\Data\Masa.Contrib.Data.Contracts.EF.Tests\Masa.Contrib.Data.Contracts.EF.Tests.csproj", "{0607F6E0-84AC-4FBC-9717-6F0B1D18E574}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Tests", "src\Contrib\test\Data\Masa.Contrib.Data.EntityFrameworkCore.Tests\Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj", "{1041A4C4-D422-4AD8-B511-B8E7FBA548C9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF.Tests", "src\Contrib\test\Data\Masa.Contrib.Data.UoW.EF.Tests\Masa.Contrib.Data.UoW.EF.Tests.csproj", "{D05ADEA6-2267-4DC1-901A-BD18B697E889}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests", "src\Contrib\test\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj", "{1787BF8C-3C05-4E07-8868-E839544F9522}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests", "src\Contrib\test\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj", "{F2766BE2-8387-49E6-B17D-5B7DA791DC75}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests", "src\Contrib\test\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj", "{F673CF31-D8CF-4F3E-B294-0802589F5BF2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{9FBFDCBB-DB43-4259-B67C-693394134F09}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster.Tests", "src\Contrib\test\Data\Mapping\Masa.Contrib.Data.Mapping.Mapster.Tests\Masa.Contrib.Data.Mapping.Mapster.Tests.csproj", "{0D9CDEA2-0DC6-490A-9145-782259B63739}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{B0982BE8-DE6E-4763-8AA0-77C426DCE199}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs.Tests", "src\Contrib\test\Service\Masa.Contrib.Service.MinimalAPIs.Tests\Masa.Contrib.Service.MinimalAPIs.Tests.csproj", "{80512601-4B59-4A1B-984F-8E81E3242F97}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.AutomaticCaller.Tests", "src\Contrib\test\Service\Caller\Masa.Contrib.Service.Caller.AutomaticCaller.Tests\Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj", "{96C2CD33-8A8C-4206-9C73-97E8D748F397}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.Tests", "src\Contrib\test\Service\Caller\Masa.Contrib.Service.Caller.Tests\Masa.Contrib.Service.Caller.Tests.csproj", "{FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{8B778866-D908-456F-943A-1172B52360AD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{B7B1D4FB-8113-4B29-92DB-3BC3960BB9A5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests", "src\Contrib\test\Storage\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj", "{76117457-EC1B-4844-825A-20A760B42C44}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{92F310E1-6CD0-4066-9703-B81B4AC07819}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests", "src\Contrib\test\SearchEngine\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj", "{89EE0C4D-6C29-472E-9109-84327DB489A1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{AF35D4CC-EBE2-4F2B-8622-7A93A8CF9EF8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs.Tests", "src\Contrib\test\ReadWriteSpliting\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj", "{F45CBF27-1D45-404C-9B09-5CC781AF5942}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|x64.ActiveCfg = Debug|Any CPU + {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|x64.Build.0 = Debug|Any CPU + {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|Any CPU.Build.0 = Release|Any CPU + {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|x64.ActiveCfg = Release|Any CPU + {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|x64.Build.0 = Release|Any CPU + {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|x64.ActiveCfg = Debug|Any CPU + {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|x64.Build.0 = Debug|Any CPU + {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|Any CPU.Build.0 = Release|Any CPU + {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|x64.ActiveCfg = Release|Any CPU + {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|x64.Build.0 = Release|Any CPU + {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|x64.ActiveCfg = Debug|Any CPU + {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|x64.Build.0 = Debug|Any CPU + {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|Any CPU.Build.0 = Release|Any CPU + {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|x64.ActiveCfg = Release|Any CPU + {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|x64.Build.0 = Release|Any CPU + {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|x64.ActiveCfg = Debug|Any CPU + {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|x64.Build.0 = Debug|Any CPU + {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|Any CPU.Build.0 = Release|Any CPU + {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|x64.ActiveCfg = Release|Any CPU + {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|x64.Build.0 = Release|Any CPU + {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|x64.ActiveCfg = Debug|Any CPU + {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|x64.Build.0 = Debug|Any CPU + {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|Any CPU.Build.0 = Release|Any CPU + {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|x64.ActiveCfg = Release|Any CPU + {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|x64.Build.0 = Release|Any CPU + {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|x64.ActiveCfg = Debug|Any CPU + {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|x64.Build.0 = Debug|Any CPU + {88BC8170-9123-48C0-A914-11D3CE805196}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88BC8170-9123-48C0-A914-11D3CE805196}.Release|Any CPU.Build.0 = Release|Any CPU + {88BC8170-9123-48C0-A914-11D3CE805196}.Release|x64.ActiveCfg = Release|Any CPU + {88BC8170-9123-48C0-A914-11D3CE805196}.Release|x64.Build.0 = Release|Any CPU + {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|Any CPU.Build.0 = Debug|Any CPU + {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|x64.ActiveCfg = Debug|Any CPU + {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|x64.Build.0 = Debug|Any CPU + {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|Any CPU.ActiveCfg = Release|Any CPU + {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|Any CPU.Build.0 = Release|Any CPU + {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|x64.ActiveCfg = Release|Any CPU + {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|x64.Build.0 = Release|Any CPU + {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|x64.ActiveCfg = Debug|Any CPU + {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|x64.Build.0 = Debug|Any CPU + {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|Any CPU.Build.0 = Release|Any CPU + {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|x64.ActiveCfg = Release|Any CPU + {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|x64.Build.0 = Release|Any CPU + {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|x64.ActiveCfg = Debug|Any CPU + {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|x64.Build.0 = Debug|Any CPU + {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|Any CPU.Build.0 = Release|Any CPU + {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|x64.ActiveCfg = Release|Any CPU + {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|x64.Build.0 = Release|Any CPU + {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|x64.ActiveCfg = Debug|Any CPU + {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|x64.Build.0 = Debug|Any CPU + {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|Any CPU.Build.0 = Release|Any CPU + {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|x64.ActiveCfg = Release|Any CPU + {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|x64.Build.0 = Release|Any CPU + {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|x64.ActiveCfg = Debug|Any CPU + {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|x64.Build.0 = Debug|Any CPU + {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|Any CPU.Build.0 = Release|Any CPU + {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|x64.ActiveCfg = Release|Any CPU + {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|x64.Build.0 = Release|Any CPU + {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|x64.ActiveCfg = Debug|Any CPU + {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|x64.Build.0 = Debug|Any CPU + {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|Any CPU.Build.0 = Release|Any CPU + {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|x64.ActiveCfg = Release|Any CPU + {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|x64.Build.0 = Release|Any CPU + {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|x64.ActiveCfg = Debug|Any CPU + {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|x64.Build.0 = Debug|Any CPU + {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|Any CPU.Build.0 = Release|Any CPU + {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|x64.ActiveCfg = Release|Any CPU + {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|x64.Build.0 = Release|Any CPU + {C3451307-3743-4911-A401-7F28889703D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C3451307-3743-4911-A401-7F28889703D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C3451307-3743-4911-A401-7F28889703D3}.Debug|x64.ActiveCfg = Debug|Any CPU + {C3451307-3743-4911-A401-7F28889703D3}.Debug|x64.Build.0 = Debug|Any CPU + {C3451307-3743-4911-A401-7F28889703D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C3451307-3743-4911-A401-7F28889703D3}.Release|Any CPU.Build.0 = Release|Any CPU + {C3451307-3743-4911-A401-7F28889703D3}.Release|x64.ActiveCfg = Release|Any CPU + {C3451307-3743-4911-A401-7F28889703D3}.Release|x64.Build.0 = Release|Any CPU + {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|x64.ActiveCfg = Debug|Any CPU + {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|x64.Build.0 = Debug|Any CPU + {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|Any CPU.Build.0 = Release|Any CPU + {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|x64.ActiveCfg = Release|Any CPU + {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|x64.Build.0 = Release|Any CPU + {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|x64.ActiveCfg = Debug|Any CPU + {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|x64.Build.0 = Debug|Any CPU + {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|Any CPU.Build.0 = Release|Any CPU + {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|x64.ActiveCfg = Release|Any CPU + {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|x64.Build.0 = Release|Any CPU + {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|Any CPU.Build.0 = Debug|Any CPU + {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|x64.ActiveCfg = Debug|Any CPU + {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|x64.Build.0 = Debug|Any CPU + {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|Any CPU.ActiveCfg = Release|Any CPU + {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|Any CPU.Build.0 = Release|Any CPU + {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|x64.ActiveCfg = Release|Any CPU + {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|x64.Build.0 = Release|Any CPU + {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|x64.ActiveCfg = Debug|Any CPU + {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|x64.Build.0 = Debug|Any CPU + {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|Any CPU.Build.0 = Release|Any CPU + {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|x64.ActiveCfg = Release|Any CPU + {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|x64.Build.0 = Release|Any CPU + {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|x64.ActiveCfg = Debug|Any CPU + {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|x64.Build.0 = Debug|Any CPU + {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|Any CPU.Build.0 = Release|Any CPU + {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|x64.ActiveCfg = Release|Any CPU + {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|x64.Build.0 = Release|Any CPU + {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|Any CPU.Build.0 = Debug|Any CPU + {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|x64.ActiveCfg = Debug|Any CPU + {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|x64.Build.0 = Debug|Any CPU + {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|Any CPU.ActiveCfg = Release|Any CPU + {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|Any CPU.Build.0 = Release|Any CPU + {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|x64.ActiveCfg = Release|Any CPU + {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|x64.Build.0 = Release|Any CPU + {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|x64.ActiveCfg = Debug|Any CPU + {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|x64.Build.0 = Debug|Any CPU + {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|Any CPU.Build.0 = Release|Any CPU + {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|x64.ActiveCfg = Release|Any CPU + {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|x64.Build.0 = Release|Any CPU + {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|x64.ActiveCfg = Debug|Any CPU + {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|x64.Build.0 = Debug|Any CPU + {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|Any CPU.Build.0 = Release|Any CPU + {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|x64.ActiveCfg = Release|Any CPU + {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|x64.Build.0 = Release|Any CPU + {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|x64.ActiveCfg = Debug|Any CPU + {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|x64.Build.0 = Debug|Any CPU + {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|Any CPU.Build.0 = Release|Any CPU + {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|x64.ActiveCfg = Release|Any CPU + {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|x64.Build.0 = Release|Any CPU + {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|x64.ActiveCfg = Debug|Any CPU + {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|x64.Build.0 = Debug|Any CPU + {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|Any CPU.Build.0 = Release|Any CPU + {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|x64.ActiveCfg = Release|Any CPU + {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|x64.Build.0 = Release|Any CPU + {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|x64.ActiveCfg = Debug|Any CPU + {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|x64.Build.0 = Debug|Any CPU + {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|Any CPU.Build.0 = Release|Any CPU + {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|x64.ActiveCfg = Release|Any CPU + {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|x64.Build.0 = Release|Any CPU + {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|x64.ActiveCfg = Debug|Any CPU + {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|x64.Build.0 = Debug|Any CPU + {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|Any CPU.Build.0 = Release|Any CPU + {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|x64.ActiveCfg = Release|Any CPU + {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|x64.Build.0 = Release|Any CPU + {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|x64.ActiveCfg = Debug|Any CPU + {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|x64.Build.0 = Debug|Any CPU + {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|Any CPU.Build.0 = Release|Any CPU + {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|x64.ActiveCfg = Release|Any CPU + {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|x64.Build.0 = Release|Any CPU + {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|x64.ActiveCfg = Debug|Any CPU + {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|x64.Build.0 = Debug|Any CPU + {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|Any CPU.Build.0 = Release|Any CPU + {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|x64.ActiveCfg = Release|Any CPU + {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|x64.Build.0 = Release|Any CPU + {B228589B-4106-4CF8-B165-26636B94BE2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B228589B-4106-4CF8-B165-26636B94BE2C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B228589B-4106-4CF8-B165-26636B94BE2C}.Debug|x64.ActiveCfg = Debug|Any CPU + {B228589B-4106-4CF8-B165-26636B94BE2C}.Debug|x64.Build.0 = Debug|Any CPU + {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|Any CPU.Build.0 = Release|Any CPU + {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|x64.ActiveCfg = Release|Any CPU + {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|x64.Build.0 = Release|Any CPU + {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Debug|x64.ActiveCfg = Debug|Any CPU + {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Debug|x64.Build.0 = Debug|Any CPU + {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Release|Any CPU.Build.0 = Release|Any CPU + {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Release|x64.ActiveCfg = Release|Any CPU + {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Release|x64.Build.0 = Release|Any CPU + {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Debug|x64.ActiveCfg = Debug|Any CPU + {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Debug|x64.Build.0 = Debug|Any CPU + {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Release|Any CPU.Build.0 = Release|Any CPU + {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Release|x64.ActiveCfg = Release|Any CPU + {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Release|x64.Build.0 = Release|Any CPU + {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|x64.ActiveCfg = Debug|Any CPU + {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|x64.Build.0 = Debug|Any CPU + {322F0F91-E181-4139-87DE-974CCF2339BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {322F0F91-E181-4139-87DE-974CCF2339BA}.Release|Any CPU.Build.0 = Release|Any CPU + {322F0F91-E181-4139-87DE-974CCF2339BA}.Release|x64.ActiveCfg = Release|Any CPU + {322F0F91-E181-4139-87DE-974CCF2339BA}.Release|x64.Build.0 = Release|Any CPU + {46C86695-A597-47F3-944E-03C63CA678F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46C86695-A597-47F3-944E-03C63CA678F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {46C86695-A597-47F3-944E-03C63CA678F4}.Debug|x64.ActiveCfg = Debug|Any CPU + {46C86695-A597-47F3-944E-03C63CA678F4}.Debug|x64.Build.0 = Debug|Any CPU + {46C86695-A597-47F3-944E-03C63CA678F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {46C86695-A597-47F3-944E-03C63CA678F4}.Release|Any CPU.Build.0 = Release|Any CPU + {46C86695-A597-47F3-944E-03C63CA678F4}.Release|x64.ActiveCfg = Release|Any CPU + {46C86695-A597-47F3-944E-03C63CA678F4}.Release|x64.Build.0 = Release|Any CPU + {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Debug|x64.ActiveCfg = Debug|Any CPU + {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Debug|x64.Build.0 = Debug|Any CPU + {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Release|Any CPU.Build.0 = Release|Any CPU + {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Release|x64.ActiveCfg = Release|Any CPU + {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Release|x64.Build.0 = Release|Any CPU + {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Debug|x64.ActiveCfg = Debug|Any CPU + {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Debug|x64.Build.0 = Debug|Any CPU + {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Release|Any CPU.Build.0 = Release|Any CPU + {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Release|x64.ActiveCfg = Release|Any CPU + {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Release|x64.Build.0 = Release|Any CPU + {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Debug|x64.ActiveCfg = Debug|Any CPU + {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Debug|x64.Build.0 = Debug|Any CPU + {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Release|Any CPU.Build.0 = Release|Any CPU + {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Release|x64.ActiveCfg = Release|Any CPU + {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Release|x64.Build.0 = Release|Any CPU + {049430DA-664C-4C77-A679-0CF12217ABB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {049430DA-664C-4C77-A679-0CF12217ABB2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {049430DA-664C-4C77-A679-0CF12217ABB2}.Debug|x64.ActiveCfg = Debug|Any CPU + {049430DA-664C-4C77-A679-0CF12217ABB2}.Debug|x64.Build.0 = Debug|Any CPU + {049430DA-664C-4C77-A679-0CF12217ABB2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {049430DA-664C-4C77-A679-0CF12217ABB2}.Release|Any CPU.Build.0 = Release|Any CPU + {049430DA-664C-4C77-A679-0CF12217ABB2}.Release|x64.ActiveCfg = Release|Any CPU + {049430DA-664C-4C77-A679-0CF12217ABB2}.Release|x64.Build.0 = Release|Any CPU + {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Debug|x64.ActiveCfg = Debug|Any CPU + {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Debug|x64.Build.0 = Debug|Any CPU + {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Release|Any CPU.Build.0 = Release|Any CPU + {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Release|x64.ActiveCfg = Release|Any CPU + {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Release|x64.Build.0 = Release|Any CPU + {64B72C9E-85BD-4C41-B67D-892157600F5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64B72C9E-85BD-4C41-B67D-892157600F5B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64B72C9E-85BD-4C41-B67D-892157600F5B}.Debug|x64.ActiveCfg = Debug|Any CPU + {64B72C9E-85BD-4C41-B67D-892157600F5B}.Debug|x64.Build.0 = Debug|Any CPU + {64B72C9E-85BD-4C41-B67D-892157600F5B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64B72C9E-85BD-4C41-B67D-892157600F5B}.Release|Any CPU.Build.0 = Release|Any CPU + {64B72C9E-85BD-4C41-B67D-892157600F5B}.Release|x64.ActiveCfg = Release|Any CPU + {64B72C9E-85BD-4C41-B67D-892157600F5B}.Release|x64.Build.0 = Release|Any CPU + {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Debug|x64.ActiveCfg = Debug|Any CPU + {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Debug|x64.Build.0 = Debug|Any CPU + {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Release|Any CPU.Build.0 = Release|Any CPU + {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Release|x64.ActiveCfg = Release|Any CPU + {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Release|x64.Build.0 = Release|Any CPU + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Debug|x64.ActiveCfg = Debug|Any CPU + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Debug|x64.Build.0 = Debug|Any CPU + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Release|Any CPU.Build.0 = Release|Any CPU + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Release|x64.ActiveCfg = Release|Any CPU + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Release|x64.Build.0 = Release|Any CPU + {A88B4DB8-2441-488D-B097-68F02F18DECC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A88B4DB8-2441-488D-B097-68F02F18DECC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A88B4DB8-2441-488D-B097-68F02F18DECC}.Debug|x64.ActiveCfg = Debug|Any CPU + {A88B4DB8-2441-488D-B097-68F02F18DECC}.Debug|x64.Build.0 = Debug|Any CPU + {A88B4DB8-2441-488D-B097-68F02F18DECC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A88B4DB8-2441-488D-B097-68F02F18DECC}.Release|Any CPU.Build.0 = Release|Any CPU + {A88B4DB8-2441-488D-B097-68F02F18DECC}.Release|x64.ActiveCfg = Release|Any CPU + {A88B4DB8-2441-488D-B097-68F02F18DECC}.Release|x64.Build.0 = Release|Any CPU + {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Debug|x64.ActiveCfg = Debug|Any CPU + {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Debug|x64.Build.0 = Debug|Any CPU + {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Release|Any CPU.Build.0 = Release|Any CPU + {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Release|x64.ActiveCfg = Release|Any CPU + {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Release|x64.Build.0 = Release|Any CPU + {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Debug|x64.ActiveCfg = Debug|Any CPU + {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Debug|x64.Build.0 = Debug|Any CPU + {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Release|Any CPU.Build.0 = Release|Any CPU + {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Release|x64.ActiveCfg = Release|Any CPU + {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Release|x64.Build.0 = Release|Any CPU + {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Debug|x64.ActiveCfg = Debug|Any CPU + {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Debug|x64.Build.0 = Debug|Any CPU + {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Release|Any CPU.Build.0 = Release|Any CPU + {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Release|x64.ActiveCfg = Release|Any CPU + {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Release|x64.Build.0 = Release|Any CPU + {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Debug|x64.ActiveCfg = Debug|Any CPU + {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Debug|x64.Build.0 = Debug|Any CPU + {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Release|Any CPU.Build.0 = Release|Any CPU + {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Release|x64.ActiveCfg = Release|Any CPU + {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Release|x64.Build.0 = Release|Any CPU + {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Debug|x64.ActiveCfg = Debug|Any CPU + {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Debug|x64.Build.0 = Debug|Any CPU + {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Release|Any CPU.Build.0 = Release|Any CPU + {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Release|x64.ActiveCfg = Release|Any CPU + {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Release|x64.Build.0 = Release|Any CPU + {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Debug|x64.ActiveCfg = Debug|Any CPU + {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Debug|x64.Build.0 = Debug|Any CPU + {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Release|Any CPU.Build.0 = Release|Any CPU + {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Release|x64.ActiveCfg = Release|Any CPU + {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Release|x64.Build.0 = Release|Any CPU + {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Debug|x64.ActiveCfg = Debug|Any CPU + {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Debug|x64.Build.0 = Debug|Any CPU + {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Release|Any CPU.Build.0 = Release|Any CPU + {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Release|x64.ActiveCfg = Release|Any CPU + {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Release|x64.Build.0 = Release|Any CPU + {BE11C98A-5680-491E-86E9-93B0A83909EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE11C98A-5680-491E-86E9-93B0A83909EA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE11C98A-5680-491E-86E9-93B0A83909EA}.Debug|x64.ActiveCfg = Debug|Any CPU + {BE11C98A-5680-491E-86E9-93B0A83909EA}.Debug|x64.Build.0 = Debug|Any CPU + {BE11C98A-5680-491E-86E9-93B0A83909EA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE11C98A-5680-491E-86E9-93B0A83909EA}.Release|Any CPU.Build.0 = Release|Any CPU + {BE11C98A-5680-491E-86E9-93B0A83909EA}.Release|x64.ActiveCfg = Release|Any CPU + {BE11C98A-5680-491E-86E9-93B0A83909EA}.Release|x64.Build.0 = Release|Any CPU + {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Debug|x64.ActiveCfg = Debug|Any CPU + {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Debug|x64.Build.0 = Debug|Any CPU + {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Release|Any CPU.Build.0 = Release|Any CPU + {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Release|x64.ActiveCfg = Release|Any CPU + {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Release|x64.Build.0 = Release|Any CPU + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Debug|x64.ActiveCfg = Debug|Any CPU + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Debug|x64.Build.0 = Debug|Any CPU + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Release|Any CPU.Build.0 = Release|Any CPU + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Release|x64.ActiveCfg = Release|Any CPU + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Release|x64.Build.0 = Release|Any CPU + {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Debug|x64.ActiveCfg = Debug|Any CPU + {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Debug|x64.Build.0 = Debug|Any CPU + {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Release|Any CPU.Build.0 = Release|Any CPU + {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Release|x64.ActiveCfg = Release|Any CPU + {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Release|x64.Build.0 = Release|Any CPU + {CC117C03-267A-4145-B258-922C35484883}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC117C03-267A-4145-B258-922C35484883}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC117C03-267A-4145-B258-922C35484883}.Debug|x64.ActiveCfg = Debug|Any CPU + {CC117C03-267A-4145-B258-922C35484883}.Debug|x64.Build.0 = Debug|Any CPU + {CC117C03-267A-4145-B258-922C35484883}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC117C03-267A-4145-B258-922C35484883}.Release|Any CPU.Build.0 = Release|Any CPU + {CC117C03-267A-4145-B258-922C35484883}.Release|x64.ActiveCfg = Release|Any CPU + {CC117C03-267A-4145-B258-922C35484883}.Release|x64.Build.0 = Release|Any CPU + {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Debug|x64.ActiveCfg = Debug|Any CPU + {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Debug|x64.Build.0 = Debug|Any CPU + {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Release|Any CPU.Build.0 = Release|Any CPU + {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Release|x64.ActiveCfg = Release|Any CPU + {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Release|x64.Build.0 = Release|Any CPU + {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Debug|x64.ActiveCfg = Debug|Any CPU + {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Debug|x64.Build.0 = Debug|Any CPU + {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Release|Any CPU.Build.0 = Release|Any CPU + {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Release|x64.ActiveCfg = Release|Any CPU + {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Release|x64.Build.0 = Release|Any CPU + {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Debug|x64.ActiveCfg = Debug|Any CPU + {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Debug|x64.Build.0 = Debug|Any CPU + {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Release|Any CPU.Build.0 = Release|Any CPU + {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Release|x64.ActiveCfg = Release|Any CPU + {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Release|x64.Build.0 = Release|Any CPU + {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Debug|x64.ActiveCfg = Debug|Any CPU + {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Debug|x64.Build.0 = Debug|Any CPU + {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Release|Any CPU.Build.0 = Release|Any CPU + {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Release|x64.ActiveCfg = Release|Any CPU + {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Release|x64.Build.0 = Release|Any CPU + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Debug|x64.ActiveCfg = Debug|Any CPU + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Debug|x64.Build.0 = Debug|Any CPU + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|Any CPU.Build.0 = Release|Any CPU + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|x64.ActiveCfg = Release|Any CPU + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|x64.Build.0 = Release|Any CPU + {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Debug|x64.ActiveCfg = Debug|Any CPU + {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Debug|x64.Build.0 = Debug|Any CPU + {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Release|Any CPU.Build.0 = Release|Any CPU + {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Release|x64.ActiveCfg = Release|Any CPU + {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Release|x64.Build.0 = Release|Any CPU + {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Debug|x64.ActiveCfg = Debug|Any CPU + {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Debug|x64.Build.0 = Debug|Any CPU + {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Release|Any CPU.Build.0 = Release|Any CPU + {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Release|x64.ActiveCfg = Release|Any CPU + {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Release|x64.Build.0 = Release|Any CPU + {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|x64.ActiveCfg = Debug|Any CPU + {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|x64.Build.0 = Debug|Any CPU + {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Release|Any CPU.Build.0 = Release|Any CPU + {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Release|x64.ActiveCfg = Release|Any CPU + {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Release|x64.Build.0 = Release|Any CPU + {2A57A40F-92F5-4ACE-95AA-763915578282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2A57A40F-92F5-4ACE-95AA-763915578282}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2A57A40F-92F5-4ACE-95AA-763915578282}.Debug|x64.ActiveCfg = Debug|Any CPU + {2A57A40F-92F5-4ACE-95AA-763915578282}.Debug|x64.Build.0 = Debug|Any CPU + {2A57A40F-92F5-4ACE-95AA-763915578282}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2A57A40F-92F5-4ACE-95AA-763915578282}.Release|Any CPU.Build.0 = Release|Any CPU + {2A57A40F-92F5-4ACE-95AA-763915578282}.Release|x64.ActiveCfg = Release|Any CPU + {2A57A40F-92F5-4ACE-95AA-763915578282}.Release|x64.Build.0 = Release|Any CPU + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Debug|x64.ActiveCfg = Debug|Any CPU + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Debug|x64.Build.0 = Debug|Any CPU + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Release|Any CPU.Build.0 = Release|Any CPU + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Release|x64.ActiveCfg = Release|Any CPU + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Release|x64.Build.0 = Release|Any CPU + {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Debug|x64.ActiveCfg = Debug|Any CPU + {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Debug|x64.Build.0 = Debug|Any CPU + {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|Any CPU.Build.0 = Release|Any CPU + {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|x64.ActiveCfg = Release|Any CPU + {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|x64.Build.0 = Release|Any CPU + {072E41B5-B2BF-4493-9D26-15D4BB490318}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {072E41B5-B2BF-4493-9D26-15D4BB490318}.Debug|Any CPU.Build.0 = Debug|Any CPU + {072E41B5-B2BF-4493-9D26-15D4BB490318}.Debug|x64.ActiveCfg = Debug|Any CPU + {072E41B5-B2BF-4493-9D26-15D4BB490318}.Debug|x64.Build.0 = Debug|Any CPU + {072E41B5-B2BF-4493-9D26-15D4BB490318}.Release|Any CPU.ActiveCfg = Release|Any CPU + {072E41B5-B2BF-4493-9D26-15D4BB490318}.Release|Any CPU.Build.0 = Release|Any CPU + {072E41B5-B2BF-4493-9D26-15D4BB490318}.Release|x64.ActiveCfg = Release|Any CPU + {072E41B5-B2BF-4493-9D26-15D4BB490318}.Release|x64.Build.0 = Release|Any CPU + {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|x64.ActiveCfg = Debug|Any CPU + {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|x64.Build.0 = Debug|Any CPU + {A4F3852E-DC6B-43A8-A40A-899089546444}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4F3852E-DC6B-43A8-A40A-899089546444}.Release|Any CPU.Build.0 = Release|Any CPU + {A4F3852E-DC6B-43A8-A40A-899089546444}.Release|x64.ActiveCfg = Release|Any CPU + {A4F3852E-DC6B-43A8-A40A-899089546444}.Release|x64.Build.0 = Release|Any CPU + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Debug|x64.ActiveCfg = Debug|Any CPU + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Debug|x64.Build.0 = Debug|Any CPU + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Release|Any CPU.Build.0 = Release|Any CPU + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Release|x64.ActiveCfg = Release|Any CPU + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Release|x64.Build.0 = Release|Any CPU + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Debug|x64.ActiveCfg = Debug|Any CPU + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Debug|x64.Build.0 = Debug|Any CPU + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Release|Any CPU.Build.0 = Release|Any CPU + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Release|x64.ActiveCfg = Release|Any CPU + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Release|x64.Build.0 = Release|Any CPU + {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Debug|x64.ActiveCfg = Debug|Any CPU + {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Debug|x64.Build.0 = Debug|Any CPU + {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Release|Any CPU.Build.0 = Release|Any CPU + {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Release|x64.ActiveCfg = Release|Any CPU + {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Release|x64.Build.0 = Release|Any CPU + {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Debug|x64.ActiveCfg = Debug|Any CPU + {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Debug|x64.Build.0 = Debug|Any CPU + {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Release|Any CPU.Build.0 = Release|Any CPU + {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Release|x64.ActiveCfg = Release|Any CPU + {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Release|x64.Build.0 = Release|Any CPU + {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Debug|x64.ActiveCfg = Debug|Any CPU + {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Debug|x64.Build.0 = Debug|Any CPU + {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Release|Any CPU.Build.0 = Release|Any CPU + {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Release|x64.ActiveCfg = Release|Any CPU + {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Release|x64.Build.0 = Release|Any CPU + {65605EB9-FA98-42CE-8F40-117D89D59786}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65605EB9-FA98-42CE-8F40-117D89D59786}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65605EB9-FA98-42CE-8F40-117D89D59786}.Debug|x64.ActiveCfg = Debug|Any CPU + {65605EB9-FA98-42CE-8F40-117D89D59786}.Debug|x64.Build.0 = Debug|Any CPU + {65605EB9-FA98-42CE-8F40-117D89D59786}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65605EB9-FA98-42CE-8F40-117D89D59786}.Release|Any CPU.Build.0 = Release|Any CPU + {65605EB9-FA98-42CE-8F40-117D89D59786}.Release|x64.ActiveCfg = Release|Any CPU + {65605EB9-FA98-42CE-8F40-117D89D59786}.Release|x64.Build.0 = Release|Any CPU + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Debug|x64.ActiveCfg = Debug|Any CPU + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Debug|x64.Build.0 = Debug|Any CPU + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Release|Any CPU.Build.0 = Release|Any CPU + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Release|x64.ActiveCfg = Release|Any CPU + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Release|x64.Build.0 = Release|Any CPU + {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Debug|x64.ActiveCfg = Debug|Any CPU + {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Debug|x64.Build.0 = Debug|Any CPU + {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Release|Any CPU.Build.0 = Release|Any CPU + {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Release|x64.ActiveCfg = Release|Any CPU + {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Release|x64.Build.0 = Release|Any CPU + {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Debug|x64.ActiveCfg = Debug|Any CPU + {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Debug|x64.Build.0 = Debug|Any CPU + {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Release|Any CPU.Build.0 = Release|Any CPU + {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Release|x64.ActiveCfg = Release|Any CPU + {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Release|x64.Build.0 = Release|Any CPU + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Debug|x64.ActiveCfg = Debug|Any CPU + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Debug|x64.Build.0 = Debug|Any CPU + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Release|Any CPU.Build.0 = Release|Any CPU + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Release|x64.ActiveCfg = Release|Any CPU + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Release|x64.Build.0 = Release|Any CPU + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Debug|x64.ActiveCfg = Debug|Any CPU + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Debug|x64.Build.0 = Debug|Any CPU + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Release|Any CPU.Build.0 = Release|Any CPU + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Release|x64.ActiveCfg = Release|Any CPU + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Release|x64.Build.0 = Release|Any CPU + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Debug|x64.ActiveCfg = Debug|Any CPU + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Debug|x64.Build.0 = Debug|Any CPU + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Release|Any CPU.Build.0 = Release|Any CPU + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Release|x64.ActiveCfg = Release|Any CPU + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Release|x64.Build.0 = Release|Any CPU + {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Debug|x64.ActiveCfg = Debug|Any CPU + {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Debug|x64.Build.0 = Debug|Any CPU + {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Release|Any CPU.Build.0 = Release|Any CPU + {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Release|x64.ActiveCfg = Release|Any CPU + {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Release|x64.Build.0 = Release|Any CPU + {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Debug|x64.ActiveCfg = Debug|Any CPU + {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Debug|x64.Build.0 = Debug|Any CPU + {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Release|Any CPU.Build.0 = Release|Any CPU + {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Release|x64.ActiveCfg = Release|Any CPU + {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Release|x64.Build.0 = Release|Any CPU + {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Debug|x64.ActiveCfg = Debug|Any CPU + {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Debug|x64.Build.0 = Debug|Any CPU + {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Release|Any CPU.Build.0 = Release|Any CPU + {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Release|x64.ActiveCfg = Release|Any CPU + {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Release|x64.Build.0 = Release|Any CPU + {7A4F49AC-A597-4D41-B380-675787D00CCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A4F49AC-A597-4D41-B380-675787D00CCD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A4F49AC-A597-4D41-B380-675787D00CCD}.Debug|x64.ActiveCfg = Debug|Any CPU + {7A4F49AC-A597-4D41-B380-675787D00CCD}.Debug|x64.Build.0 = Debug|Any CPU + {7A4F49AC-A597-4D41-B380-675787D00CCD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A4F49AC-A597-4D41-B380-675787D00CCD}.Release|Any CPU.Build.0 = Release|Any CPU + {7A4F49AC-A597-4D41-B380-675787D00CCD}.Release|x64.ActiveCfg = Release|Any CPU + {7A4F49AC-A597-4D41-B380-675787D00CCD}.Release|x64.Build.0 = Release|Any CPU + {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Debug|x64.ActiveCfg = Debug|Any CPU + {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Debug|x64.Build.0 = Debug|Any CPU + {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Release|Any CPU.Build.0 = Release|Any CPU + {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Release|x64.ActiveCfg = Release|Any CPU + {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Release|x64.Build.0 = Release|Any CPU + {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Debug|x64.ActiveCfg = Debug|Any CPU + {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Debug|x64.Build.0 = Debug|Any CPU + {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Release|Any CPU.Build.0 = Release|Any CPU + {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Release|x64.ActiveCfg = Release|Any CPU + {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Release|x64.Build.0 = Release|Any CPU + {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Debug|x64.ActiveCfg = Debug|Any CPU + {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Debug|x64.Build.0 = Debug|Any CPU + {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Release|Any CPU.Build.0 = Release|Any CPU + {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Release|x64.ActiveCfg = Release|Any CPU + {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Release|x64.Build.0 = Release|Any CPU + {55887169-B044-47AA-8554-E5F51935FF38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55887169-B044-47AA-8554-E5F51935FF38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55887169-B044-47AA-8554-E5F51935FF38}.Debug|x64.ActiveCfg = Debug|Any CPU + {55887169-B044-47AA-8554-E5F51935FF38}.Debug|x64.Build.0 = Debug|Any CPU + {55887169-B044-47AA-8554-E5F51935FF38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55887169-B044-47AA-8554-E5F51935FF38}.Release|Any CPU.Build.0 = Release|Any CPU + {55887169-B044-47AA-8554-E5F51935FF38}.Release|x64.ActiveCfg = Release|Any CPU + {55887169-B044-47AA-8554-E5F51935FF38}.Release|x64.Build.0 = Release|Any CPU + {90D60969-E01C-4993-9DC4-794180FF49E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90D60969-E01C-4993-9DC4-794180FF49E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90D60969-E01C-4993-9DC4-794180FF49E5}.Debug|x64.ActiveCfg = Debug|Any CPU + {90D60969-E01C-4993-9DC4-794180FF49E5}.Debug|x64.Build.0 = Debug|Any CPU + {90D60969-E01C-4993-9DC4-794180FF49E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90D60969-E01C-4993-9DC4-794180FF49E5}.Release|Any CPU.Build.0 = Release|Any CPU + {90D60969-E01C-4993-9DC4-794180FF49E5}.Release|x64.ActiveCfg = Release|Any CPU + {90D60969-E01C-4993-9DC4-794180FF49E5}.Release|x64.Build.0 = Release|Any CPU + {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Debug|x64.ActiveCfg = Debug|Any CPU + {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Debug|x64.Build.0 = Debug|Any CPU + {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Release|Any CPU.Build.0 = Release|Any CPU + {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Release|x64.ActiveCfg = Release|Any CPU + {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Release|x64.Build.0 = Release|Any CPU + {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Debug|x64.ActiveCfg = Debug|Any CPU + {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Debug|x64.Build.0 = Debug|Any CPU + {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Release|Any CPU.Build.0 = Release|Any CPU + {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Release|x64.ActiveCfg = Release|Any CPU + {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Release|x64.Build.0 = Release|Any CPU + {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Debug|x64.ActiveCfg = Debug|Any CPU + {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Debug|x64.Build.0 = Debug|Any CPU + {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Release|Any CPU.Build.0 = Release|Any CPU + {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Release|x64.ActiveCfg = Release|Any CPU + {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Release|x64.Build.0 = Release|Any CPU + {19C7B778-345C-407B-BE72-67BF04784F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19C7B778-345C-407B-BE72-67BF04784F35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19C7B778-345C-407B-BE72-67BF04784F35}.Debug|x64.ActiveCfg = Debug|Any CPU + {19C7B778-345C-407B-BE72-67BF04784F35}.Debug|x64.Build.0 = Debug|Any CPU + {19C7B778-345C-407B-BE72-67BF04784F35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19C7B778-345C-407B-BE72-67BF04784F35}.Release|Any CPU.Build.0 = Release|Any CPU + {19C7B778-345C-407B-BE72-67BF04784F35}.Release|x64.ActiveCfg = Release|Any CPU + {19C7B778-345C-407B-BE72-67BF04784F35}.Release|x64.Build.0 = Release|Any CPU + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Debug|x64.ActiveCfg = Debug|Any CPU + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Debug|x64.Build.0 = Debug|Any CPU + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Release|Any CPU.Build.0 = Release|Any CPU + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Release|x64.ActiveCfg = Release|Any CPU + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Release|x64.Build.0 = Release|Any CPU + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Debug|x64.ActiveCfg = Debug|Any CPU + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Debug|x64.Build.0 = Debug|Any CPU + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Release|Any CPU.Build.0 = Release|Any CPU + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Release|x64.ActiveCfg = Release|Any CPU + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Release|x64.Build.0 = Release|Any CPU + {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Debug|x64.ActiveCfg = Debug|Any CPU + {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Debug|x64.Build.0 = Debug|Any CPU + {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Release|Any CPU.Build.0 = Release|Any CPU + {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Release|x64.ActiveCfg = Release|Any CPU + {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Release|x64.Build.0 = Release|Any CPU + {9B615187-D90E-4334-BBD8-5973A12442F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B615187-D90E-4334-BBD8-5973A12442F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B615187-D90E-4334-BBD8-5973A12442F9}.Debug|x64.ActiveCfg = Debug|Any CPU + {9B615187-D90E-4334-BBD8-5973A12442F9}.Debug|x64.Build.0 = Debug|Any CPU + {9B615187-D90E-4334-BBD8-5973A12442F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B615187-D90E-4334-BBD8-5973A12442F9}.Release|Any CPU.Build.0 = Release|Any CPU + {9B615187-D90E-4334-BBD8-5973A12442F9}.Release|x64.ActiveCfg = Release|Any CPU + {9B615187-D90E-4334-BBD8-5973A12442F9}.Release|x64.Build.0 = Release|Any CPU + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Debug|x64.ActiveCfg = Debug|Any CPU + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Debug|x64.Build.0 = Debug|Any CPU + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Release|Any CPU.Build.0 = Release|Any CPU + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Release|x64.ActiveCfg = Release|Any CPU + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Release|x64.Build.0 = Release|Any CPU + {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Debug|x64.ActiveCfg = Debug|Any CPU + {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Debug|x64.Build.0 = Debug|Any CPU + {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Release|Any CPU.Build.0 = Release|Any CPU + {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Release|x64.ActiveCfg = Release|Any CPU + {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Release|x64.Build.0 = Release|Any CPU + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Debug|x64.ActiveCfg = Debug|Any CPU + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Debug|x64.Build.0 = Debug|Any CPU + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Release|Any CPU.Build.0 = Release|Any CPU + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Release|x64.ActiveCfg = Release|Any CPU + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Release|x64.Build.0 = Release|Any CPU + {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Debug|x64.ActiveCfg = Debug|Any CPU + {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Debug|x64.Build.0 = Debug|Any CPU + {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Release|Any CPU.Build.0 = Release|Any CPU + {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Release|x64.ActiveCfg = Release|Any CPU + {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Release|x64.Build.0 = Release|Any CPU + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Debug|x64.ActiveCfg = Debug|Any CPU + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Debug|x64.Build.0 = Debug|Any CPU + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Release|Any CPU.Build.0 = Release|Any CPU + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Release|x64.ActiveCfg = Release|Any CPU + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Release|x64.Build.0 = Release|Any CPU + {524C5CA0-036E-480A-86E4-513232422F26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {524C5CA0-036E-480A-86E4-513232422F26}.Debug|Any CPU.Build.0 = Debug|Any CPU + {524C5CA0-036E-480A-86E4-513232422F26}.Debug|x64.ActiveCfg = Debug|Any CPU + {524C5CA0-036E-480A-86E4-513232422F26}.Debug|x64.Build.0 = Debug|Any CPU + {524C5CA0-036E-480A-86E4-513232422F26}.Release|Any CPU.ActiveCfg = Release|Any CPU + {524C5CA0-036E-480A-86E4-513232422F26}.Release|Any CPU.Build.0 = Release|Any CPU + {524C5CA0-036E-480A-86E4-513232422F26}.Release|x64.ActiveCfg = Release|Any CPU + {524C5CA0-036E-480A-86E4-513232422F26}.Release|x64.Build.0 = Release|Any CPU + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Debug|x64.ActiveCfg = Debug|Any CPU + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Debug|x64.Build.0 = Debug|Any CPU + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Release|Any CPU.Build.0 = Release|Any CPU + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Release|x64.ActiveCfg = Release|Any CPU + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Release|x64.Build.0 = Release|Any CPU + {217AB0A8-8750-4696-8E43-E11F82A191CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {217AB0A8-8750-4696-8E43-E11F82A191CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {217AB0A8-8750-4696-8E43-E11F82A191CB}.Debug|x64.ActiveCfg = Debug|Any CPU + {217AB0A8-8750-4696-8E43-E11F82A191CB}.Debug|x64.Build.0 = Debug|Any CPU + {217AB0A8-8750-4696-8E43-E11F82A191CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {217AB0A8-8750-4696-8E43-E11F82A191CB}.Release|Any CPU.Build.0 = Release|Any CPU + {217AB0A8-8750-4696-8E43-E11F82A191CB}.Release|x64.ActiveCfg = Release|Any CPU + {217AB0A8-8750-4696-8E43-E11F82A191CB}.Release|x64.Build.0 = Release|Any CPU + {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Debug|x64.ActiveCfg = Debug|Any CPU + {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Debug|x64.Build.0 = Debug|Any CPU + {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Release|Any CPU.Build.0 = Release|Any CPU + {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Release|x64.ActiveCfg = Release|Any CPU + {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Release|x64.Build.0 = Release|Any CPU + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Debug|x64.ActiveCfg = Debug|Any CPU + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Debug|x64.Build.0 = Debug|Any CPU + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Release|Any CPU.Build.0 = Release|Any CPU + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Release|x64.ActiveCfg = Release|Any CPU + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Release|x64.Build.0 = Release|Any CPU + {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Debug|x64.ActiveCfg = Debug|Any CPU + {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Debug|x64.Build.0 = Debug|Any CPU + {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Release|Any CPU.Build.0 = Release|Any CPU + {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Release|x64.ActiveCfg = Release|Any CPU + {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Release|x64.Build.0 = Release|Any CPU + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Debug|x64.ActiveCfg = Debug|Any CPU + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Debug|x64.Build.0 = Debug|Any CPU + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Release|Any CPU.Build.0 = Release|Any CPU + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Release|x64.ActiveCfg = Release|Any CPU + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Release|x64.Build.0 = Release|Any CPU + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Debug|x64.ActiveCfg = Debug|Any CPU + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Debug|x64.Build.0 = Debug|Any CPU + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Release|Any CPU.Build.0 = Release|Any CPU + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Release|x64.ActiveCfg = Release|Any CPU + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Release|x64.Build.0 = Release|Any CPU + {66DEC85C-7433-4902-B01A-8F98D1A87385}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66DEC85C-7433-4902-B01A-8F98D1A87385}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66DEC85C-7433-4902-B01A-8F98D1A87385}.Debug|x64.ActiveCfg = Debug|Any CPU + {66DEC85C-7433-4902-B01A-8F98D1A87385}.Debug|x64.Build.0 = Debug|Any CPU + {66DEC85C-7433-4902-B01A-8F98D1A87385}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66DEC85C-7433-4902-B01A-8F98D1A87385}.Release|Any CPU.Build.0 = Release|Any CPU + {66DEC85C-7433-4902-B01A-8F98D1A87385}.Release|x64.ActiveCfg = Release|Any CPU + {66DEC85C-7433-4902-B01A-8F98D1A87385}.Release|x64.Build.0 = Release|Any CPU + {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Debug|x64.ActiveCfg = Debug|Any CPU + {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Debug|x64.Build.0 = Debug|Any CPU + {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Release|Any CPU.Build.0 = Release|Any CPU + {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Release|x64.ActiveCfg = Release|Any CPU + {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Release|x64.Build.0 = Release|Any CPU + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Debug|x64.ActiveCfg = Debug|Any CPU + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Debug|x64.Build.0 = Debug|Any CPU + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Release|Any CPU.Build.0 = Release|Any CPU + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Release|x64.ActiveCfg = Release|Any CPU + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Release|x64.Build.0 = Release|Any CPU + {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Debug|x64.ActiveCfg = Debug|Any CPU + {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Debug|x64.Build.0 = Debug|Any CPU + {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Release|Any CPU.Build.0 = Release|Any CPU + {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Release|x64.ActiveCfg = Release|Any CPU + {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Release|x64.Build.0 = Release|Any CPU + {E7C80137-1D51-4215-BED7-C739BC663BE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7C80137-1D51-4215-BED7-C739BC663BE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7C80137-1D51-4215-BED7-C739BC663BE2}.Debug|x64.ActiveCfg = Debug|Any CPU + {E7C80137-1D51-4215-BED7-C739BC663BE2}.Debug|x64.Build.0 = Debug|Any CPU + {E7C80137-1D51-4215-BED7-C739BC663BE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E7C80137-1D51-4215-BED7-C739BC663BE2}.Release|Any CPU.Build.0 = Release|Any CPU + {E7C80137-1D51-4215-BED7-C739BC663BE2}.Release|x64.ActiveCfg = Release|Any CPU + {E7C80137-1D51-4215-BED7-C739BC663BE2}.Release|x64.Build.0 = Release|Any CPU + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Debug|x64.ActiveCfg = Debug|Any CPU + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Debug|x64.Build.0 = Debug|Any CPU + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Release|Any CPU.Build.0 = Release|Any CPU + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Release|x64.ActiveCfg = Release|Any CPU + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Release|x64.Build.0 = Release|Any CPU + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Debug|x64.ActiveCfg = Debug|Any CPU + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Debug|x64.Build.0 = Debug|Any CPU + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Release|Any CPU.Build.0 = Release|Any CPU + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Release|x64.ActiveCfg = Release|Any CPU + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Release|x64.Build.0 = Release|Any CPU + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Debug|x64.ActiveCfg = Debug|Any CPU + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Debug|x64.Build.0 = Debug|Any CPU + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Release|Any CPU.Build.0 = Release|Any CPU + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Release|x64.ActiveCfg = Release|Any CPU + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Release|x64.Build.0 = Release|Any CPU + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Debug|x64.ActiveCfg = Debug|Any CPU + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Debug|x64.Build.0 = Debug|Any CPU + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Release|Any CPU.Build.0 = Release|Any CPU + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Release|x64.ActiveCfg = Release|Any CPU + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Release|x64.Build.0 = Release|Any CPU + {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Debug|x64.ActiveCfg = Debug|Any CPU + {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Debug|x64.Build.0 = Debug|Any CPU + {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Release|Any CPU.Build.0 = Release|Any CPU + {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Release|x64.ActiveCfg = Release|Any CPU + {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Release|x64.Build.0 = Release|Any CPU + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Debug|x64.Build.0 = Debug|Any CPU + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Release|Any CPU.Build.0 = Release|Any CPU + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Release|x64.ActiveCfg = Release|Any CPU + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Release|x64.Build.0 = Release|Any CPU + {C517C235-8969-478B-941B-2E40897F4C71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C517C235-8969-478B-941B-2E40897F4C71}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C517C235-8969-478B-941B-2E40897F4C71}.Debug|x64.ActiveCfg = Debug|Any CPU + {C517C235-8969-478B-941B-2E40897F4C71}.Debug|x64.Build.0 = Debug|Any CPU + {C517C235-8969-478B-941B-2E40897F4C71}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C517C235-8969-478B-941B-2E40897F4C71}.Release|Any CPU.Build.0 = Release|Any CPU + {C517C235-8969-478B-941B-2E40897F4C71}.Release|x64.ActiveCfg = Release|Any CPU + {C517C235-8969-478B-941B-2E40897F4C71}.Release|x64.Build.0 = Release|Any CPU + {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Debug|x64.ActiveCfg = Debug|Any CPU + {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Debug|x64.Build.0 = Debug|Any CPU + {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Release|Any CPU.Build.0 = Release|Any CPU + {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Release|x64.ActiveCfg = Release|Any CPU + {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Release|x64.Build.0 = Release|Any CPU + {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|x64.ActiveCfg = Debug|Any CPU + {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|x64.Build.0 = Debug|Any CPU + {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Release|Any CPU.Build.0 = Release|Any CPU + {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Release|x64.ActiveCfg = Release|Any CPU + {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Release|x64.Build.0 = Release|Any CPU + {36629279-FD56-452B-88C2-5C8271500042}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36629279-FD56-452B-88C2-5C8271500042}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36629279-FD56-452B-88C2-5C8271500042}.Debug|x64.ActiveCfg = Debug|Any CPU + {36629279-FD56-452B-88C2-5C8271500042}.Debug|x64.Build.0 = Debug|Any CPU + {36629279-FD56-452B-88C2-5C8271500042}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36629279-FD56-452B-88C2-5C8271500042}.Release|Any CPU.Build.0 = Release|Any CPU + {36629279-FD56-452B-88C2-5C8271500042}.Release|x64.ActiveCfg = Release|Any CPU + {36629279-FD56-452B-88C2-5C8271500042}.Release|x64.Build.0 = Release|Any CPU + {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Debug|x64.ActiveCfg = Debug|Any CPU + {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Debug|x64.Build.0 = Debug|Any CPU + {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Release|Any CPU.Build.0 = Release|Any CPU + {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Release|x64.ActiveCfg = Release|Any CPU + {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Release|x64.Build.0 = Release|Any CPU + {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Debug|x64.ActiveCfg = Debug|Any CPU + {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Debug|x64.Build.0 = Debug|Any CPU + {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Release|Any CPU.Build.0 = Release|Any CPU + {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Release|x64.ActiveCfg = Release|Any CPU + {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Release|x64.Build.0 = Release|Any CPU + {91A658A2-3326-4730-B039-73709697938B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91A658A2-3326-4730-B039-73709697938B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91A658A2-3326-4730-B039-73709697938B}.Debug|x64.ActiveCfg = Debug|Any CPU + {91A658A2-3326-4730-B039-73709697938B}.Debug|x64.Build.0 = Debug|Any CPU + {91A658A2-3326-4730-B039-73709697938B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91A658A2-3326-4730-B039-73709697938B}.Release|Any CPU.Build.0 = Release|Any CPU + {91A658A2-3326-4730-B039-73709697938B}.Release|x64.ActiveCfg = Release|Any CPU + {91A658A2-3326-4730-B039-73709697938B}.Release|x64.Build.0 = Release|Any CPU + {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Debug|x64.ActiveCfg = Debug|Any CPU + {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Debug|x64.Build.0 = Debug|Any CPU + {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Release|Any CPU.Build.0 = Release|Any CPU + {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Release|x64.ActiveCfg = Release|Any CPU + {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Release|x64.Build.0 = Release|Any CPU + {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Debug|x64.ActiveCfg = Debug|Any CPU + {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Debug|x64.Build.0 = Debug|Any CPU + {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Release|Any CPU.Build.0 = Release|Any CPU + {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Release|x64.ActiveCfg = Release|Any CPU + {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Release|x64.Build.0 = Release|Any CPU + {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Debug|x64.ActiveCfg = Debug|Any CPU + {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Debug|x64.Build.0 = Debug|Any CPU + {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Release|Any CPU.Build.0 = Release|Any CPU + {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Release|x64.ActiveCfg = Release|Any CPU + {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Release|x64.Build.0 = Release|Any CPU + {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|x64.ActiveCfg = Debug|Any CPU + {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|x64.Build.0 = Debug|Any CPU + {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Release|Any CPU.Build.0 = Release|Any CPU + {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Release|x64.ActiveCfg = Release|Any CPU + {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Release|x64.Build.0 = Release|Any CPU + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Debug|x64.ActiveCfg = Debug|Any CPU + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Debug|x64.Build.0 = Debug|Any CPU + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Release|Any CPU.Build.0 = Release|Any CPU + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Release|x64.ActiveCfg = Release|Any CPU + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Release|x64.Build.0 = Release|Any CPU + {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Debug|x64.ActiveCfg = Debug|Any CPU + {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Debug|x64.Build.0 = Debug|Any CPU + {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Release|Any CPU.Build.0 = Release|Any CPU + {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Release|x64.ActiveCfg = Release|Any CPU + {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Release|x64.Build.0 = Release|Any CPU + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Debug|x64.ActiveCfg = Debug|Any CPU + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Debug|x64.Build.0 = Debug|Any CPU + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Release|Any CPU.Build.0 = Release|Any CPU + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Release|x64.ActiveCfg = Release|Any CPU + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Release|x64.Build.0 = Release|Any CPU + {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Debug|x64.ActiveCfg = Debug|Any CPU + {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Debug|x64.Build.0 = Debug|Any CPU + {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Release|Any CPU.Build.0 = Release|Any CPU + {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Release|x64.ActiveCfg = Release|Any CPU + {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Release|x64.Build.0 = Release|Any CPU + {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Debug|x64.ActiveCfg = Debug|Any CPU + {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Debug|x64.Build.0 = Debug|Any CPU + {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Release|Any CPU.Build.0 = Release|Any CPU + {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Release|x64.ActiveCfg = Release|Any CPU + {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Release|x64.Build.0 = Release|Any CPU + {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Debug|x64.ActiveCfg = Debug|Any CPU + {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Debug|x64.Build.0 = Debug|Any CPU + {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Release|Any CPU.Build.0 = Release|Any CPU + {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Release|x64.ActiveCfg = Release|Any CPU + {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Release|x64.Build.0 = Release|Any CPU + {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Debug|x64.ActiveCfg = Debug|Any CPU + {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Debug|x64.Build.0 = Debug|Any CPU + {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Release|Any CPU.Build.0 = Release|Any CPU + {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Release|x64.ActiveCfg = Release|Any CPU + {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Release|x64.Build.0 = Release|Any CPU + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Debug|x64.ActiveCfg = Debug|Any CPU + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Debug|x64.Build.0 = Debug|Any CPU + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Release|Any CPU.Build.0 = Release|Any CPU + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Release|x64.ActiveCfg = Release|Any CPU + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Release|x64.Build.0 = Release|Any CPU + {472122D3-114E-424D-AF47-B3D7E94057A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {472122D3-114E-424D-AF47-B3D7E94057A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {472122D3-114E-424D-AF47-B3D7E94057A8}.Debug|x64.ActiveCfg = Debug|Any CPU + {472122D3-114E-424D-AF47-B3D7E94057A8}.Debug|x64.Build.0 = Debug|Any CPU + {472122D3-114E-424D-AF47-B3D7E94057A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {472122D3-114E-424D-AF47-B3D7E94057A8}.Release|Any CPU.Build.0 = Release|Any CPU + {472122D3-114E-424D-AF47-B3D7E94057A8}.Release|x64.ActiveCfg = Release|Any CPU + {472122D3-114E-424D-AF47-B3D7E94057A8}.Release|x64.Build.0 = Release|Any CPU + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Debug|x64.ActiveCfg = Debug|Any CPU + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Debug|x64.Build.0 = Debug|Any CPU + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|Any CPU.Build.0 = Release|Any CPU + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|x64.ActiveCfg = Release|Any CPU + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|x64.Build.0 = Release|Any CPU + {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Debug|x64.ActiveCfg = Debug|Any CPU + {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Debug|x64.Build.0 = Debug|Any CPU + {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Release|Any CPU.Build.0 = Release|Any CPU + {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Release|x64.ActiveCfg = Release|Any CPU + {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Release|x64.Build.0 = Release|Any CPU + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|x64.ActiveCfg = Debug|Any CPU + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|x64.Build.0 = Debug|Any CPU + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Release|Any CPU.Build.0 = Release|Any CPU + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Release|x64.ActiveCfg = Release|Any CPU + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Release|x64.Build.0 = Release|Any CPU + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Debug|x64.ActiveCfg = Debug|Any CPU + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Debug|x64.Build.0 = Debug|Any CPU + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Release|Any CPU.Build.0 = Release|Any CPU + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Release|x64.ActiveCfg = Release|Any CPU + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Release|x64.Build.0 = Release|Any CPU + {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Debug|x64.ActiveCfg = Debug|Any CPU + {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Debug|x64.Build.0 = Debug|Any CPU + {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Release|Any CPU.Build.0 = Release|Any CPU + {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Release|x64.ActiveCfg = Release|Any CPU + {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Release|x64.Build.0 = Release|Any CPU + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Debug|x64.ActiveCfg = Debug|Any CPU + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Debug|x64.Build.0 = Debug|Any CPU + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Release|Any CPU.Build.0 = Release|Any CPU + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Release|x64.ActiveCfg = Release|Any CPU + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Release|x64.Build.0 = Release|Any CPU + {332D590C-11EC-481D-AC55-6279548F1CF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {332D590C-11EC-481D-AC55-6279548F1CF4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {332D590C-11EC-481D-AC55-6279548F1CF4}.Debug|x64.ActiveCfg = Debug|Any CPU + {332D590C-11EC-481D-AC55-6279548F1CF4}.Debug|x64.Build.0 = Debug|Any CPU + {332D590C-11EC-481D-AC55-6279548F1CF4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {332D590C-11EC-481D-AC55-6279548F1CF4}.Release|Any CPU.Build.0 = Release|Any CPU + {332D590C-11EC-481D-AC55-6279548F1CF4}.Release|x64.ActiveCfg = Release|Any CPU + {332D590C-11EC-481D-AC55-6279548F1CF4}.Release|x64.Build.0 = Release|Any CPU + {7BF99E7E-37EB-46D6-8808-2254430C3645}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7BF99E7E-37EB-46D6-8808-2254430C3645}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7BF99E7E-37EB-46D6-8808-2254430C3645}.Debug|x64.ActiveCfg = Debug|Any CPU + {7BF99E7E-37EB-46D6-8808-2254430C3645}.Debug|x64.Build.0 = Debug|Any CPU + {7BF99E7E-37EB-46D6-8808-2254430C3645}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7BF99E7E-37EB-46D6-8808-2254430C3645}.Release|Any CPU.Build.0 = Release|Any CPU + {7BF99E7E-37EB-46D6-8808-2254430C3645}.Release|x64.ActiveCfg = Release|Any CPU + {7BF99E7E-37EB-46D6-8808-2254430C3645}.Release|x64.Build.0 = Release|Any CPU + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Debug|x64.ActiveCfg = Debug|Any CPU + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Debug|x64.Build.0 = Debug|Any CPU + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|Any CPU.Build.0 = Release|Any CPU + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|x64.ActiveCfg = Release|Any CPU + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|x64.Build.0 = Release|Any CPU + {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Debug|x64.ActiveCfg = Debug|Any CPU + {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Debug|x64.Build.0 = Debug|Any CPU + {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Release|Any CPU.Build.0 = Release|Any CPU + {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Release|x64.ActiveCfg = Release|Any CPU + {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Release|x64.Build.0 = Release|Any CPU + {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|x64.ActiveCfg = Debug|Any CPU + {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|x64.Build.0 = Debug|Any CPU + {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Release|Any CPU.Build.0 = Release|Any CPU + {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Release|x64.ActiveCfg = Release|Any CPU + {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Release|x64.Build.0 = Release|Any CPU + {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Debug|x64.ActiveCfg = Debug|Any CPU + {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Debug|x64.Build.0 = Debug|Any CPU + {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Release|Any CPU.Build.0 = Release|Any CPU + {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Release|x64.ActiveCfg = Release|Any CPU + {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Release|x64.Build.0 = Release|Any CPU + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Debug|x64.ActiveCfg = Debug|Any CPU + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Debug|x64.Build.0 = Debug|Any CPU + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Release|Any CPU.Build.0 = Release|Any CPU + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Release|x64.ActiveCfg = Release|Any CPU + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Release|x64.Build.0 = Release|Any CPU + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Debug|x64.ActiveCfg = Debug|Any CPU + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Debug|x64.Build.0 = Debug|Any CPU + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Release|Any CPU.Build.0 = Release|Any CPU + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Release|x64.ActiveCfg = Release|Any CPU + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Release|x64.Build.0 = Release|Any CPU + {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Debug|x64.ActiveCfg = Debug|Any CPU + {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Debug|x64.Build.0 = Debug|Any CPU + {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Release|Any CPU.Build.0 = Release|Any CPU + {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Release|x64.ActiveCfg = Release|Any CPU + {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Release|x64.Build.0 = Release|Any CPU + {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Debug|x64.ActiveCfg = Debug|Any CPU + {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Debug|x64.Build.0 = Debug|Any CPU + {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Release|Any CPU.Build.0 = Release|Any CPU + {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Release|x64.ActiveCfg = Release|Any CPU + {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Release|x64.Build.0 = Release|Any CPU + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Debug|x64.ActiveCfg = Debug|Any CPU + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Debug|x64.Build.0 = Debug|Any CPU + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Release|Any CPU.Build.0 = Release|Any CPU + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Release|x64.ActiveCfg = Release|Any CPU + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Release|x64.Build.0 = Release|Any CPU + {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Debug|x64.ActiveCfg = Debug|Any CPU + {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Debug|x64.Build.0 = Debug|Any CPU + {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Release|Any CPU.Build.0 = Release|Any CPU + {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Release|x64.ActiveCfg = Release|Any CPU + {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Release|x64.Build.0 = Release|Any CPU + {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Debug|x64.ActiveCfg = Debug|Any CPU + {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Debug|x64.Build.0 = Debug|Any CPU + {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Release|Any CPU.Build.0 = Release|Any CPU + {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Release|x64.ActiveCfg = Release|Any CPU + {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Release|x64.Build.0 = Release|Any CPU + {CC9C8421-68D2-4645-B97E-512FAC691703}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC9C8421-68D2-4645-B97E-512FAC691703}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC9C8421-68D2-4645-B97E-512FAC691703}.Debug|x64.ActiveCfg = Debug|Any CPU + {CC9C8421-68D2-4645-B97E-512FAC691703}.Debug|x64.Build.0 = Debug|Any CPU + {CC9C8421-68D2-4645-B97E-512FAC691703}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC9C8421-68D2-4645-B97E-512FAC691703}.Release|Any CPU.Build.0 = Release|Any CPU + {CC9C8421-68D2-4645-B97E-512FAC691703}.Release|x64.ActiveCfg = Release|Any CPU + {CC9C8421-68D2-4645-B97E-512FAC691703}.Release|x64.Build.0 = Release|Any CPU + {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Debug|x64.ActiveCfg = Debug|Any CPU + {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Debug|x64.Build.0 = Debug|Any CPU + {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Release|Any CPU.Build.0 = Release|Any CPU + {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Release|x64.ActiveCfg = Release|Any CPU + {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Release|x64.Build.0 = Release|Any CPU + {CB1F1533-E430-47C5-AD52-04922CC959A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CB1F1533-E430-47C5-AD52-04922CC959A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CB1F1533-E430-47C5-AD52-04922CC959A5}.Debug|x64.ActiveCfg = Debug|Any CPU + {CB1F1533-E430-47C5-AD52-04922CC959A5}.Debug|x64.Build.0 = Debug|Any CPU + {CB1F1533-E430-47C5-AD52-04922CC959A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CB1F1533-E430-47C5-AD52-04922CC959A5}.Release|Any CPU.Build.0 = Release|Any CPU + {CB1F1533-E430-47C5-AD52-04922CC959A5}.Release|x64.ActiveCfg = Release|Any CPU + {CB1F1533-E430-47C5-AD52-04922CC959A5}.Release|x64.Build.0 = Release|Any CPU + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Debug|x64.ActiveCfg = Debug|Any CPU + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Debug|x64.Build.0 = Debug|Any CPU + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Release|Any CPU.Build.0 = Release|Any CPU + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Release|x64.ActiveCfg = Release|Any CPU + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Release|x64.Build.0 = Release|Any CPU + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Debug|x64.ActiveCfg = Debug|Any CPU + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Debug|x64.Build.0 = Debug|Any CPU + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Release|Any CPU.Build.0 = Release|Any CPU + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Release|x64.ActiveCfg = Release|Any CPU + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Release|x64.Build.0 = Release|Any CPU + {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Debug|x64.ActiveCfg = Debug|Any CPU + {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Debug|x64.Build.0 = Debug|Any CPU + {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Release|Any CPU.Build.0 = Release|Any CPU + {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Release|x64.ActiveCfg = Release|Any CPU + {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Release|x64.Build.0 = Release|Any CPU + {1787BF8C-3C05-4E07-8868-E839544F9522}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1787BF8C-3C05-4E07-8868-E839544F9522}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1787BF8C-3C05-4E07-8868-E839544F9522}.Debug|x64.ActiveCfg = Debug|Any CPU + {1787BF8C-3C05-4E07-8868-E839544F9522}.Debug|x64.Build.0 = Debug|Any CPU + {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|Any CPU.Build.0 = Release|Any CPU + {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|x64.ActiveCfg = Release|Any CPU + {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|x64.Build.0 = Release|Any CPU + {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Debug|x64.ActiveCfg = Debug|Any CPU + {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Debug|x64.Build.0 = Debug|Any CPU + {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Release|Any CPU.Build.0 = Release|Any CPU + {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Release|x64.ActiveCfg = Release|Any CPU + {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Release|x64.Build.0 = Release|Any CPU + {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|x64.ActiveCfg = Debug|Any CPU + {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|x64.Build.0 = Debug|Any CPU + {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Release|Any CPU.Build.0 = Release|Any CPU + {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Release|x64.ActiveCfg = Release|Any CPU + {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Release|x64.Build.0 = Release|Any CPU + {0D9CDEA2-0DC6-490A-9145-782259B63739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0D9CDEA2-0DC6-490A-9145-782259B63739}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D9CDEA2-0DC6-490A-9145-782259B63739}.Debug|x64.ActiveCfg = Debug|Any CPU + {0D9CDEA2-0DC6-490A-9145-782259B63739}.Debug|x64.Build.0 = Debug|Any CPU + {0D9CDEA2-0DC6-490A-9145-782259B63739}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0D9CDEA2-0DC6-490A-9145-782259B63739}.Release|Any CPU.Build.0 = Release|Any CPU + {0D9CDEA2-0DC6-490A-9145-782259B63739}.Release|x64.ActiveCfg = Release|Any CPU + {0D9CDEA2-0DC6-490A-9145-782259B63739}.Release|x64.Build.0 = Release|Any CPU + {80512601-4B59-4A1B-984F-8E81E3242F97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80512601-4B59-4A1B-984F-8E81E3242F97}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80512601-4B59-4A1B-984F-8E81E3242F97}.Debug|x64.ActiveCfg = Debug|Any CPU + {80512601-4B59-4A1B-984F-8E81E3242F97}.Debug|x64.Build.0 = Debug|Any CPU + {80512601-4B59-4A1B-984F-8E81E3242F97}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80512601-4B59-4A1B-984F-8E81E3242F97}.Release|Any CPU.Build.0 = Release|Any CPU + {80512601-4B59-4A1B-984F-8E81E3242F97}.Release|x64.ActiveCfg = Release|Any CPU + {80512601-4B59-4A1B-984F-8E81E3242F97}.Release|x64.Build.0 = Release|Any CPU + {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Debug|x64.ActiveCfg = Debug|Any CPU + {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Debug|x64.Build.0 = Debug|Any CPU + {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Release|Any CPU.Build.0 = Release|Any CPU + {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Release|x64.ActiveCfg = Release|Any CPU + {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Release|x64.Build.0 = Release|Any CPU + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Debug|x64.ActiveCfg = Debug|Any CPU + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Debug|x64.Build.0 = Debug|Any CPU + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Release|Any CPU.Build.0 = Release|Any CPU + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Release|x64.ActiveCfg = Release|Any CPU + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Release|x64.Build.0 = Release|Any CPU + {76117457-EC1B-4844-825A-20A760B42C44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76117457-EC1B-4844-825A-20A760B42C44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76117457-EC1B-4844-825A-20A760B42C44}.Debug|x64.ActiveCfg = Debug|Any CPU + {76117457-EC1B-4844-825A-20A760B42C44}.Debug|x64.Build.0 = Debug|Any CPU + {76117457-EC1B-4844-825A-20A760B42C44}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76117457-EC1B-4844-825A-20A760B42C44}.Release|Any CPU.Build.0 = Release|Any CPU + {76117457-EC1B-4844-825A-20A760B42C44}.Release|x64.ActiveCfg = Release|Any CPU + {76117457-EC1B-4844-825A-20A760B42C44}.Release|x64.Build.0 = Release|Any CPU + {89EE0C4D-6C29-472E-9109-84327DB489A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89EE0C4D-6C29-472E-9109-84327DB489A1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89EE0C4D-6C29-472E-9109-84327DB489A1}.Debug|x64.ActiveCfg = Debug|Any CPU + {89EE0C4D-6C29-472E-9109-84327DB489A1}.Debug|x64.Build.0 = Debug|Any CPU + {89EE0C4D-6C29-472E-9109-84327DB489A1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89EE0C4D-6C29-472E-9109-84327DB489A1}.Release|Any CPU.Build.0 = Release|Any CPU + {89EE0C4D-6C29-472E-9109-84327DB489A1}.Release|x64.ActiveCfg = Release|Any CPU + {89EE0C4D-6C29-472E-9109-84327DB489A1}.Release|x64.Build.0 = Release|Any CPU + {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Debug|x64.ActiveCfg = Debug|Any CPU + {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Debug|x64.Build.0 = Debug|Any CPU + {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|Any CPU.Build.0 = Release|Any CPU + {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|x64.ActiveCfg = Release|Any CPU + {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|x64.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} + {374B7E56-A815-4F56-A4C2-6094B5A97EE7} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} + {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B} = {08649D7D-EF5A-4626-9959-935CA85DF770} + {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A} = {08649D7D-EF5A-4626-9959-935CA85DF770} + {2971858E-2CCA-4688-B8CA-84F130AD5AA9} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} + {2503F67B-63BB-4364-8B31-1DD3049C92B7} = {FE0F37B3-7727-4A08-AEA1-437F53982658} + {88BC8170-9123-48C0-A914-11D3CE805196} = {FE0F37B3-7727-4A08-AEA1-437F53982658} + {316B1D0A-9CF7-4E5C-A39A-8A389B075A19} = {4B812744-1CB5-4760-9719-2220EACC566C} + {2F4986D6-3F56-4C05-8A1D-399594F96093} = {232840A6-183C-4D3A-A086-582FD449D300} + {E72E105D-B15F-4D69-9A13-CAA49D4889D6} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} + {B689E82B-B3E8-4C83-B56C-D4C27206AAC6} = {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} + {74283F68-6B38-4CF4-B0CB-AAD65618ADB8} = {46C33E74-835B-4CB4-861D-42A781A2502C} + {AB6FAB84-5218-48A8-8F94-03B02ECD098F} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {5A3338F1-9963-4CAC-85A3-7AB263CB15B0} = {08649D7D-EF5A-4626-9959-935CA85DF770} + {C3451307-3743-4911-A401-7F28889703D3} = {08649D7D-EF5A-4626-9959-935CA85DF770} + {736F69E9-89D0-47E2-99AF-9412AAE1C6BB} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} + {4B818EE6-8E13-40DA-B99A-218BB228EE91} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {30DC35DF-9D86-443C-B26C-9053E6FCA434} = {08649D7D-EF5A-4626-9959-935CA85DF770} + {4B94CAF6-134D-4F89-8F2D-72A4FB363B59} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} + {54936F20-EEFC-405B-8646-76F200A5C8F7} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} + {546EE1A2-DB6B-49D3-8919-33624FEF2498} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} + {B603B92A-1203-4E28-9D15-2AF1CE4E9510} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} + {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B} = {7064C470-7D0B-4CE2-A80C-BEE376DDC956} + {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {981E883E-CCDC-400B-8FB1-76E1E65C32AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {0D34A7F0-DC77-4789-A136-93089CBD15C3} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {DA816A33-F164-4456-92DD-A672BAD1A6B1} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {C265268A-F311-4B6A-915E-C1AF9D1EB624} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {ABF6E41A-CBF9-49DE-87FC-9D88F440A104} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} + {5944A182-13B8-4DA6-AEE2-0A01E64A9648} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} + {88740F49-00A1-40F8-B141-78EFA7CE2B4D} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {801BB9FA-307C-4A93-A116-16BAEC637C1E} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {1F8E0520-6670-4561-B92B-37B725CBE243} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {B228589B-4106-4CF8-B165-26636B94BE2C} = {1F8E0520-6670-4561-B92B-37B725CBE243} + {355663A0-EF0B-4C26-92A4-1589A7FFC9E6} = {1F8E0520-6670-4561-B92B-37B725CBE243} + {D0BE0F45-2C77-45AB-B861-EBEE34C187B2} = {1F8E0520-6670-4561-B92B-37B725CBE243} + {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {08649D7D-EF5A-4626-9959-935CA85DF770} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {8663AD83-4E2C-47EF-BF28-1427E82F1A36} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {FE0F37B3-7727-4A08-AEA1-437F53982658} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {4B812744-1CB5-4760-9719-2220EACC566C} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {322F0F91-E181-4139-87DE-974CCF2339BA} = {4B812744-1CB5-4760-9719-2220EACC566C} + {232840A6-183C-4D3A-A086-582FD449D300} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {7064C470-7D0B-4CE2-A80C-BEE376DDC956} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {E8CE3469-6E0F-495C-937E-D9820DE3DA89} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {46C33E74-835B-4CB4-861D-42A781A2502C} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} + {02B35A90-23DF-4341-89CF-E911ED210FBE} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {F262689D-5BE8-45E9-B090-0CFF81315FB9} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {46C86695-A597-47F3-944E-03C63CA678F4} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {DBD1137D-0208-4CF4-BB45-36FE023B4FED} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {A93D1699-A8B1-432E-8929-5800F4FE5AA7} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {049430DA-664C-4C77-A679-0CF12217ABB2} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} + {64B72C9E-85BD-4C41-B67D-892157600F5B} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} + {354D1855-EE83-41EF-BFFC-1348F77A66DB} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} + {A88B4DB8-2441-488D-B097-68F02F18DECC} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} + {3B5C4669-07C6-49F0-BC69-70A8980FC605} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} + {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} + {81618F3D-ED3C-44C5-9BAD-8F04CF601D42} = {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} + {F6E5B615-A85D-4FB4-97D0-698098D7616F} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} + {7A628B6A-AFE4-4235-95AA-9A711268B9B1} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} + {E417DAE3-A1D2-430D-A6C7-C8BDE083D851} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} + {9A6A3012-6A11-415B-BC58-E2268BE7022E} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} + {7A8F1593-C00F-4D90-9029-11BF75B3C926} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {0F43C687-59EF-4164-B3A5-E53C3BF86892} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {BE11C98A-5680-491E-86E9-93B0A83909EA} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {E2B9737D-9630-4705-B2DF-21C2EB607F65} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} + {8C154ACF-ED6E-43C4-906E-2D36CBC8D112} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} + {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} + {CC117C03-267A-4145-B258-922C35484883} = {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} + {1AD1F4E7-84DA-4CE8-BC69-7D713413560D} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {9DEA348B-8915-4BAA-AE04-99BF5FC6131B} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {E85FA5C9-C7D9-4461-99DE-11675749E38E} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {FB66887D-E08C-4551-B838-EAF49C1D1EE7} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {E8282BC0-5F46-4A96-80A6-1326F97E16C4} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {4428D240-7BF5-46BF-9FB7-EF531FA5C088} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {675D2886-B4E9-4B14-A02D-44B5204EE2E0} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {2A57A40F-92F5-4ACE-95AA-763915578282} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {B44F4054-5B66-4937-A99D-216DEFBAD0EF} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {072E41B5-B2BF-4493-9D26-15D4BB490318} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {A4F3852E-DC6B-43A8-A40A-899089546444} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} + {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} + {53543535-E81D-4B28-8EB0-89E9A8FDD496} = {E3F32658-290D-4A85-A123-11FF6169774D} + {E3F32658-290D-4A85-A123-11FF6169774D} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {19999563-8BBA-48A3-A087-EDEC1185E5C8} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} + {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} = {E3F32658-290D-4A85-A123-11FF6169774D} + {89B2A360-4806-41B2-9CE1-F2E556BB222D} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} + {45B8C34E-A62D-4809-BA0F-6046AFAB2851} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} + {C72508E7-CEF3-4E36-BF39-F3908EE338B7} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {65605EB9-FA98-42CE-8F40-117D89D59786} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} = {E3F32658-290D-4A85-A123-11FF6169774D} + {4F26D6F5-32FA-4EE6-8588-A325734E4386} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} + {0C5262F4-DC7E-493F-AB87-A72063ABCA00} = {E3F32658-290D-4A85-A123-11FF6169774D} + {FE906D46-B113-4600-AC2C-7523937B96AB} = {0C5262F4-DC7E-493F-AB87-A72063ABCA00} + {6FF949B6-F1C6-4056-B9DA-CC6120D427FC} = {FE906D46-B113-4600-AC2C-7523937B96AB} + {920E6762-32FE-4BEC-AD0C-6F28119C6804} = {E3F32658-290D-4A85-A123-11FF6169774D} + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {672C436B-ECE4-4722-8B7D-4EF1E45194B0} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} = {E3F32658-290D-4A85-A123-11FF6169774D} + {5D9F3039-D6FE-4F2E-9752-486ADF970093} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {E99EB5EE-6C3A-4878-9407-BB4060F5E200} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {7A4F49AC-A597-4D41-B380-675787D00CCD} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {39F57444-3DB4-458D-9CEB-6484069BD7E0} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {55887169-B044-47AA-8554-E5F51935FF38} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {90D60969-E01C-4993-9DC4-794180FF49E5} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {12E3C29F-AE3A-4BC9-A7CE-904269223C3B} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {430DC17D-B161-48D6-B4CE-17913C1AABBE} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {A9D8D7E4-591D-479B-B0A5-07F30F831199} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {14D3C601-C29B-48D2-8312-556319D04619} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {19C7B778-345C-407B-BE72-67BF04784F35} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {7DC7F500-F004-4DAC-9F16-D6878B3808E1} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {9B615187-D90E-4334-BBD8-5973A12442F9} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {8E00F570-6926-4304-BAE0-C9E7FA9A4213} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {A69815D7-1C4F-4484-8E0B-7E6765203AC0} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {524C5CA0-036E-480A-86E4-513232422F26} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {217AB0A8-8750-4696-8E43-E11F82A191CB} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {C92637A7-77FC-4995-8024-B28F6C58AEA8} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {2BDF6D68-91FF-4220-8D78-90AA024275C3} = {14D3C601-C29B-48D2-8312-556319D04619} + {542D8266-668F-49FA-BFE1-814AB96720DD} = {E3F32658-290D-4A85-A123-11FF6169774D} + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8} = {542D8266-668F-49FA-BFE1-814AB96720DD} + {83AA938C-9182-4E65-A42A-79CAE68888E9} = {E3F32658-290D-4A85-A123-11FF6169774D} + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592} = {83AA938C-9182-4E65-A42A-79CAE68888E9} + {66DEC85C-7433-4902-B01A-8F98D1A87385} = {83AA938C-9182-4E65-A42A-79CAE68888E9} + {8BE42490-F83D-48D7-8C5D-1665AC84229C} = {83AA938C-9182-4E65-A42A-79CAE68888E9} + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11} = {83AA938C-9182-4E65-A42A-79CAE68888E9} + {BA74E50F-C553-40D6-8578-BCB4A3F5E585} = {E3F32658-290D-4A85-A123-11FF6169774D} + {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} = {E3F32658-290D-4A85-A123-11FF6169774D} + {2DEE608F-965F-4298-9B71-D7B32CBA66BD} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} + {E7C80137-1D51-4215-BED7-C739BC663BE2} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} + {DC9F9523-A2F9-47AA-B6D9-40AC14797548} = {E3F32658-290D-4A85-A123-11FF6169774D} + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} + {5A42D577-38AA-4A5B-866A-01FE1339F2AB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} + {89639A47-CA9E-46C6-8CFB-CFB4FC18785E} = {16FABF17-EC86-4B86-9130-19D8635219C0} + {3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997} = {16FABF17-EC86-4B86-9130-19D8635219C0} + {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} + {C517C235-8969-478B-941B-2E40897F4C71} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} + {E7F0C1EC-A954-4325-8AA4-91148F334BEA} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} + {41817AD2-D1DA-4698-B87D-910524CE4B7A} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} + {36629279-FD56-452B-88C2-5C8271500042} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} + {8F668369-606C-4EC5-B0F5-8095D2720642} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {CE986B6E-7B18-4E1C-AB35-7993193A56C0} = {8F668369-606C-4EC5-B0F5-8095D2720642} + {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD} = {8F668369-606C-4EC5-B0F5-8095D2720642} + {91A658A2-3326-4730-B039-73709697938B} = {8F668369-606C-4EC5-B0F5-8095D2720642} + {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3} = {8F668369-606C-4EC5-B0F5-8095D2720642} + {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E} = {8F668369-606C-4EC5-B0F5-8095D2720642} + {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {850FF743-77FF-49CB-BE4A-C4F561E1FDCA} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {40D7AED3-982D-440B-BCD5-C1EFFC59514D} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {A1D7408C-AB95-4CFF-89F8-24797A865DBF} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {8680EA03-13A7-4F4A-A579-EB2CB6411C21} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {4CE930E3-12E4-4BFA-962E-3477B7AB6930} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {8903DCD8-A68D-4164-83EE-DE07385DDDD6} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {E2E68FF1-9CB5-424F-9D91-130A48462E54} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {472122D3-114E-424D-AF47-B3D7E94057A8} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {AE626BF6-3202-46B2-BB1A-0E71ED462C84} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} + {985B71A9-DF28-4B70-9DA5-1D60B82E8551} = {E3F32658-290D-4A85-A123-11FF6169774D} + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {F9C27912-F7EC-47B6-A385-064BD4B92EDA} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {332D590C-11EC-481D-AC55-6279548F1CF4} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {7BF99E7E-37EB-46D6-8808-2254430C3645} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} + {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} + {37138DEF-EEE4-4363-A307-0027B4C6ACD8} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} + {A93F1887-0011-466C-8EB8-3A338AEA5A4B} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} + {965C3DBE-2DF3-4BCF-A7BB-C26BEB2F8CCA} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {58344864-F2A8-4C95-AB75-B5150C3A383A} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {CC7ED747-8BCE-4B49-8855-AE4697792A81} = {58344864-F2A8-4C95-AB75-B5150C3A383A} + {605A3653-C7E3-4EC2-8749-979E4A0227D0} = {58344864-F2A8-4C95-AB75-B5150C3A383A} + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC} = {58344864-F2A8-4C95-AB75-B5150C3A383A} + {50C13F5E-BA3A-4B04-A730-BAA584E051AB} = {58344864-F2A8-4C95-AB75-B5150C3A383A} + {C8AD2261-D325-414D-9B2D-B2A9D27C242F} = {58344864-F2A8-4C95-AB75-B5150C3A383A} + {CC9C8421-68D2-4645-B97E-512FAC691703} = {965C3DBE-2DF3-4BCF-A7BB-C26BEB2F8CCA} + {16FABF17-EC86-4B86-9130-19D8635219C0} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {1551B2ED-9931-4A03-8853-1C3E5504C43D} = {89639A47-CA9E-46C6-8CFB-CFB4FC18785E} + {CB1F1533-E430-47C5-AD52-04922CC959A5} = {89639A47-CA9E-46C6-8CFB-CFB4FC18785E} + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574} = {16FABF17-EC86-4B86-9130-19D8635219C0} + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9} = {16FABF17-EC86-4B86-9130-19D8635219C0} + {D05ADEA6-2267-4DC1-901A-BD18B697E889} = {16FABF17-EC86-4B86-9130-19D8635219C0} + {1787BF8C-3C05-4E07-8868-E839544F9522} = {3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997} + {F2766BE2-8387-49E6-B17D-5B7DA791DC75} = {3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997} + {F673CF31-D8CF-4F3E-B294-0802589F5BF2} = {3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997} + {9FBFDCBB-DB43-4259-B67C-693394134F09} = {16FABF17-EC86-4B86-9130-19D8635219C0} + {0D9CDEA2-0DC6-490A-9145-782259B63739} = {9FBFDCBB-DB43-4259-B67C-693394134F09} + {B0982BE8-DE6E-4763-8AA0-77C426DCE199} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {80512601-4B59-4A1B-984F-8E81E3242F97} = {B0982BE8-DE6E-4763-8AA0-77C426DCE199} + {96C2CD33-8A8C-4206-9C73-97E8D748F397} = {8B778866-D908-456F-943A-1172B52360AD} + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31} = {8B778866-D908-456F-943A-1172B52360AD} + {8B778866-D908-456F-943A-1172B52360AD} = {B0982BE8-DE6E-4763-8AA0-77C426DCE199} + {B7B1D4FB-8113-4B29-92DB-3BC3960BB9A5} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {76117457-EC1B-4844-825A-20A760B42C44} = {B7B1D4FB-8113-4B29-92DB-3BC3960BB9A5} + {92F310E1-6CD0-4066-9703-B81B4AC07819} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {89EE0C4D-6C29-472E-9109-84327DB489A1} = {92F310E1-6CD0-4066-9703-B81B4AC07819} + {AF35D4CC-EBE2-4F2B-8622-7A93A8CF9EF8} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} + {F45CBF27-1D45-404C-9B09-5CC781AF5942} = {AF35D4CC-EBE2-4F2B-8622-7A93A8CF9EF8} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} + EndGlobalSection +EndGlobal diff --git a/src/BuildingBlocks/Directory.Build.props b/src/BuildingBlocks/Directory.Build.props new file mode 100644 index 000000000..628190679 --- /dev/null +++ b/src/BuildingBlocks/Directory.Build.props @@ -0,0 +1,20 @@ + + + 6.0.0 + 2.2.3 + 16.9.4 + 3.0.2 + 3.19.1 + + $(AssemblyName) + packageIcon.png + masastack + © masastack Corporation. All rights reserved. + packageIcon.png + https://github.com/masastack/Masa.BuildingBlocks + git + true + $(MSBuildThisFileDirectory) + LICENSE.txt + + diff --git a/src/BuildingBlocks/MASA.BuildingBlocks b/src/BuildingBlocks/MASA.BuildingBlocks deleted file mode 160000 index d293c4dd6..000000000 --- a/src/BuildingBlocks/MASA.BuildingBlocks +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d293c4dd6b26948c052def9c5401a196c735c027 diff --git a/src/BuildingBlocks/Masa.BuildingBlocks.sln b/src/BuildingBlocks/Masa.BuildingBlocks.sln new file mode 100644 index 000000000..0f687ff5c --- /dev/null +++ b/src/BuildingBlocks/Masa.BuildingBlocks.sln @@ -0,0 +1,285 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31521.260 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{FBD326D3-E59C-433E-A88E-14E179E3093D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "I18n", "I18n", "{EA2668AF-28E3-42C5-9FA5-8C9FF377180E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{022D6FF5-4B65-4213-9A97-C69E2B2F99E1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Observability", "Observability", "{75050CBC-A0F2-408A-A582-54EF37450B29}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{509BDB5A-5D32-478F-BF27-F0470C18C7C9}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{8C39C640-0E8A-43A7-890C-9742B6B70AA4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{593A3114-D1E0-47ED-BC37-58E08886175B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testable", "Testable", "{57AD498B-D9AF-4479-8C14-45507F6509F5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{9CB643CA-AA09-46E7-8CB9-E1D55E84B32B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{64FB8703-E922-45DE-9D01-3FE9EFE56727}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{77D17E30-CB7C-4DD7-8CF1-9D5350FF2304}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6ED365E6-4A1A-499F-85FB-F22E865CA4BA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "design", "design", "{43157B67-5CDB-4D28-9095-9586C685CA6B}" + ProjectSection(SolutionItems) = preProject + design\CodeMap.dgml = design\CodeMap.dgml + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{884D1A0A-A24F-4ED9-BBFE-DCC4E47CF26D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.MinimalAPIs", "src\Service\Masa.BuildingBlocks.Service.MinimalAPIs\Masa.BuildingBlocks.Service.MinimalAPIs.csproj", "{F128E74B-CEC4-4915-AEE2-FF69E60D17F0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete", "src\SearchEngine\Masa.BuildingBlocks.SearchEngine.AutoComplete\Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj", "{9782B9B5-22D0-432A-9BC5-D830C9478D38}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing", "src\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj", "{6175D1D5-8007-4951-BF12-0064B8201C35}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.Events", "src\Dispatcher\Masa.BuildingBlocks.Dispatcher.Events\Masa.BuildingBlocks.Dispatcher.Events.csproj", "{EECA2E9C-36B4-4DCE-93F7-487955B6260E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.IntegrationEvents", "src\Dispatcher\Masa.BuildingBlocks.Dispatcher.IntegrationEvents\Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj", "{4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Contracts", "src\Data\Masa.BuildingBlocks.Data.Contracts\Masa.BuildingBlocks.Data.Contracts.csproj", "{B735824E-D918-4140-AE94-CA4172BF59EB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.UoW", "src\Data\Masa.BuildingBlocks.Data.UoW\Masa.BuildingBlocks.Data.UoW.csproj", "{41F94385-3EAC-4617-8C2B-74D606B0A6A6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration", "src\Configuration\Masa.BuildingBlocks.Configuration\Masa.BuildingBlocks.Configuration.csproj", "{E86483C1-1479-453A-8ABC-35DAC95AC056}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain", "src\Ddd\Masa.BuildingBlocks.Ddd.Domain\Masa.BuildingBlocks.Ddd.Domain.csproj", "{7B99E2A1-95AE-4C98-8C06-A5CE43969512}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.Cqrs", "src\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj", "{10CC5E31-EE6C-440B-A71F-9E3C8608410D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration.Tests", "test\Masa.BuildingBlocks.Configuration.Tests\Masa.BuildingBlocks.Configuration.Tests.csproj", "{F48B8455-B7A2-402C-8F88-16733A825EAF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Pm", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Pm\Masa.BuildingBlocks.BasicAbility.Pm.csproj", "{5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolation", "src\Isolation\Masa.BuildingBlocks.Isolation\Masa.BuildingBlocks.Isolation.csproj", "{5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{4CC735F3-DB32-4D9D-863D-BB6E1BA362B9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Storage.ObjectStorage", "src\Storage\Masa.BuildingBlocks.Storage.ObjectStorage\Masa.BuildingBlocks.Storage.ObjectStorage.csproj", "{D52E223F-F406-47A7-BF3E-924DC2D74981}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{F8681808-45F3-4C2D-8A37-D24C0A3414A5}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Mapping", "src\Data\Masa.BuildingBlocks.Data.Mapping\Masa.BuildingBlocks.Data.Mapping.csproj", "{EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data", "src\Data\Masa.BuildingBlocks.Data\Masa.BuildingBlocks.Data.csproj", "{4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Contracts", "src\Service\Masa.BuildingBlocks.Service.Contracts\Masa.BuildingBlocks.Service.Contracts.csproj", "{775797E2-8576-4050-8649-18AAD00D0A87}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.MappingExtensions", "src\Data\Masa.BuildingBlocks.Data.MappingExtensions\Masa.BuildingBlocks.Data.MappingExtensions.csproj", "{42D62996-F3FA-406F-AECD-BEACE557E0DB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{7078E83D-778C-4CE0-829F-7F0AD969361E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Cache", "src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Cache\Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj", "{CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{639F5AB4-3648-4AFE-95E3-5909C054E39C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{701DF095-CF25-4311-9129-279A1834D8A3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Scheduler", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Scheduler\Masa.BuildingBlocks.BasicAbility.Scheduler.csproj", "{E9B586D1-CCEF-450E-9E29-E102B141C32F}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth.Contracts", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth.Contracts\Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj", "{A006D835-D5A1-440E-A55A-58BE27794515}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth\Masa.BuildingBlocks.BasicAbility.Auth.csproj", "{8EE885E8-7D15-4810-9E1B-871089319080}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Dcc", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Dcc\Masa.BuildingBlocks.BasicAbility.Dcc.csproj", "{BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.Service.Caller", "src\Service\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{C4BF6451-134A-4113-8B13-5F8CE95E1B72}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{C79B289A-DCFA-4763-BF44-55ED03E7E5BA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\Identity\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{F9178604-E581-4C7B-B5F2-936231ED2CC1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F128E74B-CEC4-4915-AEE2-FF69E60D17F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F128E74B-CEC4-4915-AEE2-FF69E60D17F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F128E74B-CEC4-4915-AEE2-FF69E60D17F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F128E74B-CEC4-4915-AEE2-FF69E60D17F0}.Release|Any CPU.Build.0 = Release|Any CPU + {9782B9B5-22D0-432A-9BC5-D830C9478D38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9782B9B5-22D0-432A-9BC5-D830C9478D38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9782B9B5-22D0-432A-9BC5-D830C9478D38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9782B9B5-22D0-432A-9BC5-D830C9478D38}.Release|Any CPU.Build.0 = Release|Any CPU + {6175D1D5-8007-4951-BF12-0064B8201C35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6175D1D5-8007-4951-BF12-0064B8201C35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6175D1D5-8007-4951-BF12-0064B8201C35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6175D1D5-8007-4951-BF12-0064B8201C35}.Release|Any CPU.Build.0 = Release|Any CPU + {EECA2E9C-36B4-4DCE-93F7-487955B6260E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EECA2E9C-36B4-4DCE-93F7-487955B6260E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EECA2E9C-36B4-4DCE-93F7-487955B6260E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EECA2E9C-36B4-4DCE-93F7-487955B6260E}.Release|Any CPU.Build.0 = Release|Any CPU + {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}.Release|Any CPU.Build.0 = Release|Any CPU + {B735824E-D918-4140-AE94-CA4172BF59EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B735824E-D918-4140-AE94-CA4172BF59EB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B735824E-D918-4140-AE94-CA4172BF59EB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B735824E-D918-4140-AE94-CA4172BF59EB}.Release|Any CPU.Build.0 = Release|Any CPU + {41F94385-3EAC-4617-8C2B-74D606B0A6A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {41F94385-3EAC-4617-8C2B-74D606B0A6A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41F94385-3EAC-4617-8C2B-74D606B0A6A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {41F94385-3EAC-4617-8C2B-74D606B0A6A6}.Release|Any CPU.Build.0 = Release|Any CPU + {E86483C1-1479-453A-8ABC-35DAC95AC056}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E86483C1-1479-453A-8ABC-35DAC95AC056}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E86483C1-1479-453A-8ABC-35DAC95AC056}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E86483C1-1479-453A-8ABC-35DAC95AC056}.Release|Any CPU.Build.0 = Release|Any CPU + {7B99E2A1-95AE-4C98-8C06-A5CE43969512}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B99E2A1-95AE-4C98-8C06-A5CE43969512}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B99E2A1-95AE-4C98-8C06-A5CE43969512}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B99E2A1-95AE-4C98-8C06-A5CE43969512}.Release|Any CPU.Build.0 = Release|Any CPU + {10CC5E31-EE6C-440B-A71F-9E3C8608410D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {10CC5E31-EE6C-440B-A71F-9E3C8608410D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {10CC5E31-EE6C-440B-A71F-9E3C8608410D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {10CC5E31-EE6C-440B-A71F-9E3C8608410D}.Release|Any CPU.Build.0 = Release|Any CPU + {F48B8455-B7A2-402C-8F88-16733A825EAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F48B8455-B7A2-402C-8F88-16733A825EAF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F48B8455-B7A2-402C-8F88-16733A825EAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F48B8455-B7A2-402C-8F88-16733A825EAF}.Release|Any CPU.Build.0 = Release|Any CPU + {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}.Release|Any CPU.Build.0 = Release|Any CPU + {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}.Release|Any CPU.Build.0 = Release|Any CPU + {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}.Release|Any CPU.Build.0 = Release|Any CPU + {D52E223F-F406-47A7-BF3E-924DC2D74981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D52E223F-F406-47A7-BF3E-924DC2D74981}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D52E223F-F406-47A7-BF3E-924DC2D74981}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D52E223F-F406-47A7-BF3E-924DC2D74981}.Release|Any CPU.Build.0 = Release|Any CPU + {F8681808-45F3-4C2D-8A37-D24C0A3414A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F8681808-45F3-4C2D-8A37-D24C0A3414A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F8681808-45F3-4C2D-8A37-D24C0A3414A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F8681808-45F3-4C2D-8A37-D24C0A3414A5}.Release|Any CPU.Build.0 = Release|Any CPU + {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}.Release|Any CPU.Build.0 = Release|Any CPU + {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}.Release|Any CPU.Build.0 = Release|Any CPU + {775797E2-8576-4050-8649-18AAD00D0A87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {775797E2-8576-4050-8649-18AAD00D0A87}.Debug|Any CPU.Build.0 = Debug|Any CPU + {775797E2-8576-4050-8649-18AAD00D0A87}.Release|Any CPU.ActiveCfg = Release|Any CPU + {775797E2-8576-4050-8649-18AAD00D0A87}.Release|Any CPU.Build.0 = Release|Any CPU + {42D62996-F3FA-406F-AECD-BEACE557E0DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42D62996-F3FA-406F-AECD-BEACE557E0DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42D62996-F3FA-406F-AECD-BEACE557E0DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42D62996-F3FA-406F-AECD-BEACE557E0DB}.Release|Any CPU.Build.0 = Release|Any CPU + {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}.Release|Any CPU.Build.0 = Release|Any CPU + {639F5AB4-3648-4AFE-95E3-5909C054E39C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {639F5AB4-3648-4AFE-95E3-5909C054E39C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {639F5AB4-3648-4AFE-95E3-5909C054E39C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {639F5AB4-3648-4AFE-95E3-5909C054E39C}.Release|Any CPU.Build.0 = Release|Any CPU + {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}.Release|Any CPU.Build.0 = Release|Any CPU + {701DF095-CF25-4311-9129-279A1834D8A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {701DF095-CF25-4311-9129-279A1834D8A3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {701DF095-CF25-4311-9129-279A1834D8A3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {701DF095-CF25-4311-9129-279A1834D8A3}.Release|Any CPU.Build.0 = Release|Any CPU + {E9B586D1-CCEF-450E-9E29-E102B141C32F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9B586D1-CCEF-450E-9E29-E102B141C32F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9B586D1-CCEF-450E-9E29-E102B141C32F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9B586D1-CCEF-450E-9E29-E102B141C32F}.Release|Any CPU.Build.0 = Release|Any CPU + {A006D835-D5A1-440E-A55A-58BE27794515}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A006D835-D5A1-440E-A55A-58BE27794515}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A006D835-D5A1-440E-A55A-58BE27794515}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A006D835-D5A1-440E-A55A-58BE27794515}.Release|Any CPU.Build.0 = Release|Any CPU + {8EE885E8-7D15-4810-9E1B-871089319080}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8EE885E8-7D15-4810-9E1B-871089319080}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8EE885E8-7D15-4810-9E1B-871089319080}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8EE885E8-7D15-4810-9E1B-871089319080}.Release|Any CPU.Build.0 = Release|Any CPU + {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}.Release|Any CPU.Build.0 = Release|Any CPU + {C4BF6451-134A-4113-8B13-5F8CE95E1B72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4BF6451-134A-4113-8B13-5F8CE95E1B72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4BF6451-134A-4113-8B13-5F8CE95E1B72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4BF6451-134A-4113-8B13-5F8CE95E1B72}.Release|Any CPU.Build.0 = Release|Any CPU + {F9178604-E581-4C7B-B5F2-936231ED2CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9178604-E581-4C7B-B5F2-936231ED2CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9178604-E581-4C7B-B5F2-936231ED2CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9178604-E581-4C7B-B5F2-936231ED2CC1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {FBD326D3-E59C-433E-A88E-14E179E3093D} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {EA2668AF-28E3-42C5-9FA5-8C9FF377180E} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {022D6FF5-4B65-4213-9A97-C69E2B2F99E1} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {75050CBC-A0F2-408A-A582-54EF37450B29} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {509BDB5A-5D32-478F-BF27-F0470C18C7C9} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {8C39C640-0E8A-43A7-890C-9742B6B70AA4} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {593A3114-D1E0-47ED-BC37-58E08886175B} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {57AD498B-D9AF-4479-8C14-45507F6509F5} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {9CB643CA-AA09-46E7-8CB9-E1D55E84B32B} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {64FB8703-E922-45DE-9D01-3FE9EFE56727} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {884D1A0A-A24F-4ED9-BBFE-DCC4E47CF26D} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {F128E74B-CEC4-4915-AEE2-FF69E60D17F0} = {593A3114-D1E0-47ED-BC37-58E08886175B} + {9782B9B5-22D0-432A-9BC5-D830C9478D38} = {8C39C640-0E8A-43A7-890C-9742B6B70AA4} + {6175D1D5-8007-4951-BF12-0064B8201C35} = {509BDB5A-5D32-478F-BF27-F0470C18C7C9} + {EECA2E9C-36B4-4DCE-93F7-487955B6260E} = {FBD326D3-E59C-433E-A88E-14E179E3093D} + {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE} = {FBD326D3-E59C-433E-A88E-14E179E3093D} + {B735824E-D918-4140-AE94-CA4172BF59EB} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} + {41F94385-3EAC-4617-8C2B-74D606B0A6A6} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} + {E86483C1-1479-453A-8ABC-35DAC95AC056} = {884D1A0A-A24F-4ED9-BBFE-DCC4E47CF26D} + {7B99E2A1-95AE-4C98-8C06-A5CE43969512} = {9CB643CA-AA09-46E7-8CB9-E1D55E84B32B} + {10CC5E31-EE6C-440B-A71F-9E3C8608410D} = {509BDB5A-5D32-478F-BF27-F0470C18C7C9} + {F48B8455-B7A2-402C-8F88-16733A825EAF} = {6ED365E6-4A1A-499F-85FB-F22E865CA4BA} + {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB} = {6ED365E6-4A1A-499F-85FB-F22E865CA4BA} + {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} + {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8} = {022D6FF5-4B65-4213-9A97-C69E2B2F99E1} + {4CC735F3-DB32-4D9D-863D-BB6E1BA362B9} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {D52E223F-F406-47A7-BF3E-924DC2D74981} = {4CC735F3-DB32-4D9D-863D-BB6E1BA362B9} + {F8681808-45F3-4C2D-8A37-D24C0A3414A5} = {6ED365E6-4A1A-499F-85FB-F22E865CA4BA} + {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} + {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} + {775797E2-8576-4050-8649-18AAD00D0A87} = {593A3114-D1E0-47ED-BC37-58E08886175B} + {42D62996-F3FA-406F-AECD-BEACE557E0DB} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} + {7078E83D-778C-4CE0-829F-7F0AD969361E} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B} = {7078E83D-778C-4CE0-829F-7F0AD969361E} + {639F5AB4-3648-4AFE-95E3-5909C054E39C} = {7078E83D-778C-4CE0-829F-7F0AD969361E} + {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD} = {7078E83D-778C-4CE0-829F-7F0AD969361E} + {701DF095-CF25-4311-9129-279A1834D8A3} = {7078E83D-778C-4CE0-829F-7F0AD969361E} + {E9B586D1-CCEF-450E-9E29-E102B141C32F} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} + {A006D835-D5A1-440E-A55A-58BE27794515} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} + {8EE885E8-7D15-4810-9E1B-871089319080} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} + {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} + {C4BF6451-134A-4113-8B13-5F8CE95E1B72} = {593A3114-D1E0-47ED-BC37-58E08886175B} + {C79B289A-DCFA-4763-BF44-55ED03E7E5BA} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} + {F9178604-E581-4C7B-B5F2-936231ED2CC1} = {C79B289A-DCFA-4763-BF44-55ED03E7E5BA} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} + EndGlobalSection +EndGlobal diff --git a/src/BuildingBlocks/README.md b/src/BuildingBlocks/README.md new file mode 100644 index 000000000..e2c362c1d --- /dev/null +++ b/src/BuildingBlocks/README.md @@ -0,0 +1,67 @@ +# + +[中](README.zh-CN.md) | EN + +# MASA.BuildingBlocks [Archived, please see [MASA.Framework](https://github.com/masastack/MASA.Framework)] +Building blocks of the MASA Stack, provides a unified interface standard for [MASA Contrib](https://github.com/masastack/MASA.Contrib/blob/main/README.md) implementation specifications and process connector. + + + +## Why choose MASA.BuildingBlocks? +* Supports monolithic architecture and distributed architecture +* Based on the .Net main push technology stack, no magic modification, low learning cost +* Provide a unified interface standard, with the best practices of MASA Contrib, but not limited to [MASA Contrib](https://github.com/masastack/MASA.Contrib/blob/main/README.md) , anyone can implement their own Contrib based on MASA BuildingBlocks, re-customize some features + + + +## Roadmap +* [Release notes](https://github.com/masastack/MASA.BuildingBlocks/releases) +* [Latest roadmap](https://github.com/masastack/MASA.BuildingBlocks/issues/39) + + + +## Features +* AutoComplete: make searching easier +* Configuration: Configuration Center +* CQRS +* DDD +* Dispatcher +* Isolation: Support physical isolation, logical isolation +* MinimalAPI: Supports API classification aggregation similar to Controller +* UoW: unit of work +* Storage: cloud storage + + + +## How to contribute + +1. Fork & Clone +2. Create Feature_xxx branch +3. Commit with commit message, like `feat(Isolation): Support physical isolation, logical isolation` +4. Create Pull Request + +If you wish to contribute, please [Pull Request](https://github.com/masastack/MASA.BuildingBlocks/pulls), or send us a [Report Bug](https://github.com/masastack/MASA.BuildingBlocks/issues/new) . + + + +## Contributors + +Thanks to all the friends who have contributed to this project. + + + + + + + +## code of conduct + +This project adopts the Code of Conduct as defined by the Contributors Covenant to clarify the expected behavior of our community. For more information see [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). + + + +## ☀️ License Statement + +[![MASA.BuildingBlocks](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) + +Copyright (c) 2021-present MASA Stack diff --git a/src/BuildingBlocks/README.zh-CN.md b/src/BuildingBlocks/README.zh-CN.md new file mode 100644 index 000000000..11e25a105 --- /dev/null +++ b/src/BuildingBlocks/README.zh-CN.md @@ -0,0 +1,65 @@ +中 | [EN](README.md) + +# MASA.BuildingBlocks [归档, 请看 [MASA.Framework](https://github.com/masastack/MASA.Framework)] +MASA Stack的构建块,提供统一的接口标准,用于[MASA Contrib](https://github.com/masastack/MASA.Contrib/blob/main/README.zh-CN.md)的实现规约和流程衔接。 + + + +## 为什么选择MASA.BuildingBlocks? +* 支持单体架构,也支持分布式架构 +* 基于.Net主推技术栈,不魔改,学习成本低 +* 提供统一的接口标准,有MASA Contrib的最佳实践,但不局限于[MASA Contrib](https://github.com/masastack/MASA.Contrib/blob/main/README.zh-CN.md),任何人都可以基于MASA BuildingBlocks实现自己的Contrib,重新定制某些特性 + + + +## 路线图 +* [发行说明](https://github.com/masastack/MASA.BuildingBlocks/releases) +* [最新路线图](https://github.com/masastack/MASA.BuildingBlocks/issues/39) + + + +## 特性 +* AutoComplete: 使搜索更简单 +* Configuration: 配置中心 +* CQRS +* DDD +* Dispatcher +* Isolation: 支持物理隔离、逻辑隔离 +* MinimalAPI: 支持类似Controller的API分类聚合 +* UoW: 工作单元 +* Storage: 云存储 + + + +## 如何贡献 + +1. Fork & Clone +2. Create Feature_xxx branch +3. Commit with commit message, like `feat(Isolation): Support physical isolation, logical isolation` +4. Create Pull Request + +如果你希望参与贡献,欢迎 [Pull Request](https://github.com/masastack/MASA.BuildingBlocks/pulls),或给我们 [报告 Bug](https://github.com/masastack/MASA.BuildingBlocks/issues/new) 。 + + + +## 贡献者 + +感谢所有为本项目做出过贡献的朋友。 + + + + + + + +## 行为准则 + +本项目采用了《贡献者公约》所定义的行为准则,以明确我们社区的预期行为。更多信息请见 [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). + + + +## ☀️ 许可声明 + +[![MASA.BuildingBlocks](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) + +Copyright (c) 2021-present MASA Stack diff --git a/src/BuildingBlocks/design/CodeMap.dgml b/src/BuildingBlocks/design/CodeMap.dgml new file mode 100644 index 000000000..d2cc0dbd3 --- /dev/null +++ b/src/BuildingBlocks/design/CodeMap.dgml @@ -0,0 +1,473 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs new file mode 100644 index 000000000..92c5a5390 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; + +public interface IApiResourceCache +{ + Task> GetListAsync(IEnumerable names); + + Task> GetListAsync(); + + Task SetAsync(ApiResource apiResource); + + Task SetRangeAsync(IEnumerable apiResources); + + Task RemoveAsync(ApiResource apiResource); + + Task ResetAsync(IEnumerable identityResources); +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs new file mode 100644 index 000000000..07002b1ac --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; + +public interface IApiScopeCache +{ + Task> GetListAsync(IEnumerable names); + + Task> GetListAsync(); + + Task SetAsync(ApiScope apiScope); + + Task SetRangeAsync(IEnumerable apiScopes); + + Task RemoveAsync(ApiScope apiScope); + + Task ResetAsync(IEnumerable identityResources); +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs new file mode 100644 index 000000000..f0e2ac840 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; + +public interface IClientCache +{ + Task GetAsync(string clientId); + + Task> GetListAsync(IEnumerable clientIds); + + Task SetAsync(Client client); + + Task SetRangeAsync(IEnumerable clients); + + Task RemoveAsync(Client client); + + Task ResetAsync(IEnumerable clients); +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs new file mode 100644 index 000000000..7c0ef59c1 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; + +public interface IIdentityResourceCache +{ + Task> GetListAsync(IEnumerable names); + + Task> GetListAsync(); + + Task SetAsync(IdentityResource identityResource); + + Task SetRangeAsync(IEnumerable identityResources); + + Task RemoveAsync(IdentityResource identityResource); + + Task ResetAsync(IEnumerable identityResources); +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj new file mode 100644 index 000000000..efd405435 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs new file mode 100644 index 000000000..f9859df48 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs new file mode 100644 index 000000000..962779103 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs @@ -0,0 +1,37 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; + +public class GrantTypeConsts +{ + public static ICollection Implicit => + new[] { GrantTypes.IMPLICIT }; + + public static ICollection ImplicitAndClientCredentials => + new[] { GrantTypes.IMPLICIT, GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection Code => + new[] { GrantTypes.AUTHORIZATION_CODE }; + + public static ICollection CodeAndClientCredentials => + new[] { GrantTypes.AUTHORIZATION_CODE, GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection Hybrid => + new[] { GrantTypes.HYBRID }; + + public static ICollection HybridAndClientCredentials => + new[] { GrantTypes.HYBRID, GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection ClientCredentials => + new[] { GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection ResourceOwnerPassword => + new[] { GrantTypes.RESOURCE_OWNER_PASSWORD }; + + public static ICollection ResourceOwnerPasswordAndClientCredentials => + new[] { GrantTypes.RESOURCE_OWNER_PASSWORD, GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection DeviceFlow => + new[] { GrantTypes.DEVICE_FLOW }; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs new file mode 100644 index 000000000..d6e49be2d --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; + +public static class GrantTypes +{ + public const string IMPLICIT = "implicit"; + + public const string HYBRID = "hybrid"; + + public const string AUTHORIZATION_CODE = "authorization_code"; + + public const string CLIENT_CREDENTIALS = "client_credentials"; + + public const string RESOURCE_OWNER_PASSWORD = "password"; + + public const string DEVICE_FLOW = "urn:ietf:params:oauth:grant-type:device_code"; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs new file mode 100644 index 000000000..a76ab6f88 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; + +public abstract class Property : Entity +{ + public string Key { get; protected set; } = ""; + + public string Value { get; protected set; } = ""; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs new file mode 100644 index 000000000..d317f503b --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; + +public abstract class Secret : FullEntity +{ + public string Description { get; protected set; } = string.Empty; + + public string Value { get; protected set; } = string.Empty; + + public DateTime? Expiration { get; protected set; } + + public string Type { get; protected set; } = "SharedSecret"; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs new file mode 100644 index 000000000..c953e82d5 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs @@ -0,0 +1,78 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResource : FullAggregateRoot +{ + private List _secrets = new(); + private List _apiScopes = new(); + private List _userClaims = new(); + private List _properties = new(); + + public bool Enabled { get; private set; } + + public string Name { get; private set; } = ""; + + public string DisplayName { get; private set; } = ""; + + public string Description { get; private set; } = ""; + + public string AllowedAccessTokenSigningAlgorithms { get; private set; } = ""; + + public bool ShowInDiscoveryDocument { get; private set; } = true; + + public DateTime? LastAccessed { get; private set; } + + public bool NonEditable { get; private set; } + + public IReadOnlyCollection Secrets => _secrets; + + public IReadOnlyCollection ApiScopes => _apiScopes; + + public IReadOnlyCollection UserClaims => _userClaims; + + public IReadOnlyCollection Properties => _properties; + + public ApiResource(string name, string displayName, string description, string allowedAccessTokenSigningAlgorithms, bool showInDiscoveryDocument, DateTime? lastAccessed, bool nonEditable, bool enabled) + { + Enabled = enabled; + Name = name; + DisplayName = displayName; + Description = description; + AllowedAccessTokenSigningAlgorithms = allowedAccessTokenSigningAlgorithms; + ShowInDiscoveryDocument = showInDiscoveryDocument; + LastAccessed = lastAccessed; + NonEditable = nonEditable; + } + + public void Update(string displayName, string description, string allowedAccessTokenSigningAlgorithms, bool showInDiscoveryDocument, DateTime? lastAccessed, bool nonEditable, bool enabled) + { + Enabled = enabled; + DisplayName = displayName; + Description = description; + AllowedAccessTokenSigningAlgorithms = allowedAccessTokenSigningAlgorithms; + ShowInDiscoveryDocument = showInDiscoveryDocument; + LastAccessed = lastAccessed; + NonEditable = nonEditable; + } + + public void BindUserClaims(List userClaims) + { + _userClaims.Clear(); + _userClaims.AddRange(userClaims.Select(id => new ApiResourceClaim(id))); + } + + public void BindProperties(Dictionary properties) + { + _properties.Clear(); + _properties.AddRange(properties.Select(property => new ApiResourceProperty(property.Key, property.Value))); + } + + public void BindApiScopes(List apiScopes) + { + _apiScopes.Clear(); + _apiScopes.AddRange(apiScopes.Select(id => new ApiResourceScope(id))); + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs new file mode 100644 index 000000000..0188babe4 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResourceClaim : FullEntity +{ + public int UserClaimId { get; private set; } + + public UserClaim UserClaim { get; private set; } = null!; + + public int ApiResourceId { get; private set; } + + public ApiResource ApiResource { get; private set; } = null!; + + public ApiResourceClaim(int userClaimId) + { + UserClaimId = userClaimId; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs new file mode 100644 index 000000000..8dde202ac --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResourceProperty : Property +{ + public int ApiResourceId { get; private set; } + + public ApiResource ApiResource { get; private set; } = null!; + + public ApiResourceProperty(string key, string value) + { + Key = key; + Value = value; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs new file mode 100644 index 000000000..745deb01a --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResourceScope : FullEntity +{ + public int ApiScopeId { get; private set; } + + public ApiScope ApiScope { get; private set; } = null!; + + public int ApiResourceId { get; private set; } + + public ApiResource ApiResource { get; private set; } = null!; + + public ApiResourceScope(int apiScopeId) + { + ApiScopeId = apiScopeId; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs new file mode 100644 index 000000000..aef627684 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResourceSecret : Secret +{ + public int ApiResourceId { get; private set; } + + public ApiResource ApiResource { get; private set; } = null!; +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs new file mode 100644 index 000000000..b2d6c400f --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiScope : FullAggregateRoot +{ + private List _userClaims = new(); + private List _properties = new(); + + public bool Enabled { get; private set; } + + public string Name { get; private set; } = ""; + + public string DisplayName { get; private set; } = ""; + + public string Description { get; private set; } = ""; + + public bool Required { get; private set; } + + public bool Emphasize { get; private set; } + + public bool ShowInDiscoveryDocument { get; private set; } + + public IReadOnlyCollection UserClaims => _userClaims; + + public IReadOnlyCollection Properties => _properties; + + public ApiScope(string name) : this(name, name, "", true, true, true, true) + { + + } + + public ApiScope(string name, string displayName, string description, bool required, bool emphasize, bool showInDiscoveryDocument, bool enabled) + { + Enabled = enabled; + Name = name; + DisplayName = displayName; + Description = description; + Required = required; + Emphasize = emphasize; + ShowInDiscoveryDocument = showInDiscoveryDocument; + } + + public void Update(string displayName, string description, bool required, bool emphasize, bool showInDiscoveryDocument, bool enabled) + { + Enabled = enabled; + DisplayName = displayName; + Description = description; + Required = required; + Emphasize = emphasize; + ShowInDiscoveryDocument = showInDiscoveryDocument; + } + + public void BindUserClaims(List userClaims) + { + _userClaims.Clear(); + _userClaims.AddRange(userClaims.Select(id => new ApiScopeClaim(id))); + } + + public void BindProperties(Dictionary properties) + { + _properties.Clear(); + _properties.AddRange(properties.Select(property => new ApiScopeProperty(property.Key, property.Value))); + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs new file mode 100644 index 000000000..613e08be7 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiScopeClaim : FullEntity +{ + public int UserClaimId { get; private set; } + + public UserClaim UserClaim { get; private set; } = null!; + + public int ApiScopeId { get; private set; } + + public ApiScope ApiScope { get; private set; } = null!; + + public ApiScopeClaim(int userClaimId) + { + UserClaimId = userClaimId; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs new file mode 100644 index 000000000..9b49e1e00 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiScopeProperty : Property +{ + public int ScopeId { get; private set; } + + public ApiScope Scope { get; private set; } = null!; + + public ApiScopeProperty(string key, string value) + { + Key = key; + Value = value; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs new file mode 100644 index 000000000..535e3a8ee --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs @@ -0,0 +1,161 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class Client : FullAggregateRoot +{ + public ClientTypes ClientType { get; private set; } + + public bool Enabled { get; private set; } = true; + + public string ClientId { get; private set; } = string.Empty; + + public string ProtocolType { get; private set; } = "oidc"; + + public List ClientSecrets { get; private set; } = new(); + + public bool RequireClientSecret { get; private set; } = true; + + public string ClientName { get; private set; } = string.Empty; + + public string Description { get; private set; } = string.Empty; + + public string ClientUri { get; private set; } = string.Empty; + + public string LogoUri { get; private set; } = string.Empty; + + public bool RequireConsent { get; private set; } = false; + + public bool AllowRememberConsent { get; private set; } = true; + + public bool AlwaysIncludeUserClaimsInIdToken { get; private set; } + + public List AllowedGrantTypes { get; private set; } = new(); + + public bool RequirePkce { get; private set; } = true; + + public bool AllowPlainTextPkce { get; private set; } + + public bool RequireRequestObject { get; private set; } + + public bool AllowAccessTokensViaBrowser { get; private set; } + + public List RedirectUris { get; private set; } = new(); + + public List PostLogoutRedirectUris { get; private set; } = new(); + + public string FrontChannelLogoutUri { get; private set; } = string.Empty; + + public bool FrontChannelLogoutSessionRequired { get; private set; } = true; + + public string BackChannelLogoutUri { get; private set; } = string.Empty; + + public bool BackChannelLogoutSessionRequired { get; private set; } = true; + + public bool AllowOfflineAccess { get; private set; } + + public List AllowedScopes { get; private set; } = new(); + + public int IdentityTokenLifetime { get; private set; } = 300; + + public string AllowedIdentityTokenSigningAlgorithms { get; private set; } = string.Empty; + + public int AccessTokenLifetime { get; private set; } = 3600; + + public int AuthorizationCodeLifetime { get; private set; } = 300; + + public int? ConsentLifetime { get; private set; } = null; + + public int AbsoluteRefreshTokenLifetime { get; private set; } = 2592000; + + public int SlidingRefreshTokenLifetime { get; private set; } = 1296000; + + public int RefreshTokenUsage { get; private set; } = (int)TokenUsage.OneTimeOnly; + + public bool UpdateAccessTokenClaimsOnRefresh { get; private set; } + + public int RefreshTokenExpiration { get; private set; } = (int)TokenExpiration.Absolute; + + public int AccessTokenType { get; private set; } = 0; // AccessTokenType.Jwt; + + public bool EnableLocalLogin { get; private set; } = true; + + public List IdentityProviderRestrictions { get; private set; } = new(); + + public bool IncludeJwtId { get; private set; } + + public List Claims { get; private set; } = new(); + + public bool AlwaysSendClientClaims { get; private set; } + + public string ClientClaimsPrefix { get; private set; } = "client_"; + + public string PairWiseSubjectSalt { get; private set; } = string.Empty; + + public List AllowedCorsOrigins { get; private set; } = new(); + + public List Properties { get; private set; } = new(); + + public DateTime? LastAccessed { get; private set; } + + public int? UserSsoLifetime { get; private set; } + + public string UserCodeType { get; private set; } = string.Empty; + + public int DeviceCodeLifetime { get; private set; } = 300; + + public bool NonEditable { get; private set; } + + private Client() + { + } + + public Client(ClientTypes clientType, string clientId, string clientName) + { + SetClientType(clientType); + ClientId = clientId; + ClientName = clientName; + } + + public void SetClientType(ClientTypes clientType) + { + ClientType = clientType; + switch (clientType) + { + case ClientTypes.Web: + case ClientTypes.Spa: + case ClientTypes.Native: + AllowedGrantTypes = GrantTypeConsts.Code.Select(x => new ClientGrantType(x)).ToList(); + RequirePkce = true; + RequireClientSecret = false; + break; + case ClientTypes.Machine: + AllowedGrantTypes = GrantTypeConsts.ClientCredentials.Select(x => new ClientGrantType(x)).ToList(); + RequireClientSecret = true; + break; + case ClientTypes.Device: + AllowedGrantTypes = GrantTypeConsts.DeviceFlow.Select(x => new ClientGrantType(x)).ToList(); + RequireClientSecret = false; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + public void SetRedirectUris(List redirectUris) + { + RedirectUris = redirectUris.Select(x => new ClientRedirectUri(x)).ToList(); + } + + public void SetPostLogoutRedirectUris(List postLogoutRedirectUris) + { + PostLogoutRedirectUris = postLogoutRedirectUris.Select(x => new ClientPostLogoutRedirectUri(x)).ToList(); + } + + public void SetAllowedScopes(List allowedScopes) + { + AllowedScopes = allowedScopes.Select(x => new ClientScope(x)).ToList(); + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs new file mode 100644 index 000000000..a95e140f4 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientClaim : Entity +{ + public string Type { get; private set; } = string.Empty; + + public string Value { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs new file mode 100644 index 000000000..942460995 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientCorsOrigin : Entity +{ + public string Origin { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs new file mode 100644 index 000000000..aa6124fc9 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientGrantType : Entity +{ + public string GrantType { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientGrantType(string grantType) + { + GrantType = grantType; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs new file mode 100644 index 000000000..61ed181a8 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientIdPRestriction : Entity +{ + public string Provider { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs new file mode 100644 index 000000000..b50256c26 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientPostLogoutRedirectUri : Entity +{ + public string PostLogoutRedirectUri { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientPostLogoutRedirectUri(string postLogoutRedirectUri) + { + PostLogoutRedirectUri = postLogoutRedirectUri; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs new file mode 100644 index 000000000..8d78e460b --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientProperty : Property +{ + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientProperty(string key, string value) + { + Key = key; + Value = value; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs new file mode 100644 index 000000000..7d0016b87 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientRedirectUri : Entity +{ + public string RedirectUri { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientRedirectUri(string redirectUri) + { + RedirectUri = redirectUri; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs new file mode 100644 index 000000000..051e242b1 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientScope : Entity +{ + public string Scope { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientScope(string scope) + { + Scope = scope; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs new file mode 100644 index 000000000..415646d32 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientSecret : Secret +{ + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs new file mode 100644 index 000000000..5607d7399 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs @@ -0,0 +1,71 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class DeviceFlowCodes : FullAggregateRoot +{ + /// + /// Gets or sets the device code. + /// + /// + /// The device code. + /// + public string DeviceCode { get; private set; } = string.Empty; + + /// + /// Gets or sets the user code. + /// + /// + /// The user code. + /// + public string UserCode { get; private set; } = string.Empty; + + /// + /// Gets or sets the subject identifier. + /// + /// + /// The subject identifier. + /// + public string SubjectId { get; private set; } = string.Empty; + + /// + /// Gets or sets the session identifier. + /// + /// + /// The session identifier. + /// + public string SessionId { get; private set; } = string.Empty; + + /// + /// Gets or sets the client identifier. + /// + /// + /// The client identifier. + /// + public string ClientId { get; private set; } = string.Empty; + + /// + /// Gets the description the user assigned to the device being authorized. + /// + /// + /// The description. + /// + public string Description { get; private set; } = string.Empty; + + /// + /// Gets or sets the expiration. + /// + /// + /// The expiration. + /// + public DateTime? Expiration { get; private set; } + + /// + /// Gets or sets the data. + /// + /// + /// The data. + /// + public string Data { get; private set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs new file mode 100644 index 000000000..e947153b2 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class IdentityResource : FullAggregateRoot +{ + private List _userClaims = new(); + private List _properties = new(); + + public string Name { get; private set; } = string.Empty; + + public string DisplayName { get; private set; } = string.Empty; + + public string Description { get; private set; } = string.Empty; + + public bool Enabled { get; private set; } = true; + + public bool Required { get; private set; } + + public bool Emphasize { get; private set; } + + public bool ShowInDiscoveryDocument { get; private set; } = true; + + public IReadOnlyCollection UserClaims => _userClaims; + + public IReadOnlyCollection Properties => _properties; + + public bool NonEditable { get; private set; } + + public IdentityResource(string name, string displayName, string description, bool enabled, bool required, bool emphasize, bool showInDiscoveryDocument, bool nonEditable) + { + Name = name; + DisplayName = displayName; + Description = description; + Enabled = enabled; + Required = required; + Emphasize = emphasize; + ShowInDiscoveryDocument = showInDiscoveryDocument; + NonEditable = nonEditable; + } + + public void BindUserClaims(IEnumerable userClaims) + { + _userClaims.Clear(); + _userClaims.AddRange(userClaims.Select(id => new IdentityResourceClaim(id))); + } + + public void BindProperties(Dictionary properties) + { + _properties.Clear(); + _properties.AddRange(properties.Select(property => new IdentityResourceProperty(property.Key, property.Value))); + } + + public void Update(string displayName, string description, bool enabled, bool required, bool emphasize, bool showInDiscoveryDocument, bool nonEditable) + { + DisplayName = displayName; + Description = description; + Enabled = enabled; + Required = required; + Emphasize = emphasize; + ShowInDiscoveryDocument = showInDiscoveryDocument; + NonEditable = nonEditable; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs new file mode 100644 index 000000000..d8f4fa9f6 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class IdentityResourceClaim : FullEntity +{ + public int UserClaimId { get; private set; } + + public UserClaim UserClaim { get; private set; } = null!; + + public int IdentityResourceId { get; private set; } + + public IdentityResource IdentityResource { get; private set; } = null!; + + public IdentityResourceClaim(int userClaimId) + { + UserClaimId = userClaimId; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs new file mode 100644 index 000000000..88b21d15c --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities +{ + public class IdentityResourceProperty : Property + { + public int IdentityResourceId { get; private set; } + + public IdentityResource IdentityResource { get; private set; } = null!; + + public IdentityResourceProperty(string key, string value) + { + Key = key; + Value = value; + } + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs new file mode 100644 index 000000000..2ceeced09 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class PersistedGrant : FullAggregateRoot +{ + public string Key { get; private set; } = null!; + + public string Type { get; private set; } = string.Empty; + + public string SubjectId { get; private set; } = string.Empty; + + public string SessionId { get; private set; } = string.Empty; + + public string ClientId { get; private set; } = string.Empty; + + public string Description { get; private set; } = string.Empty; + + public DateTime? Expiration { get; private set; } + + public DateTime? ConsumedTime { get; private set; } + + public string Data { get; private set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs new file mode 100644 index 000000000..669417c56 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class UserClaim : FullAggregateRoot +{ + public string Name { get; private set; } + + public string Description { get; private set; } + + public UserClaim(string name, string description) + { + Name = name; + Description = description; + } + + public void Update(string description) + { + Description = description; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs new file mode 100644 index 000000000..d4882f57d --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; + +public enum ClientTypes +{ + Web = 1, + Spa = 2, + Native = 3, + Machine = 4, + Device = 5 +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs new file mode 100644 index 000000000..410ac838f --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; + +/// +/// Token expiration types. +/// +public enum TokenExpiration +{ + /// + /// Sliding token expiration + /// + Sliding = 0, + + /// + /// Absolute token expiration + /// + Absolute = 1 +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs new file mode 100644 index 000000000..67eaa8040 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; + +/// +/// Token usage types. +/// +public enum TokenUsage +{ + /// + /// Re-use the refresh token handle + /// + Reuse = 0, + + /// + /// Issue a new refresh token handle every time + /// + OneTimeOnly = 1 +} diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj similarity index 59% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj rename to src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj index b6c588b8d..5f01c06c5 100644 --- a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj @@ -2,13 +2,12 @@ net6.0 - enable enable - false + enable - + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs new file mode 100644 index 000000000..c7118c570 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IApiResourceRepository : IRepositoryBase +{ +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs new file mode 100644 index 000000000..6d5822e83 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IApiScopeRepository : IRepositoryBase +{ +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs new file mode 100644 index 000000000..31c686ff4 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IClientRepository : IRepositoryBase +{ +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs new file mode 100644 index 000000000..f70b7ab4d --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IIdentityResourceRepository : IRepositoryBase +{ + Task AddStandardIdentityResourcesAsync(); +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs new file mode 100644 index 000000000..a15fceae5 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IRepositoryBase where TEntity : class, IEntity +{ + Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null); + + Task GetDetailAsync(int id); + + Task> GetListAsync(); + + Task FindAsync(Expression> predicate); + + Task GetCountAsync(Expression> predicate); + + ValueTask AddAsync(TEntity entity); + + Task UpdateAsync(TEntity entity); + + Task RemoveAsync(TEntity entity); +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs new file mode 100644 index 000000000..2a884f1fb --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IUserClaimRepository : IRepositoryBase +{ + Task AddStandardUserClaimsAsync(); +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs new file mode 100644 index 000000000..623152bd2 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Entities.Full; +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; +global using System.Linq.Expressions; diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs new file mode 100644 index 000000000..900f0e698 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; + +public static class GrantType +{ + public const string IMPLICIT = "implicit"; + + public const string HYBRID = "hybrid"; + + public const string AUTHORIZATION_CODE = "authorization_code"; + + public const string CLIENT_CREDENTIALS = "client_credentials"; + + public const string RESOURCE_OWNER_PASSWORD = "password"; + + public const string DEVICE_FLOW = "urn:ietf:params:oauth:grant-type:device_code"; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs new file mode 100644 index 000000000..dbcd5e530 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs @@ -0,0 +1,37 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; + +public class GrantTypes +{ + public static ICollection Implicit => + new[] { GrantType.IMPLICIT }; + + public static ICollection ImplicitAndClientCredentials => + new[] { GrantType.IMPLICIT, GrantType.CLIENT_CREDENTIALS }; + + public static ICollection Code => + new[] { GrantType.AUTHORIZATION_CODE }; + + public static ICollection CodeAndClientCredentials => + new[] { GrantType.AUTHORIZATION_CODE, GrantType.CLIENT_CREDENTIALS }; + + public static ICollection Hybrid => + new[] { GrantType.HYBRID }; + + public static ICollection HybridAndClientCredentials => + new[] { GrantType.HYBRID, GrantType.CLIENT_CREDENTIALS }; + + public static ICollection ClientCredentials => + new[] { GrantType.CLIENT_CREDENTIALS }; + + public static ICollection ResourceOwnerPassword => + new[] { GrantType.RESOURCE_OWNER_PASSWORD }; + + public static ICollection ResourceOwnerPasswordAndClientCredentials => + new[] { GrantType.RESOURCE_OWNER_PASSWORD, GrantType.CLIENT_CREDENTIALS }; + + public static ICollection DeviceFlow => + new[] { GrantType.DEVICE_FLOW }; +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs new file mode 100644 index 000000000..b1dc32a84 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs @@ -0,0 +1,104 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; + +public class StandardIdentityResources +{ + [Description("Your user identifier")] + public static IdentityResourceModel OpenId = new() + { + Name = "openid", + DisplayName = "Your user identifier", + Description = "Your user identifier", + Required = true, + UserClaims = new List() + { + StandardUserClaims.Subject + } + }; + + [Description("Your address")] + public static IdentityResourceModel Address = new() + { + Name = "address", + DisplayName = "Your address", + Description = "Your address", + Emphasize = true, + UserClaims = new List() + { + StandardUserClaims.Address + } + }; + + [Description("Your email address")] + public static IdentityResourceModel Email = new() + { + Name = "email", + DisplayName = "Your email address", + Description = "Your email address", + Emphasize = true, + UserClaims = new List() + { + StandardUserClaims.Email, + StandardUserClaims.EmailVerified, + } + }; + + [Description("Your phone number")] + public static IdentityResourceModel Phone = new() + { + Name = "phone", + DisplayName = "Your phone number", + Description = "Your phone number", + Emphasize = true, + UserClaims = new List() + { + StandardUserClaims.PhoneNumber, + StandardUserClaims.PhoneNumberVerified + } + }; + + [Description("User profile")] + public static IdentityResourceModel Profile = new() + { + Name = "profile", + DisplayName = "User profile", + Description = "Your user profile information (first name, last name, etc.)", + Emphasize = true, + UserClaims = new List() + { + StandardUserClaims.Name, + StandardUserClaims.FamilyName, + StandardUserClaims.GivenName, + StandardUserClaims.MiddleName, + StandardUserClaims.NickName, + StandardUserClaims.PreferredUserName, + StandardUserClaims.Profile, + StandardUserClaims.Picture, + StandardUserClaims.WebSite, + StandardUserClaims.Gender, + StandardUserClaims.BirthDate, + StandardUserClaims.ZoneInfo, + StandardUserClaims.Locale, + StandardUserClaims.UpdatedAt + } + }; + + static List? _identityResources; + + public static List IdentityResources => _identityResources ??= GetIdentityResources(); + + static List GetIdentityResources() + { + var identityResources = new List(); + var fields = typeof(StandardIdentityResources).GetFields(BindingFlags.Static | BindingFlags.Public); + foreach (var field in fields) + { + var idrs = (IdentityResourceModel)(field.GetValue(null) ?? throw new Exception("Error standard identity resources data")); + identityResources.Add(idrs); + } + + return identityResources; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs new file mode 100644 index 000000000..f6b2d8ed9 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs @@ -0,0 +1,78 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; + +public static class StandardUserClaims +{ + [Description("subject 的缩写,唯一标识,一般为用户 ID")] + public static readonly string Subject = "sub"; + [Description("姓名")] + public static readonly string Name = "name"; + [Description("名字")] + public static readonly string GivenName = "given_name"; + [Description("姓")] + public static readonly string FamilyName = "family_name"; + [Description("中间名")] + public static readonly string MiddleName = "middle_name"; + [Description("昵称")] + public static readonly string NickName = "nickname"; + [Description("希望被称呼的名字")] + public static readonly string PreferredUserName = "preferred_username"; + [Description("基础资料")] + public static readonly string Profile = "profile"; + [Description("头像")] + public static readonly string Picture = "picture"; + [Description("网站链接")] + public static readonly string WebSite = "website"; + [Description("电子邮箱")] + public static readonly string Email = "email"; + [Description("邮箱是否被认证")] + public static readonly string EmailVerified = "email_verified"; + [Description("性别")] + public static readonly string Gender = "gender"; + [Description("生日")] + public static readonly string BirthDate = "birthdate"; + [Description("时区")] + public static readonly string ZoneInfo = "zoneinfo"; + [Description("区域")] + public static readonly string Locale = "locale"; + [Description("手机号")] + public static readonly string PhoneNumber = "phone_number"; + [Description("认证手机号")] + public static readonly string PhoneNumberVerified = "phone_number_verified"; + [Description("地址")] + public static readonly string Address = "address"; + [Description("详细地址")] + public static readonly string Formatted = "formatted"; + [Description("街道地址")] + public static readonly string StreetAddress = "street_address"; + [Description("城市")] + public static readonly string Locality = "locality"; + [Description("省")] + public static readonly string Region = "region"; + [Description("邮编")] + public static readonly string PostalCode = "postal_code"; + [Description("国家")] + public static readonly string Country = "country"; + [Description("信息更新时间")] + public static readonly string UpdatedAt = "updated_at"; + + static Dictionary? _claims; + + public static Dictionary Claims => _claims ??= GetClaims(); + + static Dictionary GetClaims() + { + var claims = new Dictionary(); + var fileds = typeof(StandardUserClaims).GetFields(BindingFlags.Static | BindingFlags.Public); + foreach (var filed in fileds) + { + var value = filed.GetValue(null)?.ToString() ?? ""; + var description = filed.GetCustomAttribute()?.Description ?? ""; + claims.Add(value, description); + } + + return claims; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs new file mode 100644 index 000000000..f49e96f2b --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; + +public enum AccessTokenType +{ + [Description("Self-contained Json Web Token")] + Jwt, + [Description("Reference token")] + Reference +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs new file mode 100644 index 000000000..8a3e0dd6f --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; + +public enum TokenExpiration +{ + [Description("Sliding token expiration")] + Sliding, + [Description("Absolute token expiration")] + Absolute +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs new file mode 100644 index 000000000..52ffd7eff --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; + +public enum TokenUsage +{ + [Description("Re-use the refresh token handle")] + Reuse, + [Description("Issue a new refresh token handle every time")] + OneTimeOnly +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs new file mode 100644 index 000000000..7e27dd894 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs @@ -0,0 +1,50 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ApiResourceModel : ResourceModel +{ + public ICollection? Scopes { get; set; } + + public ICollection? ApiSecrets { get; set; } + + public ICollection? AllowedAccessTokenSigningAlgorithms { get; set; } + + public ApiResourceModel() + { + + } + + public ApiResourceModel( + string name, + string? displayName = null, + ICollection? userClaims = null) + { + Name = name; + DisplayName = displayName ?? name; + if (userClaims is not null) UserClaims = userClaims; + } + + public ApiResourceModel( + string name, + string displayName, + string? description, + bool enabled, + bool showInDiscoveryDocument, + ICollection? userClaims, + ICollection? scopes, + IDictionary properties, + ICollection? apiSecrets, + ICollection? allowedAccessTokenSigningAlgorithms) : this(name, displayName, userClaims) + { + Description = description; + Enabled = enabled; + ShowInDiscoveryDocument = showInDiscoveryDocument; + Scopes = scopes; + Properties = properties; + ApiSecrets = apiSecrets; + AllowedAccessTokenSigningAlgorithms = allowedAccessTokenSigningAlgorithms; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs new file mode 100644 index 000000000..584292172 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs @@ -0,0 +1,46 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ApiScopeModel : ResourceModel +{ + public bool Required { get; set; } + + public bool Emphasize { get; set; } + + public ApiScopeModel() + { + + } + + public ApiScopeModel( + string name, + string? displayName = null, + ICollection? userClaims = null) + { + Name = name; + DisplayName = displayName ?? name; + if (userClaims is not null) UserClaims = userClaims; + } + + public ApiScopeModel( + string name, + string displayName, + string? description, + bool enabled, + bool showInDiscoveryDocument, + bool required, + bool emphasize, + ICollection? userClaims, + Dictionary properties) : this(name, displayName, userClaims) + { + Description = description; + Enabled = enabled; + ShowInDiscoveryDocument = showInDiscoveryDocument; + Required = required; + Emphasize = emphasize; + Properties = properties; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs new file mode 100644 index 000000000..7b37e0dba --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs @@ -0,0 +1,59 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ClientClaimModel +{ + /// + /// The claim type + /// + public string Type { get; set; } + + /// + /// The claim value + /// + public string Value { get; set; } + + /// + /// The claim value type + /// + public string ValueType { get; set; } = ClaimValueTypes.String; + + /// + /// ctor + /// + public ClientClaimModel(string type, string value, string? valueType = null) + { + Type = type; + Value = value; + if (valueType is not null) ValueType = valueType; + } + + public override int GetHashCode() + { + unchecked + { + int hash = 17; + + hash = hash * 23 + Value.GetHashCode(); + hash = hash * 23 + Type.GetHashCode(); + hash = hash * 23 + ValueType.GetHashCode(); + return hash; + } + } + + public override bool Equals(object? obj) + { + if (obj is null) return false; + if (obj is ClientClaimModel c) + { + return string.Equals(Type, c.Type, StringComparison.Ordinal) && + string.Equals(Value, c.Value, StringComparison.Ordinal) && + string.Equals(ValueType, c.ValueType, StringComparison.Ordinal); + } + + return false; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs new file mode 100644 index 000000000..d9522b574 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs @@ -0,0 +1,227 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ClientModel +{ + private IEnumerable? _allowedGrantTypes; + private IEnumerable? _apiScopes; + + public string ClientId { get; set; } + + public string ClientName { get; set; } + + public string Description { get; set; } + + public string ClientUri { get; set; } + + public string LogoUri { get; set; } + + public IEnumerable ClientSecrets { get; set; } + + public IEnumerable RedirectUris { get; set; } + + public IEnumerable PostLogoutRedirectUris { get; set; } + + public IEnumerable AllowedGrantTypes + { + get + { + if (_allowedGrantTypes is null) throw new Exception("Please set Client.GrantTypes"); + ValidateGrantTypes(_allowedGrantTypes); + return _allowedGrantTypes.Distinct(); + } + set + { + ValidateGrantTypes(value); + _allowedGrantTypes = value; + } + } + + public IEnumerable AllowedScopes + { + get => _apiScopes?.Distinct() ?? throw new Exception("Please set Client.AllowedScopes"); + set => _apiScopes = value; + } + + /// + /// Signing algorithm for identity token. If empty, will use the server default signing + /// + public IEnumerable? AllowedIdentityTokenSigningAlgorithms { get; set; } + + /// + /// Allows settings claims for the client (will be included in the access token) + /// + public ICollection? Claims { get; set; } + + /// + /// Gets or sets the allowed CORS origins for JavaScript clients. + /// + public ICollection? AllowedCorsOrigins { get; set; } + + /// + /// Gets or sets the custom properties for the client. + /// + public IDictionary Properties { get; set; } = new Dictionary(); + + /// + /// Specifies which external IdPs can be used with this client (if list is empty + /// all IdPs are allowed). Defaults to empty. + /// + public ICollection IdentityProviderRestrictions { get; set; } = new HashSet(); + + public bool RequireConsent { get; set; } + + public bool RequireClientSecret { get; set; } = true; + + public bool Enabled { get; set; } = true; + + public bool AllowRememberConsent { get; set; } = true; + + public bool RequirePkce { get; set; } = true; + + public bool AllowPlainTextPkce { get; set; } + + public bool RequireRequestObject { get; set; } + + public bool AllowAccessTokensViaBrowser { get; set; } + + public bool AllowOfflineAccess { get; set; } + + public bool AlwaysIncludeUserClaimsInIdToken { get; set; } + + public bool BackChannelLogoutSessionRequired { get; set; } = true; + + /// + /// Gets or sets a value indicating whether JWT access tokens should include an identifier. + /// + public bool IncludeJwtId { get; set; } = true; + + /// + /// Gets or sets a value indicating whether client claims should be always included + /// in the access tokens - or only for client credentials flow. Defaults to false + /// + public bool AlwaysSendClientClaims { get; set; } + + /// + /// Gets or sets a value indicating whether the local login is allowed for this client.Defaults to true. + /// + public bool EnableLocalLogin { get; set; } = true; + + /// + /// Gets or sets a value indicating whether the access token (and its claims) should + /// be updated on a refresh token request. Defaults to false. + /// + public bool UpdateAccessTokenClaimsOnRefresh { get; set; } + + /// + /// Lifetime of identity token in seconds (defaults to 300 seconds / 5 minutes) + /// + public int IdentityTokenLifetime { get; set; } = 300; + + /// + /// Lifetime of access token in seconds (defaults to 3600 seconds / 1 hour) + /// + public int AccessTokenLifetime { get; set; } = 3600; + + /// + /// Lifetime of authorization code in seconds (defaults to 300 seconds / 5 minutes) + /// + public int AuthorizationCodeLifetime { get; set; } = 300; + + /// + /// Maximum lifetime of a refresh token in seconds (defaults to 2592000 seconds / 30 days) + /// + public int AbsoluteRefreshTokenLifetime { get; set; } = 2592000; + + /// + /// Sliding lifetime of a refresh token in seconds (defaults to 1296000 seconds / 15 days) + /// + public int SlidingRefreshTokenLifetime { get; set; } = 1296000; + + /// + /// Lifetime of a user consent in seconds. Defaults to null (no expiration) + /// + public int? ConsentLifetime { get; set; } + + /// + /// The maximum duration (in seconds) since the last time the user authenticated. + /// + public int? UserSsoLifetime { get; set; } + + /// + /// Gets or sets the device code lifetime. + /// + public int DeviceCodeLifetime { get; set; } = 300; + + /// + /// Absolute: the refresh token will expire on a fixed point in time (specified by + /// the AbsoluteRefreshTokenLifetime) Sliding: when refreshing the token, the lifetime + /// of the refresh token will be renewed(by the amount specified in SlidingRefreshTokenLifetime). + /// he lifetime will not exceed AbsoluteRefreshTokenLifetime. + /// + public TokenExpiration RefreshTokenExpiration { get; set; } = TokenExpiration.Absolute; + + /// + /// ReUse:the refresh token handle will stay the same when refreshing tokens + /// OneTimeOnly:the refresh token handle will be updated when refreshing tokens + /// Default value OneTimeOnly + /// + public TokenUsage RefreshTokenUsage { get; set; } = TokenUsage.OneTimeOnly; + + public AccessTokenType AccessTokenType { get; set; } + + public string ProtocolType { get; set; } = "oidc"; + + public string? FrontChannelLogoutUri { get; set; } + + public bool FrontChannelLogoutSessionRequired { get; set; } = true; + + public string? BackChannelLogoutUri { get; set; } + + /// + /// Gets or sets a value to prefix it on client claim types. Defaults to client_. + /// + public string ClientClaimsPrefix { get; set; } = "client_"; + + /// + /// Gets or sets a salt value used in pair-wise subjectId generation for users of + /// this client. + /// + public string? PairWiseSubjectSalt { get; set; } + + /// + /// Gets or sets the type of the device flow user code. + /// + public string? UserCodeType { get; set; } + + public ClientModel(string clientId, string clientName, string description, string clientUri, string logoUri, IEnumerable redirectUris, IEnumerable postLogoutRedirectUris, IEnumerable allowedGrantTypes, IEnumerable allowedScopes) + { + ClientId = clientId; + ClientName = clientName; + Description = description; + ClientUri = clientUri; + LogoUri = logoUri; + RedirectUris = redirectUris; + PostLogoutRedirectUris = postLogoutRedirectUris; + AllowedGrantTypes = allowedGrantTypes; + AllowedScopes = allowedScopes; + } + + private static void ValidateGrantTypes(IEnumerable grantTypes) + { + if (grantTypes.Any(grantType => grantType.Contains(' '))) + throw new InvalidOperationException("Grant types cannot contain spaces"); + + if (grantTypes.Count() != 1) + { + foreach (var (value1, value2) in GrantType.DisallowGrantTypeCombinations) + { + if (grantTypes.Contains(value1, StringComparer.Ordinal) && grantTypes.Contains(value2, StringComparer.Ordinal)) + throw new InvalidOperationException($"Grant types list cannot contain both {value1} and {value2}"); + } + } + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs new file mode 100644 index 000000000..a8762ad57 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs @@ -0,0 +1,113 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +/// +/// Represents data needed for device flow. +/// +public class DeviceCodeModel +{ + /// + /// Gets or sets the creation time. + /// + /// + /// The creation time. + /// + public DateTime CreationTime { get; set; } + + /// + /// Gets or sets the lifetime. + /// + /// + /// The lifetime. + /// + public int Lifetime { get; set; } + + /// + /// Gets or sets the client identifier. + /// + /// + /// The client identifier. + /// + public string ClientId { get; set; } + + /// + /// Gets the description the user assigned to the device being authorized. + /// + /// + /// The description. + /// + public string Description { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is open identifier. + /// + /// + /// true if this instance is open identifier; otherwise, false. + /// + public bool IsOpenId { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is authorized. + /// + /// + /// true if this instance is authorized; otherwise, false. + /// + public bool IsAuthorized { get; set; } + + /// + /// Gets or sets the requested scopes. + /// + /// + /// The authorized scopes. + /// + public IEnumerable RequestedScopes { get; set; } + + /// + /// Gets or sets the authorized scopes. + /// + /// + /// The authorized scopes. + /// + public IEnumerable AuthorizedScopes { get; set; } + + /// + /// Gets or sets the subject. + /// + /// + /// The subject. + /// + public ClaimsPrincipal Subject { get; set; } + + /// + /// Gets or sets the session identifier. + /// + /// + /// The session identifier. + /// + public string SessionId { get; set; } + + public DeviceCodeModel( + DateTime creationTime, + int lifetime, + string clientId, + string description, + bool isOpenId, + bool isAuthorized, + IEnumerable requestedScopes, + IEnumerable authorizedScopes, + ClaimsPrincipal subject, string sessionId) + { + CreationTime = creationTime; + Lifetime = lifetime; + ClientId = clientId; + Description = description; + IsOpenId = isOpenId; + IsAuthorized = isAuthorized; + RequestedScopes = requestedScopes; + AuthorizedScopes = authorizedScopes; + Subject = subject; + SessionId = sessionId; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs new file mode 100644 index 000000000..5e74f68c7 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class GrantType +{ + public const string Implicit = "implicit"; + public const string Hybrid = "hybrid"; + public const string AuthorizationCode = "authorization_code"; + public const string ClientCredentials = "client_credentials"; + public const string ResourceOwnerPassword = "password"; + public const string DeviceFlow = "urn:ietf:params:oauth:grant-type:device_code"; + + public static List<(string, string)> DisallowGrantTypeCombinations = new() + { + (Implicit, AuthorizationCode), + (Implicit, Hybrid), + (AuthorizationCode, Hybrid), + }; +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs new file mode 100644 index 000000000..523a33b30 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs @@ -0,0 +1,48 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class IdentityResourceModel : ResourceModel +{ + public bool Required { get; set; } + + public bool Emphasize { get; set; } + + public override ICollection UserClaims { get; set; } + + public IdentityResourceModel() + { + } + + public IdentityResourceModel(string name, string displayName, ICollection userClaims) + { + Name = name; + DisplayName = displayName; + UserClaims = userClaims; + } + + public IdentityResourceModel(string name, ICollection userClaims) : this(name, name, userClaims) + { + } + + public IdentityResourceModel( + string name, + string displayName, + string? description, + bool enabled, + bool showInDiscoveryDocument, + bool required, + bool emphasize, + ICollection userClaims, + IDictionary properties) : this(name, displayName, userClaims) + { + Description = description; + Enabled = enabled; + ShowInDiscoveryDocument = showInDiscoveryDocument; + Required = required; + Emphasize = emphasize; + Properties = properties; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs new file mode 100644 index 000000000..b59ec207f --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +/// +/// Represents a filter used when accessing the persisted grants store. +/// Setting multiple properties is interpreted as a logical 'AND' to further filter the query. +/// At least one value must be supplied. +/// +public class PersistedGrantFilter +{ + /// + /// Subject id of the user. + /// + public string SubjectId { get; set; } + + /// + /// Session id used for the grant. + /// + public string SessionId { get; set; } + + /// + /// Client id the grant was issued to. + /// + public string ClientId { get; set; } + + /// + /// The type of grant. + /// + public string Type { get; set; } + + public PersistedGrantFilter( + string subjectId, + string sessionId, + string clientId, + string type) + { + SubjectId = subjectId; + SessionId = sessionId; + ClientId = clientId; + Type = type; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs new file mode 100644 index 000000000..8616114a4 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs @@ -0,0 +1,114 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +/// +/// A model for a persisted grant +/// +public class PersistedGrantModel +{ + /// + /// Gets or sets the key. + /// + /// + /// The key. + /// + public string Key { get; set; } + + /// + /// Gets the type. + /// + /// + /// The type. + /// + public string Type { get; set; } + + /// + /// Gets the subject identifier. + /// + /// + /// The subject identifier. + /// + public string SubjectId { get; set; } + + /// + /// Gets the session identifier. + /// + /// + /// The session identifier. + /// + public string SessionId { get; set; } + + /// + /// Gets the client identifier. + /// + /// + /// The client identifier. + /// + public string ClientId { get; set; } + + /// + /// Gets the description the user assigned to the device being authorized. + /// + /// + /// The description. + /// + public string Description { get; set; } + + /// + /// Gets or sets the creation time. + /// + /// + /// The creation time. + /// + public DateTime CreationTime { get; set; } + + /// + /// Gets or sets the expiration. + /// + /// + /// The expiration. + /// + public DateTime? Expiration { get; set; } + + /// + /// Gets or sets the consumed time. + /// + /// + /// The consumed time. + /// + public DateTime? ConsumedTime { get; set; } + + /// + /// Gets or sets the data. + /// + /// + /// The data. + /// + public string Data { get; set; } + + public PersistedGrantModel( + string key, + string type, + string subjectId, + string sessionId, + string clientId, + string description, + DateTime creationTime, + DateTime? expiration, + DateTime? consumedTime, + string data) + { + Key = key; + Type = type; + SubjectId = subjectId; + SessionId = sessionId; + ClientId = clientId; + Description = description; + CreationTime = creationTime; + Expiration = expiration; + ConsumedTime = consumedTime; + Data = data; + } +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs new file mode 100644 index 000000000..a9da1fd8d --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public abstract class ResourceModel +{ + public bool Enabled { get; set; } = true; + + public string Name { get; set; } = ""; + + public string DisplayName { get; set; } = ""; + + public string? Description { get; set; } + + public bool ShowInDiscoveryDocument { get; set; } = true; + + [DisallowNull] + public virtual ICollection UserClaims { get; set; } = new HashSet(); + + public IDictionary Properties { get; set; } = new Dictionary(); +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs new file mode 100644 index 000000000..44df9f5bf --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ResourcesModel +{ + /// + /// Gets or sets a value indicating whether [offline access]. + /// + public bool OfflineAccess { get; set; } + + public IEnumerable IdentityResources { get; set; } = new HashSet(); + + public IEnumerable ApiResources { get; set; } = new HashSet(); + + public IEnumerable ApiScopes { get; set; } = new HashSet(); + + public ResourcesModel() + { + } + + public ResourcesModel(ResourcesModel other) + : this(other.IdentityResources, other.ApiResources, other.ApiScopes) + { + OfflineAccess = other.OfflineAccess; + } + + public ResourcesModel(IEnumerable identityResources, IEnumerable apiResources, IEnumerable apiScopes) + { + if (identityResources?.Any() == true) + { + IdentityResources = new HashSet(identityResources.ToArray()); + } + if (apiResources?.Any() == true) + { + ApiResources = new HashSet(apiResources.ToArray()); + } + if (apiScopes?.Any() == true) + { + ApiScopes = new HashSet(apiScopes.ToArray()); + } + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs new file mode 100644 index 000000000..77406b319 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class SecretModel +{ + public string? Value { get; set; } + + public string? Description { get; set; } + + public DateTime? Expiration { get; set; } + + public string Type { get; set; } = "SharedSecret"; + + public SecretModel(string? value = null, string? description = null, DateTime? expiration = null) + { + Value = value; + Description = description; + Expiration = expiration; + } + + public override int GetHashCode() + { + return (17 * 23 + (Value?.GetHashCode() ?? 0)) * 23 + Type.GetHashCode(); + } + + public override bool Equals(object? obj) + { + if (obj is null) return false; + if (obj is SecretModel secret) + { + if (secret == this) return true; + return string.Equals(secret.Type, Type, StringComparison.Ordinal) && string.Equals(secret.Value, Value, StringComparison.Ordinal); + } + + return false; + } +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs new file mode 100644 index 000000000..e5b433234 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +global using System.ComponentModel; +global using System.Diagnostics.CodeAnalysis; +global using System.Reflection; +global using System.Security.Claims; diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj new file mode 100644 index 000000000..ed98caad6 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj @@ -0,0 +1,16 @@ + + + + net6.0 + enable + enable + + $(WarningsAsErrors);CS8600;CS8601;CS8602;CS8603;CS8604;CS8609;CS8610;CS8614;CS8616;CS8618;CS8619;CS8620;CS8622;CS8625 + + + + + + + + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs new file mode 100644 index 000000000..976845a60 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; + +public interface IClientStore +{ + /// + /// Finds a client by id + /// + /// The client id + /// The client + Task FindClientByIdAsync(string clientId); +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs new file mode 100644 index 000000000..4875f3ea4 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; + +/// +/// Interface for the device flow store +/// +public interface IDeviceFlowStore +{ + /// + /// Stores the device authorization request. + /// + /// The device code. + /// The user code. + /// The data. + /// + Task StoreDeviceAuthorizationAsync(string deviceCode, string userCode, DeviceCodeModel data); + + /// + /// Finds device authorization by user code. + /// + /// The user code. + /// + Task FindByUserCodeAsync(string userCode); + + /// + /// Finds device authorization by device code. + /// + /// The device code. + Task FindByDeviceCodeAsync(string deviceCode); + + /// + /// Updates device authorization, searching by user code. + /// + /// The user code. + /// The data. + Task UpdateByUserCodeAsync(string userCode, DeviceCodeModel data); + + /// + /// Removes the device authorization, searching by device code. + /// + /// The device code. + Task RemoveByDeviceCodeAsync(string deviceCode); +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs new file mode 100644 index 000000000..b08e71f14 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; + +/// +/// Interface for persisting any type of grant. +/// +public interface IPersistedGrantStore +{ + /// + /// Stores the grant. + /// + /// The grant. + /// + Task StoreAsync(PersistedGrantModel grant); + + /// + /// Gets the grant. + /// + /// The key. + /// + Task GetAsync(string key); + + /// + /// Gets all grants based on the filter. + /// + /// The filter. + /// + Task> GetAllAsync(PersistedGrantFilter filter); + + /// + /// Removes the grant by key. + /// + /// The key. + /// + Task RemoveAsync(string key); + + /// + /// Removes all grants based on the filter. + /// + /// The filter. + /// + Task RemoveAllAsync(PersistedGrantFilter filter); +} diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs new file mode 100644 index 000000000..45aebca13 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; + +public interface IResourceStore +{ + /// + /// Gets identity resources by scope name. + /// + /// + /// + Task> FindIdentityResourcesByScopeNameAsync(IEnumerable scopeNames); + + /// + /// Gets API scopes by scope name. + /// + /// + /// + Task> FindApiScopesByNameAsync(IEnumerable scopeNames); + + /// + /// Gets API resources by scope name. + /// + /// + /// + Task> FindApiResourcesByScopeNameAsync(IEnumerable scopeNames); + + /// + /// Gets API resources by API resource name. + /// + /// + /// + Task> FindApiResourcesByNameAsync(IEnumerable apiResourceNames); + + /// + /// Gets all resources. + /// + /// + Task GetAllResourcesAsync(); +} + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs new file mode 100644 index 000000000..c045e84b7 --- /dev/null +++ b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/GenderTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/GenderTypes.cs new file mode 100644 index 000000000..ec0e9eaf8 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/GenderTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; + +public enum GenderTypes +{ + Male = 1, + Female, +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/StaffTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/StaffTypes.cs new file mode 100644 index 000000000..457ae5ce5 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/StaffTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; + +public enum StaffTypes +{ + InternalStaff = 1, + ExternalStaff +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/SubjectTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/SubjectTypes.cs new file mode 100644 index 000000000..8a90e27f6 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/SubjectTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; + +public enum SubjectTypes +{ + User = 1, + Department, + Role, + Team, +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/TeamTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/TeamTypes.cs new file mode 100644 index 000000000..c43f66a69 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/TeamTypes.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; + +public enum TeamTypes +{ + Normal = 1 +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddUserModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddUserModel.cs new file mode 100644 index 000000000..6f1c3f63b --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddUserModel.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class AddUserModel +{ + public string Account { get; set; } + + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string? IdCard { get; set; } + + public string? CompanyName { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } + + public string? Password { get; set; } + + public GenderTypes Gender { get; set; } + + public AddUserModel() + { + Account = ""; + Name = ""; + } + + public AddUserModel(string account, string name) + { + Account = account; + Name = name; + } +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddressValueModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddressValueModel.cs new file mode 100644 index 000000000..895c96205 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddressValueModel.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class AddressValueModel +{ + public string Address { get; set; } + + public string? ProvinceCode { get; set; } + + public string? CityCode { get; set; } + + public string? DistrictCode { get; set; } + + public AddressValueModel() + { + Address = ""; + } + + public AddressValueModel(string address, string? provinceCode, string? cityCode, string? districtCode) + { + Address = address; + ProvinceCode = provinceCode; + CityCode = cityCode; + DistrictCode = districtCode; + } + + public override string ToString() + { + return Address; + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AppModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AppModel.cs new file mode 100644 index 000000000..506ed496f --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AppModel.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class AppModel +{ + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public string Identity { get; set; } = string.Empty; + + public string Tag { get; set; } = string.Empty; + + public int ProjectId { get; set; } + + public List Navs { get; set; } = new(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/CollectMenuModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/CollectMenuModel.cs new file mode 100644 index 000000000..3232af39d --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/CollectMenuModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class CollectMenuModel +{ + public Guid Value { get; set; } + + public string Text { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/DisableUserModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/DisableUserModel.cs new file mode 100644 index 000000000..87fc89dd1 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/DisableUserModel.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class DisableUserModel +{ + public string Account { get; set; } + + public DisableUserModel(string account) + { + Account = account; + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/MenuModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/MenuModel.cs new file mode 100644 index 000000000..4b68d3e55 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/MenuModel.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class MenuModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public string Code { get; set; } + + public string Icon { get; set; } + + public string Url { get; set; } + + public List Children { get; set; } = new(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/NavModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/NavModel.cs new file mode 100644 index 000000000..7002a0cb0 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/NavModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class NavModel +{ + public string Code { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public string Icon { get; set; } = string.Empty; + + public string Url { get; set; } = string.Empty; + + public List Children { get; set; } = new(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/ProjectModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/ProjectModel.cs new file mode 100644 index 000000000..b95470198 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/ProjectModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class ProjectModel +{ + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public string Identity { get; set; } = string.Empty; + + public List Apps { get; set; } = new(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/RoleModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/RoleModel.cs new file mode 100644 index 000000000..d2d57d3d7 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/RoleModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class RoleModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffDetailModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffDetailModel.cs new file mode 100644 index 000000000..61badfc5b --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffDetailModel.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class StaffDetailModel: StaffModel +{ + public List Roles { get; set; } + + public List Teams { get; set; } + + public DateTime CreationTime { get; set; } + + public DateTime ModificationTime { get; set; } +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffModel.cs new file mode 100644 index 000000000..b573d5b36 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffModel.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class StaffModel +{ + public Guid Id { get; set; } + + public Guid UserId { get; set; } + + public string Department { get; set; } = ""; + + public string Position { get; set; } = ""; + + public string JobNumber { get; set; } = ""; + + public StaffTypes StaffType { get; set; } + + public string Name { get; set; } = ""; + + public string DisplayName { get; set; } = ""; + + public string Avatar { get; set; } = ""; + + public string IdCard { get; set; } = ""; + + public string Account { get; set; } = ""; + + public string CompanyName { get; set; } = ""; + + public string PhoneNumber { get; set; } = ""; + + public string Email { get; set; } = ""; + + public AddressValueModel Address { get; set; } = new(); + + public GenderTypes Gender { get; set; } + + public StaffModel() + { + } + + public StaffModel( + Guid id, + Guid userId, + string department, + string position, + string jobNumber, + StaffTypes staffType, + string name, + string displayName, + string avatar, + string idCard, + string account, + string companyName, + string phoneNumber, + string email, + AddressValueModel address, + GenderTypes gender) + { + Id = id; + UserId = userId; + Department = department; + Position = position; + JobNumber = jobNumber; + StaffType = staffType; + Name = name; + DisplayName = displayName; + Avatar = avatar; + IdCard = idCard; + Account = account; + CompanyName = companyName; + PhoneNumber = phoneNumber; + Email = email; + Address = address; + Gender = gender; + } +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/SubjectModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/SubjectModel.cs new file mode 100644 index 000000000..2022f5026 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/SubjectModel.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class SubjectModel +{ + public Guid SubjectId { get; set; } + + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string? Avatar { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } + + public SubjectTypes SubjectType { get; set; } + + public SubjectModel() + { + Name = ""; + } + + public SubjectModel( + Guid subjectId, + string name, + string? displayName, + string? avatar, + string? phoneNumber, + string? email, + SubjectTypes subjectType) + { + SubjectId = subjectId; + Name = name; + DisplayName = displayName; + Avatar = avatar; + PhoneNumber = phoneNumber; + Email = email; + SubjectType = subjectType; + } +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamDetailModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamDetailModel.cs new file mode 100644 index 000000000..c597da186 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamDetailModel.cs @@ -0,0 +1,49 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class TeamDetailModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public string Avatar { get; set; } + + public string Description { get; set; } + + public TeamTypes TeamType { get; set; } + + public List Admins { get; set; } + + public List Members { get; set; } + + public TeamDetailModel() + { + Name = ""; + Avatar = ""; + Description = ""; + Admins = new(); + Members = new(); + } + + public TeamDetailModel( + Guid id, + string name, + string avatar, + string description, + TeamTypes teamType, + List admins, + List members) + { + Id = id; + Name = name; + Avatar = avatar; + Description = description; + TeamType = teamType; + Admins = admins; + Members = members; + } +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamModel.cs new file mode 100644 index 000000000..2c1baa747 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamModel.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class TeamModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public string Avatar { get; set; } + + public string Description { get; set; } + + public string Role { get; set; } + + public int MemberCount { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamPersonnelModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamPersonnelModel.cs new file mode 100644 index 000000000..7252d6891 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamPersonnelModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class TeamPersonnelModel +{ + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string Avatar { get; set; } + + public string Account { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs new file mode 100644 index 000000000..7098c3faa --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class UpdateUserBasicInfoModel +{ + public Guid Id { get; set; } + + public string DisplayName { get; set; } = ""; + + public string Avatar { get; set; } = ""; + + public string PhoneNumber { get; set; } = ""; + + public string Email { get; set; } = ""; + + public GenderTypes Gender { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserPasswordModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserPasswordModel.cs new file mode 100644 index 000000000..961b16d3f --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserPasswordModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class UpdateUserPasswordModel +{ + public Guid Id { get; set; } + + public string OldPassword { get; set; } = ""; + + public string NewPassword { get; set; } = ""; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpsertUserModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpsertUserModel.cs new file mode 100644 index 000000000..61fa33389 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpsertUserModel.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class UpsertUserModel +{ + public Guid Id { get; set; } + + public string Account { get; set; } + + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string? IdCard { get; set; } + + public string? CompanyName { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } + + public GenderTypes Gender { get; set; } + + public UpsertUserModel() + { + Account = ""; + Name = ""; + } + + public UpsertUserModel(string account, string name) + { + Account = account; + Name = name; + } +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserModel.cs new file mode 100644 index 000000000..876dcd34a --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserModel.cs @@ -0,0 +1,73 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class UserModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string Account { get; set; } + + public GenderTypes Gender { get; set; } + + public string Avatar { get; set; } + + public string? IdCard { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } + + public string? CompanyName { get; set; } + + public string? Department { get; set; } + + public string? Position { get; set; } + + public AddressValueModel Address { get; set; } = new(); + + public List Roles { get; set; } = new(); + + public UserModel() + { + Name = ""; + Avatar = ""; + Account = ""; + } + + public UserModel( + Guid id, + string name, + string? displayName, + string account, + GenderTypes gender, + string avatar, + string? idCard, + string? phoneNumber, + string? email, + string? companyName, + string? department, + string? position, + AddressValueModel address) + { + Id = id; + Name = name; + DisplayName = displayName; + Account = account; + Gender = gender; + Avatar = avatar; + IdCard = idCard; + PhoneNumber = phoneNumber; + Email = email; + CompanyName = companyName; + Department = department; + Position = position; + Address = address; + } +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserPortraitModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserPortraitModel.cs new file mode 100644 index 000000000..e64f32d29 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserPortraitModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class UserPortraitModel +{ + public Guid Id { get; set; } + + public string Account { get; set; } + + public string Name { get; set; } + + public string DisplayName { get; set; } + + public string Avatar { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserSimpleModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserSimpleModel.cs new file mode 100644 index 000000000..001d9b286 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserSimpleModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class UserSimpleModel +{ + public Guid Id { get; set; } + + public string Account { get; set; } + + public string? DisplayName { get; set; } + + public UserSimpleModel(Guid id, string account, string? displayName) + { + Id = id; + Account = account; + DisplayName = displayName; + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserVisitedModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserVisitedModel.cs new file mode 100644 index 000000000..11d071dcd --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserVisitedModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; + +public class UserVisitedModel +{ + public string Name { get; set; } = string.Empty; + + public string Url { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/_Imports.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/_Imports.cs new file mode 100644 index 000000000..979a758f6 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IAuthClient.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IAuthClient.cs new file mode 100644 index 000000000..16b068758 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IAuthClient.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth; + +public interface IAuthClient +{ + IUserService UserService { get; } + + ISubjectService SubjectService { get; } + + ITeamService TeamService { get; } + + IPermissionService PermissionService { get; } + + IProjectService ProjectService { get; } +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IEnvironmentProvider.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IEnvironmentProvider.cs new file mode 100644 index 000000000..63df11e54 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IEnvironmentProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth; + +public interface IEnvironmentProvider +{ + string GetEnvironment(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Masa.BuildingBlocks.BasicAbility.Auth.csproj b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Masa.BuildingBlocks.BasicAbility.Auth.csproj new file mode 100644 index 000000000..4dbfe1f9b --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Masa.BuildingBlocks.BasicAbility.Auth.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IPermissionService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IPermissionService.cs new file mode 100644 index 000000000..fd189b571 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IPermissionService.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; + +public interface IPermissionService +{ + /// + /// Get menus for the appid with current user + /// + /// + /// + Task> GetMenusAsync(string appId); + + /// + /// Get element permissions for the appid with current user + /// + /// + /// + Task> GetElementPermissionsAsync(string appId); + + Task AuthorizedAsync(string appId, string code); + + Task AddFavoriteMenuAsync(Guid menuId); + + Task RemoveFavoriteMenuAsync(Guid menuId); + + Task> GetFavoriteMenuListAsync(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IProjectService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IProjectService.cs new file mode 100644 index 000000000..bcff62566 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IProjectService.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; + +public interface IProjectService +{ + Task> GetGlobalNavigations(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ISubjectService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ISubjectService.cs new file mode 100644 index 000000000..926494f8f --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ISubjectService.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; + +public interface ISubjectService +{ + Task> GetListAsync(string filter); +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ITeamService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ITeamService.cs new file mode 100644 index 000000000..cdf9d8a2c --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ITeamService.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; + +public interface ITeamService +{ + Task GetDetailAsync(Guid id); + + Task> GetAllAsync(); + + Task> GetUserTeamsAsync(); +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IUserService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IUserService.cs new file mode 100644 index 000000000..6673d6c38 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IUserService.cs @@ -0,0 +1,52 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; + +public interface IUserService +{ + Task> GetListByTeamAsync(Guid teamId); + + Task> GetListByRoleAsync(Guid roleId); + + Task> GetListByDepartmentAsync(Guid departmentId); + + Task GetTotalByDepartmentAsync(Guid departmentId); + + Task GetTotalByRoleAsync(Guid roleId); + + Task GetTotalByTeamAsync(Guid teamId); + + Task AddAsync(AddUserModel user); + + Task UpsertAsync(UpsertUserModel user); + + Task ValidateCredentialsByAccountAsync(string account, string password, bool isLdap = false); + + Task FindByAccountAsync(string account); + + Task FindByPhoneNumberAsync(string phoneNumber); + + Task FindByEmailAsync(string email); + + Task GetCurrentUserAsync(); + + Task GetCurrentStaffAsync(); + + Task VisitedAsync(string url); + + Task> GetVisitedListAsync(); + + Task UpdatePasswordAsync(UpdateUserPasswordModel user); + + Task UpdateBasicInfoAsync(UpdateUserBasicInfoModel user); + + Task> GetUserPortraitsAsync(params Guid[] userIds); + + Task SaveUserSystemDataAsync(string systemId, T data); + + Task GetUserSystemDataAsync(string systemId); + + Task DisableUserAsync(DisableUserModel user); +} + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/_Imports.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/_Imports.cs new file mode 100644 index 000000000..80a883fd5 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +global using Masa.BuildingBlocks.BasicAbility.Auth.Service; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/IDccClient.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/IDccClient.cs new file mode 100644 index 000000000..052a858ed --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/IDccClient.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Dcc; + +public interface IDccClient +{ + public ILabelService LabelService { get; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Masa.BuildingBlocks.BasicAbility.Dcc.csproj b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Masa.BuildingBlocks.BasicAbility.Dcc.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Masa.BuildingBlocks.BasicAbility.Dcc.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Model/LabelModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Model/LabelModel.cs new file mode 100644 index 000000000..e6de7cccd --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Model/LabelModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Dcc.Model +{ + public class LabelModel + { + public int Id { get; set; } + + public string Code { get; set; } = ""; + + public string Name { get; set; } = ""; + + public string TypeCode { get; set; } = ""; + + public string TypeName { get; set; } = ""; + + public string Description { get; set; } = ""; + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Service/ILabelService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Service/ILabelService.cs new file mode 100644 index 000000000..f00dc6f74 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Service/ILabelService.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Dcc.Service; + +public interface ILabelService +{ + Task> GetListByTypeCodeAsync(string typeCode); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/_Imports.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/_Imports.cs new file mode 100644 index 000000000..8b71ee7c2 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.BasicAbility.Dcc.Model; +global using Masa.BuildingBlocks.BasicAbility.Dcc.Service; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ChannelTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ChannelTypes.cs new file mode 100644 index 000000000..37250a18d --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ChannelTypes.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum ChannelTypes +{ + Sms = 1, + Email, + WebsiteMessage +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskReceiverTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskReceiverTypes.cs new file mode 100644 index 000000000..b6d160de0 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskReceiverTypes.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum MessageTaskReceiverTypes +{ + User = 1, + Organization, + Role, + Team, + Group +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSelectReceiverTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSelectReceiverTypes.cs new file mode 100644 index 000000000..ad68fda1f --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSelectReceiverTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum MessageTaskSelectReceiverTypes +{ + ManualSelection = 1, + BatchUpload +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSources.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSources.cs new file mode 100644 index 000000000..6f59b9f95 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSources.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum MessageTaskSources +{ + Management = 1, + Sdk, +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskStatuses.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskStatuses.cs new file mode 100644 index 000000000..8e0b61fe2 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskStatuses.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum MessageTaskStatuses +{ + NotPublished = 1, + InProgress, + Cancel, + Published, + PublishedFailed, + PartialFailed +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateAuditStatuses.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateAuditStatuses.cs new file mode 100644 index 000000000..d077546cd --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateAuditStatuses.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum MessageTemplateAuditStatuses +{ + Waited = 1, + Approved, + Failed, +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateStates.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateStates.cs new file mode 100644 index 000000000..d429a2680 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateStates.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum MessageTemplateStates +{ + Normal = 1, + Invalid +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTypes.cs new file mode 100644 index 000000000..42b23fcaf --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum MessageTypes +{ + Ordinary = 1, + Template +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ReceiverGroupItemTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ReceiverGroupItemTypes.cs new file mode 100644 index 000000000..ab19ef852 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ReceiverGroupItemTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum ReceiverGroupItemTypes +{ + User = 1, + Organization, + Role, + Team +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/SendTargets.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/SendTargets.cs new file mode 100644 index 000000000..82ce91beb --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/SendTargets.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum SendTargets +{ + Assign = 1, + Broadcast +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/WebsiteMessageFilterType.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/WebsiteMessageFilterType.cs new file mode 100644 index 000000000..2385f0287 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/WebsiteMessageFilterType.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; + +public enum WebsiteMessageFilterType +{ + Title = 1, + Content, +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/IMcClient.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/IMcClient.cs new file mode 100644 index 000000000..a7067b540 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/IMcClient.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc; + +public interface IMcClient +{ + IChannelService ChannelService { get; } + + IMessageTaskService MessageTaskService { get; } + + IMessageTemplateService MessageTemplateService { get; } + + IReceiverGroupService ReceiverGroupService { get; } + + IWebsiteMessageService WebsiteMessageService { get; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs new file mode 100644 index 000000000..b8ff3d9be --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System.Collections.Concurrent; + +[Serializable] +public class ExtraPropertyDictionary : ConcurrentDictionary +{ + public ExtraPropertyDictionary() + { + + } + + public ExtraPropertyDictionary(IDictionary dictionary) + : base(dictionary) + { + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Masa.BuildingBlocks.BasicAbility.Mc.csproj b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Masa.BuildingBlocks.BasicAbility.Mc.csproj new file mode 100644 index 000000000..5f01c06c5 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Masa.BuildingBlocks.BasicAbility.Mc.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/AuditEntityModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/AuditEntityModel.cs new file mode 100644 index 000000000..5fe684bd1 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/AuditEntityModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class AuditEntityModel : EntityModel +{ + public TUserId Creator { get; set; } = default!; + + public DateTime CreationTime { get; set; } + + public TUserId Modifier { get; set; } = default!; + + public DateTime ModificationTime { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ChannelModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ChannelModel.cs new file mode 100644 index 000000000..404bbb78c --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ChannelModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class ChannelModel : AuditEntityModel +{ + public string DisplayName { get; set; } = string.Empty; + + public string Code { get; set; } = string.Empty; + + public ChannelTypes Type { get; set; } + + public string Description { get; set; } = string.Empty; + + public string Color { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/EntityModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/EntityModel.cs new file mode 100644 index 000000000..2cab60770 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/EntityModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class EntityModel +{ + public TKey Id { get; set; } = default!; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetChannelModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetChannelModel.cs new file mode 100644 index 000000000..1408ff65c --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetChannelModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class GetChannelModel : PaginatedOptions +{ + public string Filter { get; set; } = string.Empty; + + public ChannelTypes? Type { get; set; } + + public string DisplayName { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetMessageTemplateModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetMessageTemplateModel.cs new file mode 100644 index 000000000..7608abc9d --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetMessageTemplateModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class GetMessageTemplateModel : PaginatedOptions +{ + public string Filter { get; set; } = string.Empty; + + public MessageTemplateStates? Status { get; set; } + + public MessageTemplateAuditStatuses? AuditStatus { get; set; } + + public ChannelTypes? ChannelType { get; set; } + + public Guid? ChannelId { get; set; } + + public DateTime? StartTime { get; set; } + + public DateTime? EndTime { get; set; } + + public int TemplateType { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetNoticeListModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetNoticeListModel.cs new file mode 100644 index 000000000..57c5d2559 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetNoticeListModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class GetNoticeListModel +{ + public int PageSize { get; set; } = 5; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetReceiverGroupModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetReceiverGroupModel.cs new file mode 100644 index 000000000..6da240669 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetReceiverGroupModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class GetReceiverGroupModel : PaginatedOptions +{ + public string Filter { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetWebsiteMessageModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetWebsiteMessageModel.cs new file mode 100644 index 000000000..8fc7d10f1 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetWebsiteMessageModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class GetWebsiteMessageModel : PaginatedOptionsModel +{ + public string Filter { get; set; } = string.Empty; + + public WebsiteMessageFilterType? FilterType { get; set; } + + public Guid? ChannelId { get; set; } + + public bool? IsRead { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoModel.cs new file mode 100644 index 000000000..48ad86259 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class MessageInfoModel +{ + public string Title { get; set; } = string.Empty; + + public string Content { get; set; } = string.Empty; + + public string Markdown { get; set; } = string.Empty; + + public bool IsJump { get; set; } + + public string JumpUrl { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoUpsertModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoUpsertModel.cs new file mode 100644 index 000000000..7dd1079b1 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoUpsertModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class MessageInfoUpsertModel +{ + public string Title { get; set; } = string.Empty; + + public string Content { get; set; } = string.Empty; + + public string Markdown { get; set; } = string.Empty; + + public bool IsJump { get; set; } + + public string JumpUrl { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskModel.cs new file mode 100644 index 000000000..3a06771d8 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskModel.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class MessageTaskModel : AuditEntityModel +{ + public string DisplayName { get; set; } = string.Empty; + + public Guid ChannelId { get; set; } + + public ChannelModel Channel { get; set; } = new(); + + public MessageTypes EntityType { get; set; } + + public Guid EntityId { get; set; } + + public bool IsDraft { get; set; } + + public bool IsEnabled { get; set; } + + public SendTargets ReceiverType { get; set; } + + public MessageTaskSelectReceiverTypes SelectReceiverType { get; set; } + + public DateTimeOffset? SendTime { get; set; } + + public string Sign { get; set; } = string.Empty; + + public MessageInfoModel MessageInfo { get; set; } = new(); + + public List Receivers { get; set; } = new(); + + public SendRuleModel SendRules { get; set; } = new(); + + public ExtraPropertyDictionary Variables { get; set; } = new(); + + public string Content { get; set; } = string.Empty; + + public MessageTaskStatuses Status { get; set; } + + public MessageTaskSources Source { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskReceiverModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskReceiverModel.cs new file mode 100644 index 000000000..2736ff385 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskReceiverModel.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class MessageTaskReceiverModel +{ + public Guid SubjectId { get; set; } + + public string DisplayName { get; set; } = string.Empty; + + public string Avatar { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public MessageTaskReceiverTypes Type { get; set; } + + public ExtraPropertyDictionary Variables { get; set; } = new(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateItemModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateItemModel.cs new file mode 100644 index 000000000..6f28d44e1 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateItemModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class MessageTemplateItemModel +{ + public string Code { get; set; } = string.Empty; + + public string MappingCode { get; set; } = string.Empty; + + public string DisplayText { get; set; } = string.Empty; + + public string Description { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateModel.cs new file mode 100644 index 000000000..8d3619020 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateModel.cs @@ -0,0 +1,50 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class MessageTemplateModel : AuditEntityModel +{ + public Guid ChannelId { get; set; } + + public string DisplayName { get; set; } = string.Empty; + + public string Title { get; set; } = string.Empty; + + public string Content { get; set; } = string.Empty; + + public string Markdown { get; set; } = string.Empty; + + public string TemplateId { get; set; } = string.Empty; + + public bool IsJump { get; set; } + + public string JumpUrl { get; set; } = string.Empty; + + public string Sign { get; set; } = string.Empty; + + public MessageTemplateStates Status { get; set; } + + public MessageTemplateAuditStatuses AuditStatus { get; set; } + + public DateTimeOffset? AuditTime { get; set; } + + public DateTimeOffset? InvalidTime { get; set; } + + public string AuditReason { get; set; } = string.Empty; + + public int TemplateType { get; set; } + + public string TemplateTypeDisplayName { get; set; } + + public long PerDayLimit { get; set; } + + public bool IsStatic { get; set; } + + public List Items { get; set; } + + public MessageTemplateModel() + { + this.Items = new List(); + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedListModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedListModel.cs new file mode 100644 index 000000000..20174f759 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedListModel.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class PaginatedListModel +{ + public long Total { get; set; } + + public int TotalPages { get; set; } + + public List Result { get; set; } = default!; + + public PaginatedListModel() + { + Result = new List(); + } + + public PaginatedListModel(long total, int totalPages, List result) + { + Total = total; + TotalPages = totalPages; + Result = result; + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedOptionsModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedOptionsModel.cs new file mode 100644 index 000000000..98dae85f1 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedOptionsModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class PaginatedOptionsModel +{ + public int Page { get; set; } = 1; + + public int PageSize { get; set; } = 10; + + public string Sorting { get; set; } + + public PaginatedOptionsModel(string sorting = "", int page = 1, int pageSize = 10) + { + Sorting = sorting; + Page = page; + PageSize = pageSize; + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadAllWebsiteMessageModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadAllWebsiteMessageModel.cs new file mode 100644 index 000000000..7b69863f9 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadAllWebsiteMessageModel.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class ReadAllWebsiteMessageModel : GetWebsiteMessageModel +{ +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadWebsiteMessageModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadWebsiteMessageModel.cs new file mode 100644 index 000000000..ed0c119cc --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadWebsiteMessageModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class ReadWebsiteMessageModel +{ + public Guid Id { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupItemModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupItemModel.cs new file mode 100644 index 000000000..987d1ccc8 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupItemModel.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class ReceiverGroupItemModel +{ + public Guid GroupId { get; set; } + + public ReceiverGroupItemTypes Type { get; set; } + + public Guid SubjectId { get; set; } + + public string DisplayName { get; set; } = string.Empty; + + public string Avatar { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupModel.cs new file mode 100644 index 000000000..8ad94e451 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class ReceiverGroupModel : AuditEntityModel +{ + public string DisplayName { get; set; } = string.Empty; + + public string Description { get; set; } = string.Empty; + + public List Items { get; set; } = new(); + + public string ModifierName { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendOrdinaryMessageModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendOrdinaryMessageModel.cs new file mode 100644 index 000000000..46c631ddb --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendOrdinaryMessageModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class SendOrdinaryMessageModel +{ + public string ChannelCode { get; set; } = string.Empty; + + public ChannelTypes? ChannelType { get; set; } + + public SendTargets ReceiverType { get; set; } + + public List Receivers { get; set; } = new(); + + public SendRuleModel SendRules { get; set; } = new(); + + public MessageInfoUpsertModel MessageInfo { get; set; } = new(); + + public ExtraPropertyDictionary Variables { get; set; } = new(); + + public Guid OperatorId { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendRuleModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendRuleModel.cs new file mode 100644 index 000000000..4108b7ff9 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendRuleModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class SendRuleModel +{ + public bool IsCustom { get; set; } + + public string CronExpression { get; set; } = string.Empty; + + public long SendingCount { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendTemplateMessageModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendTemplateMessageModel.cs new file mode 100644 index 000000000..13c927c5f --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendTemplateMessageModel.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class SendTemplateMessageModel +{ + public string ChannelCode { get; set; } = string.Empty; + + public ChannelTypes? ChannelType { get; set; } + + public string TemplateCode { get; set; } = string.Empty; + + public SendTargets ReceiverType { get; set; } + + public string Sign { get; set; } = string.Empty; + + public List Receivers { get; set; } = new(); + + public SendRuleModel SendRules { get; set; } = new(); + + public ExtraPropertyDictionary Variables { get; set; } = new(); + + public Guid OperatorId { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageChannelModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageChannelModel.cs new file mode 100644 index 000000000..5323807d7 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageChannelModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class WebsiteMessageChannelModel : WebsiteMessageModel +{ + public long NoReading { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageModel.cs new file mode 100644 index 000000000..365da1872 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageModel.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; + +public class WebsiteMessageModel : AuditEntityModel +{ + public Guid ChannelId { get; set; } + + public ChannelModel Channel { get; set; } = default!; + + public Guid UserId { get; set; } + + public string Title { get; set; } = string.Empty; + + public string Content { get; set; } = string.Empty; + + public string LinkUrl { get; set; } = string.Empty; + + public DateTimeOffset SendTime { get; set; } + + public bool IsRead { get; set; } + + public DateTimeOffset? ReadTime { get; set; } + + public string Abstract { get; set; } = string.Empty; + + public Guid PrevId { get; set; } + + public Guid NextId { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IChannelService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IChannelService.cs new file mode 100644 index 000000000..a696cfec1 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IChannelService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; + +public interface IChannelService +{ + Task GetAsync(Guid id); + + Task> GetListAsync(GetChannelModel options); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTaskService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTaskService.cs new file mode 100644 index 000000000..99390630d --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTaskService.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; + +public interface IMessageTaskService +{ + Task GetAsync(Guid id); + + Task SendTemplateMessageAsync(SendTemplateMessageModel options); + + Task SendOrdinaryMessageAsync(SendOrdinaryMessageModel options); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTemplateService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTemplateService.cs new file mode 100644 index 000000000..a96c9de0d --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTemplateService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; + +public interface IMessageTemplateService +{ + Task GetAsync(Guid id); + + Task> GetListAsync(GetMessageTemplateModel options); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IReceiverGroupService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IReceiverGroupService.cs new file mode 100644 index 000000000..f23ebfe32 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IReceiverGroupService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; + +public interface IReceiverGroupService +{ + Task GetAsync(Guid id); + + Task> GetListAsync(GetReceiverGroupModel inputDto); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IWebsiteMessageService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IWebsiteMessageService.cs new file mode 100644 index 000000000..f0bfef41a --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IWebsiteMessageService.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; + +public interface IWebsiteMessageService +{ + Task> GetListAsync(GetWebsiteMessageModel options); + + Task GetAsync(Guid id); + + Task> GetChannelListAsync(); + + Task SetAllReadAsync(ReadAllWebsiteMessageModel options); + + Task DeleteAsync(Guid id); + + Task ReadAsync(ReadWebsiteMessageModel options); + + Task CheckAsync(); + + Task> GetNoticeListAsync(GetNoticeListModel options); + + Task SendCheckNotificationAsync(); + + Task SendGetNotificationAsync(List userIds); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/_Imports.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/_Imports.cs new file mode 100644 index 000000000..69c7f3d4e --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.BasicAbility.Mc.Enum; +global using Masa.BuildingBlocks.BasicAbility.Mc.Model; +global using Masa.BuildingBlocks.BasicAbility.Mc.Service; +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; +global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/AppTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/AppTypes.cs new file mode 100644 index 000000000..3fd4cee9d --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/AppTypes.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Enum; + +public enum AppTypes +{ + [Description("Service")] + Service = 1, + + [Description("UI")] + UI, + + [Description("Job")] + Job +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/ServiceTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/ServiceTypes.cs new file mode 100644 index 000000000..0867e2fe8 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/ServiceTypes.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Enum; + +public enum ServiceTypes +{ + [Description("Dapr")] + Dapr = 1, + + [Description("Web Api")] + WebApi +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/IPmClient.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/IPmClient.cs new file mode 100644 index 000000000..37287260e --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/IPmClient.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm; + +public interface IPmClient +{ + public IEnvironmentService EnvironmentService { get; init; } + + public IClusterService ClusterService { get; init; } + + public IProjectService ProjectService { get; init; } + + public IAppService AppService { get; init; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Masa.BuildingBlocks.BasicAbility.Pm.csproj b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Masa.BuildingBlocks.BasicAbility.Pm.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Masa.BuildingBlocks.BasicAbility.Pm.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppDetailModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppDetailModel.cs new file mode 100644 index 000000000..5b769ec04 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppDetailModel.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class AppDetailModel : BaseModel +{ + public int ProjectId { get; set; } + + public int Id { get; set; } + + public string Name { get; set; } = ""; + + public string Identity { get; set; } = ""; + + public string Description { get; set; } = ""; + + public AppTypes Type { get; set; } + + public ServiceTypes ServiceType { get; set; } + + public string Url { get; set; } = ""; + + public string SwaggerUrl { get; set; } = ""; + + public List EnvironmentClusters { get; set; } = new(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppModel.cs new file mode 100644 index 000000000..21d98bfa8 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppModel.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class AppModel +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string Identity { get; set; } + + public int ProjectId { get; set; } + + public AppTypes Type { get; set; } + + public AppModel() + { + } + + public AppModel(int id, string name, string identity, int projectId) + { + Id = id; + Name = name; + Identity = identity; + ProjectId = projectId; + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/BaseModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/BaseModel.cs new file mode 100644 index 000000000..919ec48bc --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/BaseModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class BaseModel +{ + public Guid Creator { get; set; } + + public DateTime CreationTime { get; set; } + + public Guid Modifier { get; set; } + + public DateTime ModificationTime { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterDetailModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterDetailModel.cs new file mode 100644 index 000000000..bf2560aab --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterDetailModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class ClusterDetailModel : BaseModel +{ + public int Id { get; set; } + + public string Name { get; set; } = default!; + + public string Description { get; set; } = ""; + + public List EnvironmentIds { get; set; } = new(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterModel.cs new file mode 100644 index 000000000..33cc88537 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class ClusterModel +{ + public int Id { get; set; } + + public string Name { get; set; } = default!; + + public int EnvironmentClusterId { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentClusterModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentClusterModel.cs new file mode 100644 index 000000000..f24e3e1b0 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentClusterModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class EnvironmentClusterModel +{ + public int Id { get; set; } + + public string EnvironmentName { get; set; } = ""; + + public string EnvironmentColor { get; set; } = ""; + + public string ClusterName { get; set; } = ""; + + public string EnvironmentClusterName + { + get + { + return $"{EnvironmentName}/{ClusterName}"; + } + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentDetailModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentDetailModel.cs new file mode 100644 index 000000000..4482ba7bb --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentDetailModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class EnvironmentDetailModel : BaseModel +{ + public int Id { get; set; } + + public string Name { get; set; } = default!; + + public string Description { get; set; } = ""; + + public string Color { get; set; } = ""; + + public List ClusterIds { get; set; } = default!; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentModel.cs new file mode 100644 index 000000000..d620467c6 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class EnvironmentModel +{ + public int Id { get; set; } + + public string Name { get; set; } = ""; + + public string Color { get; set; } = ""; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectAppsModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectAppsModel.cs new file mode 100644 index 000000000..612467c68 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectAppsModel.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class ProjectAppsModel +{ + public int Id { get; set; } + + public string Identity { get; set; } + + public string Name { get; set; } + + public string LabelCode { get; set; } + + public Guid TeamId { get; set; } + + public List Apps { get; set; } = new(); + + public ProjectAppsModel(int id, string identity, string name, string labelCode, Guid teamId) + { + Id = id; + Identity = identity; + Name = name; + LabelCode = labelCode; + TeamId = teamId; + } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectDetailModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectDetailModel.cs new file mode 100644 index 000000000..b0095c6e5 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectDetailModel.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class ProjectDetailModel : BaseModel +{ + public int Id { get; set; } + + public string Identity { get; set; } = ""; + + public string LabelCode { get; set; } + + public string Name { get; set; } = ""; + + public string Description { get; set; } = ""; + + public Guid TeamId { get; set; } + + public List EnvironmentClusterIds { get; set; } = new List(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectModel.cs new file mode 100644 index 000000000..7a084c692 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class ProjectModel +{ + public int Id { get; set; } + + public string Identity { get; set; } = ""; + + public string Name { get; set; } = ""; + + public string Description { get; set; } = ""; + + public string LabelCode { get; set; } = ""; + + public string LabelName { get; set; } = ""; + + public Guid Modifier { get; set; } + + public DateTime ModificationTime { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectTypeModel.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectTypeModel.cs new file mode 100644 index 000000000..5fc2c8d9b --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectTypeModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; + +public class ProjectTypeModel +{ + public int Id { get; set; } + + public string Name { get; set; } = ""; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IAppService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IAppService.cs new file mode 100644 index 000000000..7e701914b --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IAppService.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Service; + +public interface IAppService +{ + Task> GetListAsync(); + + Task> GetListByProjectIdsAsync(List projectIds); + + Task GetWithEnvironmentClusterAsync(int Id); + + Task GetAsync(int Id); + + Task GetByIdentityAsync(string identity); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IClusterService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IClusterService.cs new file mode 100644 index 000000000..0ef028687 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IClusterService.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Service; + +public interface IClusterService +{ + Task> GetListAsync(); + + Task> GetListByEnvIdAsync(int envId); + + Task GetAsync(int Id); + + Task> GetEnvironmentClustersAsync(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IEnvironmentService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IEnvironmentService.cs new file mode 100644 index 000000000..1012be517 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IEnvironmentService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Service; + +public interface IEnvironmentService +{ + Task> GetListAsync(); + + Task GetAsync(int Id); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IProjectService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IProjectService.cs new file mode 100644 index 000000000..3bcbcae28 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IProjectService.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Pm.Service; + +public interface IProjectService +{ + Task> GetProjectAppsAsync(string envName); + + Task> GetListByEnvironmentClusterIdAsync(int envClusterId); + + Task> GetListByTeamIdsAsync(List teamIds); + + Task GetAsync(int id); + + Task GetByIdentityAsync(string identity); + + Task> GetProjectTypesAsync(); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/_Imports.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/_Imports.cs new file mode 100644 index 000000000..38feeda8f --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.BasicAbility.Pm.Enum; +global using Masa.BuildingBlocks.BasicAbility.Pm.Model; +global using Masa.BuildingBlocks.BasicAbility.Pm.Service; +global using System.ComponentModel; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpMethods.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpMethods.cs new file mode 100644 index 000000000..74ac7e427 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpMethods.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; + +public enum HttpMethods +{ + GET = 1, + POST, + HEAD, + PUT, + DELETE +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpVerifyTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpVerifyTypes.cs new file mode 100644 index 000000000..ddcb4c6b8 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpVerifyTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; + +public enum HttpVerifyTypes +{ + StatusCode200 = 1, + CustomStatusCode, + ContentContains, + ContentUnContains, +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/JobTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/JobTypes.cs new file mode 100644 index 000000000..3af93d261 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/JobTypes.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; + +public enum JobTypes +{ + JobApp = 1, + Http, + DaprServiceInvocation +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/RunTimeoutStrategyTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/RunTimeoutStrategyTypes.cs new file mode 100644 index 000000000..56fdbedfe --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/RunTimeoutStrategyTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; + +public enum RunTimeoutStrategyTypes +{ + RunFailedStrategy = 1, + IgnoreTimeout +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleBlockStrategyTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleBlockStrategyTypes.cs new file mode 100644 index 000000000..9a2b88f05 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleBlockStrategyTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; + +public enum ScheduleBlockStrategyTypes +{ + Serial = 1, + Parallel, + Discard, + Cover +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs new file mode 100644 index 000000000..455f19d3a --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; + +public enum ScheduleExpiredStrategyTypes +{ + ExecuteImmediately = 1, + AutoCompensation, + Ignore +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerClient.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerClient.cs new file mode 100644 index 000000000..c8518b74d --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerClient.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler; + +public interface ISchedulerClient +{ + ISchedulerJobService SchedulerJobService { get; } + + ISchedulerTaskService SchedulerTaskService { get; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerJob.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerJob.cs new file mode 100644 index 000000000..2aa73bb87 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerJob.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler; + +public interface ISchedulerJob +{ + Task BeforeExcuteAsync(JobContext context); + + Task ExcuteAsync(JobContext context); + + Task AfterExcuteAsync(JobContext context); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Masa.BuildingBlocks.BasicAbility.Scheduler.csproj b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Masa.BuildingBlocks.BasicAbility.Scheduler.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Masa.BuildingBlocks.BasicAbility.Scheduler.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/JobContext.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/JobContext.cs new file mode 100644 index 000000000..871f29bca --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/JobContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Model; + +public class JobContext +{ + public Guid JobId { get; set; } + + public Guid TaskId { get; set; } + + public DateTimeOffset ExecutionTime { get; set; } + + public string ExcuteClassName { get; set; } = string.Empty; + + public List ExcuteParameters { get; set; } = new(); + + public object? ExcuteResult { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobAppConfig.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobAppConfig.cs new file mode 100644 index 000000000..e5a63cbc2 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobAppConfig.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Model; + +public class SchedulerJobAppConfig +{ + public string JobAppIdentity { get; set; } = string.Empty; + + public string JobEntryAssembly { get; set; } = string.Empty; + + public string JobEntryClassName { get; set; } = string.Empty; + + public string JobParams { get; set; } = string.Empty; + + public string Version { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs new file mode 100644 index 000000000..d50584dd5 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Model; + +public class SchedulerJobDaprServiceInvocationConfig +{ + public string MethodName { get; set; } = string.Empty; + + public HttpMethods HttpMethod { get; set; } + + public string Data { get; set; } = string.Empty; + + public string DaprServiceIdentity { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobHttpConfig.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobHttpConfig.cs new file mode 100644 index 000000000..1b4577f17 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobHttpConfig.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Model; + +public class SchedulerJobHttpConfig +{ + public HttpMethods HttpMethod { get; set; } + + public string RequestUrl { get; set; } = string.Empty; + + public List> HttpParameters { get; set; } = new(); + + public List> HttpHeaders { get; set; } = new(); + + public string HttpBody { get; set; } = string.Empty; + + public HttpVerifyTypes HttpVerifyType { get; set; } + + public string VerifyContent { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/AddSchedulerJobRequest.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/AddSchedulerJobRequest.cs new file mode 100644 index 000000000..dd9d9a0f9 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/AddSchedulerJobRequest.cs @@ -0,0 +1,48 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; + +public class AddSchedulerJobRequest +{ + public string ProjectIdentity { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public bool IsAlertException { get; set; } + + public JobTypes JobType { get; set; } + + public Guid OperatorId { get; set; } + + public string CronExpression { get; set; } = string.Empty; + + public string Description { get; set; } = string.Empty; + + /// + /// Default Ignore + /// + public ScheduleExpiredStrategyTypes ScheduleExpiredStrategy { get; set; } = ScheduleExpiredStrategyTypes.Ignore; + + /// + /// Default Parallel + /// + public ScheduleBlockStrategyTypes ScheduleBlockStrategy { get; set; } = ScheduleBlockStrategyTypes.Serial; + + /// + /// Default IgnoreTimeout + /// + public RunTimeoutStrategyTypes RunTimeoutStrategy { get; set; } = RunTimeoutStrategyTypes.IgnoreTimeout; + + public int RunTimeoutSecond { get; set; } + + public int FailedRetryInterval { get; set; } + + public int FailedRetryCount { get; set; } + + public SchedulerJobAppConfig? JobAppConfig { get; set; } + + public SchedulerJobHttpConfig? HttpConfig { get; set; } + + public SchedulerJobDaprServiceInvocationConfig? DaprServiceInvocationConfig { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerJobRequest.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerJobRequest.cs new file mode 100644 index 000000000..ae6e6140a --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerJobRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; + +public class BaseSchedulerJobRequest +{ + public Guid JobId { get; set; } + + public Guid OperatorId { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerTaskRequest.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerTaskRequest.cs new file mode 100644 index 000000000..aa9b5843f --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerTaskRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; + +public class BaseSchedulerTaskRequest +{ + public Guid TaskId { get; set; } + + public Guid OperatorId { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/ChangeEnabledStatusRequest.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/ChangeEnabledStatusRequest.cs new file mode 100644 index 000000000..e0fa6c434 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/ChangeEnabledStatusRequest.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; + +public class ChangeEnabledStatusRequest : BaseSchedulerJobRequest +{ + public bool Enabled { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/StartSchedulerTaskRequest.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/StartSchedulerTaskRequest.cs new file mode 100644 index 000000000..01a3bbfd4 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/StartSchedulerTaskRequest.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; + +public class StartSchedulerTaskRequest : BaseSchedulerTaskRequest +{ + public bool IsManual { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerJobService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerJobService.cs new file mode 100644 index 000000000..e174e1e39 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerJobService.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Service; + +public interface ISchedulerJobService +{ + Task AddAsync(AddSchedulerJobRequest job); + + Task StartAsync(BaseSchedulerJobRequest request); + + Task RemoveAsync(BaseSchedulerJobRequest request); + + Task EnableAsync(BaseSchedulerJobRequest request); + + Task DisableAsync(BaseSchedulerJobRequest request); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerTaskService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerTaskService.cs new file mode 100644 index 000000000..d0af3ab77 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerTaskService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Service; + +public interface ISchedulerTaskService +{ + Task StopAsync(BaseSchedulerTaskRequest request); + + Task StartAsync(BaseSchedulerTaskRequest request); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/_Imports.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/_Imports.cs new file mode 100644 index 000000000..fadffca3b --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; +global using Masa.BuildingBlocks.BasicAbility.Scheduler.Model; +global using Masa.BuildingBlocks.BasicAbility.Scheduler.Request; +global using Masa.BuildingBlocks.BasicAbility.Scheduler.Service; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Enums/AggregationTypes.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Enums/AggregationTypes.cs new file mode 100644 index 000000000..9269bcc2c --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Enums/AggregationTypes.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Tsc.Enums; + +public enum AggregationTypes +{ + Count = 1, + Sum, + Avg +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/ITscClient.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/ITscClient.cs new file mode 100644 index 000000000..4ad5d45ff --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/ITscClient.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Tsc; + +public interface ITscClient +{ + public ILogService LogService { get; } + + public IMetricService MetricService { get; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Masa.BuildingBlocks.BasicAbility.Tsc.csproj b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Masa.BuildingBlocks.BasicAbility.Tsc.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Masa.BuildingBlocks.BasicAbility.Tsc.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/LableValuesRequest.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/LableValuesRequest.cs new file mode 100644 index 000000000..0153f513e --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/LableValuesRequest.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Tsc.Model; + +public class LableValuesRequest +{ + private string[] _match = new string[1]; + + /// + /// it for the parameter `match` whitch is IEnumerable + /// and in this case only support single mode,for example: + /// Match="up", last `Matches` result is (IEnumerable){"up"} + /// + [JsonIgnore] + public string Match { get { return _match[0]; } set { _match[0] = value; } } + + /// + /// for parameter transform + /// + [JsonPropertyName("match")] + public IEnumerable Matches { get { return _match; } } + + public DateTime Start { get; set; } + + public DateTime End { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/ValuesRequest.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/ValuesRequest.cs new file mode 100644 index 000000000..43b947f3c --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/ValuesRequest.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Tsc.Model; + +public class ValuesRequest +{ + public string Match { get; set; } + + /// + /// for parameter `match` child, for example + /// Match = "up", Lables=new string[]{ "instance=\"k8s-hz-001\"" }, last result is 'up{instance="k8s-hz-001"} for `Match`' + /// + [JsonIgnore] + public IEnumerable? Lables { get; set; } + + public DateTime Start { get; set; } + + public DateTime End { get; set; } +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/ILogService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/ILogService.cs new file mode 100644 index 000000000..ec1d0696d --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/ILogService.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Tsc.Service; + +public interface ILogService +{ + Task> GetFieldsAsync(); + + Task>> GetAggregationAsync(LogAggregationRequest query); + + Task GetLatestAsync(LogLatestRequest query); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/IMetricService.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/IMetricService.cs new file mode 100644 index 000000000..dd26284ec --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/IMetricService.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.BasicAbility.Tsc.Service; + +public interface IMetricService +{ + Task> GetNamesAsync(IEnumerable? match); + + Task>> GetLabelValuesAsync(LableValuesRequest query); + + Task GetValuesAsync(ValuesRequest query); +} diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/_Imports.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/_Imports.cs new file mode 100644 index 000000000..ac697ef51 --- /dev/null +++ b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.BasicAbility.Tsc.Enums; +global using Masa.BuildingBlocks.BasicAbility.Tsc.Model; +global using Masa.BuildingBlocks.BasicAbility.Tsc.Service; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs new file mode 100644 index 000000000..d6101ffdf --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public abstract class AbstractConfigurationRepository : IConfigurationRepository +{ + private readonly ILogger? _logger; + + private readonly List _listeners = new(); + + public abstract SectionTypes SectionType { get; } + + public AbstractConfigurationRepository(ILoggerFactory? loggerFactory = null) + => _logger = loggerFactory?.CreateLogger(); + + public abstract Properties Load(); + + public void AddChangeListener(IRepositoryChangeListener listener) + { + if (!_listeners.Contains(listener)) + _listeners.Add(listener); + } + + public void RemoveChangeListener(IRepositoryChangeListener listener) + => _listeners.Remove(listener); + + public void FireRepositoryChange(SectionTypes sectionType, Properties newProperties) + { + foreach (var listener in _listeners) + { + try + { + listener.OnRepositoryChange(sectionType, newProperties); + } + catch (Exception ex) + { + _logger?.LogError($"Failed to invoke repository change listener {listener.GetType()}", ex); + } + } + } +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs new file mode 100644 index 000000000..7860859ce --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; +public enum ConfigurationTypes +{ + Properties = 1, + Text, + Json, + Yaml, + Xml +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs new file mode 100644 index 000000000..7ef0d1bb8 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IConfigurationApi +{ + public IConfiguration Get(string appId); +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs new file mode 100644 index 000000000..349e61ab2 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; +public interface IConfigurationApiClient +{ + Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string configObject, Action? valueChanged = null); + + Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged = null); + + Task GetAsync(string configObject, Action? valueChanged = null); + + Task GetAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged = null); + + Task GetDynamicAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged = null); + + Task GetDynamicAsync(string key); +} + diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs new file mode 100644 index 000000000..9fa71028c --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IConfigurationApiManage +{ + /// + /// Initialize config object + /// + /// Environment name + /// Cluster name + /// App id + /// Config objects,Key:config object name,Value:config object content + /// + Task InitializeAsync(string environment, string cluster, string appId, Dictionary configObjects); + + Task UpdateAsync(string environment, string cluster, string appId, string configObject, object value); +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs new file mode 100644 index 000000000..ae74f6a32 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IConfigurationRepository +{ + SectionTypes SectionType { get; } + + Properties Load(); + + void AddChangeListener(IRepositoryChangeListener listener); + + void RemoveChangeListener(IRepositoryChangeListener listener); +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs new file mode 100644 index 000000000..3e96f0f72 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IMasaConfiguration +{ + public IConfiguration Local { get; } + + public IConfigurationApi ConfigurationApi { get; } +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs new file mode 100644 index 000000000..7a7f8ac50 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IMasaConfigurationBuilder : IConfigurationBuilder +{ + IServiceCollection Services { get; } + + IConfiguration Configuration { get; } + + void AddRepository(IConfigurationRepository configurationRepository); + + void AddRelations(params ConfigurationRelationOptions[] relationOptions); +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs new file mode 100644 index 000000000..ded04a54a --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IRepositoryChangeListener +{ + void OnRepositoryChange(SectionTypes sectionType, Properties newProperties); +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj new file mode 100644 index 000000000..e70c41401 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs new file mode 100644 index 000000000..d43243275 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration.Options; + +public class ConfigurationRelationOptions +{ + public SectionTypes SectionType { get; set; } + + public string? ParentSection { get; set; } + + public string? Section { get; set; } = default!; + + /// + /// Object type of mapping node relationship + /// + public Type ObjectType { get; set; } = default!; +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs new file mode 100644 index 000000000..9f7f641e6 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration.Options; + +/// +/// Automatic mapping relationship specification. +/// When ParentSection is Null or an empty string, the configuration will be mounted to the root node. +/// When Section is Null, the configuration will be mounted under the ParentSection node, and its node name is class name. +/// If Section is an empty string, it will be directly mounted under the ParentSection node +/// +public interface IMasaConfigurationOptions +{ + /// + /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType + /// + [JsonIgnore] + string? ParentSection { get; } + + /// + /// The section null means same as the class name, else load from the specify section + /// + [JsonIgnore] + string? Section { get; } + + [JsonIgnore] + SectionTypes SectionType { get; } +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs new file mode 100644 index 000000000..598f95251 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration.Options; +public abstract class MasaConfigurationOptions : IMasaConfigurationOptions +{ + /// + /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType + /// + [JsonIgnore] + public virtual string? ParentSection => null; + + /// + /// The section null means same as the class name, else load from the specify section + /// + [JsonIgnore] + public virtual string? Section => null; + + [JsonIgnore] + public abstract SectionTypes SectionType { get; } +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs new file mode 100644 index 000000000..088729dd1 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs @@ -0,0 +1,73 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public class Properties : IEquatable, IEquatable +{ + private readonly Dictionary _dict; + + public Properties() => _dict = new Dictionary(StringComparer.OrdinalIgnoreCase); + + public Properties(IDictionary? dictionary) => + _dict = dictionary == null + ? new Dictionary(StringComparer.OrdinalIgnoreCase) + : new Dictionary(dictionary, StringComparer.OrdinalIgnoreCase); + + public Properties(Properties source) => _dict = source._dict; + + public bool TryGetProperty(string key, [NotNullWhen(true)] out string? value) => _dict.TryGetValue(key, out value); + + public string? GetProperty(string key) + { + _dict.TryGetValue(key, out var result); + + return result; + } + + public ISet GetPropertyNames() => new HashSet(_dict.Keys); + + public override bool Equals(object? obj) + { + if (this is null ^ obj is null) return false; + + if (obj is Properties other) + { + return Equals(other); + } + else + { + return false; + } + } + + public bool Equals(Properties? newProperties) + { + if (newProperties == null) return false; + + return GetHashCode() == newProperties.GetHashCode(); + } + + public static bool operator ==(Properties? x, Properties? y) + { + if (x is null ^ y is null) return false; + + if (x is null) return true; + + return x.Equals(y); + } + + public static bool operator !=(Properties? x, Properties? y) + { + if (x is null ^ y is null) return false; + + if (x is null) return false; + + return !x.Equals(y); + } + + public override int GetHashCode() + { + return _dict.Select(key => key.Key + key.Value).Aggregate(0, (hashCode, next) => HashCode.Combine(hashCode, next)); + } +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs new file mode 100644 index 000000000..2a3086cf2 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public enum SectionTypes +{ + Local = 1, + ConfigurationApi +} diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs new file mode 100644 index 000000000..e06845834 --- /dev/null +++ b/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Configuration.Options; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using System.Diagnostics.CodeAnalysis; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs new file mode 100644 index 000000000..2e1a2aeba --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Contracts.DataFiltering; + +public interface IDataFilter +{ + IDisposable Enable() where TFilter : class; + + IDisposable Disable() where TFilter : class; + + bool IsEnabled() where TFilter : class; +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs new file mode 100644 index 000000000..b503daf17 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Contracts.DataFiltering; + +public interface ISoftDelete +{ + bool IsDeleted { get; } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj new file mode 100644 index 000000000..5a26be858 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs new file mode 100644 index 000000000..8c25e5522 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Contracts.Paginated; + +public class BasePaginatedList + where TEntity : class +{ + public long Total { get; set; } + + public int TotalPages { get; set; } + + public List Result { get; set; } = default!; +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs new file mode 100644 index 000000000..b6f0781ac --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.Extensions.DependencyInjection; +global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/IMapping.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/IMapping.cs new file mode 100644 index 000000000..709f99c16 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/IMapping.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Mapping; + +public interface IMapper +{ + TDestination Map(TSource source, MapOptions? options = null); + + TDestination Map(object source, MapOptions? options = null); + + TDestination Map(TSource source, TDestination destination, MapOptions? options = null); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Mapper.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Mapper.cs new file mode 100644 index 000000000..567292ca2 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Mapper.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Mapping; + +public sealed class Mapper +{ + public static Mapper? Instance { get; set; } + + private readonly IMapper _mapper; + + public Mapper(IServiceCollection services) => _mapper = services.BuildServiceProvider().GetRequiredService(); + + public TDestination Map(TSource source, MapOptions? options = null) + => _mapper.Map(source, options); + + public TDestination Map(object source, MapOptions? options = null) + => _mapper.Map(source, options); + + public TDestination Map(TSource source, TDestination destination, MapOptions? options = null) + => _mapper.Map(source, destination, options); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj new file mode 100644 index 000000000..a4d5434e8 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs new file mode 100644 index 000000000..d51a933dd --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Mapping.Options.Enum; + +/// +/// Mapping mode +/// Currently only shared mapping modes are supported +/// +public enum MapMode +{ + /// + /// Use global settings and update global settings (update nested mappings) + /// + Shared = 1, +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs new file mode 100644 index 000000000..958c9b8ad --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Mapping.Options; + +public class MapOptions +{ + public MapMode Mode { get; set; } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/_Imports.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/_Imports.cs new file mode 100644 index 000000000..f9edf00cf --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Mapping.Options; +global using Masa.BuildingBlocks.Data.Mapping.Options.Enum; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj new file mode 100644 index 000000000..12c5adf20 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs new file mode 100644 index 000000000..1a6e92ff3 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public static class ObjectExtensions +{ + private static Mapper? _mapper; + private static Mapper GetMapper() => _mapper ??= Mapper.Instance ?? throw new Exception("Please use MapperFactory to initialize Mapper"); + + public static TDestination Map(this TSource source, MapOptions? options = null) + => GetMapper().Map(source, options); + + public static TDestination Map(this object obj, MapOptions? options = null) + => GetMapper().Map(obj, options); + + public static TDestination Map(this TSource source, TDestination destination, MapOptions? options = null) + => GetMapper().Map(source, destination, options); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs new file mode 100644 index 000000000..e7ac38dcf --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Mapping; +global using Masa.BuildingBlocks.Data.Mapping.Options; diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs new file mode 100644 index 000000000..dd3593f96 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public enum CommitState +{ + /// + /// A transaction is opened and the data has changed + /// + UnCommited, + /// + /// The transaction is not opened or the data has not changed + /// + Commited +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs new file mode 100644 index 000000000..cc77bf386 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public enum EntityState +{ + UnChanged, + Changed +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs new file mode 100644 index 000000000..36ca7d1e8 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public interface ITransaction +{ + [JsonIgnore] + IUnitOfWork? UnitOfWork { get; set; } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs new file mode 100644 index 000000000..e8f37cd4d --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public interface IUnitOfWork : IDisposable, IAsyncDisposable +{ + IServiceProvider ServiceProvider { get; } + + DbTransaction Transaction { get; } + + /// + /// Whether the transaction has been opened + /// + bool TransactionHasBegun { get; } + + /// + /// Whether to use transaction + /// + bool UseTransaction { get; set; } + + /// + /// Disable transaction rollback after failure + /// + bool DisableRollbackOnFailure { get; set; } + + EntityState EntityState { get; set; } + + CommitState CommitState { get; set; } + + Task SaveChangesAsync(CancellationToken cancellationToken = default); + + Task CommitAsync(CancellationToken cancellationToken = default); + + Task RollbackAsync(CancellationToken cancellationToken = default); + + /// + /// Provides support for enqueuing aggregate root realm events + /// + /// + /// + Task AddDomainEventAsync(TDomainEvent @event) where TDomainEvent : class; +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs new file mode 100644 index 000000000..fe830ba5a --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public interface IUnitOfWorkAccessor +{ + /// + /// Only exists after the DbContext is confirmed to be created + /// + MasaDbContextConfigurationOptions? CurrentDbContextOptions { get; set; } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs new file mode 100644 index 000000000..79a3d2e25 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public interface IUnitOfWorkManager +{ + /// + /// Create new DbContext + /// We create DbContext with lazy loading enabled by default + /// + /// Deferred creation of DbContext, easy to specify tenant or environment by yourself, which is very effective for physical isolation + /// + IUnitOfWork CreateDbContext(bool lazyLoading = true); + + IUnitOfWork CreateDbContext(MasaDbContextConfigurationOptions dbContextOptions); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj new file mode 100644 index 000000000..876b59650 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs new file mode 100644 index 000000000..a376a67ba --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Options; +global using System.Data.Common; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs new file mode 100644 index 000000000..b50c3b680 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public abstract class BaseDbConnectionStringProvider : IDbConnectionStringProvider +{ + private readonly List? _dbContextOptionsList = null; + + public virtual List DbContextOptionsList => _dbContextOptionsList ?? GetDbContextOptionsList(); + + protected abstract List GetDbContextOptionsList(); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs new file mode 100644 index 000000000..a34bdd2f3 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public class DefaultConcurrencyStampProvider : IConcurrencyStampProvider +{ + public string GetRowVersion() => Guid.NewGuid().ToString(); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs new file mode 100644 index 000000000..37968eaff --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IConcurrencyStampProvider +{ + string GetRowVersion(); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs new file mode 100644 index 000000000..9d5647341 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IHasConcurrencyStamp +{ + string RowVersion { get; } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs new file mode 100644 index 000000000..7d78706b7 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +[AttributeUsage(AttributeTargets.Class)] +public class ConnectionStringNameAttribute : Attribute +{ + public string Name { get; set; } + + public ConnectionStringNameAttribute(string name) => Name = name; + + public static string GetConnStringName() => GetConnStringName(typeof(T)); + + public static string GetConnStringName(Type type) + { + var nameAttribute = type.GetTypeInfo().GetCustomAttribute(); + + if (nameAttribute == null) + return ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME; + + return !string.IsNullOrEmpty(nameAttribute.Name) ? nameAttribute.Name : type.FullName!; + } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs new file mode 100644 index 000000000..835b485c5 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public class ConnectionStrings : Dictionary +{ + public const string DEFAULT_SECTION = "ConnectionStrings"; + + public const string DEFAULT_CONNECTION_STRING_NAME = "DefaultConnection"; + + public string DefaultConnection + { + get => GetConnectionString(DEFAULT_CONNECTION_STRING_NAME); + set => this[DEFAULT_CONNECTION_STRING_NAME] = value; + } + + public ConnectionStrings() { } + + public ConnectionStrings(IEnumerable> connectionStrings) : base(connectionStrings) { } + + public string GetConnectionString(string name) + { + if (base.TryGetValue(name, out var connectionString)) + return connectionString; + + return string.Empty; + } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs new file mode 100644 index 000000000..40a1554fa --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public enum SequentialGuidType +{ + /// + /// The GUID should be sequential when formatted using the + /// Used by MySql and PostgreSql. + /// + SequentialAsString, + + /// + /// The GUID should be sequential when formatted using the + /// Used by Oracle. + /// + SequentialAsBinary, + + /// + /// The sequential portion of the GUID should be located at the end + /// of the Data4 block. + /// Used by SqlServer. + /// + SequentialAtEnd +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs new file mode 100644 index 000000000..e22189617 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public enum TimestampType +{ + Milliseconds = 1, + Seconds +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs new file mode 100644 index 000000000..2b55934d4 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IConnectionStringProvider +{ + /// + /// Get Database Connection Strings based on ConnectionName + /// + /// + /// + Task GetConnectionStringAsync(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME); + + /// + /// Get Database Connection Strings based on ConnectionName + /// + /// + /// + string GetConnectionString(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs new file mode 100644 index 000000000..23e8e483a --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IDbConnectionStringProvider +{ + List DbContextOptionsList { get; } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs new file mode 100644 index 000000000..64a1ed9d1 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IDistributedLock +{ + IDisposable? TryGet(string key, TimeSpan timeout = default); + + Task TryGetAsync(string key, TimeSpan timeout = default, CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs new file mode 100644 index 000000000..c3cac5b22 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IMasaDbContext : IDisposable, IAsyncDisposable +{ +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs new file mode 100644 index 000000000..0e6180fbf --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IGuidGenerator : IIdGenerator +{ +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs new file mode 100644 index 000000000..59e657e16 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IIdGenerator + where T : notnull + where TOut : notnull +{ + public TOut NewId(); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs new file mode 100644 index 000000000..cb0c52148 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface ISequentialGuidGenerator : IIdGenerator +{ + Guid Create(SequentialGuidType guidType); +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs new file mode 100644 index 000000000..3b04cb7b4 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface ISnowflakeGenerator : IIdGenerator +{ +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs new file mode 100644 index 000000000..ac34d991b --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public class IdGeneratorFactory +{ + private static IGuidGenerator? _guidGenerator; + public static IGuidGenerator GuidGenerator => _guidGenerator ?? throw new Exception($"Unsupported {nameof(GuidGenerator)}"); + + private static ISequentialGuidGenerator? _sequentialGuidGenerator; + public static ISequentialGuidGenerator SequentialGuidGenerator + => _sequentialGuidGenerator ?? throw new Exception($"Unsupported {nameof(SequentialGuidGenerator)}"); + + private static ISnowflakeGenerator? _snowflakeGenerator; + public static ISnowflakeGenerator SnowflakeGenerator + => _snowflakeGenerator ?? throw new Exception($"Unsupported {nameof(SnowflakeGenerator)}"); + + public static void SetGuidGenerator(IGuidGenerator guidGenerator) + { + ArgumentNullException.ThrowIfNull(guidGenerator, nameof(guidGenerator)); + _guidGenerator = guidGenerator; + } + + public static void SetSequentialGuidGenerator(ISequentialGuidGenerator sequentialGuidGenerator) + { + ArgumentNullException.ThrowIfNull(sequentialGuidGenerator, nameof(sequentialGuidGenerator)); + _sequentialGuidGenerator = sequentialGuidGenerator; + } + + public static void SetSnowflakeGenerator(ISnowflakeGenerator snowflakeGenerator) + { + ArgumentNullException.ThrowIfNull(snowflakeGenerator, nameof(snowflakeGenerator)); + _snowflakeGenerator = snowflakeGenerator; + } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj new file mode 100644 index 000000000..d54911de3 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs new file mode 100644 index 000000000..2bced1bca --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public class MasaDbConnectionOptions +{ + private static readonly List> _connectionStrings = new(); + public ConnectionStrings ConnectionStrings { get; set; } + + public MasaDbConnectionOptions() + { + ConnectionStrings = new ConnectionStrings(_connectionStrings); + } + + public void TryAddConnectionString(string name, string connectionString) + { + if (_connectionStrings.All(item => item.Key != name)) + _connectionStrings.Add(new KeyValuePair(name, connectionString)); + } +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs new file mode 100644 index 000000000..3e32d3e29 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Options; + +public class MasaDbContextConfigurationOptions +{ + public string ConnectionString { get; } + + public MasaDbContextConfigurationOptions(string connectionString) => ConnectionString = connectionString; +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs new file mode 100644 index 000000000..b0eb7ed86 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public readonly struct SequentialGuid +{ + +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs new file mode 100644 index 000000000..1e8ff2d9b --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public readonly struct Snowflake +{ + +} diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/_Imports.cs b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/_Imports.cs new file mode 100644 index 000000000..5096951d3 --- /dev/null +++ b/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Options; +global using System.Reflection; diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs new file mode 100644 index 000000000..48b1f709f --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public abstract class AggregateRoot : Entity, IAggregateRoot, IGenerateDomainEvents +{ + private readonly List _domainEvents = new(); + + public virtual void AddDomainEvent(IDomainEvent domainEvent) + { + _domainEvents.Add(domainEvent); + } + + public virtual void RemoveDomainEvent(IDomainEvent domainEvent) + { + _domainEvents.Remove(domainEvent); + } + + public virtual IEnumerable GetDomainEvents() + { + return _domainEvents; + } + + public void ClearDomainEvents() + { + _domainEvents.Clear(); + } + + public async Task PublishDomainEventsAsync(IDomainEventBus eventBus) + { + while (_domainEvents.Any()) + { + await eventBus.PublishAsync(_domainEvents.First()); + _domainEvents.RemoveAt(0); + } + } +} + +public abstract class AggregateRoot : Entity, IAggregateRoot, IGenerateDomainEvents +{ + private readonly List _domainEvents = new(); + + public AggregateRoot() : base() + { + } + + public AggregateRoot(TKey id) : base(id) + { + } + + public virtual void AddDomainEvent(IDomainEvent domainEvent) + { + _domainEvents.Add(domainEvent); + } + + public virtual void RemoveDomainEvent(IDomainEvent domainEvent) + { + _domainEvents.Remove(domainEvent); + } + + public virtual IEnumerable GetDomainEvents() + { + return _domainEvents; + } + + public void ClearDomainEvents() + { + _domainEvents.Clear(); + } + + public async Task PublishDomainEventsAsync(IDomainEventBus eventBus) + { + while (_domainEvents.Any()) + { + await eventBus.PublishAsync(_domainEvents.First()); + _domainEvents.RemoveAt(0); + } + } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs new file mode 100644 index 000000000..7730550e4 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; + +public abstract class AuditAggregateRoot : AggregateRoot, IAuditAggregateRoot +{ + public TUserId Creator { get; protected set; } = default!; + + public DateTime CreationTime { get; protected set; } + + public TUserId Modifier { get; protected set; } = default!; + + public DateTime ModificationTime { get; set; } + + public AuditAggregateRoot() => Initialize(); + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + this.ModificationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; +} + +public abstract class AuditAggregateRoot : AggregateRoot, IAuditAggregateRoot +{ + public TUserId Creator { get; protected set; } = default!; + + public DateTime CreationTime { get; protected set; } + + public TUserId Modifier { get; protected set; } = default!; + + public DateTime ModificationTime { get; protected set; } + + public AuditAggregateRoot() : base() + { + Initialize(); + } + + public AuditAggregateRoot(TKey id) : base(id) + { + Initialize(); + } + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + this.ModificationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs new file mode 100644 index 000000000..cee548d09 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; + +public abstract class AuditEntity : Entity, IAuditEntity +{ + public TUserId Creator { get; protected set; } = default!; + + public DateTime CreationTime { get; protected set; } + + public TUserId Modifier { get; protected set; } = default!; + + public DateTime ModificationTime { get; set; } + + public AuditEntity() => Initialize(); + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + this.ModificationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; +} + +public abstract class AuditEntity : Entity, IAuditEntity +{ + public TUserId Creator { get; protected set; } = default!; + + public DateTime CreationTime { get; protected set; } + + public TUserId Modifier { get; protected set; } = default!; + + public DateTime ModificationTime { get; protected set; } + + public AuditEntity() : base() + { + Initialize(); + } + + public AuditEntity(TKey id) : base(id) + { + Initialize(); + } + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + this.ModificationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs new file mode 100644 index 000000000..653f21d20 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; + +public interface IAuditAggregateRoot : IAuditEntity, IAggregateRoot +{ + +} + +public interface IAuditAggregateRoot : IAuditEntity, IAggregateRoot +{ + +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs new file mode 100644 index 000000000..af78ad9b6 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; + +public interface IAuditEntity : IEntity +{ + TUserId Creator { get; } + + DateTime CreationTime { get; } + + TUserId Modifier { get; } + + DateTime ModificationTime { get; } +} + +public interface IAuditEntity : IAuditEntity, IEntity +{ +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs new file mode 100644 index 000000000..125e7a35d --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs @@ -0,0 +1,78 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public abstract class Entity : IEntity, IEquatable, IEquatable +{ + public abstract IEnumerable<(string Name, object Value)> GetKeys(); + + /// + public override string ToString() + { + var keys = GetKeys().ToArray(); + string connector = keys.Length > 1 ? Environment.NewLine : string.Empty; + + return $"{GetType().Name}:{connector}{string.Join(Environment.NewLine, keys.Select(key => $"{key.Name}={key.Value}"))}"; + } + + public override bool Equals(object? obj) + { + if (this is null ^ obj is null) return false; + + if (obj is Entity other) + { + return other.GetKeys().Select(key => key.Value).SequenceEqual(GetKeys().Select(key => key.Value)); + } + else + { + return false; + } + } + + public bool Equals(Entity? other) + { + if (this is null ^ other is null) return false; + + return other!.GetKeys().Select(key => key.Value).SequenceEqual(GetKeys().Select(key => key.Value)); + } + + public override int GetHashCode() + { + return GetKeys().Select(key => key.Value).Aggregate(0, (hashCode, next) => HashCode.Combine(hashCode, next)); + } + + public static bool operator ==(Entity? x, Entity? y) + { + if (x is null ^ y is null) return false; + + if (x is null) return true; + + return x.Equals(y); + } + + public static bool operator !=(Entity? x, Entity? y) + { + if (x is null ^ y is null) return true; + + if (x is null) return false; + + return !x.Equals(y); + } +} + +public abstract class Entity : Entity, IEntity +{ + public TKey Id { get; protected set; } = default!; + + protected Entity() + { + } + + protected Entity(TKey id) : this() => Id = id; + + public override IEnumerable<(string Name, object Value)> GetKeys() + { + yield return ("Id", Id!); + } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs new file mode 100644 index 000000000..79b0b08bb --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; + +public abstract class FullAggregateRoot + : AuditAggregateRoot, IFullAggregateRoot +{ + public bool IsDeleted { get; protected set; } +} + +public abstract class FullAggregateRoot + : AuditAggregateRoot, IFullAggregateRoot +{ + public bool IsDeleted { get; protected set; } + + public FullAggregateRoot() : base() + { + } + + public FullAggregateRoot(TKey id) : base(id) + { + } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs new file mode 100644 index 000000000..86e51d88b --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; + +public abstract class FullEntity + : AuditEntity, IFullEntity +{ + public bool IsDeleted { get; protected set; } +} + +public abstract class FullEntity + : AuditEntity, IFullEntity +{ + public bool IsDeleted { get; protected set; } + + public FullEntity() : base() + { + } + + public FullEntity(TKey id) : base(id) + { + } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs new file mode 100644 index 000000000..2e2be7c5c --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; + +public interface IFullAggregateRoot : IFullEntity, IAuditAggregateRoot +{ + +} + +public interface IFullAggregateRoot : IFullEntity, IAuditAggregateRoot +{ + +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs new file mode 100644 index 000000000..fdcfa99bb --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; + +public interface IFullEntity : IAuditEntity, ISoftDelete +{ + +} + +public interface IFullEntity : IAuditEntity, ISoftDelete +{ + +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs new file mode 100644 index 000000000..bcb3af683 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public interface IAggregateRoot : IEntity +{ + +} + +public interface IAggregateRoot : IEntity, IAggregateRoot +{ + +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs new file mode 100644 index 000000000..2d497da0c --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public interface IEntity +{ + IEnumerable<(string Name, object Value)> GetKeys(); +} + +public interface IEntity : IEntity +{ + TKey Id { get; } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs new file mode 100644 index 000000000..d9cb031b2 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public interface IGenerateDomainEvents +{ + IEnumerable GetDomainEvents(); + + void ClearDomainEvents(); +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs new file mode 100644 index 000000000..4379070f7 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public abstract record DomainCommand : IDomainCommand +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + public DomainCommand() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public DomainCommand(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs new file mode 100644 index 000000000..403b43267 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public abstract record DomainEvent : IDomainEvent +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + public DomainEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public DomainEvent(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs new file mode 100644 index 000000000..577dc6a0b --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public abstract record DomainQuery : IDomainQuery + where TResult : notnull +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork + { + get => null; + set => throw new NotSupportedException(nameof(UnitOfWork)); + } + + public abstract TResult Result { get; set; } + + public DomainQuery() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public DomainQuery(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs new file mode 100644 index 000000000..30fb5801b --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IDomainCommand : ICommand, IDomainEvent +{ + +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs new file mode 100644 index 000000000..ef591fa07 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IDomainEvent : IEvent, ITransaction +{ + +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs new file mode 100644 index 000000000..f34878152 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IDomainEventBus : IEventBus +{ + Task Enqueue(TDomainEvent @event) + where TDomainEvent : IDomainEvent; + + Task PublishQueueAsync(); + + Task AnyQueueAsync(); +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs new file mode 100644 index 000000000..b265889fd --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IDomainQuery : IDomainEvent, IQuery + where TResult : notnull +{ + +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs new file mode 100644 index 000000000..3e5864c70 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IIntegrationDomainEvent : IDomainEvent, IIntegrationEvent +{ + +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs new file mode 100644 index 000000000..5222a9c10 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public abstract record IntegrationDomainEvent(Guid Id, DateTime CreationTime) : DomainEvent(Id, CreationTime), IIntegrationDomainEvent +{ + [JsonIgnore] + public abstract string Topic { get; set; } + + public IntegrationDomainEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj new file mode 100644 index 000000000..cb28a2af4 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj @@ -0,0 +1,16 @@ + + + + net6.0 + enable + enable + + + + + + + + + + diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs new file mode 100644 index 000000000..549704fc3 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs @@ -0,0 +1,163 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; + +public abstract class BaseRepository : + IRepository + where TEntity : class, IEntity +{ + public IServiceProvider ServiceProvider { get; } + + public virtual EntityState EntityState + { + get => UnitOfWork.EntityState; + set => UnitOfWork.EntityState = value; + } + + public virtual CommitState CommitState + { + get => UnitOfWork.CommitState; + protected set => UnitOfWork.CommitState = value; + } + + protected BaseRepository(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; + + public abstract IUnitOfWork UnitOfWork { get; } + + #region IRepository + + public abstract ValueTask AddAsync(TEntity entity, CancellationToken cancellationToken = default); + + public virtual async Task AddRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await AddAsync(entity, cancellationToken); + } + } + + public abstract Task FindAsync(IEnumerable> keyValues, CancellationToken cancellationToken = default); + + public abstract Task FindAsync(Expression> predicate, CancellationToken cancellationToken = default); + + public abstract Task RemoveAsync(TEntity entity, CancellationToken cancellationToken = default); + + public abstract Task RemoveAsync(Expression> predicate, CancellationToken cancellationToken = default); + + public virtual async Task RemoveRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await RemoveAsync(entity, cancellationToken); + } + } + + public abstract Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default); + + public virtual async Task UpdateRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await UpdateAsync(entity, cancellationToken); + } + } + + public abstract Task> GetListAsync(CancellationToken cancellationToken = default); + + public abstract Task> GetListAsync(string sortField, bool isDescending = true, CancellationToken cancellationToken = default); + + public abstract Task> GetListAsync(Expression> predicate, CancellationToken cancellationToken = default); + + public abstract Task> GetListAsync(Expression> predicate, string sortField, bool isDescending = true, CancellationToken cancellationToken = default); + + public abstract Task GetCountAsync(CancellationToken cancellationToken = default); + + public abstract Task GetCountAsync(Expression> predicate, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + public abstract Task> GetPaginatedListAsync(int skip, int take, string sortField, bool isDescending, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + public abstract Task> GetPaginatedListAsync(int skip, int take, Dictionary? sorting = null, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + public abstract Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, string sortField, + bool isDescending = true, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + public abstract Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, Dictionary? sorting = null, CancellationToken cancellationToken = default); + + public virtual async Task> GetPaginatedListAsync(PaginatedOptions options, CancellationToken cancellationToken = default) + { + var result = await GetPaginatedListAsync( + (options.Page - 1) * options.PageSize, + options.PageSize <= 0 ? int.MaxValue : options.PageSize, + options.Sorting, + cancellationToken + ); + + var total = await GetCountAsync(cancellationToken); + + return new PaginatedList() + { + Total = total, + Result = result, + TotalPages = (int)Math.Ceiling(total / (decimal)options.PageSize) + }; + } + + public async Task> GetPaginatedListAsync(Expression> predicate, PaginatedOptions options, CancellationToken cancellationToken = default) + { + var result = await GetPaginatedListAsync( + predicate, + (options.Page - 1) * options.PageSize, + options.PageSize <= 0 ? int.MaxValue : options.PageSize, + options.Sorting, + cancellationToken + ); + + var total = await GetCountAsync(predicate, cancellationToken); + + return new PaginatedList() + { + Total = total, + Result = result, + TotalPages = (int)Math.Ceiling(total / (decimal)options.PageSize) + }; + } + + #endregion +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs new file mode 100644 index 000000000..6867b9443 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs @@ -0,0 +1,132 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; + +public interface IRepository + where TEntity : class, IEntity +{ + IUnitOfWork UnitOfWork { get; } + + #region Add + + ValueTask AddAsync(TEntity entity, CancellationToken cancellationToken = default); + + Task AddRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default); + + #endregion + + #region Update + + Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default); + + Task UpdateRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default); + + #endregion + + #region Remove + + Task RemoveAsync(TEntity entity, CancellationToken cancellationToken = default); + + Task RemoveRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default); + + Task RemoveAsync(Expression> predicate, CancellationToken cancellationToken = default); + + #endregion + + #region Find + + Task FindAsync(IEnumerable> keyValues, CancellationToken cancellationToken = default); + + Task FindAsync(Expression> predicate, CancellationToken cancellationToken = default); + + #endregion + + #region Get + + Task> GetListAsync(CancellationToken cancellationToken = default); + + Task> GetListAsync(string sortField, bool isDescending = true, CancellationToken cancellationToken = default); + + Task> GetListAsync(Expression> predicate, CancellationToken cancellationToken = default); + + Task> GetListAsync(Expression> predicate, string sortField, bool isDescending = true, CancellationToken cancellationToken = default); + + Task GetCountAsync(CancellationToken cancellationToken = default); + + Task GetCountAsync(Expression> predicate, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + Task> GetPaginatedListAsync(int skip, int take, string sortField, bool isDescending = true, + CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + Task> GetPaginatedListAsync(int skip, int take, Dictionary? sorting = null, + CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, string sortField, + bool isDescending = true, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, + Dictionary? sorting = null, CancellationToken cancellationToken = default); + + Task> GetPaginatedListAsync(PaginatedOptions options, CancellationToken cancellationToken = default); + + Task> GetPaginatedListAsync(Expression> predicate, PaginatedOptions options, + CancellationToken cancellationToken = default); + + #endregion +} + +public interface IRepository : IRepository + where TEntity : class, IEntity + where TKey : IComparable +{ + #region Find + + Task FindAsync(TKey id, CancellationToken cancellationToken = default); + + #endregion + + #region Remove + + Task RemoveAsync(TKey id, CancellationToken cancellationToken = default); + + Task RemoveRangeAsync(IEnumerable ids, CancellationToken cancellationToken = default); + + #endregion +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs new file mode 100644 index 000000000..df089f229 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; + +public class PaginatedList : BasePaginatedList + where TEntity : class, IEntity +{ +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs new file mode 100644 index 000000000..90d921394 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; + +public class PaginatedOptions +{ + public int Page { get; set; } + + public int PageSize { get; set; } + + public Dictionary? Sorting { get; set; } + + public PaginatedOptions() + { + } + + public PaginatedOptions(int page, int pageSize, Dictionary? sorting = null) + { + Page = page; + PageSize = pageSize; + Sorting = sorting; + } + + /// + /// Initialize a new instance of PaginatedOptions. + /// + /// page number + /// returns per page + /// sort field name + /// true descending order, false ascending order, default: true + public PaginatedOptions(int page, int pageSize, string sortField, bool isDescending = true) + : this(page, pageSize, new Dictionary(new List> { new(sortField, isDescending) })) + { + } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs new file mode 100644 index 000000000..3fa9753c9 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs @@ -0,0 +1,72 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.SeedWork; + +/// +/// Reference from https://docs.microsoft.com/zh-cn/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types +/// +public abstract class Enumeration : IComparable +{ + public string Name { get; private set; } + + public int Id { get; private set; } + + protected Enumeration(int id, string name) => (Id, Name) = (id, name); + + public override string ToString() => Name; + + public static IEnumerable GetAll() + where T : Enumeration + { + return typeof(T).GetFields(BindingFlags.Public | + BindingFlags.Static | + BindingFlags.DeclaredOnly) + .Select(f => f.GetValue(null)) + .Cast(); + } + + public override bool Equals(object? obj) + { + if (obj is not Enumeration otherValue) + { + return false; + } + + if (this is null ^ obj is null) return false; + + var typeMatches = GetType().Equals(obj!.GetType()); + var valueMatches = Id.Equals(otherValue.Id); + + return typeMatches && valueMatches; + } + + public override int GetHashCode() => Id.GetHashCode(); + + public static int AbsoluteDifference(Enumeration firstValue, Enumeration secondValue) + { + return Math.Abs(firstValue.Id - secondValue.Id); + } + + public static T FromValue(int value) where T : Enumeration + { + return Parse(value, "value", item => item.Id == value); + } + + public static T FromDisplayName(string displayName) where T : Enumeration + { + return Parse(displayName, "display name", item => item.Name == displayName); + } + + private static T Parse(K value, string description, Func predicate) where T : Enumeration + { + var matchingItem = GetAll().FirstOrDefault(predicate); + + if (matchingItem == null) + throw new InvalidOperationException($"'{value}' is not a valid {description} in {typeof(T)}"); + + return matchingItem; + } + + public int CompareTo(object? other) => Id.CompareTo(((Enumeration?)other)?.Id); +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs new file mode 100644 index 000000000..cbb9b30e9 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Services; + +public interface IDomainService +{ + IDomainEventBus EventBus { get; } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs new file mode 100644 index 000000000..c494285c8 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Specifications; + +public abstract class BaseSpecification : ISpecification +{ + public BaseSpecification(Expression> whereExpression) + { + WhereExpression = whereExpression; + } + public Expression> WhereExpression { get; } + + public List>> Includes { get; } = + new List>>(); + + public List IncludeStrings { get; } = new List(); + + public abstract bool IsSatisfiedBy(T obj); + + protected virtual void AddInclude(Expression> includeExpression) + { + Includes.Add(includeExpression); + } + + protected virtual void AddInclude(string includeString) + { + IncludeStrings.Add(includeString); + } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs new file mode 100644 index 000000000..34b14a8dd --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Specifications; + +/// +/// Reference from +/// https://docs.microsoft.com/zh-cn/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/infrastructure-persistence-layer-implementation-entity-framework-core +/// https://martinfowler.com/apsupp/spec.pdf +/// +public interface ISpecification +{ + bool IsSatisfiedBy(T obj); + + Expression> WhereExpression { get; } + + List>> Includes { get; } + + List IncludeStrings { get; } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs new file mode 100644 index 000000000..35bd261a2 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Values; + +public abstract class ValueObject +{ + protected abstract IEnumerable GetEqualityValues(); + + public override bool Equals(object? obj) + { + if (this is null ^ obj is null) return false; + + if (obj is ValueObject entity) + { + return entity.GetEqualityValues().SequenceEqual(GetEqualityValues()); + } + else + { + return false; + } + } + + public override int GetHashCode() + { + return GetEqualityValues().Aggregate(0, (hashCode, next) => HashCode.Combine(hashCode, next)); + } + + public static bool operator ==(ValueObject x, ValueObject y) + { + return x.Equals(y); + } + + public static bool operator !=(ValueObject x, ValueObject y) + { + return !x.Equals(y); + } +} diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs new file mode 100644 index 000000000..dac97ea04 --- /dev/null +++ b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; +global using Masa.BuildingBlocks.Data.Contracts.Paginated; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; +global using Masa.BuildingBlocks.Ddd.Domain.Events; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; +global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; +global using System.Linq.Expressions; +global using System.Reflection; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs new file mode 100644 index 000000000..d559be44d --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public abstract record Event : IEvent +{ + private Guid _eventId; + private DateTime _creationTime; + + public Event() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public Event(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs new file mode 100644 index 000000000..964e9c59e --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IDispatcherOptions +{ + IServiceCollection Services { get; } + + Assembly[] Assemblies { get; } +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs new file mode 100644 index 000000000..f3893912d --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IEvent +{ + Guid GetEventId(); + + void SetEventId(Guid eventId); + + DateTime GetCreationTime(); + + void SetCreationTime(DateTime creationTime); +} + +public interface IEvent : IEvent + where TResult : notnull +{ + TResult Result { get; set; } +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs new file mode 100644 index 000000000..da39dd140 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IEventBus +{ + Task PublishAsync(TEvent @event) + where TEvent : IEvent; + + IEnumerable GetAllEventTypes(); + + Task CommitAsync(CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs new file mode 100644 index 000000000..820cb2504 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IEventBusBuilder +{ + public IServiceCollection Services { get; } + + IEventBusBuilder UseMiddleware(Type middleware, ServiceLifetime middlewareLifetime = ServiceLifetime.Transient); +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs new file mode 100644 index 000000000..0039bc86e --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IEventHandler + where TEvent : IEvent +{ + Task HandleAsync(TEvent @event); +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs new file mode 100644 index 000000000..5e9eae264 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public delegate Task EventHandlerDelegate(); + +/// +/// Middleware is assembled into an event pipeline to handle invoke event and result +/// +public interface IMiddleware + where TEvent : IEvent +{ + Task HandleAsync(TEvent @event, EventHandlerDelegate next); + + /// + /// If Recursive is not supported, the current Middleware only executes once + /// If Recursive is supported, Middleware will be executed everytime when EventBus is nested + /// + bool SupportRecursive { get; } +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs new file mode 100644 index 000000000..be470b149 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface ISagaEventHandler : IEventHandler + where TEvent : IEvent +{ + Task CancelAsync(TEvent @event); +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj new file mode 100644 index 000000000..5a26be858 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs new file mode 100644 index 000000000..db37200da --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public abstract class Middleware : IMiddleware where TEvent : IEvent +{ + public virtual bool SupportRecursive => true; + + public abstract Task HandleAsync(TEvent @event, EventHandlerDelegate next); +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs new file mode 100644 index 000000000..67285f175 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.Extensions.DependencyInjection; +global using System.Reflection; diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs new file mode 100644 index 000000000..468933d79 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public interface IDistributedDispatcherOptions : IDispatcherOptions +{ +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs new file mode 100644 index 000000000..a31cf0f41 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public interface IIntegrationEvent : IEvent, ITopic, ITransaction +{ +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs new file mode 100644 index 000000000..639364f3e --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public interface IIntegrationEventBus : IEventBus +{ + +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs new file mode 100644 index 000000000..c5792c4f8 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public interface ITopic +{ + string Topic { get; set; } +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs new file mode 100644 index 000000000..297fcba1c --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public abstract record IntegrationEvent : IIntegrationEvent +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + [JsonIgnore] + public abstract string Topic { get; set; } + + public IntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + protected IntegrationEvent(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs new file mode 100644 index 000000000..43f539830 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public enum IntegrationEventStates +{ + NotPublished = 0, + InProgress = 1, + Published = 2, + PublishedFailed = 3 +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs new file mode 100644 index 000000000..b07efc722 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; + +public interface IIntegrationEventLogService +{ + /// + /// Get messages to retry + /// + /// The size of a single event to be retried + /// + /// default: 60s + /// + Task> RetrieveEventLogsFailedToPublishAsync(int retryBatchSize = 200, int maxRetryTimes = 10, int minimumRetryInterval = 60); + + Task SaveEventAsync(IIntegrationEvent @event, DbTransaction transaction); + + Task MarkEventAsPublishedAsync(Guid eventId); + + Task MarkEventAsInProgressAsync(Guid eventId); + + Task MarkEventAsFailedAsync(Guid eventId); + + /// + /// Delete successfully published and expired data + /// + /// + /// + /// + /// + Task DeleteExpiresAsync(DateTime expiresAt, int batchCount = 1000, CancellationToken token = default); +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs new file mode 100644 index 000000000..104851c9f --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs @@ -0,0 +1,72 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; + +public class IntegrationEventLog : IHasConcurrencyStamp +{ + public Guid Id { get; private set; } + + public Guid EventId { get; private set; } + + public string EventTypeName { get; private set; } = null!; + + [NotMapped] + public string EventTypeShortName => EventTypeName.Split('.').Last(); + + [NotMapped] + public IIntegrationEvent Event { get; private set; } = null!; + + public IntegrationEventStates State { get; set; } = IntegrationEventStates.NotPublished; + + public int TimesSent { get; set; } = 0; + + public DateTime CreationTime { get; private set; } + + public DateTime ModificationTime { get; set; } + + public string Content { get; private set; } = null!; + + public Guid TransactionId { get; private set; } = Guid.Empty; + + public string RowVersion { get; private set; } + + private IntegrationEventLog() + { + Id = Guid.NewGuid(); + Initialize(); + } + + public IntegrationEventLog(IIntegrationEvent @event, Guid transactionId) : this() + { + EventId = @event.GetEventId(); + CreationTime = @event.GetCreationTime(); + ModificationTime = @event.GetCreationTime(); + EventTypeName = @event.GetType().FullName!; + Content = System.Text.Json.JsonSerializer.Serialize((object)@event); + TransactionId = transactionId; + } + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; + + public IntegrationEventLog DeserializeJsonContent(Type type) + { + Event = (System.Text.Json.JsonSerializer.Deserialize(Content, type) as IIntegrationEvent)!; + Event?.SetEventId(this.EventId); + Event?.SetCreationTime(this.CreationTime); + return this; + } + + public void SetRowVersion(string rowVersion) + { + if (string.IsNullOrEmpty(rowVersion)) + throw new ArgumentNullException(nameof(rowVersion)); + + RowVersion = rowVersion; + } +} diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj new file mode 100644 index 000000000..c530b0d9f --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs new file mode 100644 index 000000000..e33e8f784 --- /dev/null +++ b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using System.ComponentModel.DataAnnotations.Schema; +global using System.Data.Common; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs new file mode 100644 index 000000000..087259862 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class DefaultTypeConvertProvider : ITypeConvertProvider +{ + public T ConvertTo(string value) + { + if (typeof(T) == typeof(Guid)) + return (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(value)!; + + return (T)Convert.ChangeType(value, typeof(T)); + } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs new file mode 100644 index 000000000..b116f32bb --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IIdentityUser +{ + string Id { get; set; } + + string? UserName { get; set; } + + IEnumerable> Roles { get; set; } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs new file mode 100644 index 000000000..2ecacfe4a --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class IdentityRole +{ + public T Id { get; set; } + + public string Name { get; set; } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs new file mode 100644 index 000000000..31213d8d5 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class IdentityUser : IIdentityUser +{ + public string Id { get; set; } + + public string? UserName { get; set; } + + public IEnumerable> Roles { get; set; } = new List>(); +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs new file mode 100644 index 000000000..656188c3f --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IIsolatedIdentityUser : IMultiTenantIdentityUser, IMultiEnvironmentIdentityUser +{ +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs new file mode 100644 index 000000000..72d89fdf0 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IMultiEnvironmentIdentityUser : IIdentityUser +{ + string? Environment { get; set; } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs new file mode 100644 index 000000000..d57e54ee9 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IMultiTenantIdentityUser : IIdentityUser +{ + string? TenantId { get; set; } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs new file mode 100644 index 000000000..1121b1b03 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class IsolatedIdentityUser : MultiTenantIdentityUser +{ + public string? Environment { get; set; } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs new file mode 100644 index 000000000..fc3e54447 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class MultiEnvironmentIdentityUser : IdentityUser +{ + public string? Environment { get; set; } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs new file mode 100644 index 000000000..da9be1540 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class MultiTenantIdentityUser : IdentityUser, IMultiTenantIdentityUser +{ + public string? TenantId { get; set; } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs new file mode 100644 index 000000000..bce77db68 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +[Flags] +public enum IdentityType +{ + /// + /// Only use user information + /// + Basic = 0x01, + + /// + /// Multi-tenant + /// + MultiTenant = 0x02, + + /// + /// Multi-Environment + /// + MultiEnvironment = 0x04, +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs new file mode 100644 index 000000000..a5c9b3505 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IIsolatedUserContext : IMultiTenantUserContext, + IMultiEnvironmentUserContext +{ + +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs new file mode 100644 index 000000000..62c3f97e8 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IMultiEnvironmentUserContext : IUserContext +{ + string? Environment { get; } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs new file mode 100644 index 000000000..a4b517917 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IMultiTenantUserContext : IUserContext +{ + string? TenantId { get; } + + TTenantId? GetTenantId(); +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs new file mode 100644 index 000000000..2862d2bae --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface ITypeConvertProvider +{ + T ConvertTo(string value); +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs new file mode 100644 index 000000000..32a7302ea --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IUserContext +{ + bool IsAuthenticated { get; } + + string? UserId { get; } + + string? UserName { get; } + + TUserId? GetUserId(); + + TIdentityUser? GetUser() where TIdentityUser : IIdentityUser; + + IEnumerable> GetUserRoles(); +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs new file mode 100644 index 000000000..5ac2d328e --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IUserSetter +{ + IDisposable Change(TIdentityUser identityUser) where TIdentityUser : IIdentityUser; +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs new file mode 100644 index 000000000..2a2408616 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel.Internal; + +internal class DisposeAction : IDisposable +{ + private readonly Action _action; + + public DisposeAction(Action action) + { + ArgumentNullException.ThrowIfNull(action, nameof(action)); + _action = action; + } + + public void Dispose() => _action(); +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs new file mode 100644 index 000000000..004c5e44a --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public abstract class UserContext : IUserSetter, IUserContext +{ + private readonly AsyncLocal _currentUser = new(); + + public bool IsAuthenticated => GetUserSimple() != null; + + public string? UserId => GetUserSimple()?.Id; + + public string? UserName => GetUserSimple()?.UserName; + + protected ITypeConvertProvider TypeConvertProvider { get; } + + public UserContext(ITypeConvertProvider typeConvertProvider) => TypeConvertProvider = typeConvertProvider; + + protected abstract object? GetUser(); + + protected abstract IdentityUser? GetUserBasicInfo(); + + public TUserId? GetUserId() + { + var userId = UserId; + if (userId == null) + return default; + + return TypeConvertProvider.ConvertTo(userId); + } + + public TIdentityUser? GetUser() where TIdentityUser : IIdentityUser + { + var user = _currentUser.Value ?? GetUser(); + return user == null ? default : (TIdentityUser)user; + } + + public IIdentityUser? GetUserSimple() => GetUser(); + + public IDisposable Change(TIdentityUser identityUser) where TIdentityUser : IIdentityUser + { + var user = GetUser(); + _currentUser.Value = identityUser; + return new DisposeAction(() => _currentUser.Value = user); + } + + public IEnumerable> GetUserRoles() + { + return GetUserSimple()?.Roles.Select(r => new IdentityRole + { + Id = TypeConvertProvider.ConvertTo(r.Id), + Name = r.Name + }) ?? new List>(); + } +} diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs new file mode 100644 index 000000000..15e5b13bc --- /dev/null +++ b/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Identity.IdentityModel.Internal; +global using System.ComponentModel; diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs new file mode 100644 index 000000000..920f7451a --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Environment; + +public interface IEnvironmentContext +{ + string CurrentEnvironment { get; } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs new file mode 100644 index 000000000..db701075f --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Environment; + +public interface IEnvironmentSetter +{ + void SetEnvironment(string environment); +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs new file mode 100644 index 000000000..e86cceb23 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Environment; + +public interface IMultiEnvironment +{ + /// + /// The framework is responsible for the assignment operation, no manual assignment is required + /// + public string Environment { get; set; } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs new file mode 100644 index 000000000..f9aed3942 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation; + +public interface IConvertProvider +{ + object ChangeType(string value, Type conversionType); +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs new file mode 100644 index 000000000..8e2c89760 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation; + +public interface IIsolation : IMultiTenant, IMultiEnvironment + where TKey : IComparable +{ +} + +public interface IIsolation : IIsolation +{ +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs new file mode 100644 index 000000000..918e3b41e --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation; + +public interface IIsolationBuilder +{ + IServiceCollection Services { get; } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs new file mode 100644 index 000000000..de646ff37 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation; + +public interface IParserProvider +{ + string Name { get; } + + Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action); +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj new file mode 100644 index 000000000..efde41b45 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs new file mode 100644 index 000000000..e14fea629 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Middleware; + +public interface IIsolationMiddleware +{ + Task HandleAsync(); +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs new file mode 100644 index 000000000..638f693fb --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.MultiTenant; + +public interface IMultiTenant : IMultiTenant +{ +} + +public interface IMultiTenant where TKey : IComparable +{ + /// + /// The framework is responsible for the assignment operation, no manual assignment is required + /// + public TKey TenantId { get; set; } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs new file mode 100644 index 000000000..6d5eddb8a --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.MultiTenant; + +public interface ITenantContext +{ + Tenant? CurrentTenant { get; } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs new file mode 100644 index 000000000..f8cca629f --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.MultiTenant; + +public interface ITenantSetter +{ + void SetTenant(Tenant? tenant); +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs new file mode 100644 index 000000000..6fdbde873 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.MultiTenant; + +public class Tenant +{ + public string Id { get; set; } + + public Tenant(object id) : this(id?.ToString() ?? throw new ArgumentNullException(nameof(id))) + { + } + + public Tenant(string id) + { + if (string.IsNullOrEmpty(id)) + throw new ArgumentNullException(nameof(id)); + + Id = id; + } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs new file mode 100644 index 000000000..91cfdff63 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Options; + +public class IsolationDbConnectionOptions : MasaDbConnectionOptions +{ + public List IsolationConnectionStrings { get; set; } = new(); +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs new file mode 100644 index 000000000..b9d7078dc --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Options; + +public class IsolationOptions +{ + public string TenantId { get; set; } + + public string Environment { get; set; } + + public string Name { get; set; } = string.Empty; + + public string ConnectionString { get; set; } + + /// + /// Used to control the configuration with the highest score when multiple configurations are satisfied. The default score is 100 + /// + public int Score { get; set; } = 100; +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs new file mode 100644 index 000000000..e27f005e4 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class CookieParserProvider : IParserProvider +{ + public string Name => "Cookie"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (httpContext?.Request.Cookies.ContainsKey(key) ?? false) + { + var value = httpContext.Request.Cookies[key]; + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs new file mode 100644 index 000000000..7e50d1da0 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class EnvironmentVariablesParserProvider : IParserProvider +{ + public string Name { get; } = "EnvironmentVariables"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + string? value = System.Environment.GetEnvironmentVariable(key); + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs new file mode 100644 index 000000000..c471328c9 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class FormParserProvider : IParserProvider +{ + public string Name => "Form"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (!(httpContext?.Request.HasFormContentType ?? false)) + return Task.FromResult(false); + + if (httpContext?.Request.Form.ContainsKey(key) ?? false) + { + var value = httpContext.Request.Form[key].ToString(); + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs new file mode 100644 index 000000000..4149c3165 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class HeaderParserProvider : IParserProvider +{ + public string Name => "Header"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (httpContext?.Request.Headers.ContainsKey(key) ?? false) + { + var value = httpContext.Request.Headers[key].ToString(); + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs new file mode 100644 index 000000000..76dbbfd9a --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class HttpContextItemParserProvider : IParserProvider +{ + public string Name => "Items"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (httpContext?.Items.ContainsKey(key) ?? false) + { + var value = httpContext.Items[key]?.ToString() ?? string.Empty; + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs new file mode 100644 index 000000000..c76c2b904 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class QueryStringParserProvider : IParserProvider +{ + public string Name => "QueryString"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (httpContext?.Request.Query.ContainsKey(key) ?? false) + { + var value = httpContext.Request.Query[key].ToString(); + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs new file mode 100644 index 000000000..34b637282 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class RouteParserProvider : IParserProvider +{ + public string Name => "Route"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + var value = httpContext?.GetRouteValue(key)?.ToString() ?? string.Empty; + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs new file mode 100644 index 000000000..c998d2ac1 --- /dev/null +++ b/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Isolation.Environment; +global using Masa.BuildingBlocks.Isolation.MultiTenant; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Routing; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs new file mode 100644 index 000000000..5408d26b6 --- /dev/null +++ b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; + +public abstract record Command : ICommand +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + public Command() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public Command(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs new file mode 100644 index 000000000..b16f0ad3e --- /dev/null +++ b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; + +public interface ICommand : IEvent, ITransaction +{ +} diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs new file mode 100644 index 000000000..59d6070e5 --- /dev/null +++ b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; + +public interface ICommandHandler : IEventHandler + where TCommand : ICommand +{ +} diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj new file mode 100644 index 000000000..2438d134a --- /dev/null +++ b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs new file mode 100644 index 000000000..c32c90b5b --- /dev/null +++ b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; + +public interface IQuery : IEvent + where TResult : notnull +{ +} diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs new file mode 100644 index 000000000..2bcdb7e68 --- /dev/null +++ b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; + +public interface IQueryHandler : IEventHandler + where TCommand : IQuery where TResult : notnull +{ +} diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs new file mode 100644 index 000000000..5f71f1b84 --- /dev/null +++ b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; + +public abstract record Query : IQuery + where TResult : notnull +{ + private Guid _eventId; + private DateTime _creationTime; + + public abstract TResult Result { get; set; } + + public Query() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public Query(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs new file mode 100644 index 000000000..212b5d65b --- /dev/null +++ b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs new file mode 100644 index 000000000..8175cc184 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public class AutoCompleteDocument +{ + private string? _documentId; + + private string? _text; + + public string Text + { + get + { + return _text ??= GetText(); + } + init + { + if (value != null!) + _text = value; + } + } + + public AutoCompleteDocument() + { + } + + public AutoCompleteDocument(string text) : this() + { + Text = text; + } + + public virtual string GetDocumentId() => _documentId ??= Guid.NewGuid().ToString(); + + protected virtual string GetText() => string.Empty; +} + +public class AutoCompleteDocument : AutoCompleteDocument where TValue : notnull +{ + private string _id; + + public string Id + { + get + { + if (string.IsNullOrEmpty(_id)) + return Value?.ToString() ?? throw new ArgumentException("{Id} cannot be empty", nameof(Id)); + + return _id; + } + init + { + if (string.IsNullOrEmpty(value)) + throw new ArgumentException("{Id} cannot be empty", nameof(Id)); + + _id = value; + } + } + + public TValue Value { get; set; } + + public AutoCompleteDocument() + { + } + + public AutoCompleteDocument(string text, TValue value) + : this(value?.ToString() ?? throw new ArgumentException($"{value} cannot be empty", nameof(value)), text, value) + { + } + + public AutoCompleteDocument(string id, string text, TValue value) : this() + { + Id = id; + Text = text; + Value = value; + } + + public override string GetDocumentId() => Id; +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs new file mode 100644 index 000000000..7b7aafe35 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs @@ -0,0 +1,96 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public abstract class BaseAutoCompleteClient : IAutoCompleteClient +{ + public virtual Task>> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) + => GetAsync(keyword, options, cancellationToken); + + public virtual Task>> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull + => GetAsync, TValue>(keyword, options, cancellationToken); + + public virtual Task> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument + => GetBySpecifyDocumentAsync(keyword, options, cancellationToken); + + public abstract Task> GetBySpecifyDocumentAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + public virtual Task SetAsync( + AutoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) + => SetAsync, Guid>(document, options, cancellationToken); + + public virtual Task SetAsync( + IEnumerable> documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) + => SetAsync, Guid>(documents, options, cancellationToken); + + public virtual Task SetAsync( + AutoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull + => SetAsync, TValue>(document, options, cancellationToken); + + public virtual Task SetAsync( + IEnumerable> documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull + => SetAsync, TValue>(documents, options, cancellationToken); + + public virtual Task SetAsync( + TAudoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument + => SetAsync(new List { document }, options, cancellationToken); + + public virtual Task SetAsync( + IEnumerable documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument + => SetBySpecifyDocumentAsync(documents, options, cancellationToken); + + public virtual Task SetBySpecifyDocumentAsync( + TAudoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument + => SetBySpecifyDocumentAsync(new List { document }, options, cancellationToken); + + public abstract Task SetBySpecifyDocumentAsync( + IEnumerable documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + + public abstract Task DeleteAsync(string id, CancellationToken cancellationToken = default); + + public virtual Task DeleteAsync(T id, CancellationToken cancellationToken = default) where T : IComparable + => DeleteAsync(id.ToString() ?? throw new ArgumentNullException($"{id} is not null", nameof(id)), cancellationToken); + + public abstract Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default); + + public virtual Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) + where T : IComparable + { + var type = typeof(T); + if (!type.IsPrimitive && type != typeof(Guid) && type != typeof(string)) + throw new NotSupportedException("Unsupported types, id only supports simple types or guid, string"); + + return DeleteAsync(ids.Select(id => id.ToString() ?? throw new ArgumentNullException($"{id} is not null", nameof(id))), + cancellationToken); + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs new file mode 100644 index 000000000..ba29aed29 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public interface IAutoCompleteClient +{ + Task>> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default); + + Task>> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull; + + [Obsolete($"{nameof(GetAsync)} expired, please use {nameof(GetBySpecifyDocumentAsync)}")] + Task> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) + where TAudoCompleteDocument : AutoCompleteDocument; + + Task> GetBySpecifyDocumentAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) + where TAudoCompleteDocument : AutoCompleteDocument; + + Task SetAsync( + AutoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default); + + Task SetAsync( + IEnumerable> documents, + SetOptions? options = null, + CancellationToken cancellationToken = default); + + Task SetAsync( + AutoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull; + + Task SetAsync( + IEnumerable> documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull; + + [Obsolete($"{nameof(SetAsync)} expired, please use {nameof(SetBySpecifyDocumentAsync)}")] + Task SetAsync( + TAudoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + [Obsolete($"{nameof(SetAsync)} expired, please use {nameof(SetBySpecifyDocumentAsync)}")] + Task SetAsync( + IEnumerable documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + Task SetBySpecifyDocumentAsync( + TAudoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + Task SetBySpecifyDocumentAsync( + IEnumerable documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + Task DeleteAsync(string id, CancellationToken cancellationToken = default); + + Task DeleteAsync(T id, CancellationToken cancellationToken = default) where T : IComparable; + + Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default); + + Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) where T : IComparable; +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs new file mode 100644 index 000000000..77f5ed483 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public interface IAutoCompleteFactory +{ + IAutoCompleteClient CreateClient(); + + IAutoCompleteClient CreateClient(string name); +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj new file mode 100644 index 000000000..ca62071d4 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs new file mode 100644 index 000000000..98e26886c --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; + +public class AutoCompleteOptions +{ + public string Field { get; set; } + + private int _page; + + public int Page + { + get => _page; + set + { + if (value <= 0) + throw new ArgumentException($"{nameof(Page)} must be greater than 0", nameof(Page)); + + _page = value; + } + } + + private int _pageSize; + + public int PageSize + { + get => _pageSize; + set + { + if (value <= 0) + throw new ArgumentException($"{nameof(PageSize)} must be greater than 0", nameof(PageSize)); + + _pageSize = value; + } + } + + public SearchType? SearchType { get; } + + public AutoCompleteOptions(SearchType? searchType = null) + { + this.Field = "text"; + this.Page = 1; + this.PageSize = 10; + this.SearchType = searchType; + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs new file mode 100644 index 000000000..f74dd5010 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; + +public class SetOptions +{ + public bool IsOverride { get; set; } + + public SetOptions(bool isOverride = true) + { + IsOverride = isOverride; + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs new file mode 100644 index 000000000..9e6c2fcfb --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class DeleteMultiResponse : ResponseBase +{ + public List Data { get; set; } + + public DeleteMultiResponse(bool isValid, string message) : base(isValid, message) + { + } + + public DeleteMultiResponse(bool isValid, string message, IEnumerable? data) : this(isValid, message) + { + ArgumentNullException.ThrowIfNull(data, nameof(data)); + + Data = data.ToList(); + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs new file mode 100644 index 000000000..fb3ad8895 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class DeleteRangeResponseItems +{ + public string Id { get; } + + public bool IsValid { get; } + + public string Message { get; } + + public DeleteRangeResponseItems(string id, bool isValid, string message) + { + this.Id = id; + this.IsValid = isValid; + this.Message = message; + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs new file mode 100644 index 000000000..65df88c4e --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class DeleteResponse : ResponseBase +{ + public DeleteResponse(bool isValid, string message) : base(isValid, message) + { + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs new file mode 100644 index 000000000..a02a7f7a4 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class GetResponse : ResponseBase + where TDropdownBox : AutoCompleteDocument +{ + public long Total { get; set; } + + public long TotalPages { get; set; } + + public List Data { get; set; } + + public GetResponse(bool isValid, string message) : base(isValid, message) + { + } + + public GetResponse(bool isValid, string message, IEnumerable data) : this(isValid, message) + { + ArgumentNullException.ThrowIfNull(data, nameof(data)); + + Data = data.ToList(); + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs new file mode 100644 index 000000000..6e3022ed0 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class ResponseBase +{ + public bool IsValid { get; } + + public string Message { get; } + + public ResponseBase(bool isValid, string message) + { + IsValid = isValid; + Message = message; + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs new file mode 100644 index 000000000..53785a71e --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class SetResponse : ResponseBase +{ + public List Items { get; set; } + + public SetResponse(bool isValid, string message) : base(isValid, message) + { + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs new file mode 100644 index 000000000..bd03efdca --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class SetResponseItems +{ + public string Id { get; } + + public bool IsValid { get; } + + public string Message { get; } + + public SetResponseItems(string id, bool isValid, string message) + { + Id = id; + IsValid = isValid; + Message = message; + } +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs new file mode 100644 index 000000000..f481c2404 --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public enum SearchType +{ + Precise = 1, + Fuzzy = 2 +} diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs new file mode 100644 index 000000000..ec81698cc --- /dev/null +++ b/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs new file mode 100644 index 000000000..a3963e6a7 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs @@ -0,0 +1,391 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public abstract class AbstractCaller : ICaller +{ + private readonly ITypeConvertor _typeConvertor; + public readonly IServiceProvider ServiceProvider; + + private IRequestMessage? _requestMessage; + private IResponseMessage? _responseMessage; + protected IRequestMessage RequestMessage => _requestMessage ??= ServiceProvider.GetRequiredService(); + protected IResponseMessage ResponseMessage => _responseMessage ??= ServiceProvider.GetRequiredService(); + + public AbstractCaller(IServiceProvider serviceProvider) + { + _typeConvertor = serviceProvider.GetRequiredService(); + ServiceProvider = serviceProvider; + } + + public virtual async Task SendAsync( + HttpRequestMessage request, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var response = await SendAsync(request, cancellationToken); + if (autoThrowUserFriendlyException) + await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + + return response; + } + + public abstract Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + public abstract Task CreateRequestAsync( + HttpMethod method, + string? methodName); + + public abstract Task CreateRequestAsync( + HttpMethod method, + string? methodName, + TRequest data); + + public abstract Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName); + request.Content = content; + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public abstract Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default); + + public abstract Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default) + where TResponse : IMessage, new(); + + public abstract Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage; + + public abstract Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage + where TResponse : IMessage, new(); + + public virtual async Task GetStringAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsStringAsync(cancellationToken); + } + + public virtual Task GetStringAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetStringAsync( + GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetStringAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetStringAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetByteArrayAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsByteArrayAsync(cancellationToken); + } + + public virtual Task GetByteArrayAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetByteArrayAsync( + GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetByteArrayAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetByteArrayAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetStreamAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsStreamAsync(cancellationToken); + } + + public virtual Task GetStreamAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetStreamAsync( + GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetStreamAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetStreamAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual Task GetAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Get, methodName, null, autoThrowUserFriendlyException, cancellationToken); + + public virtual Task GetAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetAsync( + string? methodName, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) where TRequest : class + { + HttpRequestMessage request = + await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data))); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = + await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data))); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + Dictionary data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, data)); + return await SendAsync(request, cancellationToken); + } + + protected virtual string GetUrl(string? url, IEnumerable> properties) + { + url ??= string.Empty; + foreach (var property in properties) + { + string value = property.Value; + + url = !url.Contains("?") ? + $"{url}?{property.Key}={value}" : + $"{url}&{property.Key}={value}"; + } + + return url; + } + + public virtual Task PostAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Post, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PostAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PostAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PostAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task PatchAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Patch, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PatchAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Patch, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PatchAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PatchAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task PutAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Put, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PutAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PutAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PutAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task DeleteAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Delete, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task DeleteAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task DeleteAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task DeleteAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, cancellationToken); + } +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs new file mode 100644 index 000000000..6deb557ef --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public static class AddCallerExtensions +{ + public static void AddCaller(CallerOptions callerOptions, string name, bool isDefault, Func func) + { + if (callerOptions.Callers.Any(c => c.Name == name)) + throw new ArgumentException($"The caller name already exists, please change the name, the repeat name is {name}"); + + callerOptions.Callers.Add(new CallerRelationOptions(name, isDefault, func)); + } +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs new file mode 100644 index 000000000..e345d8d46 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public abstract class CallerBase +{ + public virtual string Name { get; set; } = string.Empty; + + protected CallerOptions CallerOptions { get; private set; } = default!; + + private ICaller? _caller; + + protected ICaller Caller => _caller ??= ServiceProvider.GetRequiredService().Create(Name); + + [Obsolete("CallerProvider has expired, please use Caller")] + protected ICaller CallerProvider => Caller; + + private IServiceProvider ServiceProvider { get; } + + protected CallerBase(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; + + public abstract void UseCallerExtension(); + + public void SetCallerOptions(CallerOptions options, string name) + { + CallerOptions = options; + if (string.IsNullOrEmpty(Name)) + Name = name; + } +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs new file mode 100644 index 000000000..c69510e3a --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs @@ -0,0 +1,219 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface ICaller +{ + Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpRequestMessage request, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default); + + Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default) + where TResponse : IMessage, new(); + + Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage; + + Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage + where TResponse : IMessage, new(); + + Task GetStringAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStringAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetStringAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetByteArrayAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetByteArrayAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetByteArrayAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStreamAsync(string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStreamAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetStreamAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + where TRequest : class; + + Task GetAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task GetAsync(string? methodName, Dictionary data, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task DeleteAsync(string? methodName, TRequest data, CancellationToken cancellationToken = default); + + Task DeleteAsync(string? methodName, object data, CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs new file mode 100644 index 000000000..cd2a0b49c --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface ICallerFactory +{ + ICaller Create(); + + ICaller Create(string name); +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs new file mode 100644 index 000000000..bcf6f4059 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface IRequestMessage +{ + Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage); + + Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data); +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs new file mode 100644 index 000000000..ffc42c0a6 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface IResponseMessage +{ + Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); + + Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs new file mode 100644 index 000000000..2b2e670d8 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface ITypeConvertor +{ + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + [Obsolete("Use ConvertToKeyValuePairs instead")] + Dictionary ConvertToDictionary(TRequest request) where TRequest : class; + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class; +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj new file mode 100644 index 000000000..2e0c7dfd8 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj new file mode 100644 index 000000000..9488b24bd --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs new file mode 100644 index 000000000..010163cb6 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller.Options; + +public class CallerFactoryOptions +{ + public readonly List Callers = new(); + + public JsonSerializerOptions? JsonSerializerOptions { get; set; } + + public string? RequestIdKey { get; set; } +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs new file mode 100644 index 000000000..63acc4048 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller.Options; + +public class CallerOptions +{ + public readonly List Callers = new(); + + public IServiceCollection Services { get; } + + private Assembly[] _assemblies = AppDomain.CurrentDomain.GetAssemblies(); + + public Assembly[] Assemblies + { + get => _assemblies; + set + { + ArgumentNullException.ThrowIfNull(value, nameof(Assemblies)); + + _assemblies = value; + } + } + + public ServiceLifetime CallerLifetime { get; set; } + + public JsonSerializerOptions? JsonSerializerOptions { get; set; } + + public string? RequestIdKey { get; set; } + + public CallerOptions(IServiceCollection services) + { + Services = services; + CallerLifetime = ServiceLifetime.Scoped; + } +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs new file mode 100644 index 000000000..9a5b101fa --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller.Options; + +public class CallerRelationOptions +{ + public string Name { get; } = default!; + + public bool IsDefault { get; } + + public Func Func { get; } = default!; + + public CallerRelationOptions(string name, bool isDefault, Func func) + { + Name = name; + IsDefault = isDefault; + Func = func; + } +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs new file mode 100644 index 000000000..7d22b6607 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Google.Protobuf; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Microsoft.Extensions.DependencyInjection; +global using System.Reflection; +global using System.Text.Json; diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs new file mode 100644 index 000000000..f9407964d --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Contracts; + +public class BaseMessage +{ + /// + /// Unique Identifier + /// + protected Guid _correlationId = Guid.NewGuid(); + + public Guid CorrelationId() => _correlationId; +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs new file mode 100644 index 000000000..d13057fe6 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Contracts; + +public abstract class BaseRequest : BaseMessage +{ +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs new file mode 100644 index 000000000..d901a1082 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Contracts; + +public abstract class BaseResponse : BaseMessage +{ + public BaseResponse(Guid correlationId) : base() + { + base._correlationId = correlationId; + } + + public BaseResponse() + { + } +} + +public abstract class BaseResponse : BaseResponse +{ + public T? Data { get; set; } + + public BaseResponse(Guid correlationId) + : base(correlationId) + { + } + + public BaseResponse() + { + } +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs new file mode 100644 index 000000000..7a159cc54 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.MinimalAPIs; + +public interface IService +{ + WebApplication App { get; } + + IServiceCollection Services { get; } + + TService? GetService(); + + TService GetRequiredService() where TService : notnull; +} diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj new file mode 100644 index 000000000..1e1618a72 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs new file mode 100644 index 000000000..aefd78f01 --- /dev/null +++ b/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs new file mode 100644 index 000000000..2692fc072 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +[AttributeUsage(AttributeTargets.Class)] +public class BucketNameAttribute : Attribute +{ + public string? Name { get; set; } + + public BucketNameAttribute(string? name = null) => Name = name; + + public static string GetName() => GetName(typeof(T)); + + public static string GetName(Type type) + { + var nameAttribute = type.GetTypeInfo().GetCustomAttribute(); + + if (nameAttribute == null) + return BucketNames.DEFAULT_BUCKET_NAME; + + return !string.IsNullOrWhiteSpace(nameAttribute.Name) ? nameAttribute.Name : type.FullName!; + } +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs new file mode 100644 index 000000000..ca61c53f5 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public class BucketNames : Dictionary +{ + public const string DEFAULT_BUCKET_NAME = "DefaultBucketName"; + + public string DefaultBucketName + { + get => GetBucketName(DEFAULT_BUCKET_NAME); + set => this[DEFAULT_BUCKET_NAME] = value; + } + + public BucketNames() { } + public BucketNames(IEnumerable> names) : base(names) { } + + public string GetBucketName(string name) + { + if (base.TryGetValue(name, out var bucketName)) + return bucketName; + + return string.Empty; + } +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs new file mode 100644 index 000000000..34bb6026b --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs @@ -0,0 +1,51 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public class DefaultClientContainer + : DefaultClientContainer, IClientContainer where TContainer : class +{ + public DefaultClientContainer(IClient client, IBucketNameProvider bucketNameProvider) + : base(client, bucketNameProvider.GetBucketName()) + { + } +} + +public class DefaultClientContainer : IClientContainer +{ + private readonly IClient _client; + private readonly string _bucketName; + + public DefaultClientContainer(IClient client, string bucketName) + { + _client = client; + _bucketName = bucketName; + } + + public TemporaryCredentialsResponse GetSecurityToken() => _client.GetSecurityToken(); + + public string GetToken() => _client.GetToken(); + + public Task GetObjectAsync(string objectName, Action callback, CancellationToken cancellationToken = default) + => _client.GetObjectAsync(_bucketName, objectName, callback, cancellationToken); + + public Task GetObjectAsync(string objectName, + long offset, + long length, + Action callback, + CancellationToken cancellationToken = default) + => _client.GetObjectAsync(_bucketName, objectName, offset, length, callback, cancellationToken); + + public Task PutObjectAsync(string objectName, Stream data, CancellationToken cancellationToken = default) + => _client.PutObjectAsync(_bucketName, objectName, data, cancellationToken); + + public Task ObjectExistsAsync(string objectName, CancellationToken cancellationToken = default) + => _client.ObjectExistsAsync(_bucketName, objectName, cancellationToken); + + public Task DeleteObjectAsync(string objectName, CancellationToken cancellationToken = default) + => _client.DeleteObjectAsync(_bucketName, objectName, cancellationToken); + + public Task DeleteObjectAsync(IEnumerable objectNames, CancellationToken cancellationToken = default) + => _client.DeleteObjectAsync(_bucketName, objectNames, cancellationToken); +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs new file mode 100644 index 000000000..def32b589 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public class DefaultClientFactory : IClientFactory +{ + private readonly IClient _client; + + public DefaultClientFactory(IClient client) => _client = client; + + public IClientContainer Create(string bucketName) + { + if (string.IsNullOrWhiteSpace(bucketName)) + throw new AggregateException($"{nameof(bucketName)} cannot be empty"); + + return new DefaultClientContainer(_client, bucketName); + } +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs new file mode 100644 index 000000000..756d16bbc --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public interface IBucketNameProvider +{ + string GetBucketName(); + + string GetBucketName() where TContainer : class; +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs new file mode 100644 index 000000000..378cbded2 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public interface IClient +{ + /// + /// Obtain temporary authorization credentials through STS service + /// + /// + TemporaryCredentialsResponse GetSecurityToken(); + + /// + /// Obtain temporary request token through authorization service + /// + /// + string GetToken(); + + Task GetObjectAsync( + string bucketName, + string objectName, + Action callback, + CancellationToken cancellationToken = default(CancellationToken)); + + Task GetObjectAsync( + string bucketName, + string objectName, + long offset, + long length, + Action callback, + CancellationToken cancellationToken = default(CancellationToken)); + + Task PutObjectAsync( + string bucketName, + string objectName, + Stream data, + CancellationToken cancellationToken = default(CancellationToken)); + + Task ObjectExistsAsync( + string bucketName, + string objectName, + CancellationToken cancellationToken = default(CancellationToken)); + + Task DeleteObjectAsync( + string bucketName, + string objectName, + CancellationToken cancellationToken = default(CancellationToken)); + + Task DeleteObjectAsync( + string bucketName, + IEnumerable objectNames, + CancellationToken cancellationToken = default(CancellationToken)); +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs new file mode 100644 index 000000000..cd3b0f020 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs @@ -0,0 +1,53 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public interface IClientContainer : IClientContainer where TContainer : class +{ + +} + +public interface IClientContainer +{ + /// + /// Obtain temporary authorization credentials through STS service + /// + /// + TemporaryCredentialsResponse GetSecurityToken(); + + /// + /// Obtain temporary request token through authorization service + /// + /// + string GetToken(); + + Task GetObjectAsync( + string objectName, + Action callback, + CancellationToken cancellationToken = default); + + Task GetObjectAsync( + string objectName, + long offset, + long length, + Action callback, + CancellationToken cancellationToken = default); + + Task PutObjectAsync( + string objectName, + Stream data, + CancellationToken cancellationToken = default); + + Task ObjectExistsAsync( + string objectName, + CancellationToken cancellationToken = default); + + Task DeleteObjectAsync( + string objectName, + CancellationToken cancellationToken = default); + + Task DeleteObjectAsync( + IEnumerable objectNames, + CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs new file mode 100644 index 000000000..e133ce1c7 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public interface IClientFactory +{ + IClientContainer Create(string bucketName); +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj new file mode 100644 index 000000000..17a5a8795 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs new file mode 100644 index 000000000..c626350f0 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage.Response; + +public class TemporaryCredentialsResponse +{ + public string AccessKeyId { get; } + + public string AccessKeySecret { get; } + + public string SessionToken { get; } + + public DateTime? Expiration { get; } + + public TemporaryCredentialsResponse(string accessKeyId, string accessKeySecret, string sessionToken, DateTime? expiration) + { + AccessKeyId = accessKeyId; + AccessKeySecret = accessKeySecret; + SessionToken = sessionToken; + Expiration = expiration; + } +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs new file mode 100644 index 000000000..02c338f62 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public class StorageOptions +{ + private static readonly List> _bucketNames = new(); + + public BucketNames BucketNames { get; set; } + + public StorageOptions() => BucketNames = new BucketNames(_bucketNames); + + public void TryAddBucketName(string name, string bucketName) + { + if (_bucketNames.All(item => item.Key != name)) + _bucketNames.Add(new KeyValuePair(name, bucketName)); + } +} diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs new file mode 100644 index 000000000..16a47c504 --- /dev/null +++ b/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Storage.ObjectStorage.Response; +global using Microsoft.Extensions.Options; +global using System.Reflection; diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj b/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj new file mode 100644 index 000000000..a241a60f8 --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + + diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs b/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs new file mode 100644 index 000000000..633b5b235 --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration.Tests; + +[TestClass] +public class TestProperties +{ + [TestMethod] + public void TestEquals() + { + var id = Guid.NewGuid().ToString(); + var x = new Properties(new Dictionary() + { + {"id", id}, + }); + var y = new Properties(new Dictionary() + { + {"id", id}, + }); + var z = new Properties(new Dictionary() + { + {"id2", Guid.NewGuid().ToString()}, + {"id", id} + }); + Assert.IsTrue(x.Equals(y)); + Assert.IsTrue(!x.Equals(null)); + Assert.IsTrue(!x!.Equals(z)); + Assert.IsTrue(!z.Equals(x)); + + var w = new Properties(new Dictionary() + { + {"id", Guid.NewGuid().ToString()}, + }); + + Assert.IsFalse(x!.Equals(w)); + } + + [TestMethod] + public void TestGetHashCode() + { + var id = Guid.NewGuid().ToString(); + Properties x = new(new Dictionary() { { "Id", id } }); + Properties y = new(new Dictionary() { { "Id", id } }); + + Assert.AreEqual(x.GetHashCode(), y.GetHashCode()); + } + + [TestMethod] + public void TestOperator() + { + var id = Guid.NewGuid().ToString(); + Properties x = new(new Dictionary() { { "Id", id } }); + Properties y = new(new Dictionary() { { "Id", id } }); + Properties z = new(new Dictionary() { { "Id", Guid.NewGuid().ToString() } }); + + Assert.IsTrue(x == y); + Assert.IsTrue(x != z); + + Properties? m = null; + Assert.IsTrue(m == null); + Assert.IsTrue(null == m); + Assert.IsFalse(null != m); + Assert.IsFalse(m != null); + } +} diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs b/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs new file mode 100644 index 000000000..1109a8e81 --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj b/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj new file mode 100644 index 000000000..fb220f4c5 --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs b/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs new file mode 100644 index 000000000..e6a21820d --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs @@ -0,0 +1,64 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Tests; + +[TestClass] +public class TestEntity +{ + [TestMethod] + public void TestToString() + { + MasaEntity entity = new(Guid.Empty); + Assert.AreEqual("MasaEntity:Id=00000000-0000-0000-0000-000000000000", entity.ToString()); + } + + [TestMethod] + public void TestEquals() + { + var id = Guid.NewGuid(); + MasaEntity x = new(id); + MasaEntity y = new(id); + + Assert.IsTrue(x.Equals(y)); + Assert.IsTrue(x.Equals((object)y)); + } + + [TestMethod] + public void TestGetHashCode() + { + var id = Guid.NewGuid(); + MasaEntity x = new(id); + MasaEntity y = new(id); + + Assert.AreEqual(x.GetHashCode(), y.GetHashCode()); + } + + [TestMethod] + public void TestOperator() + { + var id = Guid.NewGuid(); + MasaEntity x = new(id); + MasaEntity y = new(id); + MasaEntity z = new(Guid.NewGuid()); + + Assert.IsTrue(x == y); + Assert.IsTrue(x != z); + + MasaEntity? m = null; + Assert.IsTrue(m == null); + Assert.IsTrue(null == m); + Assert.IsFalse(null != m); + Assert.IsFalse(m != null); + Assert.IsTrue(x != null); + Assert.IsTrue(null != x); + } + + public class MasaEntity : Entity + { + public MasaEntity(Guid id) + { + Id = id; + } + } +} diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs b/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs new file mode 100644 index 000000000..d2679ea25 --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs @@ -0,0 +1,52 @@ +using Masa.BuildingBlocks.Ddd.Domain.Values; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Tests; + +[TestClass] +public class TestValueObject +{ + [TestMethod] + public void TestEquals() + { + var id = Guid.NewGuid(); + MasaValueObject x = new() { Id = id }; + MasaValueObject y = new() { Id = id }; + + Assert.IsTrue(x.Equals(y)); + } + + [TestMethod] + public void TestGetHashCode() + { + var id = Guid.NewGuid(); + MasaValueObject x = new() { Id = id }; + MasaValueObject y = new() { Id = id }; + + Assert.AreEqual(x.GetHashCode(), y.GetHashCode()); + } + + [TestMethod] + public void TestOperator() + { + var id = Guid.NewGuid(); + MasaValueObject x = new() { Id = id }; + MasaValueObject y = new() { Id = id }; + MasaValueObject z = new() { Id = Guid.NewGuid() }; + + Assert.IsTrue(x == y); + Assert.IsTrue(x != z); + } + + public class MasaValueObject : ValueObject + { + public Guid Id { get; set; } + + protected override IEnumerable GetEqualityValues() + { + yield return Id; + } + } +} diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs b/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs new file mode 100644 index 000000000..fdacb3726 --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs b/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs new file mode 100644 index 000000000..a06a134da --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests; + +public class CustomAutoCompleteClient : BaseAutoCompleteClient +{ + + public override Task> GetBySpecifyDocumentAsync(string keyword, AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SetBySpecifyDocumentAsync(IEnumerable documents, SetOptions? options = null, + CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task DeleteAsync(string id, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) + => Task.FromResult(new DeleteMultiResponse(true, "")); +} diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj b/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj new file mode 100644 index 000000000..9ffa2ae34 --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs b/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs new file mode 100644 index 000000000..f98407229 --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests; + +[TestClass] +public class TestAutoCompleteClient +{ + [TestMethod] + public async Task TestDeleteMultiAsyncReturnSuccess() + { + var client = new CustomAutoCompleteClient(); + var response = await client.DeleteAsync(new[] { 1, 2 }); + Assert.IsTrue(response.IsValid); + + response = await client.DeleteAsync(new[] { "1", "2" }); + Assert.IsTrue(response.IsValid); + + response = await client.DeleteAsync(new[] { 1d, 2d }); + Assert.IsTrue(response.IsValid); + + response = await client.DeleteAsync(new[] { 1L, 2L }); + Assert.IsTrue(response.IsValid); + + response = await client.DeleteAsync(new[] { Guid.NewGuid(), Guid.NewGuid() }); + Assert.IsTrue(response.IsValid); + } +} diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs b/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs new file mode 100644 index 000000000..b8cdf88c8 --- /dev/null +++ b/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Directory.Build.props b/src/Contrib/Directory.Build.props new file mode 100644 index 000000000..4542bd522 --- /dev/null +++ b/src/Contrib/Directory.Build.props @@ -0,0 +1,21 @@ + + + 6.0.0 + 0.13.1 + 2.2.3 + 16.9.4 + 3.0.2 + 4.16.1 + 0.5.0 + 7.3.0 + 1.5.0 + 3.19.1 + 1.0.4 + 11.1.0 + 11.1.2 + + 1.3.0 + 1.0.0-beta2 + 1.0.0-rc9.3 + + diff --git a/src/Contrib/README.md b/src/Contrib/README.md new file mode 100644 index 000000000..cd64f439a --- /dev/null +++ b/src/Contrib/README.md @@ -0,0 +1,105 @@ +[中](README.zh-CN.md) | EN + +[![codecov](https://codecov.io/gh/masastack/MASA.Contrib/branch/main/graph/badge.svg?token=87TPNHUHW2)](https://codecov.io/gh/masastack/MASA.Contrib) + +# MASA.Contrib + +The purpose of MASA.Contrib is based on [MASA.BuildingBlocks](https://github.com/masastack/MASA.BuildingBlocks) to provide open, community driven reusable components for building mesh applications. These components will be used by the [MASA Stack](https://github.com/masastack) and [MASA Labs](https://github.com/masalabs) projects. + + + +## Roadmap +* [Release Notes](https://github.com/masastack/MASA.Contrib/releases) +* [Latest Roadmap](https://github.com/masastack/MASA.Contrib/issues/42) + + + +## Features +* AutoComplete: make searching easier + * [ElasticSearch](./src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md) +* Configuration: Configuration Center + * [Configuration core, provide local configuration](./src/Configuration/Masa.Contrib.Configuration/README.md) + * ConfigurationAPI + * [Dcc](./src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md) +* [CQRS](./src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md) +* Data: + * [EntityFrameworkCore](./src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.md) + * [SqlServer](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md) + * [Pomelo.MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md): Recommend + * [MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md) + * [Sqlite](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md) + * [Cosmos](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md) + * [InMemory](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md) + * [Oracle](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md) + * [PostgreSql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md) + * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EF/): data protocol + * UoW: unit of work + * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EF/README.md) + * IdGenerator: Unique ID generator + * [NormalGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md): Normal Guid + * [SequentialGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md): Sequential Guid + * [Snowflake](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.md): Snowflake id + * [Snowflake.Distributed.Redis](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md): Distributed snowflake id + * Mapping: object mapping + * [Mapster](./src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md) +* [DDD](./src/Ddd/Masa.Contrib.Ddd.Domain/README.md) + * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md): Provide warehousing services +* Dispatcher + * [EventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md): In-process events + * [IntegrationEventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md): Cross-process events + * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md): Provides message management services for cross-process events +* Isolation: Support physical isolation, logical isolation + * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md) + * [MultiEnvironment](./src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md): MultiEnvironment + * [MultiTenant](./src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md): Multi-tenancy +* [MinimalAPI](./src/Service/Masa.Contrib.Service.MinimalAPIs/README.md): Support API classification aggregation similar to Controller +* Storage: cloud storage + * [Aliyun Storage](./src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md) +* Operational capacity + * [Auth](./src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md): Authentication and Authorization + * [Dcc](./src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md): Distributed Configuration Center + * [PM](./src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md): Project Management + * [Scheduler](./src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md): Distributed Scheduler + * [TSC](./src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md): Troubleshooting Console + + + +## How to clone +```` +git clone --recursive https://github.com/masastack/MASA.Contrib.git +```` + + + +## How to contribute + +1. Fork & Clone +2. Create Feature_xxx branch +3. Commit with commit message, like `feat(Isolation): Support physical isolation, logical isolation` +4. Create Pull Request + +If you wish to contribute, please [Pull Request](https://github.com/masastack/MASA.BuildingBlocks/pulls), or send us a [Report Bug](https://github.com/masastack/MASA.BuildingBlocks /issues/new) . + + + +## Contributors + +Thanks to all the friends who have contributed to this project. + + + + + + + +## Code of conduct + +This project adopts the Code of Conduct as defined by the Contributors Covenant to clarify the expected behavior of our community. For more information see [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). + + + +## ☀️ License Statement + +[![MASA.Contrib](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) + +Copyright (c) 2021-present MASA Stack \ No newline at end of file diff --git a/src/Contrib/README.zh-CN.md b/src/Contrib/README.zh-CN.md new file mode 100644 index 000000000..5676458a7 --- /dev/null +++ b/src/Contrib/README.zh-CN.md @@ -0,0 +1,104 @@ +中 | [EN](README.md) + +[![codecov](https://codecov.io/gh/masastack/MASA.Contrib/branch/main/graph/badge.svg?token=87TPNHUHW2)](https://codecov.io/gh/masastack/MASA.Contrib) + +# MASA.Contrib + +MASA.Contrib是基于[MASA.BuildingBlocks](https://github.com/masastack/MASA.BuildingBlocks)提供开放, 社区驱动的可重用组件,用于构建网格应用程序。这些组件将被[MASA Stack](https://github.com/masastack)和[MASA Labs](https://github.com/masalabs)等项目使用。 + + + +## 路线图 +* [发行说明](https://github.com/masastack/MASA.Contrib/releases) +* [最新路线图](https://github.com/masastack/MASA.Contrib/issues/42) + + + +## 特性 +* AutoComplete: 使搜索更简单 + * [ElasticSearch](./src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md) +* Configuration: 配置中心 + * [Configuration核心、提供本地配置](./src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md) + * ConfigurationAPI + * [Dcc](./src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md) +* [CQRS](./src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md) +* Data: + * [EntityFrameworkCore](./src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md) + * [SqlServer](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md) + * [Pomelo.MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md): 推荐 + * [MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md) + * [Sqlite](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md) + * [Cosmos](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md) + * [InMemory](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md) + * [Oracle](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md) + * [PostgreSql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md) + * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EF/): 数据规约 + * UoW: 工作单元 + * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md) + * IdGenerator: 唯一ID生成器 + * [NormalGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md): 普通的Guid + * [SequentialGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md): 有序的Guid + * [Snowflake](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md): Single version snowflake id + * [Snowflake.Distributed.Redis](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md): 分布式雪花id + * Mapping: 对象映射 + * [Mapster](./src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md) +* [DDD](./src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md) + * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md): 提供仓储服务 +* Dispatcher + * [EventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md): 进程内事件 + * [IntegrationEventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md): 跨进程事件 + * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md): 为跨进程事件提供消息管理服务 +* Isolation: 支持物理隔离、逻辑隔离 + * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md) + * [MultiEnvironment](./src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md): 多环境 + * [MultiTenant](./src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md): 多租户 +* [MinimalAPI](./src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md): 支持类似Controller的API分类聚合 +* Storage: 云存储 + * [阿里云存储](./src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md) +* 业务能力 + * [Auth](./src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md): 权限认证 + * [Dcc](./src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md): 分布式配置中心 + * [PM](./src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md): 项目管理 + * [Scheduler](./src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md): 分布式调度中心 + * [TSC](./src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md): 故障排除平台 + + +## 如何克隆 +``` +git clone --recursive https://github.com/masastack/MASA.Contrib.git +``` + + + +## 如何贡献 + +1. Fork & Clone +2. Create Feature_xxx branch +3. Commit with commit message, like `feat(Isolation): Support physical isolation, logical isolation` +4. Create Pull Request + +如果你希望参与贡献,欢迎 [Pull Request](https://github.com/masastack/MASA.BuildingBlocks/pulls),或给我们 [报告 Bug](https://github.com/masastack/MASA.BuildingBlocks/issues/new) 。 + + + +## 贡献者 + +感谢所有为本项目做出过贡献的朋友。 + + + + + + + +## 行为准则 + +本项目采用了《贡献者公约》所定义的行为准则,以明确我们社区的预期行为。更多信息请见 [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). + + + +## ☀️ 许可声明 + +[![MASA.Contrib](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) + +Copyright (c) 2021-present MASA Stack \ No newline at end of file diff --git a/docs/LoadEvent.md b/src/Contrib/docs/LoadEvent.md similarity index 100% rename from docs/LoadEvent.md rename to src/Contrib/docs/LoadEvent.md diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj similarity index 79% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj index 0a314a09b..fd6d2ef88 100644 --- a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj +++ b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj similarity index 70% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj index 7521d570c..fdbced3af 100644 --- a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj +++ b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.md b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.md similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.md rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.md diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj similarity index 57% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj index e84f662aa..456821bbb 100644 --- a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj +++ b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs diff --git a/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs similarity index 100% rename from src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs rename to src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/AuthClient.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/AuthClient.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/AuthClient.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/AuthClient.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Constants.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Constants.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Constants.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Constants.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/EnvironmentProvider.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/EnvironmentProvider.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/EnvironmentProvider.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/EnvironmentProvider.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/HttpEnvironmentDelegatingHandler.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/HttpEnvironmentDelegatingHandler.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/HttpEnvironmentDelegatingHandler.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/HttpEnvironmentDelegatingHandler.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj similarity index 70% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj index 7fb81b179..abc121653 100644 --- a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj +++ b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj @@ -13,10 +13,11 @@ - - + + + diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/PermissionService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/PermissionService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/PermissionService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/PermissionService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/ProjectService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/ProjectService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/ProjectService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/ProjectService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/SubjectService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/SubjectService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/SubjectService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/SubjectService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/TeamService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/TeamService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/TeamService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/TeamService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/UserService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/UserService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/UserService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/UserService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/ServiceCollectionExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/ServiceCollectionExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/ServiceCollectionExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/ServiceCollectionExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/_Imports.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/_Imports.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Auth/_Imports.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/_Imports.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/DccClient.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/DccClient.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/DccClient.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/DccClient.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Internal/Constants.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Internal/Constants.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Internal/Constants.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Internal/Constants.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj similarity index 76% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj index 1edbc2844..e87b3a220 100644 --- a/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj +++ b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Service/LabelService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Service/LabelService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Service/LabelService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Service/LabelService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/ServiceCollectionExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/ServiceCollectionExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/ServiceCollectionExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/ServiceCollectionExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/_Imports.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/_Imports.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/_Imports.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/_Imports.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Constants.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Constants.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Constants.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Constants.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/HttpClientAuthorizationDelegatingHandler.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/HttpClientAuthorizationDelegatingHandler.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/HttpClientAuthorizationDelegatingHandler.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/DictionaryExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/DictionaryExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/DictionaryExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/DictionaryExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Helper/TypeHelper.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Helper/TypeHelper.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Helper/TypeHelper.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Helper/TypeHelper.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj similarity index 69% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj index add5246c8..683f3e221 100644 --- a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj +++ b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -7,7 +7,7 @@ - + diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/McClient.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/McClient.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/McClient.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/McClient.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ChannelService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ChannelService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ChannelService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ChannelService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTaskService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTaskService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTaskService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTaskService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTemplateService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTemplateService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTemplateService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTemplateService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ReceiverGroupService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ReceiverGroupService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ReceiverGroupService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ReceiverGroupService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/WebsiteMessageService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/WebsiteMessageService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/WebsiteMessageService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/WebsiteMessageService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/ServiceCollectionExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/ServiceCollectionExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/ServiceCollectionExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/ServiceCollectionExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/_Imports.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/_Imports.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Mc/_Imports.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/_Imports.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Constants.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Constants.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Constants.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Constants.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj similarity index 82% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj index 02f84d061..dd59469b9 100644 --- a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj +++ b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/PmClient.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/PmClient.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/PmClient.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/PmClient.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/AppService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/AppService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/AppService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/AppService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ClusterService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ClusterService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ClusterService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ClusterService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/EnvironmentService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/EnvironmentService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/EnvironmentService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/EnvironmentService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ProjectService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ProjectService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ProjectService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ProjectService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/ServiceCollectionExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/ServiceCollectionExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/ServiceCollectionExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/ServiceCollectionExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/_Imports.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/_Imports.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Pm/_Imports.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/_Imports.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Constants.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Constants.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Constants.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Constants.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/HttpClientAuthorizationDelegatingHandler.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/HttpClientAuthorizationDelegatingHandler.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/HttpClientAuthorizationDelegatingHandler.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj similarity index 62% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj index eac78816a..f8e74bad6 100644 --- a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj +++ b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj @@ -9,10 +9,10 @@ - + - - + + diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/SchedulerClient.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/SchedulerClient.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/SchedulerClient.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/SchedulerClient.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/ServiceCollectionExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/ServiceCollectionExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/ServiceCollectionExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/ServiceCollectionExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerJobService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerJobService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerJobService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerJobService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerTaskService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerTaskService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerTaskService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerTaskService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/_Imports.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/_Imports.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/_Imports.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/_Imports.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/CallerProviderExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/CallerProviderExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/CallerProviderExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/CallerProviderExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/ServiceExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/ServiceExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/ServiceExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/ServiceExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/StreamExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/StreamExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/StreamExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/StreamExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Logging/OpenTelemetryLoggingExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Logging/OpenTelemetryLoggingExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Logging/OpenTelemetryLoggingExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Logging/OpenTelemetryLoggingExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj similarity index 90% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj index 2bfccdb18..d7b4ca258 100644 --- a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj +++ b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/MasaObservableOptions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/MasaObservableOptions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/MasaObservableOptions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/MasaObservableOptions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Metrics/MasaServiceExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Metrics/MasaServiceExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Metrics/MasaServiceExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Metrics/MasaServiceExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTelemetryAttributeName.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTelemetryAttributeName.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTelemetryAttributeName.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTelemetryAttributeName.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/LogService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/LogService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/LogService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/LogService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/MetricService.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/MetricService.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/MetricService.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/MetricService.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/ActivityExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/ActivityExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/ActivityExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/ActivityExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/MasaServiceExtensions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/MasaServiceExtensions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/MasaServiceExtensions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/MasaServiceExtensions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/TscClient.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/TscClient.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/TscClient.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/TscClient.cs diff --git a/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/_Imports.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/_Imports.cs similarity index 100% rename from src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/_Imports.cs rename to src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/_Imports.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj similarity index 86% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj index 59110779b..92a1fa2a8 100644 --- a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj +++ b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md diff --git a/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj similarity index 67% rename from src/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj index c406f0464..2447115a0 100644 --- a/src/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj +++ b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/README.md b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.md similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/README.md rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.md diff --git a/src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md diff --git a/src/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs diff --git a/src/Configuration/Masa.Contrib.Configuration/_Imports.cs b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/_Imports.cs similarity index 100% rename from src/Configuration/Masa.Contrib.Configuration/_Imports.cs rename to src/Contrib/src/Configuration/Masa.Contrib.Configuration/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj similarity index 76% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj index 7a9d3a22d..0b3e325e3 100644 --- a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj +++ b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj similarity index 75% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj index b1245248d..8e8fbcf60 100644 --- a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj +++ b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj @@ -11,8 +11,8 @@ - + - + diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj similarity index 75% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj index 9cde53eba..15d85ee59 100644 --- a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj +++ b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj similarity index 75% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj index 25dc04558..84f5b69de 100644 --- a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj +++ b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj similarity index 78% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj index fcdf60d54..3f84ebda1 100644 --- a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj +++ b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj similarity index 77% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj index 63465297d..31037573b 100644 --- a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj +++ b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs diff --git a/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs similarity index 100% rename from src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs rename to src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj new file mode 100644 index 000000000..c0353a4c1 --- /dev/null +++ b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs b/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs rename to src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj similarity index 72% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj index ac6935f59..1730198a6 100644 --- a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj +++ b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj @@ -9,9 +9,9 @@ - + - + diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj similarity index 72% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj index ac6935f59..1730198a6 100644 --- a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj +++ b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj @@ -9,9 +9,9 @@ - + - + diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj similarity index 80% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj index 5584ad875..ba95d01a3 100644 --- a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj +++ b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.md b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.md similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.md rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.md diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs diff --git a/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs similarity index 100% rename from src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs rename to src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj similarity index 78% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj index d7501f704..2e4ea322c 100644 --- a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj +++ b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs diff --git a/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs similarity index 100% rename from src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs rename to src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj similarity index 63% rename from src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj index efc51b03e..c4feba61c 100644 --- a/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj +++ b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj @@ -7,13 +7,12 @@ - - + + - - + diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs diff --git a/src/Data/Masa.Contrib.Data.Contracts.EF/_Imports.cs b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.Contracts.EF/_Imports.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/_Imports.cs diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/Internal/Const.cs b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Internal/Const.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/Internal/Const.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Internal/Const.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj new file mode 100644 index 000000000..219771c5d --- /dev/null +++ b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/README.md b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/README.md similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/README.md rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/README.md diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/Transaction.cs b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Transaction.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/Transaction.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Transaction.cs diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/_Imports.cs b/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/_Imports.cs similarity index 100% rename from src/Data/Masa.Contrib.Data.UoW.EF/_Imports.cs rename to src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/_Imports.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj similarity index 75% rename from src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj index 63d9d8c8f..f2979af49 100644 --- a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj +++ b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain/DomainEventBus.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/DomainEventBus.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain/DomainEventBus.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/DomainEventBus.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain/DomainService.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/DomainService.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain/DomainService.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/DomainService.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj similarity index 75% rename from src/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj index d65e436fa..fb708972f 100644 --- a/src/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj +++ b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain/README.md b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/README.md similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain/README.md rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/README.md diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs diff --git a/src/Ddd/Masa.Contrib.Ddd.Domain/_Imports.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/_Imports.cs similarity index 100% rename from src/Ddd/Masa.Contrib.Ddd.Domain/_Imports.cs rename to src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/_Imports.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj similarity index 59% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj index 1d1eaa140..b294cca50 100644 --- a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj +++ b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj similarity index 63% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj index 017afc367..e1d63c8fc 100644 --- a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj +++ b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj similarity index 74% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj index 239533585..8e5b7f72a 100644 --- a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj +++ b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj @@ -11,8 +11,9 @@ - + - + + diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.md b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.md similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.md rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.md diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs diff --git a/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs similarity index 100% rename from src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs rename to src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj similarity index 71% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj index a2a742ad9..e08b4cbc8 100644 --- a/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj +++ b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/README.md b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/README.md similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/README.md rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/README.md diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs diff --git a/src/Identity/Masa.Contrib.Identity.IdentityModel/_Imports.cs b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/_Imports.cs similarity index 100% rename from src/Identity/Masa.Contrib.Identity.IdentityModel/_Imports.cs rename to src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/_Imports.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj new file mode 100644 index 000000000..6f8c99ae5 --- /dev/null +++ b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj new file mode 100644 index 000000000..6f8c99ae5 --- /dev/null +++ b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs diff --git a/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj similarity index 81% rename from src/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj index 99c864943..5111e94f6 100644 --- a/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj +++ b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj @@ -12,7 +12,6 @@ - diff --git a/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md diff --git a/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md diff --git a/src/Isolation/Masa.Contrib.Isolation.UoW.EF/_Imports.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/_Imports.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation.UoW.EF/_Imports.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/_Imports.cs diff --git a/src/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs diff --git a/src/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs diff --git a/src/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs diff --git a/src/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs diff --git a/src/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj new file mode 100644 index 000000000..d2a64afdc --- /dev/null +++ b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + diff --git a/src/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs diff --git a/src/Isolation/Masa.Contrib.Isolation/README.md b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/README.md similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation/README.md rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation/README.md diff --git a/src/Isolation/Masa.Contrib.Isolation/README.zh-CN.md b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/README.zh-CN.md similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation/README.zh-CN.md rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation/README.zh-CN.md diff --git a/src/Isolation/Masa.Contrib.Isolation/_Imports.cs b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/_Imports.cs similarity index 100% rename from src/Isolation/Masa.Contrib.Isolation/_Imports.cs rename to src/Contrib/src/Isolation/Masa.Contrib.Isolation/_Imports.cs diff --git a/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs b/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs similarity index 100% rename from src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs rename to src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs diff --git a/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj b/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj similarity index 56% rename from src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj rename to src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj index cea07d657..11ba1e3d6 100644 --- a/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj +++ b/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj @@ -12,8 +12,7 @@ - - + diff --git a/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs b/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs similarity index 100% rename from src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs rename to src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs diff --git a/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md b/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md similarity index 100% rename from src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md rename to src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md diff --git a/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md b/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md similarity index 100% rename from src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md rename to src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md diff --git a/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs b/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs similarity index 100% rename from src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs rename to src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs diff --git a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs similarity index 100% rename from src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs rename to src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs diff --git a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs similarity index 100% rename from src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs rename to src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs diff --git a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj similarity index 73% rename from src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj rename to src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj index 384a6f616..ec818def9 100644 --- a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj +++ b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs similarity index 100% rename from src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs rename to src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs diff --git a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs similarity index 100% rename from src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs rename to src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs diff --git a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md similarity index 100% rename from src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md rename to src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md diff --git a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md similarity index 100% rename from src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md rename to src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md diff --git a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs similarity index 100% rename from src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs rename to src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs diff --git a/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs similarity index 100% rename from src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs rename to src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj similarity index 67% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj index 4095df268..f6c3fabfe 100644 --- a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj +++ b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj similarity index 62% rename from src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj index b9f47bef2..d04a188ec 100644 --- a/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj +++ b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj @@ -7,11 +7,11 @@ - + - + diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj similarity index 67% rename from src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj index 16d56fed9..85386307b 100644 --- a/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj +++ b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj @@ -7,10 +7,10 @@ - + - + - + diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/README.md b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/README.md similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/README.md rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/README.md diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs diff --git a/src/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs similarity index 100% rename from src/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs rename to src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs diff --git a/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj similarity index 75% rename from src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj rename to src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj index b16803553..364cd3abc 100644 --- a/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj +++ b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Service/Masa.Contrib.Service.MinimalAPIs/README.md b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/README.md similarity index 100% rename from src/Service/Masa.Contrib.Service.MinimalAPIs/README.md rename to src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/README.md diff --git a/src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md similarity index 100% rename from src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md rename to src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md diff --git a/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs similarity index 100% rename from src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs rename to src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs diff --git a/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs similarity index 100% rename from src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs rename to src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs diff --git a/src/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs similarity index 100% rename from src/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs rename to src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj similarity index 75% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj index 5f89cc427..5a3f577fe 100644 --- a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj +++ b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs diff --git a/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs b/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs similarity index 100% rename from src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs rename to src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs diff --git a/test/Masa.Contrib.BasicAbility.Auth.Tests/AuthClientTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/AuthClientTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Auth.Tests/AuthClientTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/AuthClientTest.cs diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj new file mode 100644 index 000000000..7bd572c9a --- /dev/null +++ b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj @@ -0,0 +1,27 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + diff --git a/test/Masa.Contrib.BasicAbility.Auth.Tests/PermissionServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/PermissionServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Auth.Tests/PermissionServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/PermissionServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Auth.Tests/ProjectServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/ProjectServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Auth.Tests/ProjectServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/ProjectServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Auth.Tests/SubjectServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/SubjectServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Auth.Tests/SubjectServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/SubjectServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Auth.Tests/TeamServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/TeamServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Auth.Tests/TeamServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/TeamServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Auth.Tests/UserServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/UserServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Auth.Tests/UserServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/UserServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Auth.Tests/_Imports.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Auth.Tests/_Imports.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/_Imports.cs diff --git a/test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/DccClientTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/DccClientTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/DccClientTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/DccClientTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/LabelServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/LabelServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/LabelServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/LabelServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj similarity index 76% rename from test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj index 123206515..a89d78099 100644 --- a/test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj +++ b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -30,8 +30,8 @@ - - + + diff --git a/test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/_Imports.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/_Imports.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/_Imports.cs diff --git a/test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/appsettings.json b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/appsettings.json similarity index 100% rename from test/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/appsettings.json rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/appsettings.json diff --git a/test/Masa.Contrib.BasicAbility.Mc.Tests/ChannelServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ChannelServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Mc.Tests/ChannelServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ChannelServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj similarity index 65% rename from test/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj index 226f1c111..8012c84a7 100644 --- a/test/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj +++ b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj @@ -15,9 +15,8 @@ - - - + + diff --git a/test/Masa.Contrib.BasicAbility.Mc.Tests/McClientTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/McClientTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Mc.Tests/McClientTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/McClientTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Mc.Tests/MessageTaskServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTaskServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Mc.Tests/MessageTaskServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTaskServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Mc.Tests/MessageTemplateServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTemplateServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Mc.Tests/MessageTemplateServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTemplateServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Mc.Tests/ReceiverGroupServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ReceiverGroupServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Mc.Tests/ReceiverGroupServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ReceiverGroupServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Mc.Tests/WebsiteMessageServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/WebsiteMessageServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Mc.Tests/WebsiteMessageServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/WebsiteMessageServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Mc.Tests/_Imports.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Mc.Tests/_Imports.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/_Imports.cs diff --git a/test/Masa.Contrib.BasicAbility.Pm.Tests/AppServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/AppServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Pm.Tests/AppServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/AppServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Pm.Tests/ClusterServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ClusterServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Pm.Tests/ClusterServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ClusterServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Pm.Tests/EnvironmentServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/EnvironmentServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Pm.Tests/EnvironmentServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/EnvironmentServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj similarity index 73% rename from test/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj index d8943bad2..ca6a141da 100644 --- a/test/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj +++ b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj @@ -18,9 +18,8 @@ - - - + + diff --git a/test/Masa.Contrib.BasicAbility.Pm.Tests/PmClientTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/PmClientTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Pm.Tests/PmClientTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/PmClientTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Pm.Tests/ProjectServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ProjectServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Pm.Tests/ProjectServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ProjectServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Pm.Tests/_Imports.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Pm.Tests/_Imports.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/_Imports.cs diff --git a/test/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj similarity index 71% rename from test/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj index 01624c4f7..8195f8453 100644 --- a/test/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj +++ b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj @@ -18,9 +18,8 @@ - - - + + diff --git a/test/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerClientTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerClientTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerClientTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerClientTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerJobServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerJobServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerJobServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerJobServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerTaskServiceTest.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerTaskServiceTest.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerTaskServiceTest.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerTaskServiceTest.cs diff --git a/test/Masa.Contrib.BasicAbility.Scheduler.Tests/_Imports.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Scheduler.Tests/_Imports.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/_Imports.cs diff --git a/test/Masa.Contrib.BasicAbility.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs diff --git a/test/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj similarity index 69% rename from test/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj index 2c1ac968e..213b0d84b 100644 --- a/test/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj +++ b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj @@ -16,8 +16,8 @@ - - + + diff --git a/test/Masa.Contrib.BasicAbility.Tsc.Test/Service/LogServiceTests.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/LogServiceTests.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Tsc.Test/Service/LogServiceTests.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/LogServiceTests.cs diff --git a/test/Masa.Contrib.BasicAbility.Tsc.Test/Service/MetricServiceTests.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/MetricServiceTests.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Tsc.Test/Service/MetricServiceTests.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/MetricServiceTests.cs diff --git a/test/Masa.Contrib.BasicAbility.Tsc.Test/_Imports.cs b/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/_Imports.cs similarity index 100% rename from test/Masa.Contrib.BasicAbility.Tsc.Test/_Imports.cs rename to src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/_Imports.cs diff --git a/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs similarity index 100% rename from test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs diff --git a/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj similarity index 75% rename from test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj index 87fb8782a..be5b9abb1 100644 --- a/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj similarity index 85% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj index ccf0b4ba8..30f97d39c 100644 --- a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj @@ -33,9 +33,9 @@ - - + + diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json diff --git a/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json similarity index 100% rename from test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json diff --git a/test/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/KafkaOptions.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/KafkaOptions.cs similarity index 100% rename from test/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/KafkaOptions.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/KafkaOptions.cs diff --git a/test/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj similarity index 68% rename from test/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj index 3f9de168b..a4416f595 100644 --- a/test/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj similarity index 62% rename from test/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj index ab6df9050..fe17a392b 100644 --- a/test/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/MountSectionRedisOptions.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/MountSectionRedisOptions.cs similarity index 100% rename from test/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/MountSectionRedisOptions.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/MountSectionRedisOptions.cs diff --git a/test/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/_Imports.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/_Imports.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs similarity index 100% rename from test/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs diff --git a/test/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs similarity index 100% rename from test/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs diff --git a/test/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs similarity index 100% rename from test/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs diff --git a/test/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs similarity index 100% rename from test/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs diff --git a/test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj similarity index 93% rename from test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj index 4a044c889..2791c5711 100644 --- a/test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -21,14 +21,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - + @@ -47,5 +40,12 @@ Always + + + + + + + diff --git a/test/Masa.Contrib.Configuration.Tests/_Imports.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Configuration.Tests/_Imports.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Configuration.Tests/appsettings.json b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/appsettings.json similarity index 100% rename from test/Masa.Contrib.Configuration.Tests/appsettings.json rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/appsettings.json diff --git a/test/Masa.Contrib.Configuration.Tests/customAppConfig.json b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/customAppConfig.json similarity index 100% rename from test/Masa.Contrib.Configuration.Tests/customAppConfig.json rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/customAppConfig.json diff --git a/test/Masa.Contrib.Configuration.Tests/rabbitMq.json b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/rabbitMq.json similarity index 100% rename from test/Masa.Contrib.Configuration.Tests/rabbitMq.json rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/rabbitMq.json diff --git a/test/Masa.Contrib.Configuration.Tests/redis.json b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/redis.json similarity index 100% rename from test/Masa.Contrib.Configuration.Tests/redis.json rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/redis.json diff --git a/test/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs b/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs similarity index 100% rename from test/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs rename to src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs diff --git a/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj b/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj new file mode 100644 index 000000000..b5abf503c --- /dev/null +++ b/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/test/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs b/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs rename to src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs b/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs similarity index 100% rename from test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs rename to src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs diff --git a/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj b/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj new file mode 100644 index 000000000..4d37a0092 --- /dev/null +++ b/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs b/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs rename to src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj new file mode 100644 index 000000000..0ee173290 --- /dev/null +++ b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + false + + + + + + + + + + + + + + diff --git a/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs similarity index 100% rename from test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs diff --git a/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Benchmarks.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Benchmarks.cs similarity index 100% rename from test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Benchmarks.cs rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Benchmarks.cs diff --git a/test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/DistributedBenchmarks.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/DistributedBenchmarks.cs similarity index 100% rename from test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/DistributedBenchmarks.cs rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/DistributedBenchmarks.cs diff --git a/test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj similarity index 64% rename from test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj index 0aadbea05..32c9e5f7b 100644 --- a/test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj +++ b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj @@ -16,8 +16,7 @@ - - + diff --git a/test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Program.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Program.cs similarity index 100% rename from test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Program.cs rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Program.cs diff --git a/test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/_Imports.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/_Imports.cs rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs similarity index 100% rename from test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs diff --git a/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs similarity index 100% rename from test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs diff --git a/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj similarity index 65% rename from test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj index 51db54437..8d2a9951b 100644 --- a/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj +++ b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj @@ -14,8 +14,7 @@ - - + diff --git a/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs rename to src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj similarity index 70% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj index b1bf3399b..573aa17dd 100644 --- a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj +++ b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj @@ -16,8 +16,8 @@ - - + + diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs diff --git a/test/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs b/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs rename to src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs b/src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs similarity index 100% rename from test/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs diff --git a/test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj b/src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj similarity index 90% rename from test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj rename to src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj index 89f5e6f7d..a614fdd84 100644 --- a/test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj +++ b/src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/test/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs b/src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj similarity index 65% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj index 6661ec7b3..3bb6fe0aa 100644 --- a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj +++ b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj @@ -18,10 +18,9 @@ - - - - + + + diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs diff --git a/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs similarity index 100% rename from test/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs diff --git a/test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj b/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj similarity index 82% rename from test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj rename to src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj index 28853936b..a4c006863 100644 --- a/test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj +++ b/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj @@ -29,12 +29,6 @@ - - - - - - @@ -42,4 +36,10 @@ + + + + + + diff --git a/test/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs b/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs similarity index 100% rename from test/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs diff --git a/test/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs b/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs similarity index 100% rename from test/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs diff --git a/test/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs b/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs rename to src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json b/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json similarity index 100% rename from test/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json rename to src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json diff --git a/test/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/RegisterUserDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/RegisterUserDomainEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/RegisterUserDomainEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/RegisterUserDomainEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/UpdateUserDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/UpdateUserDomainEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/UpdateUserDomainEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/UpdateUserDomainEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Entities.Tests/Events/RegisterUserEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Events/RegisterUserEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Entities.Tests/Events/RegisterUserEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Events/RegisterUserEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj similarity index 71% rename from test/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj index 5ea8a41bd..6abf2488b 100644 --- a/test/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj +++ b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Masa.Contrib.Ddd.Domain.Entities.Tests/User.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/User.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Entities.Tests/User.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/User.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Entities.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Entities.Tests/_Imports.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Integrated.Tests/CustomDbContext.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/CustomDbContext.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Integrated.Tests/CustomDbContext.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/CustomDbContext.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Integrated.Tests/DomainEventTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/DomainEventTest.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Integrated.Tests/DomainEventTest.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/DomainEventTest.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Integrated.Tests/Handlers/UserHandler.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Handlers/UserHandler.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Integrated.Tests/Handlers/UserHandler.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Handlers/UserHandler.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj similarity index 55% rename from test/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj index e703abce6..f72e01398 100644 --- a/test/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj +++ b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj @@ -22,13 +22,13 @@ - - - - - - - + + + + + + + diff --git a/test/Masa.Contrib.Ddd.Domain.Integrated.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Integrated.Tests/_Imports.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Entities/User.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Entities/User.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Entities/User.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Entities/User.cs diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj new file mode 100644 index 000000000..745b2b5ed --- /dev/null +++ b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + false + + + + + + + diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Repositories/IUserRepository.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Repositories/IUserRepository.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Repositories/IUserRepository.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Repositories/IUserRepository.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/_Imports.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/BaseRepositoryTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/BaseRepositoryTest.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/BaseRepositoryTest.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/BaseRepositoryTest.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Repositories/IOrderRepository.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Repositories/IOrderRepository.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Repositories/IOrderRepository.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Repositories/IOrderRepository.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/CustomDbContext.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/CustomDbContext.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/CustomDbContext.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/CustomDbContext.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/Repositories/OrderRepository.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/Repositories/OrderRepository.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/Repositories/OrderRepository.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/Repositories/OrderRepository.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj similarity index 76% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj index f13787c92..205d9be33 100644 --- a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj +++ b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj @@ -23,9 +23,9 @@ - - - + + + diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/TestBase.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/TestBase.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/TestBase.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/TestBase.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/DomainIntegrationEventBusTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainIntegrationEventBusTest.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/DomainIntegrationEventBusTest.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainIntegrationEventBusTest.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/AddUserIntegrationDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/AddUserIntegrationDomainEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/AddUserIntegrationDomainEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/AddUserIntegrationDomainEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/CreateProductDomainCommand.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CreateProductDomainCommand.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/CreateProductDomainCommand.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CreateProductDomainCommand.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainCommand.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainCommand.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainCommand.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainCommand.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/ForgetPasswordEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ForgetPasswordEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/ForgetPasswordEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ForgetPasswordEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentFailedIntegrationDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentFailedIntegrationDomainEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentFailedIntegrationDomainEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentFailedIntegrationDomainEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededDomainEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededDomainEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededDomainEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededIntegraionDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededIntegraionDomainEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededIntegraionDomainEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededIntegraionDomainEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/ProductItemDomainQuery.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ProductItemDomainQuery.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/ProductItemDomainQuery.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ProductItemDomainQuery.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Events/RegisterUserSucceededDomainIntegrationEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/RegisterUserSucceededDomainIntegrationEvent.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Events/RegisterUserSucceededDomainIntegrationEvent.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/RegisterUserSucceededDomainIntegrationEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Handlers/PaymentSucceededDomainEventHandller.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Handlers/PaymentSucceededDomainEventHandller.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Handlers/PaymentSucceededDomainEventHandller.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Handlers/PaymentSucceededDomainEventHandller.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj similarity index 85% rename from test/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj index e7826da78..3a5fbcc20 100644 --- a/test/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj +++ b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj @@ -24,8 +24,8 @@ - - + + diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/Services/UserDomainService.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Services/UserDomainService.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/Services/UserDomainService.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Services/UserDomainService.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Ddd.Domain.Tests/_Imports.cs rename to src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Benchmarks.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Benchmarks.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Benchmarks.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Benchmarks.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/AddShoppingCartEventHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/AddShoppingCartEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/AddShoppingCartEventHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/AddShoppingCartEventHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/CouponHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/CouponHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/CouponHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/CouponHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/AddShoppingCartEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/AddShoppingCartEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/AddShoppingCartEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/AddShoppingCartEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/RegisterUserEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/RegisterUserEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/RegisterUserEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/RegisterUserEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Middleware/LoggingMiddleware.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Middleware/LoggingMiddleware.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Middleware/LoggingMiddleware.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Middleware/LoggingMiddleware.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj similarity index 85% rename from test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj index 075382f3f..f549a7ca6 100644 --- a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj @@ -17,7 +17,7 @@ - + diff --git a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Program.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Program.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Program.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Program.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs diff --git a/test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj similarity index 67% rename from test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj index 3025feb10..a6f4ae16e 100644 --- a/test/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj @@ -2,13 +2,13 @@ net6.0 - enable enable + enable false - + diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj similarity index 67% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj index b6c588b8d..1e592be80 100644 --- a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj similarity index 67% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj index b6c588b8d..1e592be80 100644 --- a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj similarity index 67% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj index b6c588b8d..1e592be80 100644 --- a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj similarity index 67% rename from test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj index b6c588b8d..1e592be80 100644 --- a/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj similarity index 67% rename from test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj index b6c588b8d..1e592be80 100644 --- a/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj similarity index 67% rename from test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj index b6c588b8d..1e592be80 100644 --- a/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/CustomDbContext.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/CustomDbContext.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/CustomDbContext.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/CustomDbContext.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/CouponHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/CouponHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/CouponHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/CouponHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj similarity index 84% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj index ce0f0c7a5..6465510fc 100644 --- a/test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj @@ -8,10 +8,6 @@ enable - - - - all @@ -25,14 +21,14 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + + @@ -42,4 +38,5 @@ + diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs diff --git a/test/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj similarity index 89% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj index 2112fe88d..2a3bc520e 100644 --- a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj @@ -25,8 +25,9 @@ - + + diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj similarity index 78% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj index c84c7ec4a..961dbf481 100644 --- a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj @@ -24,8 +24,8 @@ - - + + diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj similarity index 89% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj index 64bc0d514..6a62382b6 100644 --- a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj @@ -24,7 +24,7 @@ - + diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs diff --git a/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Application/Command/RegisterUserCommand.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Command/RegisterUserCommand.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Application/Command/RegisterUserCommand.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Command/RegisterUserCommand.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Application/Events/AddGoodsIntegrationEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/AddGoodsIntegrationEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Application/Events/AddGoodsIntegrationEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/AddGoodsIntegrationEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Application/Events/RegisterUserEvent.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/RegisterUserEvent.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Application/Events/RegisterUserEvent.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/RegisterUserEvent.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQuery.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQuery.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQuery.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQuery.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQueryValidator.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQueryValidator.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQueryValidator.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQueryValidator.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQuery.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQuery.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQuery.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQuery.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQueryValidator.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQueryValidator.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQueryValidator.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQueryValidator.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Application/UserHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/UserHandler.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Application/UserHandler.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/UserHandler.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Domain/Aggregate/User.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Domain/Aggregate/User.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Domain/Aggregate/User.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Domain/Aggregate/User.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Infrastructure/CustomDbContext.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/CustomDbContext.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Infrastructure/CustomDbContext.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/CustomDbContext.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DefaultPublisher.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DefaultPublisher.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DefaultPublisher.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DefaultPublisher.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/RecordMiddleware.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/RecordMiddleware.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/RecordMiddleware.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/RecordMiddleware.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/ValidatorMiddleware.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/ValidatorMiddleware.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/ValidatorMiddleware.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/ValidatorMiddleware.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj new file mode 100644 index 000000000..15dd0abec --- /dev/null +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj @@ -0,0 +1,35 @@ + + + + net6.0 + enable + enable + + false + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + diff --git a/test/Masa.Contrib.Dispatcher.Tests/TestBase.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestBase.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/TestBase.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestBase.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/TestDispatcher.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestDispatcher.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/TestDispatcher.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestDispatcher.cs diff --git a/test/Masa.Contrib.Dispatcher.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Dispatcher.Tests/_Imports.cs rename to src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj b/src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj similarity index 90% rename from test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj rename to src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj index 8e8d78456..1914264ee 100644 --- a/test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj +++ b/src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj @@ -24,7 +24,7 @@ - + diff --git a/test/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs b/src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs similarity index 100% rename from test/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs rename to src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs diff --git a/test/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs b/src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs rename to src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj similarity index 88% rename from test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj index 1fb90cbfa..b9caa698c 100644 --- a/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj +++ b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs similarity index 100% rename from test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs diff --git a/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs similarity index 100% rename from test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs diff --git a/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj similarity index 89% rename from test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj index 670127c7a..5645c2a13 100644 --- a/test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj +++ b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs similarity index 100% rename from test/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs diff --git a/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs similarity index 100% rename from test/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs diff --git a/test/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj similarity index 74% rename from test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj index 38b6dd55e..ad5adeef8 100644 --- a/test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj +++ b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj @@ -23,9 +23,9 @@ - - - + + + diff --git a/test/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs similarity index 100% rename from test/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs diff --git a/test/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs similarity index 100% rename from test/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs diff --git a/test/Masa.Contrib.Isolation.Tests/TestIsolation.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestIsolation.cs similarity index 100% rename from test/Masa.Contrib.Isolation.Tests/TestIsolation.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestIsolation.cs diff --git a/test/Masa.Contrib.Isolation.Tests/TestParserProvider.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestParserProvider.cs similarity index 100% rename from test/Masa.Contrib.Isolation.Tests/TestParserProvider.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestParserProvider.cs diff --git a/test/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs similarity index 100% rename from test/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs diff --git a/test/Masa.Contrib.Isolation.Tests/_Imports.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Isolation.Tests/_Imports.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj similarity index 61% rename from test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj index a5bd40440..215382c3f 100644 --- a/test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj +++ b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj @@ -22,19 +22,19 @@ - - - - - - - - - Always + + + + + + + + + diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj similarity index 52% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj index a228162a8..18472f3e1 100644 --- a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj +++ b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj @@ -15,14 +15,6 @@ - - - - - - - - @@ -30,4 +22,14 @@ + + + + + + + + + + diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json similarity index 100% rename from test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json rename to src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json diff --git a/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs b/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs similarity index 100% rename from test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs rename to src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs diff --git a/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs b/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs similarity index 100% rename from test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs rename to src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs diff --git a/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs b/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs similarity index 100% rename from test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs rename to src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs diff --git a/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj b/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj similarity index 80% rename from test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj rename to src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj index 0bbf33722..2f7e1c2c5 100644 --- a/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj +++ b/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj @@ -23,8 +23,8 @@ - - + + diff --git a/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs b/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs similarity index 100% rename from test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs rename to src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs diff --git a/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs b/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs similarity index 100% rename from test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs rename to src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs diff --git a/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs b/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs rename to src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs diff --git a/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs b/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs similarity index 100% rename from test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs rename to src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs diff --git a/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj b/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj similarity index 86% rename from test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj rename to src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj index fd4bde057..aa4160f50 100644 --- a/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj +++ b/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs b/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs similarity index 100% rename from test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs rename to src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs diff --git a/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs b/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs rename to src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj similarity index 69% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj index 6c4f3a01d..df28da5c6 100644 --- a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj +++ b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj @@ -20,9 +20,9 @@ - - - + + + diff --git a/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/CallerTest.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/CallerTest.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/CallerTest.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/CallerTest.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj new file mode 100644 index 000000000..e1171c174 --- /dev/null +++ b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + + + + diff --git a/test/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs diff --git a/test/Masa.Contrib.Service.Caller.Tests/_Imports.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Service.Caller.Tests/_Imports.cs rename to src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj b/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj similarity index 89% rename from test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj rename to src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj index 2bbfbe177..925fbecfc 100644 --- a/test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj +++ b/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj @@ -23,7 +23,7 @@ - + - + diff --git a/test/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs b/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs similarity index 100% rename from test/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs rename to src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs diff --git a/test/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs b/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs similarity index 100% rename from test/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs rename to src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs diff --git a/test/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs b/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs rename to src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj similarity index 91% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj index 132322e2b..8738152a9 100644 --- a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj +++ b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj @@ -24,14 +24,14 @@ - - - - Always + + + + diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs diff --git a/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json b/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json similarity index 100% rename from test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json rename to src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj b/src/Data/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj deleted file mode 100644 index be78651f6..000000000 --- a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - - - diff --git a/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj b/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj deleted file mode 100644 index 94c27db47..000000000 --- a/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj b/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj deleted file mode 100644 index 6afb27526..000000000 --- a/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj b/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj deleted file mode 100644 index 6afb27526..000000000 --- a/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj b/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj deleted file mode 100644 index f754966c6..000000000 --- a/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - diff --git a/src/Utils/Directory.Build.props b/src/Utils/Directory.Build.props new file mode 100644 index 000000000..7b728acf8 --- /dev/null +++ b/src/Utils/Directory.Build.props @@ -0,0 +1,18 @@ + + + 6.0.0 + 3.19.1 + 2.2.4 + 2.2.3 + 16.9.4 + 3.0.2 + 4.16.1 + 7.17.4 + 6.0.1 + 2.40.0 + 1.5.0 + 6.15.0 + 11.1.0 + 11.1.2 + + diff --git a/src/Utils/Masa.Utils.sln b/src/Utils/Masa.Utils.sln new file mode 100644 index 000000000..3b75c81a6 --- /dev/null +++ b/src/Utils/Masa.Utils.sln @@ -0,0 +1,320 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31606.5 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D956582F-4071-47E6-A8E7-4C5A83770045}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{2852693E-7C18-4031-AF92-DA423BD0B3D8}" + ProjectSection(SolutionItems) = preProject + .gitignore = .gitignore + README.md = README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{AC4B880D-01C6-4D9C-AE55-21A1A0E5E3DB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching", "Caching", "{A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{9EA04A94-80C6-4352-8758-F4B65691AE4A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{F844C2A1-C36D-400E-A0D8-7658EF9C3B93}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{4F908878-0EB8-43E4-96E4-8B1F32E9B635}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{72E67141-9CD8-48A9-B27B-F0C924FD4A12}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development", "{598A7DA7-898E-429B-992A-B0E586DADA35}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Core", "src\Caching\Masa.Utils.Caching.Core\Masa.Utils.Caching.Core.csproj", "{91A68564-07EA-439D-BED3-EFC068A159D0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.DistributedMemory", "src\Caching\Masa.Utils.Caching.DistributedMemory\Masa.Utils.Caching.DistributedMemory.csproj", "{9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Memory", "src\Caching\Masa.Utils.Caching.Memory\Masa.Utils.Caching.Memory.csproj", "{F75C5658-C7EB-4922-833F-9052D9723487}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis", "src\Caching\Masa.Utils.Caching.Redis\Masa.Utils.Caching.Redis.csproj", "{246AA228-57AC-40B4-9BE1-EC75B8C3FC10}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core", "src\Caller\Masa.Utils.Caller.Core\Masa.Utils.Caller.Core.csproj", "{AE2109F8-6772-41A8-88C3-8E603BA29144}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.DaprClient", "src\Caller\Masa.Utils.Caller.DaprClient\Masa.Utils.Caller.DaprClient.csproj", "{A489F659-7925-475E-A82E-EFEE846C24C8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.HttpClient", "src\Caller\Masa.Utils.Caller.HttpClient\Masa.Utils.Caller.HttpClient.csproj", "{ACE02BC6-04E9-48F5-BF1A-C5591366F72A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Dcc", "src\Configuration\Masa.Utils.Configuration.Dcc\Masa.Utils.Configuration.Dcc.csproj", "{31A832FC-2AC6-4540-A659-1DCFF7882102}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Json", "src\Configuration\Masa.Utils.Configuration.Json\Masa.Utils.Configuration.Json.csproj", "{4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations", "src\Data\Masa.Utils.Data.DataAnnotations\Masa.Utils.Data.DataAnnotations.csproj", "{AAC6E291-48D8-41AD-99C0-5B085EB88F81}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch", "src\Data\Masa.Utils.Data.Elasticsearch\Masa.Utils.Data.Elasticsearch.csproj", "{306184FE-65BE-4763-A86E-D84BBB8CFDDF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr", "src\Development\Masa.Utils.Development.Dapr\Masa.Utils.Development.Dapr.csproj", "{14FDF393-49F1-4D41-9EC0-FF493BDDE376}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr.AspNetCore", "src\Development\Masa.Utils.Development.Dapr.AspNetCore\Masa.Utils.Development.Dapr.AspNetCore.csproj", "{BA28042B-25C1-4361-A836-5710BF271EEF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Enums", "src\Extensions\Masa.Utils.Extensions.Enums\Masa.Utils.Extensions.Enums.csproj", "{56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Expressions", "src\Extensions\Masa.Utils.Extensions.Expressions\Masa.Utils.Extensions.Expressions.csproj", "{22FB9445-2337-43F7-AEFB-6E349619CBB1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection", "src\Extensions\Masa.Utils.Extensions.DependencyInjection\Masa.Utils.Extensions.DependencyInjection.csproj", "{6CC1E189-9249-44BB-B0C9-E13D173E85CE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DotNet", "src\Extensions\Masa.Utils.Extensions.DotNet\Masa.Utils.Extensions.DotNet.csproj", "{3244CF56-A19C-4A5B-B479-79DA704BDBB2}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Exceptions", "src\Masa.Utils.Exceptions\Masa.Utils.Exceptions.csproj", "{8D573300-4173-41CA-A4C8-BAA49A89B4F8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Models.Config", "src\Models\Masa.Utils.Models.Config\Masa.Utils.Models.Config.csproj", "{333E1D7C-780F-4917-A823-8B369F1D278C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication", "src\Security\Masa.Utils.Security.Authentication\Masa.Utils.Security.Authentication.csproj", "{83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography", "src\Security\Masa.Utils.Security.Cryptography\Masa.Utils.Security.Cryptography.csproj", "{C9D66303-AE01-4D8C-A69E-82B620007EBD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Token", "src\Security\Masa.Utils.Security.Token\Masa.Utils.Security.Token.csproj", "{4A3B1928-5014-4D81-BB83-FDCD0652D067}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations.Tests", "test\Masa.Utils.Data.DataAnnotations.Tests\Masa.Utils.Data.DataAnnotations.Tests.csproj", "{52B3A8FE-A553-4D65-8660-447F120616AB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography.Tests", "test\Masa.Utils.Security.Cryptography.Tests\Masa.Utils.Security.Cryptography.Tests.csproj", "{1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core.Tests", "test\Masa.Utils.Caller.Core.Tests\Masa.Utils.Caller.Core.Tests.csproj", "{4B351F95-5919-46A9-A02F-F4409C9EA79A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.IntegratedTests", "test\Masa.Utils.Caller.IntegratedTests\Masa.Utils.Caller.IntegratedTests.csproj", "{D5E09920-081B-478C-B77B-EAB77931F47D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Tests", "test\Masa.Utils.Caller.Tests\Masa.Utils.Caller.Tests.csproj", "{276B4CDC-BD8F-4563-A82A-B46724C9F4B0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ldap", "Ldap", "{59124A98-14AF-4201-87D7-6DC9C92D9849}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell", "src\Ldap\Masa.Utils.Ldap.Novell\Masa.Utils.Ldap.Novell.csproj", "{E62E5E11-7119-4782-BCF4-A5913F4048FE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell.Tests", "test\Masa.Utils.Ldap.Tests\Masa.Utils.Ldap.Novell.Tests\Masa.Utils.Ldap.Novell.Tests.csproj", "{F6242694-66A5-4E59-9ECD-510D3D81C8C6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch.Tests", "test\Masa.Utils.Data.Elasticsearch.Tests\Masa.Utils.Data.Elasticsearch.Tests.csproj", "{EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis.Tests", "test\Masa.Utils.Caching.Redis.Tests\Masa.Utils.Caching.Redis.Tests.csproj", "{B063C9CC-868A-4474-8DCD-1708A65D4F2A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Tests", "test\Masa.Utils.Extensions.DependencyInjection.Tests\Masa.Utils.Extensions.DependencyInjection.Tests.csproj", "{20960ED7-76FC-4DBD-8358-1A424D1E0DC1}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Repository.Tests", "test\Masa.Utils.Extensions.DependencyInjection.Repository.Tests\Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj", "{22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Validations", "Validations", "{533BCE80-61BC-443A-95D3-2C6328921ED8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Validations.FluentValidation", "src\Extensions\Validations\Masa.Utils.Extensions.Validations.FluentValidation\Masa.Utils.Extensions.Validations.FluentValidation.csproj", "{B0E3CA19-C101-4E30-9401-C017B7088F4E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication.OpenIdConnect", "src\Security\Masa.Utils.Security.Authentication.OpenIdConnect\Masa.Utils.Security.Authentication.OpenIdConnect.csproj", "{D17B5B36-5773-4827-9D5D-44390DF666CA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus", "src\Data\Masa.Utils.Data.Prometheus\Masa.Utils.Data.Prometheus.csproj", "{81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus.Test", "test\Masa.Utils.Data.Prometheus.Test\Masa.Utils.Data.Prometheus.Test.csproj", "{CAB4132B-82E4-4B37-AF05-7F446DE3AF04}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {91A68564-07EA-439D-BED3-EFC068A159D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {91A68564-07EA-439D-BED3-EFC068A159D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {91A68564-07EA-439D-BED3-EFC068A159D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {91A68564-07EA-439D-BED3-EFC068A159D0}.Release|Any CPU.Build.0 = Release|Any CPU + {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}.Release|Any CPU.Build.0 = Release|Any CPU + {F75C5658-C7EB-4922-833F-9052D9723487}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F75C5658-C7EB-4922-833F-9052D9723487}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F75C5658-C7EB-4922-833F-9052D9723487}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F75C5658-C7EB-4922-833F-9052D9723487}.Release|Any CPU.Build.0 = Release|Any CPU + {246AA228-57AC-40B4-9BE1-EC75B8C3FC10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {246AA228-57AC-40B4-9BE1-EC75B8C3FC10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {246AA228-57AC-40B4-9BE1-EC75B8C3FC10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {246AA228-57AC-40B4-9BE1-EC75B8C3FC10}.Release|Any CPU.Build.0 = Release|Any CPU + {AE2109F8-6772-41A8-88C3-8E603BA29144}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AE2109F8-6772-41A8-88C3-8E603BA29144}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AE2109F8-6772-41A8-88C3-8E603BA29144}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AE2109F8-6772-41A8-88C3-8E603BA29144}.Release|Any CPU.Build.0 = Release|Any CPU + {A489F659-7925-475E-A82E-EFEE846C24C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A489F659-7925-475E-A82E-EFEE846C24C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A489F659-7925-475E-A82E-EFEE846C24C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A489F659-7925-475E-A82E-EFEE846C24C8}.Release|Any CPU.Build.0 = Release|Any CPU + {ACE02BC6-04E9-48F5-BF1A-C5591366F72A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ACE02BC6-04E9-48F5-BF1A-C5591366F72A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ACE02BC6-04E9-48F5-BF1A-C5591366F72A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ACE02BC6-04E9-48F5-BF1A-C5591366F72A}.Release|Any CPU.Build.0 = Release|Any CPU + {31A832FC-2AC6-4540-A659-1DCFF7882102}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {31A832FC-2AC6-4540-A659-1DCFF7882102}.Debug|Any CPU.Build.0 = Debug|Any CPU + {31A832FC-2AC6-4540-A659-1DCFF7882102}.Release|Any CPU.ActiveCfg = Release|Any CPU + {31A832FC-2AC6-4540-A659-1DCFF7882102}.Release|Any CPU.Build.0 = Release|Any CPU + {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}.Release|Any CPU.Build.0 = Release|Any CPU + {AAC6E291-48D8-41AD-99C0-5B085EB88F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AAC6E291-48D8-41AD-99C0-5B085EB88F81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AAC6E291-48D8-41AD-99C0-5B085EB88F81}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AAC6E291-48D8-41AD-99C0-5B085EB88F81}.Release|Any CPU.Build.0 = Release|Any CPU + {306184FE-65BE-4763-A86E-D84BBB8CFDDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {306184FE-65BE-4763-A86E-D84BBB8CFDDF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {306184FE-65BE-4763-A86E-D84BBB8CFDDF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {306184FE-65BE-4763-A86E-D84BBB8CFDDF}.Release|Any CPU.Build.0 = Release|Any CPU + {14FDF393-49F1-4D41-9EC0-FF493BDDE376}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14FDF393-49F1-4D41-9EC0-FF493BDDE376}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14FDF393-49F1-4D41-9EC0-FF493BDDE376}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14FDF393-49F1-4D41-9EC0-FF493BDDE376}.Release|Any CPU.Build.0 = Release|Any CPU + {BA28042B-25C1-4361-A836-5710BF271EEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA28042B-25C1-4361-A836-5710BF271EEF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA28042B-25C1-4361-A836-5710BF271EEF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA28042B-25C1-4361-A836-5710BF271EEF}.Release|Any CPU.Build.0 = Release|Any CPU + {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}.Release|Any CPU.Build.0 = Release|Any CPU + {22FB9445-2337-43F7-AEFB-6E349619CBB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22FB9445-2337-43F7-AEFB-6E349619CBB1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22FB9445-2337-43F7-AEFB-6E349619CBB1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22FB9445-2337-43F7-AEFB-6E349619CBB1}.Release|Any CPU.Build.0 = Release|Any CPU + {6CC1E189-9249-44BB-B0C9-E13D173E85CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6CC1E189-9249-44BB-B0C9-E13D173E85CE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6CC1E189-9249-44BB-B0C9-E13D173E85CE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6CC1E189-9249-44BB-B0C9-E13D173E85CE}.Release|Any CPU.Build.0 = Release|Any CPU + {3244CF56-A19C-4A5B-B479-79DA704BDBB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3244CF56-A19C-4A5B-B479-79DA704BDBB2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3244CF56-A19C-4A5B-B479-79DA704BDBB2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3244CF56-A19C-4A5B-B479-79DA704BDBB2}.Release|Any CPU.Build.0 = Release|Any CPU + {8D573300-4173-41CA-A4C8-BAA49A89B4F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D573300-4173-41CA-A4C8-BAA49A89B4F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D573300-4173-41CA-A4C8-BAA49A89B4F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D573300-4173-41CA-A4C8-BAA49A89B4F8}.Release|Any CPU.Build.0 = Release|Any CPU + {333E1D7C-780F-4917-A823-8B369F1D278C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {333E1D7C-780F-4917-A823-8B369F1D278C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {333E1D7C-780F-4917-A823-8B369F1D278C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {333E1D7C-780F-4917-A823-8B369F1D278C}.Release|Any CPU.Build.0 = Release|Any CPU + {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}.Release|Any CPU.Build.0 = Release|Any CPU + {C9D66303-AE01-4D8C-A69E-82B620007EBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9D66303-AE01-4D8C-A69E-82B620007EBD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9D66303-AE01-4D8C-A69E-82B620007EBD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9D66303-AE01-4D8C-A69E-82B620007EBD}.Release|Any CPU.Build.0 = Release|Any CPU + {4A3B1928-5014-4D81-BB83-FDCD0652D067}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A3B1928-5014-4D81-BB83-FDCD0652D067}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A3B1928-5014-4D81-BB83-FDCD0652D067}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A3B1928-5014-4D81-BB83-FDCD0652D067}.Release|Any CPU.Build.0 = Release|Any CPU + {52B3A8FE-A553-4D65-8660-447F120616AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {52B3A8FE-A553-4D65-8660-447F120616AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {52B3A8FE-A553-4D65-8660-447F120616AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {52B3A8FE-A553-4D65-8660-447F120616AB}.Release|Any CPU.Build.0 = Release|Any CPU + {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}.Release|Any CPU.Build.0 = Release|Any CPU + {4B351F95-5919-46A9-A02F-F4409C9EA79A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B351F95-5919-46A9-A02F-F4409C9EA79A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B351F95-5919-46A9-A02F-F4409C9EA79A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B351F95-5919-46A9-A02F-F4409C9EA79A}.Release|Any CPU.Build.0 = Release|Any CPU + {D5E09920-081B-478C-B77B-EAB77931F47D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5E09920-081B-478C-B77B-EAB77931F47D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5E09920-081B-478C-B77B-EAB77931F47D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5E09920-081B-478C-B77B-EAB77931F47D}.Release|Any CPU.Build.0 = Release|Any CPU + {276B4CDC-BD8F-4563-A82A-B46724C9F4B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {276B4CDC-BD8F-4563-A82A-B46724C9F4B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {276B4CDC-BD8F-4563-A82A-B46724C9F4B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {276B4CDC-BD8F-4563-A82A-B46724C9F4B0}.Release|Any CPU.Build.0 = Release|Any CPU + {E62E5E11-7119-4782-BCF4-A5913F4048FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E62E5E11-7119-4782-BCF4-A5913F4048FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E62E5E11-7119-4782-BCF4-A5913F4048FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E62E5E11-7119-4782-BCF4-A5913F4048FE}.Release|Any CPU.Build.0 = Release|Any CPU + {F6242694-66A5-4E59-9ECD-510D3D81C8C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6242694-66A5-4E59-9ECD-510D3D81C8C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6242694-66A5-4E59-9ECD-510D3D81C8C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6242694-66A5-4E59-9ECD-510D3D81C8C6}.Release|Any CPU.Build.0 = Release|Any CPU + {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}.Release|Any CPU.Build.0 = Release|Any CPU + {B063C9CC-868A-4474-8DCD-1708A65D4F2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B063C9CC-868A-4474-8DCD-1708A65D4F2A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B063C9CC-868A-4474-8DCD-1708A65D4F2A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B063C9CC-868A-4474-8DCD-1708A65D4F2A}.Release|Any CPU.Build.0 = Release|Any CPU + {20960ED7-76FC-4DBD-8358-1A424D1E0DC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20960ED7-76FC-4DBD-8358-1A424D1E0DC1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20960ED7-76FC-4DBD-8358-1A424D1E0DC1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20960ED7-76FC-4DBD-8358-1A424D1E0DC1}.Release|Any CPU.Build.0 = Release|Any CPU + {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}.Release|Any CPU.Build.0 = Release|Any CPU + {B0E3CA19-C101-4E30-9401-C017B7088F4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0E3CA19-C101-4E30-9401-C017B7088F4E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0E3CA19-C101-4E30-9401-C017B7088F4E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0E3CA19-C101-4E30-9401-C017B7088F4E}.Release|Any CPU.Build.0 = Release|Any CPU + {D17B5B36-5773-4827-9D5D-44390DF666CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D17B5B36-5773-4827-9D5D-44390DF666CA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D17B5B36-5773-4827-9D5D-44390DF666CA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D17B5B36-5773-4827-9D5D-44390DF666CA}.Release|Any CPU.Build.0 = Release|Any CPU + {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}.Release|Any CPU.Build.0 = Release|Any CPU + {CAB4132B-82E4-4B37-AF05-7F446DE3AF04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CAB4132B-82E4-4B37-AF05-7F446DE3AF04}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CAB4132B-82E4-4B37-AF05-7F446DE3AF04}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CAB4132B-82E4-4B37-AF05-7F446DE3AF04}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {AC4B880D-01C6-4D9C-AE55-21A1A0E5E3DB} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {9EA04A94-80C6-4352-8758-F4B65691AE4A} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {F844C2A1-C36D-400E-A0D8-7658EF9C3B93} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {72E67141-9CD8-48A9-B27B-F0C924FD4A12} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {598A7DA7-898E-429B-992A-B0E586DADA35} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {91A68564-07EA-439D-BED3-EFC068A159D0} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} + {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} + {F75C5658-C7EB-4922-833F-9052D9723487} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} + {246AA228-57AC-40B4-9BE1-EC75B8C3FC10} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} + {AE2109F8-6772-41A8-88C3-8E603BA29144} = {72E67141-9CD8-48A9-B27B-F0C924FD4A12} + {A489F659-7925-475E-A82E-EFEE846C24C8} = {72E67141-9CD8-48A9-B27B-F0C924FD4A12} + {ACE02BC6-04E9-48F5-BF1A-C5591366F72A} = {72E67141-9CD8-48A9-B27B-F0C924FD4A12} + {31A832FC-2AC6-4540-A659-1DCFF7882102} = {AC4B880D-01C6-4D9C-AE55-21A1A0E5E3DB} + {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4} = {AC4B880D-01C6-4D9C-AE55-21A1A0E5E3DB} + {AAC6E291-48D8-41AD-99C0-5B085EB88F81} = {F844C2A1-C36D-400E-A0D8-7658EF9C3B93} + {306184FE-65BE-4763-A86E-D84BBB8CFDDF} = {F844C2A1-C36D-400E-A0D8-7658EF9C3B93} + {14FDF393-49F1-4D41-9EC0-FF493BDDE376} = {598A7DA7-898E-429B-992A-B0E586DADA35} + {BA28042B-25C1-4361-A836-5710BF271EEF} = {598A7DA7-898E-429B-992A-B0E586DADA35} + {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} + {22FB9445-2337-43F7-AEFB-6E349619CBB1} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} + {6CC1E189-9249-44BB-B0C9-E13D173E85CE} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} + {3244CF56-A19C-4A5B-B479-79DA704BDBB2} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} + {8D573300-4173-41CA-A4C8-BAA49A89B4F8} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {333E1D7C-780F-4917-A823-8B369F1D278C} = {9EA04A94-80C6-4352-8758-F4B65691AE4A} + {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} + {C9D66303-AE01-4D8C-A69E-82B620007EBD} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} + {4A3B1928-5014-4D81-BB83-FDCD0652D067} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} + {52B3A8FE-A553-4D65-8660-447F120616AB} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {4B351F95-5919-46A9-A02F-F4409C9EA79A} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {D5E09920-081B-478C-B77B-EAB77931F47D} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {276B4CDC-BD8F-4563-A82A-B46724C9F4B0} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {59124A98-14AF-4201-87D7-6DC9C92D9849} = {D956582F-4071-47E6-A8E7-4C5A83770045} + {E62E5E11-7119-4782-BCF4-A5913F4048FE} = {59124A98-14AF-4201-87D7-6DC9C92D9849} + {F6242694-66A5-4E59-9ECD-510D3D81C8C6} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {B063C9CC-868A-4474-8DCD-1708A65D4F2A} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {20960ED7-76FC-4DBD-8358-1A424D1E0DC1} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + {533BCE80-61BC-443A-95D3-2C6328921ED8} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} + {B0E3CA19-C101-4E30-9401-C017B7088F4E} = {533BCE80-61BC-443A-95D3-2C6328921ED8} + {D17B5B36-5773-4827-9D5D-44390DF666CA} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} + {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7} = {F844C2A1-C36D-400E-A0D8-7658EF9C3B93} + {CAB4132B-82E4-4B37-AF05-7F446DE3AF04} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D7DAA0E6-098F-4B18-8775-64FDA96F1FF0} + EndGlobalSection +EndGlobal diff --git a/src/Utils/README.md b/src/Utils/README.md new file mode 100644 index 000000000..898ac3388 --- /dev/null +++ b/src/Utils/README.md @@ -0,0 +1,74 @@ +[中](README.zh-CN.md) | EN + +# MASA.Utils + +MASA.Utils is a library of MASA tools used by projects such as [MASA Stack](https://github.com/masastack) and [MASA Labs](https://github.com/masalabs). + + + +## Roadmap +* [Release Notes](https://github.com/masastack/MASA.Utils/releases) +* [Latest Roadmap](https://github.com/masastack/MASA.Utils/issues/41) + + + +## Features +* Caching + * Memory: memory cache + * Redis + * DistributedMemory: Distributed memory cache +* Caller + * [HttpClient](./src/Caller/Masa.Utils.Caller.HttpClient/README.md) + * [DaprClient](./src/Caller/Masa.Utils.Caller.DaprClient/README.md) +* Data + * [Elasticsearch](./src/Data/Masa.Utils.Data.Elasticsearch/README.md) +* Development + * [Development.Dapr](./src/Development/Masa.Utils.Development.Dapr/README.md): Dapr Starter Core Library + * [Development.Dapr.AspNetCore](./src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.md): Dapr AspNetCore library +* Extensions + * [DependencyInjection](./src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md): inject extension + * DotNet: DotNet extension + * Enums: enum extension + * Expressions: Expression expansion +* Ldap + * Ldap.Novell: Novell-based LDAP client library +* [Exceptions](https://github.com/masastack/MASA.Utils/blob/main/src/Masa.Utils.Exceptions/README.md): Exception extension +* Security: security + * Authentication: Authentication + * Cryptography: Password extension, support AES encryption and decryption, DES encryption and decryption, Base64 encoding, MD5 encryption, SHA encryption, etc. + * Token: JWT token management + + + +## How to contribute + +1. Fork & Clone +2. Create Feature_xxx branch +3. Commit with commit message, like `feat(Elasticsearch): Support Index management, document management, alias management` +4. Create Pull Request + +If you wish to contribute, please [Pull Request](https://github.com/masastack/MASA.Utils/pulls), or send us a [Report Bug](https://github.com/masastack/MASA.Utils /issues/new) . + + + +## Contributors + +Thanks to all the friends who have contributed to this project. + + + + + + + +## Code of conduct + +This project adopts the Code of Conduct as defined by the Contributors Covenant to clarify the expected behavior of our community. For more information see [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). + + + +## ☀️ License Statement + +[![MASA.Utils](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) + +Copyright (c) 2021-present MASA Stack \ No newline at end of file diff --git a/src/Utils/README.zh-CN.md b/src/Utils/README.zh-CN.md new file mode 100644 index 000000000..40d1c307c --- /dev/null +++ b/src/Utils/README.zh-CN.md @@ -0,0 +1,74 @@ +中 | [EN](README.md) + +# MASA.Utils + +MASA.Utils是MASA的工具库,这些工具被[MASA Stack](https://github.com/masastack)和[MASA Labs](https://github.com/masalabs)等项目使用。 + + + +## 路线图 +* [发行说明](https://github.com/masastack/MASA.Utils/releases) +* [最新路线图](https://github.com/masastack/MASA.Utils/issues/41) + + + +## 特性 +* Caching + * Memory: 内存缓存 + * Redis + * DistributedMemory: 分布式内存缓存 +* Caller + * [HttpClient](./src/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md) + * [DaprClient](./src/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md) +* Data + * [Elasticsearch](./src/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md) +* Development + * [Development.Dapr](./src/Development/Masa.Utils.Development.Dapr/README.zh-CN.md): Dapr Starter核心库 + * [Development.Dapr.AspNetCore](./src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md): Dapr AspNetCore库 +* Extensions + * [DependencyInjection](./src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md): 注入扩展 + * DotNet: DotNet扩展 + * Enums: 枚举扩展 + * Expressions: 表达式扩展 +* Ldap + * Ldap.Novell: 基于Novell的LDAP客户端库 +* [Exceptions](https://github.com/masastack/MASA.Utils/blob/main/src/Masa.Utils.Exceptions/README.zh-CN.md): 异常扩展 +* Security: 安全 + * Authentication: 身份验证 + * Cryptography: 密码扩展,支持AES加解密、DES加解密、Base64编码、MD5加密、SHA加密等 + * Token: JWT令牌管理 + + + +## 如何贡献 + +1. Fork & Clone +2. Create Feature_xxx branch +3. Commit with commit message, like `feat(Elasticsearch): Support Index management, document management, alias management` +4. Create Pull Request + +如果你希望参与贡献,欢迎 [Pull Request](https://github.com/masastack/MASA.Utils/pulls),或给我们 [报告 Bug](https://github.com/masastack/MASA.Utils/issues/new) 。 + + + +## 贡献者 + +感谢所有为本项目做出过贡献的朋友。 + + + + + + + +## 行为准则 + +本项目采用了《贡献者公约》所定义的行为准则,以明确我们社区的预期行为。更多信息请见 [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). + + + +## ☀️ 许可声明 + +[![MASA.Utils](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) + +Copyright (c) 2021-present MASA Stack \ No newline at end of file diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs new file mode 100644 index 000000000..b0584d3b7 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.DependencyInjection; + +public class CachingBuilder : ICachingBuilder +{ + /// + /// Initializes a new instance of the class. + /// + /// The to add services to. + /// + public CachingBuilder(IServiceCollection services, string name) + { + Services = services; + Name = name; + } + + /// + public IServiceCollection Services { get; private set; } + + /// + public string Name { get; private set; } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs new file mode 100644 index 000000000..20fbe7413 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.DependencyInjection; + +/// +/// Extension methods for configuring an +/// +public static class DistributedCacheClientBuilderExtensions +{ + /// + /// Adds a delegate that will be used to configure a named . + /// + /// The . + /// A delegate that is used to configure an . + /// An that can be used to configure the client. + public static ICachingBuilder ConfigureDistributedCacheClient(this ICachingBuilder builder, Action configureOptions) + where TOptions : class + { + ArgumentNullException.ThrowIfNull(builder, nameof(builder)); + ArgumentNullException.ThrowIfNull(configureOptions, nameof(configureOptions)); + + builder.Services.Configure(builder.Name, configureOptions); + return builder; + } + + /// + /// Adds a delegate that will be used to configure a named . + /// + /// The . + /// + /// An that can be used to configure the client. + public static ICachingBuilder ConfigureDistributedCacheClient(this ICachingBuilder builder, IConfiguration configuration) + where TOptions : class + { + ArgumentNullException.ThrowIfNull(builder, nameof(builder)); + ArgumentNullException.ThrowIfNull(configuration, nameof(configuration)); + + builder.Services.Configure(builder.Name, configuration); + return builder; + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs new file mode 100644 index 000000000..2cb999456 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.DependencyInjection; + +/// +/// A builder for configuring named instances. +/// +public interface ICachingBuilder +{ + /// + /// Gets the application service collection. + /// + IServiceCollection Services { get; } + + /// + /// Gets the name of the client configured by this builder. + /// + string Name { get; } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs new file mode 100644 index 000000000..40622509a --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs @@ -0,0 +1,49 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core; + +public abstract class DistributedCacheClientFactory : IDistributedCacheClientFactory +{ + private readonly IOptionsMonitor _optionsMonitor; + + private readonly ConcurrentDictionary> _clients; + private readonly Func> _clientFactory; + + public DistributedCacheClientFactory(IOptionsMonitor optionsMonitor) + { + if (optionsMonitor == null) + { + throw new ArgumentNullException(nameof(optionsMonitor)); + } + + _optionsMonitor = optionsMonitor; + + _clients = new ConcurrentDictionary>(); + + _clientFactory = (name) => + { + return new Lazy(() => + { + return CreateClientHandler(name); + }); + }; + } + + // + public IDistributedCacheClient CreateClient(string name) + { + name ??= string.Empty; + + var client = _clients.GetOrAdd(name, _clientFactory); + + return client.Value; + } + + internal protected abstract IDistributedCacheClient CreateClientHandler(string name); + + protected TOptions GetOptions(string name) + { + return _optionsMonitor.Get(name); + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs new file mode 100644 index 000000000..df29f9f34 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core; + +/// +/// Extension methods for . +/// +public static class DistributedCacheClientFactoryExtensions +{ + /// + /// Creates a new using the default configuration. + /// + /// The . + /// An configured using the default configuration. + public static IDistributedCacheClient CreateClient(this IDistributedCacheClientFactory factory) + { + if (factory == null) + { + throw new ArgumentNullException(nameof(factory)); + } + + return factory.CreateClient(string.Empty); + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs new file mode 100644 index 000000000..4deea1873 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs @@ -0,0 +1,57 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Helpers; + +/// +/// The subscribe helper. +/// +public static class SubscribeHelper +{ + /// + /// Formats the memory cache key. + /// + /// The key. + /// A string. + public static string FormatMemoryCacheKey(string key) + { + var type = typeof(T); + if (type.IsGenericType) + { + var dictType = typeof(Dictionary<,>); + if (type.GetGenericTypeDefinition() == dictType) + key += type.Name + "[" + type.GetGenericArguments()[1].Name + "]"; + else + key += type.Name + "[" + type.GetGenericArguments()[0].Name + "]"; + } + else + { + key += typeof(T).Name; + } + + return key; + } + + /// + /// Formats the subscribe channel. + /// + /// The key. + /// The type. + /// The prefix. + /// A string. + public static string FormatSubscribeChannel(string key, SubscribeKeyTypes type, string prefix = "") + { + var valueTypeFullName = typeof(T).FullName!; + switch (type) + { + case SubscribeKeyTypes.ValueTypeFullName: + return valueTypeFullName; + case SubscribeKeyTypes.ValueTypeFullNameAndKey: + return $"[{valueTypeFullName}]{key}"; + case SubscribeKeyTypes.SpecificPrefix: + return $"{prefix}{key}"; + default: + throw new NotImplementedException(); + } + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs new file mode 100644 index 000000000..b09ed34ca --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs @@ -0,0 +1,100 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Interfaces; + +/// +/// The interface for cache client. +/// +public interface ICacheClient : IDisposable +{ + /// + /// Gets a value with given key. + /// + /// A string identifying the request value. + /// The located value or null. + T? Get(string key); + + /// + /// Gets a value with given key. + /// + /// A string identifying the request value. + /// The that represents the asynchronous opertion, containing the located value or null. + Task GetAsync(string key); + + /// + /// Gets or sets a value with given key. + /// + /// A string identifying the request value. + /// The setter. + /// The . + /// The located value. + T? GetOrSet(string key, Func setter, CombinedCacheEntryOptions? options = null); + + /// + /// Gets or sets a value with given key. + /// + /// A string identifying the request value. + /// The setter. + /// The . + /// The that represents the asynchronous opertion, containing the located value. + Task GetOrSetAsync(string key, Func setter, CombinedCacheEntryOptions? options = null); + + /// + /// Gets a list of values with given keys. + /// + /// A list of string identifying the request value. + /// The located values without . + IEnumerable GetList(string[] keys); + + /// + /// Gets a list of values with given keys. + /// + /// A list of string identifying the request value. + /// The that represents the asynchronous opertion, containing the located values with . + Task> GetListAsync(string[] keys); + + /// + /// Removes a list of values with given keys. + /// + /// A list of string identifying the requested value. + void Remove(params string[] keys); + + /// + /// Removes a list of values with given keys. + /// + /// A list of string identifying the requested value. + Task RemoveAsync(params string[] keys); + + /// + /// Sets a value with given key. + /// + /// A string identifying the requested value. + /// The value to set int the cache. + /// The cache options for the value. + void Set(string key, T value, CombinedCacheEntryOptions? options = null); + + /// + /// Sets a value with given key. + /// + /// A string identifying the requested value. + /// The value to set int the cache. + /// The cache options for the value. + /// The that represents the asynchronous operation. + Task SetAsync(string key, T value, CombinedCacheEntryOptions? options = null); + + /// + /// Sets a list of cahce items contains key and value. + /// + /// The contains the cache key and cache value. + /// The cache options for the value. + void SetList(Dictionary keyValues, CombinedCacheEntryOptions? options = null); + + /// + /// Sets a list of cahce items contains key and value. + /// + /// The contains the cache key and cache value. + /// The cache options for the value. + /// The that represents the asynchronous operation. + Task SetListAsync(Dictionary keyValues, CombinedCacheEntryOptions? options = null); +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs new file mode 100644 index 000000000..745f573b4 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Interfaces; + +/// +/// A factory abstraction for a component that can create instances of type with custom +/// configuration for a given logical name. +/// +public interface ICacheClientFactory +{ + /// + /// Creates and configures an instance of type using the configuration that corresponds + /// to the logical name specified by . + /// + /// The logical name of the client to create. + /// A new instance of type. + TICacheClinet CreateClient(string name); +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs new file mode 100644 index 000000000..c772d52d3 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs @@ -0,0 +1,85 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Interfaces; + +/// +/// The interface for distributed cache client. +/// +public interface IDistributedCacheClient : ICacheClient +{ + /// + /// Refreshes a value's expiration with given key. + /// + /// A string identifying the requested value. + void Refresh(string key); + + /// + /// Refreshes a value's expiration with given key. + /// + /// A string identifying the requested value. + /// The that represents the asynchronous operation. + Task RefreshAsync(string key); + + /// + /// Checks whether a value exists with given key. + /// + /// A string identifying the requested value. + /// if the value exists, otherwise . + bool Exists(string key); + + /// + /// Checks whether a value exists with given key. + /// + /// A string identifying the requested value. + /// The that represents the asynchronous operation, containing the value if the value exists, otherwise . + Task ExistsAsync(string key); + + /// + /// Subscribes to perform some operation when a change to the perferred/active node is broadcast. + /// + /// The channel to subscribe to. + /// The handler to invoke when a message is received on channel. + void Subscribe(string channel, Action> handler); + + /// + /// Subscribes to perform some operation when a change to the perferred/active node is broadcast. + /// + /// The channel to subscribe to. + /// The handler to invoke when a message is received on channel. + /// The that represents the asynchronous operation. + Task SubscribeAsync(string channel, Action> handler); + + /// + /// Posts a message to the given channel. + /// + /// The channel to publish to. + /// The setup action to configure the . + void Publish(string channel, Action> setup); + + /// + /// Posts a message to the given channel. + /// + /// The channel to publish to. + /// The setup action to configure the . + /// The that represents the asynchronous operation. + Task PublishAsync(string channel, Action> setup); + + /// + /// !Destructive support in caching + /// Increments the number stored at field in the hash stored at key by increment + /// + /// The key + /// The increment number + /// + Task HashIncrementAsync(string key, long value = 1L); + + /// + /// !Destructive support in caching + /// Decrements the number stored at field in the hash stored at key by decrement. return -1 if decrement failed, otherwise return the result. + /// + /// The key + /// The decrement number + /// + Task HashDecrementAsync(string key, long value = 1L); +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs new file mode 100644 index 000000000..efdbffb52 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Interfaces; + +/// +/// A factory abstraction for a component that create instances with custom configuration for a given logical name. +/// +public interface IDistributedCacheClientFactory : ICacheClientFactory +{ +} diff --git a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/Masa.Utils.Data.EntityFrameworkCore.csproj b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj similarity index 61% rename from src/Data/Masa.Contrib.Data.EntityFrameworkCore/Masa.Utils.Data.EntityFrameworkCore.csproj rename to src/Utils/src/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj index efd5302c9..13928df95 100644 --- a/src/Data/Masa.Contrib.Data.EntityFrameworkCore/Masa.Utils.Data.EntityFrameworkCore.csproj +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj @@ -7,9 +7,9 @@ - - - + + + diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs new file mode 100644 index 000000000..1172a3a6a --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs @@ -0,0 +1,55 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Models; + +/// +/// The combined cache entry options. +/// +public class CombinedCacheEntryOptions +{ + /// + /// Gets or sets the memory cache entry options. + /// + public MemoryCacheEntryOptions? MemoryCacheEntryOptions { get; set; } + + /// + /// Gets or sets the distributed cache entry options. + /// + public DistributedCacheEntryOptions? DistributedCacheEntryOptions { get; set; } + + public CombinedCacheEntryOptions() + { + } + + public CombinedCacheEntryOptions(MemoryCacheEntryOptions? memoryCacheEntryOptions, DistributedCacheEntryOptions? distributedCacheEntryOptions) + { + MemoryCacheEntryOptions = memoryCacheEntryOptions; + DistributedCacheEntryOptions = distributedCacheEntryOptions; + } +} + +/// +/// The combined cache entry options. +/// +public class CombinedCacheEntryOptions +{ + public Action? ValueChanged { get; set; } + + /// + /// Gets or sets the memory cache entry options. + /// + public MemoryCacheEntryOptions? MemoryCacheEntryOptions { get; set; } + + /// + /// Gets or sets the distributed cache entry options. + /// + public DistributedCacheEntryOptions? DistributedCacheEntryOptions { get; set; } + + /// + /// Determines whether to ignore subscribe. + /// + public bool IgnoreSubscribe { get; set; } + + public CombinedCacheEntryOptions Standard => new(MemoryCacheEntryOptions, DistributedCacheEntryOptions); +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs new file mode 100644 index 000000000..91a12b1de --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Models; + +/// +/// The subscribe key type. +/// +public enum SubscribeKeyTypes +{ + ValueTypeFullName = 1, + + ValueTypeFullNameAndKey = 2, + + SpecificPrefix = 3 +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs new file mode 100644 index 000000000..768191aac --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Models; + +/// +/// The subscribe operation. +/// +public enum SubscribeOperation +{ + Set = 1, + + Remove = 2 +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs new file mode 100644 index 000000000..a572e4dde --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Models; + +/// +/// The subscribe options. +/// +public class SubscribeOptions +{ + /// + /// Gets or sets the operation. + /// + public SubscribeOperation Operation { get; set; } + + /// + /// Gets or sets the key. + /// + public string Key { get; set; } = default!; + + /// + /// Gets or sets the value. + /// + public T? Value { get; set; } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/_Imports.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Core/_Imports.cs new file mode 100644 index 000000000..b3099d7a7 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Core/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Core.Models; +global using Microsoft.Extensions.Caching.Distributed; +global using Microsoft.Extensions.Caching.Memory; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using System.Collections.Concurrent; diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs new file mode 100644 index 000000000..948dfbbc5 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.DependencyInjection; + +/// +/// Extension methods for configuring an +/// +public static class MemoryCacheClientBuilderExtensions +{ + /// + /// Adds a delegate that will be used to configure a named . + /// + /// The . + /// A delegate that is used to configure an . + /// An that can be used to configure the client. + public static ICachingBuilder ConfigureMemoryCacheClient(this ICachingBuilder builder, Action configureOptions) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + if (configureOptions == null) + { + throw new ArgumentNullException(nameof(configureOptions)); + } + + builder.Services.Configure(builder.Name, configureOptions); + + return builder; + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs new file mode 100644 index 000000000..a40aa6928 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.DependencyInjection; + +/// +/// Extension methods to configure an for . +/// +public static class MemoryCacheClientFactoryCachingBuilderExtensions +{ + /// + /// Adds the and related services to the . + /// + /// The . + /// The . + public static ICachingBuilder AddMasaMemoryCache(this ICachingBuilder builder) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + var name = builder.Name; + + builder.Services.TryAddSingleton(); + + builder.Services.TryAddSingleton(serviceProvider => + { + var factory = serviceProvider.GetRequiredService(); + + return factory.CreateClient(name); + }); + + return builder; + } + + /// + /// Adds the and related services to the . + /// + /// The . + /// A delegate that is used to configure an . + /// The . + public static ICachingBuilder AddMasaMemoryCache(this ICachingBuilder builder, Action configureOptions) + { + if (configureOptions == null) + { + throw new ArgumentNullException(nameof(configureOptions)); + } + + builder.AddMasaMemoryCache(); + + builder.ConfigureMemoryCacheClient(configureOptions); + + return builder; + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs new file mode 100644 index 000000000..0654a9381 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.Interfaces; + +/// +/// The the interface memory cache client. +/// +public interface IMemoryCacheClient : ICacheClient +{ + /// + /// Gets a value with given key. + /// + /// A string identifying the request value. + /// The handler to invoke when the request value changed. + /// The located value or null. + T? Get(string key, Action valueChanged); + + /// + /// Gets a value with given key. + /// + /// A string identifying the request value. + /// The handler to invoke when the request value changed. + /// The that represents the asynchronous opertion, containing the located value or null. + Task GetAsync(string key, Action valueChanged); +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs new file mode 100644 index 000000000..a17f0c43f --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.Interfaces; + +/// +/// A factory abstraction for a component that create instances with custom configuration for a given logical name. +/// +public interface IMemoryCacheClientFactory : ICacheClientFactory +{ +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj new file mode 100644 index 000000000..9a852d2bd --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs new file mode 100644 index 000000000..0aea93ee5 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs @@ -0,0 +1,407 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory; + +public class MemoryCacheClient : IMemoryCacheClient +{ + private readonly IMemoryCache _cache; + private readonly IDistributedCacheClient _distributedClient; + + private readonly SubscribeKeyTypes _subscribeKeyType; + private readonly string _subscribeKeyPrefix; + + private readonly object _locker = new(); + private readonly IList _subscribeChannels = new List(); + + /// + /// Initializes a new instance of the class. + /// + /// The cache. + /// The distributed client. + /// The type of subscribe key. + /// The prefix of subscribe key. + public MemoryCacheClient(IMemoryCache cache, IDistributedCacheClient distributedClient, SubscribeKeyTypes subscribeKeyType, + string subscribeKeyPrefix = "") + { + _cache = cache; + _distributedClient = distributedClient; + + _subscribeKeyType = subscribeKeyType; + _subscribeKeyPrefix = subscribeKeyPrefix; + } + + /// + public T? Get(string key) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = _distributedClient.Get(key); + + _cache.Set(formattedKey, value); + + var channel = FormatSubscribeChannel(key); + + Subscribe(channel); + } + + return value; + } + + /// + public async Task GetAsync(string key) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = await _distributedClient.GetAsync(key); + + _cache.Set(formattedKey, value); + + var channel = FormatSubscribeChannel(key); + + Subscribe(channel); + } + + return value; + } + + /// + public T? Get(string key, Action valueChanged) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = _distributedClient.Get(key); + + _cache.Set(formattedKey, value); + + var channel = FormatSubscribeChannel(key); + + Subscribe(channel, new CombinedCacheEntryOptions + { + ValueChanged = valueChanged + }); + } + + return value; + } + + /// + public async Task GetAsync(string key, Action valueChanged) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = await _distributedClient.GetAsync(key); + + _cache.Set(formattedKey, value); + + var channel = FormatSubscribeChannel(key); + + Subscribe(channel, new CombinedCacheEntryOptions + { + ValueChanged = valueChanged + }); + } + + return value; + } + + /// + public IEnumerable GetList(string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + // TODO: whether need to check keys.length + + return keys + .Where(k => !string.IsNullOrWhiteSpace(k)) + .Select(Get); + } + + /// + public async Task> GetListAsync(string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + return + await Task.WhenAll(keys + .Where(key => !string.IsNullOrWhiteSpace(key)) + .Select(GetAsync)); + } + + /// + public T? GetOrSet(string key, Func setter, CombinedCacheEntryOptions? options = null) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + if (setter == null) + throw new ArgumentNullException(nameof(setter)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = _distributedClient.GetOrSet(key, setter, options); + + if (options == null) + { + _cache.Set(formattedKey, value); + } + else + { + _cache.Set(formattedKey, value, options.MemoryCacheEntryOptions); + } + + PubSub(key, SubscribeOperation.Set, value, options); + } + + return value; + } + + /// + public async Task GetOrSetAsync(string key, Func setter, CombinedCacheEntryOptions? options = null) + { + ArgumentNullException.ThrowIfNull(key, nameof(key)); + + ArgumentNullException.ThrowIfNull(setter, nameof(setter)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(key, out T? value)) + { + value = await _distributedClient.GetOrSetAsync(key, setter, options); + + if (options == null) + { + _cache.Set(formattedKey, value); + } + else + { + _cache.Set(formattedKey, value, options.MemoryCacheEntryOptions); + } + + await PubSubAsync(key, SubscribeOperation.Set, value, options); + } + + return value; + } + + /// + public void Remove(params string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + Parallel.ForEach(keys, RemoveOne); + } + + /// + public Task RemoveAsync(params string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + return Task.WhenAll(keys.Select(RemoveOneAsync)); + } + + /// + public void Set(string key, T value, CombinedCacheEntryOptions? options = null) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + if (value == null) + throw new ArgumentNullException(nameof(value)); + + _distributedClient.Set(key, value, options); + + Set(key, value, options?.MemoryCacheEntryOptions); + + PubSub(key, SubscribeOperation.Set, value, options); + } + + /// + public async Task SetAsync(string key, T value, CombinedCacheEntryOptions? options = null) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + if (value == null) + throw new ArgumentNullException(nameof(value)); + + await _distributedClient.SetAsync(key, value, options); + + Set(key, value, options?.MemoryCacheEntryOptions); + + await PubSubAsync(key, SubscribeOperation.Set, value, options); + } + + /// + public void SetList(Dictionary keyValues, CombinedCacheEntryOptions? options = null) + { + if (keyValues == null) + throw new ArgumentNullException(nameof(keyValues)); + + _distributedClient.SetList(keyValues, options); + + Parallel.ForEach(keyValues, item => PubSub(item.Key, SubscribeOperation.Set, item.Value, options)); + } + + /// + public async Task SetListAsync(Dictionary keyValues, CombinedCacheEntryOptions? options = null) + { + if (keyValues == null) + throw new ArgumentNullException(nameof(keyValues)); + + await _distributedClient.SetListAsync(keyValues, options); + + await Task.WhenAll(keyValues.Select(item => PubSubAsync(item.Key, SubscribeOperation.Set, item.Value, options))); + } + + private void RemoveOne(string key) + { + _distributedClient.Remove(key); + + Publish(key, SubscribeOperation.Remove); + } + + private async Task RemoveOneAsync(string key) + { + await _distributedClient.RemoveAsync(key); + + await PublishAsync(key, SubscribeOperation.Remove); + } + + private void Subscribe(string channel, CombinedCacheEntryOptions? options = null) + { + if (!_subscribeChannels.Contains(channel)) + { + lock (_locker) + { + if (!_subscribeChannels.Contains(channel)) + { + _distributedClient.Subscribe(channel, (subscribeOptions) => + { + switch (subscribeOptions.Operation) + { + case SubscribeOperation.Set: + options ??= new CombinedCacheEntryOptions(); + _cache.Set(subscribeOptions.Key, subscribeOptions.Value, options.MemoryCacheEntryOptions); + break; + case SubscribeOperation.Remove: + _cache.Remove(subscribeOptions.Key); + break; + default: + throw new NotImplementedException(); + } + + options?.ValueChanged?.Invoke(subscribeOptions.Value); + }); + + _subscribeChannels.Add(channel); + } + } + } + } + + private void Publish(string key, SubscribeOperation operation, T? value = default) + { + var channel = FormatSubscribeChannel(key); + _distributedClient.Publish(channel, subscribeOptions => + { + subscribeOptions.Key = FormatMemoryCacheKey(key); + subscribeOptions.Operation = operation; + subscribeOptions.Value = value; + }); + } + + private async Task PublishAsync(string key, SubscribeOperation operation, T? value = default) + { + var channel = FormatSubscribeChannel(key); + await _distributedClient.PublishAsync(channel, subscribeOptions => + { + subscribeOptions.Key = FormatMemoryCacheKey(key); + subscribeOptions.Operation = operation; + subscribeOptions.Value = value; + }); + } + + private void PubSub(string key, SubscribeOperation operation, T? value, CombinedCacheEntryOptions? options = null) + { + var channel = FormatSubscribeChannel(key); + + if (!options?.IgnoreSubscribe ?? true) + { + Subscribe(channel, options); + } + + _distributedClient.Publish(channel, subscribeOptions => + { + subscribeOptions.Key = FormatMemoryCacheKey(key); + subscribeOptions.Operation = operation; + subscribeOptions.Value = value; + }); + } + + private async Task PubSubAsync(string key, SubscribeOperation operation, T? value=default, + CombinedCacheEntryOptions? options = null) + { + var channel = FormatSubscribeChannel(key); + + Subscribe(channel, options); + + await _distributedClient.PublishAsync(channel, subscribeOptions => + { + subscribeOptions.Key = FormatMemoryCacheKey(key); + subscribeOptions.Operation = operation; + subscribeOptions.Value = value; + }); + } + + private string FormatMemoryCacheKey(string key) => SubscribeHelper.FormatMemoryCacheKey(key); + + private string FormatSubscribeChannel(string key) => + SubscribeHelper.FormatSubscribeChannel(key, _subscribeKeyType, _subscribeKeyPrefix); + + private void Set(string key, T value, MemoryCacheEntryOptions? options = null) + { + var formattedKey = FormatMemoryCacheKey(key); + if (options == null) + { + _cache.Set(formattedKey, value); + } + else + { + _cache.Set(formattedKey, value, options); + } + } + + /// + public void Dispose() + { + _cache.Dispose(); + _distributedClient.Dispose(); + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs new file mode 100644 index 000000000..981b2e2ea --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs @@ -0,0 +1,63 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory; + +public class MemoryCacheClientFactory : IMemoryCacheClientFactory +{ + private readonly IServiceProvider _services; + + private readonly IOptionsMonitor _optionsMonitor; + + private readonly ConcurrentDictionary> _clients; + + private readonly Func> _clientFactory; + + public MemoryCacheClientFactory(IServiceProvider services, IOptionsMonitor optionsMonitor) + { + ArgumentNullException.ThrowIfNull(services); + + ArgumentNullException.ThrowIfNull(optionsMonitor); + + _services = services; + + _optionsMonitor = optionsMonitor; + + _clients = new ConcurrentDictionary>(); + + _clientFactory = (name) => + { + return new Lazy(() => + { + return CreateClientHandler(name); + }); + }; + } + + public MemoryCacheClient CreateClient(string name) + { + ArgumentNullException.ThrowIfNull(name); + + var client = _clients.GetOrAdd(name, _clientFactory); + + return client.Value; + } + + internal MemoryCacheClient CreateClientHandler(string name) + { + var options = _optionsMonitor.Get(name); + + if (options == null) + { + throw new ArgumentException("No matching client found!"); + } + + var memoryCache = new MemoryCache(Options.Create(options)); + + var factory = _services.GetRequiredService(); + + var distributedCacheClient = factory.CreateClient(name); + + return new MemoryCacheClient(memoryCache, distributedCacheClient, options.SubscribeKeyType, options.SubscribeKeyPrefix); + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs new file mode 100644 index 000000000..864754853 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory; + +/// +/// Extension methods for . +/// +public static class MemoryCacheClientFactoryExtensions +{ + /// + /// Creates a new using the default configuration. + /// + /// The . + /// An configured using the default configuration. + public static IMemoryCacheClient CreateClient(this IMemoryCacheClientFactory factory) + { + if (factory == null) + { + throw new ArgumentNullException(nameof(factory)); + } + + return factory.CreateClient(string.Empty); + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs new file mode 100644 index 000000000..c645980ee --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.Models; + +/// +/// The MASA memory cache options. +/// +public class MasaMemoryCacheOptions : MemoryCacheOptions +{ + /// + /// Gets or sets the . + /// + public SubscribeKeyTypes SubscribeKeyType { get; set; } = SubscribeKeyTypes.ValueTypeFullNameAndKey; + + /// + /// Gets or sets the prefix of subscribe key. + /// + public string SubscribeKeyPrefix { get; set; } = string.Empty; +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs new file mode 100644 index 000000000..8b254372c --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caching.Core.DependencyInjection; +global using Masa.Utils.Caching.Core.Helpers; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Core.Models; +global using Masa.Utils.Caching.DistributedMemory.Interfaces; +global using Masa.Utils.Caching.DistributedMemory.Models; +global using Microsoft.Extensions.Caching.Distributed; +global using Microsoft.Extensions.Caching.Memory; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Options; +global using System.Collections.Concurrent; diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj b/src/Utils/src/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs new file mode 100644 index 000000000..015e66240 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs @@ -0,0 +1,110 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Memory; + +public class MemoryCache : IDisposable where TKey : notnull +{ + private ConcurrentDictionary> _dicCache = new(); + + public TKey[] Keys + { + get + { + return _dicCache.Keys.ToArray(); + } + } + + public TValue[] Values + { + get + { + return _dicCache.Values.Select(value => value.Value).ToArray(); + } + } + + public bool Get(TKey key, out TValue? value) + { + bool result = _dicCache.TryGetValue(key, out var lazyValue); + value = lazyValue == null ? default : lazyValue.Value; + + return result; + } + + public bool TryGet(TKey key, out TValue? value) + { + var result = _dicCache.TryGetValue(key, out var lazyValue); + + if (result) + { + value = lazyValue == null ? default :lazyValue.Value; + } + else + { + value = default; + } + + return result; + } + + public bool TryAdd(TKey key, Func valueFactory) + { + return _dicCache.TryAdd(key, new Lazy(() => valueFactory(key), LazyThreadSafetyMode.ExecutionAndPublication)); + } + + public TValue GetOrAdd(TKey key, Func valueFactory) + { + if (!_dicCache.TryGetValue(key, out var lazyValue)) + { + lazyValue = _dicCache.GetOrAdd(key, k => new Lazy(() => valueFactory(k), LazyThreadSafetyMode.ExecutionAndPublication)); + } + + return lazyValue.Value; + } + + /// + /// Updates the value associated with key to newValue if the existing value with key is equal to comparisonValue. + /// + /// The key of the value that is compared with comparisonValue and possibly replaced. + /// The value that replaces the value of the element that has the specified key if the comparison results in equality. + /// The value that is compared with the value of the element that has the specified key. + /// true if the value with key was equal to comparisonValue and was replaced with newValue; otherwise, false. + public bool TryUpdate(TKey key, Func valueFactory, TValue comparisonValue) + { + return _dicCache.TryUpdate( + key, + new Lazy(() => valueFactory(key), LazyThreadSafetyMode.ExecutionAndPublication), + new Lazy(() => comparisonValue, LazyThreadSafetyMode.ExecutionAndPublication) + ); + } + + public TValue AddOrUpdate(TKey key, Func valueFactory) + { + return _dicCache.AddOrUpdate + ( + key, + k => new Lazy(() => valueFactory(k), LazyThreadSafetyMode.ExecutionAndPublication), + (oldkey, _) => new Lazy(() => valueFactory(oldkey), LazyThreadSafetyMode.ExecutionAndPublication) + ).Value; + } + + public bool Remove(TKey key) + { + return _dicCache.TryRemove(key, out _); + } + + public bool ContainsKey(TKey key) + { + return _dicCache.ContainsKey(key); + } + + public void Clear() + { + _dicCache.Clear(); + } + + public void Dispose() + { + _dicCache.Clear(); + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Memory/_Imports.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Memory/_Imports.cs new file mode 100644 index 000000000..5b736fb9c --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Memory/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.Collections.Concurrent; diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs new file mode 100644 index 000000000..40cdef83b --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs @@ -0,0 +1,111 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +/// +/// Extensions methods to configure an for . +/// +public static class RedisCacheClientFactoryServiceCollectionExtensions +{ + /// + /// Adds the and related services to the . + /// + /// The . + /// A delegate that is used to configure an . + /// The . + public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, Action configureOptions) + { + services.TryAddSingleton(serviceProvider => + { + var factory = serviceProvider.GetRequiredService(); + return factory.CreateClient(string.Empty); + }); + + return services.AddMasaRedisCache(string.Empty, configureOptions); + } + + /// + /// Adds the and related services to the and configures a named . + /// + /// The . + /// The logical name of the to configure. + /// A delegate that is used to configure an . + /// The . + public static ICachingBuilder AddMasaRedisCache( + this IServiceCollection services, + string name, + Action configureOptions) + { + ArgumentNullException.ThrowIfNull(services, nameof(services)); + ArgumentNullException.ThrowIfNull(name, nameof(name)); + ArgumentNullException.ThrowIfNull(configureOptions, nameof(configureOptions)); + + services.TryAddSingleton(); + + var builder = new CachingBuilder(services, name); + + builder.ConfigureDistributedCacheClient(configureOptions); + + return builder; + } + + /// + /// Adds the and related services to the . + /// + /// The . + /// + /// The . + public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, IConfiguration configuration) + { + services.TryAddSingleton(serviceProvider => + { + var factory = serviceProvider.GetRequiredService(); + return factory.CreateClient(string.Empty); + }); + + return services.AddMasaRedisCache(string.Empty, configuration); + } + + /// + /// Adds the and related services to the and configures a named . + /// + /// The . + /// The logical name of the to configure. + /// + /// The . + public static ICachingBuilder AddMasaRedisCache( + this IServiceCollection services, + string name, + IConfiguration configuration) + { + ArgumentNullException.ThrowIfNull(services, nameof(services)); + ArgumentNullException.ThrowIfNull(name, nameof(name)); + ArgumentNullException.ThrowIfNull(configuration, nameof(configuration)); + + services.TryAddSingleton(); + + var builder = new CachingBuilder(services, name); + builder.ConfigureDistributedCacheClient(configuration); + return builder; + } + + /// + /// Adds the and related services to the . + /// + /// The . + /// The to configure an . + /// The . + public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, RedisConfigurationOptions options) + => services.AddMasaRedisCache(o => o.Initialize(options)); + + /// + /// Adds the and related services to the and configures a named . + /// + /// The . + /// The logical name of the to configure. + /// The to configure an . + /// The . + public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, string name, RedisConfigurationOptions options) + => services.AddMasaRedisCache(name, o => o.Initialize(options)); +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs new file mode 100644 index 000000000..081508623 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs @@ -0,0 +1,558 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Extensions; + +/// +/// This class is intended as a sample for supporting the feature. +/// +/// +/// It requires a reference to the "System.Linq.Expressions" assembly. +/// +public static class JsonSerializerExtensions +{ + /// + /// Enable support for the feature. + /// Changes the default handling for types specified as from deserializing as + /// to instead deserializing as the one of the + /// -derived types including: + /// , + /// , + /// , + /// and + /// . + /// + /// + /// When deserializing , + /// is returned which implements . + /// When deserializing , + /// is returned which implements . + /// When deserializing , + /// is returned and supports an implicit cast to . + /// An explicit cast or assignment to other types, such as , + /// is supported provided there is a custom converter for that Type. + /// When deserializing , is returned. + /// An explicit cast or assignment is required to the appropriate number type, such as or . + /// When deserializing and , + /// is returned and supports an implicit cast to . + /// An explicit cast or assignment to other types is supported provided there is a custom converter for that type. + /// When deserializing , is returned. + /// + public static void EnableDynamicTypes(this JsonSerializerOptions options) + { + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + options.Converters.Add(new DynamicObjectConverter()); + } + + /// + /// The base class for all dynamic types supported by the serializer. + /// + public abstract class JsonDynamicType : DynamicObject + { + public JsonSerializerOptions Options { get; private set; } + + internal JsonDynamicType(JsonSerializerOptions options) + { + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + Options = options; + } + + public sealed override bool TryConvert(ConvertBinder binder, out object? result) + { + return TryConvert(binder.ReturnType, out result); + } + + public abstract T? GetValue(); + public abstract void SetValue(object value); + protected abstract bool TryConvert(Type returnType, out object? result); + + protected static bool TryConvertWithTypeConverter(object value, Type returnType, out object? result) + { + TypeConverter converter = TypeDescriptor.GetConverter(value.GetType()); + if (converter.CanConvertTo(returnType)) + { + result = converter.ConvertTo(value, returnType)!; + return true; + } + + converter = TypeDescriptor.GetConverter(returnType); + if (converter.CanConvertFrom(value.GetType())) + { + result = converter.ConvertFrom(value)!; + return true; + } + + result = null; + return false; + } + + internal abstract object Value { get; } + } + + /// + /// Supports dynamic strings. + /// + public sealed class JsonDynamicString : JsonDynamicType + { + private object _value; + private Type? _type; + + public JsonDynamicString(string value, JsonSerializerOptions options) : base(options) + { + _value = value; + _type = typeof(string); + } + + public override T? GetValue() where T : default + { + bool success = TryConvert(typeof(T), out object? result); + Debug.Assert(success); + return result is T ? (T) result : default; + } + + public override void SetValue(object value) + { + _value = value; + _type = value.GetType(); + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType == _type) + { + result = _value; // Return cached value, such as a DateTime. + return true; + } + + if (TryConvertWithTypeConverter(_value, returnType, out result)) + { + return true; + } + + result = _value = JsonSerializer.Deserialize($"\"{_value}\"", returnType, Options)!; + _type = result.GetType(); + return true; + } + + internal override object Value => _value; + + public static implicit operator string(JsonDynamicString obj) + { + bool success = obj.TryConvert(typeof(string), out object? result); + Debug.Assert(success); + return (string) result!; + } + } + + /// + /// Supports dynamic numbers. + /// + public sealed class JsonDynamicNumber : JsonDynamicType + { + private Type? _type; + private object _value; + private object? _lastValue = null; + + public JsonDynamicNumber(object? value, JsonSerializerOptions options) : base(options) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + public override T? GetValue() where T : default + { + if (TryConvert(typeof(T), out object? result)) + { + return result is T ? (T) result : default; + } + + throw new InvalidOperationException($"Cannot change type {_value.GetType()} to {typeof(T)}."); + } + + public override void SetValue(object value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + _value = _lastValue = value; + _type = value.GetType(); + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType == _type) + { + result = _lastValue; // Return cached value, such as a long or double. + return true; + } + + bool success = false; + result = null; + + if (!(_value is JsonElement jsonElement)) + { + return TryConvertWithTypeConverter(_value, returnType, out result); + } + + if (returnType == typeof(long)) + { + success = jsonElement.TryGetInt64(out long value); + result = value; + } + else if (returnType == typeof(double)) + { + success = jsonElement.TryGetDouble(out double value); + result = value; + } + else if (returnType == typeof(int)) + { + success = jsonElement.TryGetInt32(out int value); + result = value; + } + else if (returnType == typeof(short)) + { + success = jsonElement.TryGetInt16(out short value); + result = value; + } + else if (returnType == typeof(decimal)) + { + success = jsonElement.TryGetDecimal(out decimal value); + result = value; + } + else if (returnType == typeof(byte)) + { + success = jsonElement.TryGetByte(out byte value); + result = value; + } + else if (returnType == typeof(float)) + { + success = jsonElement.TryGetSingle(out float value); + result = value; + } + else if (returnType == typeof(uint)) + { + success = jsonElement.TryGetUInt32(out uint value); + result = value; + } + else if (returnType == typeof(ushort)) + { + success = jsonElement.TryGetUInt16(out ushort value); + result = value; + } + else if (returnType == typeof(ulong)) + { + success = jsonElement.TryGetUInt64(out ulong value); + result = value; + } + else if (returnType == typeof(sbyte)) + { + success = jsonElement.TryGetSByte(out sbyte value); + result = value; + } + + if (!success) + { + // Use the raw test which may be recognized by converters such as the Enum converter than can process numbers. + string rawText = jsonElement.GetRawText(); + result = JsonSerializer.Deserialize($"{rawText}", returnType, Options)!; + } + + _lastValue = result!; + _type = result!.GetType(); + return true; + } + + internal override object Value => _value; + } + + /// + /// Supports dynamic booleans. + /// + public sealed class JsonDynamicBoolean : JsonDynamicType + { + private object _value; + private Type? _type; + + public JsonDynamicBoolean(bool value, JsonSerializerOptions options) : base(options) + { + _value = value; + _type = typeof(bool); + } + + public override T? GetValue() where T : default + { + bool success = TryConvert(typeof(T), out object? result); + Debug.Assert(success); + return (T) result!; + } + + public override void SetValue(object value) + { + _value = value; + _type = value.GetType(); + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType == _value!.GetType()) + { + result = _value; // Return cached value. + return true; + } + + if (TryConvertWithTypeConverter(_value, returnType, out result)) + { + return true; + } + + result = _value = JsonSerializer.Deserialize($"\"{Value}\"", returnType, Options)!; + _type = result?.GetType()!; + return true; + } + + internal override object Value => _value; + + public static implicit operator bool(JsonDynamicBoolean obj) + { + bool success = obj.TryConvert(typeof(bool), out object? result); + Debug.Assert(success); + return (bool) result!; + } + } + + /// + /// Supports dynamic objects. + /// + public sealed class JsonDynamicObject : JsonDynamicType, IDictionary + { + private IDictionary _value; + + public JsonDynamicObject(JsonSerializerOptions options) + : base(options) + { + _value = new Dictionary(options.PropertyNameCaseInsensitive + ? StringComparer.OrdinalIgnoreCase + : StringComparer.Ordinal); + } + + public override bool TryGetMember(GetMemberBinder binder, out object? result) + { + if (_value.TryGetValue(binder.Name, out result)) + { + JsonDynamicObject? dynamicObj = result as JsonDynamicObject; + if (dynamicObj != null) + { + return dynamicObj.TryConvert(binder.ReturnType, out result); + } + + return true; + } + + // Return null for missing properties. + result = null; + return true; + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType.IsAssignableFrom(typeof(IDictionary))) + { + result = this; + return true; + } + + result = null; + return false; + } + + public override bool TrySetMember(SetMemberBinder binder, object? value) + { + _value[binder.Name] = value!; + return true; + } + + internal override object Value => _value; + + public override T? GetValue() where T : default => throw new NotSupportedException(); + public override void SetValue(object value) => throw new NotSupportedException(); + + // IDictionary members. + public void Add(string key, object value) => _value.Add(key, value!); + void ICollection>.Add(KeyValuePair item) => _value.Add(item!); + public void Clear() => _value.Clear(); + bool ICollection>.Contains(KeyValuePair item) => _value.Contains(item); + public bool ContainsKey(string key) => _value.ContainsKey(key); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) + => _value.CopyTo(array, arrayIndex); + + public IEnumerator> GetEnumerator() => _value.GetEnumerator(); + public bool Remove(string key) => _value.Remove(key); + bool ICollection>.Remove(KeyValuePair item) => _value.Remove(item); + + public object this[string key] + { + get => _value[key]; + set => _value[key] = value!; + } + + ICollection IDictionary.Keys => _value.Keys; + ICollection IDictionary.Values => _value.Values; + public int Count => _value.Count; + bool ICollection>.IsReadOnly => _value.IsReadOnly; + IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable) _value).GetEnumerator(); + public bool TryGetValue(string key, out object value) => _value.TryGetValue(key, out value!); + } + + /// + /// Supports dynamic arrays. + /// + public sealed class JsonDynamicArray : JsonDynamicType, IList + { + private IList _value; + + public JsonDynamicArray(JsonSerializerOptions options) : base(options) + { + _value = new List(); + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType.IsAssignableFrom(typeof(IList))) + { + result = _value; + return true; + } + + result = null; + return false; + } + + internal override object Value => _value; + + public override T? GetValue() where T : default => throw new NotSupportedException(); + public override void SetValue(object value) => throw new NotSupportedException(); + + // IList members. + public object this[int index] + { + get => _value[index]; + set => _value[index] = value; + } + + public int Count => _value.Count; + bool ICollection.IsReadOnly => _value.IsReadOnly; + public void Add(object item) => _value.Add(item); + public void Clear() => _value.Clear(); + public bool Contains(object item) => _value.Contains(item); + void ICollection.CopyTo(object[] array, int arrayIndex) => _value.CopyTo(array, arrayIndex); + public IEnumerator GetEnumerator() => _value.GetEnumerator(); + public int IndexOf(object item) => _value.IndexOf(item); + public void Insert(int index, object item) => _value.Insert(index, item); + public bool Remove(object item) => _value.Remove(item); + public void RemoveAt(int index) => _value.RemoveAt(index); + IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable) _value).GetEnumerator(); + } + + /// + /// Supports deserialization of all -declared types, supporting . + /// supports serialization of all -derived types. + /// + private sealed class DynamicObjectConverter : JsonConverter + { + public override bool CanConvert(Type typeToConvert) + { + // For simplicity in adding the converter, we use a single converter instead of two. + return typeToConvert == typeof(object) || + typeof(JsonDynamicType).IsAssignableFrom(typeToConvert); + } + + public sealed override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case JsonTokenType.String: + return new JsonDynamicString(reader.GetString() ?? string.Empty, options); + case JsonTokenType.StartArray: + var dynamicArray = new JsonDynamicArray(options); + ReadList(dynamicArray, ref reader, options); + return dynamicArray; + case JsonTokenType.StartObject: + var dynamicObject = new JsonDynamicObject(options); + ReadObject(dynamicObject, ref reader, options); + return dynamicObject; + case JsonTokenType.False: + return new JsonDynamicBoolean(false, options); + case JsonTokenType.True: + return new JsonDynamicBoolean(true, options); + case JsonTokenType.Number: + JsonElement jsonElement = JsonElement.ParseValue(ref reader); + return new JsonDynamicNumber(jsonElement, options); + case JsonTokenType.Null: + throw new NotSupportedException(nameof(reader.TokenType)); + default: + throw new JsonException("Unexpected token type."); + } + } + + public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions? options) + { + if (value is JsonDynamicType dynamicType) + { + value = dynamicType.Value; + } + + JsonSerializer.Serialize(writer, value, options); + } + + private void ReadList(JsonDynamicArray dynamicArray, ref Utf8JsonReader reader, JsonSerializerOptions options) + { + while (true) + { + reader.Read(); + if (reader.TokenType == JsonTokenType.EndArray) + { + break; + } + + object value = Read(ref reader, typeof(object), options); + dynamicArray.Add(value); + } + } + + private void ReadObject(JsonDynamicObject dynamicObject, ref Utf8JsonReader reader, JsonSerializerOptions options) + { + while (true) + { + reader.Read(); + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException(); + } + + string key = reader.GetString() ?? string.Empty; + + reader.Read(); + object? value = Read(ref reader, typeof(object), options); + dynamicObject.Add(key, value); + } + } + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs new file mode 100644 index 000000000..6024cfecd --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs @@ -0,0 +1,38 @@ +using StackExchange.Redis; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Extensions; + +/// +/// Reference from https://github.com/dotnet/aspnetcore/blob/3c79366674/src/Caching/StackExchangeRedis/src/RedisExtensions.cs +/// +internal static class RedisExtensions +{ + internal static RedisValue[] HashMemberGet(this IDatabase cache, string key, params string[] members) + { + // TODO: Error checking? + return cache.HashGet(key, GetRedisMembers(members)); + } + + internal static async Task HashMemberGetAsync( + this IDatabase cache, + string key, + params string[] members) + { + // TODO: Error checking? + return await cache.HashGetAsync(key, GetRedisMembers(members)).ConfigureAwait(false); + } + + private static RedisValue[] GetRedisMembers(params string[] members) + { + var redisMembers = new RedisValue[members.Length]; + for (int i = 0; i < members.Length; i++) + { + redisMembers[i] = members[i]; + } + + return redisMembers; + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs new file mode 100644 index 000000000..d03c716ad --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs @@ -0,0 +1,122 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Caching.Redis.Internal.Enum; + +namespace Masa.Utils.Caching.Redis.Helpers; + +public static class RedisHelper +{ + public static T? ConvertToValue(RedisValue redisValue) + { + var type = typeof(T); + var compressMode = GetCompressMode(type); + + if (compressMode == CompressMode.None) + return (T?)Convert.ChangeType(redisValue, type); + + var byteValue = (byte[])redisValue; + if (byteValue == null || byteValue.Length == 0) + return default; + + var value = Decompress(byteValue); + + if (compressMode == CompressMode.Compress) + { + var valueString = Encoding.UTF8.GetString(value); + return (dynamic)valueString; + } + + var options = new JsonSerializerOptions(); + options.EnableDynamicTypes(); + + return JsonSerializer.Deserialize(value, options); + } + + public static RedisValue ConvertFromValue(T value) + { + var type = typeof(T); + dynamic redisValue; + switch (GetCompressMode(type)) + { + case CompressMode.None: + redisValue = value!; + break; + case CompressMode.Compress: + redisValue = Compress(Encoding.UTF8.GetBytes(value?.ToString() ?? string.Empty)); + break; + default: + var options = new JsonSerializerOptions(); + options.EnableDynamicTypes(); + + var jsonString = JsonSerializer.Serialize(value, options); + redisValue = Compress(Encoding.UTF8.GetBytes(jsonString)); + break; + } + return ConvertToRedisValue(type, redisValue); + } + + private static RedisValue ConvertToRedisValue(Type type, dynamic value) + { + if (type == typeof(byte) || type == typeof(ushort)) + return (long)value; + + if (type == typeof(decimal)) + return new RedisValue(value.ToString()); + + return value; + } + + public static byte[] Compress(byte[] data) + { + using (MemoryStream msGZip = new MemoryStream()) + using (GZipStream stream = new GZipStream(msGZip, CompressionMode.Compress, true)) + { + stream.Write(data, 0, data.Length); + stream.Close(); + return msGZip.ToArray(); + } + } + + public static byte[] Decompress(byte[] data) + { + using (MemoryStream ms = new MemoryStream(data)) + using (GZipStream stream = new GZipStream(ms, CompressionMode.Decompress)) + using (MemoryStream outBuffer = new MemoryStream()) + { + byte[] block = new byte[1024]; + while (true) + { + int bytesRead = stream.Read(block, 0, block.Length); + if (bytesRead <= 0) + break; + else + outBuffer.Write(block, 0, bytesRead); + } + return outBuffer.ToArray(); + } + } + + private static CompressMode GetCompressMode(this Type type) + { + switch (Type.GetTypeCode(type)) + { + case TypeCode.Byte: + case TypeCode.SByte: + case TypeCode.UInt16: + case TypeCode.UInt32: + case TypeCode.UInt64: + case TypeCode.Int16: + case TypeCode.Int32: + case TypeCode.Int64: + case TypeCode.Double: + case TypeCode.Single: + case TypeCode.Decimal: + return CompressMode.None; + case TypeCode.String: + return CompressMode.Compress; + default: + return CompressMode.SerializeAndCompress; + } + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs new file mode 100644 index 000000000..cb73be51d --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs @@ -0,0 +1,19 @@ +namespace Masa.Utils.Caching.Redis.Internal.Enum; + +internal enum CompressMode +{ + /// + /// no compression + /// + None = 1, + + /// + /// Compress but not deserialize + /// + Compress, + + /// + /// serialize and compress + /// + SerializeAndCompress, +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj new file mode 100644 index 000000000..df8b395e9 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs new file mode 100644 index 000000000..59b8dc550 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs @@ -0,0 +1,87 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Models; + +/// +/// The redis configuration options. +/// +public class RedisConfigurationOptions : DistributedCacheEntryOptions +{ + /// + /// Gets the servers. + /// + public List Servers { get; set; } = new(); + + /// + /// Gets or sets whether connect/configuration timeouts should be explicitly notified via a TimeoutException. + /// + public bool AbortOnConnectFail { get; set; } + + /// + /// Indicates whether admin operations should be allowed. + /// + public bool AllowAdmin { get; set; } + + /// + /// The client name to use for all connections + /// + public string ClientName { get; set; } = default!; + + /// + /// Automatically encodes and decodes channels. + /// + public string ChannelPrefix { get; set; } = default!; + + /// + /// The number of times to repeat the initial connect cycle if no servers respond promptly. + /// + public int ConnectRetry { get; set; } = 3; + + /// + /// Specifies the time in milliseconds that should be allowed for connection (defaults to 5 seconds unless SyncTimeout is higher) + /// + public int ConnectTimeout { get; set; } = 5000; + + /// + /// Specifies the default database to be used when calling ConnectionMultiplexer.GetDatabase() without any parameters. + /// + public int DefaultDatabase { get; set; } + + /// + /// The password to use to authenticate with the server. + /// + public string Password { get; set; }= default!; + + /// + /// Type of proxy to use (if any); for example Proxy.Twemproxy. + /// + public Proxy Proxy { get; set; } = Proxy.None; + + /// + /// Indicates whether the connection should be encrypted. + /// + public bool Ssl { get; set; } + + /// + /// Specifies the time in milliseconds that the system should allow for synchronous operations (defaults to 5 seconds) + /// + public int SyncTimeout { get; set; } = 1000; + + public void Initialize(RedisConfigurationOptions options) + { + Servers = options.Servers; + ClientName = options.ClientName; + ChannelPrefix = options.ChannelPrefix; + ConnectRetry = options.ConnectRetry; + ConnectTimeout = options.ConnectTimeout; + DefaultDatabase = options.DefaultDatabase; + Password = options.Password; + Proxy = options.Proxy; + Ssl = options.Ssl; + SyncTimeout = options.SyncTimeout; + AbsoluteExpiration = options.AbsoluteExpiration; + AbsoluteExpirationRelativeToNow = options.AbsoluteExpirationRelativeToNow; + SlidingExpiration = options.SlidingExpiration; + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs new file mode 100644 index 000000000..3f2204471 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs @@ -0,0 +1,73 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Models; + +/// +/// The redis configuration. +/// +public class RedisServerOptions +{ + private const int DEFAULT_REDIS_PORT = 6379; + + /// + /// Gets the host. + /// + public string Host { get; set; } = default!; + + /// + /// Gets the port. + /// + public int Port { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public RedisServerOptions() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The host. + public RedisServerOptions(string host) + { + if (string.IsNullOrWhiteSpace(host)) + { + throw new ArgumentNullException(nameof(host)); + } + + var lastIndex = host.LastIndexOf(':'); + if (lastIndex > 0 && host.Length > lastIndex + 1) + { + if (int.TryParse(host.Substring(lastIndex + 1), out var port)) + { + Host = host.Substring(0, lastIndex); + Port = port; + } + } + + if (string.IsNullOrEmpty(Host)) + { + Host = host; + Port = DEFAULT_REDIS_PORT; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// The host. + /// The port. + public RedisServerOptions(string host, int port) + { + if (string.IsNullOrWhiteSpace(host)) + { + throw new ArgumentNullException(nameof(host)); + } + + Host = host; + Port = port; + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClient.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClient.cs new file mode 100644 index 000000000..51abdb6a1 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClient.cs @@ -0,0 +1,576 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis; + +/// +/// The redis cache client. +/// +public class RedisCacheClient : IDistributedCacheClient +{ + // Reference from https://github.com/dotnet/aspnetcore/blob/3c793666742cfc4c389292f3378d15e32f860dc9/src/Caching/StackExchangeRedis/src/RedisCache.cs#L372 + // KEYS[1] = = key + // ARGV[1] = absolute-expiration - ticks as long (-1 for none) + // ARGV[2] = sliding-expiration - ticks as long (-1 for none) + // ARGV[3] = relative-expiration (long, in seconds, -1 for none) - Min(absolute-expiration - Now, sliding-expiration) + // ARGV[4] = data - byte[] + // this order should not change LUA script depends on it + private const string SET_SCRIPT = @" + redis.call('HSET', KEYS[1], 'absexp', ARGV[1], 'sldexp', ARGV[2], 'data', ARGV[4]) + if ARGV[3] ~= '-1' then + redis.call('EXPIRE', KEYS[1], ARGV[3]) + end + return 1"; + + private const string SET_MULTIPLE_SCRIPT = @" + local count = 0 + for i, key in ipairs(KEYS) do + redis.call('HSET', key, 'absexp', ARGV[1], 'sldexp', ARGV[2], 'data', ARGV[i+3]) + if ARGV[3] ~= '-1' then + redis.call('EXPIRE', key, ARGV[3]) + end + count = count + 1 + end + return count"; + + private const string ABSOLUTE_EXPIRATION_KEY = "absexp"; + private const string SLIDING_EXPIRATION_KEY = "sldexp"; + private const string DATA_KEY = "data"; + private const long NOT_PRESENT = -1; + + internal static readonly RedisConfigurationOptions RedisConfiguration = new(); + + private readonly IConnectionMultiplexer? _connection; + private readonly IDatabase _db; + private readonly ISubscriber _subscriber; + + public RedisCacheClient(ConfigurationOptions options) + { + _connection = ConnectionMultiplexer.Connect(options); + _db = _connection.GetDatabase(); + _subscriber = _connection.GetSubscriber(); + } + + /// + public T? Get(string key) + { + var redisValue = GetAndRefresh(key, getData: true); + if (redisValue.HasValue && !redisValue.IsNullOrEmpty) + { + return ConvertToValue(redisValue); + } + + return default; + } + + /// + public async Task GetAsync(string key) + { + var redisValue = await GetAndRefreshAsync(key, getData: true); + if (redisValue.HasValue && !redisValue.IsNullOrEmpty) + { + return ConvertToValue(redisValue); + } + + return default; + } + + /// + public T? GetOrSet(string key, Func setter, CombinedCacheEntryOptions? options = null) + { + if (string.IsNullOrWhiteSpace(key)) + throw new ArgumentNullException(nameof(key)); + + if (setter == null) + throw new ArgumentNullException(nameof(setter)); + + T? value; + + var redisValue = GetAndRefresh(key, true); + + if (redisValue.HasValue && !redisValue.IsNullOrEmpty) + { + value = ConvertToValue(redisValue); + } + else + { + value = setter(); + + Set(key, value, options); + } + + return value; + } + + /// + public async Task GetOrSetAsync(string key, Func setter, CombinedCacheEntryOptions? options = null) + { + if (string.IsNullOrWhiteSpace(key)) + throw new ArgumentNullException(nameof(key)); + + if (setter == null) + throw new ArgumentNullException(nameof(setter)); + + T? value; + + var redisValue = await GetAndRefreshAsync(key, getData: true); + + if (redisValue.HasValue && !redisValue.IsNullOrEmpty) + { + value = ConvertToValue(redisValue); + } + else + { + value = setter(); + + await SetAsync(key, value, options); + } + + return value; + } + + /// + public IEnumerable GetList(string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + // TODO: whether need to check keys.length + + var redisValues = keys.Select(key => GetAndRefresh(key, getData: true)); + + return redisValues + .Where(v => v.HasValue && !v.IsNullOrEmpty) + .Select(ConvertToValue); + } + + /// + public async Task> GetListAsync(string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + // TODO: whether need to check keys.length + + var redisValues = await Task.WhenAll(keys.Select(key => GetAndRefreshAsync(key, getData: true))); + + return redisValues + .Where(v => v.HasValue && !v.IsNullOrEmpty) + .Select(ConvertToValue); + } + + /// + public void Remove(params string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + _db.KeyDelete(keys.Select(key => (RedisKey)key).ToArray()); + } + + /// + public async Task RemoveAsync(params string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + await _db.KeyDeleteAsync(keys.Select(key => (RedisKey)key).ToArray()); + } + + /// + public void Set(string key, T value, CombinedCacheEntryOptions? options = null) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + if (value == null) + throw new ArgumentNullException(nameof(value)); + + if (options == null) + options = new CombinedCacheEntryOptions(); + + var distributedCacheEntryOptions = options.DistributedCacheEntryOptions; + + var bytesValue = ConvertFromValue(value); + + var creationTime = DateTimeOffset.UtcNow; + var absoluteExpiration = GetAbsoluteExpiration(creationTime, distributedCacheEntryOptions); + + var redisKeys = new RedisKey[] { key }; + var redisValues = new RedisValue[] + { + absoluteExpiration?.Ticks ?? NOT_PRESENT, + distributedCacheEntryOptions?.SlidingExpiration?.Ticks ?? NOT_PRESENT, + GetExpirationInSeconds(creationTime, absoluteExpiration, distributedCacheEntryOptions) ?? NOT_PRESENT, + bytesValue + }; + + _db.ScriptEvaluate(SET_SCRIPT, redisKeys, redisValues); + } + + /// + public async Task SetAsync(string key, T value, CombinedCacheEntryOptions? options = null) + { + ArgumentNullException.ThrowIfNull(key, nameof(key)); + + ArgumentNullException.ThrowIfNull(value, nameof(value)); + + options ??= new CombinedCacheEntryOptions(); + + var bytesValue = ConvertFromValue(value); + + await _db.ScriptEvaluateAsync( + SET_SCRIPT, + new RedisKey[] { key }, + GetRedisValues(options.DistributedCacheEntryOptions, () => new[] { (RedisValue)bytesValue }) + ).ConfigureAwait(false); + } + + /// + public void SetList(Dictionary keyValues, CombinedCacheEntryOptions? options = null) + { + ArgumentNullException.ThrowIfNull(keyValues, nameof(keyValues)); + + options ??= new CombinedCacheEntryOptions(); + + var redisKeys = keyValues.Select(item => (RedisKey)item.Key).ToArray(); + var redisValues = keyValues.Select(item => ConvertFromValue(item.Value)).ToArray(); + + _db.ScriptEvaluate( + SET_MULTIPLE_SCRIPT, + redisKeys, + GetRedisValues(options.DistributedCacheEntryOptions, () => redisValues) + ); + } + + /// + public async Task SetListAsync(Dictionary keyValues, CombinedCacheEntryOptions? options = null) + { + if (keyValues == null) + throw new ArgumentNullException(nameof(keyValues)); + + options ??= new CombinedCacheEntryOptions(); + + var keys = keyValues.Select(item => (RedisKey)item.Key).ToArray(); + var redisValues = keyValues.Select(item => ConvertFromValue(item.Value)).ToArray(); + + await _db.ScriptEvaluateAsync( + SET_MULTIPLE_SCRIPT, + keys, + GetRedisValues(options.DistributedCacheEntryOptions, () => redisValues) + ).ConfigureAwait(false); + } + + private RedisValue[] GetRedisValues(DistributedCacheEntryOptions? distributedCacheEntryOptions, Func? func = null) + { + var creationTime = DateTimeOffset.UtcNow; + var absoluteExpiration = GetAbsoluteExpiration(creationTime, distributedCacheEntryOptions); + List redisValues = new() + { + absoluteExpiration?.Ticks ?? NOT_PRESENT, + distributedCacheEntryOptions?.SlidingExpiration?.Ticks ?? NOT_PRESENT, + GetExpirationInSeconds(creationTime, absoluteExpiration, distributedCacheEntryOptions) ?? NOT_PRESENT, + }; + if (func != null) + { + redisValues.AddRange(func.Invoke()); + } + return redisValues.ToArray(); + } + + /// + public bool Exists(string key) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + return _db.KeyExists(key); + } + + /// + public async Task ExistsAsync(string key) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + return await _db.KeyExistsAsync(key); + } + + /// + public void Refresh(string key) + { + GetAndRefresh(key, getData: false); + } + + /// + public async Task RefreshAsync(string key) + { + await GetAndRefreshAsync(key, getData: false); + } + + /// + public void Subscribe(string channel, Action> handler) + { + _subscriber.Subscribe(channel, (_, message) => + { + var options = JsonSerializer.Deserialize>(message); + handler(options!); + }); + } + + /// + public async Task SubscribeAsync(string channel, Action> handler) + { + await _subscriber.SubscribeAsync(channel, (_, message) => + { + var options = JsonSerializer.Deserialize>(message); + handler(options!); + }); + } + + /// + public void Publish(string channel, Action> setup) + { + if (channel == null) + throw new ArgumentNullException(nameof(channel)); + + if (setup == null) + throw new ArgumentNullException(nameof(setup)); + + var options = new SubscribeOptions(); + setup.Invoke(options); + + if (string.IsNullOrWhiteSpace(options.Key)) + throw new ArgumentNullException(nameof(options.Key)); + + var message = JsonSerializer.Serialize(options); + + _subscriber.Publish(channel, message); + } + + /// + public async Task PublishAsync(string channel, Action> setup) + { + if (channel == null) + throw new ArgumentNullException(nameof(channel)); + + if (setup == null) + throw new ArgumentNullException(nameof(setup)); + + var options = new SubscribeOptions(); + setup.Invoke(options); + + if (string.IsNullOrWhiteSpace(options.Key)) + throw new ArgumentNullException(nameof(options.Key)); + + var message = JsonSerializer.Serialize(options); + + await _subscriber.PublishAsync(channel, message); + } + + public async Task HashIncrementAsync(string key, long value = 1L) + { + return await _db.HashIncrementAsync(key, DATA_KEY, value); + } + + public async Task HashDecrementAsync(string key, long value = 1L) + { + var script = $@" +local result = redis.call('HGET', KEYS[1], KEYS[2]) +if tonumber(result) >= {value} then + result = redis.call('HINCRBY', KEYS[1], KEYS[2], {0 - value}) + return result +else + return -1 +end"; + var result = (long)await _db.ScriptEvaluateAsync(script, new RedisKey[] { key, DATA_KEY }); + + return result; + } + + private RedisValue GetAndRefresh(string key, bool getData) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + RedisValue[] results; + if (getData) + { + results = _db.HashMemberGet(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY, DATA_KEY); + } + else + { + results = _db.HashMemberGet(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY); + } + + if (results.Length >= 2) + { + MapMetadata(results, out DateTimeOffset? absExpr, out TimeSpan? sldExpr); + Refresh(key, absExpr, sldExpr); + } + + if (results.Length >= 3 && results[2].HasValue) + { + return results[2]; + } + + return RedisValue.Null; + } + + private async Task GetAndRefreshAsync(string key, bool getData) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + RedisValue[] results; + if (getData) + { + results = await _db.HashMemberGetAsync(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY, DATA_KEY).ConfigureAwait(false); + } + else + { + results = await _db.HashMemberGetAsync(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY).ConfigureAwait(false); + } + + // TODO: Error handling + if (results.Length >= 2) + { + MapMetadata(results, out DateTimeOffset? absExpr, out TimeSpan? sldExpr); + await RefreshAsync(key, absExpr, sldExpr).ConfigureAwait(false); + } + + if (results.Length >= 3 && results[2].HasValue) + { + return results[2]; + } + + return RedisValue.Null; + } + + private void Refresh(string key, DateTimeOffset? absExpr, TimeSpan? sldExpr) + { + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + // Note Refresh has no effect if there is just an absolute expiration (or neither). + if (sldExpr.HasValue) + { + TimeSpan? expr; + if (absExpr.HasValue) + { + var relExpr = absExpr.Value - DateTimeOffset.Now; + expr = relExpr <= sldExpr.Value ? relExpr : sldExpr; + } + else + { + expr = sldExpr; + } + + _db.KeyExpire(key, expr); + // TODO: Error handling + } + } + + private async Task RefreshAsync(string key, DateTimeOffset? absExpr, TimeSpan? sldExpr, CancellationToken token = default) + { + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + token.ThrowIfCancellationRequested(); + + // Note Refresh has no effect if there is just an absolute expiration (or neither). + if (sldExpr.HasValue) + { + TimeSpan? expr; + if (absExpr.HasValue) + { + var relExpr = absExpr.Value - DateTimeOffset.Now; + expr = relExpr <= sldExpr.Value ? relExpr : sldExpr; + } + else + { + expr = sldExpr; + } + + await _db.KeyExpireAsync(key, expr).ConfigureAwait(false); + // TODO: Error handling + } + } + + private static void MapMetadata(RedisValue[] results, out DateTimeOffset? absoluteExpiration, out TimeSpan? slidingExpiration) + { + absoluteExpiration = null; + slidingExpiration = null; + var absoluteExpirationTicks = (long?)results[0]; + if (absoluteExpirationTicks.HasValue && absoluteExpirationTicks.Value != NOT_PRESENT) + { + absoluteExpiration = new DateTimeOffset(absoluteExpirationTicks.Value, TimeSpan.Zero); + } + + var slidingExpirationTicks = (long?)results[1]; + if (slidingExpirationTicks.HasValue && slidingExpirationTicks.Value != NOT_PRESENT) + { + slidingExpiration = new TimeSpan(slidingExpirationTicks.Value); + } + } + + private static long? GetExpirationInSeconds( + DateTimeOffset creationTime, + DateTimeOffset? absoluteExpiration, + DistributedCacheEntryOptions? options) + { + if (options == null) + return null; + + if (absoluteExpiration.HasValue && options.SlidingExpiration.HasValue) + { + return (long)Math.Min( + (absoluteExpiration.Value - creationTime).TotalSeconds, + options.SlidingExpiration.Value.TotalSeconds); + } + + if (absoluteExpiration.HasValue) + { + return (long)(absoluteExpiration.Value - creationTime).TotalSeconds; + } + + if (options is { SlidingExpiration: { } }) + { + return (long)options.SlidingExpiration.Value.TotalSeconds; + } + + return null; + } + + private static DateTimeOffset? GetAbsoluteExpiration(DateTimeOffset creationTime, DistributedCacheEntryOptions? options) + { + if (options == null) + return null; + + if (options.AbsoluteExpiration.HasValue && options.AbsoluteExpiration <= creationTime) + { + throw new ArgumentOutOfRangeException( + nameof(DistributedCacheEntryOptions.AbsoluteExpiration), + options.AbsoluteExpiration.Value, + "The absolute expiration value must be in the future."); + } + + if (options.AbsoluteExpirationRelativeToNow.HasValue) + { + return creationTime + options.AbsoluteExpirationRelativeToNow; + } + + return options.AbsoluteExpiration; + } + + /// + public void Dispose() + { + if (_connection != null) + _connection.Dispose(); + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs new file mode 100644 index 000000000..3bd8918d5 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis; + +public class RedisCacheClientFactory : DistributedCacheClientFactory +{ + public RedisCacheClientFactory(IOptionsMonitor optionsMonitor) : base(optionsMonitor) + { + + } + + protected override IDistributedCacheClient CreateClientHandler(string name) + { + var options = GetOptions(name); + + if (options == null) + { + throw new ArgumentException("No matching client found!"); + } + + var configurationOptions = new ConfigurationOptions + { + AbortOnConnectFail = options.AbortOnConnectFail, + AllowAdmin = options.AllowAdmin, + ChannelPrefix = options.ChannelPrefix, + ClientName = options.ClientName, + ConnectRetry = options.ConnectRetry, + ConnectTimeout = options.ConnectTimeout, + DefaultDatabase = options.DefaultDatabase, + Password = options.Password, + Proxy = options.Proxy, + Ssl = options.Ssl, + SyncTimeout = options.SyncTimeout + }; + + foreach (var server in options.Servers) + { + configurationOptions.EndPoints.Add(server.Host, server.Port); + } + + return new RedisCacheClient(configurationOptions); + } +} diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/_Imports.cs b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/_Imports.cs new file mode 100644 index 000000000..b6b6321b1 --- /dev/null +++ b/src/Utils/src/Caching/Masa.Utils.Caching.Redis/_Imports.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caching.Core; +global using Masa.Utils.Caching.Core.DependencyInjection; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Core.Models; +global using Masa.Utils.Caching.Redis; +global using Masa.Utils.Caching.Redis.Extensions; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.Extensions.Caching.Distributed; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Options; +global using StackExchange.Redis; +global using System.Collections; +global using System.ComponentModel; +global using System.Diagnostics; +global using System.Dynamic; +global using System.IO.Compression; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; +global using static Masa.Utils.Caching.Redis.Helpers.RedisHelper; diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs new file mode 100644 index 000000000..abf252544 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs @@ -0,0 +1,391 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public abstract class AbstractCallerProvider : ICallerProvider +{ + private readonly ITypeConvertProvider _typeConvertProvider; + public readonly IServiceProvider ServiceProvider; + + private IRequestMessage? _requestMessage; + private IResponseMessage? _responseMessage; + protected IRequestMessage RequestMessage => _requestMessage ??= ServiceProvider.GetRequiredService(); + protected IResponseMessage ResponseMessage => _responseMessage ??= ServiceProvider.GetRequiredService(); + + public AbstractCallerProvider(IServiceProvider serviceProvider) + { + _typeConvertProvider = serviceProvider.GetRequiredService(); + ServiceProvider = serviceProvider; + } + + public virtual async Task SendAsync( + HttpRequestMessage request, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var response = await SendAsync(request, cancellationToken); + if (autoThrowUserFriendlyException) + await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + + return response; + } + + public abstract Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + public abstract Task CreateRequestAsync( + HttpMethod method, + string? methodName); + + public abstract Task CreateRequestAsync( + HttpMethod method, + string? methodName, + TRequest data); + + public abstract Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName); + request.Content = content; + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public abstract Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default); + + public abstract Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default) + where TResponse : IMessage, new(); + + public abstract Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage; + + public abstract Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage + where TResponse : IMessage, new(); + + public virtual async Task GetStringAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsStringAsync(cancellationToken); + } + + public virtual Task GetStringAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetStringAsync( + GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetStringAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetStringAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetByteArrayAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsByteArrayAsync(cancellationToken); + } + + public virtual Task GetByteArrayAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetByteArrayAsync( + GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetByteArrayAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetByteArrayAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetStreamAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsStreamAsync(cancellationToken); + } + + public virtual Task GetStreamAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetStreamAsync( + GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetStreamAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetStreamAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual Task GetAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Get, methodName, null, autoThrowUserFriendlyException, cancellationToken); + + public virtual Task GetAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetAsync( + string? methodName, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) where TRequest : class + { + HttpRequestMessage request = + await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data))); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = + await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data))); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + Dictionary data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, data)); + return await SendAsync(request, cancellationToken); + } + + protected virtual string GetUrl(string? url, IEnumerable> properties) + { + url ??= string.Empty; + foreach (var property in properties) + { + string value = property.Value; + + url = !url.Contains("?") ? + $"{url}?{property.Key}={value}" : + $"{url}&{property.Key}={value}"; + } + + return url; + } + + public virtual Task PostAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Post, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PostAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PostAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PostAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task PatchAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Patch, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PatchAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Patch, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PatchAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PatchAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task PutAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Put, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PutAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PutAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PutAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task DeleteAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Delete, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task DeleteAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task DeleteAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task DeleteAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, cancellationToken); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs new file mode 100644 index 000000000..11d8d1a36 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class AddCallerExtensions +{ + public static void AddCaller(CallerOptions callerOptions, string name, bool isDefault, Func func) + { + if (callerOptions.Callers.Any(c => c.Name == name)) + throw new ArgumentException($"The caller name already exists, please change the name, the repeat name is {name}"); + + callerOptions.Callers.Add(new CallerRelations(name, isDefault, func)); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerBase.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerBase.cs new file mode 100644 index 000000000..d09453db8 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerBase.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public abstract class CallerBase +{ + public virtual string Name { get; set; } = string.Empty; + + protected CallerOptions CallerOptions { get; private set; } = default!; + + private ICallerProvider? _callerProvider; + + protected ICallerProvider CallerProvider => _callerProvider ??= ServiceProvider.GetRequiredService().CreateClient(Name); + + private IServiceProvider ServiceProvider { get; } + + protected CallerBase(IServiceProvider serviceProvider) + { + ServiceProvider = serviceProvider; + } + + public abstract void UseCallerExtension(); + + public void SetCallerOptions(CallerOptions options, string name) + { + CallerOptions = options; + if (string.IsNullOrEmpty(Name)) + Name = name; + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerOptions.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerOptions.cs new file mode 100644 index 000000000..61ccb5535 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerOptions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class CallerOptions +{ + internal readonly List Callers = new(); + + public IServiceCollection Services { get; } + + private Assembly[] _assemblies = AppDomain.CurrentDomain.GetAssemblies(); + + public Assembly[] Assemblies + { + get => _assemblies; + set + { + ArgumentNullException.ThrowIfNull(value, nameof(Assemblies)); + + _assemblies = value; + } + } + + public ServiceLifetime CallerLifetime { get; set; } + + public JsonSerializerOptions? JsonSerializerOptions { get; set; } + + public string RequestIdKey { get; set; } = "Masa-Request-Id"; + + public CallerOptions(IServiceCollection services) + { + Services = services; + CallerLifetime = ServiceLifetime.Scoped; + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs new file mode 100644 index 000000000..2f8c1a3c2 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +internal class DefaultCallerFactory : ICallerFactory +{ + private readonly IServiceProvider _serviceProvider; + private readonly List _callers; + + public DefaultCallerFactory(IServiceProvider serviceProvider, CallerOptions options) + { + _serviceProvider = serviceProvider; + _callers = options.Callers; + } + + public ICallerProvider CreateClient() + { + var caller = _callers.SingleOrDefault(c => c.IsDefault) ?? _callers.FirstOrDefault()!; + return caller.Func.Invoke(_serviceProvider); + } + + public ICallerProvider CreateClient(string name) + { + var caller = _callers.SingleOrDefault(c => c.Name == name); + if (caller == null) + throw new NotSupportedException($"Please make sure you have used [{name}] Caller"); + + return caller.Func.Invoke(_serviceProvider); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs new file mode 100644 index 000000000..cc232ed08 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class DefaultRequestIdGenerator : IRequestIdGenerator +{ + public string NewId() => Guid.NewGuid().ToString(); +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs new file mode 100644 index 000000000..300462c30 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public abstract class DefaultRequestMessage +{ + private readonly string _requestIdKey; + private readonly IRequestIdGenerator _requestIdGenerator; + private readonly IHttpContextAccessor? _httpContextAccessor; + + public DefaultRequestMessage(string requestIdKey, IRequestIdGenerator requestIdGenerator, + IHttpContextAccessor? httpContextAccessor = null) + { + _requestIdKey = requestIdKey; + _requestIdGenerator = requestIdGenerator; + _httpContextAccessor = httpContextAccessor; + } + + protected void TrySetRequestId(HttpRequestMessage requestMessage) + { + var httpContext = _httpContextAccessor?.HttpContext; + if (httpContext == null) + return; + + if (!httpContext.Request.Headers.TryGetValue(_requestIdKey, out var requestId)) + requestId = _requestIdGenerator.NewId(); + + if (requestMessage.Headers.All(h => h.Key != _requestIdKey)) + requestMessage.Headers.Add(_requestIdKey, requestId.ToString()); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs new file mode 100644 index 000000000..7f50faa39 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs @@ -0,0 +1,92 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class DefaultResponseMessage : IResponseMessage +{ + private readonly ILogger? _logger; + private readonly CallerOptions _callerOptions; + + public DefaultResponseMessage(CallerOptions callerOptions, ILogger? logger = null) + { + _callerOptions = callerOptions; + _logger = logger; + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, + CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case HttpStatusCode.Accepted: + case HttpStatusCode.NoContent: + return default; + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + return (TResponse)Convert.ChangeType(content, typeof(TResponse)); + } + try + { + return await response.Content.ReadFromJsonAsync(_callerOptions.JsonSerializerOptions, cancellationToken) + ?? throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); + } + catch (Exception exception) + { + _logger?.LogWarning(exception, exception.Message); + ExceptionDispatchInfo.Capture(exception).Throw(); + return default; //This will never be executed, the previous line has already thrown an exception + } + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + return default; //never executed + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + return; + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + } + + public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.Content.Headers.ContentLength is > 0) + throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); + + throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs new file mode 100644 index 000000000..39a57bb2c --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs @@ -0,0 +1,98 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class DefaultTypeConvertProvider : ITypeConvertProvider +{ + private static readonly ConcurrentDictionary> Dictionary = new(); + + protected readonly List NotNeedSerializeTypes = new() + { + typeof(String), + typeof(Guid), + typeof(DateTime), + typeof(Decimal), + typeof(Guid?), + typeof(DateTime?), + typeof(Decimal?) + }; + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + [Obsolete("Use ConvertToKeyValuePairs instead")] + public Dictionary ConvertToDictionary(TRequest request) where TRequest : class + => new(ConvertToKeyValuePairs(request)); + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + public IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class + { + if (request.Equals(null)) + return Array.Empty>(); + + if (request is Dictionary response) + return response; + + if (request is IEnumerable> keyValuePairs) + return keyValuePairs; + + var requestType = request.GetType(); + if (!Dictionary.TryGetValue(requestType, out List? members)) + { + members = GetMembers(request.GetType().GetProperties()); + Dictionary.TryAdd(requestType, members); + } + List> data = new List>(); + foreach (var member in members) + { + if (member.TryGetValue(request, out string value)) + data.Add(new KeyValuePair(member.Name, value)); + } + return data; + } + + private List GetMembers(PropertyInfo[] properties) + { + List members = new(); + foreach (var property in properties) + { + if (IsSkip(property)) continue; + + string name = GetPropertyName(property); + + members.Add(new PropertyInfoMember(property, name, IsNeedSerialize(property))); + } + return members; + } + + protected bool IsSkip(PropertyInfo property) + => !property.CanRead || + !property.PropertyType.IsPublic || + property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonIgnoreAttribute)); + + protected string GetPropertyName(PropertyInfo property) + { + if (property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))) + { + var customAttributeData = + property.CustomAttributes.FirstOrDefault(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))!; + var customAttribute = customAttributeData.ConstructorArguments.FirstOrDefault(); + return customAttribute.Value?.ToString() ?? + throw new NotSupportedException( + $"Parameter name: {property.Name}, But the JsonPropertyNameAttribute assignment name is empty"); + } + return property.Name; + } + + protected bool IsNeedSerialize(PropertyInfo property) + => !property.PropertyType.IsPrimitive && !NotNeedSerializeTypes.Contains(property.PropertyType); +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs new file mode 100644 index 000000000..12013c0a1 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface ICallerFactory +{ + ICallerProvider CreateClient(); + + ICallerProvider CreateClient(string name); +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs new file mode 100644 index 000000000..a77a3df09 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs @@ -0,0 +1,219 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface ICallerProvider +{ + Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpRequestMessage request, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default); + + Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default) + where TResponse : IMessage, new(); + + Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage; + + Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage + where TResponse : IMessage, new(); + + Task GetStringAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStringAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetStringAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetByteArrayAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetByteArrayAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetByteArrayAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStreamAsync(string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStreamAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetStreamAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + where TRequest : class; + + Task GetAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task GetAsync(string? methodName, Dictionary data, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task DeleteAsync(string? methodName, TRequest data, CancellationToken cancellationToken = default); + + Task DeleteAsync(string? methodName, object data, CancellationToken cancellationToken = default); +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs new file mode 100644 index 000000000..d542a95b7 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface IRequestIdGenerator +{ + string NewId(); +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs new file mode 100644 index 000000000..2686fef7d --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface IRequestMessage +{ + Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage); + + Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data); +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs new file mode 100644 index 000000000..183320451 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface IResponseMessage +{ + Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); + + Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs new file mode 100644 index 000000000..25fc03873 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface ITypeConvertProvider +{ + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + [Obsolete("Use ConvertToKeyValuePairs instead")] + Dictionary ConvertToDictionary(TRequest request) where TRequest : class; + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class; +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs new file mode 100644 index 000000000..0e9c441c0 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs @@ -0,0 +1,89 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Internal; + +/// +/// Caller dependency orchestration +/// +internal static class CallerDependExtensions +{ + /// + /// Caller dependency orchestration + /// + /// All Callers that inherit CallerBase + /// + /// + public static List Arrangement(this List callerTypes) + { + List types = GetCallerByNotDependCaller(callerTypes); + if (types.Count == 0) + throw new UserFriendlyException(Const.CIRCULAR_DEPENDENCY); + + return callerTypes.CallersArrangement(types, 1); + } + + private static List CallersArrangement(this List allTypes, List existTypes, int executeTimes) + { + List types = existTypes; + var dependCallerTypes = allTypes.Except(existTypes); + foreach (var type in dependCallerTypes) + { + var constructorInfo = type.GetConstructors().MaxBy(con => con.GetParameters().Length)!; + bool isExist = true; + foreach (var parameter in constructorInfo.GetParameters()) + { + var parameterType = parameter.ParameterType; + if (typeof(CallerBase).IsAssignableFrom(parameterType) && !types.Contains(parameterType)) + { + isExist = false; + } + } + if (isExist) + types.Add(type); + } + + if (types.Count != allTypes.Count) + { + if (executeTimes >= allTypes.Count) + throw new UserFriendlyException(Const.CIRCULAR_DEPENDENCY); + + return CallersArrangement(allTypes, types, ++executeTimes); + } + return types; + } + + /// + /// Get a Caller object that does not depend on other Callers + /// + /// + /// + private static List GetCallerByNotDependCaller(this List callerTypes) + { + List types = new(); + callerTypes.ForEach(type => + { + if (!type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).IsDependCaller()) + types.Add(type); + }); + return types; + } + + private static bool IsDependCaller(this ConstructorInfo[] constructorInfos) + { + var constructorInfo = constructorInfos.MaxBy(constructorInfo => constructorInfo.GetParameters().Length)!; + return constructorInfo.IsDependCaller(); + } + + private static bool IsDependCaller(this ConstructorInfo constructorInfo) + { + foreach (var parameter in constructorInfo.GetParameters()) + { + if (typeof(CallerBase).IsAssignableFrom(parameter.ParameterType)) + { + return true; + } + } + return false; + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs new file mode 100644 index 000000000..1724865fe --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Internal; + +internal class CallerRelations +{ + public string Name { get; } = default!; + + public bool IsDefault { get; } + + public Func Func { get; } = default!; + + public CallerRelations(string name, bool isDefault, Func func) + { + Name = name; + IsDefault = isDefault; + Func = func; + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Const.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Const.cs new file mode 100644 index 000000000..191ba6c15 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Const.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Internal; + +internal class Const +{ + public const string CIRCULAR_DEPENDENCY = "Caller has a circular dependency, please check the constructor of Caller"; +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs new file mode 100644 index 000000000..3958e6f4d --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Internal.Options; + +internal class PropertyInfoMember +{ + public PropertyInfo Property { get; } + + public string Name { get; } + + public bool NeedSerialize { get; } + + public PropertyInfoMember(PropertyInfo property, string name, bool needSerialize) + { + Property = property; + Name = name; + NeedSerialize = needSerialize; + } + + public bool TryGetValue(TRequest data, out string value) where TRequest : class + { + value = string.Empty; + var propertyValue = Property.GetValue(data); + if (propertyValue == null || (!NeedSerialize && propertyValue.ToString() == null)) + return false; + + value = !NeedSerialize ? propertyValue.ToString()! : JsonSerializer.Serialize(propertyValue); + return true; + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs new file mode 100644 index 000000000..004c4e081 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class JsonRequestMessage : DefaultRequestMessage, IRequestMessage +{ + private readonly JsonSerializerOptions? _jsonSerializerOptions; + + public JsonRequestMessage( + CallerOptions callerOptions, + IRequestIdGenerator requestIdGenerator, + IHttpContextAccessor? httpContextAccessor = null) + : base(callerOptions.RequestIdKey, requestIdGenerator, httpContextAccessor) + => _jsonSerializerOptions = callerOptions.JsonSerializerOptions; + + public virtual Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) + { + TrySetRequestId(requestMessage); + return Task.FromResult(requestMessage); + } + + public virtual async Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) + { + requestMessage = await ProcessHttpRequestMessageAsync(requestMessage); + requestMessage.Content = JsonContent.Create(data, options: _jsonSerializerOptions); + return requestMessage; + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj new file mode 100644 index 000000000..9488b24bd --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/README.md b/src/Utils/src/Caller/Masa.Utils.Caller.Core/README.md new file mode 100644 index 000000000..3b35bcdb2 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/README.md @@ -0,0 +1,36 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Caller.Core + +Masa.Utils.Caller.Core is the basic class library of Caller, which provides the abstraction of the following capabilities + +* `ICallerFactory`: Factory for creating `CallerProvider` (Singleton) +* `ICallerProvider`: Provides `Post`, `Delete`, `Patch`, `Put`, `Get`, `Send` capabilities (Scoped) +* `IRequestMessage`: Provides the ability to process request data (default implementation [`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) +* `IResponseMessage`: Provides the ability to handle response data (default implementation [`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) +* `ITypeConvertProvider`: Provides the ability to convert types, support for `Get` requests of `ICallerProvider` (Singleton) + +## Summarize + +`Masa.Utils.Caller.Core` is the basic class library of Caller, but it cannot be used alone. Currently, Caller supports two implementations: + +* Implementation based on HttpClient: [Masa.Utils.Caller.HttpClient](../Masa.Utils.Caller.HttpClient/README.md) +* Implementation based on DaprClient: [Masa.Utils.Caller.DaprClient](../Masa.Utils.Caller.DaprClient/README.md) + +> Q: What should I do if the callee uses xml instead of json? +> +> A: Rewrite IRequestMessage and add the custom RequestMessage to the IServiceCollection before calling AddCaller + + ```` C# + services.AddSingleton(); + services.AddCaller(); + ```` + +> Q: If you want to handle custom StatusCode and throw exception information +> +> A: Rewrite IResponseMessage, add custom ResponseMessage to IServiceCollection before calling AddCaller + + ```` C# + services.AddSingleton(); + services.AddCaller(); + ```` \ No newline at end of file diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/README.zh-CN.md b/src/Utils/src/Caller/Masa.Utils.Caller.Core/README.zh-CN.md new file mode 100644 index 000000000..e4148a140 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/README.zh-CN.md @@ -0,0 +1,36 @@ +中 | [EN](README.md) + +## Masa.Utils.Caller.Core + +Masa.Utils.Caller.Core是Caller的基础类库,提供了以下能力的抽象 + +* `ICallerFactory`: 工厂,用于创建`CallerProvider` (Singleton) +* `ICallerProvider`: 提供`Post`、`Delete`、`Patch`、`Put`、`Get`、`Send`的能力 (Scoped) +* `IRequestMessage`: 提供对请求数据处理的能力 (默认实现[`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) +* `IResponseMessage`: 提供对响应数据处理的能力 (默认实现[`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) +* `ITypeConvertProvider`: 提供类型转换的能力,为`ICallerProvider`的`Get`请求支撑 (Singleton) + +## 总结 + +`Masa.Utils.Caller.Core`是Caller的基础类库,但不能单独使用,目前Caller支持了两种实现方式: + +* 基于HttpClient的实现: [Masa.Utils.Caller.HttpClient](../Masa.Utils.Caller.HttpClient/README.zh-CN.md) +* 基于DaprClient的实现: [Masa.Utils.Caller.DaprClient](../Masa.Utils.Caller.DaprClient/README.zh-CN.md) + +> Q: 如果被调用方使用的是数据格式为xml,而不是json,我应该怎么做? +> +> A: 重写IRequestMessage,在调用AddCaller之前先将自定义的RequestMessage添加到IServiceCollection中 + + ``` C# + services.AddSingleton(); + services.AddCaller(); + ``` + +> Q: 如果希望处理自定义的StatusCode,并抛出异常信息 +> +> A: 重写IResponseMessage,在调用AddCaller之前先将自定义的ResponseMessage添加到IServiceCollection中 + + ``` C# + services.AddSingleton(); + services.AddCaller(); + ``` \ No newline at end of file diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..fa23ee27c --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs @@ -0,0 +1,105 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddCaller(this IServiceCollection services) + => services.AddCaller(AppDomain.CurrentDomain.GetAssemblies()); + + public static IServiceCollection AddCaller(this IServiceCollection services, params Assembly[] assemblies) + => services.AddCaller(options => options.Assemblies = assemblies); + + private static IServiceCollection AddCaller(this IServiceCollection services, + ServiceLifetime lifetime = ServiceLifetime.Scoped, + params Assembly[] assemblies) + => services.AddCaller(options => + { + options.Assemblies = assemblies; + options.CallerLifetime = lifetime; + }); + + public static IServiceCollection AddCaller(this IServiceCollection services, Action options) + { + CallerOptions callerOption = new CallerOptions(services); + options.Invoke(callerOption); + + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddScoped(serviceProvider => serviceProvider.GetRequiredService().CreateClient()); + + services.TryAddSingleton(); + services.AddAutomaticCaller(callerOption); + TryOrUpdateCallerOptions(services, callerOption); + return services; + } + + private static IServiceCollection TryOrUpdateCallerOptions(this IServiceCollection services, CallerOptions options) + { + services.TryAddSingleton(new CallerOptions(options.Services)); + var serviceProvider = services.BuildServiceProvider(); + var callerOptions = serviceProvider.GetRequiredService(); + + options.Callers.ForEach(caller => + { + if (callerOptions.Callers.Any(relation => relation.Name == caller.Name)) + throw new ArgumentException( + $"The caller name already exists, please change the name, the repeat name is [{caller.Name}]"); + + if (callerOptions.Callers.Any(relation => relation.IsDefault && caller.IsDefault)) + { + string errorCallerNames = string.Join("、", callerOptions.Callers + .Where(relation => relation.IsDefault) + .Select(relation => relation.Name) + .Concat(options.Callers.Where(relation => relation.IsDefault).Select(relation => relation.Name)) + .Distinct()); + throw new ArgumentException( + $"There can only be at most one default Caller Provider, and now the following Caller Providers are found to be default: {errorCallerNames}"); + } + + callerOptions.Callers.Add(caller); + }); + + return services; + } + + private static void AddAutomaticCaller(this IServiceCollection services, CallerOptions callerOptions) + { + var callerTypes = callerOptions.Assemblies.SelectMany(x => x.GetTypes()) + .Where(type => typeof(CallerBase).IsAssignableFrom(type) && !type.IsAbstract).ToList(); + + callerTypes = callerTypes.Except(services.Select(d => d.ServiceType)).ToList(); + + if (callerTypes.Count == 0) + return; + + + callerTypes.Arrangement().ForEach(type => + { + ServiceDescriptor serviceDescriptor = new ServiceDescriptor(type, serviceProvider => + { + var constructorInfo = type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) + .MaxBy(constructor => constructor.GetParameters().Length)!; + List parameters = new(); + foreach (var parameter in constructorInfo.GetParameters()) + { + parameters.Add(serviceProvider.GetRequiredService(parameter.ParameterType)); + } + var callerBase = (constructorInfo.Invoke(parameters.ToArray()) as CallerBase)!; + callerBase.SetCallerOptions(callerOptions, type.FullName ?? type.Name); + return callerBase; + }, callerOptions.CallerLifetime); + services.TryAdd(serviceDescriptor); + }); + + var serviceProvider = services.BuildServiceProvider(); + callerTypes.ForEach(type => + { + var callerBase = (CallerBase)serviceProvider.GetRequiredService(type); + callerBase.UseCallerExtension(); + }); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/_Imports.cs b/src/Utils/src/Caller/Masa.Utils.Caller.Core/_Imports.cs new file mode 100644 index 000000000..95fdf3d27 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.Core/_Imports.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Google.Protobuf; +global using Masa.Utils.Caller.Core; +global using Masa.Utils.Caller.Core.Internal; +global using Masa.Utils.Caller.Core.Internal.Options; +global using Masa.Utils.Exceptions; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using System.Collections.Concurrent; +global using System.Net; +global using System.Net.Http.Json; +global using System.Reflection; +global using System.Runtime.ExceptionServices; +global using System.Text.Json; +global using System.Text.Json.Serialization; +global using Microsoft.AspNetCore.Http; diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs new file mode 100644 index 000000000..561c8a73c --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.DaprClient; + +public static class CallerOptionsExtensions +{ + public static CallerOptions UseDapr(this CallerOptions callerOptions, Func clientBuilder) + { + if (clientBuilder == null) + throw new ArgumentNullException(nameof(clientBuilder)); + + MasaDaprClientBuilder builder = clientBuilder.Invoke(); + if (clientBuilder == null) + throw new ArgumentNullException(nameof(clientBuilder)); + + callerOptions.Services.AddDaprClient(daprClientBuilder => + { + if (callerOptions.JsonSerializerOptions != null) + daprClientBuilder.UseJsonSerializationOptions(callerOptions.JsonSerializerOptions); + + builder.Configure?.Invoke(daprClientBuilder); + }); + + AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, + serviceProvider => new DaprCallerProvider(serviceProvider, builder.AppId)); + return callerOptions; + } + + public static CallerOptions UseDapr(this CallerOptions callerOptions, Action clientBuilder) + { + if (clientBuilder == null) + throw new ArgumentNullException(nameof(clientBuilder)); + + MasaDaprClientBuilder builder = new MasaDaprClientBuilder(); + clientBuilder.Invoke(builder); + + return callerOptions.UseDapr(() => builder); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs new file mode 100644 index 000000000..b882ec689 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.DaprClient; + +public abstract class DaprCallerBase : CallerBase +{ + protected abstract string AppId { get; set; } + + public virtual Action? Configure { get; set; } = null; + + protected DaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public override void UseCallerExtension() => UseDapr(); + + protected virtual void UseDapr() + { + CallerOptions.UseDapr(opt => + { + opt.Name = Name; + opt.AppId = AppId; + if (Configure != null) + { + opt.Configure = Configure; + } + }); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs new file mode 100644 index 000000000..246ea8c8a --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs @@ -0,0 +1,46 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.DaprClient; + +public class DaprCallerProvider : AbstractCallerProvider +{ + private readonly string AppId; + private Dapr.Client.DaprClient? _daprClient; + private Dapr.Client.DaprClient DaprClient => _daprClient ??= ServiceProvider.GetRequiredService(); + + public DaprCallerProvider(IServiceProvider serviceProvider, string appId) + : base(serviceProvider) + => AppId = appId; + + public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + where TResponse : default + { + var response = await DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); + return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + } + + public override Task CreateRequestAsync(HttpMethod method, string? methodName) + => RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName)); + + public override Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) + => RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName), data); + + public override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); + + public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, request, cancellationToken); + + public override Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj new file mode 100644 index 000000000..a8e99bc03 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs new file mode 100644 index 000000000..eeaf95d33 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs @@ -0,0 +1,70 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.DaprClient; + +public class MasaDaprClientBuilder +{ + private string _appId = default!; + + public string AppId + { + get + { + return _appId; + } + set + { + if (string.IsNullOrEmpty(value)) + throw new ArgumentNullException(nameof(AppId)); + + _appId = value; + } + } + + private string _name = default!; + + public string Name + { + get + { + return _name; + } + set + { + if (value is null) + throw new ArgumentNullException(nameof(Name)); + + _name = value; + } + } + + public bool IsDefault { get; set; } = false; + + public Action? Configure { get; set; } + + internal MasaDaprClientBuilder() + { + this.Name = string.Empty; + } + + public MasaDaprClientBuilder(string appid) + : this(appid, "dapr") { } + + public MasaDaprClientBuilder(string appid, string name) + : this(appid, name, null) + { + } + + public MasaDaprClientBuilder(string appid, string name, Action? configure) : this(appid, name, configure, false) + { + } + + public MasaDaprClientBuilder(string appid, string name, Action? configure, bool isDefault) + { + AppId = appid; + Name = name; + Configure = configure; + IsDefault = isDefault; + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.md b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.md new file mode 100644 index 000000000..0a4543e05 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.md @@ -0,0 +1,101 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Caller.DaprClient + +## Example: + +````c# +Install-Package Masa.Utils.Caller.DaprClient +```` + +### Basic usage: + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one Provider, you can not assign a value to Name + clientBuilder.AppId = "" ;//AppID of the callee dapr + }); + }); + ```` + +2. How to use: + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + ```` + + > The interface address of the complete request is: http://localhost:3500/v1.0/invoke//method/Hello?Name={name} + +3. When there are multiple DaprClients, modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller"; + clientBuilder.AppId = "" ;//AppID of the callee User service Dapr + }); + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "OrderCaller"; + clientBuilder.AppId = "" ;//AppID of the callee Order service Dapr + }); + }); + ```` + +4. How to use UserCaller or OrderCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var callerProvider = callerFactory.CreateClient("OrderCaller"); + return callerProvider.GetAsync($"/Hello", new { Name = name }); + }); + ```` + +> When multiple Callers are added, how to get the specified Caller? +>> Get the CallerProvider of the specified alias through the `CreateClient` method of `CallerFactory` +> +> Why doesn't `userCallerProvider` get the corresponding Caller through the `CreateClient` method of `CallerFactory`? +>> If no default ICallerProvider is specified, the default CallerProvider is the first one added in the `AddCaller` method + +### Recommended usage + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(); + ```` + +2. Add a new class `UserCaller` + + ```` C# + public class UserCaller: DaprCallerBase + { + protected override string AppId { get; set; } = ""; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); + } + ```` + +3. How to use UserCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ```` \ No newline at end of file diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md new file mode 100644 index 000000000..4a0fd6ff8 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md @@ -0,0 +1,101 @@ +中 | [EN](README.md) + +## Masa.Utils.Caller.DaprClient + +## 用例: + +```c# +Install-Package Masa.Utils.Caller.DaprClient +``` + +### 基本用法: + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个Provider时,可以不对Name赋值 + clientBuilder.AppId = "" ;//被调用方dapr的AppID + }); + }); + ``` + +2. 如何使用: + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + ``` + + > 完整请求的接口地址是:http://localhost:3500/v1.0/invoke//method/Hello?Name={name} + +3. 当存在多个DaprClient时,则修改`Program.cs`为 + + ``` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller"; + clientBuilder.AppId = "" ;//被调用方User服务Dapr的AppID + }); + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "OrderCaller"; + clientBuilder.AppId = "" ;//被调用方Order服务Dapr的AppID + }); + }); + ``` + +4. 如何使用UserCaller或OrderCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var callerProvider = callerFactory.CreateClient("OrderCaller"); + return callerProvider.GetAsync($"/Hello", new { Name = name }); + }); + ``` + +> 当多个Caller被添加时,如何获取指定的Caller? +>> 通过`CallerFactory`的`CreateClient`方法得到指定别名的CallerProvider +> +> 为什么`userCallerProvider`没有通过`CallerFactory`的`CreateClient`方法得到对应的Caller? +>> 如果未指定默认的ICallerProvider,则在`AddCaller`方法中第一个被添加的就是默认的CallerProvider + +### 推荐用法 + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(); + ``` + +2. 新增加类`UserCaller` + + ``` C# + public class UserCaller: DaprCallerBase + { + protected override string AppId { get; set; } = ""; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); + } + ``` + +3. 如何使用UserCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ``` \ No newline at end of file diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs new file mode 100644 index 000000000..2290a94b0 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Dapr.Client; +global using Masa.Utils.Caller.Core; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs new file mode 100644 index 000000000..68e578d4b --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.HttpClient; + +public static class CallerOptionsExtensions +{ + public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Func? clientBuilder = null) + { + var builder = clientBuilder == null ? new MasaHttpClientBuilder() : clientBuilder.Invoke(); + var httpClientBuilder = callerOptions.Services.AddHttpClient(builder.Name, httpClient + => builder.ConfigureHttpClient(httpClient)); + + AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, serviceProvider + => new HttpClientCallerProvider(serviceProvider, builder.Name, builder.Prefix)); + return httpClientBuilder; + } + + public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Action? clientBuilder) + { + MasaHttpClientBuilder builder = new MasaHttpClientBuilder(); + clientBuilder?.Invoke(builder); + + return callerOptions.UseHttpClient(() => builder); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs new file mode 100644 index 000000000..6666f9b9b --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.HttpClient; + +public abstract class HttpClientCallerBase : CallerBase +{ + protected abstract string BaseAddress { get; set; } + + protected virtual string Prefix { get; set; } = string.Empty; + + protected HttpClientCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public override void UseCallerExtension() => UseHttpClient(); + + protected virtual IHttpClientBuilder UseHttpClient() + { + return CallerOptions.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = Name; + httpClientBuilder.Prefix = Prefix; + httpClientBuilder.BaseAddress = BaseAddress; + httpClientBuilder.Configure = ConfigureHttpClient; + }); + } + + protected virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs new file mode 100644 index 000000000..bd353c3b4 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs @@ -0,0 +1,72 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.HttpClient; + +public class HttpClientCallerProvider : AbstractCallerProvider +{ + private readonly System.Net.Http.HttpClient _httpClient; + private readonly string _prefix; + private readonly bool _prefixIsNullOrEmpty; + + public HttpClientCallerProvider(IServiceProvider serviceProvider, string name, string prefix) + : base(serviceProvider) + { + _httpClient = serviceProvider.GetRequiredService().CreateClient(name); + _prefix = prefix; + _prefixIsNullOrEmpty = string.IsNullOrEmpty(_prefix); + } + + public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + where TResponse : default + { + var response = await _httpClient.SendAsync(request, cancellationToken); + return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + } + + public override Task CreateRequestAsync(HttpMethod method, string? methodName) + => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName))); + + public override Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) + => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName)), data); + + public override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + { + return _httpClient.SendAsync(request, cancellationToken); + } + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SendGrpcAsync(string methodName, TRequest request, + CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + protected virtual string GetRequestUri(string? methodName) + { + if (string.IsNullOrEmpty(methodName)) + return string.Empty; + + if (Uri.IsWellFormedUriString(methodName, UriKind.Absolute) || _prefixIsNullOrEmpty) + return methodName; + + if (_prefix.EndsWith("/")) + return $"{_prefix}{(methodName.StartsWith("/") ? methodName.Substring(1) : methodName)}"; + + return $"{_prefix}{(methodName.StartsWith("/") ? methodName : "/" + methodName)}"; + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj new file mode 100644 index 000000000..40c6c2d3e --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs new file mode 100644 index 000000000..8b7345dd0 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs @@ -0,0 +1,62 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.HttpClient; + +public class MasaHttpClientBuilder +{ + private string _name = default!; + + public string Name + { + get => _name; + set + { + if (value is null) + throw new ArgumentNullException(Name); + + _name = value; + } + } + + [Obsolete($"recommended to use {nameof(BaseAddress)}, {nameof(BaseApi)} has expired")] + public string BaseApi { get => BaseAddress; set => BaseAddress = value; } + + public string BaseAddress { get; set; } + + public string Prefix { get; set; } + + public bool IsDefault { get; set; } = false; + + public Action? Configure { get; set; } + + public MasaHttpClientBuilder() : this("http", null) + { + } + + public MasaHttpClientBuilder(string name, Action? configure) + : this(name, string.Empty, configure) + { + } + + public MasaHttpClientBuilder(string name, string baseAddress, Action? configure) + : this(name, baseAddress, string.Empty, configure) + { + } + + public MasaHttpClientBuilder(string name, string baseAddress, string prefix, Action? configure) + { + Name = name; + BaseAddress = baseAddress; + Prefix = prefix; + Configure = configure; + } + + public virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + if (!string.IsNullOrEmpty(BaseAddress)) + httpClient.BaseAddress = new Uri(BaseAddress); + + Configure?.Invoke(httpClient); + } +} diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.md b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.md new file mode 100644 index 000000000..7ad9fe3f6 --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.md @@ -0,0 +1,110 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Caller.HttpClient + +## Example: + +````c# +Install-Package Masa.Utils.Caller.HttpClient +```` + +### Basic usage: + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one HttpClient, you can not assign a value to Name + httpClientBuilder.BaseAddress = "http://localhost:5000" ; + }); + }); + ```` + +2. How to use: + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + ```` + + > The interface address of the complete request is: http://localhost:5000/Hello?Name={name} + +3. When there are multiple HttpClients, modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "UserCaller"; + httpClientBuilder.BaseAddress = "http://localhost:5000" ; + }); + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "OrderCaller"; + httpClientBuilder.BaseAddress = "http://localhost:6000" ; + }); + }); + ```` + +4. How to use UserCaller or OrderCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var callerProvider = callerFactory.CreateClient("OrderCaller"); + return callerProvider.GetAsync($"/Hello", new { Name = name }); + }); + ```` + +> When multiple Callers are added, how to get the specified Caller? +>> Get the CallerProvider of the specified alias through the `CreateClient` method of `CallerFactory` +> +> Why doesn't `userCallerProvider` get the corresponding Caller through the `CreateClient` method of `CallerFactory`? +>> If no default ICallerProvider is specified, the default CallerProvider is the first one added in the `AddCaller` method + +### Recommended usage + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(); + ```` + +2. Add a new class `UserCaller` + + ```` C# + public class UserCaller: HttpClientCallerBase + { + protected override string BaseAddress { get; set; } = "http://localhost:5000"; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); + + /// + /// There is no need to overload by default, and it can be overloaded when there are special requirements for httpClient + /// + /// + protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + httpClient.Timeout = TimeSpan.FromSeconds(5); + } + } + ```` + +3. How to use UserCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ```` \ No newline at end of file diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md new file mode 100644 index 000000000..5b3fac3ab --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md @@ -0,0 +1,110 @@ +中 | [EN](README.md) + +## Masa.Utils.Caller.HttpClient + +## 用例: + +```c# +Install-Package Masa.Utils.Caller.HttpClient +``` + +### 基本用法: + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个HttpClient时,可以不对Name赋值 + httpClientBuilder.BaseAddress = "http://localhost:5000" ; + }); + }); + ``` + +2. 如何使用: + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + ``` + + > 完整请求的接口地址是:http://localhost:5000/Hello?Name={name} + +3. 当存在多个HttpClient时,则修改`Program.cs`为 + + ``` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "UserCaller"; + httpClientBuilder.BaseAddress = "http://localhost:5000" ; + }); + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "OrderCaller"; + httpClientBuilder.BaseAddress = "http://localhost:6000" ; + }); + }); + ``` + +4. 如何使用UserCaller或OrderCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var callerProvider = callerFactory.CreateClient("OrderCaller"); + return callerProvider.GetAsync($"/Hello", new { Name = name }); + }); + ``` + +> 当多个Caller被添加时,如何获取指定的Caller? +>> 通过`CallerFactory`的`CreateClient`方法得到指定别名的CallerProvider +> +> 为什么`userCallerProvider`没有通过`CallerFactory`的`CreateClient`方法得到对应的Caller? +>> 如果未指定默认的ICallerProvider,则在`AddCaller`方法中第一个被添加的就是默认的CallerProvider + +### 推荐用法 + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(); + ``` + +2. 新增加类`UserCaller` + + ``` C# + public class UserCaller: HttpClientCallerBase + { + protected override string BaseAddress { get; set; } = "http://localhost:5000"; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); + + /// + /// 默认不需要重载,对httpClient有特殊需求时可重载 + /// + /// + protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + httpClient.Timeout = TimeSpan.FromSeconds(5); + } + } + ``` + +3. 如何使用UserCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ``` \ No newline at end of file diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs new file mode 100644 index 000000000..454fdb09c --- /dev/null +++ b/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caller.Core; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj b/src/Utils/src/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/src/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs b/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs new file mode 100644 index 000000000..03e89ed37 --- /dev/null +++ b/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs @@ -0,0 +1,102 @@ +using Microsoft.Extensions.Configuration; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Configuration.Json +{ + public class AppSettings + { + private static JsonConfiguration? _config; + + public static bool Initialized => _config != null; + + public static IConfiguration Configuration + { + get + { + InitializeIfNot(); + + return _config!.Configuration; + } + } + + private static void InitializeIfNot() + { + if (!Initialized) + { + var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + Initialize(environment); + } + } + + /// + /// Initialize configuration with appsettings.json + /// + public static void Initialize() + { + Initialize(string.Empty); + } + + /// + /// Initialize configuration with appsettings.json & appsettings.{environmentName}.json + /// + /// + public static void Initialize(string? environmentName) + { + if (Initialized) + { + return; + } + + var optionsList = new List + { + new JsonFileOptions + { + FileName = "appsettings.json", + Optional = false, + ReloadOnChange = true + } + }; + + if (!string.IsNullOrEmpty(environmentName)) + { + optionsList.Add(new JsonFileOptions + { + FileName = $"appsettings.{environmentName}.json", + Optional = true, + ReloadOnChange = true + }); + } + + _config = new JsonConfiguration(optionsList); + } + + /// + /// Get configuration section + /// + /// + /// + /// + public static string Get(string key, Action? onChange = null) + { + InitializeIfNot(); + + return _config!.Get(key, onChange); + } + + /// + /// Bind a model with configuration section + /// + /// + /// + /// + /// + public static TModel GetModel(string key, Action? onChange = null) + { + InitializeIfNot(); + + return _config!.GetModel(key, onChange); + } + } +} diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs b/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs new file mode 100644 index 000000000..125893fe1 --- /dev/null +++ b/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs @@ -0,0 +1,118 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Primitives; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Configuration.Json +{ + public class JsonConfiguration + { + public IConfiguration Configuration { get; } + + public JsonConfiguration(string fileName) + : this(Directory.GetCurrentDirectory(), fileName) + { + } + + public JsonConfiguration(string basePath, string fileName) + { + Configuration = new ConfigurationBuilder() + .SetBasePath(basePath) + .AddJsonFile(fileName, optional: false, reloadOnChange: true) + .Build(); + } + + public JsonConfiguration(JsonFileOptions options) + : this(Directory.GetCurrentDirectory(), options) + { + } + + public JsonConfiguration(string basePath, JsonFileOptions options) + { + Configuration = new ConfigurationBuilder() + .SetBasePath(basePath) + .AddJsonFile(options.FileName, options.Optional, options.ReloadOnChange) + .Build(); + } + + public JsonConfiguration(List optionsList) + : this(Directory.GetCurrentDirectory(), optionsList) + { + } + + public JsonConfiguration(string basePath, List optionsList) + { + var builder = new ConfigurationBuilder() + .SetBasePath(basePath); + + foreach (var options in optionsList) + { + builder.AddJsonFile(options.FileName, options.Optional, options.ReloadOnChange); + } + + Configuration = builder.Build(); + } + + /// + /// Get configuration section + /// + public string Get(string key, Action? onChange = null) + { + if (string.IsNullOrEmpty(key)) + { + throw new ArgumentNullException(nameof(key)); + } + + var model = Get(key); + + if (onChange != null) + { + ChangeToken.OnChange(() => Configuration.GetReloadToken(), () => + { + onChange(Get(key)); + }); + } + + return model; + } + + /// + /// Bind a model with configuration section + /// + public TModel GetModel(string key, Action? onChange = null) + { + if (string.IsNullOrEmpty(key)) + { + throw new ArgumentNullException(nameof(key)); + } + + var model = Get(key); + + if (onChange != null) + { + ChangeToken.OnChange(() => Configuration.GetReloadToken(), () => + { + onChange(Get(key)); + }); + } + + return model; + } + + private string Get(string key) + { + var options = Configuration.GetSection(key).Value; + return options; + } + + /// + /// Bind a model with configuration section + /// + private TModel Get(string key) + { + var options = Configuration.GetSection(key).Get(); + return options; + } + } +} diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs b/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs new file mode 100644 index 000000000..72e54a3c1 --- /dev/null +++ b/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Configuration.Json +{ + public class JsonFileOptions + { + /// + /// Path relative to the base path stored in Microsoft.Extensions.Configuration.IConfigurationBuilder.Properties of builder. + /// + public string FileName { get; set; } = null!; + + /// + /// Whether the file is optional. + /// + public bool Optional { get; set; } + + /// + /// Whether the configuration should be reloaded if the file changes. + /// + public bool ReloadOnChange { get; set; } + } +} diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj b/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj new file mode 100644 index 000000000..0662243e5 --- /dev/null +++ b/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs b/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs new file mode 100644 index 000000000..870a18104 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs @@ -0,0 +1,57 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System.ComponentModel.DataAnnotations; + +public class MinCountAttribute : ValidationAttribute +{ + private const string DEFAULT_ERROR_MESSAGE = "The field {0} must be a list type with a minimum count of '{1}'."; + + public MinCountAttribute(int count) : base(DEFAULT_ERROR_MESSAGE) + { + Count = count; + } + + public int Count { get; } + + public override bool IsValid(object? value) + { + // Check the lengths for legality + EnsureLegalLengths(); + + int count; + + if (value == null) + { + return true; + } + + if (value is IList list) + { + count = list.Count; + } + else + { + throw new InvalidCastException($"The field of type {value.GetType()} must be a list type."); + } + + return count >= Count; + } + + public override string FormatErrorMessage(string name) + { + return string.Format(ErrorMessageString, name, Count); + } + + /// + /// Checks that Length has a legal value. + /// + /// Length is less than zero. + private void EnsureLegalLengths() + { + if (Count < 0) + { + throw new InvalidOperationException($"{nameof(MinCountAttribute)} must have a Count value that is zero or greater."); + } + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs b/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs new file mode 100644 index 000000000..9043bce26 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System.ComponentModel.DataAnnotations +{ + public class NonDefaultAttribute : ValidationAttribute + { + private const string DEFAULT_ERROR_MESSAGE = "The field {0} must be a non-default value."; + + private static ConcurrentDictionary defaultInstancesCache = new(); + + public NonDefaultAttribute() : base(DEFAULT_ERROR_MESSAGE) + { + } + + public override bool IsValid(object? value) + { + if (value is null) + return true; + + var type = value.GetType(); + + if (!defaultInstancesCache.TryGetValue(type.FullName!, out var defaultInstance)) + { + defaultInstance = Activator.CreateInstance(Nullable.GetUnderlyingType(type) ?? type); + defaultInstancesCache[type.FullName!] = defaultInstance!; + } + + return !Equals(value, defaultInstance); + } + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj b/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs b/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs new file mode 100644 index 000000000..24bbb34f0 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.Collections; +global using System.Collections.Concurrent; diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs new file mode 100644 index 000000000..26705a01b --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs @@ -0,0 +1,106 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Analysis.TokenFilters; + +public interface IPinYinTokenFilter : ITokenFilter +{ + /// + /// when this option enabled, eg: 刘德华>ldh + /// + [DataMember(Name = "keep_first_letter")] + bool KeepFirstLetter { get; set; } + + /// + /// when this option enabled, will keep first letters separately + /// eg: 刘德华>l,d,h, default: false + /// NOTE: query result maybe too fuzziness due to term too frequency + /// + [DataMember(Name = "keep_separate_first_letter")] + bool KeepSeparateFirstLetter { get; set; } + + /// + /// set max length of the first_letter result + /// + [DataMember(Name = "limit_first_letter_length")] + int LimitFirstLetterLength { get; set; } + + /// + /// when this option enabled, eg: 刘德华> [liu,de,hua] + /// + [DataMember(Name = "keep_full_pinyin")] + bool KeepFullPinyin { get; set; } + + /// + /// when this option enabled, eg: 刘德华> [liudehua] + /// + [DataMember(Name = "keep_joined_full_pinyin")] + bool KeepJoinedFullPinyin { get; set; } + + /// + /// keep non chinese letter or number in result + /// + [DataMember(Name = "keep_none_chinese")] + bool KeepNoneChinese { get; set; } + + /// + /// keep non chinese letter together + /// eg: DJ音乐家 -> DJ,yin,yue,jia + /// when set to false, eg: DJ音乐家 -> D,J,yin,yue,jia + /// NOTE: keep_none_chinese should be enabled first + /// + [DataMember(Name = "keep_none_chinese_together")] + bool KeepNoneChineseTogether { get; set; } + + /// + /// keep non Chinese letters in first letter, eg: 刘德华AT2016->ldhat2016 + /// + [DataMember(Name = "keep_none_chinese_in_first_letter")] + bool KeepNoneChineseInFirstLetter { get; set; } + + /// + /// keep non Chinese letters in joined full pinyin, eg: 刘德华2016->liudehua2016 + /// + [DataMember(Name = "keep_none_chinese_in_joined_full_pinyin")] + bool KeepNoneChineseInJoinedFullPinyin { get; set; } + + /// + /// break non chinese letters into separate pinyin term if they are pinyin + /// eg: liudehuaalibaba13zhuanghan -> liu,de,hua,a,li,ba,ba,13,zhuang,han + /// NOTE: keep_none_chinese and keep_none_chinese_together should be enabled first + /// + [DataMember(Name = "none_chinese_pinyin_tokenize")] + bool NoneChinesePinyinTokenize { get; set; } + + /// + /// when this option enabled, will keep original input as well + /// + [DataMember(Name = "keep_original")] + bool KeepOriginal { get; set; } + + /// + /// lowercase non Chinese letters + /// + [DataMember(Name = "lowercase")] + bool Lowercase { get; set; } + + [DataMember(Name = "trim_whitespace")] + bool TrimWhitespace { get; set; } + + /// + /// when this option enabled, duplicated term will be removed to save index, eg: de的>de + /// NOTE: position related query maybe influenced + /// + [DataMember(Name = "remove_duplicated_term")] + bool RemoveDuplicatedTerm { get; set; } + + /// + /// after 6.0, offset is strictly constrained, overlapped tokens are not allowed + /// with this parameter, overlapped token will allowed by ignore offset + /// please note, all position related query or highlight will become incorrect + /// you should use multi fields and specify different settings for different query purpose + /// if you need offset, please set it to false + /// + [DataMember(Name = "ignore_pinyin_offset")] + bool IgnorePinyinOffset { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs new file mode 100644 index 000000000..67d87fc23 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs @@ -0,0 +1,125 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Analysis.TokenFilters; + +public class PinYinTokenFilterDescriptor + : TokenFilterDescriptorBase, IPinYinTokenFilter +{ + protected override string Type => "pinyin"; + + /// + /// when this option enabled, eg: 刘德华>ldh + /// + [DataMember(Name = "keep_first_letter")] + public bool KeepFirstLetter { get; set; } + + /// + /// when this option enabled, will keep first letters separately + /// eg: 刘德华>l,d,h, default: false + /// NOTE: query result maybe too fuzziness due to term too frequency + /// + [DataMember(Name = "keep_separate_first_letter")] + public bool KeepSeparateFirstLetter { get; set; } + + /// + /// set max length of the first_letter result + /// + [DataMember(Name = "limit_first_letter_length")] + public int LimitFirstLetterLength { get; set; } + + /// + /// when this option enabled, eg: 刘德华> [liu,de,hua] + /// + [DataMember(Name = "keep_full_pinyin")] + public bool KeepFullPinyin { get; set; } + + /// + /// when this option enabled, eg: 刘德华> [liudehua] + /// + [DataMember(Name = "keep_joined_full_pinyin")] + public bool KeepJoinedFullPinyin { get; set; } + + /// + /// keep non chinese letter or number in result + /// + [DataMember(Name = "keep_none_chinese")] + public bool KeepNoneChinese { get; set; } + + /// + /// keep non chinese letter together + /// eg: DJ音乐家 -> DJ,yin,yue,jia + /// when set to false, eg: DJ音乐家 -> D,J,yin,yue,jia + /// NOTE: keep_none_chinese should be enabled first + /// + [DataMember(Name = "keep_none_chinese_together")] + public bool KeepNoneChineseTogether { get; set; } + + /// + /// keep non Chinese letters in first letter, eg: 刘德华AT2016->ldhat2016 + /// + [DataMember(Name = "keep_none_chinese_in_first_letter")] + public bool KeepNoneChineseInFirstLetter { get; set; } + + /// + /// keep non Chinese letters in joined full pinyin, eg: 刘德华2016->liudehua2016 + /// + [DataMember(Name = "keep_none_chinese_in_joined_full_pinyin")] + public bool KeepNoneChineseInJoinedFullPinyin { get; set; } + + /// + /// break non chinese letters into separate pinyin term if they are pinyin + /// eg: liudehuaalibaba13zhuanghan -> liu,de,hua,a,li,ba,ba,13,zhuang,han + /// NOTE: keep_none_chinese and keep_none_chinese_together should be enabled first + /// + [DataMember(Name = "none_chinese_pinyin_tokenize")] + public bool NoneChinesePinyinTokenize { get; set; } + + /// + /// when this option enabled, will keep original input as well + /// + [DataMember(Name = "keep_original")] + public bool KeepOriginal { get; set; } + + /// + /// lowercase non Chinese letters + /// + [DataMember(Name = "lowercase")] + public bool Lowercase { get; set; } + + [DataMember(Name = "trim_whitespace")] + public bool TrimWhitespace { get; set; } + + /// + /// when this option enabled, duplicated term will be removed to save index, eg: de的>de + /// NOTE: position related query maybe influenced + /// + [DataMember(Name = "remove_duplicated_term")] + public bool RemoveDuplicatedTerm { get; set; } + + /// + /// after 6.0, offset is strictly constrained, overlapped tokens are not allowed + /// with this parameter, overlapped token will allowed by ignore offset + /// please note, all position related query or highlight will become incorrect + /// you should use multi fields and specify different settings for different query purpose + /// if you need offset, please set it to false + /// + [DataMember(Name = "ignore_pinyin_offset")] + public bool IgnorePinyinOffset { get; set; } + + public PinYinTokenFilterDescriptor() + { + KeepFirstLetter = true; + KeepFullPinyin = true; + KeepNoneChinese = true; + KeepNoneChineseInFirstLetter = true; + KeepNoneChineseTogether = true; + KeepJoinedFullPinyin = true; + NoneChinesePinyinTokenize = true; + KeepOriginal = true; + LimitFirstLetterLength = 50; + Lowercase = true; + RemoveDuplicatedTerm = true; + KeepNoneChineseInJoinedFullPinyin = true; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Const.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Const.cs new file mode 100644 index 000000000..ee01403a9 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Const.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class Const +{ + public const string DEFAULT_CLIENT_NAME = "es"; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs new file mode 100644 index 000000000..2423a175c --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs @@ -0,0 +1,84 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class DefaultElasticsearchFactory : IElasticsearchFactory +{ + private readonly Dictionary _relations; + private readonly ConcurrentDictionary _elasticClients; + + public DefaultElasticsearchFactory(ElasticsearchRelationsOptions options) + { + _relations = options.Relations; + _elasticClients = new(); + } + + public IMasaElasticClient CreateClient() + { + return new DefaultMasaElasticClient(CreateElasticClient()); + } + + public IMasaElasticClient CreateClient(string name) + { + return new DefaultMasaElasticClient(CreateElasticClient(name)); + } + + public IElasticClient CreateElasticClient() + { + var elasticsearchRelation = _relations.Values.SingleOrDefault(r => r.IsDefault) ?? _relations.Values.FirstOrDefault(); + + if (elasticsearchRelation == null) + throw new Exception("The default ElasticClient is not found, please check if Elasticsearch is added"); + + return GetOrAddElasticClient(elasticsearchRelation.Name); + } + + public IElasticClient CreateElasticClient(string name) + { + if (!_relations.ContainsKey(name)) + throw new NotSupportedException($"The ElasticClient whose name is {name} is not found"); + + return GetOrAddElasticClient(name); + } + + private IElasticClient GetOrAddElasticClient(string name) + => _elasticClients.GetOrAdd(name, name => Create(name)); + + private IElasticClient Create(string name) + { + var relation = _relations[name]; + + var settings = relation.UseConnectionPool + ? GetConnectionSettingsConnectionPool(relation) + : GetConnectionSettingsBySingleNode(relation); + + return new ElasticClient(settings); + } + + private ConnectionSettings GetConnectionSettingsBySingleNode(ElasticsearchRelations relation) + { + var connectionSetting = new ConnectionSettings(relation.Nodes[0]) + .EnableApiVersioningHeader(); + relation.Action?.Invoke(connectionSetting); + return connectionSetting; + } + + private ConnectionSettings GetConnectionSettingsConnectionPool(ElasticsearchRelations relation) + { + var pool = new StaticConnectionPool( + relation.Nodes, + relation.StaticConnectionPoolOptions?.Randomize ?? true, + relation.StaticConnectionPoolOptions?.DateTimeProvider); + + var settings = new ConnectionSettings( + pool, + relation.ConnectionSettingsOptions?.Connection, + relation.ConnectionSettingsOptions?.SourceSerializerFactory, + relation.ConnectionSettingsOptions?.PropertyMappingProvider) + .EnableApiVersioningHeader(); + + relation.Action?.Invoke(settings); + return settings; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs new file mode 100644 index 000000000..39cb3e471 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs @@ -0,0 +1,391 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class DefaultMasaElasticClient : IMasaElasticClient +{ + private readonly IElasticClient _elasticClient; + + public DefaultMasaElasticClient(IElasticClient elasticClient) + => _elasticClient = elasticClient; + + #region index manage + + public async Task IndexExistAsync( + string indexName, + CancellationToken cancellationToken = default) + { + IIndexExistsRequest request = new IndexExistsRequest(indexName); + return new Response.ExistsResponse(await _elasticClient.Indices.ExistsAsync(request, cancellationToken)); + } + + public async Task CreateIndexAsync( + string indexName, + CreateIndexOptions? options = null, + CancellationToken cancellationToken = default) + { + ICreateIndexRequest request = new CreateIndexRequest(indexName); + if (options != null) + { + request.Settings = options.IndexSettings; + request.Aliases = options.Aliases; + request.Mappings = options.Mappings; + } + + return new Response.Index.CreateIndexResponse(await _elasticClient.Indices.CreateAsync(request, cancellationToken)); + } + + public async Task DeleteIndexAsync( + string indexName, + CancellationToken cancellationToken = default) + { + IDeleteIndexRequest request = new DeleteIndexRequest(indexName); + return new Response.Index.DeleteIndexResponse(await _elasticClient.Indices.DeleteAsync(request, cancellationToken)); + } + + public async Task DeleteMultiIndexAsync( + IEnumerable indexNames, + CancellationToken cancellationToken = default) + { + BulkAliasDescriptor request = new BulkAliasDescriptor(); + foreach (var indexName in indexNames) + request.RemoveIndex(opt => opt.Index(indexName)); + + return new Response.Index.DeleteIndexResponse(await _elasticClient.Indices.BulkAliasAsync(request, cancellationToken)); + } + + public async Task DeleteIndexByAliasAsync( + string alias, + CancellationToken cancellationToken = default) + { + var response = await GetIndexByAliasAsync(alias, cancellationToken); + if (response.IsValid) + return await DeleteMultiIndexAsync(response.IndexNames, cancellationToken); + + return new(response.Message); + } + + public async Task GetAllIndexAsync(CancellationToken cancellationToken = default) + { + ICatIndicesRequest request = new CatIndicesRequest(); + var response = await _elasticClient.Cat.IndicesAsync(request, cancellationToken); + return new Response.Index.GetIndexResponse(response); + } + + public async Task GetIndexByAliasAsync(string alias, CancellationToken cancellationToken = default) + { + ICatIndicesRequest request = new CatIndicesRequest(alias); + var response = await _elasticClient.Cat.IndicesAsync(request, cancellationToken); + return new Response.Index.GetIndexByAliasResponse(response); + } + + #endregion + + #region alias manage + + public async Task GetAllAliasAsync(CancellationToken cancellationToken = default) + { + Func? selector = null; + var response = await _elasticClient.Cat.AliasesAsync(selector, cancellationToken); + return new MASAGetAliasResponse(response); + } + + public async Task GetAliasByIndexAsync( + string indexName, + CancellationToken cancellationToken = default) + { + IGetAliasRequest request = new GetAliasRequest((Indices)indexName); + var response = await _elasticClient.Indices.GetAliasAsync(request, cancellationToken); + return new MASAGetAliasResponse(response); + } + + public async Task BindAliasAsync( + BindAliasIndexOptions options, + CancellationToken cancellationToken = default) + { + BulkAliasDescriptor request = new BulkAliasDescriptor(); + foreach (var indexName in options.IndexNames) + request.Add(opt => opt.Aliases(options.Alias).Index(indexName)); + + var response = await _elasticClient.Indices.BulkAliasAsync(request, cancellationToken); + return new MASABulkAliasResponse(response); + } + + public async Task UnBindAliasAsync( + UnBindAliasIndexOptions options, + CancellationToken cancellationToken = default) + { + BulkAliasDescriptor request = new BulkAliasDescriptor(); + foreach (var indexName in options.IndexNames) + request.Remove(opt => opt.Aliases(options.Alias).Index(indexName)); + + var response = await _elasticClient.Indices.BulkAliasAsync(request, cancellationToken); + return new MASABulkAliasResponse(response); + } + + #endregion + + #region document manage + + public async Task DocumentExistsAsync( + ExistDocumentRequest request, + CancellationToken cancellationToken = default) + { + var documentExistsRequest = new DocumentExistsRequest(request.IndexName, request.DocumentId); + return new Response.ExistsResponse(await _elasticClient.DocumentExistsAsync(documentExistsRequest, cancellationToken)); + } + + public async Task DocumentCountAsync(CountDocumentRequest request, CancellationToken cancellationToken = default) + { + var countRequest = new CountRequest(request.IndexName) + { + ExpandWildcards = ExpandWildcards.All + }; + return new CountDocumentResponse(await _elasticClient.CountAsync(countRequest, cancellationToken)); + } + + /// + /// Add a new document + /// only when the document does not exist + /// + /// + /// + /// + /// + public async Task CreateDocumentAsync( + CreateDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + ICreateRequest createRequest = new CreateRequest(request.IndexName, new Id(request.Request.DocumentId)); + createRequest.Document = request.Request.Document; + return new Response.CreateResponse(await _elasticClient.CreateAsync(createRequest, cancellationToken)); + } + + /// + /// Add new documents in batches + /// only when the documents do not exist + /// + /// + /// + /// + /// + public async Task CreateMultiDocumentAsync( + CreateMultiDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + BulkDescriptor descriptor = new BulkDescriptor(request.IndexName); + foreach (var item in request.Items) + { + descriptor + .Create(opt => opt.Document(item.Document) + .Index(request.IndexName) + .Id(item.DocumentId)); + } + + var response = await _elasticClient.BulkAsync(descriptor, cancellationToken); + return new CreateMultiResponse(response); + } + + /// + /// Update or insert document + /// Overwrite if it exists, add new if it does not exist + /// + /// + /// + /// + /// + public async Task SetDocumentAsync( + SetDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + BulkDescriptor descriptor = new BulkDescriptor(request.IndexName); + foreach (var item in request.Items) + { + descriptor + .Index(opt => opt.Document(item.Document) + .Index(request.IndexName) + .Id(item.DocumentId)); + } + + var response = await _elasticClient.BulkAsync(descriptor, cancellationToken); + return new SetResponse(response); + } + + public async Task DeleteDocumentAsync( + DeleteDocumentRequest request, + CancellationToken cancellationToken = default) + { + IDeleteRequest deleteRequest = new DeleteRequest(request.IndexName, new Id(request.DocumentId)); + return new Response.DeleteResponse(await _elasticClient.DeleteAsync(deleteRequest, cancellationToken)); + } + + public async Task DeleteMultiDocumentAsync( + DeleteMultiDocumentRequest request, + CancellationToken cancellationToken = default) + { + var response = await Internal.DeleteMultiExtensions.DeleteManyAsync(_elasticClient, request.DocumentIds, request.IndexName, cancellationToken); + return new DeleteMultiResponse(response); + } + + public async Task ClearDocumentAsync(string indexNameOrAlias, CancellationToken cancellationToken = default) + { + var deleteByQueryRequest = new DeleteByQueryRequest(indexNameOrAlias) + { + Query = new QueryContainer(new MatchAllQuery()) + }; + return new(await _elasticClient.DeleteByQueryAsync(deleteByQueryRequest, cancellationToken)); + } + + /// + /// Update the document + /// only if the document exists + /// + /// + /// + /// + /// + /// + public async Task UpdateDocumentAsync( + UpdateDocumentRequest request, + CancellationToken cancellationToken = default) + where TDocument : class + { + if (request.Request.Document != null) + { + var response = await _elasticClient.UpdateAsync( + request.Request.DocumentId, + opt => opt.Doc(request.Request.Document).Index(request.IndexName), + cancellationToken); + return new UpdateResponse(response); + } + + IUpdateRequest updateRequest = + new UpdateRequest(request.IndexName, request.Request.DocumentId) + { + Doc = request.Request.PartialDocument! + }; + return new UpdateResponse(await _elasticClient.UpdateAsync(updateRequest, cancellationToken)); + } + + /// + /// Update documents in batches + /// only when the documents exist + /// + /// + /// + /// + /// + public async Task UpdateMultiDocumentAsync( + UpdateMultiDocumentRequest request, + CancellationToken cancellationToken = default) + where TDocument : class + { + BulkDescriptor descriptor = new BulkDescriptor(request.IndexName); + foreach (var item in request.Items) + { + if (item.Document != null) + { + descriptor + .Update(opt => opt.Doc(item.Document) + .Index(request.IndexName) + .Id(item.DocumentId)); + } + else + { + descriptor + .Update(opt => opt.Doc(item.PartialDocument!) + .Index(request.IndexName) + .Id(item.DocumentId)); + } + } + + var response = await _elasticClient.BulkAsync(descriptor, cancellationToken); + return new UpdateMultiResponse(response); + } + + public async Task> GetAsync( + GetDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + IGetRequest getRequest = new GetRequest(request.IndexName, request.Id); + return new Response.GetResponse(await _elasticClient.GetAsync(getRequest, cancellationToken)); + } + + public async Task> GetMultiAsync( + GetMultiDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + var response = (await + _elasticClient.GetManyAsync(request.Ids, request.IndexName, cancellationToken) + )?.ToList() ?? new List>(); + + if (response.Count == request.Ids.Count()) + return new GetMultiResponse(true, "success", response); + + return new GetMultiResponse(false, "Failed to get document"); + } + + public async Task> GetListAsync( + QueryOptions options, + CancellationToken cancellationToken = default) where TDocument : class + { + var response = await QueryString( + options.IndexName, + options.Skip, + options.Take, + options, + cancellationToken); + return new Response.SearchResponse(response); + } + + public async Task> GetPaginatedListAsync( + PaginatedOptions options, + CancellationToken cancellationToken = default) where TDocument : class + { + var response = await QueryString( + options.IndexName, + (options.Page - 1) * options.PageSize, + options.PageSize, + options, + cancellationToken); + return new SearchPaginatedResponse(options.PageSize, response); + } + + private Task> QueryString( + string? indexName, + int skip, + int take, + QueryBaseOptions queryBaseOptions, + CancellationToken cancellationToken = default) + where TDocument : class + { + return _elasticClient.SearchAsync(s => s + .Index(indexName) + .From(skip) + .Size(take) + .Query(q => q + .QueryString(qs => GetQueryDescriptor(qs, queryBaseOptions)) + ), cancellationToken); + } + + private static QueryStringQueryDescriptor GetQueryDescriptor( + QueryStringQueryDescriptor queryDescriptor, + QueryBaseOptions queryBaseOptions) + where TDocument : class + { + queryDescriptor = queryDescriptor.Query(queryBaseOptions.Query); + queryDescriptor = queryDescriptor.DefaultOperator(queryBaseOptions.Operator); + if (!string.IsNullOrEmpty(queryBaseOptions.DefaultField)) + queryDescriptor.DefaultField(queryBaseOptions.DefaultField); + + if (queryBaseOptions.Fields.Any()) + queryDescriptor.Fields(queryBaseOptions.Fields.ToArray()); + + queryBaseOptions.Action?.Invoke(queryDescriptor); + + return queryDescriptor; + } + + #endregion +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs new file mode 100644 index 000000000..b51e57a0a --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class ElasticsearchOptions +{ + public bool IsDefault { get; set; } + + public bool UseConnectionPool { get; private set; } + + internal string[] Nodes { get; private set; } + + internal StaticConnectionPoolOptions StaticConnectionPoolOptions { get; } + + internal ConnectionSettingsOptions ConnectionSettingsOptions { get; } + + internal Action? Action { get; private set; } + + public ElasticsearchOptions(params string[] nodes) + { + if (nodes.Length == 0) + throw new ArgumentException("Please specify the Elasticsearch node address"); + + IsDefault = false; + Nodes = nodes; + UseConnectionPool = nodes.Length > 1; + ConnectionSettingsOptions = new(); + StaticConnectionPoolOptions = new(); + Action = null; + } + + public ElasticsearchOptions UseDefault() + { + IsDefault = true; + return this; + } + + public ElasticsearchOptions UseNodes(params string[] nodes) + { + if (nodes == null || nodes.Length == 0) + throw new ArgumentException("Please enter the Elasticsearch node address"); + + Nodes = nodes; + UseConnectionPool = nodes.Length > 1; + return this; + } + + public ElasticsearchOptions UseRandomize(bool randomize) + { + StaticConnectionPoolOptions.UseRandomize(randomize); + return this; + } + + public ElasticsearchOptions UseDateTimeProvider(IDateTimeProvider dateTimeProvider) + { + StaticConnectionPoolOptions.UseDateTimeProvider(dateTimeProvider); + return this; + } + + public ElasticsearchOptions UseConnectionSettings(Action action) + { + Action = action; + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs new file mode 100644 index 000000000..8927fa4a1 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class ElasticsearchRelations +{ + public bool IsDefault { get; private set; } + + public string Name { get; } + + public Uri[] Nodes { get; } + + public bool UseConnectionPool { get; } + + internal StaticConnectionPoolOptions? StaticConnectionPoolOptions { get; private set; } + + internal ConnectionSettingsOptions? ConnectionSettingsOptions { get; private set; } + + internal Action? Action { get; private set; } + + public ElasticsearchRelations(string name, bool useConnectionPool, Uri[] nodes) + { + Name = name; + IsDefault = false; + UseConnectionPool = useConnectionPool; + Nodes = nodes; + Action = null; + StaticConnectionPoolOptions = null; + ConnectionSettingsOptions = null; + } + + public ElasticsearchRelations UseDefault() + { + IsDefault = true; + return this; + } + + public ElasticsearchRelations UseStaticConnectionPoolOptions(StaticConnectionPoolOptions staticConnectionPoolOptions) + { + StaticConnectionPoolOptions = staticConnectionPoolOptions; + return this; + } + + public ElasticsearchRelations UseConnectionSettingsOptions(ConnectionSettingsOptions connectionSettingsOptions) + { + ConnectionSettingsOptions = connectionSettingsOptions; + return this; + } + + public ElasticsearchRelations UseConnectionSettings(Action? action) + { + Action = action; + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs new file mode 100644 index 000000000..0ad3b3cdb --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public interface IElasticsearchFactory +{ + IMasaElasticClient CreateClient(); + + IMasaElasticClient CreateClient(string name); + + IElasticClient CreateElasticClient(); + + IElasticClient CreateElasticClient(string name); +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs new file mode 100644 index 000000000..a418e5fcb --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs @@ -0,0 +1,153 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public interface IMasaElasticClient +{ + #region index manage + + Task IndexExistAsync( + string indexName, + CancellationToken cancellationToken = default); + + Task CreateIndexAsync( + string indexName, + CreateIndexOptions? options = null, + CancellationToken cancellationToken = default); + + Task DeleteIndexAsync(string indexName, + CancellationToken cancellationToken = default); + + Task DeleteMultiIndexAsync( + IEnumerable indexNames, + CancellationToken cancellationToken = default); + + Task DeleteIndexByAliasAsync( + string alias, + CancellationToken cancellationToken = default); + + Task GetAllIndexAsync(CancellationToken cancellationToken = default); + + Task GetIndexByAliasAsync( + string alias, + CancellationToken cancellationToken = default); + + #endregion + + #region alias manage + + Task GetAllAliasAsync(CancellationToken cancellationToken = default); + + Task GetAliasByIndexAsync( + string indexName, + CancellationToken cancellationToken = default); + + Task BindAliasAsync( + BindAliasIndexOptions options, + CancellationToken cancellationToken = default); + + Task UnBindAliasAsync( + UnBindAliasIndexOptions options, + CancellationToken cancellationToken = default); + + #endregion + + #region document manage + + Task DocumentExistsAsync( + ExistDocumentRequest request, + CancellationToken cancellationToken = default); + + Task DocumentCountAsync(CountDocumentRequest request, CancellationToken cancellationToken = default); + + /// + /// Add a new document + /// only when the document does not exist + /// + /// + /// + /// + /// + Task CreateDocumentAsync( + CreateDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + /// + /// Add new documents in batches + /// only when the documents do not exist + /// + /// + /// + /// + /// + Task CreateMultiDocumentAsync( + CreateMultiDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + /// + /// Update or insert document + /// Overwrite if it exists, add new if it does not exist + /// + /// + /// + /// + /// + Task SetDocumentAsync( + SetDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + Task DeleteDocumentAsync( + DeleteDocumentRequest request, + CancellationToken cancellationToken = default); + + Task DeleteMultiDocumentAsync( + DeleteMultiDocumentRequest request, + CancellationToken cancellationToken = default); + + Task ClearDocumentAsync(string indexNameOrAlias, CancellationToken cancellationToken = default); + + /// + /// Update the document + /// only if the document exists + /// + /// + /// + /// + /// + Task UpdateDocumentAsync( + UpdateDocumentRequest request, + CancellationToken cancellationToken = default) + where TDocument : class; + + /// + /// Update documents in batches + /// only when the documents exist + /// + /// + /// + /// + /// + Task UpdateMultiDocumentAsync( + UpdateMultiDocumentRequest request, + CancellationToken cancellationToken = default) + where TDocument : class; + + Task> GetAsync( + GetDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + Task> GetMultiAsync( + GetMultiDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + Task> GetListAsync( + QueryOptions options, + CancellationToken cancellationToken = default) where TDocument : class; + + Task> GetPaginatedListAsync( + PaginatedOptions options, + CancellationToken cancellationToken = default) where TDocument : class; + + #endregion +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs new file mode 100644 index 000000000..3c49a012d --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Internal.BulkOperation; + +public class BulkDeleteOperation : BulkOperationBase +{ + public BulkDeleteOperation(Id id) => Id = id; + + protected override object GetBody() => null!; + + protected override Type ClrType { get; } = default!; + + protected override string Operation => "delete"; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs new file mode 100644 index 000000000..899427d51 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Internal; + +internal static class DeleteMultiExtensions +{ + public static Task DeleteManyAsync( + this IElasticClient client, + IEnumerable documentIds, + IndexName index, + CancellationToken cancellationToken = default ) + { + var bulkRequest = CreateDeleteBulkRequest(documentIds, index); + return client.BulkAsync(bulkRequest, cancellationToken); + } + + private static BulkRequest CreateDeleteBulkRequest(IEnumerable documentIds, IndexName index) + { + ArgumentNullException.ThrowIfNull(documentIds, nameof(documentIds)); + var bulkRequest = new BulkRequest(index); + var deletes = documentIds + .Select(id => new BulkDeleteOperation(new Id(id))) + .Cast() + .ToList(); + + bulkRequest.Operations = new BulkOperationsCollection(deletes); + return bulkRequest; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj new file mode 100644 index 000000000..1ad8a42e0 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs new file mode 100644 index 000000000..63fc923bb --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class MasaElasticsearchBuilder +{ + public IServiceCollection Services { get; } + + public IElasticClient ElasticClient { get; } + + public IMasaElasticClient Client { get; } + + public MasaElasticsearchBuilder(IServiceCollection services, IElasticClient elasticClient) + { + Services = services; + ElasticClient = elasticClient; + Client = new DefaultMasaElasticClient(elasticClient); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs new file mode 100644 index 000000000..a9385d3aa --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Alias; + +public class BindAliasIndexOptions +{ + public IEnumerable IndexNames { get; } = default!; + + public string Alias { get; } + + private BindAliasIndexOptions(string alias) => Alias = alias; + + public BindAliasIndexOptions(string alias, string indexName) : this(alias) + { + if (string.IsNullOrEmpty(indexName)) + throw new ArgumentException("indexName cannot be empty", nameof(indexName)); + + IndexNames = new[] { indexName }; + } + + public BindAliasIndexOptions(string alias, IEnumerable indexNames) : this(alias) + { + ArgumentNullException.ThrowIfNull(nameof(indexNames)); + IndexNames = indexNames; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs new file mode 100644 index 000000000..ea787ffd4 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Alias; + +public class UnBindAliasIndexOptions +{ + public IEnumerable IndexNames { get; } = default!; + + public string Alias { get; } + + private UnBindAliasIndexOptions(string alias) => Alias = alias; + + public UnBindAliasIndexOptions(string alias, string indexName) : this(alias) + { + if (string.IsNullOrEmpty(indexName)) + throw new ArgumentException("indexName cannot be empty", nameof(indexName)); + + IndexNames = new[] { indexName }; + } + + public UnBindAliasIndexOptions(string alias, IEnumerable indexNames) : this(alias) + { + ArgumentNullException.ThrowIfNull(nameof(indexNames)); + IndexNames = indexNames; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs new file mode 100644 index 000000000..bf5909f09 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options; + +public class ConnectionSettingsOptions +{ + internal IConnection? Connection { get; set; } + + internal ConnectionSettings.SourceSerializerFactory? SourceSerializerFactory { get; set; } + + internal IPropertyMappingProvider? PropertyMappingProvider { get; set; } + + public ConnectionSettingsOptions() + { + Connection = null; + SourceSerializerFactory = null; + PropertyMappingProvider = null; + } + + public ConnectionSettingsOptions UseConnection(IConnection? connection) + { + Connection = connection; + return this; + } + + public ConnectionSettingsOptions UseSourceSerializerFactory(ConnectionSettings.SourceSerializerFactory? sourceSerializerFactory) + { + SourceSerializerFactory = sourceSerializerFactory; + return this; + } + + public ConnectionSettingsOptions UsePropertyMappingProvider(IPropertyMappingProvider? propertyMappingProvider) + { + PropertyMappingProvider = propertyMappingProvider; + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs new file mode 100644 index 000000000..200f1fcfa --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Count; + +public class CountDocumentRequest : DocumentOptions +{ + public CountDocumentRequest(string indexNameOrAlias) : base(indexNameOrAlias) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs new file mode 100644 index 000000000..fe9ec9b91 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Create; + +public class CreateDocumentItemRequest : SingleDocumentBaseRequest + where TDocument : class +{ + public CreateDocumentItemRequest(TDocument document, string? documentId) : base(document, documentId) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs new file mode 100644 index 000000000..ba8ef25b0 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Create; + +public class CreateDocumentRequest : DocumentOptions where TDocument : class +{ + public SingleDocumentBaseRequest Request { get; } + + public CreateDocumentRequest(string indexName, TDocument document, string? documentId) : base(indexName) + => Request = new SingleDocumentBaseRequest(document, documentId); +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs new file mode 100644 index 000000000..a9bbca495 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Create; + +public class CreateMultiDocumentRequest : DocumentOptions where TDocument : class +{ + public List> Items { get; set; } + + public CreateMultiDocumentRequest(string indexName) : base(indexName) => Items = new(); + + public CreateMultiDocumentRequest(string indexName, TDocument document, string? documentId = null) : this(indexName) + => AddDocument(document, documentId); + + public CreateMultiDocumentRequest(string indexName, IEnumerable> datas) : this(indexName) + { + ArgumentNullException.ThrowIfNull(datas, nameof(datas)); + + foreach (var data in datas) AddDocument(data.Document, data.DocumentId); + } + + public CreateMultiDocumentRequest AddDocument(TDocument document, string? documentId = null) + => AddDocument(new SingleDocumentBaseRequest(document, documentId)); + + public CreateMultiDocumentRequest AddDocument(SingleDocumentBaseRequest item) + { + Items.Add(item); + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs new file mode 100644 index 000000000..eb7707b9d --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Delete; + +public class DeleteDocumentRequest : DocumentOptions +{ + public string DocumentId { get; } + + public DeleteDocumentRequest(string indexName, string documentId) : base(indexName) => DocumentId = documentId; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs new file mode 100644 index 000000000..cb3bde72c --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Delete; + +public class DeleteMultiDocumentRequest : DocumentOptions +{ + public IEnumerable DocumentIds { get; } + + public DeleteMultiDocumentRequest(string indexName, params string[] documentIds) : base(indexName) + => DocumentIds = documentIds; + + public DeleteMultiDocumentRequest(string indexName, IEnumerable documentIds) : base(indexName) + => DocumentIds = documentIds; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs new file mode 100644 index 000000000..9242b3303 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document; + +public class DocumentOptions +{ + public string IndexName { get; } + + public DocumentOptions(string indexName) + { + if (string.IsNullOrEmpty(indexName)) + throw new ArgumentException("indexName cannot be empty",nameof(indexName)); + + IndexName = indexName; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs new file mode 100644 index 000000000..6d55d93e2 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Exist; + +public class ExistDocumentRequest : DocumentOptions +{ + public string DocumentId { get; set; } + + public ExistDocumentRequest(string indexName, string documentId) : base(indexName) + => DocumentId = documentId; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs new file mode 100644 index 000000000..2c03ac347 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Get; + +public class GetDocumentRequest : DocumentOptions +{ + public string Id { get; } + + public GetDocumentRequest(string indexName, string id) : base(indexName) => Id = id; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs new file mode 100644 index 000000000..d175c5cab --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Get; + +public class GetMultiDocumentRequest : DocumentOptions +{ + public IEnumerable Ids { get; } + + public GetMultiDocumentRequest(string indexName,params string[] ids) : base(indexName) + => Ids = ids; + + public GetMultiDocumentRequest(string indexName, IEnumerable ids) : base(indexName) + => Ids = ids; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs new file mode 100644 index 000000000..ded6c7b3a --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Query; + +public class PaginatedOptions : QueryBaseOptions + where TDocument : class +{ + public int Page { get; } + + public int PageSize { get; } + + public PaginatedOptions( + string indexName, + string query, + string defaultField, + int page, + int pageSize, + Operator @operator = Operator.Or) + : base(indexName, query, defaultField, @operator) + { + Page = page; + PageSize = pageSize; + } + + public PaginatedOptions( + string indexName, + string query, + IEnumerable fields, + int page, + int pageSize, + Operator @operator = Operator.Or) + : base(indexName, query, fields, @operator) + { + Page = page; + PageSize = pageSize; + } + + public new PaginatedOptions UseFields(params string[] fields) + { + base.UseFields(fields); + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs new file mode 100644 index 000000000..42e1cb00f --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Query; + +public class QueryBaseOptions : DocumentOptions + where TDocument : class +{ + public string? DefaultField { get; } + + public IEnumerable Fields { get; private set; } + + public string Query { get; } + + public Operator Operator { get; set; } + + public Action>? Action { get; set; } + + public QueryBaseOptions(string indexName, string query, string? defaultField = null, Operator @operator = Operator.Or) + : base(indexName) + { + DefaultField = defaultField; + Fields = Array.Empty(); + Query = query; + Operator = @operator; + } + + public QueryBaseOptions(string indexName, string query, IEnumerable? fields = null, Operator @operator = Operator.Or) + : base(indexName) + { + DefaultField = string.Empty; + Fields = fields ?? Array.Empty(); + Query = query; + Operator = @operator; + } + + public QueryBaseOptions UseFields(params string[] fields) + { + if (string.IsNullOrEmpty(DefaultField)) + throw new NotSupportedException("Does not support the assignment of DefaultField and Fields at the same time"); + + Fields = fields; + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs new file mode 100644 index 000000000..5817949a9 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Query; + +public class QueryOptions : QueryBaseOptions + where TDocument : class +{ + public int Skip { get; } + + public int Take { get; } + + public QueryOptions(string indexName, string query, string defaultField, int skip, int take, Operator @operator = Operator.Or) + : base(indexName, query, defaultField, @operator) + { + Skip = skip; + Take = take; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs new file mode 100644 index 000000000..42c90e9a7 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Set; + +public class SetDocumentItemBaseRequest : SingleDocumentBaseRequest + where TDocument : class +{ + public SetDocumentItemBaseRequest(TDocument document, string? documentId) : base(document, documentId) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs new file mode 100644 index 000000000..004723124 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Set; + +public class SetDocumentRequest : DocumentOptions where TDocument : class +{ + public List> Items { get; set; } + + public SetDocumentRequest(string indexName) : base(indexName) => Items = new(); + + public SetDocumentRequest(string indexName, TDocument document, string? documentId = null) : this(indexName) + => AddDocument(document, documentId); + + public SetDocumentRequest(string indexName, IEnumerable> datas) : this(indexName) + { + ArgumentNullException.ThrowIfNull(datas, nameof(datas)); + + foreach (var data in datas) AddDocument(data.Document, data.DocumentId); + } + + public SetDocumentRequest AddDocument(TDocument document, string? documentId = null) + => AddDocument(new SingleDocumentBaseRequest(document, documentId)); + + public SetDocumentRequest AddDocument(SingleDocumentBaseRequest item) + { + Items.Add(item); + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs new file mode 100644 index 000000000..7a3ee84a6 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document; + +public class SingleDocumentBaseRequest where TDocument : class +{ + public TDocument Document { get; } + + public string? DocumentId { get; } + + public SingleDocumentBaseRequest(TDocument document, string? documentId) + { + Document = document; + DocumentId = documentId ?? Guid.NewGuid().ToString(); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs new file mode 100644 index 000000000..ba6c060d5 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Update; + +public class UpdateDocumentBaseRequest where TDocument : class +{ + public TDocument? Document { get; } + + public object? PartialDocument { get; } + + public string? DocumentId { get; } + + public UpdateDocumentBaseRequest(TDocument document, string? documentId = null) + { + Document = document; + DocumentId = documentId; + } + + public UpdateDocumentBaseRequest(object partialDocument, string? documentId = null) + { + PartialDocument = partialDocument; + DocumentId = documentId; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs new file mode 100644 index 000000000..ddaf95607 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Update; + +public class UpdateDocumentRequest : DocumentOptions where TDocument : class +{ + public UpdateDocumentBaseRequest Request { get; } + + public UpdateDocumentRequest(string indexName, TDocument document, string? documentId = null) : base(indexName) + => Request = new UpdateDocumentBaseRequest(document, documentId); + + public UpdateDocumentRequest(string indexName, object partialDocument, string? documentId = null) : base(indexName) + => Request = new UpdateDocumentBaseRequest(partialDocument, documentId); +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs new file mode 100644 index 000000000..bba9db635 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Update; + +public class UpdateMultiDocumentRequest : DocumentOptions where TDocument : class +{ + public List> Items { get; set; } + + public UpdateMultiDocumentRequest(string indexName) : base(indexName) + => Items = new(); + + public UpdateMultiDocumentRequest AddDocument(UpdateDocumentBaseRequest item) + { + Items.Add(item); + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs new file mode 100644 index 000000000..6697a7975 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options; + +public class ElasticsearchRelationsOptions +{ + internal readonly Dictionary Relations = new(); + + public ElasticsearchRelationsOptions AddRelation(string name, ElasticsearchOptions options) + { + Uri[] nodes = options.Nodes.Select(uriString => new Uri(uriString)).ToArray(); + ElasticsearchRelations relation = new ElasticsearchRelations(name, options.UseConnectionPool, nodes) + .UseStaticConnectionPoolOptions(options.StaticConnectionPoolOptions) + .UseConnectionSettingsOptions(options.ConnectionSettingsOptions) + .UseConnectionSettings(options.Action); + Relations.Add(name, relation); + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs new file mode 100644 index 000000000..3fc7ffbd6 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Index; + +public class CreateIndexOptions +{ + public IIndexSettings? IndexSettings { get; set; } = null; + + public IAliases? Aliases { get; set; } = null; + + public ITypeMapping? Mappings { get; set; } = null; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs new file mode 100644 index 000000000..520278d63 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Index; + +public class DeleteIndexOptions +{ + public string Alias { get; set; } = default!; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs new file mode 100644 index 000000000..f11083ec7 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options; + +public class StaticConnectionPoolOptions +{ + internal bool Randomize { get; set; } + + internal IDateTimeProvider? DateTimeProvider { get; set; } + + public StaticConnectionPoolOptions() + { + Randomize = true; + DateTimeProvider = null; + } + + internal StaticConnectionPoolOptions UseRandomize(bool randomize) + { + Randomize = randomize; + return this; + } + + internal StaticConnectionPoolOptions UseDateTimeProvider(IDateTimeProvider dateTimeProvider) + { + DateTimeProvider = dateTimeProvider; + return this; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.md b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.md new file mode 100644 index 000000000..13b285e74 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.md @@ -0,0 +1,89 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Data.Elasticsearch + +## Example: + +```c# +Install-Package Masa.Utils.Data.Elasticsearch +``` + +#### Basic usage: + +Using Elasticsearch + +```` C# +builder.Services.AddElasticsearch("es", "http://localhost:9200"); // or builder.Services.AddElasticsearchClient("es", "http://localhost:9200"); +```` + +#### Create index: + +```` C# +public async Task CreateIndexAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + await client.CreateIndexAsync(indexName); +} +```` + +#### Delete index: + +```` C# +public async Task DeleteIndexAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + await client.DeleteIndexAsync(indexName); +} +```` + +#### Remove indexes based on aliases: + +```` C# +public async Task DeleteIndexByAliasAsync([FromServices] IMasaElasticClient client) +{ + string alias = "userIndex"; + await client.DeleteIndexByAliasAsync(alias); +} +```` + +### bind alias + +```` C# +public async Task BindAliasAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + string indexName2 = "user_index_2"; + string alias = "userIndex"; + await client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 }); +} +```` + +### Unbind aliases + +```` C# +public async Task BindAliasAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + string indexName2 = "user_index_2"; + string alias = "userIndex"; + await client.UnBindAliasAsync(new UnBindAliasIndexOptions(alias, new[] { indexName, indexName2 })); +} +```` + +> For more methods, please see [IMasaElasticClient](./IMasaElasticClient.cs) + +## FAQ + +1. The error message is: `"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` + + We enable the compatibility mode by default, namely `EnableApiVersioningHeader(true)`, which supports the 8.* version very well, but will cause errors in some 7.*, in this case, you need to manually turn off the compatibility mode, that is, `EnableApiVersioningHeader(false)`. + + ```` C# + service.AddElasticsearchClient("es", option => + { + option.UseNodes("http://localhost:9200") + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); + }); + ```` + +[Why turn on compatibility mode? ](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md new file mode 100644 index 000000000..18a101942 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md @@ -0,0 +1,89 @@ +中 | [EN](README.md) + +## Masa.Utils.Data.Elasticsearch + +## 用例: + +```c# +Install-Package Masa.Utils.Data.Elasticsearch +``` + +#### 基本用法: + +使用Elasticsearch + +``` C# +builder.Services.AddElasticsearch("es", "http://localhost:9200"); // 或者builder.Services.AddElasticsearchClient("es", "http://localhost:9200"); +``` + +#### 创建索引: + +``` C# +public async Task CreateIndexAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + await client.CreateIndexAsync(indexName); +} +``` + +#### 删除索引: + +``` C# +public async Task DeleteIndexAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + await client.DeleteIndexAsync(indexName); +} +``` + +#### 根据别名删除索引: + +``` C# +public async Task DeleteIndexByAliasAsync([FromServices] IMasaElasticClient client) +{ + string alias = "userIndex"; + await client.DeleteIndexByAliasAsync(alias); +} +``` + +### 绑定别名 + +``` C# +public async Task BindAliasAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + string indexName2 = "user_index_2"; + string alias = "userIndex"; + await client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 }); +} +``` + +### 解除别名绑定 + +``` C# +public async Task BindAliasAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + string indexName2 = "user_index_2"; + string alias = "userIndex"; + await client.UnBindAliasAsync(new UnBindAliasIndexOptions(alias, new[] { indexName, indexName2 })); +} +``` + +> 更多方法请查看[IMasaElasticClient](./IMasaElasticClient.cs) + +## 常见问题 + +1. 出错提示为:`"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` + + 我们默认启用兼容模式,即`EnableApiVersioningHeader(true)`,这样对8.*版本支持很好,但在部分7.*会导致错误,此时需要手动关闭兼容模式,即`EnableApiVersioningHeader(false)`。 + + ``` C# + service.AddElasticsearchClient("es", option => + { + option.UseNodes("http://localhost:9200") + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); + }); + ``` + +[为何开启兼容模式?](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs new file mode 100644 index 000000000..8e97da026 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Alias; + +public class BulkAliasResponse : ResponseBase +{ + public BulkAliasResponse(Nest.BulkAliasResponse bulkAliasResponse) : base(bulkAliasResponse) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs new file mode 100644 index 000000000..28b5846b8 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Alias; + +public class GetAliasResponse : ResponseBase +{ + public IEnumerable Aliases { get; } + + public GetAliasResponse(CatResponse catResponse) : base(catResponse) + => Aliases = catResponse.IsValid ? catResponse.Records.Select(r => r.Alias).ToArray() : Array.Empty(); + + public GetAliasResponse(Nest.GetAliasResponse getAliasResponse) : base(getAliasResponse) + { + Aliases = getAliasResponse.IsValid + ? getAliasResponse.Indices + .Select(item => item.Value) + .SelectMany(indexAlias => indexAlias.Aliases) + .Select(alias => alias.Key).Distinct().ToArray() + : Array.Empty(); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs new file mode 100644 index 000000000..0a01a010f --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class BulkResponse : ResponseBase +{ + public List Items { get; set; } + + public BulkResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + Items = bulkResponse.Items.Select(item => new BulkResponseItems(item.Id, item.IsValid, item.Error?.ToString() ?? string.Empty)).ToList(); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs new file mode 100644 index 000000000..2fd7bacae --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class BulkResponseItems +{ + /// + /// The id of the document for the bulk operation + /// + public string Id { get; } + + public bool IsValid { get; } + + public string Message { get; } + + public BulkResponseItems(string id, bool isValid, string message) + { + Id = id; + IsValid = isValid; + Message = message; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs new file mode 100644 index 000000000..b2f60e8d3 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class CreateMultiResponse : BulkResponse +{ + public CreateMultiResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs new file mode 100644 index 000000000..ad50cf6f3 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class CreateResponse : ResponseBase +{ + public CreateResponse(Nest.CreateResponse createResponse) : base(createResponse) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs new file mode 100644 index 000000000..6fc2570e4 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class DeleteMultiResponse : ResponseBase +{ + public List Data { get; set; } + + public DeleteMultiResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + Data = bulkResponse.Items.Select(item => + new DeleteRangeResponseItems(item.Id, + item.IsValid && item.Status == 200, + !string.IsNullOrEmpty(item.Result) ? item.Result : item.Error?.ToString() ?? string.Empty)).ToList(); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs new file mode 100644 index 000000000..785d24796 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class DeleteRangeResponseItems +{ + public string Id { get; } + + public bool IsValid { get; } + + public string Message { get; } + + public DeleteRangeResponseItems(string id, bool isValid, string message) + { + Id = id; + IsValid = isValid; + Message = message; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs new file mode 100644 index 000000000..ab6a99db6 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class DeleteResponse : ResponseBase +{ + public DeleteResponse(Nest.DeleteResponse deleteResponse) : base(deleteResponse) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs new file mode 100644 index 000000000..9b13a2fbd --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Document; + +public class ClearDocumentResponse : ResponseBase +{ + public ClearDocumentResponse(DeleteByQueryResponse response) : base(response) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs new file mode 100644 index 000000000..ef46ae530 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Document; + +public class CountDocumentResponse : ResponseBase +{ + public long Count { get; } + + public CountDocumentResponse(CountResponse response) : base(response) => Count = response.Count; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs new file mode 100644 index 000000000..6436bf54f --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class ExistsResponse : ResponseBase +{ + public bool Exists { get; } + + public ExistsResponse(Nest.ExistsResponse existsResponse) : base( + existsResponse.IsValid || existsResponse.ApiCall.HttpStatusCode == 404, + existsResponse.IsValid || existsResponse.ApiCall.HttpStatusCode == 404 ? "success" : existsResponse.ServerError?.ToString() ?? string.Empty) + { + Exists = existsResponse.Exists; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs new file mode 100644 index 000000000..d22106c0e --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class GetMultiResponse : ResponseBase + where TDocument : class +{ + public List> Data { get; set; } + + public GetMultiResponse(bool isValid, string message, List>? multiGetHits = null) : base(isValid, message) + { + Data = multiGetHits?.Select(res => new GetMultiResponseItems(res.Id, res.Source)).ToList() ?? new(); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs new file mode 100644 index 000000000..2a023fbc9 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class GetMultiResponseItems + where TDocument : class +{ + public string Id { get; } + + public TDocument Document { get; } + + public GetMultiResponseItems(string id, TDocument document) + { + Id = id; + Document = document; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs new file mode 100644 index 000000000..15333ce89 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class GetResponse : ResponseBase + where TDocument : class +{ + public TDocument Document { get; set; } + + public GetResponse(IGetResponse getResponse) : base(getResponse) + { + Document = getResponse.Source; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs new file mode 100644 index 000000000..dcf7915c4 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Index; + +public class CreateIndexResponse : ResponseBase +{ + public CreateIndexResponse(Nest.CreateIndexResponse createIndexResponse) : base(createIndexResponse) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs new file mode 100644 index 000000000..4059fef64 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Index; + +public class DeleteIndexResponse : ResponseBase +{ + public DeleteIndexResponse(Nest.DeleteIndexResponse deleteIndexResponse) : base(deleteIndexResponse) + { + } + + public DeleteIndexResponse(BulkAliasResponse bulkAliasResponse) : base(bulkAliasResponse) + { + } + + public DeleteIndexResponse(string message) : base(false, message) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs new file mode 100644 index 000000000..d045eb27b --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Index; + +public class GetIndexByAliasResponse : ResponseBase +{ + public string[] IndexNames { get; } + + public GetIndexByAliasResponse(CatResponse catResponse) : base(catResponse) + { + IndexNames = catResponse.IsValid ? catResponse.Records.Select(r => r.Index).ToArray() : Array.Empty(); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs new file mode 100644 index 000000000..d7a4feb05 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Index; + +public class GetIndexResponse : ResponseBase +{ + public string[] IndexNames { get; set; } + + public GetIndexResponse(CatResponse catResponse) : base(catResponse) + { + IndexNames = catResponse.IsValid ? catResponse.Records.Select(r => r.Index).ToArray() : Array.Empty(); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs new file mode 100644 index 000000000..1e7ea5b55 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class ResponseBase +{ + public bool IsValid { get; } + + public string Message { get; } + + protected ResponseBase(bool isValid, string message) + { + IsValid = isValid; + Message = message; + } + + public ResponseBase(IResponse response) : this(response.IsValid, response.IsValid ? "success" : response.ServerError?.ToString() ?? string.Empty) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs new file mode 100644 index 000000000..da4843bb7 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class SearchPaginatedResponse : SearchResponse + where TDocument : class +{ + public long Total { get; set; } + + public int TotalPages { get; set; } + + public SearchPaginatedResponse(ISearchResponse searchResponse) : base(searchResponse) + { + Total = searchResponse.Hits.Count; + } + + public SearchPaginatedResponse(int pageSize, ISearchResponse searchResponse) : this(searchResponse) + { + TotalPages = (int)Math.Ceiling(Total / (decimal)pageSize); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs new file mode 100644 index 000000000..309f8f424 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class SearchResponse : ResponseBase + where TDocument : class +{ + public List Data { get; } + + public SearchResponse(ISearchResponse searchResponse) : base(searchResponse) + { + Data = searchResponse.Hits.Select(hit => hit.Source).ToList(); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs new file mode 100644 index 000000000..76e03529e --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class SetResponse : BulkResponse +{ + public SetResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs new file mode 100644 index 000000000..039be8e1e --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class UpdateMultiResponse : BulkResponse +{ + public UpdateMultiResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs new file mode 100644 index 000000000..75763fcaa --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class UpdateResponse : ResponseBase +{ + public UpdateResponse(IUpdateResponse updateResponse) : base(updateResponse) + { + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs new file mode 100644 index 000000000..0a3912065 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static partial class ServiceCollectionExtensions +{ + private static MasaElasticsearchBuilder CreateElasticsearchClient(this IServiceCollection services, string name) + { + var elasticClient = services.BuildServiceProvider().GetRequiredService().CreateElasticClient(name); + return new MasaElasticsearchBuilder(services, elasticClient); + } + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services) + => services.AddElasticsearch().CreateElasticsearchClient(Const.DEFAULT_CLIENT_NAME); + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string[]? nodes) + => services + .AddElasticsearch(Const.DEFAULT_CLIENT_NAME, nodes == null || nodes.Length == 0 ? new[] {"http://localhost:9200"} : nodes) + .CreateElasticsearchClient(Const.DEFAULT_CLIENT_NAME); + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string name, params string[] nodes) + => services.AddElasticsearch(name, nodes).CreateElasticsearchClient(name); + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string name, Action action) + => services.AddElasticsearch(name, action).CreateElasticsearchClient(name); + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string name, Func func) + => services.AddElasticsearch(name, func).CreateElasticsearchClient(name); +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..feba8bd2c --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs @@ -0,0 +1,75 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static partial class ServiceCollectionExtensions +{ + public static IServiceCollection AddElasticsearch(this IServiceCollection services, string[]? nodes = null) + { + if (nodes == null || nodes.Length == 0) + { + nodes = new[] {"http://localhost:9200"}; + } + + return services.AddElasticsearch(Const.DEFAULT_CLIENT_NAME, nodes); + } + + public static IServiceCollection AddElasticsearch(this IServiceCollection services, string name, params string[] nodes) + => services.AddElasticsearch(name, options => options.UseNodes(nodes)); + + public static IServiceCollection AddElasticsearch(this IServiceCollection services, string name, Action action) + { + return services.AddElasticsearch(name, () => + { + ElasticsearchOptions options = new("http://localhost:9200"); + action.Invoke(options); + return options; + }); + } + + public static IServiceCollection AddElasticsearch(this IServiceCollection services, string name, Func func) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException(nameof(name)); + } + + AddElasticsearchCore(services); + + services.TryAddOrUpdateElasticsearchRelation(name, func.Invoke()); + + return services; + } + + private static IServiceCollection AddElasticsearchCore(this IServiceCollection services) + { + ArgumentNullException.ThrowIfNull(services); + + services.TryAddSingleton(); + + services.TryAddSingleton(serviceProvider => + serviceProvider.GetRequiredService().CreateElasticClient()); + + services.TryAddSingleton(serviceProvider => + new DefaultMasaElasticClient(serviceProvider.GetRequiredService())); + + services.TryAddSingleton(new ElasticsearchRelationsOptions()); + + return services; + } + + private static void TryAddOrUpdateElasticsearchRelation(this IServiceCollection services, string name, ElasticsearchOptions options) + { + var serviceProvider = services.BuildServiceProvider(); + var relationsOptions = serviceProvider.GetRequiredService(); + + if (relationsOptions.Relations.ContainsKey(name)) + throw new ArgumentException($"The ElasticClient whose name is {name} is exist"); + + if (options.IsDefault && relationsOptions.Relations.Values.Any(r => r.IsDefault)) + throw new ArgumentNullException(nameof(ElasticsearchRelations.IsDefault), "ElasticClient can only have one default"); + + relationsOptions.AddRelation(name, options); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs new file mode 100644 index 000000000..7a55080cd --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Elasticsearch.Net; +global using Masa.Utils.Data.Elasticsearch; +global using Masa.Utils.Data.Elasticsearch.Internal.BulkOperation; +global using Masa.Utils.Data.Elasticsearch.Options; +global using Masa.Utils.Data.Elasticsearch.Options.Alias; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Count; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Create; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Delete; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Exist; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Get; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Query; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Set; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Update; +global using Masa.Utils.Data.Elasticsearch.Options.Index; +global using Masa.Utils.Data.Elasticsearch.Response; +global using Masa.Utils.Data.Elasticsearch.Response.Document; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Nest; +global using System.Collections.Concurrent; +global using System.Runtime.Serialization; +global using MASABulkAliasResponse = Masa.Utils.Data.Elasticsearch.Response.Alias.BulkAliasResponse; +global using MASAGetAliasResponse = Masa.Utils.Data.Elasticsearch.Response.Alias.GetAliasResponse; diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs new file mode 100644 index 000000000..b4f33b1db --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Enums; + +public enum ResultStatuses +{ + Success = 1, + Error +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs new file mode 100644 index 000000000..35391ffc0 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Enums; + +/// +/// reference https://prometheus.io/docs/prometheus/latest/querying/api/#expression-query-result-formats +/// +public enum ResultTypes +{ + Matrix = 1, + Vector, + Scalar, + String +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs new file mode 100644 index 000000000..32c446a66 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +[assembly: InternalsVisibleTo("Masa.Utils.Data.Prometheus.Test")] +namespace Masa.Utils.Caller.Core; + +internal static class CallerProviderExtensions +{ + public static async Task GetAsync(this ICallerProvider caller, string url, object data) + { + var request = new HttpRequestMessage(HttpMethod.Get, $"{url}?{data.ToUrlParam()}"); + var response = await caller.SendAsync(request, autoThrowUserFriendlyException: false); + return await response.Content.ReadAsStringAsync(); + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs new file mode 100644 index 000000000..040a87648 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs @@ -0,0 +1,142 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public static class ObjectExtensions +{ + /// + /// Currently supported types: class, struct and types implementing the IEnumerable interface, + /// struct and class use public get properties and fields by default, + /// The IEnumerable type is directly converted to: key[]=value1&key[]=value2 + /// enum uses strings by default. If you need to use numeric values, please set isEnumString=false + /// + /// + /// + /// + /// + /// + public static string? ToUrlParam(this object? obj, bool isEnumString = true, bool isCamelCase = true, bool isUrlEncode = true) + { + return GetValue(obj, string.Empty, isEnumString, isCamelCase, isUrlEncode); + } + + private static string? GetValue(object? obj, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) + { + if (obj == null) return null; + var type = obj.GetType(); + if (type == typeof(string)) + { + var str = (string)obj; + return AppendValue(preStr, str, "=", isUrlEncode); + } + + if (type.IsValueType) + { + if (type.IsEnum) + { + var str = isEnumString ? obj.ToString() : Convert.ToInt32(obj).ToString(); + return AppendValue(preStr, str, "=", isUrlEncode); + } + + //sample value + if (type.IsPrimitive) + { + var str = obj.ToString(); + return AppendValue(preStr, str, "=", isUrlEncode); + } + + //struct + return GetObjValue(type, obj, preStr, isEnumString, isCamelCase, isUrlEncode); + } + + if (type.IsArray || type.GetInterfaces().Any(t => t.Name.IndexOf("IEnumerable") == 0)) + return GetEnumerableValue(obj, preStr, isEnumString, isCamelCase, isUrlEncode); + + if (type.IsClass) + return GetObjValue(type, obj, preStr, isEnumString, isCamelCase, isUrlEncode); + + //current type not suport + return null; + } + + private static string GetObjValue(Type type, object obj, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) + { + var properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty); + var fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetField); + var list = new List(); + + foreach (var item in properties) + { + var str = GetMemerInfoValue(item, item.GetValue(obj), preStr, isEnumString, isCamelCase, isUrlEncode); + if (string.IsNullOrEmpty(str)) + continue; + list.Add(str); + } + + foreach (var item in fields) + { + var str = GetMemerInfoValue(item, item.GetValue(obj), preStr, isEnumString, isCamelCase, isUrlEncode); + if (string.IsNullOrEmpty(str)) + continue; + list.Add(str); + } + + if (!list.Any()) + return default!; + + list.Sort(); + return string.Join('&', list); + } + + private static string? GetMemerInfoValue(MemberInfo info, object? value, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) + { + if (value == null) + return null; + + var name = info.Name; + if (isCamelCase) + name = name.ToCamelCase(); + + return GetValue(value, AppendValue(preStr, name, ".", isUrlEncode) ?? default!, isEnumString, isCamelCase, isUrlEncode); + } + + private static string? GetEnumerableValue(object obj, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) + { + var list = new List(); + foreach (var item in (IEnumerable)obj) + { + if (item is KeyValuePair keyValue) + { + var name = keyValue.Key; + if (isCamelCase) + name = name.ToCamelCase(); + var str = GetValue(keyValue.Value, AppendValue(preStr, name, ".", isUrlEncode) ?? default!, isEnumString, isCamelCase, isUrlEncode); + if (!string.IsNullOrEmpty(str)) + list.Add(str); + } + else + { + var str = GetValue(item, $"{preStr}{(isUrlEncode ? HttpUtility.UrlEncode("[]", Encoding.UTF8) : "[]")}", isEnumString, isCamelCase, isUrlEncode); + if (!string.IsNullOrEmpty(str)) + list.Add(str); + } + } + if (!list.Any()) + return default!; + + list.Sort(); + return string.Join('&', list); + } + + private static string? AppendValue(string preStr, string? value, string splitChar, bool isUrlEncode) + { + if (string.IsNullOrEmpty(preStr) || string.IsNullOrEmpty(value)) + return value; + + if (isUrlEncode) + return $"{preStr}{splitChar}{HttpUtility.UrlEncode(value, Encoding.UTF8)}"; + else + return $"{preStr}{splitChar}{value}"; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs new file mode 100644 index 000000000..a484b7fb1 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +internal static class StringExtensions +{ + public static string ToCamelCase(this string str) + { + if (string.IsNullOrEmpty(str)) + return default!; + + var span = new ReadOnlySpan(str.ToArray()); + var c = span[0]; + if (c - 'A' >= 0 && c - 'Z' <= 0) + return $"{(char)(c + 32)}{span[1..]}"; + + return str; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs new file mode 100644 index 000000000..cc8c5d508 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus; + +public interface IMasaPrometheusClient +{ + Task QueryAsync(QueryRequest query); + + Task QueryRangeAsync(QueryRangeRequest query); + + Task SeriesQueryAsync(MetaDataQueryRequest query); + + Task LabelsQueryAsync(MetaDataQueryRequest query); + + Task LabelValuesQueryAsync(LableValueQueryRequest query); + + Task ExemplarQueryAsync(QueryExemplarRequest query); +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj new file mode 100644 index 000000000..d3bd13a85 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs new file mode 100644 index 000000000..e243e99a2 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs @@ -0,0 +1,127 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +[assembly: InternalsVisibleTo("Masa.Utils.Data.Prometheus.Test")] +namespace Masa.Utils.Data.Prometheus; + +internal class MasaPrometheusClient : IMasaPrometheusClient +{ + private readonly ICallerProvider _caller; + private readonly JsonSerializerOptions _jsonSerializerOptions; + + public MasaPrometheusClient(ICallerProvider caller, JsonSerializerOptions jsonSerializerOptions) + { + _caller = caller; + _jsonSerializerOptions = jsonSerializerOptions; + } + + public async Task ExemplarQueryAsync(QueryExemplarRequest query) + { + return await QueryDataAsync("/api/v1/query_exemplars", query); + } + + public async Task LabelsQueryAsync(MetaDataQueryRequest query) + { + return await QueryDataAsync("/api/v1/labels", query); + } + + public async Task LabelValuesQueryAsync(LableValueQueryRequest query) + { + var name = query.Lable; + query.Lable = null; + return await QueryDataAsync($"/api/v1/label/{name}/values", query); + } + + public async Task QueryAsync(QueryRequest query) + { + return await QueryDataAsync("/api/v1/query", query); + } + + public async Task QueryRangeAsync(QueryRangeRequest query) + { + return await QueryDataAsync("/api/v1/query_range", query); + } + + public async Task SeriesQueryAsync(MetaDataQueryRequest query) + { + return await QueryDataAsync("/api/v1/series", query); + } + + private async Task QueryDataAsync(string url, object data) where T : ResultBaseResponse + { + var str = await _caller.GetAsync(url, data); + if (string.IsNullOrEmpty(str)) + return default!; + + var baseResult = JsonSerializer.Deserialize(str, _jsonSerializerOptions); + + if (baseResult == null || baseResult.Status != ResultStatuses.Success) + { + return baseResult ?? default!; + } + + if (typeof(T) == typeof(QueryResultCommonResponse)) + { + var result = baseResult as QueryResultCommonResponse; + if (result == null || result.Data == null) + return baseResult; + switch (result.Data.ResultType) + { + case ResultTypes.Matrix: + { + var temp = JsonSerializer.Serialize(result.Data.Result, _jsonSerializerOptions); + result.Data.Result = JsonSerializer.Deserialize(temp, _jsonSerializerOptions); + if (result.Data.Result != null && result.Data.Result.Any()) + { + foreach (QueryResultMatrixRangeResponse item in result.Data.Result) + { + if (item.Values == null || !item.Values.Any()) + continue; + var array = item.Values.ToArray(); + int i = 0, max = array.Length - 1; + do + { + array[i] = ConvertJsonToObjValue(array[i]); + i++; + } + while (max - i >= 0); + item.Values = array; + } + } + return result as T ?? default!; + } + case ResultTypes.Vector: + { + var temp = JsonSerializer.Serialize(result.Data.Result, _jsonSerializerOptions); + result.Data.Result = JsonSerializer.Deserialize(temp, _jsonSerializerOptions); + if (result.Data.Result != null && result.Data.Result.Any()) + { + foreach (QueryResultInstantVectorResponse item in result.Data.Result) + { + item.Value = ConvertJsonToObjValue(item.Value); + } + } + return result as T ?? default!; + } + default: + { + if (result.Data.Result != null && result.Data.Result.Any()) + { + result.Data.Result = ConvertJsonToObjValue(result.Data.Result); + } + } + break; + } + } + + return baseResult; + } + + private static object[] ConvertJsonToObjValue(object[]? values) + { + if (values == null || values.Length - 2 < 0) + return default!; + + return new object[] { ((JsonElement)values[0]).GetDouble(), ((JsonElement)values[1]).GetString() ?? default! }; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs new file mode 100644 index 000000000..2777b076a --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class ExemplarModel +{ + public IDictionary? Labels { get; set; } + + public string? Value { get; set; } + + public float TimeStamp { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs new file mode 100644 index 000000000..84ff5c61e --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class ExemplarDataModel +{ + public IDictionary? SeriesLabels { get; set; } + + public IEnumerable? Exemplars { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs new file mode 100644 index 000000000..c03e8eee1 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class ExemplarResultResponse : ResultBaseResponse +{ + public IEnumerable? Data { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs new file mode 100644 index 000000000..a20a25ca2 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class LabelResultResponse : ResultBaseResponse +{ + public IEnumerable? Data { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs new file mode 100644 index 000000000..6422449c5 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class SeriesResultResponse : ResultBaseResponse +{ + public IEnumerable>? Data { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs new file mode 100644 index 000000000..1859c35b5 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryResultCommonResponse: ResultBaseResponse +{ + public QueryResultDataResponse? Data { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs new file mode 100644 index 000000000..209f6d573 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryResultDataResponse +{ + public ResultTypes ResultType { get; set; } + + public object[]? Result { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs new file mode 100644 index 000000000..976986e28 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryResultInstantVectorResponse +{ + public IDictionary? Metric { get; set; } + + public object[]? Value { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs new file mode 100644 index 000000000..810473d12 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryResultMatrixRangeResponse +{ + public IDictionary? Metric { get; set; } + + public IEnumerable? Values { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs new file mode 100644 index 000000000..33381e613 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class ResultBaseResponse +{ + public ResultStatuses Status { get; set; } + + public string? Error { get; set; } + + public string? ErrorType { get; set; } + + public IEnumerable? Warnings { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs new file mode 100644 index 000000000..b1089a15d --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class LableValueQueryRequest: MetaDataQueryRequest +{ + public string Lable { get; set; } = "__name__"; +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs new file mode 100644 index 000000000..00c3af561 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class MetaDataQueryRequest +{ + public IEnumerable? Match { get; set; } + + public string? Start { get; set; } + + public string? End { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs new file mode 100644 index 000000000..b6b9a4be7 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryExemplarRequest +{ + public string? Query { get; set; } + + public string? Start { get; set; } + + public string? End { get; set; } +} + diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs new file mode 100644 index 000000000..9d4926191 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryRangeRequest +{ + public string? Query { get; set; } + + public string? Start { get; set; } + + public string? End { get; set; } + + public string? Step { get; set; } + + public string? TimeOut { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs new file mode 100644 index 000000000..b1779587c --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryRequest +{ + public string? Query { get; set; } + + public string? Time { get; set; } + + public string? TimeOut { get; set; } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.md b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.md new file mode 100644 index 000000000..94ad400db --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.md @@ -0,0 +1,75 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Data.Prometheus + +[Prometheus Http Api](https://www.prometheus.io/docs/prometheus/latest/querying/api/) Client Library + +## Install: +```c# +Install-Package Masa.Utils.Data.Prometheus +``` + +### Example: + +1. Inject + +```` C# +builder.Services.AddPrometheusClient("http://127.0.0.1:9090"); +```` + +2. Query Example + +```C# +public class SampleService +{ + + private IMasaPrometheusClient _client; + + public SampleService(IMasaPrometheusClient client) + { + _client=client; + } + + public async Task QueryAsync() + { + var query= new QueryRequest { + Query = "up", //metric name + Time = "2022-06-01T09:00:00.000Z" //standard time format or unix timestamp, such as: 1654045200 or 1654045200.000 + }; + var result = await _client.QueryAsync(query); + if(result.Status == ResultStatuses.Success) + { + switch(result.Data.ResultType) + { + case ResultTypes.Vector: + { + var data=result.Data.Result as QueryResultInstantVectorResponse[]; + ... + } + break; + case ResultTypes.Matrix: + { + var data=result.Data.Result as QueryResultMatrixRangeResponse[]; + ... + } + break; + default: + { + var timeSpan=(double)result.Data.Result[0]; + var value=(string)result.Data.Result[1]; + } + break; + } + } + } +} +``` + +### Current suports: + +- [query](https://www.prometheus.io/docs/prometheus/latest/querying/api/#instant-queries) +- [query_range](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-queries) +- [series](https://www.prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers) +- [lables](https://www.prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names) +- [lable value](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values) +- [exemplars](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-exemplars) diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md new file mode 100644 index 000000000..b8c14ab1f --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md @@ -0,0 +1,75 @@ +[EN](README.md) | 中 + +## Masa.Utils.Data.Prometheus + +[Prometheus Http Api](https://www.prometheus.io/docs/prometheus/latest/querying/api/) 客户端类库 + +## 安装: +```c# +Install-Package Masa.Utils.Data.Prometheus +``` + +### 示例: + +1. 注册 + +```` C# +builder.Services.AddPrometheusClient("http://127.0.0.1:9090"); +```` + +2. 查询样例 + +```C# +public class SampleService +{ + + private IMasaPrometheusClient _client; + + public SampleService(IMasaPrometheusClient client) + { + _client=client; + } + + public async Task QueryAsync() + { + var query= new QueryRequest { + Query = "up", //metric name + Time = "2022-06-01T09:00:00.000Z" //标准时间格式或unix时间戳,如:1654045200或1654045200.000 + }; + var result = await _client.QueryAsync(query); + if(result.Status == ResultStatuses.Success) + { + switch(result.Data.ResultType) + { + case ResultTypes.Vector: + { + var data=result.Data.Result as QueryResultInstantVectorResponse[]; + ... + } + break; + case ResultTypes.Matrix: + { + var data=result.Data.Result as QueryResultMatrixRangeResponse[]; + ... + } + break; + default: + { + var timeSpan=(double)result.Data.Result[0]; + var value=(string)result.Data.Result[1]; + } + break; + } + } + } +} +``` + +### 目前只支持以下api: + +- [query](https://www.prometheus.io/docs/prometheus/latest/querying/api/#instant-queries) +- [query_range](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-queries) +- [series](https://www.prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers) +- [lables](https://www.prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names) +- [lable value](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values) +- [exemplars](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-exemplars) diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..3b1ca0556 --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs @@ -0,0 +1,39 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus; + +public static class ServiceCollectionExtensions +{ + private const string PROMETHEUS_HTTP_CLIENT_NAME = "prometheus_client_name"; + + public static IServiceCollection AddPrometheusClient(this IServiceCollection services, string url) + { + ArgumentNullException.ThrowIfNull(url, nameof(url)); + + if (services.Any(service => service.GetType() == typeof(IMasaPrometheusClient))) + return services; + + services.AddCaller(builder => + { + builder.UseHttpClient(options => + { + options.BaseAddress = url; + options.Name = PROMETHEUS_HTTP_CLIENT_NAME; + }); + }); + + var jsonOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true + }; + jsonOptions.Converters.Add(new JsonStringEnumConverter()); + + services.AddScoped(ServiceProvider => + { + var caller = ServiceProvider.GetRequiredService().CreateClient(PROMETHEUS_HTTP_CLIENT_NAME); + return new MasaPrometheusClient(caller, jsonOptions); + }); + return services; + } +} diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/_Imports.cs b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/_Imports.cs new file mode 100644 index 000000000..0d8a7ec8a --- /dev/null +++ b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/_Imports.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caller.Core; +global using Masa.Utils.Caller.HttpClient; +global using Masa.Utils.Data.Prometheus.Enums; +global using Masa.Utils.Data.Prometheus.Model; +global using Microsoft.Extensions.DependencyInjection; +global using System.Collections; +global using System.Reflection; +global using System.Runtime.CompilerServices; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; +global using System.Web; diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs new file mode 100644 index 000000000..e29c63771 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.AspNetCore; + +public class DaprBackgroundService : BackgroundService +{ + private readonly IAppPortProvider _appPortProvider; + private readonly IDaprProcess _daprProcess; + private readonly DaprOptions _options; + private readonly IHostApplicationLifetime _hostApplicationLifetime; + private readonly ILogger? _logger; + + public DaprBackgroundService( + IAppPortProvider appPortProvider, + IDaprProcess daprProcess, + IOptionsMonitor options, + IHostApplicationLifetime hostApplicationLifetime, + ILogger? logger) + { + _appPortProvider = appPortProvider; + _daprProcess = daprProcess; + _options = options.CurrentValue; + options.OnChange(daprOptions => + { + daprOptions.AppPort ??= _appPortProvider.GetAppPort(daprOptions.EnableSsl); + _daprProcess.Refresh(daprOptions); + }); + _hostApplicationLifetime = hostApplicationLifetime; + _logger = logger; + } + + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + if (!await WaitForAppStartup(_hostApplicationLifetime, stoppingToken)) + return; + + // if cancellation was requested, stop + if (stoppingToken.IsCancellationRequested) + { + _logger?.LogInformation("{Name} is Stopping...", nameof(DaprBackgroundService)); + _daprProcess.Stop(stoppingToken); + } + else + { + _logger?.LogInformation("{Name} is Starting ...", nameof(DaprBackgroundService)); + _options.AppPort ??= _appPortProvider.GetAppPort(_options.EnableSsl); + _daprProcess.Start(_options, stoppingToken); + } + } + + static async Task WaitForAppStartup(IHostApplicationLifetime hostApplicationLifetime, CancellationToken stoppingToken) + { + var startedSource = new TaskCompletionSource(); + var cancelledSource = new TaskCompletionSource(); + + await using var startedCancellationTokenRegistration = + hostApplicationLifetime.ApplicationStarted.Register(() => startedSource.SetResult()); + await using var cancellationTokenRegistration = stoppingToken.Register(() => cancelledSource.SetResult()); + + Task completedTask = await Task.WhenAny(startedSource.Task, cancelledSource.Task).ConfigureAwait(false); + + // If the completed tasks was the "app started" task, return true, otherwise false + return completedTask == startedSource.Task; + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs new file mode 100644 index 000000000..fed607320 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.AspNetCore; + +public class DefaultAppPortProvider : IAppPortProvider +{ + private readonly IServer _server; + + public DefaultAppPortProvider(IServer server) => _server = server; + + public ushort GetAppPort(bool? enableSsl) + { + var addresses = _server.Features.Get()?.Addresses; + if (addresses is { IsReadOnly: false, Count: 0 }) + throw new Exception("Failed to get the startup port, please specify the port manually"); + + var ports = addresses! + .Select(address => new Uri(address)) + .Where(address + => (enableSsl is true && address.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)) + || address.Scheme.Equals(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase)) + .Select(address => new + { + address.Scheme, + address.Port + }).ToList(); + + if (enableSsl is true) + { + return ports + .Where(p => p.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)) + .Select(p => (ushort)p.Port) + .FirstOrDefault(); + } + + return ports + .Where(p => p.Scheme.Equals(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase)) + .Select(p => (ushort)p.Port) + .FirstOrDefault(); + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs new file mode 100644 index 000000000..8dc3e765d --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.AspNetCore; + +public interface IAppPortProvider +{ + ushort GetAppPort(bool? enableSsl); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj new file mode 100644 index 000000000..5774c7add --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.md b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.md new file mode 100644 index 000000000..70baec004 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.md @@ -0,0 +1,59 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Development.Dapr.AspNetCore + +Responsibilities: + +Assist in managing the dapr process to reduce the dependency on docker compose during development + +### Basic usage: + +1. Install Masa.Utils.Development.Dapr.AspNetCore +``` C# +Install-Package Masa.Utils.Development.Dapr.AspNetCore +``` + +2. Add DaprStarter to assist in managing the dapr process (recommended to be used in the development environment) + +``` C# +builder.Services.AddDaprStarter(); +``` + +### Advanced usage: + +1. Specify the configuration in the code + +``` C# +builder.Services.AddDaprStarter(opt => +{ + opt.AppId = "masa-dapr-test"; + opt.AppPort = 5001; + opt.AppIdSuffix = ""; + opt.DaprHttpPort = 8080; + opt.DaprGrpcPort = 8081; +}); +``` + +2. The configuration file specifies the configuration + +First step: + +``` appsettings.json +{ + "DaprOptions": { + "AppId": "masa-dapr-test", + "AppPort": 5001, + "AppIdSuffix": "", + "DaprHttpPort": 8080, + "DaprGrpcPort": 8081 + } +} +``` + +Step 2: + +``` C# +builder.Services.AddDaprStarter(builder.Configuration.GetSection("DaprOptions"); +``` + +Advantages: After the configuration is changed, the dapr process is restarted and updated, and the project does not need to be restarted diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md new file mode 100644 index 000000000..0f87ee42c --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md @@ -0,0 +1,59 @@ +中 | [EN](README.md) + +## Masa.Utils.Development.Dapr.AspNetCore + +职责: + +协助管理dapr进程,用于开发时减少对docker compose的依赖 + +### 基本用法: + +1. 安装Masa.Utils.Development.Dapr.AspNetCore +```C# +Install-Package Masa.Utils.Development.Dapr.AspNetCore +``` + +2. 添加DaprStarter协助管理dapr进程(建议在开发环境使用) + +```C# +builder.Services.AddDaprStarter(); +``` + +### 高级用法: + +1. 代码中指定配置 + +```C# +builder.Services.AddDaprStarter(opt => +{ + opt.AppId = "masa-dapr-test"; + opt.AppPort = 5001; + opt.AppIdSuffix = ""; + opt.DaprHttpPort = 8080; + opt.DaprGrpcPort = 8081; +}); +``` + +2. 配置文件指定配置 + +第一步: + +``` appsettings.json +{ + "DaprOptions": { + "AppId": "masa-dapr-test", + "AppPort": 5001, + "AppIdSuffix": "", + "DaprHttpPort": 8080, + "DaprGrpcPort": 8081 + } +} +``` + +第二步: + +``` C# +builder.Services.AddDaprStarter(builder.Configuration.GetSection("DaprOptions")); +``` + +优势:支持配置变更后,dapr 进程重启更新,项目无需重新启动 diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..8c8cb20dc --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs @@ -0,0 +1,76 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddDaprStarter(this IServiceCollection services) + => services.AddDaprStarter(_ => + { + }); + + public static IServiceCollection AddDaprStarter( + this IServiceCollection services, + Action daprOptionAction, + bool isDelay = true) + { + ArgumentNullException.ThrowIfNull(daprOptionAction, nameof(daprOptionAction)); + + return services.AddDaprStarter(() => + { + services.AddDaprStarterCore(daprOptionAction); + }, isDelay); + } + + public static IServiceCollection AddDaprStarter( + this IServiceCollection services, + IConfiguration configuration, + bool isDelay = true) + { + return services.AddDaprStarter(() => + { + services.AddDaprStarterCore(configuration); + }, isDelay); + } + + private static IServiceCollection AddDaprStarter(this IServiceCollection services, Action action, bool isDelay = true) + { + if (services.Any(service => service.ImplementationType == typeof(DaprService))) + return services; + + services.AddSingleton(); + + services.AddSingleton(); + action.Invoke(); + if (isDelay) + return services.AddHostedService(); + + var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + ArgumentNullException.ThrowIfNull(options.CurrentValue.AppPort, nameof(options.CurrentValue.AppPort)); + var daprProcess = serviceProvider.GetRequiredService(); + options.OnChange(daprOptions => + { + daprProcess.Refresh(daprOptions); + }); + daprProcess.Start(options.CurrentValue); + CompleteDaprEnvironment(options.CurrentValue.DaprHttpPort, options.CurrentValue.DaprGrpcPort); + return services; + } + + private static void CompleteDaprEnvironment(ushort? daprHttpPort, ushort? daprGrpcPort) + { + if (daprHttpPort == null || daprGrpcPort == null) + return; + + EnvironmentExtensions.TryAdd("DAPR_GRPC_PORT", daprGrpcPort.ToString, out _); + EnvironmentExtensions.TryAdd("DAPR_HTTP_PORT", daprHttpPort.ToString, out _); + } + + private class DaprService + { + + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs new file mode 100644 index 000000000..5509a71e7 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Development.Dapr; +global using Masa.Utils.Development.Dapr.AspNetCore; +global using Microsoft.AspNetCore.Hosting.Server; +global using Microsoft.AspNetCore.Hosting.Server.Features; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.Hosting; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/CommandLineBuilder.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/CommandLineBuilder.cs new file mode 100644 index 000000000..f6eda87fe --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/CommandLineBuilder.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public class CommandLineBuilder +{ + public string Prefix { get; } + + public List Arguments { get; set; } + + public CommandLineBuilder(string prefix) + { + Prefix = prefix; + Arguments = new(); + } + + public CommandLineBuilder Add(string name, string value, bool isSkip = false) + { + if (!isSkip) + { + Arguments.Add($"{Prefix}{name} {value}"); + } + + return this; + } + + public override string ToString() => string.Join(' ', Arguments); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs new file mode 100644 index 000000000..4eb49996d --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Configurations; + +public class DaprRuntimeOptions +{ + [JsonPropertyName("appId")] + public string AppId { get; set; } = default!; + + [JsonPropertyName("httpPort")] + public ushort HttpPort { get; set; } = default!; + + [JsonPropertyName("grpcPort")] + public ushort GrpcPort { get; set; } = default!; + + [JsonPropertyName("appPort")] + public ushort AppPort { get; set; } = default!; + + [JsonPropertyName("metricsEnabled")] + public bool MetricsEnabled { get; set; } = default!; + + [JsonPropertyName("command")] + public string Command { get; set; } = default!; + + [JsonPropertyName("pid")] + public int PId { get; set; } = default!; +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprExtensions.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprExtensions.cs new file mode 100644 index 000000000..248d977db --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprExtensions.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public static class DaprExtensions +{ + public static string DefaultAppId => ((Assembly.GetEntryAssembly() ?? Assembly.GetCallingAssembly()).GetName().Name ?? + throw new NotSupportedException("dapr appid is not empty")).Replace(".", Const.DEFAULT_APPID_DELIMITER); + + /// + /// Appid suffix, the default is the current MAC address + /// + public static readonly string DefaultAppidSuffix = NetworkUtils.GetPhysicalAddress(); + + /// + /// Get dapr AppId by appid and suffix + /// + /// custom appId + /// appid suffix, When appidSuffix is empty, Dapr appId is custom appId, When appidSuffix is null, appidSuffix is MAC address, default: null + /// separator used to splice custom appId and appIdSuffix, default: - + /// + /// + public static string GetAppId(string appId, string? appidSuffix = null, string appIdDelimiter = Const.DEFAULT_APPID_DELIMITER) + { + ArgumentNullException.ThrowIfNull(appIdDelimiter, nameof(appIdDelimiter)); + + if (appidSuffix == null) + appidSuffix = DefaultAppidSuffix; + else if (appidSuffix.Trim() == string.Empty) + return appId; + + return GetAppIdCore(appId, appidSuffix, appIdDelimiter); + } + + private static string GetAppIdCore(string appId, string appidSuffix, string appIdDelimiter) + { + if (appIdDelimiter == ".") + throw new NotSupportedException("AppIdDelimiter is not supported as ."); + + return $"{appId}{appIdDelimiter}{appidSuffix}"; + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprOptions.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprOptions.cs new file mode 100644 index 000000000..903ec4e5a --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprOptions.cs @@ -0,0 +1,283 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +/// +/// dapr startup configuration information +/// When the specified attribute is configured as null, the default value of the parameter is subject to the default value of dapr of the current version +/// +public class DaprOptions +{ + private string _appid = DaprExtensions.DefaultAppId; + + /// + /// The id for your application, used for service discovery + /// Required, no blanks allowed + /// + public string AppId + { + get => _appid; + set + { + ArgumentNullException.ThrowIfNull(value, nameof(AppId)); + + _appid = value; + } + } + + private string _appIdDelimiter = Const.DEFAULT_APPID_DELIMITER; + + /// + /// Separator used to splice AppId and AppIdSuffix + /// default:- , AppIdDelimiter not support . + /// + public string AppIdDelimiter + { + get => _appIdDelimiter; + set + { + if (value == ".") + { + throw new NotSupportedException("AppIdDelimiter is not supported as ."); + } + + _appIdDelimiter = value; + } + } + + private string _appIdSuffix = DaprExtensions.DefaultAppidSuffix; + + /// + /// Appid suffix + /// optional. the default is the current MAC address + /// + public string AppIdSuffix + { + get => _appIdSuffix; + set + { + if (value == ".") + { + throw new NotSupportedException("AppIdSuffix is not supported as ."); + } + + _appIdSuffix = value; + } + } + + private int? _maxConcurrency; + + /// + /// The concurrency level of the application, otherwise is unlimited + /// + public int? MaxConcurrency + { + get => _maxConcurrency; + set + { + if (value is <= 0) + { + throw new NotSupportedException($"{nameof(MaxConcurrency)} must be greater than 0 ."); + } + + _maxConcurrency = value; + } + } + + private ushort? _appPort; + + /// + /// The port your application is listening on + /// + public ushort? AppPort + { + get => _appPort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(AppPort)} must be greater than 0 ."); + + _appPort = value; + } + } + + /// + /// The protocol (gRPC or HTTP) Dapr uses to talk to the application. Valid values are: http or grpc + /// + public Protocol? AppProtocol { get; set; } + + /// + /// Enable https when Dapr invokes the application + /// + public bool? EnableSsl { get; set; } + + /// + /// Dapr configuration file + /// default: + /// Linux & Mac: $HOME/.dapr/config.yaml + /// Windows: %USERPROFILE%\.dapr\config.yaml + /// + public string? Config { get; set; } + + /// + /// The path for components directory + /// default: + /// Linux & Mac: $HOME/.dapr/components + /// Windows: %USERPROFILE%\.dapr\components + /// + public string? ComponentPath { get; set; } + + private ushort? _daprGrpcPort; + + /// + /// The gRPC port for Dapr to listen on + /// + public ushort? DaprGrpcPort + { + get => _daprGrpcPort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(DaprGrpcPort)} must be greater than 0 ."); + + _daprGrpcPort = value; + } + } + + private ushort? _daprHttpPort; + + /// + /// The HTTP port for Dapr to listen on + /// + public ushort? DaprHttpPort + { + get => _daprHttpPort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(DaprHttpPort)} must be greater than 0 ."); + + _daprHttpPort = value; + } + } + + /// + /// Enable pprof profiling via an HTTP endpoint + /// + public bool? EnableProfiling { get; set; } + + /// + /// The image to build the code in. Input is: repository/image + /// + public string? Image { get; set; } + + /// + /// The log verbosity. Valid values are: debug, info, warn, error, fatal, or panic + /// default: info + /// + public LogLevel? LogLevel { get; set; } + + /// + /// default: localhost + /// + public string? PlacementHostAddress { get; set; } + + /// + /// Address for the Sentry CA service + /// + public string? SentryAddress { get; set; } + + private ushort? _metricsPort; + + /// + /// The port that Dapr sends its metrics information to + /// + public ushort? MetricsPort + { + get => _metricsPort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(MetricsPort)} must be greater than 0 ."); + + _metricsPort = value; + } + } + + private ushort? _profilePort; + + /// + /// The port for the profile server to listen on + /// + public ushort? ProfilePort + { + get => _profilePort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(ProfilePort)} must be greater than 0 ."); + + _profilePort = value; + } + } + + /// + /// Path to a unix domain socket dir mount. If specified + /// communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports + /// Not available on Windows OS + /// + public string? UnixDomainSocket { get; set; } + + private int? _daprMaxRequestSize; + + /// + /// Max size of request body in MB. + /// + public int? DaprMaxRequestSize + { + get => _daprMaxRequestSize; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(DaprMaxRequestSize)} must be greater than 0 ."); + + _daprMaxRequestSize = value; + } + } + + private int _heartBeatInterval = Const.DEFAULT_HEARTBEAT_INTERVAL; + + /// + /// Heartbeat detection interval, used to detect dapr status + /// default: 5000 ms + /// + public int? HeartBeatInterval + { + get => _heartBeatInterval; + set + { + if (value < 0) + throw new NotSupportedException($"{nameof(DaprMaxRequestSize)} must be greater than or equal to 0 ."); + + _heartBeatInterval = value ?? Const.DEFAULT_HEARTBEAT_INTERVAL; + } + } + + /// + /// Start the heartbeat check to ensure that the dapr program is active. + /// When the heartbeat check is turned off, dapr will not start automatically after it exits abnormally. + /// + public bool EnableHeartBeat { get; set; } = true; + + public bool CreateNoWindow { get; set; } = true; + + public string GetAppId() => DaprExtensions.GetAppId(AppId, AppIdSuffix, AppIdDelimiter); + + public ushort GetAppPort() => + AppPort ?? throw new ArgumentNullException(nameof(AppPort)); + + public event DaprEventHandler? OutputDataReceived; + + public void Output(string type, string data) => OutputDataReceived?.Invoke(type, data); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProcess.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProcess.cs new file mode 100644 index 000000000..7545b752b --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProcess.cs @@ -0,0 +1,351 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public class DaprProcess : IDaprProcess +{ + private readonly object _lock = new(); + + private readonly IDaprProvider _daprProvider; + private readonly IProcessProvider _processProvider; + private readonly ILoggerFactory? _loggerFactory; + private readonly ILogger? _logger; + private IProcess? _process; + private DaprProcessStatus Status { get; set; } + private System.Timers.Timer? _heartBeatTimer; + private DaprCoreOptions? _successDaprOptions; + private int _retryTime; + + /// + /// record whether dapr is initialized for the first time + /// + private bool _isFirst = true; + + public DaprProcess(IDaprProvider daprProvider, IProcessProvider processProvider, ILoggerFactory? loggerFactory) + { + _daprProvider = daprProvider; + _processProvider = processProvider; + _loggerFactory = loggerFactory; + _logger = _loggerFactory?.CreateLogger(); + } + + public void Start(DaprOptions options, CancellationToken cancellationToken = default) + { + lock (_lock) + { + StartCore(GetDaprOptions(options), cancellationToken); + } + } + + private void StartCore(DaprCoreOptions options, CancellationToken cancellationToken = default) + { + UpdateStatus(DaprProcessStatus.Starting); + var commandLineBuilder = Initialize(options, cancellationToken); + StopCore(_successDaprOptions, cancellationToken); + + var utils = new ProcessUtils(_loggerFactory); + + utils.OutputDataReceived += delegate(object? sender, DataReceivedEventArgs args) + { + if (_isFirst) + { + CompleteDaprOptions(options, () => _isFirst = false); + } + DaprProcess_OutputDataReceived(sender, args); + }; + utils.ErrorDataReceived += DaprProcess_ErrorDataReceived; + utils.Exit += delegate + { + UpdateStatus(DaprProcessStatus.Stopped); + _logger?.LogDebug("{Name} process has exited", Const.DEFAULT_FILE_NAME); + }; + _retryTime = 0; + var process = utils.Run(Const.DEFAULT_FILE_NAME, $"run {commandLineBuilder}", options.CreateNoWindow); + _process = new SystemProcess(process); + if (_heartBeatTimer == null && options.EnableHeartBeat) + { + _heartBeatTimer = new System.Timers.Timer + { + AutoReset = true, + Interval = options.HeartBeatInterval + }; + _heartBeatTimer.Elapsed += (sender, args) => HeartBeat(cancellationToken); + _heartBeatTimer.Start(); + } + } + + private static void DaprProcess_OutputDataReceived(object? sender, DataReceivedEventArgs e) + { + if (e.Data == null) return; + + var dataSpan = e.Data.AsSpan(); + var levelStartIndex = e.Data.IndexOf("level=", StringComparison.Ordinal) + 6; + var level = "information"; + if (levelStartIndex > 5) + { + var levelLength = dataSpan.Slice(levelStartIndex).IndexOf(' '); + level = dataSpan.Slice(levelStartIndex, levelLength).ToString(); + } + + var color = Console.ForegroundColor; + switch (level) + { + case "warning": + Console.ForegroundColor = ConsoleColor.Yellow; + break; + case "error": + case "critical": + case "fatal": + Console.ForegroundColor = ConsoleColor.Red; + break; + default: + break; + } + + Console.WriteLine(e.Data); + Console.ForegroundColor = color; + } + + private static void DaprProcess_ErrorDataReceived(object? sender, DataReceivedEventArgs e) + { + if (e.Data == null) return; + + var color = Console.ForegroundColor; + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine(e.Data); + Console.ForegroundColor = color; + } + + public void Stop(CancellationToken cancellationToken = default) + { + lock (_lock) + { + StopCore(_successDaprOptions, cancellationToken); + } + } + + private void StopCore(DaprCoreOptions? options, CancellationToken cancellationToken = default) + { + _process?.Kill(); + if (options != null) + { + List daprList = _daprProvider.GetDaprList(options.AppId); + if (daprList.Any()) + { + foreach (var dapr in daprList) + { + _process = _processProvider.GetProcess(dapr.PId); + _process.Kill(); + } + } + if (options.DaprHttpPort != null) + CheckPortAndKill(options.DaprHttpPort.Value); + if (options.DaprGrpcPort != null) + CheckPortAndKill(options.DaprGrpcPort.Value); + } + } + + /// + /// Refresh the dapr configuration, the source dapr process will be killed and the new dapr process will be restarted + /// todo: At present, there are no restrictions on HttpPort and GrpcPort, but if the configuration update changes HttpPort and GrpcPort, the port obtained by DaprClient will be inconsistent with the actual operation, which needs to be adjusted later. + /// + /// + /// + public void Refresh(DaprOptions options, CancellationToken cancellationToken = default) + { + lock (_lock) + { + _logger?.LogDebug("Dapr configuration refresh, appid is {appid}, please wait...", _successDaprOptions!.AppId); + + if (_successDaprOptions != null) + { + UpdateStatus(DaprProcessStatus.Restarting); + _logger?.LogDebug("Dapr configuration refresh, appid is {appid}, closing dapr, please wait...", + _successDaprOptions!.AppId); + StopCore(_successDaprOptions, cancellationToken); + } + + _isFirst = true; + _successDaprOptions = null; + _process = null; + _logger?.LogDebug("Dapr configuration refresh, appid is {appid}, restarting dapr, please wait...", options.AppId); + StartCore(GetDaprOptions(options), cancellationToken); + } + } + + private void CheckPortAndKill(ushort port) + { + if (!_processProvider.IsAvailablePorts(port)) + { + var pIdList = _processProvider.GetPidByPort(port); + foreach (var pId in pIdList) + { + var process = _processProvider.GetProcess(pId); + _logger?.LogWarning("Port {Port} is used, PId: {PId}, PName: {PName} , Process has been killed by {Name}", + port, + pId, + process.Name, + nameof(Dapr)); + process.Kill(); + } + } + } + + private void HeartBeat(CancellationToken cancellationToken) + { + lock (_lock) + { + if (!_daprProvider.IsExist(_successDaprOptions!.AppId)) + { + if (Status == DaprProcessStatus.Started || Status == DaprProcessStatus.Stopped) + { + _logger?.LogWarning("Dapr stopped, restarting, please wait..."); + StartCore(_successDaprOptions, cancellationToken); + } + else if (Status == DaprProcessStatus.Starting) + { + if (_retryTime < Const.DEFAULT_RETRY_TIME) + { + _retryTime++; + _logger?.LogDebug("Dapr is not started: The {retries}th heartbeat check. AppId is {AppId}", + _retryTime, + _successDaprOptions.AppId); + } + else + { + _logger?.LogWarning( + "Dapr is not started: The {retries}th heartbeat check. Dapr stopped, restarting, please wait...", + _retryTime + 1); + StartCore(_successDaprOptions, cancellationToken); + } + } + else + { + _logger?.LogWarning("Dapr is restarting, the current state is {State}, please wait...", Status); + } + } + else + { + _retryTime = 0; + UpdateStatus(DaprProcessStatus.Started); + } + } + } + + private DaprCoreOptions GetDaprOptions(DaprOptions options) + { + string appId = options.GetAppId(); + ushort appPort = options.GetAppPort(); + DaprCoreOptions dataOptions = new( + appId, + appPort, + options.AppProtocol, + options.EnableSsl, + options.DaprGrpcPort, + options.DaprHttpPort, + options.EnableHeartBeat, + options.HeartBeatInterval!.Value, + options.CreateNoWindow) + { + MaxConcurrency = options.MaxConcurrency, + Config = options.Config, + ComponentPath = options.ComponentPath, + EnableProfiling = options.EnableProfiling, + Image = options.Image, + LogLevel = options.LogLevel, + PlacementHostAddress = options.PlacementHostAddress, + SentryAddress = options.PlacementHostAddress, + MetricsPort = options.MetricsPort, + ProfilePort = options.ProfilePort, + UnixDomainSocket = options.UnixDomainSocket, + DaprMaxRequestSize = options.DaprMaxRequestSize + }; + dataOptions.OutputDataReceived += options.Output; + return dataOptions; + } + + private CommandLineBuilder Initialize(DaprCoreOptions options, CancellationToken cancellationToken) + { + var commandLineBuilder = new CommandLineBuilder(Const.DEFAULT_ARGUMENT_PREFIX); + commandLineBuilder + .Add("app-id", options.AppId) + .Add("app-port", options.AppPort.ToString()) + .Add("app-protocol", options.AppProtocol?.ToString().ToLower() ?? string.Empty, options.AppProtocol == null) + .Add("app-ssl", options.EnableSsl?.ToString().ToLower() ?? "", options.EnableSsl == null) + .Add("components-path", options.ComponentPath ?? string.Empty, options.ComponentPath == null) + .Add("app-max-concurrency", options.MaxConcurrency?.ToString() ?? string.Empty, options.MaxConcurrency == null) + .Add("config", options.Config ?? string.Empty, options.Config == null) + .Add("dapr-grpc-port", options.DaprGrpcPort?.ToString() ?? string.Empty, options.DaprGrpcPort == null) + .Add("dapr-http-port", options.DaprHttpPort?.ToString() ?? string.Empty, options.DaprHttpPort == null) + .Add("enable-profiling", options.EnableProfiling?.ToString().ToLower() ?? string.Empty, options.EnableProfiling == null) + .Add("image", options.Image ?? string.Empty, options.Image == null) + .Add("log-level", options.LogLevel?.ToString().ToLower() ?? string.Empty, options.LogLevel == null) + .Add("placement-host-address", options.PlacementHostAddress ?? string.Empty, options.PlacementHostAddress == null) + .Add("sentry-address", options.SentryAddress ?? string.Empty, options.SentryAddress == null) + .Add("metrics-port", options.MetricsPort?.ToString() ?? string.Empty, options.MetricsPort == null) + .Add("profile-port", options.ProfilePort?.ToString() ?? string.Empty, options.ProfilePort == null) + .Add("unix-domain-socket", options.UnixDomainSocket ?? string.Empty, options.UnixDomainSocket == null) + .Add("dapr-http-max-request-size", options.DaprMaxRequestSize?.ToString() ?? string.Empty, options.DaprMaxRequestSize == null); + + _successDaprOptions ??= options; + return commandLineBuilder; + } + + /// + /// Improve the information of HttpPort and GrpcPort successfully configured. + /// When Port is specified or Dapr is closed for other reasons after startup, the HttpPort and GrpcPort are the same as the Port assigned at the first startup. + /// + private void CompleteDaprOptions(DaprCoreOptions options, Action action) + { + int retry = 0; + if (_successDaprOptions!.DaprHttpPort == null || _successDaprOptions.DaprGrpcPort == null) + { + again: + var daprList = _daprProvider.GetDaprList(_successDaprOptions.AppId); + if (daprList.Any()) + { + var currentDapr = daprList.FirstOrDefault()!; + _successDaprOptions.SetPort(currentDapr.HttpPort, currentDapr.GrpcPort); + } + else + { + if (retry < 3) + { + retry++; + goto again; + } + _logger?.LogWarning("Dapr failed to start, appid is {Appid}", _successDaprOptions!.AppId); + return; + } + } + + string daprHttpPort = _successDaprOptions.DaprHttpPort.ToString()!; + string daprGrpcPort = _successDaprOptions.DaprGrpcPort.ToString()!; + CompleteDaprEnvironment(daprHttpPort, daprGrpcPort, out bool isChange); + action.Invoke(); + if (isChange) + { + options.Output(Const.CHANGE_DAPR_ENVIRONMENT_VARIABLE, + $"update environment variables, DaprHttpPort: {daprHttpPort}, DAPR_GRPC_PORT: {daprGrpcPort}"); + } + } + + private void UpdateStatus(DaprProcessStatus status) + { + if (status != Status) + { + _logger?.LogDebug($"Dapr Process Status Change: {Status} -> {status}"); + Status = status; + } + } + + private static void CompleteDaprEnvironment(string daprHttpPort, string daprGrpcPort, out bool isChange) + { + EnvironmentExtensions.TryAdd("DAPR_GRPC_PORT", () => daprGrpcPort, out bool gRpcPortIsExist); + EnvironmentExtensions.TryAdd("DAPR_HTTP_PORT", () => daprHttpPort, out bool httpPortIsExist); + isChange = !gRpcPortIsExist || !httpPortIsExist; + } + + public void Dispose() => Stop(); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProvider.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProvider.cs new file mode 100644 index 000000000..dffa9f5ce --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProvider.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public class DaprProvider : IDaprProvider +{ + private readonly ILogger? _logger; + private ProcessUtils _processUtils; + + public DaprProvider(ILoggerFactory? loggerFactory) + { + _logger = loggerFactory?.CreateLogger(); + _processUtils = new ProcessUtils(loggerFactory); + } + + public List GetDaprList(string appId) + { + _processUtils.Exit += delegate + { + _logger?.LogDebug("{Name} process has exited", Const.DEFAULT_FILE_NAME); + }; + _processUtils.Run(Const.DEFAULT_FILE_NAME, "list -o json", out string response, true, true); + List daprList = new(); + try + { + if (response.StartsWith("[")) + { + daprList = System.Text.Json.JsonSerializer.Deserialize>(response) ?? new(); + } + else if (response.StartsWith("{")) + { + var option = System.Text.Json.JsonSerializer.Deserialize(response); + if (option != null) + { + daprList.Add(option); + } + } + else + { + _logger?.LogWarning("----- Failed to get currently running dapr"); + } + } + catch (Exception exception) + { + _logger?.LogWarning(exception, "----- Error getting list of running dapr, response message is {response}", response); + return new List(); + } + return daprList.Where(dapr => dapr.AppId == appId).ToList(); + } + + public bool IsExist(string appId) + { + return GetDaprList(appId).Any(); + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs new file mode 100644 index 000000000..80b10cccf --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public static class EnvironmentExtensions +{ + public static void TryAdd(string environment, Func func, out bool isExist) + { + var value = Environment.GetEnvironmentVariable(environment); + isExist = value == null; + if (isExist) + { + Environment.SetEnvironmentVariable(environment, func.Invoke()); + } + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProcess.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProcess.cs new file mode 100644 index 000000000..8f54fe5b2 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProcess.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public interface IDaprProcess : IDisposable +{ + void Start(DaprOptions options, CancellationToken cancellationToken = default); + + void Stop(CancellationToken cancellationToken = default); + + /// + /// Refresh the dapr configuration, the source dapr process will be killed and the new dapr process will be restarted + /// + /// + /// + void Refresh(DaprOptions options, CancellationToken cancellationToken = default); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProvider.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProvider.cs new file mode 100644 index 000000000..e7d2a1e2f --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProvider.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public interface IDaprProvider +{ + List GetDaprList(string appId); + + bool IsExist(string appId); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs new file mode 100644 index 000000000..5ce5e4294 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs @@ -0,0 +1,55 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +public class CommandArgumentBuilder +{ + private const string DEFAULT_ARGUMENT_SEPARATOR = " "; + private const string DEFAULT_ARGUMENT_PREFIX = "--"; + + private Dictionary _arguments = new(); + + public string ArgumemtPrefix { get; } + + private string _argumentSeparator = default!; + + public string ArgumentSeparator + { + get => _argumentSeparator; + set => _argumentSeparator = string.IsNullOrEmpty(value) ? DEFAULT_ARGUMENT_SEPARATOR : value; + } + + public CommandArgumentBuilder(string? argumentPrefix = null) + { + ArgumemtPrefix = string.IsNullOrEmpty(argumentPrefix) ? DEFAULT_ARGUMENT_PREFIX : argumentPrefix; + ArgumentSeparator = DEFAULT_ARGUMENT_SEPARATOR; + } + + public CommandArgumentBuilder Add(string name, object? value = null) + { + if (value == null || string.IsNullOrEmpty(name)) + { + return this; + } + + if (_arguments.ContainsKey(name)) + { + _arguments.Remove(name); + } + + _arguments.Add(name, value.ToString() ?? ""); + return this; + } + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + foreach (var item in _arguments) + { + stringBuilder.Append($"{ArgumentSeparator}{ArgumemtPrefix}{item.Key}{ArgumentSeparator}{item.Value}"); + } + + return stringBuilder.ToString(); + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/Const.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/Const.cs new file mode 100644 index 000000000..f6c7e5376 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/Const.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +internal class Const +{ + public const string DEFAULT_APPID_DELIMITER = "-"; + + public const string DEFAULT_FILE_NAME = "dapr"; + + public const string DEFAULT_ARGUMENT_PREFIX = "--"; + + /// + /// Heartbeat detection interval, used to detect dapr status + /// + public const int DEFAULT_HEARTBEAT_INTERVAL = 5000; + + /// + /// Default number of retries + /// + public const int DEFAULT_RETRY_TIME = 10; + + /// + /// Change the dapr environment variable + /// + public const string CHANGE_DAPR_ENVIRONMENT_VARIABLE = "DAPR_CHANGE_ENVIRONMENT_VARIABLE"; +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs new file mode 100644 index 000000000..74e9fcc83 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs @@ -0,0 +1,145 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +internal class DaprCoreOptions +{ + /// + /// The id for your application, used for service discovery + /// Required, no blanks allowed + /// + public string AppId { get; } + + /// + /// The port your application is listening on + /// + public ushort AppPort { get; } + + /// + /// The protocol (gRPC or HTTP) Dapr uses to talk to the application. Valid values are: http or grpc + /// + public Protocol? AppProtocol { get; } + + /// + /// Enable https when Dapr invokes the application + /// + public bool? EnableSsl { get; } + + /// + /// The gRPC port for Dapr to listen on + /// + public ushort? DaprGrpcPort { get; private set; } + + /// + /// The HTTP port for Dapr to listen on + /// + public ushort? DaprHttpPort { get; private set; } + + public bool EnableHeartBeat { get; private set; } + + public int HeartBeatInterval { get; } + + public bool CreateNoWindow { get; } = true; + + /// + /// The concurrency level of the application, otherwise is unlimited + /// + public int? MaxConcurrency { get; set; } + + /// + /// Dapr configuration file + /// default: + /// Linux & Mac: $HOME/.dapr/config.yaml + /// Windows: %USERPROFILE%\.dapr\config.yaml + /// + public string? Config { get; set; } + + /// + /// The path for components directory + /// default: + /// Linux & Mac: $HOME/.dapr/components + /// Windows: %USERPROFILE%\.dapr\components + /// + public string? ComponentPath { get; set; } + + /// + /// Enable pprof profiling via an HTTP endpoint + /// + public bool? EnableProfiling { get; set; } + + /// + /// The image to build the code in. Input is: repository/image + /// + public string? Image { get; set; } + + /// + /// The log verbosity. Valid values are: debug, info, warn, error, fatal, or panic + /// default: info + /// + public LogLevel? LogLevel { get; set; } + + /// + /// default: localhost + /// + public string? PlacementHostAddress { get; set; } + + /// + /// Address for the Sentry CA service + /// + public string? SentryAddress { get; set; } + + /// + /// The port that Dapr sends its metrics information to + /// + public ushort? MetricsPort { get; set; } + + /// + /// The port for the profile server to listen on + /// + public ushort? ProfilePort { get; set; } + + /// + /// Path to a unix domain socket dir mount. If specified + /// communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports + /// Not available on Windows OS + /// + public string? UnixDomainSocket { get; set; } + + /// + /// Max size of request body in MB. + /// + public int? DaprMaxRequestSize { get; set; } + + public event DaprEventHandler? OutputDataReceived; + + public DaprCoreOptions( + string appId, + ushort appPort, + Protocol? appProtocol, + bool? enableSsl, + ushort? daprGrpcPort, + ushort? daprHttpPort, + bool enableHeartBeat, + int heartBeatInterval, + bool createNoWindow) + { + AppId = appId; + AppPort = appPort; + AppProtocol = appProtocol; + EnableSsl = enableSsl; + DaprGrpcPort = daprGrpcPort; + DaprHttpPort = daprHttpPort; + EnableHeartBeat = enableHeartBeat; + HeartBeatInterval = heartBeatInterval; + CreateNoWindow = createNoWindow; + } + + public void SetPort(ushort httpPort, ushort rpcPort) + { + DaprHttpPort ??= httpPort; + DaprGrpcPort ??= rpcPort; + } + + public void Output(string type, string data) => OutputDataReceived?.Invoke(type, data); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs new file mode 100644 index 000000000..c4f29c0d0 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +public enum DaprProcessStatus +{ + Starting = 1, + Started, + Stopping, + Stopped, + Restarting +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs new file mode 100644 index 000000000..0442234cd --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +internal class NetworkUtils +{ + public static string GetPhysicalAddress() + { + var firstMacAddress = NetworkInterface + .GetAllNetworkInterfaces() + .Where(nic => nic.OperationalStatus == OperationalStatus.Up && nic.NetworkInterfaceType != NetworkInterfaceType.Loopback) + .Select(nic => nic.GetPhysicalAddress().ToString()) + .FirstOrDefault(); + + return firstMacAddress ?? string.Empty; + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs new file mode 100644 index 000000000..200341906 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs @@ -0,0 +1,107 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +internal class ProcessUtils +{ + private readonly ILogger? _logger; + + public ProcessUtils(ILoggerFactory? loggerFactory = null) + { + _logger = loggerFactory?.CreateLogger(); + } + + public System.Diagnostics.Process Run( + string fileName, + string arguments, + bool createNoWindow = true, + bool isWait = false) + => Run(fileName, arguments, out string _, createNoWindow, isWait); + + public System.Diagnostics.Process Run( + string fileName, + string arguments, + out string response, + bool createNoWindow = true, + bool isWait = false) + { + _logger?.LogDebug("FileName: {FileName}, Arguments: {Arguments}", fileName, arguments); + var processStartInfo = new ProcessStartInfo + { + FileName = fileName, + Arguments = arguments, + UseShellExecute = !createNoWindow, + CreateNoWindow = createNoWindow + }; + var daprProcess = new System.Diagnostics.Process() + { + StartInfo = processStartInfo, + }; + if (createNoWindow) + { + processStartInfo.RedirectStandardInput = true; + processStartInfo.RedirectStandardError = true; + processStartInfo.RedirectStandardOutput = true; + + if (!isWait) + { + daprProcess.OutputDataReceived += (_, args) => OnOutputDataReceived(args); + daprProcess.ErrorDataReceived += (_, args) => OnErrorDataReceived(args); + } + } + daprProcess.Start(); + if (createNoWindow && !isWait) + { + daprProcess.BeginOutputReadLine(); + daprProcess.BeginErrorReadLine(); + } + daprProcess.Exited += (_, _) => OnExited(); + string command = $"{fileName} {arguments}"; + _logger?.LogDebug("Process: {ProcessName}, Command: {Command}, PID: {ProcessId} executed successfully", fileName, + command, daprProcess.Id); + + if (isWait) + { + response = daprProcess.StandardOutput.ReadToEnd(); + daprProcess.WaitForExit(); + } + else + { + response = string.Empty; + } + return daprProcess; + } + + public event EventHandler OutputDataReceived = default!; + + public event EventHandler? ErrorDataReceived; + + public event EventHandler Exit = default!; + + protected virtual void OnOutputDataReceived(DataReceivedEventArgs args) + { + try + { + OutputDataReceived(this, args); + } + catch (Exception ex) + { + _logger?.LogError("ProcessUtils: error in output information ", ex); + } + } + + protected virtual void OnErrorDataReceived(DataReceivedEventArgs args) + { + try + { + ErrorDataReceived?.Invoke(this, args); + } + catch (Exception ex) + { + _logger?.LogError("execution error", ex); + } + } + + protected virtual void OnExited() => Exit(this, EventArgs.Empty); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/LogLevel.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/LogLevel.cs new file mode 100644 index 000000000..a47b5c2e0 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/LogLevel.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public enum LogLevel +{ + Debug = 1, + Info, + Warn, + Error, + Fatal, + Panic +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj new file mode 100644 index 000000000..4fd57bf4d --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcess.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcess.cs new file mode 100644 index 000000000..b0ace3f57 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcess.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Process; + +public interface IProcess +{ + int PId { get; } + + public string Name { get; } + + void Kill(); + + bool Start(); + + void WaitForExit(int? milliseconds = null); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs new file mode 100644 index 000000000..779ba3995 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Process; + +public interface IProcessProvider +{ + /// + /// Get process collection based on process name + /// + /// + /// Process collection + IEnumerable GetProcesses(string processName); + + IProcess GetProcess(int pId); + + /// + /// get available ports + /// + /// Minimum port (includes minimum port), default: 0 + /// Maximum ports (including maximum ports), default: 65535 + /// + int GetAvailablePorts(ushort? minPort = null, ushort? maxPort = null); + + /// + /// Is the port available + /// + /// + /// + bool IsAvailablePorts(ushort port); + + List GetPidByPort(ushort port); +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs new file mode 100644 index 000000000..8acca69f4 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs @@ -0,0 +1,181 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Process; + +public class ProcessProvider : IProcessProvider +{ + private readonly ILogger? _logger; + + public ProcessProvider(ILoggerFactory loggerFactory) + { + _logger = loggerFactory.CreateLogger(); + } + + /// + /// Get process collection based on process name + /// + /// + /// + public IEnumerable GetProcesses(string processName) + => System.Diagnostics.Process.GetProcessesByName(processName).Select(process => new SystemProcess(process)); + + public IProcess GetProcess(int pId) + => new SystemProcess(System.Diagnostics.Process.GetProcessById(pId)); + + /// + /// get available ports + /// + /// Minimum port (includes minimum port), default: 0 + /// Maximum ports (including maximum ports), default: 65535 + /// + public int GetAvailablePorts(ushort? minPort = null, ushort? maxPort = null) + { + minPort ??= ushort.MinValue; + maxPort ??= ushort.MaxValue; + var usePorts = GetPortsByUsed(); + + var effectivePorts = Enumerable.Range(minPort.Value, maxPort.Value).Except(usePorts).ToList(); + if (effectivePorts.Count == 0) + throw new Exception("... No port available exception"); + + return effectivePorts.FirstOrDefault(); + } + + /// + /// Is the port available + /// + /// + /// + public bool IsAvailablePorts(ushort port) + => !GetPortsByUsed().Contains(port); + + public List GetPidByPort(ushort port) + { + List pIdList = new(); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + List output = GetResponse("netstat", $"-a -n -o", "\r\n"); + + foreach (var line in output) + { + if (line.Trim().StartsWith("Proto") || line.Trim().StartsWith("协议")) + continue; + + var parts = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + var len = parts.Length; + if (len > 2) + { + var pId = int.Parse(parts[len - 1].Split('/')[0]); + if (int.Parse(parts[1].Split(':').Last()) == port && !pIdList.Contains(pId)) + { + pIdList.Add(pId); + } + } + } + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + List output = GetResponse("netstat", $"-tunlp", "\n"); + + Console.WriteLine("result: " + output.Count); + Console.WriteLine("result2: " + System.Text.Json.JsonSerializer.Serialize(output)); + foreach (var line in output) + { + Console.WriteLine("line: " + line); + if (!line.Trim().StartsWith("tcp", StringComparison.OrdinalIgnoreCase) && + !line.Trim().StartsWith("udp", StringComparison.OrdinalIgnoreCase)) + continue; + + var parts = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + var len = parts.Length; + if (len > 2) + { + var pId = int.Parse(parts[GetIndex(parts, "LISTEN") + 1].Split('/')[0]); + if (int.Parse(parts[3].Split(':').Last()) == port && !pIdList.Contains(pId)) + { + pIdList.Add(pId); + } + } + } + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + List output = GetResponse("lsof", $"-nP -iTCP -sTCP:LISTEN", "\n"); + + Console.WriteLine("result: " + output.Count); + Console.WriteLine("result2: " + System.Text.Json.JsonSerializer.Serialize(output)); + foreach (var line in output) + { + Console.WriteLine("line: " + line); + if (line.Trim().StartsWith("COMMAND", StringComparison.OrdinalIgnoreCase)) + continue; + + var parts = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + var len = parts.Length; + if (len > 2) + { + var pId = int.Parse(parts[1]); + if (int.Parse(parts[parts.Length - 2].Split(':').Last()) == port && !pIdList.Contains(pId)) + { + pIdList.Add(pId); + } + } + } + } + else + { + _logger?.LogError("unsupported operating system"); + } + return pIdList.Where(pid => pid > 0).ToList(); + } + + private int GetIndex(string[] array, string content) + { + for (var index = 0; index < array.Length; index++) + { + if (array[index].Equals(content, StringComparison.OrdinalIgnoreCase)) + return index; + } + return 0; + } + + private List GetResponse(string fileName, string arguments, string pattern) + { + var process = new System.Diagnostics.Process() + { + StartInfo = new ProcessStartInfo + { + FileName = fileName, + Arguments = arguments, + UseShellExecute = false, + RedirectStandardInput = true, + RedirectStandardOutput = true, + RedirectStandardError = true + } + }; + process.Start(); + + var output = process.StandardOutput.ReadToEnd(); + return Regex.Split(output, pattern).ToList(); + } + + /// + /// get the currently used port + /// + /// Port set that has been used + private IEnumerable GetPortsByUsed() + { + var ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); + var connectionEndPoints = ipGlobalProperties.GetActiveTcpConnections().Select(information => information.LocalEndPoint); + var tcpListenerEndPoints = ipGlobalProperties.GetActiveTcpListeners(); + var udpListenerEndPoints = ipGlobalProperties.GetActiveUdpListeners(); + return connectionEndPoints + .Concat(tcpListenerEndPoints) + .Concat(udpListenerEndPoints) + .Select(endPoint => endPoint.Port); + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/SystemProcess.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/SystemProcess.cs new file mode 100644 index 000000000..afea10ba9 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/SystemProcess.cs @@ -0,0 +1,39 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Process; + +public class SystemProcess : IProcess +{ + private readonly System.Diagnostics.Process _process; + + public SystemProcess(System.Diagnostics.Process process) + { + _process = process; + } + + public int PId => IsRun ? _process.Id : 0; + + public string Name => IsRun ? _process.ProcessName : string.Empty; + + public bool IsRun => !_process.HasExited; + + public void Kill() + { + if (IsRun) _process.Kill(); + } + + public bool Start() => _process.Start(); + + public void WaitForExit(int? milliseconds = null) + { + if (milliseconds is > 0) + { + _process.WaitForExit(milliseconds.Value); + } + else if (IsRun) + { + _process.Kill(); + } + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Protocol.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Protocol.cs new file mode 100644 index 000000000..7c4cba425 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/Protocol.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public enum Protocol +{ + Http = 1, + GRpc +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/README.md b/src/Utils/src/Development/Masa.Utils.Development.Dapr/README.md new file mode 100644 index 000000000..630e687a5 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/README.md @@ -0,0 +1,95 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Development.Dapr + +Dapr Starter Core Library + +Responsibilities: + +Provide core support for Masa.Utils.Development.Dapr.AspNetCore + +The start, stop, refresh, and dapr daemon of the dapr process are provided by such libraries + +### Usage: + +1. Install Masa.Utils.Development.Dapr.AspNetCore +``` C# +Install-Package Masa.Utils.Development.Dapr.AspNetCore +``` + +2. Add DaprStarter to assist in managing the dapr process (recommended to be used in the development environment) + +``` C# +builder.Services.AddDaprStarterCore(); +``` + +3. Inject IDaprProcess at the specified location as needed, and then call the Start method to start the dapr process or hand it over to Masa.Utils.Development.Dapr.AspNetCore to manage the dapr process. Related documents can be found at [View](../Masa.Utils.Development.Dapr.AspNetCore/README.md) + +Example: + +New DaprController + +``` C# DaprController.cs +public class DaprController : ControllerBase +{ + private readonly IDaprProcess _daprProcess; + + private readonly DaprOptions _options; + + public DaprController(IDaprProcess daprProcess, IOptions options) + { + _daprProcess = daprProcess; + _options = options.Value; + } + + [HttpGet(Name = "Start")] + public string Start() + { + _daprProcess.Start(_options); + return "start success"; + } + + [HttpGet(Name = "Stop")] + public string Stop() + { + _daprProcess.Stop(); + return "stop success"; + } +} +``` + +## Notice + +1. The netstat command is used in the library, please make sure the netstat command is available + +> Windows system supports netstat command by default without special installation +> +> Linux and OSX need to confirm by themselves whether netstat is installed on the computer + +Open a terminal and enter the following command to confirm that the computer supports the netstat command: + +```` +netstat -h +```` + +Example: ubuntu: + +```` +apt-get install net-tools +```` + +2. AppId, AppIdSuffix strongly recommend not to enter a string containing ., otherwise it will cause problems with the dapr call. It is recommended to use - + 1. Dapr AppID follows the FQDN format, which includes the target namespace + 2. FQDN is spliced with the symbol . + +### Rule + +dapr AppId naming rules default: + +AppId + "-" + AppIdSuffix + +AppId default: Appid.Replace(".","-") + +AppIdSuffix default: network card address + +When AppIdSuffix is empty, the appid of dapr is equal to AppId diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/README.zh-CN.md b/src/Utils/src/Development/Masa.Utils.Development.Dapr/README.zh-CN.md new file mode 100644 index 000000000..022edfaf8 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/README.zh-CN.md @@ -0,0 +1,95 @@ +中 | [EN](README.md) + +## Masa.Utils.Development.Dapr + +Dapr Starter核心库 + +职责: + +为Masa.Utils.Development.Dapr.AspNetCore 提供核心支撑,支持windows、linux、OSX + +dapr进程的启动、停止、刷新、dapr守护进程均由此类库提供 + +### 用法: + +1. 安装Masa.Utils.Development.Dapr.AspNetCore +```C# +Install-Package Masa.Utils.Development.Dapr.AspNetCore +``` + +2. 添加DaprStarter协助管理dapr进程(建议在开发环境使用) + +```C# +builder.Services.AddDaprStarterCore(); +``` + +3. 根据需要在指定位置注入IDaprProcess, 之后调用Start方法即可启动dapr进程或者交由Masa.Utils.Development.Dapr.AspNetCore管理dapr进程,相关文档可[查看](../Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md) + +例如: + +新建DaprController + +``` C# DaprController.cs +public class DaprController : ControllerBase +{ + private readonly IDaprProcess _daprProcess; + + private readonly DaprOptions _options; + + public DaprController(IDaprProcess daprProcess, IOptions options) + { + _daprProcess = daprProcess; + _options = options.Value; + } + + [HttpGet(Name = "Start")] + public string Start() + { + _daprProcess.Start(_options); + return "start success"; + } + + [HttpGet(Name = "Stop")] + public string Stop() + { + _daprProcess.Stop(); + return "stop success"; + } +} +``` + +## 注意 + +1. 库中有使用到netstat命令,请确保netstat命令是可用的 + +> Windows系统默认支持netstat命令无需特殊安装 +> +> Linux与OSX需要自行确认确认电脑是否安装netstat + +打开终端输入以下命令确认电脑支持netstat命令: + +``` +netstat -h +``` + +例:ubuntu: + +``` +apt-get install net-tools +``` + +2. AppId、AppIdSuffix强烈建议不要输入含.的字符串,否则会导致dapr调用出现问题,推荐使用- + 1. Dapr AppID遵循FQDN格式,其中包括目标命名空间 + 2. FQDN是通过符号.来拼接域名的 + +### 规则 + +dapr AppId命名规则默认: + +AppId + "-" + AppIdSuffix + +AppId默认:Appid.Replace(".","-") + +AppIdSuffix默认:网卡地址 + +当AppIdSuffix为空时,dapr的appid等于AppId \ No newline at end of file diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..cc4ba23a5 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public delegate void DaprEventHandler(string type, string data); + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddDaprStarterCore(this IServiceCollection services, Action? action = null) + { + if (action != null) + services.Configure(action); + else + services.Configure(_ => + { + }); + return services.AddDaprStarter(); + } + + public static IServiceCollection AddDaprStarterCore(this IServiceCollection services, IConfiguration configuration) + { + services.Configure(configuration); + return services.AddDaprStarter(); + } + + private static IServiceCollection AddDaprStarter(this IServiceCollection services) + { + if (services.Any(service => service.ImplementationType == typeof(DaprService))) + return services; + + services.AddSingleton(); + + services.TryAddSingleton(typeof(IDaprProcess), typeof(DaprProcess)); + services.TryAddSingleton(typeof(IDaprProvider), typeof(DaprProvider)); + services.TryAddSingleton(typeof(IProcessProvider), typeof(ProcessProvider)); + return services; + } + + private class DaprService + { + + } +} diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/_Imports.cs b/src/Utils/src/Development/Masa.Utils.Development.Dapr/_Imports.cs new file mode 100644 index 000000000..c666c7d32 --- /dev/null +++ b/src/Utils/src/Development/Masa.Utils.Development.Dapr/_Imports.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Development.Dapr; +global using Masa.Utils.Development.Dapr.Configurations; +global using Masa.Utils.Development.Dapr.Internal; +global using Masa.Utils.Development.Dapr.Process; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using System.Diagnostics; +global using System.Net.NetworkInformation; +global using System.Reflection; +global using System.Runtime.InteropServices; +global using System.Text; +global using System.Text.Json.Serialization; +global using System.Text.RegularExpressions; diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs new file mode 100644 index 000000000..def4eca3c --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public abstract class BaseTypeProvider : ITypeProvider +{ + public virtual bool IsAssignableFrom(Type type, Type targetType) + { + if (type.IsGenericType && + type.GetTypeInfo().GenericTypeParameters.Length > 0 && + targetType.IsGenericType && + targetType.GetTypeInfo().GenericTypeParameters.Length > 0) + return targetType.GetInterfaces().Any(t => t.IsGenericType && t.GetGenericTypeDefinition() == type); + + return type.IsAssignableFrom(targetType); + } + + public virtual bool IsAssignableTo(Type type, Type targetType) + => IsAssignableFrom(targetType, type); + + public virtual List GetAllTypes() => GetAllTypes(AppDomain.CurrentDomain.GetAssemblies()); + + public virtual List GetAllTypes(IEnumerable assemblies) + => assemblies.SelectMany(assembly => assembly.GetTypes()).ToList(); + + public abstract List GetServiceDescriptors(List types); +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs new file mode 100644 index 000000000..87974ab8b --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs @@ -0,0 +1,41 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public class DefaultServiceRegister : IServiceRegister +{ + public void Add(IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime) + { + var dependency = implementationType.GetCustomAttribute(); + var descriptor = services.FirstOrDefault(d => d.ServiceType == serviceType); + if (dependency != null) + { + if (descriptor != null) + { + var preDependency = descriptor.ImplementationType?.GetCustomAttribute(); + if (preDependency is { ReplaceServices: true }) + return; + + if (dependency.ReplaceServices || preDependency is { TryRegister: true }) + services.Remove(descriptor); + else if (dependency.TryRegister) + return; + } + } + else + { + if (descriptor != null) + { + var preDependency = descriptor.ImplementationType?.GetCustomAttribute(); + if (preDependency is { ReplaceServices: true }) + return; + + if (preDependency is { TryRegister: true }) + services.Remove(descriptor); + } + } + + services.Add(new ServiceDescriptor(serviceType, implementationType, lifetime)); + } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs new file mode 100644 index 000000000..a715c77cf --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs @@ -0,0 +1,73 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public class DefaultTypeProvider : BaseTypeProvider +{ + public override List GetServiceDescriptors(List types) + => GetServiceDescriptorCore(types, typeof(ISingletonDependency), ServiceLifetime.Singleton) + .Concat(GetServiceDescriptorCore(types, typeof(IScopedDependency), ServiceLifetime.Scoped)) + .Concat(GetServiceDescriptorCore(types, typeof(ITransientDependency), ServiceLifetime.Transient)).ToList(); + + public virtual List GetServiceDescriptorCore(List types, Type type, ServiceLifetime lifetime) + { + List descriptors = new(); + var serviceTypes = GetServiceTypes(types, type); + foreach (var serviceType in serviceTypes) + { + var implementationTypes = GetImplementationTypes(types, serviceType); + foreach (var implementationType in implementationTypes) + { + if (serviceType.IsGenericType && + implementationType.IsGenericType && + serviceType.GetTypeInfo().GenericTypeParameters.Length != implementationType.GetTypeInfo().GenericTypeParameters.Length) + continue; + + descriptors.Add(new ServiceDescriptorOptions(serviceType, implementationType, lifetime, AutoFire(serviceType))); + } + } + + return descriptors; + } + + public virtual bool AutoFire(Type serviceType) + => IsAssignableFrom(typeof(IAutoFireDependency), serviceType); + + public virtual List GetImplementationTypes(List types, Type serviceType) + { + if (serviceType.IsInterface) + return types.Where(t => !t.IsAbstract && t.IsClass && IsAssignableFrom(serviceType, t)).ToList(); + + return new List + { + serviceType + }; + } + + public virtual List GetServiceTypes(List types, Type interfaceType) + { + var interfaceServiceTypes = types.Where(t => t.IsInterface && t != interfaceType && interfaceType.IsAssignableFrom(t)); + return types.Where(type + => IsAssignableFrom(interfaceType, type) && !type.GetInterfaces().Any(t => interfaceServiceTypes.Contains(t)) && + !IsSkip(type)) + .Concat(interfaceServiceTypes) + .ToList(); + } + + public virtual bool IsSkip(Type type) + { + if (type.IsAbstract) + return true; + + var ignoreInjection = type.GetCustomAttribute(); + if (ignoreInjection == null) + return false; + + var inheritIgnoreInjection = type.GetCustomAttribute(false); + if (inheritIgnoreInjection != null) + return true; + + return ignoreInjection.Cascade; + } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs new file mode 100644 index 000000000..422fae267 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +[AttributeUsage(AttributeTargets.Class)] +public class DependencyAttribute : Attribute +{ + /// + /// Attempt to register only if not registered + /// + public virtual bool TryRegister { get; set; } = false; + + /// + /// If the original service is already registered, replace the service registration, if not, register the service to DI + /// + public virtual bool ReplaceServices { get; set; } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs new file mode 100644 index 000000000..b55247fcb --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +/// +/// Automatic trigger injection, After the service is added, it will be obtained once +/// Need to be used with ISingletonDependency, IScopedDependency, ISingletonDependency +/// +public interface IAutoFireDependency +{ +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs new file mode 100644 index 000000000..75d0c6b21 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface IScopedDependency +{ +} + + +public interface ITestService : IScopedDependency + where T : class +{ + +} + +public class TestSerice : ITestService + where T : class +{ + +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs new file mode 100644 index 000000000..0161f094d --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface IServiceRegister +{ + void Add(IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime); +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs new file mode 100644 index 000000000..a995b1f6c --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface ISingletonDependency +{ +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs new file mode 100644 index 000000000..8d894bd06 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface ITransientDependency +{ +} + diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs new file mode 100644 index 000000000..4aa29c856 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface ITypeProvider +{ + bool IsAssignableFrom(Type type, Type targetType); + + bool IsAssignableTo(Type type, Type targetType); + + List GetAllTypes(); + + List GetAllTypes(IEnumerable assemblies); + + List GetServiceDescriptors(List types); +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs new file mode 100644 index 000000000..ab6df6e3b --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] +public class IgnoreInjectionAttribute : Attribute +{ + public bool Cascade { get; set; } + + public IgnoreInjectionAttribute(bool cascade = false) + { + Cascade = cascade; + } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj new file mode 100644 index 000000000..63130ab81 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + Microsoft.Extensions.DependencyInjection + + + + + + + diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs new file mode 100644 index 000000000..59d4b6f8a --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection.Options; + +public class ServiceDescriptorOptions +{ + public Type ServiceType { get; } + + public Type ImplementationType { get; } + + public ServiceLifetime Lifetime { get; } + + public bool AutoFire { get; } + + public ServiceDescriptorOptions(Type serviceType, Type implementationType, ServiceLifetime lifetime, bool autoFire) + { + ServiceType = serviceType; + ImplementationType = implementationType; + Lifetime = lifetime; + AutoFire = autoFire; + } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md new file mode 100644 index 000000000..6ce88603a --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md @@ -0,0 +1,117 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Extensions.DependencyInjection + +### Reference package: + +````c# +Install-Package Masa.Utils.Extensions.DependencyInjection +```` +### Usage: + +````C# +services.AddAutoInject(); +```` + +## Dependent interface: + +* ISingletonDependency: registers a service whose lifecycle is Singleton +* IScopedDependency: registers a service whose lifecycle is Scoped +* ITransientDependency: registers services whose lifecycle is Transient +* IAutoFireDependency: is automatically triggered (used in combination with ISingletonDependency, IScopedDependency, and ITransientDependency to trigger a service acquisition operation after the service is automatically registered, only inheriting IAutoFireDependency does not work) + +Example: + +````c# +public interface IRepository : IScopedDependency + where TEntity : class +{ + +} +```` + +> Because IRepository inherits IScopedDependency, the life cycle of IRepository will be Scoped + +## Rule: + +Scan the interfaces and classes that inherit ISingletonDependency, IScopedDependency, and ITransientDependency in the assembly, and automatically register services for them + +* When inheriting an interface, its ServiceType is the current interface, and its ImplementationType is the implementation class of the current interface + * If the current interface has multiple implementation classes, it will be added multiple times + + ```` C# + public interface IUserService : IScopedDependency + { + + } + + public class UserService : IUserService + { + + } + ```` + > Equivalent to service.AddScoped(); + + * If you want the interface to have only one implementation class, add [Dependency(ReplaceServices = true)] above the implementation class + + ```` C# + public interface IUserService : IScopedDependency + { + + } + + public class UserService : IUserService + { + + } + + [Dependency(ReplaceServices = true)] + public class UserService2 : IUserService + { + + } + ```` + > Equivalent to service.AddScoped(); + +* When the inherited class is not an interface, its ServiceType is the current class, and its ImplementationType is also the current class + * By default, the cascade scan registration service is supported, and subclasses of the current class will also be registered + + ```` C# + public class BaseRepository : ISingletonDependency + { + + } + + /// + /// Abstract classes are not automatically registered + /// + public abstract class CustomizeBaseRepository : ISingletonDependency + { + + } + + public class UserRepository : BaseRepository + { + + } + ```` + + > Equivalent to: `service.AddSingleton();service.AddSingleton();` + +## Features: + +* IgnoreInjection: Ignore injection, used to exclude not being injected automatically +* Dependency: + * TryRegister: Set true to be registered only when the service is not registered, similar to TryAdd of IServiceCollection... extension method + * ReplaceServices: Set true to replace previously registered services, similar to the Replace... extension method of IServiceCollection. + +## Methods: + +* Extend IServiceCollection +* GetInstance(): Get the instance of service T + * Any(): Whether there is a service TService, does not support generic services + * Any(): Whether there is a service whose interface is TService and whose implementation class is TImplementation + * Any(ServiceLifetime.Singleton): Whether there is a service TService with a life cycle of Singleton (generic services are not supported) + * Any(ServiceLifetime.Singleton): Is there an interface whose life cycle is Singleton as TService and is implemented as a TImplementation service (generic services are not supported) + * Replace(typeof(TImplementation), ServiceLifetime.Singleton): Remove the first service with the same service type in the service collection, and add typeof(TImplementation) to the collection, the life cycle is a singleton + * ReplaceAll(typeof(TImplementation), ServiceLifetime.Singleton): Remove all services with the same service type in the service collection, and add typeof(TImplementation) to the collection, the life cycle is a singleton \ No newline at end of file diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md new file mode 100644 index 000000000..e8a324b02 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md @@ -0,0 +1,117 @@ +中 | [EN](README.md) + +## Masa.Utils.Extensions.DependencyInjection + +### 引用包: + +```c# +Install-Package Masa.Utils.Extensions.DependencyInjection +``` +### 用法: + +```C# +services.AddAutoInject(); +``` + +## 依赖接口: + +* ISingletonDependency: 注册生命周期为Singleton的服务 +* IScopedDependency: 注册生命周期为Scoped的服务 +* ITransientDependency: 注册生命周期为Transient的服务 +* IAutoFireDependency: 自动触发(与ISingletonDependency、IScopedDependency、ITransientDependency结合使用,在服务自动注册结束后触发一次获取服务操作,仅继承IAutoFireDependency不起作用) + +示例: + +```c# +public interface IRepository : IScopedDependency + where TEntity : class +{ + +} +``` + +> 因IRepository继承IScopedDependency,所以会将IRepository的生命周期为Scoped + +## 规则: + +扫描程序集中继承ISingletonDependency、IScopedDependency、ITransientDependency的接口以及类,并为其自动注册服务 + +* 当继承的是接口时,其ServiceType是当前接口,其ImplementationType是当前接口的实现类 + * 如果当前接口有多个实现类,会被多次添加 + + ``` C# + public interface IUserService : IScopedDependency + { + + } + + public class UserService : IUserService + { + + } + ``` + > 等价于 service.AddScoped(); + + * 如果希望接口只有一个实现类,则在实现类上方增加[Dependency(ReplaceServices = true)]即可 + + ``` C# + public interface IUserService : IScopedDependency + { + + } + + public class UserService : IUserService + { + + } + + [Dependency(ReplaceServices = true)] + public class UserService2 : IUserService + { + + } + ``` + > 等价于 service.AddScoped(); + +* 当继承的类不是接口时,其ServiceType是当前类,其ImplementationType也是当前类 + * 默认支持级联扫描注册服务,当前类的子类也会被注册 + + ``` C# + public class BaseRepository : ISingletonDependency + { + + } + + /// + /// 抽象类不会被自动注册 + /// + public abstract class CustomizeBaseRepository : ISingletonDependency + { + + } + + public class UserRepository : BaseRepository + { + + } + ``` + + > 等价于: `service.AddSingleton();service.AddSingleton();` + +## 特性: + +* IgnoreInjection: 忽略注入,用于排除不被自动注入 +* Dependency: + * TryRegister: 设置true则仅当服务未注册时才会被注册,类似IServiceCollection的TryAdd ... 扩展方法 + * ReplaceServices: 设置true则替换之前已经注册过的服务,类似IServiceCollection的Replace ... 扩展方法. + +## 方法: + +* 扩展IServiceCollection + * GetInstance(): 获取服务T的实例 + * Any(): 是否存在服务TService,不支持泛型服务 + * Any(): 是否存在接口为TService、且实现类为TImplementation的服务 + * Any(ServiceLifetime.Singleton): 是否存在一个生命周期为Singleton的服务TService(不支持泛型服务) + * Any(ServiceLifetime.Singleton): 是否存在一个生命周期为Singleton的接口为TService,实现为TImplementation的服务(不支持泛型服务) + * Replace(typeof(TImplementation), ServiceLifetime.Singleton): 移除服务集合中具有相同服务类型的第一个服务,并将 typeof(TImplementation) 添加到集合中,生命周期为单例 + * ReplaceAll(typeof(TImplementation), ServiceLifetime.Singleton): 移除服务集合中具有相同服务类型的所有服务,并将 typeof(TImplementation) 添加到集合中,生命周期为单例 \ No newline at end of file diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs new file mode 100644 index 000000000..54f88a654 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs @@ -0,0 +1,122 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionDescriptorExtensions +{ + public static TService GetInstance(this IServiceCollection services, bool isCreateScope = false) + where TService : class + { + if (isCreateScope) + { + using var scope = services.BuildServiceProvider().CreateScope(); + return scope.ServiceProvider.GetInstance(); + } + + return services.BuildServiceProvider().GetInstance(); + } + + private static TService GetInstance(this IServiceProvider serviceProvider) + where TService : class + { + if (typeof(TService) == typeof(IServiceProvider)) + return (TService)serviceProvider; + + return serviceProvider.GetRequiredService(); + } + + /// + /// Returns whether the specified ServiceType exists in the service collection + /// + /// + /// + /// + public static bool Any(this IServiceCollection services) + => services.Any(d => d.ServiceType == typeof(TService)); + + /// + /// Returns whether the specified ServiceType and ImplementationType exist in the service collection + /// + /// + /// + /// + /// + public static bool Any(this IServiceCollection services) + => services.Any(d => d.ServiceType == typeof(TService) && d.ImplementationType == typeof(TImplementation)); + + /// + /// Returns whether the specified ServiceType exists in the service collection, and the life cycle is the life cycle. + /// + /// + /// + /// + /// + public static bool Any(this IServiceCollection services, ServiceLifetime lifetime) + => services.Any(d => d.ServiceType == typeof(TService) && d.Lifetime == lifetime); + + /// + /// Returns the specified ServiceType, ImplementationType, and whether the life cycle is lifetime exists in the service collection + /// + /// + /// + /// + /// + /// + public static bool Any(this IServiceCollection services, ServiceLifetime lifetime) + => services.Any(d => d.ServiceType == typeof(TService) && d.ImplementationType == typeof(TImplementation) && d.Lifetime == lifetime); + + /// + /// Remove the first service in the service collection with the same service type and add the implementationType to the collection. + /// + /// + /// + /// + /// + /// + public static IServiceCollection Replace(this IServiceCollection services, Type implementationType, ServiceLifetime lifetime) + { + if (services.Any()) + { + int count = services.Count; + for (int i = 0; i < count; i++) + { + if (services[i].ServiceType == typeof(TService)) + { + services.RemoveAt(i); + break; + } + } + } + + services.Add(new ServiceDescriptor(typeof(TService), implementationType, lifetime)); + return services; + } + + /// + /// Removes all services with the same service type in the services collection and adds implementationType to the collection. + /// + /// + /// + /// + /// + /// + public static IServiceCollection ReplaceAll(this IServiceCollection services, Type implementationType, ServiceLifetime lifetime) + { + if (services.Any()) + { + int count = services.Count; + for (int i = 0; i < count; i++) + { + if (services[i].ServiceType == typeof(TService)) + { + services.RemoveAt(i); + break; + } + } + } + + services.Add(new ServiceDescriptor(typeof(TService), implementationType, lifetime)); + return services; + } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..fd2b8ae39 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs @@ -0,0 +1,135 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddAutoInject(this IServiceCollection services) + => services.AddAutoInject(AppDomain.CurrentDomain.GetAssemblies()); + + public static IServiceCollection AddAutoInject(this IServiceCollection services, IEnumerable assemblies) + => services.AddAutoInjectCore(assemblies); + + public static IServiceCollection AddAutoInject(this IServiceCollection services, params Assembly[] assemblies) + => services.AddAutoInjectCore(assemblies); + + /// + /// Automatic registration from an assembly containing the specified type + /// + /// + /// + /// + public static IServiceCollection AddAutoInject(this IServiceCollection services, IEnumerable handlerAssemblyMarkerTypes) + => services.AddAutoInjectCore(handlerAssemblyMarkerTypes.Select(t => t.GetTypeInfo().Assembly).Distinct().ToArray()); + + /// + /// Automatic registration from an assembly containing the specified type + /// + /// + /// + /// + public static IServiceCollection AddAutoInject(this IServiceCollection services, params Type[] handlerAssemblyMarkerTypes) + => services.AddAutoInjectCore(handlerAssemblyMarkerTypes.Select(t => t.GetTypeInfo().Assembly).Distinct().ToArray()); + + private static IServiceCollection AddAutoInjectCore(this IServiceCollection services, IEnumerable assemblies) + { + if (services.Any()) + return services; + + services.AddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + var typeProvider = services.GetInstance(); + var serviceDescriptors = typeProvider.GetServiceDescriptors(typeProvider.GetAllTypes(assemblies)); + + var registrar = services.GetInstance(); + foreach (var descriptor in serviceDescriptors) + registrar.Add(services, descriptor.ServiceType, descriptor.ImplementationType, descriptor.Lifetime); + + if (!serviceDescriptors.Any(d => d.AutoFire)) + return services; + + var serviceProvider = services.BuildServiceProvider(); + foreach (var descriptor in serviceDescriptors.Where(d => d.AutoFire)) + serviceProvider.GetService(descriptor.ServiceType); + + return services; + } + + /// + /// Auto add all service to IoC, lifecycle is scoped + /// + /// + /// default is Service + /// + public static IServiceCollection AddServices(this IServiceCollection services, string suffix, bool autoFire) + => services.AddServices(suffix, autoFire, Assembly.GetEntryAssembly()!); + + /// + /// Auto add all service to IoC, lifecycle is scoped + /// + /// + /// default is Service + /// + /// + /// + public static IServiceCollection AddServices(this IServiceCollection services, string suffix, bool autoFire, + params Assembly[] assemblies) + => (from type in assemblies.SelectMany(assembly => assembly.GetTypes()) + where !type.IsAbstract && type.Name.EndsWith(suffix) + select type).AddScoped(services, autoFire); + + /// + /// Auto add all service to IoC, lifecycle is scoped + /// + /// + /// + /// + /// + public static IServiceCollection AddServices(this IServiceCollection services, bool autoFire) + => services.AddServices(autoFire, Assembly.GetEntryAssembly()!); + + /// + /// Auto add all service to IoC, lifecycle is scoped + /// + /// + /// + /// + /// + /// + public static IServiceCollection AddServices(this IServiceCollection services, bool autoFire, params Assembly[] assemblies) + => (from type in assemblies.SelectMany(assembly => assembly.GetTypes()) + where !type.IsAbstract && BaseOf(type) + select type).AddScoped(services, autoFire); + + private static IServiceCollection AddScoped(this IEnumerable serviceTypes, IServiceCollection services, bool autoFire) + { + foreach (var serviceType in serviceTypes) + { + services.AddScoped(serviceType); + } + + if (autoFire) + { + foreach (var serviceType in serviceTypes) + { + services.BuildServiceProvider().GetService(serviceType); + } + } + + return services; + } + + private static bool BaseOf(Type type) + { + if (type.BaseType == typeof(T)) return true; + + return type.BaseType != null && BaseOf(type.BaseType); + } + + private class DependencyInjectionService + { + + } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs new file mode 100644 index 000000000..7e42c75d0 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.DependencyInjection.Options; +global using System.Reflection; diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj b/src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs new file mode 100644 index 000000000..6d6373546 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public static class TypeExtensions +{ + public static string GetGenericTypeName(this Type type) + { + string typeName; + + if (type.IsGenericType) + { + var genericTypes = string.Join(",", type.GetGenericArguments().Select(t => t.Name).ToArray()); + typeName = $"{type.Name.Remove(type.Name.IndexOf('`'))}<{genericTypes}>"; + } + else + { + typeName = type.Name; + } + + return typeName; + } + + public static string GetGenericTypeName(this object @object) + => @object.GetType().GetGenericTypeName(); +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs new file mode 100644 index 000000000..21882d7ae --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public static class EnumExtensions +{ + public static DescriptionAttribute GetDescription(this Enum enumSubitem) + { + string value = enumSubitem.ToString(); + + var fieldInfo = enumSubitem.GetType().GetField(value); + + if (fieldInfo != null) + { + var attributes = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false); + + if (attributes == null || attributes.Length == 0) + { + return new DescriptionAttribute(value); + } + else + { + return (DescriptionAttribute)attributes[0]; + } + } + else + { + return new DescriptionAttribute(); + } + } + + public static T? GetAttribute(this Enum enumSubitem) + where T : Attribute, new() + => EnumUtil.GetSubitemAttribute(enumSubitem); +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs new file mode 100644 index 000000000..fd2004b22 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class EnumUtil +{ + public static T? GetSubitemAttribute(object enumSubitem) + where T : Attribute, new() + { + if (enumSubitem == null) + return null; + + string value = enumSubitem.ToString() ?? ""; + + var fieldInfo = enumSubitem.GetType().GetField(value); + + if (fieldInfo != null) + { + var attributes = fieldInfo.GetCustomAttributes(typeof(T), false); + + if (attributes == null || attributes.Length == 0) + { + return new T(); + } + else + { + return attributes[0] as T; + } + } + else + { + return new T(); + } + } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs new file mode 100644 index 000000000..88ae47fe1 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class EnumObject +{ + public string Name { get; set; } = default!; + + public TValue Value { get; set; } = default!; +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs new file mode 100644 index 000000000..c25637d33 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs @@ -0,0 +1,116 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class Enum + where TEnum : Enum +{ + public static List GetAttributes() + where TAttribute : Attribute, new() + { + var enumType = typeof(TEnum); + var names = Enum.GetNames(enumType); + var result = names.Select(name => EnumUtil.GetSubitemAttribute(Enum.Parse(enumType, name))!).ToList(); + + return result; + } + + public static Dictionary GetDictionary() + where TAttribute : Attribute, new() + { + var enumType = typeof(TEnum); + + return Enum.GetNames(enumType) + .Select(name => (TEnum)Enum.Parse(enumType, name)) + .ToDictionary(@enum => @enum, @enum => EnumUtil.GetSubitemAttribute(@enum)!); + } + + public static List GetItems() + { + var enumType = typeof(TEnum); + + return Enum.GetNames(enumType) + .Select(name => (TEnum)Enum.Parse(enumType, name)).ToList(); + } + + public static List> GetEnumObjectList(bool withAll = false, string allName = "所有", int allValue = 0) + => GetEnumObjectList(withAll, allName, allValue); + + public static List> GetEnumObjectList(bool withAll = false, string allName = "所有", TValue? allValue = default) + { + var enumType = typeof(TEnum); + + var lstResult = Enum.GetNames(enumType).Select(name => + { + var fieldInfo = enumType.GetField(name); + if (fieldInfo != null) + { + var attribute = fieldInfo.GetCustomAttribute(false); + if (attribute == null) + { + return new EnumObject() + { + Name = name, + Value = (TValue)Enum.Parse(enumType, name) + }; + } + else + { + return new EnumObject() + { + Name = attribute.Description, + Value = (TValue)Enum.Parse(enumType, name) + }; + } + } + else + { + return new EnumObject() + { + Name = name, + Value = (TValue)Enum.Parse(enumType, name) + }; + } + }).Where(p => p != null).ToList(); + + if (withAll) + { + lstResult.Insert(0, new EnumObject + { + Name = allName, + Value = (TValue)Enum.Parse(enumType, allValue?.ToString() ?? string.Empty) + }); + } + + return lstResult; + } + + public static Dictionary GetEnumObjectDictionary(bool withAll = false, string allName = "所有", int allValue = 0) + { + return GetEnumObjectDictionary(withAll, allName, allValue); + } + + public static Dictionary GetEnumObjectDictionary(bool withAll = false, string allName = "所有", TValue allValue = default!) + where TValue : notnull + { + Dictionary keyValues = new Dictionary(); + var enumType = typeof(TEnum); + + if (withAll) + { + keyValues.Add(allValue, allName); + } + + foreach (var value in Enum.GetValues(enumType)) + { + string val = value?.ToString() ?? string.Empty; + var fieldInfo = enumType.GetField(val); + var attribute = fieldInfo!.GetCustomAttribute(false); + + keyValues.Add((TValue)Enum.Parse(enumType, val), attribute?.Description ?? val); + } + + return keyValues; + } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs new file mode 100644 index 000000000..f0a35bd38 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.ComponentModel; +global using System.Reflection; diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs new file mode 100644 index 000000000..f7d0c888d --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs @@ -0,0 +1,117 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System.Linq.Expressions; + +public static class ExpressionExtensions +{ + public static Expression> And(this Expression> first, Expression> second) + { + return first.Compose(second, Expression.And); + } + + public static Expression> And(this Expression> first, bool isCompose, Expression>? second) + { + if (isCompose && second != null) + return first.Compose(second, Expression.And); + + return first; + } + + public static Expression> Or(this Expression> first, Expression> second) + { + return first.Compose(second, Expression.Or); + } + + public static Expression> Or(this Expression> first, bool isCompose, Expression>? second) + { + if (isCompose && second != null) + return first.Compose(second, Expression.Or); + + return first; + } + + public static Expression Compose(this Expression first, Expression second, Func merge) + { + var parameterMap = first.Parameters.Select((f, i) => new { f, s = second.Parameters[i] }).ToDictionary(p => p.s, p => p.f); + + var secondBody = ParameterRebinder.ReplaceParameters(parameterMap, second.Body); + + return Expression.Lambda(merge(first.Body, secondBody), first.Parameters); + } + + #region GetMemberName + + public static List GetMemberName(this Expression expression) + where T : BinaryExpression + { + var result = new List(); + var expressionBody = expression.Body; + if (expressionBody is BinaryExpression) + { + result.AddRange(ParseBinaryExpression(expressionBody)); + } + + return result; + } + + private static List ParseBinaryExpression(Expression expression) + { + var result = new List(); + var binaryExpression = expression as BinaryExpression; + + if (binaryExpression!.Left != null) + result.AddRange(ParseUnitExpression(binaryExpression.Left)); + + if (binaryExpression.Right != null) + result.AddRange(ParseUnitExpression(binaryExpression.Right)); + + return result; + } + + private static List ParseUnitExpression(Expression unitExpression) + { + var result = new List(); + + if (unitExpression is BinaryExpression) + { + result.AddRange(ParseBinaryExpression((unitExpression as BinaryExpression)!)); + } + else if (unitExpression is MemberExpression) + { + var memberExpression = unitExpression as MemberExpression; + var pi = memberExpression!.Member as PropertyInfo; + result.Add(pi!.Name); + } + + return result; + } + + #endregion + +} + +public class ParameterRebinder : ExpressionVisitor +{ + private readonly Dictionary map; + + public ParameterRebinder(Dictionary map) + { + this.map = map ?? new Dictionary(); + } + + public static Expression ReplaceParameters(Dictionary map, Expression exp) + { + return new ParameterRebinder(map).Visit(exp); + } + + protected override Expression VisitParameter(ParameterExpression p) + { + ParameterExpression replacement; + if (map.TryGetValue(p, out replacement!)) + { + p = replacement; + } + return base.VisitParameter(p); + } +} diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj b/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj new file mode 100644 index 000000000..ea64c3225 --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj @@ -0,0 +1,10 @@ + + + + net6.0 + enable + enable + System.Linq.Expressions + + + diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs b/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs new file mode 100644 index 000000000..da9630c2d --- /dev/null +++ b/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.Reflection; diff --git a/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs b/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs new file mode 100644 index 000000000..7a3c4fe5f --- /dev/null +++ b/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs @@ -0,0 +1,104 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace FluentValidation; + +public static class FluentValidationExtensions +{ + public static IRuleBuilderOptions Chinese(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.CHINESE) + .WithMessage("Can only input chinese of {PropertyName}"); + } + + public static IRuleBuilderOptions Number(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.NUMBER) + .WithMessage("Can only input number of {PropertyName}"); + } + + public static IRuleBuilderOptions Letter(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.LETTER) + .WithMessage("Can only input letter of {PropertyName}"); + } + + public static IRuleBuilderOptions LowerLetter(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.LOWER_LETTER) + .WithMessage("Can only input lower letter of {PropertyName}"); + } + + public static IRuleBuilderOptions UpperLetter(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.UPPER_LETTER) + .WithMessage("Can only input upper letter of {PropertyName}"); + } + + public static IRuleBuilderOptions LetterNumber(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.LETTER_NUMBER) + .WithMessage("Can only input upper letter and number of {PropertyName}"); + } + + public static IRuleBuilderOptions ChineseLetter(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.CHINESE_LETTER) + .WithMessage("Can only input upper chinese and letter of {PropertyName}"); + } + + public static IRuleBuilderOptions ChineseLetterNumber(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.CHINESE_LETTER_NUMBER) + .WithMessage("Can only input upper chinese and letter and number of {PropertyName}"); + } + + public static IRuleBuilderOptions Phone(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.PHONE) + .WithMessage("{PropertyName} format is incorrect"); + } + + public static IRuleBuilderOptions Email(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.EMAIL) + .WithMessage("{PropertyName} format is incorrect"); + } + + public static IRuleBuilderOptions IdCard(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.IDCARD) + .WithMessage("{PropertyName} format is incorrect"); + } + + public static IRuleBuilderOptions Url(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.URL) + .WithMessage("{PropertyName} format is incorrect"); + } + + public static IRuleBuilderOptions MinLength(this IRuleBuilder ruleBuilder, int minimumLength) + { + return ruleBuilder.MinimumLength(minimumLength) + .WithMessage("Please enter a number greater than {MinLength} of {PropertyName}"); + } + + public static IRuleBuilderOptions MaxLength(this IRuleBuilder ruleBuilder, int maximumLength) + { + return ruleBuilder.MaximumLength(maximumLength) + .WithMessage("Please enter a number less than {MaxLength} of {PropertyName}"); + } + + public static IRuleBuilderOptions Port(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.PORT) + .WithMessage("Is not a valid port {PropertyName}"); + } + + public static IRuleBuilderOptions Required(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.NotNull() + .NotEmpty() + .WithMessage("{PropertyName} is required"); + } +} diff --git a/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj b/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj new file mode 100644 index 000000000..acea0bb77 --- /dev/null +++ b/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs b/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs new file mode 100644 index 000000000..ccfcbe16e --- /dev/null +++ b/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.Validations.FluentValidation; + +internal static class RegularHelper +{ + internal const string CHINESE = "^\\s{0}$|^[\u4e00-\u9fa5]+$"; + internal const string NUMBER = "^\\s{0}$|^[0-9]+$"; + internal const string LETTER = "^\\s{0}$|^[a-zA-Z]+$"; + internal const string LOWER_LETTER = "^\\s{0}$|^[a-z]+$"; + internal const string UPPER_LETTER = "^\\s{0}$|^[A-Z]+$"; + internal const string LETTER_NUMBER = "^\\s{0}$|^[a-zA-Z0-9]+$"; + internal const string CHINESE_LETTER_NUMBER = "^\\s{0}$|^[\u4e00-\u9fa5_a-zA-Z0-9]+$"; + internal const string CHINESE_LETTER = "^\\s{0}$|^[\u4e00-\u9fa5_a-zA-Z]+$"; + internal const string PHONE = @"^\s{0}$|^((\+86)|(86))?(1[3-9][0-9])\d{8}$"; + internal const string IDCARD = "^\\s{0}$|(^\\d{15}$)|(^\\d{17}([0-9]|X|x)$)"; + internal const string EMAIL = @"^\s{0}$|^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"; + internal const string URL = "^\\s{0}$|[a-zA-z]+://[^s]*"; + internal const string PORT = "^\\s{0}$|^([1-9]|[1-9]\\d|[1-9]\\d{2}|[1-9]\\d{3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$"; +} diff --git a/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs b/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs new file mode 100644 index 000000000..53b8299c9 --- /dev/null +++ b/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Extensions.Validations.FluentValidation; diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs new file mode 100644 index 000000000..246974047 --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell.Entries; + +public class LdapAddress +{ + public string Street { get; set; } = string.Empty; + + public string PostalCode { get; set; } = string.Empty; + + public string City { get; set; } = string.Empty; + + public string StateName { get; set; } = string.Empty; + + public string CountryName { get; set; } = string.Empty; + + public string CountryCode { get; set; } = string.Empty; +} diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs new file mode 100644 index 000000000..39657d1ef --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs @@ -0,0 +1,53 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell.Entries; + +public class LdapUser +{ + /// + /// ObjectSID contains the value for the Security Identifier (SID) of the entry. + /// + public string ObjectSid { get; set; } = string.Empty; + + /// + /// ObjectGUID is an Attribute-Names which represents a Universally Unique Identifier as used in Microsoft Active Directory. + /// + public string ObjectGuid { get; set; } = string.Empty; + + public string ObjectCategory { get; set; } = string.Empty; + + public string ObjectClass { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public string CommonName { get; set; } = string.Empty; + + public string DistinguishedName { get; set; } = string.Empty; + + public string SamAccountName { get; set; } = string.Empty; + + public int SamAccountType { get; set; } + + public string[] MemberOf { get; set; } = Array.Empty(); + + public bool IsDomainAdmin { get; set; } + + public string UserPrincipalName { get; set; } = string.Empty; + + public string DisplayName { get; set; } = string.Empty; + + public string FirstName { get; set; } = string.Empty; + + public string LastName { get; set; } = string.Empty; + + public string FullName => $"{FirstName} {LastName}"; + + public string EmailAddress { get; set; } = string.Empty; + + public string Description { get; set; } = string.Empty; + + public string Phone { get; set; } = string.Empty; + + public LdapAddress Address { get; set; } = new(); +} diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs new file mode 100644 index 000000000..ca6c1fb47 --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell.Extensions; + +public static class LdapAttributeSetExtensions +{ + public static void AddAttribute(this LdapAttributeSet ldapAttributes, string name, string value) + { + if (!string.IsNullOrEmpty(value)) + { + ldapAttributes.Add(new LdapAttribute(name, value)); + } + } + + public static string GetString(this LdapAttributeSet ldapAttributes, string name) + { + ldapAttributes.TryGetValue(name, out var value); + return value?.StringValue ?? ""; + } + + public static string[] GetStringArray(this LdapAttributeSet ldapAttributes, string name) + { + ldapAttributes.TryGetValue(name, out var value); + return value?.StringValueArray ?? new string[] { }; + } +} diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..0e5efa08f --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + private static IServiceCollection AddLadpContext(this IServiceCollection services, Action optionsAction) + { + services.Configure(optionsAction); + services.AddSingleton(typeof(ILdapProvider), typeof(LdapProvider)); + return services; + } + + public static IServiceCollection AddLadpContext(this IServiceCollection services, IConfiguration configuration) + { + services.Configure(configuration); + services.AddSingleton(typeof(ILdapProvider), typeof(LdapProvider)); + return services; + } + + public static IServiceCollection AddLadpContext(this IServiceCollection services) + { + services.AddSingleton(typeof(ILdapFactory), typeof(LdapFactory)); + return services; + } +} diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs new file mode 100644 index 000000000..a3e0963ba --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public interface ILdapFactory +{ + ILdapProvider CreateProvider(LdapOptions ldapOptions); +} diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs new file mode 100644 index 000000000..b85bbca1a --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public interface ILdapProvider +{ + Task GetGroupAsync(string groupName); + + IAsyncEnumerable GetUsersInGroupAsync(string groupName); + + Task GetUsersByEmailAddressAsync(string emailAddress); + + Task GetUserByUserNameAsync(string userName); + + IAsyncEnumerable GetAllUserAsync(); + + Task> GetPagingUserAsync(int pageSize); + + Task AddUserAsync(LdapUser user, string password); + + Task DeleteUserAsync(string distinguishedName); + + Task AuthenticateAsync(string distinguishedName, string password); +} diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs new file mode 100644 index 000000000..679bd4e14 --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public class LdapFactory : ILdapFactory +{ + public ILdapProvider CreateProvider(LdapOptions ldapOptions) + { + return new LdapProvider(ldapOptions); + } +} diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs new file mode 100644 index 000000000..93b255cc9 --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs @@ -0,0 +1,49 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public class LdapOptions +{ + public string ServerAddress { get; set; } = null!; + + public int ServerPort { get; set; } + + public int ServerPortSsl { get; set; } + + public string BaseDn { get; set; } = null!; + + private string _userSearchBaseDn = string.Empty; + + public string UserSearchBaseDn + { + get + { + if (string.IsNullOrEmpty(_userSearchBaseDn)) + { + return BaseDn; + } + return _userSearchBaseDn; + } + set { _userSearchBaseDn = value; } + } + + private string _groupSearchBaseDn = string.Empty; + + public string GroupSearchBaseDn + { + get + { + if (string.IsNullOrEmpty(_groupSearchBaseDn)) + { + return BaseDn; + } + return _groupSearchBaseDn; + } + set { _groupSearchBaseDn = value; } + } + + public string RootUserDn { get; set; } = null!; + + public string RootUserPassword { get; set; } = null!; +} diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs new file mode 100644 index 000000000..40231b016 --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs @@ -0,0 +1,294 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public class LdapProvider : ILdapProvider, IDisposable +{ + ILdapConnection ldapConnection = null!; + LdapOptions _ldapOptions; + + private readonly string[] _attributes = + { + "objectSid", "objectGUID", "objectCategory", "objectClass", "memberOf", "name", "cn", "distinguishedName", + "sAMAccountName", "userPrincipalName", "displayName", "givenName", "sn", "description", + "telephoneNumber", "mail", "streetAddress", "postalCode", "l", "st", "co", "c" + }; + + internal LdapProvider(LdapOptions options) + { + _ldapOptions = options; + } + + public LdapProvider(IOptionsSnapshot options) + { + _ldapOptions = options.Value; + } + + private async Task GetConnectionAsync() + { + if (ldapConnection != null && ldapConnection.Connected) + { + return ldapConnection; + } + ldapConnection = new LdapConnection() { SecureSocketLayer = _ldapOptions.ServerPortSsl != 0 }; + //Connect function will create a socket connection to the server - Port 389 for insecure and 3269 for secure + await ldapConnection.ConnectAsync(_ldapOptions.ServerAddress, + _ldapOptions.ServerPortSsl != 0 ? _ldapOptions.ServerPortSsl : _ldapOptions.ServerPort); + //Bind function with null user dn and password value will perform anonymous bind to LDAP server + await ldapConnection.BindAsync(_ldapOptions.RootUserDn, _ldapOptions.RootUserPassword); + + return ldapConnection; + } + + public async Task AuthenticateAsync(string distinguishedName, string password) + { + using var ldapConnection = new LdapConnection() { SecureSocketLayer = _ldapOptions.ServerPortSsl != 0 }; + await ldapConnection.ConnectAsync(_ldapOptions.ServerAddress, + ldapConnection.SecureSocketLayer ? _ldapOptions.ServerPortSsl : _ldapOptions.ServerPort); + try + { + await ldapConnection.BindAsync(distinguishedName, password); + return true; + } + catch (Exception) + { + return false; + } + } + + public async Task DeleteUserAsync(string distinguishedName) + { + using (var ldapConnection = await GetConnectionAsync()) + { + await ldapConnection.DeleteAsync(distinguishedName); + } + } + + public async Task AddUserAsync(LdapUser user, string password) + { + var dn = $"CN={user.FirstName} {user.LastName},{_ldapOptions.UserSearchBaseDn}"; + + var attributeSet = new LdapAttributeSet + { + new LdapAttribute("instanceType", "4"), + new LdapAttribute("objectCategory", $"CN=Users,{_ldapOptions.UserSearchBaseDn}"), + new LdapAttribute("objectClass", new[] {"top", "person", "organizationalPerson", "user"}), + new LdapAttribute("name", user.Name), + new LdapAttribute("cn", $"{user.FirstName} {user.LastName}"), + new LdapAttribute("sAMAccountName", user.SamAccountName), + new LdapAttribute("userPrincipalName", user.UserPrincipalName), + new LdapAttribute("unicodePwd", Convert.ToBase64String(Encoding.Unicode.GetBytes($"\"{password}\""))), + new LdapAttribute("userAccountControl", "512"), + new LdapAttribute("givenName", user.FirstName), + new LdapAttribute("sn", user.LastName), + new LdapAttribute("mail", user.EmailAddress) + }; + + attributeSet.AddAttribute("displayName", user.DisplayName); + attributeSet.AddAttribute("description", user.Description); + attributeSet.AddAttribute("telephoneNumber", user.Phone); + attributeSet.AddAttribute("streetAddress", user.Address.Street); + attributeSet.AddAttribute("l", user.Address.City); + attributeSet.AddAttribute("postalCode", user.Address.PostalCode); + attributeSet.AddAttribute("st", user.Address.StateName); + attributeSet.AddAttribute("co", user.Address.CountryName); + attributeSet.AddAttribute("c", user.Address.CountryCode); + + var newEntry = new LdapEntry(dn, attributeSet); + + using var ldapConnection = await GetConnectionAsync(); + await ldapConnection.AddAsync(newEntry); + } + + public async IAsyncEnumerable GetAllUserAsync() + { + var filter = $"(&(objectCategory=person)(objectClass=user))"; + var users = GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter); + await foreach (var user in users) + { + yield return CreateUser(user.Dn, user.GetAttributeSet()); + } + } + + public async Task> GetPagingUserAsync(int pageSize) + { + using var ldapConnection = await GetConnectionAsync(); + return await ldapConnection.SearchUsingSimplePagingAsync(new SearchOptions( + _ldapOptions.UserSearchBaseDn, + LdapConnection.ScopeSub, + "(&(objectCategory=person)(objectClass=user))", + _attributes), + pageSize); + } + + public async Task GetUserByUserNameAsync(string userName) + { + var filter = $"(&(objectClass=user)(sAMAccountName={userName}))"; + var user = await GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter).FirstOrDefaultAsync(); + return user == null ? null : CreateUser(user.Dn, user.GetAttributeSet()); + } + + public async Task GetUsersByEmailAddressAsync(string emailAddress) + { + var filter = $"(&(objectClass=user)(mail={emailAddress}))"; + var user = await GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter).FirstOrDefaultAsync(); + return user == null ? null : CreateUser(user.Dn, user.GetAttributeSet()); + } + + private async IAsyncEnumerable GetFilterLdapEntryAsync(string baseDn, string filter) + { + using var ldapConnection = await GetConnectionAsync(); + var searchResults = await ldapConnection.SearchAsync( + baseDn, + LdapConnection.ScopeSub, + filter, + _attributes, + false); + await foreach (var searchResult in searchResults) + { + yield return searchResult; + } + } + + public async IAsyncEnumerable GetUsersInGroupAsync(string groupName) + { + var group = await GetGroupAsync(groupName); + if (group == null) + { + yield break; + } + var filter = $"(&(objectCategory=person)(objectClass=user)(memberOf={group.Dn}))"; + var users = GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter); + + await foreach (var user in users) + { + yield return CreateUser(user.Dn, user.GetAttributeSet()); + } + } + + public async Task GetGroupAsync(string groupName) + { + var filter = $"(&(objectCategory=group)(objectClass=group)(cn={groupName}))"; + return await GetFilterLdapEntryAsync(_ldapOptions.GroupSearchBaseDn, filter) + .FirstOrDefaultAsync(); + } + + public void Dispose() + { + if (ldapConnection.Connected) + { + ldapConnection.Disconnect(); + } + if (ldapConnection != null) + { + ldapConnection.Dispose(); + } + } + + private LdapUser CreateUser(string distinguishedName, LdapAttributeSet attributeSet) + { + var ldapUser = new LdapUser(); + + ldapUser.ObjectSid = ObjectSidToString(attributeSet.GetAttribute("objectSid").ByteValue); + ldapUser.ObjectGuid = ObjectGuidToString(attributeSet.GetAttribute("objectGUID").ByteValue); + ldapUser.ObjectCategory = attributeSet.GetString("objectCategory"); + ldapUser.ObjectClass = attributeSet.GetString("objectClass"); + ldapUser.MemberOf = attributeSet.GetStringArray("memberOf"); + ldapUser.CommonName = attributeSet.GetString("cn"); + ldapUser.SamAccountName = attributeSet.GetString("sAMAccountName"); + ldapUser.UserPrincipalName = attributeSet.GetString("userPrincipalName"); + ldapUser.Name = attributeSet.GetString("name"); + ldapUser.DistinguishedName = attributeSet.GetString("distinguishedName"); + ldapUser.DisplayName = attributeSet.GetString("displayName"); + ldapUser.FirstName = attributeSet.GetString("givenName"); + ldapUser.LastName = attributeSet.GetString("sn"); + ldapUser.Description = attributeSet.GetString("description"); + ldapUser.Phone = attributeSet.GetString("telephoneNumber"); + ldapUser.EmailAddress = attributeSet.GetString("mail"); + ldapUser.Address = new LdapAddress + { + Street = attributeSet.GetString("streetAddress"), + City = attributeSet.GetString("l"), + PostalCode = attributeSet.GetString("postalCode"), + StateName = attributeSet.GetString("st"), + CountryName = attributeSet.GetString("co"), + CountryCode = attributeSet.GetString("c") + }; + attributeSet.TryGetValue("sAMAccountType", out var sAMAccountType); + ldapUser.SamAccountType = int.Parse(sAMAccountType?.StringValue ?? "0"); + + ldapUser.IsDomainAdmin = ldapUser.MemberOf.Contains("CN=Domain Admins," + _ldapOptions.BaseDn); + + return ldapUser; + } + + private string ObjectGuidToString(byte[] bytes) + { + var strGUID = ""; + strGUID += AddLeadingZero(bytes[3] & 0xFF); + strGUID += AddLeadingZero(bytes[2] & 0xFF); + strGUID += AddLeadingZero(bytes[1] & 0xFF); + strGUID += AddLeadingZero(bytes[0] & 0xFF); + strGUID += "-"; + strGUID += AddLeadingZero(bytes[5] & 0xFF); + strGUID += AddLeadingZero(bytes[4] & 0xFF); + strGUID += "-"; + strGUID += AddLeadingZero(bytes[7] & 0xFF); + strGUID += AddLeadingZero(bytes[6] & 0xFF); + strGUID += "-"; + strGUID += AddLeadingZero(bytes[8] & 0xFF); + strGUID += AddLeadingZero(bytes[9] & 0xFF); + strGUID += "-"; + strGUID += AddLeadingZero(bytes[10] & 0xFF); + strGUID += AddLeadingZero(bytes[11] & 0xFF); + strGUID += AddLeadingZero(bytes[12] & 0xFF); + strGUID += AddLeadingZero(bytes[13] & 0xFF); + strGUID += AddLeadingZero(bytes[14] & 0xFF); + strGUID += AddLeadingZero(bytes[15] & 0xFF); + + return strGUID; + } + + private string ObjectSidToString(byte[] bytes) + { + StringBuilder strSID = new StringBuilder("S-"); + strSID.Append(bytes[0]).Append('-'); + // bytes[2..7] : + StringBuilder tmpBuff = new StringBuilder(); + for (int t = 2; t <= 7; t++) + { + //var hexString = (bytes[t] & 0xFF).ToString("X"); + //tmpBuff.Append(hexString); + tmpBuff.Append(AddLeadingZero((int)bytes[t] & 0xFF)); + } + strSID.Append(Convert.ToInt64(tmpBuff.ToString(), 16)); + // bytes[1] : the sub authorities count + int count = bytes[1]; + for (int i = 0; i < count; i++) + { + int currSubAuthOffset = i * 4; + tmpBuff.Length = 0; + tmpBuff.Append(string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", + (bytes[11 + currSubAuthOffset] & 0xFF), + (bytes[10 + currSubAuthOffset] & 0xFF), + (bytes[9 + currSubAuthOffset] & 0xFF), + (bytes[8 + currSubAuthOffset] & 0xFF))); + + strSID.Append('-').Append(Convert.ToInt64(tmpBuff.ToString(), 16)); + } + return strSID.ToString(); + } + + string AddLeadingZero(int k) + { + return (k <= 0xF) ? "0" + Int2String(k) : Int2String(k); + } + + string Int2String(int kb) + { + byte[] bytes = new byte[1]; + bytes[0] = (byte)(kb & 0xFF); + return Convert.ToHexString(bytes); + } +} diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj new file mode 100644 index 000000000..895ce1cf9 --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs new file mode 100644 index 000000000..a8f040a3f --- /dev/null +++ b/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Ldap.Novell; +global using Masa.Utils.Ldap.Novell.Entries; +global using Masa.Utils.Ldap.Novell.Extensions; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.Options; +global using Novell.Directory.Ldap; +global using System.Text; diff --git a/src/Utils/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs b/src/Utils/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs new file mode 100644 index 000000000..54e78d887 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Exceptions.Handlers; + +namespace Microsoft.AspNetCore.Builder; + +public static class ApplicationBuilderExtensions +{ + /// + /// Use localizable + /// + /// + /// + /// + [Obsolete("UseMasaExceptionHandler is recommended to use instead.")] + public static IApplicationBuilder UseMasaExceptionHandling( + this IApplicationBuilder app, + Action? exceptionHandlingOptions = null) + { + return app.UseMasaExceptionHandling(_ => + { + }, exceptionHandlingOptions); + } + + /// + /// Use localizable + /// + /// + /// + /// + /// + [Obsolete("UseMasaExceptionHandler is recommended to use instead.")] + public static IApplicationBuilder UseMasaExceptionHandling( + this IApplicationBuilder app, + Action action, + Action? exceptionHandlingOptions) + { + var option = new MasaExceptionHandlingOptions(); + exceptionHandlingOptions?.Invoke(option); + + app.UseMiddleware(Options.Create(option)); + app.UseRequestLocalization(action); + return app; + } + + /// + /// Use localizable + /// + /// + /// + /// + public static IApplicationBuilder UseMasaExceptionHandler( + this IApplicationBuilder app, + Action? exceptionHandlingOptions = null) + { + return app.UseMasaExceptionHandler(_ => + { + }, exceptionHandlingOptions); + } + + /// + /// Use localizable + /// + /// + /// + /// + /// + public static IApplicationBuilder UseMasaExceptionHandler( + this IApplicationBuilder app, + Action action, + Action? exceptionHandlingOptions) + { + var option = new MasaExceptionHandlerOptions(); + exceptionHandlingOptions?.Invoke(option); + + app.UseMiddleware(Options.Create(option)); + app.UseRequestLocalization(action); + return app; + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs b/src/Utils/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs new file mode 100644 index 000000000..98ad0fcb1 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MvcBuilderExtensions +{ + public static IMvcBuilder AddMasaExceptionHandler(this IMvcBuilder builder) + { + return builder.AddMasaExceptionHandler(_ => { }); + } + + public static IMvcBuilder AddMasaExceptionHandler(this IMvcBuilder builder, Action action) + { + builder.Services.AddLocalization(); + + builder.Services.Configure(options => { options.Filters.Add(); }); + + builder.Services.Configure(action); + + return builder; + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs b/src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs new file mode 100644 index 000000000..14a133503 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Handlers; + +public class ExceptionHandlerMiddleware +{ + private readonly RequestDelegate _next; + private readonly IMasaExceptionHandler? _masaExceptionHandler; + private readonly MasaExceptionHandlerOptions _options; + private readonly MasaExceptionLogRelationOptions _logRelationOptions; + private readonly ILogger? _logger; + + public ExceptionHandlerMiddleware( + RequestDelegate next, + IServiceProvider serviceProvider, + IOptions options, + IOptions logRelationOptions, + ILogger? logger = null) + { + _next = next; + _options = options.Value; + _masaExceptionHandler = ExceptionHandlerExtensions.GetMasaExceptionHandler(serviceProvider, _options.MasaExceptionHandlerType); + _logRelationOptions = logRelationOptions.Value; + _logger = logger; + } + + public async Task InvokeAsync(HttpContext httpContext) + { + try + { + await _next(httpContext); + } + catch (Exception exception) + { + var masaExceptionContext = new MasaExceptionContext(exception, httpContext); + if (_options.ExceptionHandler != null) + { + _options.ExceptionHandler.Invoke(masaExceptionContext); + } + else if (_masaExceptionHandler != null) + { + _masaExceptionHandler.OnException(masaExceptionContext); + } + + if (httpContext.Response.HasStarted) + return; + + if (masaExceptionContext.ExceptionHandled) + { + await httpContext.Response.WriteTextAsync( + masaExceptionContext.StatusCode, + masaExceptionContext.Message ?? masaExceptionContext.Exception.Message, + masaExceptionContext.ContentType); + return; + } + + _logger?.WriteLog(masaExceptionContext.Exception, + masaExceptionContext.Exception is UserFriendlyException ? LogLevel.Information : LogLevel.Error, + _logRelationOptions); + + if (masaExceptionContext.Exception is UserFriendlyException) + { + await httpContext.Response.WriteTextAsync((int)MasaHttpStatusCode.UserFriendlyException, + masaExceptionContext.Exception.Message); + } + else if (masaExceptionContext.Exception is MasaException || _options.CatchAllException) + { + var message = Constant.DEFAULT_EXCEPTION_MESSAGE; + await httpContext.Response.WriteTextAsync((int)HttpStatusCode.InternalServerError, message); + } + else + { + throw; + } + } + } + + +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs b/src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs new file mode 100644 index 000000000..d5ef315a7 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Handlers; + +public class ExceptionHandlingMiddleware +{ + private readonly RequestDelegate _next; + private readonly ILogger _logger; + private readonly MasaExceptionHandlingOptions _options; + + public ExceptionHandlingMiddleware( + RequestDelegate next, + ILogger logger, + IOptions options) + { + _next = next; + _logger = logger; + _options = options.Value; + } + + public async Task InvokeAsync(HttpContext httpContext) + { + try + { + await _next(httpContext); + } + catch (Exception exception) + { + if (_options.CustomExceptionHandler is not null) + { + var handlerResult = _options.CustomExceptionHandler.Invoke(exception); + + if (handlerResult.ExceptionHandled) return; + + if (handlerResult.OverrideException is not null) exception = handlerResult.OverrideException; + } + if (exception is UserFriendlyException) + { + var message = exception.Message; + _logger.LogError(exception, message); + await httpContext.Response.WriteTextAsync((int)MasaHttpStatusCode.UserFriendlyException, message); + } + else if (exception is MasaException || _options.CatchAllException) + { + var message = Constant.DEFAULT_EXCEPTION_MESSAGE; + _logger.LogError(exception, message); + await httpContext.Response.WriteTextAsync((int)HttpStatusCode.InternalServerError, message); + } + else + { + throw; + } + } + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs b/src/Utils/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs new file mode 100644 index 000000000..c24e03139 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs @@ -0,0 +1,69 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Handlers; + +/// +/// Mvc pipeline exception filter to catch global exception +/// +public class MvcGlobalExcetionFilter : IExceptionFilter +{ + private readonly IMasaExceptionHandler? _masaExceptionHandler; + private readonly MasaExceptionHandlerOptions _options; + private readonly MasaExceptionLogRelationOptions _logRelationOptions; + private readonly ILogger? _logger; + + public MvcGlobalExcetionFilter(IServiceProvider serviceProvider, + IOptions options, + IOptions logRelationOptions, + ILogger? logger = null) + { + _options = options.Value; + _masaExceptionHandler = ExceptionHandlerExtensions.GetMasaExceptionHandler(serviceProvider, _options.MasaExceptionHandlerType); + _logRelationOptions = logRelationOptions.Value; + _logger = logger; + } + + public void OnException(ExceptionContext context) + { + var masaExceptionContext = new MasaExceptionContext(context.Exception, context.HttpContext); + if (_options.ExceptionHandler != null) + { + _options.ExceptionHandler.Invoke(masaExceptionContext); + } + else + { + _masaExceptionHandler?.OnException(masaExceptionContext); + } + + if (masaExceptionContext.HttpContext.Response.HasStarted) + return; + + if (masaExceptionContext.ExceptionHandled) + { + context.ExceptionHandled = true; + context.Result = new DefaultExceptionResult( + masaExceptionContext.Message, + masaExceptionContext.StatusCode, + masaExceptionContext.ContentType); + return; + } + + _logger?.WriteLog(masaExceptionContext.Exception, + masaExceptionContext.Exception is UserFriendlyException ? LogLevel.Information : LogLevel.Error, + _logRelationOptions); + + if (masaExceptionContext.Exception is UserFriendlyException userFriendlyException) + { + context.ExceptionHandled = true; + context.Result = new UserFriendlyExceptionResult(userFriendlyException.Message); + return; + } + if (masaExceptionContext.Exception is MasaException || _options.CatchAllException) + { + context.ExceptionHandled = true; + context.Result = new InternalServerErrorObjectResult(Constant.DEFAULT_EXCEPTION_MESSAGE); + return; + } + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs b/src/Utils/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs new file mode 100644 index 000000000..0b9d57ebc --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions; + +public interface IMasaExceptionHandler +{ + void OnException(MasaExceptionContext context); +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Internal/Constant.cs b/src/Utils/src/Masa.Utils.Exceptions/Internal/Constant.cs new file mode 100644 index 000000000..e6c59bcf6 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Internal/Constant.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Internal; + +internal class Constant +{ + public const string DEFAULT_HTTP_CONTENT_TYPE = "text/plain; charset=utf-8"; + + public const string DEFAULT_EXCEPTION_MESSAGE = "An error occur in masa framework."; +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs b/src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs new file mode 100644 index 000000000..ff05ff2a7 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +internal static class ExceptionExtensions +{ + public static void WriteLog( + this ILogger logger, + Exception exception, + LogLevel defaultLogLevel, + MasaExceptionLogRelationOptions logRelationOptions, + string? message = null) + { + var logLevel = logRelationOptions.GetLogLevel(exception, defaultLogLevel); + logger.Log(logLevel, exception, message ?? exception.Message); + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs b/src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs new file mode 100644 index 000000000..7d409a73f --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Internal; + +internal static class ExceptionHandlerExtensions +{ + public static IMasaExceptionHandler? GetMasaExceptionHandler(IServiceProvider serviceProvider, Type? masaExceptionHandlerType) + { + var exceptionHandler = serviceProvider.GetService(); + if (exceptionHandler != null) + return exceptionHandler; + + if (masaExceptionHandlerType == null) + return null; + + var constructor = masaExceptionHandlerType.GetConstructors(BindingFlags.Instance | BindingFlags.Public) + .MaxBy(c => c.GetParameters().Length); + List parameters = new(); + if (constructor != null) + { + foreach (var parameterInfo in constructor.GetParameters()) + parameters.Add(serviceProvider.GetService(parameterInfo.ParameterType)); + } + var instance = Activator.CreateInstance(masaExceptionHandlerType, parameters.ToArray()); + if (instance != null) + return instance as IMasaExceptionHandler; + + return null; + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs b/src/Utils/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs new file mode 100644 index 000000000..8909aab1c --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Internal; + +internal static class HttpResponseExtensions +{ + /// + /// Write response with text/plain + /// + /// + /// + /// + /// + /// + public static async Task WriteTextAsync( + this HttpResponse httpResponse, + int statusCode, + string text, + string contentType = "text/plain; charset=utf-8") + { + httpResponse.StatusCode = statusCode; + httpResponse.ContentType = contentType; + await httpResponse.WriteAsync(text, Encoding.UTF8); + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj b/src/Utils/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj new file mode 100644 index 000000000..fe1b0f205 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj @@ -0,0 +1,11 @@ + + + + net6.0 + enable + enable + + + + + \ No newline at end of file diff --git a/src/Utils/src/Masa.Utils.Exceptions/MasaException.cs b/src/Utils/src/Masa.Utils.Exceptions/MasaException.cs new file mode 100644 index 000000000..c7f0135c1 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/MasaException.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class MasaException : Exception +{ + public string? ErrorCode { get; set; } + + public MasaException() + { + } + + public MasaException(string message) + : base(message) + { + } + + public MasaException(string message, Exception innerException) + : base(message, innerException) + { + } + + public MasaException(SerializationInfo serializationInfo, StreamingContext context) + : base(serializationInfo, context) + { + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/MasaExceptionContext.cs b/src/Utils/src/Masa.Utils.Exceptions/MasaExceptionContext.cs new file mode 100644 index 000000000..fd08374ea --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/MasaExceptionContext.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class MasaExceptionContext +{ + public Exception Exception { get; set; } + + public HttpContext HttpContext { get; } + + public bool ExceptionHandled { get; set; } + + /// + /// Http status code + /// + public int StatusCode { get; set; } + + /// + /// Error code to provide support for subsequent I18n + /// + public string? ErrorCode { get; set; } + + public string? Message { get; set; } + + public string ContentType { get; set; } + + internal MasaExceptionContext(Exception exception, HttpContext httpContext) + { + Exception = exception; + HttpContext = httpContext; + StatusCode = (int)MasaHttpStatusCode.UserFriendlyException; + ExceptionHandled = false; + ContentType = Constant.DEFAULT_HTTP_CONTENT_TYPE; + } + + public void ToResult( + string message, + int statusCode = (int)MasaHttpStatusCode.UserFriendlyException, + string contentType = Constant.DEFAULT_HTTP_CONTENT_TYPE) + { + Message = message; + StatusCode = statusCode; + ExceptionHandled = true; + ContentType = contentType; + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs b/src/Utils/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs new file mode 100644 index 000000000..9570e1afc --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions; + +public enum MasaHttpStatusCode +{ + UserFriendlyException = 299 +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs b/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs new file mode 100644 index 000000000..33179c4ec --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions; + +public class MasaExceptionHandlerOptions +{ + public bool CatchAllException { get; set; } = true; + + public Action? ExceptionHandler { get; set; } + + internal Type? MasaExceptionHandlerType { get; private set; } + + public void UseExceptionHanlder() where TExceptionHanlder : IMasaExceptionHandler + { + MasaExceptionHandlerType = typeof(TExceptionHanlder); + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs b/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs new file mode 100644 index 000000000..aab8c08cc --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions; + +public class MasaExceptionHandlingOptions +{ + public bool CatchAllException { get; set; } = true; + + public Func? CustomExceptionHandler { get; set; } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs b/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs new file mode 100644 index 000000000..06b7d4d1f --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class MasaExceptionLogRelationOptions +{ + internal Dictionary Mappings { get; } = new(); + + public MasaExceptionLogRelationOptions MapLogLevel(LogLevel logLevel) where TException : Exception + { + Mappings[typeof(TException)] = logLevel; + return this; + } + + internal LogLevel GetLogLevel(Exception exception, LogLevel defaultLogLevel) + { + if (!Mappings.TryGetValue(exception.GetType(), out var logLevel)) + logLevel = defaultLogLevel; + + return logLevel; + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/README.md b/src/Utils/src/Masa.Utils.Exceptions/README.md new file mode 100644 index 000000000..69fe60819 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/README.md @@ -0,0 +1,130 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Exceptions + +Provides a model for handling web application exceptions + +* Support custom handling exceptions for handling exceptions not provided by Masa +* Take over the `UserFriendlyException` exception and respond with a status code of 299 and return a friendly error message +* Handle all exceptions by default, and output `An error occur in masa framework` externally + +## Example: + +``` C# +Install-Package Masa.Utils.Exceptions +``` + +1. Modify `Program.cs` + +``` C# +app.UseMasaExceptionHandler(); +``` + +2. How to use? + +``` C# +app.MapGet("/Test", () +{ + throw new UserFriendlyException("This method is deprecated"); +} +``` + +3. Error response message, where Http status code is 299 + +``` js +axios + .get('/Test') + .then(response => { + if (response.status === 299) { + alert(response.data); + } + }) +``` + +## How to customize exception handling? + +1. By specifying `ExceptionHandler` + + ```` C# + app.UseMasaExceptionHandler(option => + { + option.CatchAllException = true;//Whether to catch all exceptions, the default is true, the default output of caught exceptions: An error occur in masa framework + + // Custom handling exceptions, similar to ExceptionFilter, can handle exception information according to the exception type, and output the response result through the ToResult method + option.ExceptionHandler = context => + { + if (context.Exception is ArgumentNullException argumentNullException) + { + context.ExceptionHandled = true; + context.Message = "Parameter cannot be empty"; + // or abbreviated as: context.ToResult("Parameter cannot be empty"); + } + }; + }); + ```` + +2. Implement the `IExceptionHandler` interface and register it with the service + + ```` C# + public class ExceptionHandler : IMasaExceptionHandler + { + private readonly ILogger _logger; + + public ExceptionHandler(ILogger logger) + { + _logger = logger; + } + + public void OnException(MasaExceptionContext context) + { + if (context.Exception is ArgumentNullException) + { + _logger.LogWarning(context.Message); + context.ToResult(context.Exception.Message); + } + } + } + builder.Services.AddSingleton(); + + app.UseMasaExceptionHandler(); + ```` + +3. Implement the `IExceptionHandler` interface and specify the use of Handler + + ```` C# + public class ExceptionHandler : IMasaExceptionHandler + { + private readonly ILogger _logger; + + public ExceptionHandler(ILogger logger) + { + _logger = logger; + } + + public void OnException(MasaExceptionContext context) + { + if (context.Exception is ArgumentNullException) + { + _logger.LogWarning(context.Message); + context.ToResult(context.Exception.Message); + } + } + } + app.UseMasaExceptionHandler(option => + { + option.UseExceptionHanlder(); + }); + ```` + +## Common problem + +The default log level of `UserFriendlyException` is `Information`, other types of exceptions are `Error` + +1. How to modify the log level of UserFriendlyException? + + ```` C# + builder.Services.Configure(options => + { + options.MapLogLevel(LogLevel.None); + }); + ```` \ No newline at end of file diff --git a/src/Utils/src/Masa.Utils.Exceptions/README.zh-CN.md b/src/Utils/src/Masa.Utils.Exceptions/README.zh-CN.md new file mode 100644 index 000000000..2c1364aa3 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/README.zh-CN.md @@ -0,0 +1,130 @@ +中 | [EN](README.md) + +## Masa.Utils.Exceptions + +提供了用于处理Web应用程序异常的模型 + +* 支持自定义处理异常,用于处理非Masa提供的异常 +* 接管`UserFriendlyException`异常,并响应状态码为299,返回友好的错误信息 +* 默认处理所有异常,并对外输出`An error occur in masa framework` + +## 用例: + +``` C# +Install-Package Masa.Utils.Exceptions +``` + +1. 修改`Program.cs` + +``` C# +app.UseMasaExceptionHandler(); +``` + +2. 如何使用? + +``` C# +app.MapGet("/Test", () +{ + throw new UserFriendlyException("This method is deprecated"); +} +``` + +3. 错误响应消息,其中Http状态码为299 + +``` js +axios + .get('/Test') + .then(response => { + if (response.status === 299) { + alert(response.data); + } + }) +``` + +## 如何自定义异常处理? + +1. 通过指定`ExceptionHandler` + + ``` C# + app.UseMasaExceptionHandler(option => + { + option.CatchAllException = true;//是否捕获所有异常,默认为true,捕获到的异常默认输出:An error occur in masa framework + + // 自定义处理异常,与ExceptionFilter类似,可根据异常类型处理异常信息,并通过ToResult方法输出响应结果 + option.ExceptionHandler = context => + { + if (context.Exception is ArgumentNullException argumentNullException) + { + context.ExceptionHandled = true; + context.Message = "参数不能为空"; + // 或者简写为context.ToResult("参数不能为空"); + } + }; + }); + ``` + +2. 实现`IExceptionHandler`接口,并注册到服务中 + + ``` C# + public class ExceptionHandler : IMasaExceptionHandler + { + private readonly ILogger _logger; + + public ExceptionHandler(ILogger logger) + { + _logger = logger; + } + + public void OnException(MasaExceptionContext context) + { + if (context.Exception is ArgumentNullException) + { + _logger.LogWarning(context.Message); + context.ToResult(context.Exception.Message); + } + } + } + builder.Services.AddSingleton(); + + app.UseMasaExceptionHandler(); + ``` + +3. 实现`IExceptionHandler`接口,并指定使用Handler + + ``` C# + public class ExceptionHandler : IMasaExceptionHandler + { + private readonly ILogger _logger; + + public ExceptionHandler(ILogger logger) + { + _logger = logger; + } + + public void OnException(MasaExceptionContext context) + { + if (context.Exception is ArgumentNullException) + { + _logger.LogWarning(context.Message); + context.ToResult(context.Exception.Message); + } + } + } + app.UseMasaExceptionHandler(option => + { + option.UseExceptionHanlder(); + }); + ``` + +## 常见问题 + +默认`UserFriendlyException`的日志等级为`Information`, 其它类型异常为`Error` + +1. 如何修改UserFriendlyException的日志等级? + +``` C# +builder.Services.Configure(options => +{ + options.MapLogLevel(LogLevel.None); +}); +``` \ No newline at end of file diff --git a/src/Utils/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs b/src/Utils/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs new file mode 100644 index 000000000..06999a1eb --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Mvc; + +public class DefaultExceptionResult : IActionResult +{ + public string? Message { get; set; } + + public int StatusCode { get; set; } + + public string ContentType { get; set; } + + public DefaultExceptionResult(string? message, int statusCode, string contentType) + { + Message = message; + StatusCode = statusCode; + ContentType = contentType; + } + + public async Task ExecuteResultAsync(ActionContext context) + { + await context.HttpContext.Response.WriteTextAsync(StatusCode, Message ?? Constant.DEFAULT_EXCEPTION_MESSAGE, ContentType); + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs b/src/Utils/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs new file mode 100644 index 000000000..3540a1ef0 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Mvc; + +public class InternalServerErrorObjectResult : ObjectResult +{ + public InternalServerErrorObjectResult(object obj) + : base(obj) + { + StatusCode = (int)HttpStatusCode.InternalServerError; + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs b/src/Utils/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs new file mode 100644 index 000000000..20429d2ab --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Mvc; + +public class UserFriendlyExceptionResult : IActionResult +{ + public string Message { get; set; } + + public UserFriendlyExceptionResult(string message) + { + Message = message; + } + + public async Task ExecuteResultAsync(ActionContext context) + { + await context.HttpContext.Response.WriteTextAsync((int)MasaHttpStatusCode.UserFriendlyException, Message); + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/UserFriendlyException.cs b/src/Utils/src/Masa.Utils.Exceptions/UserFriendlyException.cs new file mode 100644 index 000000000..5c2ba7787 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/UserFriendlyException.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class UserFriendlyException : MasaException +{ + public UserFriendlyException(string message) + : base(message) + { + } +} diff --git a/src/Utils/src/Masa.Utils.Exceptions/_Imports.cs b/src/Utils/src/Masa.Utils.Exceptions/_Imports.cs new file mode 100644 index 000000000..0f98ed432 --- /dev/null +++ b/src/Utils/src/Masa.Utils.Exceptions/_Imports.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Exceptions; +global using Masa.Utils.Exceptions.Handlers; +global using Masa.Utils.Exceptions.Internal; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; +global using Microsoft.AspNetCore.Mvc.Filters; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using System.Net; +global using System.Reflection; +global using System.Runtime.Serialization; +global using System.Text; diff --git a/src/Utils/src/Models/Masa.Utils.Models.Config/AppConfig.cs b/src/Utils/src/Models/Masa.Utils.Models.Config/AppConfig.cs new file mode 100644 index 000000000..c5443c2eb --- /dev/null +++ b/src/Utils/src/Models/Masa.Utils.Models.Config/AppConfig.cs @@ -0,0 +1,9 @@ + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Models.Config; +public class AppConfig +{ + public string AppId { get; set; } = string.Empty; +} diff --git a/src/Utils/src/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj b/src/Utils/src/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/src/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj b/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj new file mode 100644 index 000000000..80809863a --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs b/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs new file mode 100644 index 000000000..a215f9a9e --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication.OpenIdConnect; + +public class MasaOpenIdConnectOptions +{ + public string Authority { get; set; } = string.Empty; + + public string ClientId { get; set; } = string.Empty; + + public string ClientSecret { get; set; } = string.Empty; + + public List Scopes { get; set; } = new List(); +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs b/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..d85f09d98 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs @@ -0,0 +1,96 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Security.Authentication.OpenIdConnect; +using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.AspNetCore.Authentication.OpenIdConnect; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; +using Microsoft.IdentityModel.Protocols.OpenIdConnect; +using System.IdentityModel.Tokens.Jwt; + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddMasaOpenIdConnect( + this IServiceCollection services, + IConfiguration configuration) + { + return services.AddMasaOpenIdConnect(configuration.GetSection("oidc").Get()); + } + + public static IServiceCollection AddMasaOpenIdConnect( + this IServiceCollection services, + MasaOpenIdConnectOptions masaOpenIdConnectOptions) + { + return services.AddMasaOpenIdConnect(masaOpenIdConnectOptions.Authority, masaOpenIdConnectOptions.ClientId, + masaOpenIdConnectOptions.ClientSecret, masaOpenIdConnectOptions.Scopes.ToArray()); + } + + public static IServiceCollection AddMasaOpenIdConnect( + this IServiceCollection services, + string authority, + string clinetId, + string clientSecret, + params string[] scopes) + { + services.AddHttpContextAccessor(); + + JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); + services.AddAuthentication(options => + { + options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme; + options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; + }) + .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options => + { + options.ExpireTimeSpan = TimeSpan.FromSeconds(3600); + }) + .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options => + { + options.Authority = authority; + options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; + options.SignOutScheme = OpenIdConnectDefaults.AuthenticationScheme; + options.RequireHttpsMetadata = false; + options.ClientId = clinetId; + options.ClientSecret = clientSecret; + options.ResponseType = OpenIdConnectResponseType.Code; + + foreach (var scope in scopes) + { + options.Scope.Add(scope); + } + + options.SaveTokens = true; + options.GetClaimsFromUserInfoEndpoint = true; + options.UseTokenLifetime = true; + + options.TokenValidationParameters.RequireExpirationTime = true; + options.TokenValidationParameters.ValidateLifetime = true; + + options.NonceCookie.SameSite = SameSiteMode.Unspecified; + options.CorrelationCookie.SameSite = SameSiteMode.Unspecified; + + options.Events = new OpenIdConnectEvents + { + OnAccessDenied = context => + { + context.HandleResponse(); + context.Response.Redirect("/"); + return Task.CompletedTask; + } + }; + }); + + services.AddAuthorization(options => + { + // By default, all incoming requests will be authorized according to the default policy + options.FallbackPolicy = options.DefaultPolicy; + }); + + return services; + } +} + diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs b/src/Utils/src/Security/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs new file mode 100644 index 000000000..3ddbea269 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication.Attributes; + +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] +public class MasaAuthorizeAttribute : AuthorizeAttribute +{ + public string[] Permissions { get; set; } + + public MasaAuthorizeAttribute(params string[] permissions) + { + Permissions = permissions; + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs b/src/Utils/src/Security/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs new file mode 100644 index 000000000..8aa79822b --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication.Constants; + +public struct MasaClaimTypes +{ + public const string USER_NAME = ClaimTypes.Name; + + public const string NAME = ClaimTypes.GivenName; + + public const string USER_ID = ClaimTypes.NameIdentifier; + + public const string ROLE = ClaimTypes.Role; + + public const string EMAIL = ClaimTypes.Email; + + public const string PHONE_NUMBER = ClaimTypes.MobilePhone; + + public const string EMAIL_VERIFIED = "https://masastack.com/security/authentication/email_verified"; + + public const string PHONE_NUMBER_VERIFIED = "https://masastack.com/security/authentication/phone_number_verified"; + + public const string ENVIRONMENT = "https://masastack.com/security/authentication/environment"; + + public const string TENANT = "https://masastack.com/security/authentication/tenant"; +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs b/src/Utils/src/Security/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs new file mode 100644 index 000000000..a5d0e186a --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs @@ -0,0 +1,53 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication.Extensions; + +public static class ClaimsIdentityExtensions +{ + public static string? FindClaimValue(this ClaimsPrincipal claimsPrincipal, string claimType) + => claimsPrincipal.Claims.FirstOrDefault(c => c.Type == claimType)?.Value; + + public static Guid? FindUserId(this ClaimsPrincipal principal) + { + var userIdOrNull = principal.Claims?.FirstOrDefault(c => c.Type == MasaClaimTypes.USER_ID); + if (userIdOrNull == null || string.IsNullOrWhiteSpace(userIdOrNull.Value)) + { + return null; + } + + if (Guid.TryParse(userIdOrNull.Value, out Guid guid)) + { + return guid; + } + + return null; + } + + public static Guid? FindTenantId(this ClaimsPrincipal principal) + { + var tenantIdOrNull = principal.Claims?.FirstOrDefault(c => c.Type == MasaClaimTypes.TENANT); + if (tenantIdOrNull == null || string.IsNullOrWhiteSpace(tenantIdOrNull.Value)) + { + return null; + } + + if (Guid.TryParse(tenantIdOrNull.Value, out var guid)) + { + return guid; + } + + return null; + } + + public static string FindEnvironment(this ClaimsPrincipal principal) + { + var evironmentOrNull = principal.Claims?.FirstOrDefault(c => c.Type == MasaClaimTypes.ENVIRONMENT); + if (evironmentOrNull == null || string.IsNullOrWhiteSpace(evironmentOrNull.Value)) + { + return string.Empty; + } + + return evironmentOrNull.Value; + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs b/src/Utils/src/Security/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs new file mode 100644 index 000000000..810bf600f --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication; + +public interface ICurrentPrincipalAccessor +{ + ClaimsPrincipal? Principal { get; } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj b/src/Utils/src/Security/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj new file mode 100644 index 000000000..918c9f174 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/MasaUser.cs b/src/Utils/src/Security/Masa.Utils.Security.Authentication/MasaUser.cs new file mode 100644 index 000000000..5a33e302c --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication/MasaUser.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication; + +public class MasaUser +{ + readonly ICurrentPrincipalAccessor _principalAccessor; + + public MasaUser(ICurrentPrincipalAccessor principalAccessor) + { + _principalAccessor = principalAccessor; + } + + public virtual Claim? FindClaim(string claimType) + { + return _principalAccessor.Principal?.Claims.FirstOrDefault(c => c.Type == claimType); + } + + public virtual Claim[] FindClaims(string claimType) + { + return _principalAccessor.Principal?.Claims.Where(c => c.Type == claimType).ToArray() ?? new Claim[0]; + } + + public virtual Claim[] GetAllClaims() + { + return _principalAccessor.Principal?.Claims.ToArray() ?? new Claim[0]; + } + + public Guid? UserId => _principalAccessor.Principal?.FindUserId(); + + public string UserName => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.USER_NAME) ?? ""; + + public string Name => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.NAME) ?? ""; + + public string PhoneNumber => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.PHONE_NUMBER) ?? ""; + + public bool PhoneNumberVerified => string.Equals(_principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.PHONE_NUMBER_VERIFIED), "true", StringComparison.InvariantCultureIgnoreCase); + + public string Email => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.EMAIL) ?? ""; + + public bool EmailVerified => string.Equals(_principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.EMAIL_VERIFIED), "true", StringComparison.InvariantCultureIgnoreCase); + + public Guid? TenantId => _principalAccessor.Principal?.FindTenantId(); + + public string Environment => _principalAccessor.Principal?.FindEnvironment() ?? string.Empty; +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs b/src/Utils/src/Security/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs new file mode 100644 index 000000000..5d9526d37 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication; + +internal class ThreadCurrentPrincipalAccessor : ICurrentPrincipalAccessor, ISingletonDependency +{ + public ClaimsPrincipal? Principal => Thread.CurrentPrincipal as ClaimsPrincipal; +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/_Imports.cs b/src/Utils/src/Security/Masa.Utils.Security.Authentication/_Imports.cs new file mode 100644 index 000000000..acf0cb66f --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Authentication/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Security.Authentication.Constants; +global using Masa.Utils.Security.Authentication.Extensions; +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.Extensions.DependencyInjection; +global using System.Security.Claims; diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/AesUtils.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/AesUtils.cs new file mode 100644 index 000000000..8a23e7d78 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/AesUtils.cs @@ -0,0 +1,529 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public class AesUtils : EncryptBase +{ + private static readonly byte[] DefaultIv = + { + 0x41, + 0x72, + 0x65, + 0x79, + 0x6F, + 0x75, + 0x6D, + 0x79, + 0x53, + 0x6E, + 0x6F, + 0x77, + 0x6D, + 0x61, + 0x6E, + 0x3F + }; + + /// + /// Generate a key that complies with AES encryption rules + /// + /// + /// + public static string GenerateKey(int length) + { + var crypto = Aes.Create(); + crypto.KeySize = length; + crypto.BlockSize = 128; + crypto.GenerateKey(); + return Convert.ToBase64String(crypto.Key); + } + + /// + /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) + /// + /// String to be encrypted + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(content, GlobalConfigurationUtils.DefaultEncryKey, FillType.Right, fillCharacter, encoding); + + /// + /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) + /// + /// String to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(content, key, DefaultIv, fillType, fillCharacter, encoding); + + /// + /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) + /// + /// String to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length key or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var ivBuffer = GetSafeEncoding(encoding).GetBytes(GetSpecifiedLengthString( + iv, + 16, + () => throw new ArgumentException(nameof(key), + $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + return Encrypt(content, + key, + ivBuffer, + fillType, + fillCharacter, + encoding); + } + + /// + /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) + /// + /// String to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + key = GetSpecifiedLengthString( + key, + 32, + () => throw new ArgumentException(nameof(key), + $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter); + using var aes = Aes.Create(); + aes.Key = currentEncoding.GetBytes(key); + aes.IV = iv; + using ICryptoTransform cryptoTransform = aes.CreateEncryptor(); + byte[] buffers = currentEncoding.GetBytes(content); + byte[] encryptedData = cryptoTransform.TransformFinalBlock(buffers, 0, buffers.Length); + return Convert.ToBase64String(encryptedData); + } + + /// + /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string + /// + /// String to be decrypted + /// character for complement + /// Encoding format, default UTF-8 + /// If the decryption succeeds, the decrypted string will be returned, and if it fails, the source string will be returned. + public static string Decrypt( + string content, + char fillCharacter = ' ', + Encoding? encoding = null) + => Decrypt(content, GlobalConfigurationUtils.DefaultEncryKey, FillType.Right, fillCharacter, encoding); + + /// + /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string + /// + /// String to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decryption success returns the decrypted string, failure returns empty + public static string Decrypt( + string content, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Decrypt(content, key, DefaultIv, fillType, fillCharacter, encoding); + + /// + /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string + /// + /// String to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decryption success returns the decrypted string, failure returns empty + public static string Decrypt( + string content, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var ivBuffer = GetSafeEncoding(encoding).GetBytes(GetSpecifiedLengthString( + iv, + 16, + () => throw new ArgumentException(nameof(key), + $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + return Decrypt(content, + key, + ivBuffer, + fillType, + fillCharacter, + encoding); + } + + /// + /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string + /// + /// String to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length. 16-bit length key or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decryption success returns the decrypted string, failure returns empty + public static string Decrypt( + string content, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + key = GetSpecifiedLengthString( + key, + 32, + () => throw new ArgumentException(nameof(key), + $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter); + using var aes = Aes.Create(); + aes.Key = currentEncoding.GetBytes(key); + aes.IV = iv; + using ICryptoTransform rijndaelDecrypt = aes.CreateDecryptor(); + byte[] buffers = Convert.FromBase64String(content); + byte[] decryptedData = rijndaelDecrypt.TransformFinalBlock(buffers, 0, buffers.Length); + return currentEncoding.GetString(decryptedData); + } + + /// + /// encrypted file stream + /// + /// File streams that require encryption + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted stream result + public static CryptoStream Encrypt( + FileStream fileStream, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(fileStream, key, key, fillType, fillCharacter, encoding); + + /// + /// encrypted file stream + /// + /// File streams that require encryption + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length. 16-bit length key or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted stream result + public static CryptoStream Encrypt( + FileStream fileStream, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + + var ivBuffer = currentEncoding.GetBytes(GetSpecifiedLengthString(iv, + 16, + () => throw new ArgumentException(nameof(iv), + $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + return Encrypt(fileStream, key, ivBuffer, fillType, fillCharacter, encoding); + } + + /// + /// encrypted file stream + /// + /// File streams that require encryption + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted stream result + public static CryptoStream Encrypt( + FileStream fileStream, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + if (iv.Length != 16) + { + throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 16 bits!"); + } + + var currentEncoding = GetSafeEncoding(encoding); + key = GetSpecifiedLengthString(key, + 32, + () => throw new ArgumentException(nameof(key), + $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter); + + using var aes = Aes.Create(); + aes.Key = currentEncoding.GetBytes(key); + aes.IV = iv; + using var cryptoTransform = aes.CreateEncryptor(); + return new CryptoStream(fileStream, cryptoTransform, CryptoStreamMode.Write); + } + + /// + /// Decrypt the file stream + /// + /// file stream to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decrypt the stream result + public static CryptoStream Decrypt( + FileStream fileStream, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + + var ivBuffer = currentEncoding.GetBytes(GetSpecifiedLengthString(iv, + 16, + () => throw new ArgumentException(nameof(iv), + $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + return Decrypt(fileStream, key, ivBuffer, fillType, fillCharacter, encoding); + } + + /// + /// Decrypt the file stream + /// + /// file stream to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decrypt the stream result + public static CryptoStream Decrypt( + FileStream fileStream, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + if (iv.Length != 16) + { + throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 16 bits!"); + } + + key = GetSpecifiedLengthString(key, + 32, + () => throw new ArgumentException(nameof(key), + $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter); + + var currentEncoding = GetSafeEncoding(encoding); + using var aes = Aes.Create(); + aes.Key = currentEncoding.GetBytes(key); + aes.IV = iv; + using var cryptoTransform = aes.CreateDecryptor(); + return new CryptoStream(fileStream, cryptoTransform, CryptoStreamMode.Read); + } + + /// + /// Encrypt the specified stream with AES and output a file + /// + /// file stream to be encrypted + /// output file path + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string outputPath, + char fillCharacter = ' ', + Encoding? encoding = null) + => EncryptFile(fileStream, + GlobalConfigurationUtils.DefaultEncryKey, + outputPath, + FillType.Right, + fillCharacter, + encoding); + + /// + /// Encrypt the specified stream with AES and output a file + /// + /// file stream to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string key, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => EncryptFile(fileStream, key, key, outputPath, fillType, fillCharacter, encoding); + + /// + /// Encrypt the specified stream with AES and output a file + /// + /// file stream to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length or complement by fillType to calculate an 16-bit string + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string key, + string iv, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + using var fileStreamOut = new FileStream(outputPath, FileMode.Create); + using var cryptoStream = Encrypt(fileStream, key, iv, fillType, fillCharacter, encoding); + byte[] buffers = new byte[1024]; + while (true) + { + var count = cryptoStream.Read(buffers, 0, buffers.Length); + fileStreamOut.Write(buffers, 0, count); + if (count < buffers.Length) + { + break; + } + } + } + + /// + /// AES decrypt the specified file stream and output the file + /// + /// file stream to be decrypted + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => DecryptFile(fileStream, GlobalConfigurationUtils.DefaultEncryKey, outputPath, fillType, fillCharacter, encoding); + + /// + /// AES decrypt the specified file stream and output the file + /// + /// file stream to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string key, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => DecryptFile(fileStream, key, key, outputPath, fillType, fillCharacter, encoding); + + /// + /// AES decrypt the specified file stream and output the file + /// + /// file stream to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length or complement by fillType to calculate an 16-bit string + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string key, + string iv, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + using FileStream fileStreamOut = new(outputPath, FileMode.Create); + using CryptoStream cryptoStream = Decrypt(fileStream, key, iv, fillType, fillCharacter, encoding); + byte[] buffers = new byte[1024]; + while (true) + { + var count = cryptoStream.Read(buffers, 0, buffers.Length); + fileStreamOut.Write(buffers, 0, count); + if (count < buffers.Length) + { + break; + } + } + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs new file mode 100644 index 000000000..5db13331a --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Base64 encryption and decryption +/// +public class Base64Utils : EncryptBase +{ + /// + /// Base64 encryption + /// + /// String to be encrypted + /// Encoding format, default UTF-8 + /// encrypted data + public static string Encrypt(string content, Encoding? encoding = null) + { + byte[] buffers = GetSafeEncoding(encoding).GetBytes(content); + return Convert.ToBase64String(buffers); + } + + /// + /// Base64 decryption + /// + /// String to decrypt + /// Encoding format, default UTF-8 + /// decrypted data + public static string Decrypt(string content, Encoding? encoding = null) + { + byte[] buffers = Convert.FromBase64String(content); + return GetSafeEncoding(encoding).GetString(buffers); + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs new file mode 100644 index 000000000..2890c91a9 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public enum DESEncryType +{ + /// + /// original DES encryption + /// + Normal, + + /// + /// Easy to transfer in browser + /// + Improved +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/DesUtils.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/DesUtils.cs new file mode 100644 index 000000000..17e80496f --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/DesUtils.cs @@ -0,0 +1,415 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// DES symmetric encryption and decryption +/// +public class DesUtils : EncryptBase +{ + /// + /// Default encryption key + /// + private static readonly string DefaultEncryptKey = MD5Utils.EncryptRepeat(GlobalConfigurationUtils.DefaultEncryKey, 2); + + /// + /// 使用默认加密 + /// + /// 被加密的字符串 + /// Des encryption method, default: improved (easy to transmit) + /// Whether to convert the encrypted string to lowercase + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + DESEncryType desEncryType = DESEncryType.Improved, + bool isToLower = true, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(content, DefaultEncryptKey, desEncryType, isToLower, FillType.Right, fillCharacter, encoding); + + /// + /// Des encrypted string + /// + /// String to be encrypted + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Des encryption method, default: improved (easy to transmit) + /// Whether to convert the encrypted string to lowercase + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + DESEncryType desEncryType = DESEncryType.Improved, + bool isToLower = true, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(content, key, key, desEncryType, isToLower, fillType, fillCharacter, encoding); + + /// + /// Des encrypted string + /// + /// String to be encrypted + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Des encryption method, default: improved (easy to transmit) + /// Whether to convert the encrypted string to lowercase + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + string iv, + DESEncryType desEncryType = DESEncryType.Improved, + bool isToLower = true, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + var des = DES.Create(); + des.Key = currentEncoding.GetBytes( + GetSpecifiedLengthString(key, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + des.IV = currentEncoding.GetBytes( + GetSpecifiedLengthString(iv, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + using MemoryStream memoryStream = new MemoryStream(); + byte[] buffer = currentEncoding.GetBytes(content); + using CryptoStream cs = new CryptoStream(memoryStream, des.CreateEncryptor(), CryptoStreamMode.Write); + cs.Write(buffer, 0, buffer.Length); + cs.FlushFinalBlock(); + if (desEncryType == DESEncryType.Normal) + return Convert.ToBase64String(memoryStream.ToArray()); + + StringBuilder stringBuilder = new(); + foreach (byte b in memoryStream.ToArray()) + { + stringBuilder.AppendFormat(isToLower ? $"{b:x2}" : $"{b:X2}"); + } + + return stringBuilder.ToString(); + } + + /// + /// DES decryption with default key + /// + /// String to be decrypted + /// Des encryption method, default: improved (easy to transmit) + /// character for complement + /// Encoding format, default UTF-8 + /// decrypted result + public static string Decrypt(string content, + DESEncryType desEncryType = DESEncryType.Improved, + char fillCharacter = ' ', + Encoding? encoding = null) + => Decrypt(content, DefaultEncryptKey, desEncryType, FillType.Right, fillCharacter, encoding); + + /// + /// DES decryption + /// + /// String to be decrypted + /// 8-bit length key + /// Des encryption method, default: improved (easy to transmit) + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// decrypted result + public static string Decrypt( + string content, + string key, + DESEncryType desEncryType = DESEncryType.Improved, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Decrypt(content, key, key, desEncryType, fillType, fillCharacter, encoding); + + /// + /// DES decryption + /// + /// String to be decrypted + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Des encryption method, default: improved (easy to transmit) + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// decrypted result + public static string Decrypt( + string content, + string key, + string iv, + DESEncryType desEncryType = DESEncryType.Improved, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + using var memoryStream = new MemoryStream(); + using var des = DES.Create(); + var currentEncoding = GetSafeEncoding(encoding); + des.Key = currentEncoding.GetBytes( + GetSpecifiedLengthString(key, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + des.IV = currentEncoding.GetBytes( + GetSpecifiedLengthString(iv, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + using (MemoryStream ms = new MemoryStream()) + { + byte[] buffers = desEncryType == DESEncryType.Improved ? new byte[content.Length / 2] : Convert.FromBase64String(content); + if (desEncryType == DESEncryType.Improved) + { + for (int x = 0; x < content.Length / 2; x++) + { + int i = Convert.ToInt32(content.Substring(x * 2, 2), 16); + buffers[x] = (byte) i; + } + } + + using (CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write)) + { + cs.Write(buffers, 0, buffers.Length); + cs.FlushFinalBlock(); + } + + return currentEncoding.GetString(ms.ToArray()); + } + } + + /// + /// DES encrypts the file stream and outputs the encrypted file + /// + /// file input stream + /// file output path + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string outFilePath, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + byte[] iv = + { + 0x12, + 0x34, + 0x56, + 0x78, + 0x90, + 0xAB, + 0xCD, + 0xEF + }; + EncryptFile(fileStream, outFilePath, key, iv, fillType, fillCharacter, encoding); + } + + /// + /// DES encrypts the file stream and outputs the encrypted file + /// + /// file input stream + /// file output path + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string outFilePath, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + var ivBuffer = currentEncoding.GetBytes( + GetSpecifiedLengthString(iv, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + EncryptFile(fileStream, outFilePath, key, ivBuffer, fillType, fillCharacter, encoding); + } + + /// + /// DES encrypts the file stream and outputs the encrypted file + /// + /// file input stream + /// file output path + /// 8-bit length key + /// 8-bit length key + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string outFilePath, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + if (iv.Length != 8) + { + throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 8 bits!"); + } + + var currentEncoding = GetSafeEncoding(encoding); + using var fileStreamOut = new FileStream(outFilePath, FileMode.OpenOrCreate, FileAccess.Write); + fileStreamOut.SetLength(0); + byte[] buffers = new byte[100]; + long readLength = 0; + using var des = DES.Create(); + des.Key = currentEncoding.GetBytes( + GetSpecifiedLengthString(key, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + des.IV = iv; + + using var cryptoStream = new CryptoStream(fileStreamOut, des.CreateEncryptor(), + CryptoStreamMode.Write); + while (readLength < fileStream.Length) + { + var length = fileStream.Read(buffers, 0, 100); + cryptoStream.Write(buffers, 0, length); + readLength += length; + } + } + + /// + /// DES decrypts the file stream and outputs the source file + /// + /// input file stream to be decrypted + /// file output path + /// decryption key or complement by fillType to calculate an 8-bit string + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string outFilePath, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + byte[] iv = + { + 0x12, + 0x34, + 0x56, + 0x78, + 0x90, + 0xAB, + 0xCD, + 0xEF + }; + DecryptFile(fileStream, outFilePath, key, iv, fillType, fillCharacter, encoding); + } + + /// + /// DES decrypts the file stream and outputs the source file + /// + /// input file stream to be decrypted + /// file output path + /// decryption key or complement by fillType to calculate an 8-bit string + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string outFilePath, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + + var ivBuffer = currentEncoding.GetBytes( + GetSpecifiedLengthString(iv, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + DecryptFile(fileStream, outFilePath, key, ivBuffer, fillType, fillCharacter, currentEncoding); + } + + /// + /// DES decrypts the file stream and outputs the source file + /// + /// input file stream to be decrypted + /// file output path + /// decryption key or complement by fillType to calculate an 8-bit string + /// + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string outFilePath, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + if (iv.Length != 8) + { + throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 8 bits!"); + } + + var currentEncoding = GetSafeEncoding(encoding); + using var fileStreamOut = new FileStream(outFilePath, FileMode.OpenOrCreate, FileAccess.Write); + fileStreamOut.SetLength(0); + byte[] buffers = new byte[100]; + long readLength = 0; + using var des = DES.Create(); + des.Key = currentEncoding.GetBytes( + GetSpecifiedLengthString(key, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + des.IV = iv; + using var cryptoStream = new CryptoStream(fileStreamOut, des.CreateDecryptor(), + CryptoStreamMode.Write); + while (readLength < fileStream.Length) + { + var length = fileStream.Read(buffers, 0, 100); + cryptoStream.Write(buffers, 0, length); + readLength += length; + } + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs new file mode 100644 index 000000000..e64c337d6 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public class EncryptBase +{ + protected static string GetSpecifiedLengthString( + string key, + int length, + Func func, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ') + { + if (fillType == FillType.NoFile && key.Length < length) + { + throw func.Invoke(); + } + + if (key.Length >= length) + { + return key.Substring(0, length); + } + + if (fillType == FillType.Left) + { + return key.PadLeft(length, fillCharacter); + } + + if (fillType == FillType.Right) + { + return key.PadRight(length, fillCharacter); + } + + throw new NotSupportedException($"... Unsupported {nameof(fillType)}"); + } + + protected static Encoding GetSafeEncoding(Encoding? encoding = null) + => GetSafeEncoding(() => Encoding.UTF8, encoding); + + protected static Encoding GetSafeEncoding(Func func, Encoding? encoding = null) + => encoding ?? func.Invoke(); +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptType.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptType.cs new file mode 100644 index 000000000..30658e7e2 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptType.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public enum EncryptType +{ + Md5, + Sha1, + Sha256, + Sha384, + Sha512 +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/FillType.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/FillType.cs new file mode 100644 index 000000000..2709d93ce --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/FillType.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public enum FillType +{ + NoFile = 1, + /// + /// left fill + /// + Left = 2, + /// + /// right fill + /// + Right = 3 +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs new file mode 100644 index 000000000..ffc41192b --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public class GlobalConfigurationUtils +{ + private static string _defaultEncryKey = "masastack.com"; + + public static string DefaultEncryKey + { + get => _defaultEncryKey; + set + { + if (string.IsNullOrWhiteSpace(value)) + throw new ArgumentException($"{nameof(DefaultEncryKey)} cannot be empty", nameof(DefaultEncryKey)); + + _defaultEncryKey = value; + } + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs new file mode 100644 index 000000000..7ce6d52fe --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs @@ -0,0 +1,48 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public class HashAlgorithmBase : EncryptBase +{ + /// + /// encryption + /// + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// + /// + public static string Encrypt(EncryptType encryptType, string content, bool isToLower = false, Encoding? encoding = null) + { + using (var hashAlgorithm = HashAlgorithm.Create(encryptType.ToString())) + { + if (hashAlgorithm == null) + throw new NotSupportedException("Unsupported encryptType"); + + byte[] buffer = GetSafeEncoding(encoding).GetBytes(content); + buffer = hashAlgorithm.ComputeHash(buffer); + return Encrypt(encryptType, buffer, hashAlgorithm, isToLower); + } + } + + protected static string Encrypt(EncryptType encryptType, byte[] buffer, HashAlgorithm? hashAlgorithm = null, bool isToLower = false) + { + using (hashAlgorithm ??= HashAlgorithm.Create(encryptType.ToString())) + { + if (hashAlgorithm == null) + throw new NotSupportedException("Unsupported encryptType"); + + hashAlgorithm.Clear(); + + StringBuilder stringBuilder = new StringBuilder(); + foreach (byte b in buffer) + { + stringBuilder.AppendFormat("{0:x2}", b); + } + + var result = BitConverter.ToString(buffer).Replace("-", ""); + return isToLower ? result.ToLower() : result; + } + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs new file mode 100644 index 000000000..5a771a70d --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs @@ -0,0 +1,117 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// MD5加密算法 +/// +public class MD5Utils : HashAlgorithmBase +{ + /// + /// MD5 encryption of string + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// + private static string Encrypt( + string content, + bool isToLower = true, + Encoding? encoding = null) + => Encrypt(content, string.Empty, isToLower, encoding); + + /// + /// MD5 multiple encryption + /// + /// String to be encrypted + /// Encryption times,default: 1 + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string EncryptRepeat( + string content, + int encryptTimes = 1, + bool isToLower = true, + Encoding? encoding = null) + => EncryptRepeat(content, string.Empty, encryptTimes, false, isToLower, encoding); + + /// + /// MD5 salt-encrypted string + /// + /// String to be encrypted + /// + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string salt, + bool isToLower = true, + Encoding? encoding = null) + => Encrypt(EncryptType.Md5, content + salt, isToLower, encoding); + + /// + /// MD5 multiple encryption + /// + /// String to be encrypted + /// + /// + /// When the number of executions is greater than 1, is it necessary to add salt and then encrypt after the second time? default: false (Salt encryption only for the first time) + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string EncryptRepeat( + string content, + string salt, + int encryptTimes, + bool isNeedSalt = false, + bool isToLower = true, + Encoding? encoding = null) + { + if (encryptTimes < 1) + throw new ArgumentException($"{nameof(encryptTimes)} must be greater than or equal to 1", nameof(encryptTimes)); + + int times = 1; + string result = Encrypt(content + salt, isToLower, encoding); + while (times < encryptTimes) + { + result = isNeedSalt ? result + salt : result; + result = Encrypt(result, isToLower, encoding); + times++; + } + + return result; + } + + /// + /// Get the MD5 value of the file + /// + /// absolute path to the file + /// Whether to convert the encrypted string to lowercase + /// encrypted result + public static string EncryptFile(string fileName, bool isToLower = true) + { + using var fileStream = File.Open(fileName, FileMode.Open, FileAccess.Read); + return EncryptStream(fileStream, isToLower); + } + + /// + /// Get the MD5 value of the data stream + /// + /// + /// Whether to convert the encrypted string to lowercase + /// encrypted result + public static string EncryptStream(Stream stream, bool isToLower = true) + { + stream.Position = 0; + byte[] buffers = new byte[stream.Length]; + stream.Read(buffers, 0, buffers.Length); + stream.Seek(0, SeekOrigin.Begin); + using var md5 = MD5.Create(); + byte[] bytes = md5.ComputeHash(buffers); + var encryptedContent = Encrypt(EncryptType.Md5, bytes, null, isToLower); + stream.Position = 0; + return encryptedContent; + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs new file mode 100644 index 000000000..b71f70354 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Hash algorithm encryption SHA1 +/// +public class SHA1Utils : HashAlgorithmBase +{ + /// + /// Encrypt string with SHA1 + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) + => Encrypt(EncryptType.Sha1, content, isToLower, encoding); +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs new file mode 100644 index 000000000..d3567d057 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Hash algorithm encryption SHA256 +/// +public class SHA256Utils : HashAlgorithmBase +{ + /// + /// Encrypt string with SHA256 + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) + => Encrypt(EncryptType.Sha256, content, isToLower, encoding); +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs new file mode 100644 index 000000000..fb4bdfe4a --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Hash algorithm encryption SHA384 +/// +public class SHA384Utils : HashAlgorithmBase +{ + /// + /// Encrypt string with SHA384 + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) + => Encrypt(EncryptType.Sha384, content, isToLower, encoding); +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs new file mode 100644 index 000000000..383547368 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Hash algorithm encryption SHA512 +/// +public class SHA512Utils : HashAlgorithmBase +{ + /// + /// Encrypt string with SHA512 + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) + => Encrypt(EncryptType.Sha512, content, isToLower, encoding); +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/_Imports.cs b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/_Imports.cs new file mode 100644 index 000000000..c813f8c2c --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Cryptography/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.Security.Cryptography; +global using System.Text; diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs b/src/Utils/src/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs new file mode 100644 index 000000000..a8a18c930 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs @@ -0,0 +1,85 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Token; + +public class DefaultJwtProvider : IJwtProvider +{ + private readonly JwtConfigurationOptions _options; + private readonly ILogger? _logger; + + public DefaultJwtProvider(IOptionsSnapshot options, ILogger? logger = null) + { + _options = options.Value; + _logger = logger; + } + + public string CreateToken(string value, TimeSpan timeout) + => CreateToken(new[] + { + new Claim(ClaimTypes.Sid, value), + }, timeout); + + public string CreateToken(Claim[] claims, TimeSpan timeout) + { + DateTime notBefore = DateTime.UtcNow; + DateTime expires = notBefore.Add(timeout); + var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_options.SecurityKey)); + var credentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); + var token = new JwtSecurityToken( + _options.Issuer, + _options.Audience, + claims, + notBefore, + expires, + credentials); + var tokenHandler = new JwtSecurityTokenHandler(); + return tokenHandler.WriteToken(token); + } + + public bool IsValid(string token, string value, Action? action = null) + { + var isValid = IsValid(token, out _, + out ClaimsPrincipal? claimsPrincipal, action); + + return isValid && claimsPrincipal != null && claimsPrincipal.HasClaim(ClaimTypes.Sid, value); + } + + public bool IsValid( + string token, + out SecurityToken? securityToken, + out ClaimsPrincipal? claimsPrincipal, + Action? action = null) + { + securityToken = null; + claimsPrincipal = null; + + try + { + var handler = new JwtSecurityTokenHandler(); + var validationParameters = new TokenValidationParameters() + { + ValidateIssuer = true, + ValidateAudience = true, + ValidateLifetime = true, + ValidateIssuerSigningKey = true, + ValidIssuer = _options.Issuer, + ValidAudience = _options.Audience, + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_options.SecurityKey)), + }; + action?.Invoke(validationParameters); + claimsPrincipal = handler.ValidateToken(token, validationParameters, out securityToken); + return securityToken != null; + } + catch (SecurityTokenException ex) + { + _logger?.LogError("... IsValid Failed on SecurityTokenException", ex); + return false; + } + catch (Exception ex) + { + _logger?.LogError("... IsValid Failed", ex); + return false; + } + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/IJwtProvider.cs b/src/Utils/src/Security/Masa.Utils.Security.Token/IJwtProvider.cs new file mode 100644 index 000000000..80e9b41e2 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Token/IJwtProvider.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Token; + +public interface IJwtProvider +{ + string CreateToken(string value, TimeSpan timeout); + + string CreateToken(Claim[] claims, TimeSpan timeout); + + bool IsValid( + string token, + string value, + Action? action = null); + + bool IsValid( + string token, + out SecurityToken? securityToken, + out ClaimsPrincipal? claimsPrincipal, + Action? action = null); +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/JwtUtils.cs b/src/Utils/src/Security/Masa.Utils.Security.Token/JwtUtils.cs new file mode 100644 index 000000000..0868b912e --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Token/JwtUtils.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Token; + +public class JwtUtils +{ + private static IServiceProvider? _serviceProvider; + + public JwtUtils(IServiceCollection services) + { + _serviceProvider ??= services.BuildServiceProvider(); + } + + private static IServiceProvider GetServiceProvider() => _serviceProvider!.CreateScope().ServiceProvider; + + private static IJwtProvider GetJwtProvider() => GetServiceProvider().GetRequiredService(); + + + public static string CreateToken(string value, TimeSpan timeout) + => GetJwtProvider().CreateToken(value, timeout); + + public static string CreateToken(Claim[] claims, TimeSpan timeout) + => GetJwtProvider().CreateToken(claims, timeout); + + public static bool IsValid(string token, string value) + => GetJwtProvider().IsValid(token, value); + + public static bool IsValid(string token, out SecurityToken? securityToken, out ClaimsPrincipal? claimsPrincipal) + => GetJwtProvider().IsValid(token, out securityToken, out claimsPrincipal); +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj b/src/Utils/src/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj new file mode 100644 index 000000000..55615dc4e --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs b/src/Utils/src/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs new file mode 100644 index 000000000..eedfd42bb --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Token.Model; + +public class JwtConfigurationOptions +{ + public string Issuer { get; set; } = default!; + + public string Audience { get; set; } = default!; + + public string SecurityKey { get; set; } = default!; +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs b/src/Utils/src/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..972fb39f0 --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddJwt(this IServiceCollection services, Action options) + { + services.Configure(options); + services.TryAddScoped(); + new JwtUtils(services); + return services; + } +} diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/_Imports.cs b/src/Utils/src/Security/Masa.Utils.Security.Token/_Imports.cs new file mode 100644 index 000000000..418c9db5c --- /dev/null +++ b/src/Utils/src/Security/Masa.Utils.Security.Token/_Imports.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Security.Token; +global using Masa.Utils.Security.Token.Model; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using Microsoft.IdentityModel.Tokens; +global using System.IdentityModel.Tokens.Jwt; +global using System.Security.Claims; +global using System.Text; diff --git a/src/Utils/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs b/src/Utils/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs new file mode 100644 index 000000000..f4b844ca7 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs @@ -0,0 +1,115 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Tests; + +[TestClass] +public class ConvertToValueTest +{ + [TestMethod] + public void TestConvertByGuid() + { + Guid id = Guid.NewGuid(); + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByByte() + { + byte id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertBySByte() + { + sbyte id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByUShort() + { + ushort id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByUInt() + { + uint id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByULong() + { + ulong id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByShort() + { + short id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByInt() + { + int id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByLong() + { + long id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByDouble() + { + double score = 1.1d; + RedisValue obj = RedisHelper.ConvertFromValue(score); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == score); + } + + [TestMethod] + public void TestConvertByFloat() + { + float score = 1.1f; + RedisValue obj = RedisHelper.ConvertFromValue(score); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == score); + } + + [TestMethod] + public void TestConvertByDecimal() + { + decimal score = 1.1m; + dynamic obj = RedisHelper.ConvertFromValue(score); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == score); + } + + [TestMethod] + public void TestConvertByDynamic() + { + dynamic user = new + { + Name = "Jim" + }; + RedisValue obj = RedisHelper.ConvertFromValue(user)!; + Assert.IsTrue(RedisHelper.ConvertToValue(obj)!.Name == user.Name); + } +} diff --git a/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj b/src/Utils/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj similarity index 65% rename from test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj rename to src/Utils/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj index 706ae461c..d611420d0 100644 --- a/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj +++ b/src/Utils/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj @@ -2,19 +2,20 @@ net6.0 + enable enable false - - - - + + + + - + diff --git a/src/Utils/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs new file mode 100644 index 000000000..fe0e0105a --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caching.Redis.Helpers; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using StackExchange.Redis; +global using System; diff --git a/src/Utils/test/Masa.Utils.Caller.Core.Tests/CallerTest.cs b/src/Utils/test/Masa.Utils.Caller.Core.Tests/CallerTest.cs new file mode 100644 index 000000000..24f0efc41 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Core.Tests/CallerTest.cs @@ -0,0 +1,204 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Tests; + +[TestClass] +public class CallerTest +{ + [TestMethod] + public void TestCallerProviderServiceLifetime() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "http"; + clientBuilder.IsDefault = true; + clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + var callerProvider1 = serviceProvider.GetRequiredService(); + var callerProvider2 = serviceProvider.GetRequiredService(); + Assert.IsTrue(callerProvider1 == callerProvider2); + } + + [TestMethod] + public void TestCaller() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "http"; + clientBuilder.IsDefault = true; + clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; + }); + opt.UseDapr(clientBuilder => + { + clientBuilder.Name = "dapr"; + clientBuilder.IsDefault = false; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + var callerProvider = serviceProvider.GetRequiredService(); + Assert.IsNotNull(callerProvider); + + var caller = serviceProvider.GetRequiredService().CreateClient(); + var daprCaller = serviceProvider.GetRequiredService().CreateClient("dapr"); + var httpCaller = serviceProvider.GetRequiredService().CreateClient("http"); + + Assert.IsTrue(caller.GetType().FullName != daprCaller.GetType().FullName); + Assert.IsTrue(caller.GetType().FullName == httpCaller.GetType().FullName); + } + + [TestMethod] + public void TestMultiDefaultCaller() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + opt.UseHttpClient(builder => + { + builder.Name = "gitee"; + builder.BaseAddress = "https://gitee.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestMultiDefaultCaller2() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "gitee"; + builder.BaseAddress = "https://gitee.com/masastack"; + builder.IsDefault = true; + }); + }); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestRepeatCallerName() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestRepeatCallerName2() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestRepeatCallerName3() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = typeof(GithubCaller).FullName!; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestAddMultiCaller() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "masastack"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "masastack2"; + builder.BaseAddress = "https://github.com/masastack"; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack")); + Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack2")); + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Core.Tests/Callers/GithubCaller.cs b/src/Utils/test/Masa.Utils.Caller.Core.Tests/Callers/GithubCaller.cs new file mode 100644 index 000000000..0dac01c59 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Core.Tests/Callers/GithubCaller.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Tests.Callers; + +public class GithubCaller : HttpClientCallerBase +{ + public GithubCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + protected override string BaseAddress { get; set; } = default!; +} diff --git a/src/Utils/test/Masa.Utils.Caller.Core.Tests/Masa.Utils.Caller.Core.Tests.csproj b/src/Utils/test/Masa.Utils.Caller.Core.Tests/Masa.Utils.Caller.Core.Tests.csproj new file mode 100644 index 000000000..5bbd621bd --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Core.Tests/Masa.Utils.Caller.Core.Tests.csproj @@ -0,0 +1,23 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + + + diff --git a/src/Utils/test/Masa.Utils.Caller.Core.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Caller.Core.Tests/_Imports.cs new file mode 100644 index 000000000..ae2f7853a --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Core.Tests/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caller.Core.Tests.Callers; +global using Masa.Utils.Caller.DaprClient; +global using Masa.Utils.Caller.HttpClient; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/AutomaticCallerTest.cs b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/AutomaticCallerTest.cs new file mode 100644 index 000000000..81d14f34b --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/AutomaticCallerTest.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.IntegratedTest; + +[TestClass] +public class AutomaticCallerTest +{ + private WebApplicationBuilder _builder = default!; + + [TestInitialize] + public void EdgeDriverInitialize() + { + _builder = WebApplication.CreateBuilder(); + } + + [TestMethod] + public async Task TestGetAsync() + { + _builder.Services.AddCaller(); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var githubCaller = serviceProvider.GetRequiredService(); + Assert.IsTrue(await githubCaller.GetAsync()); + } + + [TestMethod] + public void TestRepeatAddCaller() + { + Assert.ThrowsException(() => + { + _builder.Services.AddCaller().AddCaller(); + }); + } + + [TestMethod] + public void TestDaprCallerReturnCallerProviderIsNotNull() + { + _builder.Services.AddCaller(); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var caller = serviceProvider.GetRequiredService(); + Assert.IsTrue(caller.CallerProviderIsNotNull()); + } + + [TestMethod] + public void TestCustomDaprBaseReturnAppIdIsEqualUserService() + { + _builder.Services.AddCaller(); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var roleCaller = serviceProvider.GetRequiredService(); + var userCaller = serviceProvider.GetRequiredService(); + Assert.IsTrue(roleCaller.GetAppId() == "User-Service" && userCaller.GetAppId() == "User-Service"); + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/DaprCaller.cs b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/DaprCaller.cs new file mode 100644 index 000000000..f66919cc7 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/DaprCaller.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.IntegratedTest.Callers; + +public class DaprCaller : DaprCallerBase +{ + public DaprCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + AppId = "DaprCaller"; + } + + protected override string AppId { get; set; } + + public bool CallerProviderIsNotNull() => CallerProvider != null; +} diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/GithubCaller.cs b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/GithubCaller.cs new file mode 100644 index 000000000..f2b5a6b0e --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/GithubCaller.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.IntegratedTest.Callers; + +public class GithubCaller : HttpClientCallerBase +{ + public GithubCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + BaseAddress = "https://github.com/masastack"; + } + + protected override string BaseAddress { get; set; } + + public async Task GetAsync() + { + var res = await CallerProvider.GetAsync(""); + return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/RoleCaller.cs b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/RoleCaller.cs new file mode 100644 index 000000000..e900c6d7c --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/RoleCaller.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.IntegratedTest.Callers; + +public class RoleCaller: UserDaprCallerBase +{ + public RoleCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserCaller.cs b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserCaller.cs new file mode 100644 index 000000000..bb8d37930 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserCaller.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.IntegratedTest.Callers; + +public class UserCaller : UserDaprCallerBase +{ + public UserCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserDaprCallerBase.cs b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserDaprCallerBase.cs new file mode 100644 index 000000000..8d7d93b6a --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserDaprCallerBase.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.IntegratedTest.Callers; + +public abstract class UserDaprCallerBase : DaprCallerBase +{ + protected override string AppId { get; set; }= "User-Service"; + + protected UserDaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public string GetAppId() => AppId; +} diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Masa.Utils.Caller.IntegratedTests.csproj b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Masa.Utils.Caller.IntegratedTests.csproj new file mode 100644 index 000000000..61700680e --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Masa.Utils.Caller.IntegratedTests.csproj @@ -0,0 +1,28 @@ + + + + net6.0 + enable + false + enable + Masa.Utils.Caller.IntegratedTest + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/_Imports.cs b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/_Imports.cs new file mode 100644 index 000000000..297838fd6 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caller.Core; +global using Masa.Utils.Caller.DaprClient; +global using Masa.Utils.Caller.HttpClient; +global using Masa.Utils.Caller.IntegratedTest.Callers; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System.Net; diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs b/src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs new file mode 100644 index 000000000..576c4ba35 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs @@ -0,0 +1,138 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests; + +[TestClass] +public class CallerTest +{ + private WebApplicationBuilder _builder = default!; + + [TestInitialize] + public void EdgeDriverInitialize() + { + _builder = WebApplication.CreateBuilder(); + } + + [TestMethod] + public async Task TestGetAsync() + { + _builder.Services.AddCaller(callerOptions => + { + callerOptions.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Configure = builder => builder.Timeout = TimeSpan.FromSeconds(3); + httpClientBuilder.BaseAddress = "https://github.com/masastack"; + }); + }); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var githubCaller = serviceProvider.GetRequiredService(); + Assert.IsTrue(await GetAsync(githubCaller)); + } + + private async Task GetAsync(ICallerProvider callerProvider) + { + var res = await callerProvider.GetAsync(""); + return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; + } + + [TestMethod] + public void TestConvertToDictionaryByDynamic() + { + var provider = new DefaultTypeConvertProvider(); + var dictionary = new Dictionary + { + { "account", "jim" }, + { "age", "18" } + }; + var request = new + { + account = "jim", + age = 18 + }; + var result = provider.ConvertToDictionary(request); + Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + } + + [TestMethod] + public void TestConvertToDictionaryByObject() + { + var provider = new DefaultTypeConvertProvider(); + var query = new UserListQury("Jim"); + var dictionary = new Dictionary + { + { "name", query.Name } + }; + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + } + + [TestMethod] + public void TestConvertToDictionaryByObject2() + { + var provider = new DefaultTypeConvertProvider(); + var query = new UserDetailQury("Jim", "Music", "Game"); + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(result.Count == 2); + Assert.IsTrue(result["name"] == query.Name); + Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + { + "Music", + "Game" + })); + } + + [TestMethod] + public void TestConvertToDictionaryByObject3() + { + var provider = new DefaultTypeConvertProvider(); + + List tags = null!; + var query = new UserDetailQury("Jim", tags); + var result = provider.ConvertToDictionary(query); + + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["name"] == query.Name); + } + + [TestMethod] + public void TestConvertToDictionaryByObject4() + { + var provider = new DefaultTypeConvertProvider(); + var query = new UserDetailQury(null!, "Music", "Game"); + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + { + "Music", + "Game" + })); + } + + [TestMethod] + public void TestConvertToDictionaryByObject5() + { + var provider = new DefaultTypeConvertProvider(); + var dic = new Dictionary() + { + { "Account", "Jim" } + }; + var result = provider.ConvertToDictionary(dic); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Account"] == "Jim"); + } + + [TestMethod] + public void TestConvertToDictionaryByObject6() + { + var provider = new DefaultTypeConvertProvider(); + var dic = new List>() + { + new("Account", "Jim") + }; + var result = provider.ConvertToDictionary(dic); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Account"] == "Jim"); + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/CustomHttpClientCallerProvider.cs b/src/Utils/test/Masa.Utils.Caller.Tests/CustomHttpClientCallerProvider.cs new file mode 100644 index 000000000..e46ce062b --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/CustomHttpClientCallerProvider.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests; + +public class CustomHttpClientCallerProvider : HttpClientCallerProvider +{ + public CustomHttpClientCallerProvider(IServiceProvider serviceProvider, string name, string baseApi) + : base(serviceProvider, name, baseApi) + { + } + + public string GetResult(string? methodName) => base.GetRequestUri(methodName); +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/DefaultXmlResponseMessage.cs b/src/Utils/test/Masa.Utils.Caller.Tests/DefaultXmlResponseMessage.cs new file mode 100644 index 000000000..c5d255338 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/DefaultXmlResponseMessage.cs @@ -0,0 +1,91 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests; + +public class DefaultXmlResponseMessage : IResponseMessage +{ + private readonly ILogger? _logger; + + public DefaultXmlResponseMessage(ILogger? logger = null) + { + _logger = logger; + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, + CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case HttpStatusCode.Accepted: + case HttpStatusCode.NoContent: + return default; + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + return (TResponse)Convert.ChangeType(content, typeof(TResponse)); + } + try + { + var res = await response.Content.ReadAsStringAsync(cancellationToken); + return XmlUtils.Deserialize(res) ?? + throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); + } + catch (Exception exception) + { + _logger?.LogWarning(exception, exception.Message); + ExceptionDispatchInfo.Capture(exception).Throw(); + return default; //This will never be executed, the previous line has already thrown an exception + } + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + return default; //never executed + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + return; + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + } + + public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.Content.Headers.ContentLength is > 0) + throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); + + throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs b/src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs new file mode 100644 index 000000000..eba6de05c --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs @@ -0,0 +1,130 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using System.Net.Http.Json; + +namespace Masa.Utils.Caller.Tests; + +[TestClass] +public class HttpClientCallerTest +{ + [DataTestMethod] + [DataRow("https://github.com/", "/check/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com", "/check/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com", "check/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check", "healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check/", "healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check/", "/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check/", "/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com/check/", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com/check", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com", "", "")] + [DataRow("http://github.com", "", "")] + [DataRow("/v1/check", "healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("", "healthy", "healthy")] + [DataRow("", "/healthy?id=1", "/healthy?id=1")] + public void TestGetRequestUri(string prefix, string methods, string result) + { + var services = new ServiceCollection(); + services.AddCaller(opt => opt.UseHttpClient()); + var serviceProvider = services.BuildServiceProvider(); + var provider = new CustomHttpClientCallerProvider(serviceProvider, string.Empty, prefix); + Assert.IsTrue(provider.GetResult(methods) == result); + } + + [TestMethod] + public async Task TestRequestDataIsXmlAsync() + { + var services = new ServiceCollection(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + Mock httpClientFactory = new(); + var handlerMock = new Mock(); + var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) + { + BaseAddress = new Uri("http://localhost:5000") + }; + var response = new BaseResponse("success"); + handlerMock + .Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny() + ) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent(XmlUtils.Serializer(response)) + }) + .Verifiable(); + + httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); + services.AddSingleton(httpClientFactory.Object); + var serviceProvider = services.BuildServiceProvider(); + string name = ""; + string prefix = ""; + var httpClientCallerProvider = new HttpClientCallerProvider(serviceProvider, name, prefix); + + var res = await httpClientCallerProvider.PostAsync("Hello", new RegisterUser("Jim", "123456")); + Assert.IsNotNull(res); + Assert.IsTrue(res.Code == response.Code); + } + + [TestMethod] + public async Task TestRequestMessageReturnOnceAsync() + { + var services = new ServiceCollection(); + RegisterUser registerUser = new RegisterUser("Jim", "123456"); + + services.AddSingleton(); + Mock requestMessage = new(); + requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny())) + .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello")).Verifiable(); + requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello") + { + Content = JsonContent.Create(registerUser) + }).Verifiable(); + services.AddSingleton(_ => requestMessage.Object); + services.AddSingleton(); + Mock httpClientFactory = new(); + var handlerMock = new Mock(); + var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) + { + BaseAddress = new Uri("http://localhost:5000") + }; + var response = new BaseResponse("success"); + handlerMock + .Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny() + ) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent(XmlUtils.Serializer(response)) + }) + .Verifiable(); + + httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); + services.AddSingleton(httpClientFactory.Object); + var serviceProvider = services.BuildServiceProvider(); + string name = ""; + string prefix = ""; + var httpClientCallerProvider = new HttpClientCallerProvider(serviceProvider, name, prefix); + + var res = await httpClientCallerProvider.PostAsync("Hello", registerUser); + Assert.IsNotNull(res); + Assert.IsTrue(res.Code == response.Code); + requestMessage.Verify(r => r.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny()), Times.Once); + } +} diff --git a/test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj b/src/Utils/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj similarity index 64% rename from test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj rename to src/Utils/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj index 6286e0fc0..bf39768db 100644 --- a/test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj @@ -16,9 +16,9 @@ - - - + + + diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserDetailQury.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserDetailQury.cs new file mode 100644 index 000000000..2b82607ad --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserDetailQury.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Queries; + +public class UserDetailQury +{ + public Guid? Id { get; set; } + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonIgnore] + public int Age { get; set; } + + public DateTime? DelTime { get; set; } + + public List? Tags { get; set; } + + public UserDetailQury() + { + this.Id = Guid.NewGuid(); + } + + public UserDetailQury(string name, params string[] tags) : this(name, tags.ToList()) + { + } + + public UserDetailQury(string name, List tags) + { + Name = name; + Tags = tags; + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserListQury.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserListQury.cs new file mode 100644 index 000000000..d3302d97c --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserListQury.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Queries; + +public class UserListQury +{ + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonIgnore] + public int Age { get; set; } + + public UserListQury(string name) + { + Name = name; + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Requesties/RegisterUser.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Requesties/RegisterUser.cs new file mode 100644 index 000000000..2f4e3608f --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Requesties/RegisterUser.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Requesties; + +[XmlRoot] +public class RegisterUser +{ + [XmlElement] + public string Account { get; set; } = default!; + + [XmlElement] + public string Password { get; set; } = default!; + + public RegisterUser() { } + + public RegisterUser(string account, string password) : this() + { + Account = account; + Password = password; + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Response/BaseResponse.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Response/BaseResponse.cs new file mode 100644 index 000000000..9dc1f20a3 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Response/BaseResponse.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Response; + +[Serializable] +[XmlRoot] +public class BaseResponse +{ + [XmlElement] + public string Code { get; set; } = default!; + + public BaseResponse() { } + + public BaseResponse(string code) { Code = code; } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs b/src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs new file mode 100644 index 000000000..c0ef20ca4 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests; + +[TestClass] +public class TypeConvertTest +{ + [TestMethod] + public void TestConvertToKeyValuePairs() + { + var defaultTypeConvertProvider = new DefaultTypeConvertProvider(); + var result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new + { + id = 1, + name = "masa" + }).ToList(); + Assert.AreEqual(2, result.Count()); + Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "1")); + Assert.IsTrue(result.Any(x => x.Key == "name" && x.Value == "masa")); + + result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new + { + id = 2, + text = "masa" + }).ToList(); + Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "2")); + Assert.IsTrue(result.Any(x => x.Key == "text" && x.Value == "masa")); + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Utils/XmlUtils.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Utils/XmlUtils.cs new file mode 100644 index 000000000..cf6636256 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Utils/XmlUtils.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Utils; + +public class XmlUtils +{ + public static string Serializer(object data) + { + MemoryStream ms = new MemoryStream(); + StreamWriter sw = new StreamWriter(ms, Encoding.UTF8); + XmlSerializer xz = new XmlSerializer(data.GetType()); + xz.Serialize(sw, data); + return Encoding.UTF8.GetString(ms.ToArray()); + } + + public static T Deserialize(string xml) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); + using MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml.ToCharArray())); + return (T)xmlSerializer.Deserialize(stream)!; + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/XmlRequestMessage.cs b/src/Utils/test/Masa.Utils.Caller.Tests/XmlRequestMessage.cs new file mode 100644 index 000000000..03cf5703c --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/XmlRequestMessage.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests; + +public class XmlRequestMessage : IRequestMessage +{ + public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) + => Task.FromResult(requestMessage); + + public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) + { + var xmlContent = XmlUtils.Serializer(data!); + requestMessage.Content = new StringContent(xmlContent); + return Task.FromResult(requestMessage); + } +} diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs new file mode 100644 index 000000000..f7a1a4d87 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caller.Core; +global using Masa.Utils.Caller.HttpClient; +global using Masa.Utils.Caller.Tests.Queries; +global using Masa.Utils.Caller.Tests.Requesties; +global using Masa.Utils.Caller.Tests.Response; +global using Masa.Utils.Caller.Tests.Utils; +global using Masa.Utils.Exceptions; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using Moq.Protected; +global using System.Net; +global using System.Runtime.ExceptionServices; +global using System.Text; +global using System.Text.Json.Serialization; +global using System.Xml.Serialization; diff --git a/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj b/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj new file mode 100644 index 000000000..e40017edf --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs b/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs new file mode 100644 index 000000000..95c116d78 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs @@ -0,0 +1,84 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.ComponentModel.DataAnnotations; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.DataAnnotations.Tests +{ + [TestClass] + public class MinCountAttributeTests + { + [TestMethod] + public void EmptyListWithMinCount1Test() + { + var user = new User + { + Name = "name", + Favorites = new List() + }; + + var results = ValidateModel(user); + + Assert.IsTrue(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); + } + + [TestMethod] + public void NullValueWithMinCount1Test() + { + var user = new User + { + Name = "name", + }; + + var results = ValidateModel(user); + + Assert.IsFalse(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); + } + + [TestMethod] + public void Count1WithMinCount1Test() + { + var user = new User + { + Name = "name", + Favorites = new List() { "A" } + }; + + var results = ValidateModel(user); + + Assert.IsFalse(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); + } + + [TestMethod] + public void Count2WithMinCount1Test() + { + var user = new User + { + Name = "name", + Favorites = new List() { "A", "B" } + }; + + var results = ValidateModel(user); + + Assert.IsFalse(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); + } + + private IList ValidateModel(object model) + { + var validateResults = new List(); + var ctx = new ValidationContext(model); + Validator.TryValidateObject(model, ctx, validateResults, true); + return validateResults; + } + + public class User + { + [Required] + public string Name { get; set; } = default!; + + [MinCount(1)] + public List Favorites { get; set; } = default!; + } + } +} diff --git a/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs b/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs new file mode 100644 index 000000000..a229708dd --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs @@ -0,0 +1,84 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.DataAnnotations.Tests +{ + [TestClass] + public class NonDefualtAttributeTests + { + [TestMethod] + public void DefaultTest() + { + var user = new User + { + Name = "name", + NullableId = Guid.Empty + }; + + var results = ValidateModel(user); + + var isIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Id))); + var isNullableIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.NullableId))); + var isAgeInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Age))); + var isFavroiteInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Favroite))); + + Assert.IsTrue(isIdInvalid && isNullableIdInvalid && isAgeInvalid && isFavroiteInvalid); + } + + [TestMethod] + public void NonDefaultTest() + { + var user = new User + { + Id = Guid.NewGuid(), + NullableId = Guid.NewGuid(), + Age = 20, + Favroite = Favorites.Basketball, + Name = "name" + }; + + var results = ValidateModel(user); + + var isIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Id))); + var isNullableIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.NullableId))); + var isAgeInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Age))); + var isFavroiteInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Favroite))); + + Assert.IsTrue(!isIdInvalid && !isNullableIdInvalid && !isAgeInvalid && !isFavroiteInvalid); + } + + private IList ValidateModel(object model) + { + var validateResults = new List(); + var ctx = new ValidationContext(model); + Validator.TryValidateObject(model, ctx, validateResults, true); + return validateResults; + } + + public class User + { + [NonDefault] + public Guid Id { get; set; } + + [NonDefault] + public Guid? NullableId { get; set; } + + [Required] + public string Name { get; set; } = default!; + + [NonDefault] + public int Age { get; set; } + + [NonDefault] + public Favorites Favroite { get; set; } + } + + public enum Favorites { None, Basketball, Football } + } +} diff --git a/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs b/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs new file mode 100644 index 000000000..882ec3695 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs @@ -0,0 +1,571 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Tests; + +[TestClass] +public class DefaultMasaElasticClientTests +{ + private MasaElasticsearchBuilder _builder = default!; + + [TestInitialize] + public void Initialize() + { + IServiceCollection service = new ServiceCollection(); + _builder = service.AddElasticsearchClient("es", "http://localhost:9200"); + } + + [TestMethod] + public async Task TestCreateIndexAsyncReturnIndexIsExist() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + var indexResponse = await _builder.Client.CreateIndexAsync(indexName); + Assert.IsTrue(indexResponse.IsValid); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestIndexExistAsyncReturnIndexIsExist() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + await _builder.Client.CreateIndexAsync(indexName); + + var existResponse = await _builder.Client.IndexExistAsync(indexName); + Assert.IsTrue(existResponse.IsValid && existResponse.Exists); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestCreateDocumentAsyncReturnCountIs1() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(!countResponse.IsValid); + + var createResponse = await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + Assert.IsTrue(createResponse.IsValid); + + Thread.Sleep(1000); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDeleteMultiIndexAsyncReturnCountIs0() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + var indexResponse = await _builder.Client.CreateIndexAsync(userIndexName); + Assert.IsTrue(indexResponse.IsValid); + + string personIndexName = $"person_index_{Guid.NewGuid()}"; + indexResponse = await _builder.Client.CreateIndexAsync(personIndexName); + Assert.IsTrue(indexResponse.IsValid); + + var response = await _builder.Client.DeleteMultiIndexAsync(new[] { userIndexName, personIndexName }); + Assert.IsTrue(response.IsValid); + + Thread.Sleep(1000); + Assert.IsTrue(!(await _builder.Client.IndexExistAsync(userIndexName)).Exists && + !(await _builder.Client.IndexExistAsync(personIndexName)).Exists); + } + + [TestMethod] + public async Task TestIndexByAliasAsync() + { + string userIndex1Name = $"user_index_{Guid.NewGuid()}"; + string userIndex2Name = $"user_index_{Guid.NewGuid()}"; + string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; + + IAliases aliases = new Aliases(); + aliases.Add(aliasIndexName, new Alias()); + var indexResponse = await _builder.Client.CreateIndexAsync(userIndex1Name, new CreateIndexOptions() + { + Aliases = aliases + }); + indexResponse = await _builder.Client.CreateIndexAsync(userIndex2Name, new CreateIndexOptions() + { + Aliases = aliases + }); + + Thread.Sleep(1000); + + var getIndexResponse = await _builder.Client.GetAllIndexAsync(); + Assert.IsTrue(getIndexResponse.IsValid && getIndexResponse.IndexNames.Contains(userIndex1Name) && + getIndexResponse.IndexNames.Contains(userIndex2Name)); + + var getIndexByAliasResponse = await _builder.Client.GetIndexByAliasAsync(aliasIndexName); + Assert.IsTrue(getIndexByAliasResponse.IsValid && getIndexByAliasResponse.IndexNames.Length == 2 && + getIndexByAliasResponse.IndexNames.Contains(userIndex1Name) && + getIndexByAliasResponse.IndexNames.Contains(userIndex2Name)); + + var deleteIndexResponse = await _builder.Client.DeleteIndexByAliasAsync(aliasIndexName); + Assert.IsTrue(deleteIndexResponse.IsValid); + } + + [TestMethod] + public async Task TestGetAllAliasAsyncReturnAliasCountIs1() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; + + var aliasResponse = await _builder.Client.GetAllAliasAsync(); + Assert.IsTrue(aliasResponse.IsValid); + + var oldAliasesCount = aliasResponse.Aliases.Count(); + IAliases aliases = new Aliases(); + aliases.Add(aliasIndexName, new Alias()); + await _builder.Client.CreateIndexAsync(userIndexName, new CreateIndexOptions() + { + Aliases = aliases + }); + + Thread.Sleep(1000); + aliasResponse = await _builder.Client.GetAllAliasAsync(); + Assert.IsTrue(aliasResponse.IsValid && aliasResponse.Aliases.Count() == oldAliasesCount + 1); + + await _builder.Client.DeleteIndexByAliasAsync(aliasIndexName); + } + + [TestMethod] + public async Task TestGetAliasByIndexAsyncReturnAliasIsUserIndexAlias() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; + + IAliases aliases = new Aliases(); + aliases.Add(aliasIndexName, new Alias()); + await _builder.Client.CreateIndexAsync(userIndexName, new CreateIndexOptions() + { + Aliases = aliases + }); + + Thread.Sleep(1000); + var aliasResponse = await _builder.Client.GetAliasByIndexAsync(userIndexName); + Assert.IsTrue(aliasResponse.IsValid && aliasResponse.Aliases.Count() == 1 && aliasResponse.Aliases.Contains(aliasIndexName)); + + await _builder.Client.DeleteIndexByAliasAsync(aliasIndexName); + } + + [TestMethod] + public async Task TestUnBindAliasAsyncReturnIndexIsExist() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; + + IAliases aliases = new Aliases(); + aliases.Add(aliasIndexName, new Alias()); + await _builder.Client.CreateIndexAsync(userIndexName, new CreateIndexOptions() + { + Aliases = aliases + }); + + Thread.Sleep(1000); + + var bulkAliasResponse = await _builder.Client.UnBindAliasAsync(new UnBindAliasIndexOptions(aliasIndexName, userIndexName)); + Assert.IsTrue(bulkAliasResponse.IsValid); + + Thread.Sleep(1000); + var existsResponse = await _builder.Client.IndexExistAsync(userIndexName); + Assert.IsTrue(existsResponse.IsValid && existsResponse.Exists); + } + + [TestMethod] + public async Task TestCreateMultiDocumentAsyncReturnCountIs2() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + await _builder.Client.DeleteIndexAsync(indexName); + + string id = Guid.NewGuid().ToString(); + string id2 = Guid.NewGuid().ToString(); + var createMultiResponse = await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = Guid.NewGuid() + }, id), + new(new + { + Id = Guid.NewGuid() + }, id2) + } + }); + Assert.IsTrue(createMultiResponse.IsValid && + createMultiResponse.Items.Count == 2 && + createMultiResponse.Items.Count(r => r.IsValid) == 2); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDocumentExistsAsyncReturnIsExist() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + var id = Guid.NewGuid(); + var createResponse = await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = id + }, id.ToString())); + Assert.IsTrue(createResponse.IsValid); + Thread.Sleep(1000); + + var existsResponse = await _builder.Client.DocumentExistsAsync(new ExistDocumentRequest(indexName, id.ToString())); + Assert.IsTrue(existsResponse.IsValid && existsResponse.Exists); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDeleteDocumentAsyncReturnCountIs0() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + var id = Guid.NewGuid(); + var createResponse = await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = id + }, id.ToString())); + Assert.IsTrue(createResponse.IsValid); + + var deleteResponse = await _builder.Client.DeleteDocumentAsync(new DeleteDocumentRequest(indexName, id.ToString())); + Assert.IsTrue(deleteResponse.IsValid); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 0); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDeleteMultiDocumentAsyncReturnDeleteCountIs2() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string id = Guid.NewGuid().ToString(); + string id2 = Guid.NewGuid().ToString(); + await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = Guid.NewGuid() + }, id), + new(new + { + Id = Guid.NewGuid() + }, id2) + } + }); + + var deleteResponse = + await _builder.Client.DeleteMultiDocumentAsync(new DeleteMultiDocumentRequest(indexName, id, id2)); + Assert.IsTrue(deleteResponse.IsValid && deleteResponse.Data.Count == 2 && deleteResponse.Data.Count(r => r.IsValid) == 2); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 0); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDeleteMultiDocumentAsyncReturnDeleteCountSuccessIs2() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string id = Guid.NewGuid().ToString(); + string id2 = Guid.NewGuid().ToString(); + await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = Guid.NewGuid() + }, id), + new(new + { + Id = Guid.NewGuid() + }, id2) + } + }); + + var deleteResponse = + await _builder.Client.DeleteMultiDocumentAsync(new DeleteMultiDocumentRequest(indexName, id, id2, Guid.NewGuid().ToString())); + Assert.IsTrue(deleteResponse.IsValid && deleteResponse.Data.Count == 3 && deleteResponse.Data.Count(r => r.IsValid) == 2); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 0); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestSetDocumentAsyncReturnCountIs3() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + Guid id = Guid.NewGuid(); + Guid id2 = Guid.NewGuid(); + await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = id + }, id.ToString()), + new(new + { + Id = id2 + }, id2.ToString()) + } + }); + Guid id3 = Guid.NewGuid(); + var setResponse = await _builder.Client.SetDocumentAsync(new SetDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = Guid.NewGuid() + }, id.ToString()), + new(new + { + Id = id3 + }, id3.ToString()) + } + }); + Assert.IsTrue(setResponse.IsValid && setResponse.Items.Count == 2 && setResponse.Items.Count(item => item.IsValid) == 2); + + Thread.Sleep(1000); + + var multiResponse = await _builder.Client.GetMultiAsync( + new GetMultiDocumentRequest(indexName, id.ToString(), id2.ToString(), id3.ToString())); + Assert.IsTrue(multiResponse.IsValid && multiResponse.Data.Count == 3); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestUpdateDocumentAsyncReturnIdEqual1() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + dynamic expandoObject = new ExpandoObject(); + expandoObject.Id = Guid.NewGuid(); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, expandoObject, "1")); + + expandoObject.Id = "1"; + var updateDocumentResponse = + await _builder.Client.UpdateDocumentAsync(new UpdateDocumentRequest(indexName, expandoObject, "1")); + Assert.IsTrue(updateDocumentResponse.IsValid); + + Thread.Sleep(1000); + var response = await _builder.Client.GetAsync(new GetDocumentRequest(indexName, "1")); + Assert.IsTrue(response.IsValid && ((dynamic)(response.Document)).Id == "1"); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestUpdateMultiDocumentAsyncReturnId1Equeal1AndId2Equal2() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + dynamic expandoObject = new ExpandoObject(); + dynamic expandoObject2 = new ExpandoObject(); + expandoObject.Id = Guid.NewGuid(); + expandoObject2.Id = Guid.NewGuid(); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, expandoObject, "1")); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, expandoObject2, "2")); + + expandoObject.Id = "1"; + expandoObject2.Id = "2"; + var updateDocumentResponse = + await _builder.Client.UpdateMultiDocumentAsync(new UpdateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new UpdateDocumentBaseRequest(expandoObject, "1"), + new((object)expandoObject2, "2"), + } + }); + Assert.IsTrue(updateDocumentResponse.IsValid); + + Thread.Sleep(1000); + var response = await _builder.Client.GetAsync(new GetDocumentRequest(indexName, "1")); + Assert.IsTrue(response.IsValid && ((dynamic)(response.Document)).Id == "1"); + response = await _builder.Client.GetAsync(new GetDocumentRequest(indexName, "2")); + Assert.IsTrue(response.IsValid && ((dynamic)(response.Document)).Id == "2"); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestGetListAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new { name = "jim" }, "1")); + + Thread.Sleep(1000); + var response = await _builder.Client.GetListAsync(new QueryOptions(indexName, "jim", "name", 0, 10)); + Assert.IsTrue(response.IsValid && response.Data.Count == 1); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestGetPaginatedListAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new { id = "1", name = "jim" }, "1")); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new { id = "2", name = "tom" }, "2")); + + Thread.Sleep(1000); + var response = + await _builder.Client.GetPaginatedListAsync(new PaginatedOptions(indexName, "jim", "name", 1, 1)); + Assert.IsTrue(response.IsValid && response.Data.Count == 1); + response = await _builder.Client.GetPaginatedListAsync(new PaginatedOptions(indexName, "jim or 2", + new List { "id", "name" }, 1, 2)); + Assert.IsTrue(response.IsValid && response.Data.Count == 2); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task BindAliasAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string indexName2 = $"user_index_{Guid.NewGuid()}"; + string alias = $"userIndex_{Guid.NewGuid()}"; + + await _builder.Client.CreateIndexAsync(indexName); + await _builder.Client.CreateIndexAsync(indexName2); + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName2, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName2)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + + await _builder.Client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 })); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); + + await _builder.Client.DeleteIndexAsync(indexName); + await _builder.Client.DeleteIndexAsync(indexName2); + } + + [TestMethod] + public async Task DeleteIndexByAliasAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string indexName2 = $"user_index_{Guid.NewGuid()}"; + string alias = $"user_index_{Guid.NewGuid()}"; + + await _builder.Client.CreateIndexAsync(indexName); + await _builder.Client.CreateIndexAsync(indexName2); + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName2, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName2)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + + await _builder.Client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 })); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); + + await _builder.Client.DeleteIndexByAliasAsync(alias); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(!countResponse.IsValid); + } + + [TestMethod] + public async Task ClearDocumentAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string indexName2 = $"user_index_{Guid.NewGuid()}"; + string alias = $"user_index_{Guid.NewGuid()}"; + + await _builder.Client.CreateIndexAsync(indexName); + await _builder.Client.CreateIndexAsync(indexName2); + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName2, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName2)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + + await _builder.Client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 })); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); + + await _builder.Client.ClearDocumentAsync(alias); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(countResponse.IsValid); + + await _builder.Client.DeleteIndexByAliasAsync(alias); + } + + [TestMethod] + public async Task TestAsync() + { + string userIndexName = $"user_index"; + + IServiceCollection service = new ServiceCollection(); + var builder = service.AddElasticsearchClient("es", "http://localhost:9200"); + await builder.Client.DeleteIndexAsync(userIndexName); + var serviceProvider = builder.Services.BuildServiceProvider(); + var client = serviceProvider.GetRequiredService(); + + var list = new AutoCompleteDocument[] + { + new() + { + Text = "999999999@qq.com", + Value = 1 + } + }; + var request = new SetDocumentRequest>(userIndexName); + foreach (var document in list) + request.AddDocument(document, document.Id); + + var response = await client.SetDocumentAsync(request, default); + Assert.IsTrue(response.IsValid); + await builder.Client.DeleteIndexAsync(userIndexName); + } +} diff --git a/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj b/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj new file mode 100644 index 000000000..b009a030a --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs b/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs new file mode 100644 index 000000000..18c4209d6 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Tests.Models; + +public class AutoCompleteDocument where TValue : notnull +{ + public string Id { get; set; } + + public string Text { get; set; } + + public TValue? Value { get; set; } + + public AutoCompleteDocument() + { + } + + public AutoCompleteDocument(string text, TValue? value) + : this(value?.ToString() ?? throw new ArgumentException($"{value} cannot be empty", nameof(value)), text, value) + { + } + + public AutoCompleteDocument(string id, string text, TValue? value) : this() + { + Id = id; + Text = text; + Value = value; + } +} + diff --git a/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs new file mode 100644 index 000000000..4448cf478 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Data.Elasticsearch.Options.Alias; +global using Masa.Utils.Data.Elasticsearch.Options.Document; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Count; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Create; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Delete; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Exist; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Get; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Query; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Set; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Update; +global using Masa.Utils.Data.Elasticsearch.Options.Index; +global using Masa.Utils.Data.Elasticsearch.Tests.Models; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Nest; +global using System.Dynamic; diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs new file mode 100644 index 000000000..988a782e5 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs @@ -0,0 +1,171 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Test; + +[TestClass] +public class ObjectExtensionsTests +{ + [TestMethod] + [DataRow(1)] + [DataRow((byte)1)] + [DataRow((char)2)] + [DataRow((uint)3)] + [DataRow((long)4)] + [DataRow((float)5.6789)] + [DataRow(5.6789)] + [DataRow("string")] + public void SampleValueTest(object value) + { + var result = value.ToUrlParam(); + var str = value.ToString(); + Assert.AreEqual(str, result); + } + + [TestMethod] + public void StructTest() + { + var user = new UserStruct + { + Name = "Bob", + Age = 30, + Gender = "Male" + }; + + var result = user.ToUrlParam(); + var str = $"age={user.Age}&gender={user.Gender}&name={user.Name}"; + Assert.AreEqual(str, result); + + user.Name = "王占山"; + str = $"age={user.Age}&gender={user.Gender}&name={System.Web.HttpUtility.UrlEncode(user.Name, Encoding.UTF8)}"; + result = user.ToUrlParam(); + Assert.AreEqual(str, result); + } + + [TestMethod] + public void ClassTest() + { + var obj = new + { + a = "test", + d = (float)34.56, + ch = "中文说明", + t = ResultTypes.Scalar + }; + + var result = obj.ToUrlParam(isEnumString: true); + var str = $"a={obj.a}&ch={System.Web.HttpUtility.UrlEncode(obj.ch, Encoding.UTF8)}&d={obj.d}&t={obj.t}"; + Assert.AreEqual(str, result); + + result = obj.ToUrlParam(isEnumString: false); + str = $"a={obj.a}&ch={System.Web.HttpUtility.UrlEncode(obj.ch, Encoding.UTF8)}&d={obj.d}&t={(int)obj.t}"; + Assert.AreEqual(str, result); + + result = obj.ToUrlParam(isEnumString: false, isUrlEncode: false); + str = $"a={obj.a}&ch={obj.ch}&d={obj.d}&t={(int)obj.t}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void ArrayTest() + { + var array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; + var result = array.ToUrlParam(isUrlEncode: false); + var str = string.Join("&[]=", array); + str = $"[]={str}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void ObjArrayTest() + { + var array = new QueryRequest[] { + new QueryRequest{ + Query="where1", + Time="2021-01-02", + TimeOut="5s" + }, + new QueryRequest{ + Query="where2", + Time="2021-01-01", + TimeOut="5s" + } + }; + + var result = array.ToUrlParam(isUrlEncode: false); + var str = $"[].query={array[0].Query}&[].time={array[0].Time}&[].timeOut={array[0].TimeOut}"; + str += $"&[].query={array[1].Query}&[].time={array[1].Time}&[].timeOut={array[1].TimeOut}"; + Assert.AreEqual(str, result); + + var obj = new + { + Values = array + }; + result = obj.ToUrlParam(isUrlEncode: false); + str = $"values[].query={array[0].Query}&values[].time={array[0].Time}&values[].timeOut={array[0].TimeOut}"; + str += $"&values[].query={array[1].Query}&values[].time={array[1].Time}&values[].timeOut={array[1].TimeOut}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void IEnumberTest() + { + var list = new List { 1, 2, 3, 4, 5, 6, 7, 8 }; + var result = list.ToUrlParam(isUrlEncode: false); + var str = string.Join("&[]=", list); + str = $"[]={str}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void ObjListTest() + { + var array = new List { + new QueryRequest{ + Query="where1", + Time="2021-01-02", + TimeOut="5s" + }, + new QueryRequest{ + Query="where2", + Time="2021-01-01", + TimeOut="5s" + } + }; + + var result = array.ToUrlParam(isUrlEncode: false); + var str = $"[].query={array[0].Query}&[].time={array[0].Time}&[].timeOut={array[0].TimeOut}"; + str += $"&[].query={array[1].Query}&[].time={array[1].Time}&[].timeOut={array[1].TimeOut}"; + Assert.AreEqual(str, result); + + var obj = new + { + Values = array + }; + result = obj.ToUrlParam(isUrlEncode: false); + str = $"values[].query={array[0].Query}&values[].time={array[0].Time}&values[].timeOut={array[0].TimeOut}"; + str += $"&values[].query={array[1].Query}&values[].time={array[1].Time}&values[].timeOut={array[1].TimeOut}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void KeyValueTest() + { + var dic = new Dictionary { + { "Name","David"}, + {"Age",30 }, + {"Sex","Male" } + }; + + var result = dic.ToUrlParam(); + var builder = new StringBuilder(); + var keys = dic.Keys.ToList(); + keys.Sort(); + foreach (var key in keys) + { + builder.Append($"&{key.ToCamelCase()}={dic[key]}"); + } + builder.Remove(0, 1); + Assert.AreEqual(builder.ToString(), result); + } +} diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs new file mode 100644 index 000000000..6c167dca3 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Test; + +[TestClass] +public class StringExtensionsTests +{ + [TestMethod] + [DataRow(null)] + [DataRow("")] + [DataRow("name")] + [DataRow("Name")] + [DataRow("N")] + [DataRow("FirstName")] + public void CamelCaseTest(string str) + { + var result = str.ToCamelCase(); + if (string.IsNullOrEmpty(str)) + { + Assert.IsNull(result); + } + else + { + var camelStr = $"{str[0].ToString().ToLower()}{(str.Length - 1 > 0 ? str[1..] : "")}"; + Assert.AreEqual(camelStr, result); + } + + } +} diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj new file mode 100644 index 000000000..61e38ea41 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + + false + + + + + + + + + + + + + + + diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs new file mode 100644 index 000000000..4dbea1025 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs @@ -0,0 +1,154 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Test; + +[TestClass] +public class MasaPrometheusClientTests +{ + private IMasaPrometheusClient _client; + + public MasaPrometheusClientTests() + { + IServiceCollection service = new ServiceCollection(); + service.AddPrometheusClient("http://localhost:9090"); + _client = service.BuildServiceProvider().GetService() ?? default!; + } + + [TestMethod] + [DataRow(null)] + [DataRow("up")] + [DataRow("not_exists")] + [DataRow("error data")] + public async Task TestQueryAsync(string query) + { + var result = await _client.QueryAsync(new QueryRequest + { + Query = query + }); + + Assert.IsNotNull(result); + if (string.IsNullOrEmpty(query) || query.Contains(' ')) + { + Assert.AreEqual(result.Status, ResultStatuses.Error); + } + else + { + if (query == "not_exists") + { + Assert.IsFalse(result.Data?.Result?.Any()); + } + else + { + Assert.IsTrue(result.Data?.Result?.Any()); + } + } + } + + [TestMethod] + public async Task TestQueryVectorAsync() + { + var result = await _client.QueryAsync(new QueryRequest + { + Query = "up" + }); + + if (result != null && result.Data != null && result.Data.Result != null) + { + var data = result.Data.Result as QueryResultInstantVectorResponse[]; + + Assert.IsNotNull(data); + Assert.IsNotNull(data[0].Metric); + Assert.IsNotNull(data[0].Value); + Assert.IsNotNull(data[0].Metric.Keys); + Assert.AreEqual(2, data[0].Value.Length); + } + } + + [TestMethod] + public async Task TestQueryRangeAsync() + { + var result = await _client.QueryRangeAsync(new QueryRangeRequest + { + Query = "up", + Start = "2022-06-17T02:00:00.000Z", + End = "2022-06-17T02:30:00.000Z", + Step = "300s", + }); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + Assert.IsNotNull(result.Data); + if (result.Data.ResultType == ResultTypes.Matrix) + { + var data = result.Data.Result as QueryResultMatrixRangeResponse[]; + Assert.IsNotNull(data); + Assert.IsNotNull(data[0].Metric); + Assert.IsNotNull(data[0].Values); + } + } + + [TestMethod] + public async Task TestSeriesQueryAsync() + { + var result = await _client.SeriesQueryAsync(new MetaDataQueryRequest + { + Match = new string[] { "up" }, + Start = "2022-06-17T02:00:00.000Z", + End = "2022-06-17T02:30:00.000Z" + }); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + } + + [TestMethod] + [DataRow(null)] + [DataRow(new string[] { "up" })] + [DataRow(new string[] { "not_exists" })] + [DataRow(new string[] { "error data" })] + public async Task TestLabelsQueryAsync(IEnumerable matches) + { + if (matches != null && matches.Any(s => s.Contains(' '))) + { + var result = await _client.LabelsQueryAsync(new MetaDataQueryRequest { Match = matches }); + Assert.AreEqual(result.Status, ResultStatuses.Error); + Assert.IsNotNull(result.Error); + } + else + { + var result = await _client.LabelsQueryAsync(default!); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + if (matches == null || matches.Any(s => s == "up")) + { + Assert.IsTrue(result.Data?.Any()); + } + else + { + Assert.IsFalse(result.Data?.Any()); + } + } + } + + [TestMethod] + public async Task TestLabelValuesQueryAsync() + { + var result = await _client.LabelValuesQueryAsync(new LableValueQueryRequest()); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + } + + [TestMethod] + [DataRow()] + public async Task TestExemplarQueryAsync() + { + var param = new QueryExemplarRequest + { + Query = "up", + Start = "2022-06-17T02:00:00.000Z", + End = "2022-06-17T02:30:00.000Z" + }; + var result = await _client.ExemplarQueryAsync(param); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + } +} diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs new file mode 100644 index 000000000..a1ea1f6ea --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Test; + +public struct UserStruct +{ + public string Name { get; set; } + + public int Age { get; set; } + + public string Gender { get; set; } +} diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs new file mode 100644 index 000000000..3b98df19e --- /dev/null +++ b/src/Utils/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Data.Prometheus.Enums; +global using Masa.Utils.Data.Prometheus.Model; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Text; +global using System.Threading.Tasks; diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/BaseRepository.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/BaseRepository.cs new file mode 100644 index 000000000..81c1a1e7a --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/BaseRepository.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Repository.Tests; + +public abstract class BaseRepository : IRepository + where TEntity : class +{ + +} + +public class Repository : BaseRepository + where TEntity : class +{ + +} + +public class UserRepository : IRepository + where TEntity : class +{ + +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/IRepository.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/IRepository.cs new file mode 100644 index 000000000..a4c96af33 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/IRepository.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Repository.Tests; + +public interface IRepository : IScopedDependency + where TEntity : class +{ + +} + +public interface IRepository : IScopedDependency + where TEntity : class + where TDbContext : class +{ + +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj new file mode 100644 index 000000000..8d15c0631 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + false + + + + + + + diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/UserDbContext.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/UserDbContext.cs new file mode 100644 index 000000000..446c3af3d --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/UserDbContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Repository.Tests; + +public class UserDbContext +{ + +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/_Imports.cs new file mode 100644 index 000000000..e3720125e --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs new file mode 100644 index 000000000..432d7c5d4 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs @@ -0,0 +1,204 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests; + +[TestClass] +public class DependencyInjectionTest +{ + private DefaultTypeProvider _typeProvider = default!; + private IEnumerable _allTypes = default!; + + [TestInitialize] + public void Initialize() + { + _typeProvider = new DefaultTypeProvider(); + _allTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(assembly => assembly.GetTypes()); + } + + [TestMethod] + public void TestSkip() + { + Assert.IsFalse(_typeProvider.IsSkip(typeof(BaseService))); + Assert.IsTrue(_typeProvider.IsSkip(typeof(GoodsBaseService))); + Assert.IsFalse(_typeProvider.IsSkip(typeof(GoodsService))); + Assert.IsFalse(_typeProvider.IsSkip(typeof(NullCalculateProviderService))); + Assert.IsTrue(_typeProvider.IsSkip(typeof(OrderBaseService))); + Assert.IsTrue(_typeProvider.IsSkip(typeof(OrderService))); + Assert.IsTrue(_typeProvider.IsSkip(typeof(UserBaseService))); + Assert.IsFalse(_typeProvider.IsSkip(typeof(UserService))); + } + + [TestMethod] + public void TestGetServiceTypesReturnCountIs5() + { + var serviceTypes = _typeProvider.GetServiceTypes(_allTypes.ToList(), typeof(ISingletonDependency)); + Assert.IsTrue(serviceTypes.Count == 5); + } + + [TestMethod] + public void TestGetImplementationTypesReturnCountIs1() + { + var implementationTypes = _typeProvider.GetImplementationTypes(_allTypes.ToList(), typeof(ICalculateProviderService)); + Assert.IsTrue(implementationTypes.Count == 1); + + implementationTypes = _typeProvider.GetImplementationTypes(_allTypes.ToList(), typeof(BaseService)); + Assert.IsTrue(implementationTypes.Count == 1); + } + + [TestMethod] + public void TestAssignableFrom() + { + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(ICalculateProviderService), typeof(NullCalculateProviderService))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(ISingletonDependency), typeof(ICalculateProviderService))); + + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(NullCalculateProviderService), typeof(ICalculateProviderService))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(ICalculateProviderService), typeof(ISingletonDependency))); + + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(BaseService), typeof(UserBaseService))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(BaseService), typeof(UserService))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(UserBaseService), typeof(UserService))); + + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserBaseService), typeof(BaseService))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserService), typeof(BaseService))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserService), typeof(UserBaseService))); + + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository<>), typeof(BaseRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(IRepository<>), typeof(BaseRepository))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository), typeof(BaseRepository))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(BaseRepository<>), typeof(IRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(BaseRepository), typeof(IRepository))); + + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository<,>), typeof(UserRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(IRepository), typeof(UserRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserRepository<>), typeof(IRepository<,>))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository), typeof(UserRepository))); + } + + [TestMethod] + public void TestAssignableTo() + { + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(ICalculateProviderService), typeof(NullCalculateProviderService))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(ISingletonDependency), typeof(ICalculateProviderService))); + + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(NullCalculateProviderService), typeof(ICalculateProviderService))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(ICalculateProviderService), typeof(ISingletonDependency))); + + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(BaseService), typeof(UserBaseService))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(BaseService), typeof(UserService))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(UserBaseService), typeof(UserService))); + + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserBaseService), typeof(BaseService))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserService), typeof(BaseService))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserService), typeof(UserBaseService))); + + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository<>), typeof(BaseRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository<>), typeof(BaseRepository))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository), typeof(BaseRepository))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(BaseRepository<>), typeof(IRepository<>))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(BaseRepository), typeof(IRepository))); + + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository<,>), typeof(UserRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository), typeof(UserRepository<>))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserRepository<>), typeof(IRepository<,>))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository), typeof(UserRepository))); + } + + [TestMethod] + public void TestAddAutoInject() + { + var services = new ServiceCollection(); + services.AddAutoInject(); + var serviceProvider = services.BuildServiceProvider(); + var calculateProviderService = serviceProvider.GetService(); + Assert.IsNotNull(calculateProviderService); + Assert.IsNull(serviceProvider.GetService()); + + Assert.IsTrue(BaseService.Count == 1); + var serviceBase = serviceProvider.GetService(); + Assert.IsNotNull(serviceBase); + + var userBaseService = serviceProvider.GetService(); + Assert.IsNull(userBaseService); + + Assert.IsTrue(UserService.UserCount == 1); + var userService = serviceProvider.GetService(); + Assert.IsNotNull(userService); + + var goodsBaseService = serviceProvider.GetService(); + Assert.IsNull(goodsBaseService); + + Assert.IsTrue(GoodsService.GoodsCount == 1); + var goodsService = serviceProvider.GetService(); + Assert.IsNotNull(goodsService); + + var orderBaseService = serviceProvider.GetService(); + Assert.IsNull(orderBaseService); + + var orderService = serviceProvider.GetService(); + Assert.IsNull(orderService); + } + + [TestMethod] + public void TestAddAutoInjectByAssemblies() + { + var services = new ServiceCollection(); + services.AddAutoInject(typeof(IRepository<>).Assembly); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService>()); + + Assert.IsNull(serviceProvider.GetService()); + } + + [TestMethod] + public void TestAddAutoInjectMultiByAssemblies() + { + var services = new ServiceCollection(); + services + .AddAutoInject(typeof(IRepository<>).Assembly) + .AddAutoInject(typeof(IRepository<>).Assembly); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService>()); + Assert.IsTrue(serviceProvider.GetServices>().Count() == 1); + + Assert.IsNull(serviceProvider.GetService()); + } + + [TestMethod] + public void TestAddAutoInjectByTypes() + { + var services = new ServiceCollection(); + services + .AddAutoInject(typeof(IRepository<>)); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService>()); + Assert.IsTrue(serviceProvider.GetServices>().Count() == 1); + + Assert.IsNull(serviceProvider.GetService()); + } + + [TestMethod] + public void TestAny() + { + var services = new ServiceCollection(); + Assert.IsFalse(services.Any()); + Assert.IsFalse(services.Any(ServiceLifetime.Singleton)); + services.AddScoped(); + Assert.IsTrue(services.Any()); + Assert.IsFalse(services.Any(ServiceLifetime.Singleton)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsFalse(services.Any(ServiceLifetime.Transient)); + } + + [TestMethod] + public void TestDependencyReturnProviderServiceIs1() + { + var services = new ServiceCollection(); + services.AddAutoInject(); + var serviceProvider = services.BuildServiceProvider(); + var factories = serviceProvider.GetServices().ToList(); + Assert.IsTrue(factories.Count == 1); + + Assert.IsTrue(factories[0].GetClientName() == nameof(CustomizeClientFactory)); + } +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/ICalculateProviderService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/ICalculateProviderService.cs new file mode 100644 index 000000000..e7f251f30 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/ICalculateProviderService.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.IServices; + +public interface ICalculateProviderService : ISingletonDependency +{ + string Name { get; } +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/IClientFactory.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/IClientFactory.cs new file mode 100644 index 000000000..891342f63 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/IClientFactory.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.IServices; + +public interface IClientFactory : ISingletonDependency +{ + string GetClientName(); +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj new file mode 100644 index 000000000..8d677c87a --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + + diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Models/User.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Models/User.cs new file mode 100644 index 000000000..2e1dd4d58 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Models/User.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Models; + +public class User +{ + public Guid Id { get; set; } + + public string Name { get; set; } = default!; +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/BaseService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/BaseService.cs new file mode 100644 index 000000000..8b735d8ab --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/BaseService.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +public class BaseService : ISingletonDependency, IAutoFireDependency +{ + public static int Count { get; set; } = 0; + + public BaseService() + { + Count++; + } + + public BaseService(bool isChildren) + { + + } +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/CustomizeClientFactory.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/CustomizeClientFactory.cs new file mode 100644 index 000000000..235eaf7b5 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/CustomizeClientFactory.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +[Dependency(ReplaceServices = true)] +public class CustomizeClientFactory : IClientFactory +{ + public string GetClientName() => nameof(CustomizeClientFactory); +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/EmptyClientFactory.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/EmptyClientFactory.cs new file mode 100644 index 000000000..33d11b243 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/EmptyClientFactory.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +public class EmptyClientFactory : IClientFactory +{ + public string GetClientName() => nameof(EmptyClientFactory); +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsBaseService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsBaseService.cs new file mode 100644 index 000000000..816751eb4 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsBaseService.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +[IgnoreInjection] +public class GoodsBaseService : BaseService +{ + public GoodsBaseService() : base(true) + { + } +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsService.cs new file mode 100644 index 000000000..5dcfb1e84 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsService.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +public class GoodsService : GoodsBaseService +{ + public static int GoodsCount { get; set; } = 0; + + public GoodsService() + { + GoodsCount++; + } +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/NullCalculateProviderService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/NullCalculateProviderService.cs new file mode 100644 index 000000000..46b60d915 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/NullCalculateProviderService.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +public class NullCalculateProviderService : ICalculateProviderService +{ + public string Name => string.Empty; +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderBaseService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderBaseService.cs new file mode 100644 index 000000000..974aa7fb8 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderBaseService.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +[IgnoreInjection(true)] +public class OrderBaseService : BaseService +{ + public OrderBaseService() : base(true) + { + } +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderService.cs new file mode 100644 index 000000000..719d8548a --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderService.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +public class OrderService : OrderBaseService +{ +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserBaseService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserBaseService.cs new file mode 100644 index 000000000..5dbe3a7d9 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserBaseService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +public abstract class UserBaseService : BaseService +{ + public UserBaseService() : base(true) + { + } +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserService.cs new file mode 100644 index 000000000..904763ce6 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserService.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; + +public class UserService : UserBaseService +{ + public static int UserCount { get; set; } = 0; + + public UserService() + { + UserCount++; + } +} diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs new file mode 100644 index 000000000..1c6e40493 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Extensions.DependencyInjection.Repository.Tests; +global using Masa.Utils.Extensions.DependencyInjection.Tests.IServices; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Models; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Services; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs b/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs new file mode 100644 index 000000000..993db77aa --- /dev/null +++ b/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs @@ -0,0 +1,85 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell.Tests; + +[TestClass] +public class LdapTest +{ + readonly IServiceCollection Services; + readonly ILdapProvider ldapProvider; + readonly ILdapFactory ldapFactory; + + public LdapTest() + { + Services = new ServiceCollection(); + var mockLdapOptions = new Mock(); + + var configurationBuilder = new ConfigurationBuilder().AddJsonFile("appsettings.json"); + var configuration = configurationBuilder.Build(); + var ldapConfigurationSection = configuration.GetSection(nameof(LdapOptions)); + Services.AddLadpContext(ldapConfigurationSection); + Services.AddLadpContext(); + var serviceProvider = Services.BuildServiceProvider(); + ldapProvider = serviceProvider.GetRequiredService(); + ldapFactory = serviceProvider.GetRequiredService(); + } + + [TestInitialize] + public void EdgeDriverInitialize() + { + + } + + [TestMethod] + public void CreateLdapProvider() + { + var ldapProvider = ldapFactory.CreateProvider(new LdapOptions + { + + }); + Assert.IsNotNull(ldapProvider); + } + + [TestMethod] + public async Task GetAllUser() + { + var allUsers = await ldapProvider.GetAllUserAsync().ToListAsync(); ; + Assert.IsTrue(allUsers.Count > 0); + } + + [TestMethod] + public async Task GetPagingUser() + { + var pagingUsers = await ldapProvider.GetPagingUserAsync(1); + Assert.IsTrue(pagingUsers.Count > 0); + } + + [TestMethod] + public async Task GetUserByUserName() + { + var user = await ldapProvider.GetUserByUserNameAsync("mayue"); + Assert.IsNotNull(user); + } + + [TestMethod] + public async Task GetUserByUserEmail() + { + var user = await ldapProvider.GetUsersByEmailAddressAsync("mayue@masastack.com"); + Assert.IsNotNull(user); + } + + [TestMethod] + public async Task GetGroupAsync() + { + var group = await ldapProvider.GetGroupAsync("杭州产品研发部"); + Assert.IsNotNull(group); + } + + [TestMethod] + public async Task GetUsersInGroupAsync() + { + var users = await ldapProvider.GetUsersInGroupAsync("杭州产品研发部").ToListAsync(); + Assert.IsTrue(users.Count > 0); + } +} diff --git a/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj b/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj new file mode 100644 index 000000000..797b5c685 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj @@ -0,0 +1,30 @@ + + + + net6.0 + enable + + false + + + + + + + + + + + + + + + + + + + Always + + + + diff --git a/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs new file mode 100644 index 000000000..30674ecea --- /dev/null +++ b/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Ldap.Novell.Extensions; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Linq; +global using System.Threading.Tasks; diff --git a/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json b/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json new file mode 100644 index 000000000..5a64f707c --- /dev/null +++ b/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json @@ -0,0 +1,12 @@ +{ + "LdapOptions": { + "ServerAddress": "localhost", + "ServerPort": 5389, + "ServerPortSsl": 5636, + "BaseDn": "dc=example,dc=com", + "UserSearchBaseDn": "OU=XXXX,dc=example,dc=com", + "GroupSearchBaseDn": "", + "RootUserDn": "cn=admin,dc=example,dc=com", + "RootUserPassword": "password" + } +} \ No newline at end of file diff --git a/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs b/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs new file mode 100644 index 000000000..dc39e8e7f --- /dev/null +++ b/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs @@ -0,0 +1,30 @@ +using System; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography.Tests; + +[TestClass] +public class AesTest +{ + [TestMethod] + public void EncryptAndDecrypt() + { + string str = "Hello MASA Stack"; + string key = "12345678901234567890123456789021"; + var source = AesUtils.Decrypt(AesUtils.Encrypt(str, key), key); + Assert.IsTrue(str == source); + + var source2 = AesUtils.Decrypt(AesUtils.Encrypt(str)); + Assert.IsTrue(str == source2); + + var source3 = AesUtils.Decrypt(AesUtils.Encrypt(str, key, "123", FillType.Right), key, "123", FillType.Right); + Assert.IsTrue(str == source3); + + Assert.ThrowsException(() => AesUtils.Encrypt(str, key, "123", FillType.NoFile)); + + string encryptResult = AesUtils.Encrypt(str, key, "123", FillType.Right); + Assert.ThrowsException(() => AesUtils.Decrypt(encryptResult, key, "123", FillType.NoFile)); + } +} diff --git a/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs b/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs new file mode 100644 index 000000000..a33c2bc5b --- /dev/null +++ b/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs @@ -0,0 +1,30 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography.Tests +{ + [TestClass] + public class DesTest + { + [TestMethod] + public void EncryptAndDecrypt() + { + for (int i = 0; i < 10000; i++) + { + string str = new Random().Next(0, 1000000000).ToString(); + string key = "masastac"; + string iv = "masastack"; + var source = DesUtils.Decrypt(DesUtils.Encrypt(str, key), key); + var source2 = DesUtils.Decrypt(DesUtils.Encrypt(str, key, iv), key, iv); + var source3 = DesUtils.Decrypt(DesUtils.Encrypt(str, DESEncryType.Normal), DESEncryType.Normal); + + Assert.IsTrue(str == source); + Assert.IsTrue(str == source2); + Assert.IsTrue(str == source3); + } + } + } +} diff --git a/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj b/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj new file mode 100644 index 000000000..e88eeb141 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + + false + + + + + + + + + + + + + + + diff --git a/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs new file mode 100644 index 000000000..1109a8e81 --- /dev/null +++ b/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/test/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj b/test/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj deleted file mode 100644 index f304b81af..000000000 --- a/test/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - - - - diff --git a/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj b/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj deleted file mode 100644 index 23fb74ad2..000000000 --- a/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj b/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj deleted file mode 100644 index fa7f7a32d..000000000 --- a/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - - diff --git a/test/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj b/test/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj deleted file mode 100644 index d43b31220..000000000 --- a/test/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - net6.0 - enable - enable - - false - - - - - - - - - - - - - - - - - - - - - - From 8897d99ccbbf885e4f081fc713b5ca6a7c6a78e0 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Mon, 1 Aug 2022 16:29:41 +0800 Subject: [PATCH 02/29] style: BasicAbility rename to StackSdks --- Masa.Framework.sln | 84 +++++++++---------- README.md | 10 +-- README.zh-CN.md | 10 +-- src/BuildingBlocks/Masa.BuildingBlocks.sln | 12 +-- .../_Imports.cs | 7 -- .../Enums/AggregationTypes.cs | 2 +- .../ITscClient.cs | 2 +- .../Masa.BuildingBlocks.StackSdks.Tsc.csproj} | 0 .../Model/Metric/LableValuesRequest.cs | 2 +- .../Model/Metric/ValuesRequest.cs | 2 +- .../Service/ILogService.cs | 2 +- .../Service/IMetricService.cs | 2 +- .../_Imports.cs | 6 +- .../Enum/GenderTypes.cs | 2 +- .../Enum/StaffTypes.cs | 2 +- .../Enum/SubjectTypes.cs | 2 +- .../Enum/TeamTypes.cs | 2 +- ...ingBlocks.StackSdks.Auth.Contracts.csproj} | 0 .../Model/AddUserModel.cs | 2 +- .../Model/AddressValueModel.cs | 2 +- .../Model/AppModel.cs | 2 +- .../Model/CollectMenuModel.cs | 2 +- .../Model/DisableUserModel.cs | 2 +- .../Model/MenuModel.cs | 2 +- .../Model/NavModel.cs | 2 +- .../Model/ProjectModel.cs | 2 +- .../Model/RoleModel.cs | 2 +- .../Model/StaffDetailModel.cs | 2 +- .../Model/StaffModel.cs | 2 +- .../Model/SubjectModel.cs | 2 +- .../Model/TeamDetailModel.cs | 2 +- .../Model/TeamModel.cs | 2 +- .../Model/TeamPersonnelModel.cs | 2 +- .../Model/UpdateUserBasicInfoModel.cs | 2 +- .../Model/UpdateUserPasswordModel.cs | 2 +- .../Model/UpsertUserModel.cs | 2 +- .../Model/UserModel.cs | 2 +- .../Model/UserPortraitModel.cs | 2 +- .../Model/UserSimpleModel.cs | 2 +- .../Model/UserVisitedModel.cs | 2 +- .../_Imports.cs | 2 +- .../IAuthClient.cs | 2 +- .../IEnvironmentProvider.cs | 2 +- ...Masa.BuildingBlocks.StackSdks.Auth.csproj} | 2 +- .../Service/IPermissionService.cs | 2 +- .../Service/IProjectService.cs | 2 +- .../Service/ISubjectService.cs | 2 +- .../Service/ITeamService.cs | 2 +- .../Service/IUserService.cs | 2 +- .../_Imports.cs | 4 +- .../IDccClient.cs | 2 +- .../Masa.BuildingBlocks.StackSdks.Dcc.csproj} | 0 .../Model/LabelModel.cs | 2 +- .../Service/ILabelService.cs | 2 +- .../_Imports.cs | 4 +- .../Enum/ChannelTypes.cs | 2 +- .../Enum/MessageTaskReceiverTypes.cs | 2 +- .../Enum/MessageTaskSelectReceiverTypes.cs | 2 +- .../Enum/MessageTaskSources.cs | 2 +- .../Enum/MessageTaskStatuses.cs | 2 +- .../Enum/MessageTemplateAuditStatuses.cs | 2 +- .../Enum/MessageTemplateStates.cs | 2 +- .../Enum/MessageTypes.cs | 2 +- .../Enum/ReceiverGroupItemTypes.cs | 2 +- .../Enum/SendTargets.cs | 2 +- .../Enum/WebsiteMessageFilterType.cs | 2 +- .../IMcClient.cs | 2 +- .../ExtraPropertyDictionary.cs | 0 .../Masa.BuildingBlocks.StackSdks.Mc.csproj} | 0 .../Model/AuditEntityModel.cs | 2 +- .../Model/ChannelModel.cs | 2 +- .../Model/EntityModel.cs | 2 +- .../Model/GetChannelModel.cs | 2 +- .../Model/GetMessageTemplateModel.cs | 2 +- .../Model/GetNoticeListModel.cs | 2 +- .../Model/GetReceiverGroupModel.cs | 2 +- .../Model/GetWebsiteMessageModel.cs | 2 +- .../Model/MessageInfoModel.cs | 2 +- .../Model/MessageInfoUpsertModel.cs | 2 +- .../Model/MessageTaskModel.cs | 2 +- .../Model/MessageTaskReceiverModel.cs | 2 +- .../Model/MessageTemplateItemModel.cs | 2 +- .../Model/MessageTemplateModel.cs | 2 +- .../Model/PaginatedListModel.cs | 2 +- .../Model/PaginatedOptionsModel.cs | 2 +- .../Model/ReadAllWebsiteMessageModel.cs | 2 +- .../Model/ReadWebsiteMessageModel.cs | 2 +- .../Model/ReceiverGroupItemModel.cs | 2 +- .../Model/ReceiverGroupModel.cs | 2 +- .../Model/SendOrdinaryMessageModel.cs | 2 +- .../Model/SendRuleModel.cs | 2 +- .../Model/SendTemplateMessageModel.cs | 2 +- .../Model/WebsiteMessageChannelModel.cs | 2 +- .../Model/WebsiteMessageModel.cs | 2 +- .../Service/IChannelService.cs | 2 +- .../Service/IMessageTaskService.cs | 2 +- .../Service/IMessageTemplateService.cs | 2 +- .../Service/IReceiverGroupService.cs | 2 +- .../Service/IWebsiteMessageService.cs | 2 +- .../_Imports.cs | 6 +- .../Enum/AppTypes.cs | 2 +- .../Enum/ServiceTypes.cs | 2 +- .../IPmClient.cs | 4 +- .../Masa.BuildingBlocks.StackSdks.Pm.csproj} | 0 .../Model/AppDetailModel.cs | 2 +- .../Model/AppModel.cs | 4 +- .../Model/BaseModel.cs | 2 +- .../Model/ClusterDetailModel.cs | 2 +- .../Model/ClusterModel.cs | 2 +- .../Model/EnvironmentClusterModel.cs | 2 +- .../Model/EnvironmentDetailModel.cs | 2 +- .../Model/EnvironmentModel.cs | 2 +- .../Model/ProjectAppsModel.cs | 2 +- .../Model/ProjectDetailModel.cs | 2 +- .../Model/ProjectModel.cs | 2 +- .../Model/ProjectTypeModel.cs | 2 +- .../Service/IAppService.cs | 4 +- .../Service/IClusterService.cs | 4 +- .../Service/IEnvironmentService.cs | 4 +- .../Service/IProjectService.cs | 4 +- .../_Imports.cs | 6 +- .../Enum/HttpMethods.cs | 2 +- .../Enum/HttpVerifyTypes.cs | 2 +- .../Enum/JobTypes.cs | 2 +- .../Enum/RunTimeoutStrategyTypes.cs | 2 +- .../Enum/ScheduleBlockStrategyTypes.cs | 2 +- .../Enum/ScheduleExpiredStrategyTypes.cs | 2 +- .../ISchedulerClient.cs | 2 +- .../ISchedulerJob.cs | 2 +- ...BuildingBlocks.StackSdks.Scheduler.csproj} | 0 .../Model/JobContext.cs | 2 +- .../Model/SchedulerJobAppConfig.cs | 2 +- ...SchedulerJobDaprServiceInvocationConfig.cs | 2 +- .../Model/SchedulerJobHttpConfig.cs | 2 +- .../Request/AddSchedulerJobRequest.cs | 2 +- .../Request/BaseSchedulerJobRequest.cs | 2 +- .../Request/BaseSchedulerTaskRequest.cs | 2 +- .../Request/ChangeEnabledStatusRequest.cs | 2 +- .../Request/StartSchedulerTaskRequest.cs | 2 +- .../Service/ISchedulerJobService.cs | 2 +- .../Service/ISchedulerTaskService.cs | 2 +- .../_Imports.cs | 7 ++ src/Contrib/README.md | 10 +-- src/Contrib/README.zh-CN.md | 10 +-- .../Masa.Contrib.BasicAbility.Dcc/_Imports.cs | 12 --- .../Masa.Contrib.Configuration/README.md | 2 +- .../README.zh-CN.md | 2 +- .../AuthClient.cs | 4 +- .../Masa.Contrib.StackSdks.Auth}/Constants.cs | 2 +- .../EnvironmentProvider.cs | 2 +- .../HttpEnvironmentDelegatingHandler.cs | 2 +- .../Masa.Contrib.StackSdks.Auth.csproj} | 2 +- .../Masa.Contrib.StackSdks.Auth}/README.md | 14 ++-- .../README.zh-CN.md | 4 +- .../Service/PermissionService.cs | 2 +- .../Service/ProjectService.cs | 2 +- .../Service/SubjectService.cs | 2 +- .../Service/TeamService.cs | 2 +- .../Service/UserService.cs | 2 +- .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.StackSdks.Auth}/_Imports.cs | 11 ++- .../Masa.Contrib.StackSdks.Dcc}/DccClient.cs | 4 +- .../Internal/Constants.cs | 2 +- .../Masa.Contrib.StackSdks.Dcc.csproj} | 2 +- .../Masa.Contrib.StackSdks.Dcc}/README.md | 4 +- .../README.zh-CN.md | 4 +- .../Service/LabelService.cs | 2 +- .../ServiceCollectionExtensions.cs | 2 +- .../Masa.Contrib.StackSdks.Dcc/_Imports.cs | 11 +++ .../Masa.Contrib.StackSdks.Mc}/Constants.cs | 2 +- ...ttpClientAuthorizationDelegatingHandler.cs | 2 +- .../Extensions/DictionaryExtensions.cs | 2 +- .../Extensions/ExtraPropertiesExtensions.cs | 2 +- .../Infrastructure/Helper/TypeHelper.cs | 2 +- .../Masa.Contrib.StackSdks.Mc.csproj} | 2 +- .../Masa.Contrib.StackSdks.Mc}/McClient.cs | 4 +- .../Service/ChannelService.cs | 2 +- .../Service/MessageTaskService.cs | 2 +- .../Service/MessageTemplateService.cs | 2 +- .../Service/ReceiverGroupService.cs | 2 +- .../Service/WebsiteMessageService.cs | 2 +- .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.StackSdks.Mc}/_Imports.cs | 14 ++-- .../Masa.Contrib.StackSdks.Pm}/Constants.cs | 2 +- .../Masa.Contrib.StackSdks.Pm.csproj} | 2 +- .../Masa.Contrib.StackSdks.Pm}/PmClient.cs | 6 +- .../Masa.Contrib.StackSdks.Pm}/README.md | 4 +- .../README.zh-CN.md | 4 +- .../Service/AppService.cs | 5 +- .../Service/ClusterService.cs | 5 +- .../Service/EnvironmentService.cs | 5 +- .../Service/ProjectService.cs | 5 +- .../ServiceCollectionExtensions.cs | 2 + .../Masa.Contrib.StackSdks.Pm}/_Imports.cs | 8 +- .../Constants.cs | 2 +- ...ttpClientAuthorizationDelegatingHandler.cs | 2 +- .../Masa.Contrib.StackSdks.Scheduler.csproj} | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../SchedulerClient.cs | 5 +- .../ServiceCollectionExtensions.cs | 2 + .../Services/SchedulerJobService.cs | 12 ++- .../Services/SchedulerTaskService.cs | 5 +- .../_Imports.cs | 9 +- .../Extensions/CallerProviderExtensions.cs | 2 +- .../Extensions/ServiceExtensions.cs | 4 +- .../Extensions/StreamExtensions.cs | 0 .../Logging/OpenTelemetryLoggingExtensions.cs | 0 .../Masa.Contrib.StackSdks.Tsc.csproj} | 2 +- .../MasaObservableOptions.cs | 2 +- .../Metrics/MasaServiceExtensions.cs | 0 .../OpenTelemetryAttributeName.cs | 2 +- .../OpenTemetry/ResourceBuilderExtenstions.cs | 0 .../Masa.Contrib.StackSdks.Tsc}/README.md | 4 +- .../README.zh-CN.md | 4 +- .../Service/LogService.cs | 2 +- .../Service/MetricService.cs | 2 +- .../Tracing/ActivityExtensions.cs | 0 ...NetCoreInstrumentationOptionsExtensions.cs | 0 .../Tracing/MasaServiceExtensions.cs | 0 .../OpenTelemetryInstrumentationOptions.cs | 0 .../Masa.Contrib.StackSdks.Tsc}/TscClient.cs | 6 +- .../Masa.Contrib.StackSdks.Tsc}/_Imports.cs | 9 +- .../AuthClientTest.cs | 2 +- .../Masa.Contrib.StackSdks.Auth.Tests.csproj} | 4 +- .../PermissionServiceTest.cs | 4 +- .../ProjectServiceTest.cs | 4 +- .../SubjectServiceTest.cs | 4 +- .../TeamServiceTest.cs | 4 +- .../UserServiceTest.cs | 4 +- .../_Imports.cs | 7 +- .../DccClientTest.cs | 2 +- .../LabelServiceTest.cs | 2 +- .../Masa.Contrib.StackSdks.Dcc.Tests.csproj} | 5 +- .../_Imports.cs | 4 +- .../appsettings.json | 0 .../ChannelServiceTest.cs | 4 +- .../Masa.Contrib.StackSdks.Mc.Tests.csproj} | 5 +- .../McClientTest.cs | 2 +- .../MessageTaskServiceTest.cs | 4 +- .../MessageTemplateServiceTest.cs | 4 +- .../ReceiverGroupServiceTest.cs | 4 +- .../WebsiteMessageServiceTest.cs | 4 +- .../_Imports.cs | 5 +- .../AppServiceTest.cs | 4 +- .../ClusterServiceTest.cs | 4 +- .../EnvironmentServiceTest.cs | 4 +- .../Masa.Contrib.StackSdks.Pm.Tests.csproj} | 5 +- .../PmClientTest.cs | 4 +- .../ProjectServiceTest.cs | 4 +- .../_Imports.cs | 2 - ....Contrib.StackSdks.Scheduler.Tests.csproj} | 6 +- .../SchedulerClientTest.cs | 4 +- .../SchedulerJobServiceTest.cs | 7 +- .../SchedulerTaskServiceTest.cs | 5 +- .../_Imports.cs | 4 - .../CallerProviderExtensionsTests.cs | 2 +- .../Masa.Contrib.StackSdks.Tsc.Tests.csproj} | 5 +- .../Service/LogServiceTests.cs | 5 +- .../Service/MetricServiceTests.cs | 5 +- .../_Imports.cs | 5 +- 261 files changed, 467 insertions(+), 394 deletions(-) delete mode 100644 src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/_Imports.cs rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc => StackSdks/Masa.BuildingBlocks.StackSdk.Tsc}/Enums/AggregationTypes.cs (79%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc => StackSdks/Masa.BuildingBlocks.StackSdk.Tsc}/ITscClient.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj => StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj} (100%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc => StackSdks/Masa.BuildingBlocks.StackSdk.Tsc}/Model/Metric/LableValuesRequest.cs (93%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc => StackSdks/Masa.BuildingBlocks.StackSdk.Tsc}/Model/Metric/ValuesRequest.cs (91%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc => StackSdks/Masa.BuildingBlocks.StackSdk.Tsc}/Service/ILogService.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc => StackSdks/Masa.BuildingBlocks.StackSdk.Tsc}/Service/IMetricService.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc => StackSdks/Masa.BuildingBlocks.StackSdk.Tsc}/_Imports.cs (52%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Enum/GenderTypes.cs (75%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Enum/StaffTypes.cs (77%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Enum/SubjectTypes.cs (77%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Enum/TeamTypes.cs (74%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Masa.BuildingBlocks.BasicAbility.Dcc.csproj => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj} (100%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/AddUserModel.cs (92%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/AddressValueModel.cs (92%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/AppModel.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/CollectMenuModel.cs (79%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/DisableUserModel.cs (82%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/MenuModel.cs (86%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/NavModel.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/ProjectModel.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/RoleModel.cs (79%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/StaffDetailModel.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/StaffModel.cs (96%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/SubjectModel.cs (93%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/TeamDetailModel.cs (94%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/TeamModel.cs (86%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/TeamPersonnelModel.cs (86%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/UpdateUserBasicInfoModel.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/UpdateUserPasswordModel.cs (83%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/UpsertUserModel.cs (92%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/UserModel.cs (96%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/UserPortraitModel.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/UserSimpleModel.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/Model/UserVisitedModel.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts => StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts}/_Imports.cs (68%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth => StackSdks/Masa.BuildingBlocks.StackSdks.Auth}/IAuthClient.cs (89%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth => StackSdks/Masa.BuildingBlocks.StackSdks.Auth}/IEnvironmentProvider.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Masa.BuildingBlocks.BasicAbility.Auth.csproj => StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj} (62%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth => StackSdks/Masa.BuildingBlocks.StackSdks.Auth}/Service/IPermissionService.cs (93%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth => StackSdks/Masa.BuildingBlocks.StackSdks.Auth}/Service/IProjectService.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth => StackSdks/Masa.BuildingBlocks.StackSdks.Auth}/Service/ISubjectService.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth => StackSdks/Masa.BuildingBlocks.StackSdks.Auth}/Service/ITeamService.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth => StackSdks/Masa.BuildingBlocks.StackSdks.Auth}/Service/IUserService.cs (96%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth => StackSdks/Masa.BuildingBlocks.StackSdks.Auth}/_Imports.cs (53%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc => StackSdks/Masa.BuildingBlocks.StackSdks.Dcc}/IDccClient.cs (82%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Masa.BuildingBlocks.BasicAbility.Pm.csproj => StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj} (100%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc => StackSdks/Masa.BuildingBlocks.StackSdks.Dcc}/Model/LabelModel.cs (90%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc => StackSdks/Masa.BuildingBlocks.StackSdks.Dcc}/Service/ILabelService.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc => StackSdks/Masa.BuildingBlocks.StackSdks.Dcc}/_Imports.cs (55%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/ChannelTypes.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/MessageTaskReceiverTypes.cs (82%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/MessageTaskSelectReceiverTypes.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/MessageTaskSources.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/MessageTaskStatuses.cs (84%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/MessageTemplateAuditStatuses.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/MessageTemplateStates.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/MessageTypes.cs (79%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/ReceiverGroupItemTypes.cs (82%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/SendTargets.cs (79%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Enum/WebsiteMessageFilterType.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/IMcClient.cs (90%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs (100%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Masa.BuildingBlocks.BasicAbility.Mc.csproj => StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj} (100%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/AuditEntityModel.cs (88%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/ChannelModel.cs (90%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/EntityModel.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/GetChannelModel.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/GetMessageTemplateModel.cs (92%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/GetNoticeListModel.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/GetReceiverGroupModel.cs (83%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/GetWebsiteMessageModel.cs (88%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/MessageInfoModel.cs (89%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/MessageInfoUpsertModel.cs (89%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/MessageTaskModel.cs (95%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/MessageTaskReceiverModel.cs (91%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/MessageTemplateItemModel.cs (88%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/MessageTemplateModel.cs (96%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/PaginatedListModel.cs (91%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/PaginatedOptionsModel.cs (90%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/ReadAllWebsiteMessageModel.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/ReadWebsiteMessageModel.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/ReceiverGroupItemModel.cs (91%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/ReceiverGroupModel.cs (89%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/SendOrdinaryMessageModel.cs (92%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/SendRuleModel.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/SendTemplateMessageModel.cs (93%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/WebsiteMessageChannelModel.cs (82%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Model/WebsiteMessageModel.cs (93%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Service/IChannelService.cs (84%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Service/IMessageTaskService.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Service/IMessageTemplateService.cs (86%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Service/IReceiverGroupService.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/Service/IWebsiteMessageService.cs (93%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc => StackSdks/Masa.BuildingBlocks.StackSdks.Mc}/_Imports.cs (59%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Enum/AppTypes.cs (84%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Enum/ServiceTypes.cs (83%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/IPmClient.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Masa.BuildingBlocks.BasicAbility.Scheduler.csproj => StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj} (100%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/AppDetailModel.cs (92%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/AppModel.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/BaseModel.cs (86%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/ClusterDetailModel.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/ClusterModel.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/EnvironmentClusterModel.cs (90%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/EnvironmentDetailModel.cs (89%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/EnvironmentModel.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/ProjectAppsModel.cs (92%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/ProjectDetailModel.cs (90%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/ProjectModel.cs (91%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Model/ProjectTypeModel.cs (82%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Service/IAppService.cs (82%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Service/IClusterService.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Service/IEnvironmentService.cs (74%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/Service/IProjectService.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm => StackSdks/Masa.BuildingBlocks.StackSdks.Pm}/_Imports.cs (51%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Enum/HttpMethods.cs (79%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Enum/HttpVerifyTypes.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Enum/JobTypes.cs (79%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Enum/RunTimeoutStrategyTypes.cs (79%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Enum/ScheduleBlockStrategyTypes.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Enum/ScheduleExpiredStrategyTypes.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/ISchedulerClient.cs (84%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/ISchedulerJob.cs (85%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Masa.BuildingBlocks.BasicAbility.Tsc.csproj => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj} (100%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Model/JobContext.cs (88%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Model/SchedulerJobAppConfig.cs (89%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Model/SchedulerJobDaprServiceInvocationConfig.cs (87%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Model/SchedulerJobHttpConfig.cs (91%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Request/AddSchedulerJobRequest.cs (95%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Request/BaseSchedulerJobRequest.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Request/BaseSchedulerTaskRequest.cs (81%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Request/ChangeEnabledStatusRequest.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Request/StartSchedulerTaskRequest.cs (80%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Service/ISchedulerJobService.cs (88%) rename src/BuildingBlocks/src/{BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler => StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler}/Service/ISchedulerTaskService.cs (83%) create mode 100644 src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs delete mode 100644 src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/_Imports.cs rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/AuthClient.cs (91%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/Constants.cs (88%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/EnvironmentProvider.cs (93%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/HttpEnvironmentDelegatingHandler.cs (96%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj => StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj} (86%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/README.md (73%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/README.zh-CN.md (92%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/Service/PermissionService.cs (97%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/Service/ProjectService.cs (94%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/Service/SubjectService.cs (91%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/Service/TeamService.cs (96%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/Service/UserService.cs (99%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/ServiceCollectionExtensions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Auth => StackSdks/Masa.Contrib.StackSdks.Auth}/_Imports.cs (58%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Dcc => StackSdks/Masa.Contrib.StackSdks.Dcc}/DccClient.cs (82%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Dcc => StackSdks/Masa.Contrib.StackSdks.Dcc}/Internal/Constants.cs (84%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj => StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj} (78%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Dcc => StackSdks/Masa.Contrib.StackSdks.Dcc}/README.md (91%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Dcc => StackSdks/Masa.Contrib.StackSdks.Dcc}/README.zh-CN.md (91%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Dcc => StackSdks/Masa.Contrib.StackSdks.Dcc}/Service/LabelService.cs (92%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Dcc => StackSdks/Masa.Contrib.StackSdks.Dcc}/ServiceCollectionExtensions.cs (96%) create mode 100644 src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/Constants.cs (86%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/HttpClientAuthorizationDelegatingHandler.cs (95%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/Infrastructure/Extensions/DictionaryExtensions.cs (98%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/Infrastructure/Extensions/ExtraPropertiesExtensions.cs (97%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/Infrastructure/Helper/TypeHelper.cs (98%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj => StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj} (75%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/McClient.cs (91%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/Service/ChannelService.cs (94%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/Service/MessageTaskService.cs (95%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/Service/MessageTemplateService.cs (94%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/Service/ReceiverGroupService.cs (94%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/Service/WebsiteMessageService.cs (97%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/ServiceCollectionExtensions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Mc => StackSdks/Masa.Contrib.StackSdks.Mc}/_Imports.cs (60%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/Constants.cs (86%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj => StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj} (84%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/PmClient.cs (80%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/README.md (89%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/README.zh-CN.md (89%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/Service/AppService.cs (91%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/Service/ClusterService.cs (90%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/Service/EnvironmentService.cs (84%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/Service/ProjectService.cs (93%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/ServiceCollectionExtensions.cs (97%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Pm => StackSdks/Masa.Contrib.StackSdks.Pm}/_Imports.cs (52%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler => StackSdks/Masa.Contrib.StackSdks.Scheduler}/Constants.cs (87%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler => StackSdks/Masa.Contrib.StackSdks.Scheduler}/HttpClientAuthorizationDelegatingHandler.cs (95%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj => StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj} (81%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler => StackSdks/Masa.Contrib.StackSdks.Scheduler}/README.md (89%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler => StackSdks/Masa.Contrib.StackSdks.Scheduler}/README.zh-CN.md (89%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler => StackSdks/Masa.Contrib.StackSdks.Scheduler}/SchedulerClient.cs (79%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler => StackSdks/Masa.Contrib.StackSdks.Scheduler}/ServiceCollectionExtensions.cs (97%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler => StackSdks/Masa.Contrib.StackSdks.Scheduler}/Services/SchedulerJobService.cs (91%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler => StackSdks/Masa.Contrib.StackSdks.Scheduler}/Services/SchedulerTaskService.cs (90%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler => StackSdks/Masa.Contrib.StackSdks.Scheduler}/_Imports.cs (56%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Extensions/CallerProviderExtensions.cs (90%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Extensions/ServiceExtensions.cs (90%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Extensions/StreamExtensions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Logging/OpenTelemetryLoggingExtensions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj => StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj} (91%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/MasaObservableOptions.cs (91%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Metrics/MasaServiceExtensions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/OpenTelemetryAttributeName.cs (99%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/OpenTemetry/ResourceBuilderExtenstions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/README.md (94%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/README.zh-CN.md (93%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Service/LogService.cs (95%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Service/MetricService.cs (97%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Tracing/ActivityExtensions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Tracing/MasaServiceExtensions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/Tracing/OpenTelemetryInstrumentationOptions.cs (100%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/TscClient.cs (74%) rename src/Contrib/src/{BasicAbility/Masa.Contrib.BasicAbility.Tsc => StackSdks/Masa.Contrib.StackSdks.Tsc}/_Imports.cs (79%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests => StackSdks/Masa.Contrib.StackSdks.Auth.Tests}/AuthClientTest.cs (96%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj => StackSdks/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj} (78%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests => StackSdks/Masa.Contrib.StackSdks.Auth.Tests}/PermissionServiceTest.cs (98%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests => StackSdks/Masa.Contrib.StackSdks.Auth.Tests}/ProjectServiceTest.cs (93%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests => StackSdks/Masa.Contrib.StackSdks.Auth.Tests}/SubjectServiceTest.cs (91%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests => StackSdks/Masa.Contrib.StackSdks.Auth.Tests}/TeamServiceTest.cs (96%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests => StackSdks/Masa.Contrib.StackSdks.Auth.Tests}/UserServiceTest.cs (99%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests => StackSdks/Masa.Contrib.StackSdks.Auth.Tests}/_Imports.cs (63%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests => StackSdks/Masa.Contrib.StackSdks.Dcc.Tests}/DccClientTest.cs (96%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests => StackSdks/Masa.Contrib.StackSdks.Dcc.Tests}/LabelServiceTest.cs (97%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj => StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj} (79%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests => StackSdks/Masa.Contrib.StackSdks.Dcc.Tests}/_Imports.cs (79%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests => StackSdks/Masa.Contrib.StackSdks.Dcc.Tests}/appsettings.json (100%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests => StackSdks/Masa.Contrib.StackSdks.Mc.Tests}/ChannelServiceTest.cs (94%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj => StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj} (73%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests => StackSdks/Masa.Contrib.StackSdks.Mc.Tests}/McClientTest.cs (95%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests => StackSdks/Masa.Contrib.StackSdks.Mc.Tests}/MessageTaskServiceTest.cs (96%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests => StackSdks/Masa.Contrib.StackSdks.Mc.Tests}/MessageTemplateServiceTest.cs (95%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests => StackSdks/Masa.Contrib.StackSdks.Mc.Tests}/ReceiverGroupServiceTest.cs (95%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests => StackSdks/Masa.Contrib.StackSdks.Mc.Tests}/WebsiteMessageServiceTest.cs (98%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests => StackSdks/Masa.Contrib.StackSdks.Mc.Tests}/_Imports.cs (73%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests => StackSdks/Masa.Contrib.StackSdks.Pm.Tests}/AppServiceTest.cs (98%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests => StackSdks/Masa.Contrib.StackSdks.Pm.Tests}/ClusterServiceTest.cs (98%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests => StackSdks/Masa.Contrib.StackSdks.Pm.Tests}/EnvironmentServiceTest.cs (96%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj => StackSdks/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj} (79%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests => StackSdks/Masa.Contrib.StackSdks.Pm.Tests}/PmClientTest.cs (96%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests => StackSdks/Masa.Contrib.StackSdks.Pm.Tests}/ProjectServiceTest.cs (98%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests => StackSdks/Masa.Contrib.StackSdks.Pm.Tests}/_Imports.cs (81%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj => StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj} (72%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests => StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests}/SchedulerClientTest.cs (94%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests => StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests}/SchedulerJobServiceTest.cs (98%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests => StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests}/SchedulerTaskServiceTest.cs (92%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests => StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests}/_Imports.cs (67%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test => StackSdks/Masa.Contrib.StackSdks.Tsc.Test}/Extensions/CallerProviderExtensionsTests.cs (92%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj => StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj} (70%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test => StackSdks/Masa.Contrib.StackSdks.Tsc.Test}/Service/LogServiceTests.cs (96%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test => StackSdks/Masa.Contrib.StackSdks.Tsc.Test}/Service/MetricServiceTests.cs (96%) rename src/Contrib/test/{BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test => StackSdks/Masa.Contrib.StackSdks.Tsc.Test}/_Imports.cs (77%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 9b24503d1..ede631c72 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -27,7 +27,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolati EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Storage.ObjectStorage", "src\BuildingBlocks\src\Storage\Masa.BuildingBlocks.Storage.ObjectStorage\Masa.BuildingBlocks.Storage.ObjectStorage.csproj", "{74283F68-6B38-4CF4-B0CB-AAD65618ADB8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Pm", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Pm\Masa.BuildingBlocks.BasicAbility.Pm.csproj", "{AB6FAB84-5218-48A8-8F94-03B02ECD098F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Pm", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Pm\Masa.BuildingBlocks.StackSdks.Pm.csproj", "{AB6FAB84-5218-48A8-8F94-03B02ECD098F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Mapping", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.Mapping\Masa.BuildingBlocks.Data.Mapping.csproj", "{5A3338F1-9963-4CAC-85A3-7AB263CB15B0}" EndProject @@ -35,7 +35,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Contracts", "src\BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.Contracts\Masa.BuildingBlocks.Service.Contracts.csproj", "{736F69E9-89D0-47E2-99AF-9412AAE1C6BB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth\Masa.BuildingBlocks.BasicAbility.Auth.csproj", "{4B818EE6-8E13-40DA-B99A-218BB228EE91}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Auth\Masa.BuildingBlocks.StackSdks.Auth.csproj", "{4B818EE6-8E13-40DA-B99A-218BB228EE91}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6}" EndProject @@ -51,17 +51,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authent EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\src\Identity\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Dcc", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Dcc\Masa.BuildingBlocks.BasicAbility.Dcc.csproj", "{FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Dcc", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Dcc\Masa.BuildingBlocks.StackSdks.Dcc.csproj", "{FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth.Contracts", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth.Contracts\Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj", "{981E883E-CCDC-400B-8FB1-76E1E65C32AF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth.Contracts", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Auth.Contracts\Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj", "{981E883E-CCDC-400B-8FB1-76E1E65C32AF}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{0D34A7F0-DC77-4789-A136-93089CBD15C3}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{0D34A7F0-DC77-4789-A136-93089CBD15C3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Scheduler", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Scheduler\Masa.BuildingBlocks.BasicAbility.Scheduler.csproj", "{0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Scheduler", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Scheduler\Masa.BuildingBlocks.StackSdks.Scheduler.csproj", "{0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Mc", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Mc\Masa.BuildingBlocks.BasicAbility.Mc.csproj", "{DA816A33-F164-4456-92DD-A672BAD1A6B1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Tsc", "src\BuildingBlocks\src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Tsc\Masa.BuildingBlocks.BasicAbility.Tsc.csproj", "{C265268A-F311-4B6A-915E-C1AF9D1EB624}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Mc", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Mc\Masa.BuildingBlocks.StackSdks.Mc.csproj", "{DA816A33-F164-4456-92DD-A672BAD1A6B1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Caller", "src\BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{ABF6E41A-CBF9-49DE-87FC-9D88F440A104}" EndProject @@ -395,33 +393,31 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Int EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Tests\Masa.Contrib.Dispatcher.Tests.csproj", "{AE626BF6-3202-46B2-BB1A-0E71ED462C84}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{985B71A9-DF28-4B70-9DA5-1D60B82E8551}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Auth", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Auth\Masa.Contrib.BasicAbility.Auth.csproj", "{140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{985B71A9-DF28-4B70-9DA5-1D60B82E8551}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Dcc", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Dcc\Masa.Contrib.BasicAbility.Dcc.csproj", "{EAAD274F-9C5D-4531-A4E5-A5764E9D644A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Auth\Masa.Contrib.StackSdks.Auth.csproj", "{140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Mc", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Mc\Masa.Contrib.BasicAbility.Mc.csproj", "{F9C27912-F7EC-47B6-A385-064BD4B92EDA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Dcc\Masa.Contrib.StackSdks.Dcc.csproj", "{EAAD274F-9C5D-4531-A4E5-A5764E9D644A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Pm", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Pm\Masa.Contrib.BasicAbility.Pm.csproj", "{F346B708-0D1B-4BA7-AA86-1B977BA88FB6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Mc\Masa.Contrib.StackSdks.Mc.csproj", "{F9C27912-F7EC-47B6-A385-064BD4B92EDA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Scheduler", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Scheduler\Masa.Contrib.BasicAbility.Scheduler.csproj", "{332D590C-11EC-481D-AC55-6279548F1CF4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Pm\Masa.Contrib.StackSdks.Pm.csproj", "{F346B708-0D1B-4BA7-AA86-1B977BA88FB6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Tsc", "src\Contrib\src\BasicAbility\Masa.Contrib.BasicAbility.Tsc\Masa.Contrib.BasicAbility.Tsc.csproj", "{7BF99E7E-37EB-46D6-8808-2254430C3645}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Scheduler\Masa.Contrib.StackSdks.Scheduler.csproj", "{332D590C-11EC-481D-AC55-6279548F1CF4}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Tsc\Masa.Contrib.StackSdks.Tsc.csproj", "{7BF99E7E-37EB-46D6-8808-2254430C3645}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Tsc.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Tsc.Test\Masa.Contrib.BasicAbility.Tsc.Tests.csproj", "{5EF602A6-3996-44D3-A6C0-5319C9BF8B21}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Dcc.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Dcc.Tests\Masa.Contrib.BasicAbility.Dcc.Tests\Masa.Contrib.BasicAbility.Dcc.Tests.csproj", "{7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Tsc.Test\Masa.Contrib.StackSdks.Tsc.Tests.csproj", "{5EF602A6-3996-44D3-A6C0-5319C9BF8B21}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Mc.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Mc.Tests\Masa.Contrib.BasicAbility.Mc.Tests.csproj", "{37138DEF-EEE4-4363-A307-0027B4C6ACD8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Mc.Tests\Masa.Contrib.StackSdks.Mc.Tests.csproj", "{37138DEF-EEE4-4363-A307-0027B4C6ACD8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Auth.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Auth.Tests\Masa.Contrib.BasicAbility.Auth.Tests.csproj", "{A93F1887-0011-466C-8EB8-3A338AEA5A4B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Auth.Tests\Masa.Contrib.StackSdks.Auth.Tests.csproj", "{A93F1887-0011-466C-8EB8-3A338AEA5A4B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Pm.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Pm.Tests\Masa.Contrib.BasicAbility.Pm.Tests.csproj", "{A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Pm.Tests\Masa.Contrib.StackSdks.Pm.Tests.csproj", "{A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.BasicAbility.Scheduler.Tests", "src\Contrib\test\BasicAbility\Masa.Contrib.BasicAbility.Scheduler.Tests\Masa.Contrib.BasicAbility.Scheduler.Tests.csproj", "{9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Scheduler.Tests\Masa.Contrib.StackSdks.Scheduler.Tests.csproj", "{9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{965C3DBE-2DF3-4BCF-A7BB-C26BEB2F8CCA}" EndProject @@ -483,6 +479,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs.Tests", "src\Contrib\test\ReadWriteSpliting\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj", "{F45CBF27-1D45-404C-9B09-5CC781AF5942}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Dcc.Tests\Masa.Contrib.StackSdks.Dcc.Tests.csproj", "{2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.StackSdks.Tsc", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdk.Tsc\Masa.BuildingBlocks.StackSdks.Tsc.csproj", "{8EA836C9-BE07-4EDE-A983-122A1D9FB499}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -699,14 +699,6 @@ Global {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|Any CPU.Build.0 = Release|Any CPU {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|x64.ActiveCfg = Release|Any CPU {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|x64.Build.0 = Release|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|x64.ActiveCfg = Debug|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Debug|x64.Build.0 = Debug|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|Any CPU.Build.0 = Release|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|x64.ActiveCfg = Release|Any CPU - {C265268A-F311-4B6A-915E-C1AF9D1EB624}.Release|x64.Build.0 = Release|Any CPU {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|Any CPU.Build.0 = Debug|Any CPU {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1683,14 +1675,6 @@ Global {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|Any CPU.Build.0 = Release|Any CPU {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|x64.ActiveCfg = Release|Any CPU {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|x64.Build.0 = Release|Any CPU - {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Debug|x64.ActiveCfg = Debug|Any CPU - {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Debug|x64.Build.0 = Debug|Any CPU - {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Release|Any CPU.Build.0 = Release|Any CPU - {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Release|x64.ActiveCfg = Release|Any CPU - {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8}.Release|x64.Build.0 = Release|Any CPU {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|Any CPU.Build.0 = Debug|Any CPU {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1891,6 +1875,22 @@ Global {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|Any CPU.Build.0 = Release|Any CPU {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|x64.ActiveCfg = Release|Any CPU {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|x64.Build.0 = Release|Any CPU + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Debug|x64.ActiveCfg = Debug|Any CPU + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Debug|x64.Build.0 = Debug|Any CPU + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Release|Any CPU.Build.0 = Release|Any CPU + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Release|x64.ActiveCfg = Release|Any CPU + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Release|x64.Build.0 = Release|Any CPU + {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Debug|x64.ActiveCfg = Debug|Any CPU + {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Debug|x64.Build.0 = Debug|Any CPU + {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|Any CPU.Build.0 = Release|Any CPU + {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|x64.ActiveCfg = Release|Any CPU + {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1925,7 +1925,6 @@ Global {0D34A7F0-DC77-4789-A136-93089CBD15C3} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {DA816A33-F164-4456-92DD-A672BAD1A6B1} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {C265268A-F311-4B6A-915E-C1AF9D1EB624} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {ABF6E41A-CBF9-49DE-87FC-9D88F440A104} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} {5944A182-13B8-4DA6-AEE2-0A01E64A9648} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} {88740F49-00A1-40F8-B141-78EFA7CE2B4D} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} @@ -2100,7 +2099,6 @@ Global {7BF99E7E-37EB-46D6-8808-2254430C3645} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} {5EF602A6-3996-44D3-A6C0-5319C9BF8B21} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} - {7D4EE00E-4F41-46B8-B9D5-A0F743F075A8} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} {37138DEF-EEE4-4363-A307-0027B4C6ACD8} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} {A93F1887-0011-466C-8EB8-3A338AEA5A4B} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} @@ -2135,6 +2133,8 @@ Global {89EE0C4D-6C29-472E-9109-84327DB489A1} = {92F310E1-6CD0-4066-9703-B81B4AC07819} {AF35D4CC-EBE2-4F2B-8622-7A93A8CF9EF8} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} {F45CBF27-1D45-404C-9B09-5CC781AF5942} = {AF35D4CC-EBE2-4F2B-8622-7A93A8CF9EF8} + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} + {8EA836C9-BE07-4EDE-A983-122A1D9FB499} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/README.md b/README.md index cd64f439a..2ca4fdd4c 100644 --- a/README.md +++ b/README.md @@ -56,11 +56,11 @@ The purpose of MASA.Contrib is based on [MASA.BuildingBlocks](https://github.com * Storage: cloud storage * [Aliyun Storage](./src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md) * Operational capacity - * [Auth](./src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md): Authentication and Authorization - * [Dcc](./src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md): Distributed Configuration Center - * [PM](./src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md): Project Management - * [Scheduler](./src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md): Distributed Scheduler - * [TSC](./src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md): Troubleshooting Console + * [Auth](./src/StackSdks/Masa.Contrib.StackSdks.Auth/README.md): Authentication and Authorization + * [Dcc](./src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md): Distributed Configuration Center + * [PM](./src/StackSdks/Masa.Contrib.StackSdks.Pm/README.md): Project Management + * [Scheduler](./src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md): Distributed Scheduler + * [TSC](./src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md): Troubleshooting Console diff --git a/README.zh-CN.md b/README.zh-CN.md index 5676458a7..a70304ddd 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -56,11 +56,11 @@ MASA.Contrib是基于[MASA.BuildingBlocks](https://github.com/masastack/MASA.Bui * Storage: 云存储 * [阿里云存储](./src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md) * 业务能力 - * [Auth](./src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md): 权限认证 - * [Dcc](./src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md): 分布式配置中心 - * [PM](./src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md): 项目管理 - * [Scheduler](./src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md): 分布式调度中心 - * [TSC](./src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md): 故障排除平台 + * [Auth](./src/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md): 权限认证 + * [Dcc](./src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md): 分布式配置中心 + * [PM](./src/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md): 项目管理 + * [Scheduler](./src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md): 分布式调度中心 + * [TSC](./src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md): 故障排除平台 ## 如何克隆 diff --git a/src/BuildingBlocks/Masa.BuildingBlocks.sln b/src/BuildingBlocks/Masa.BuildingBlocks.sln index 0f687ff5c..daac12ade 100644 --- a/src/BuildingBlocks/Masa.BuildingBlocks.sln +++ b/src/BuildingBlocks/Masa.BuildingBlocks.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31521.260 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BasicAbility", "BasicAbility", "{5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{FBD326D3-E59C-433E-A88E-14E179E3093D}" EndProject @@ -60,7 +60,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Pm", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Pm\Masa.BuildingBlocks.BasicAbility.Pm.csproj", "{5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Pm", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Pm\Masa.BuildingBlocks.StackSdks.Pm.csproj", "{5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolation", "src\Isolation\Masa.BuildingBlocks.Isolation\Masa.BuildingBlocks.Isolation.csproj", "{5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}" EndProject @@ -88,13 +88,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authent EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{701DF095-CF25-4311-9129-279A1834D8A3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Scheduler", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Scheduler\Masa.BuildingBlocks.BasicAbility.Scheduler.csproj", "{E9B586D1-CCEF-450E-9E29-E102B141C32F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Scheduler", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Scheduler\Masa.BuildingBlocks.StackSdks.Scheduler.csproj", "{E9B586D1-CCEF-450E-9E29-E102B141C32F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth.Contracts", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth.Contracts\Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj", "{A006D835-D5A1-440E-A55A-58BE27794515}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth.Contracts", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Auth.Contracts\Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj", "{A006D835-D5A1-440E-A55A-58BE27794515}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Auth", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Auth\Masa.BuildingBlocks.BasicAbility.Auth.csproj", "{8EE885E8-7D15-4810-9E1B-871089319080}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Auth\Masa.BuildingBlocks.StackSdks.Auth.csproj", "{8EE885E8-7D15-4810-9E1B-871089319080}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.BasicAbility.Dcc", "src\BasicAbility\Masa.BuildingBlocks.BasicAbility.Dcc\Masa.BuildingBlocks.BasicAbility.Dcc.csproj", "{BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Dcc", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Dcc\Masa.BuildingBlocks.StackSdks.Dcc.csproj", "{BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.Service.Caller", "src\Service\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{C4BF6451-134A-4113-8B13-5F8CE95E1B72}" EndProject diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/_Imports.cs b/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/_Imports.cs deleted file mode 100644 index fadffca3b..000000000 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; -global using Masa.BuildingBlocks.BasicAbility.Scheduler.Model; -global using Masa.BuildingBlocks.BasicAbility.Scheduler.Request; -global using Masa.BuildingBlocks.BasicAbility.Scheduler.Service; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Enums/AggregationTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs similarity index 79% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Enums/AggregationTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs index 9269bcc2c..f4eaa89d3 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Enums/AggregationTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Tsc.Enums; +namespace Masa.BuildingBlocks.StackSdks.Tsc.Enums; public enum AggregationTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/ITscClient.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/ITscClient.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs index 4ad5d45ff..20c08dd9a 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/ITscClient.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Tsc; +namespace Masa.BuildingBlocks.StackSdks.Tsc; public interface ITscClient { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj similarity index 100% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Masa.BuildingBlocks.BasicAbility.Auth.Contracts.csproj rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/LableValuesRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs similarity index 93% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/LableValuesRequest.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs index 0153f513e..6ecf1f444 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/LableValuesRequest.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Tsc.Model; +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; public class LableValuesRequest { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/ValuesRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs similarity index 91% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/ValuesRequest.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs index 43b947f3c..ab79dc846 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Model/Metric/ValuesRequest.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Tsc.Model; +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; public class ValuesRequest { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/ILogService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/ILogService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs index ec1d0696d..97086caec 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/ILogService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Tsc.Service; +namespace Masa.BuildingBlocks.StackSdks.Tsc.Service; public interface ILogService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/IMetricService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/IMetricService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs index dd26284ec..cbd2b3bcf 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Service/IMetricService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Tsc.Service; +namespace Masa.BuildingBlocks.StackSdks.Tsc.Service; public interface IMetricService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/_Imports.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs similarity index 52% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/_Imports.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs index ac697ef51..9549f7961 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/_Imports.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Tsc.Enums; -global using Masa.BuildingBlocks.BasicAbility.Tsc.Model; -global using Masa.BuildingBlocks.BasicAbility.Tsc.Service; +global using Masa.BuildingBlocks.StackSdks.Tsc.Enums; +global using Masa.BuildingBlocks.StackSdks.Tsc.Model; +global using Masa.BuildingBlocks.StackSdks.Tsc.Service; global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/GenderTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs similarity index 75% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/GenderTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs index ec0e9eaf8..09dc7e961 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/GenderTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; public enum GenderTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/StaffTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs similarity index 77% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/StaffTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs index 457ae5ce5..5662a2328 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/StaffTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; public enum StaffTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/SubjectTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs similarity index 77% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/SubjectTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs index 8a90e27f6..9a51a0fda 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/SubjectTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; public enum SubjectTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/TeamTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs similarity index 74% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/TeamTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs index c43f66a69..dc6cc09df 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Enum/TeamTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; public enum TeamTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Masa.BuildingBlocks.BasicAbility.Dcc.csproj b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj similarity index 100% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Masa.BuildingBlocks.BasicAbility.Dcc.csproj rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddUserModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs similarity index 92% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddUserModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs index 6f1c3f63b..03b2b2516 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddUserModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class AddUserModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddressValueModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs similarity index 92% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddressValueModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs index 895c96205..1b94a7c70 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AddressValueModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class AddressValueModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AppModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AppModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs index 506ed496f..6d15c2b6a 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/AppModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class AppModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/CollectMenuModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs similarity index 79% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/CollectMenuModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs index 3232af39d..486dcac30 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/CollectMenuModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class CollectMenuModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/DisableUserModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs similarity index 82% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/DisableUserModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs index 87fc89dd1..188ab7033 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/DisableUserModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class DisableUserModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/MenuModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs similarity index 86% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/MenuModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs index 4b68d3e55..5c6975e30 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/MenuModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class MenuModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/NavModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/NavModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs index 7002a0cb0..911fca3c1 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/NavModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class NavModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/ProjectModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/ProjectModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs index b95470198..08dda6f4f 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/ProjectModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class ProjectModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/RoleModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs similarity index 79% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/RoleModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs index d2d57d3d7..8b35cee28 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/RoleModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class RoleModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffDetailModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffDetailModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs index 61badfc5b..84203a467 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffDetailModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class StaffDetailModel: StaffModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs similarity index 96% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs index b573d5b36..f55e215ae 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/StaffModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class StaffModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/SubjectModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs similarity index 93% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/SubjectModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs index 2022f5026..a21a3c131 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/SubjectModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class SubjectModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamDetailModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs similarity index 94% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamDetailModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs index c597da186..a4ba3acdc 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamDetailModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class TeamDetailModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs similarity index 86% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs index 2c1baa747..2c5832153 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class TeamModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamPersonnelModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs similarity index 86% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamPersonnelModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs index 7252d6891..c955b46a6 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/TeamPersonnelModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class TeamPersonnelModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs index 7098c3faa..d84c75367 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class UpdateUserBasicInfoModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserPasswordModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs similarity index 83% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserPasswordModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs index 961b16d3f..c5e164269 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpdateUserPasswordModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class UpdateUserPasswordModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpsertUserModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs similarity index 92% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpsertUserModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs index 61fa33389..52bbad87e 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UpsertUserModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class UpsertUserModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs similarity index 96% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs index 876dcd34a..c6da02b56 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class UserModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserPortraitModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserPortraitModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs index e64f32d29..df76bc966 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserPortraitModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class UserPortraitModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserSimpleModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserSimpleModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs index 001d9b286..14cbe1c49 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserSimpleModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class UserSimpleModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserVisitedModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserVisitedModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs index 11d071dcd..6e3e02a8f 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/Model/UserVisitedModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; public class UserVisitedModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/_Imports.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs similarity index 68% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/_Imports.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs index 979a758f6..069e32609 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth.Contracts/_Imports.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs @@ -1,4 +1,4 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IAuthClient.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs similarity index 89% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IAuthClient.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs index 16b068758..656dddcd4 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IAuthClient.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth; +namespace Masa.BuildingBlocks.StackSdks.Auth; public interface IAuthClient { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IEnvironmentProvider.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IEnvironmentProvider.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs index 63df11e54..6c6f22319 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/IEnvironmentProvider.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth; +namespace Masa.BuildingBlocks.StackSdks.Auth; public interface IEnvironmentProvider { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Masa.BuildingBlocks.BasicAbility.Auth.csproj b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj similarity index 62% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Masa.BuildingBlocks.BasicAbility.Auth.csproj rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj index 4dbfe1f9b..7ae248f00 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Masa.BuildingBlocks.BasicAbility.Auth.csproj +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IPermissionService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs similarity index 93% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IPermissionService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs index fd189b571..8ccb4d687 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IPermissionService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; public interface IPermissionService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IProjectService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IProjectService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs index bcff62566..3b1157237 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IProjectService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; public interface IProjectService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ISubjectService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ISubjectService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs index 926494f8f..3eb636495 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ISubjectService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; public interface ISubjectService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ITeamService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ITeamService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs index cdf9d8a2c..a8c0b74d5 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/ITeamService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; public interface ITeamService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IUserService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs similarity index 96% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IUserService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs index 6673d6c38..2d8074789 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/Service/IUserService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Auth.Service; +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; public interface IUserService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/_Imports.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs similarity index 53% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/_Imports.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs index 80a883fd5..a3ed35b1a 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Auth/_Imports.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs @@ -1,5 +1,5 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; -global using Masa.BuildingBlocks.BasicAbility.Auth.Service; +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; +global using Masa.BuildingBlocks.StackSdks.Auth.Service; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/IDccClient.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs similarity index 82% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/IDccClient.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs index 052a858ed..e1d7971f0 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/IDccClient.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Dcc; +namespace Masa.BuildingBlocks.StackSdks.Dcc; public interface IDccClient { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Masa.BuildingBlocks.BasicAbility.Pm.csproj b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj similarity index 100% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Masa.BuildingBlocks.BasicAbility.Pm.csproj rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Model/LabelModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs similarity index 90% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Model/LabelModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs index e6de7cccd..1be05ebc4 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Model/LabelModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Dcc.Model +namespace Masa.BuildingBlocks.StackSdks.Dcc.Model { public class LabelModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Service/ILabelService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Service/ILabelService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs index f00dc6f74..0d4c1417a 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/Service/ILabelService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Dcc.Service; +namespace Masa.BuildingBlocks.StackSdks.Dcc.Service; public interface ILabelService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/_Imports.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs similarity index 55% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/_Imports.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs index 8b71ee7c2..328df80c1 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Dcc/_Imports.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs @@ -1,5 +1,5 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Dcc.Model; -global using Masa.BuildingBlocks.BasicAbility.Dcc.Service; +global using Masa.BuildingBlocks.StackSdks.Dcc.Model; +global using Masa.BuildingBlocks.StackSdks.Dcc.Service; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ChannelTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ChannelTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs index 37250a18d..7be436d31 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ChannelTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum ChannelTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskReceiverTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs similarity index 82% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskReceiverTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs index b6d160de0..babf49792 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskReceiverTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum MessageTaskReceiverTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSelectReceiverTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSelectReceiverTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs index ad68fda1f..e8c70f610 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSelectReceiverTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum MessageTaskSelectReceiverTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSources.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSources.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs index 6f59b9f95..3133a88eb 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskSources.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum MessageTaskSources { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskStatuses.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs similarity index 84% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskStatuses.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs index 8e0b61fe2..a02130d88 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTaskStatuses.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum MessageTaskStatuses { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateAuditStatuses.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateAuditStatuses.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs index d077546cd..66b7abbd2 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateAuditStatuses.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum MessageTemplateAuditStatuses { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateStates.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateStates.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs index d429a2680..412def79e 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTemplateStates.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum MessageTemplateStates { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs similarity index 79% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs index 42b23fcaf..4d49430d7 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/MessageTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum MessageTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ReceiverGroupItemTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs similarity index 82% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ReceiverGroupItemTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs index ab19ef852..da0924f5a 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/ReceiverGroupItemTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum ReceiverGroupItemTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/SendTargets.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs similarity index 79% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/SendTargets.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs index 82ce91beb..bb3015eba 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/SendTargets.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum SendTargets { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/WebsiteMessageFilterType.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/WebsiteMessageFilterType.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs index 2385f0287..a50c75583 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Enum/WebsiteMessageFilterType.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Enum; +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; public enum WebsiteMessageFilterType { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/IMcClient.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs similarity index 90% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/IMcClient.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs index a7067b540..935e624f5 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/IMcClient.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc; +namespace Masa.BuildingBlocks.StackSdks.Mc; public interface IMcClient { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs similarity index 100% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Masa.BuildingBlocks.BasicAbility.Mc.csproj b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj similarity index 100% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Masa.BuildingBlocks.BasicAbility.Mc.csproj rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/AuditEntityModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs similarity index 88% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/AuditEntityModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs index 5fe684bd1..9b4217c7a 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/AuditEntityModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class AuditEntityModel : EntityModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ChannelModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs similarity index 90% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ChannelModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs index 404bbb78c..f1ba0051e 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ChannelModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class ChannelModel : AuditEntityModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/EntityModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/EntityModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs index 2cab60770..ebb8df3e6 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/EntityModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class EntityModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetChannelModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetChannelModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs index 1408ff65c..cf32ef960 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetChannelModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class GetChannelModel : PaginatedOptions { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetMessageTemplateModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs similarity index 92% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetMessageTemplateModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs index 7608abc9d..d783dcc1d 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetMessageTemplateModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class GetMessageTemplateModel : PaginatedOptions { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetNoticeListModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetNoticeListModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs index 57c5d2559..bfed7b35f 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetNoticeListModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class GetNoticeListModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetReceiverGroupModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs similarity index 83% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetReceiverGroupModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs index 6da240669..06af3f7c0 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetReceiverGroupModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class GetReceiverGroupModel : PaginatedOptions { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetWebsiteMessageModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs similarity index 88% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetWebsiteMessageModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs index 8fc7d10f1..1175ddb2e 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/GetWebsiteMessageModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class GetWebsiteMessageModel : PaginatedOptionsModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs similarity index 89% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs index 48ad86259..f56dcd142 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class MessageInfoModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoUpsertModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs similarity index 89% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoUpsertModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs index 7dd1079b1..6fc0daec8 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageInfoUpsertModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class MessageInfoUpsertModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs similarity index 95% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs index 3a06771d8..61f43e012 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class MessageTaskModel : AuditEntityModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskReceiverModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs similarity index 91% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskReceiverModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs index 2736ff385..587696efd 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTaskReceiverModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class MessageTaskReceiverModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateItemModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs similarity index 88% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateItemModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs index 6f28d44e1..acec18d51 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateItemModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class MessageTemplateItemModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs similarity index 96% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs index 8d3619020..a724c8ca7 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/MessageTemplateModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class MessageTemplateModel : AuditEntityModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedListModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs similarity index 91% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedListModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs index 20174f759..8793915f2 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedListModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class PaginatedListModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedOptionsModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs similarity index 90% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedOptionsModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs index 98dae85f1..1846fc3d8 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/PaginatedOptionsModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class PaginatedOptionsModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadAllWebsiteMessageModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadAllWebsiteMessageModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs index 7b69863f9..bbd431360 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadAllWebsiteMessageModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class ReadAllWebsiteMessageModel : GetWebsiteMessageModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadWebsiteMessageModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadWebsiteMessageModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs index ed0c119cc..69aaa8191 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReadWebsiteMessageModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class ReadWebsiteMessageModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupItemModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs similarity index 91% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupItemModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs index 987d1ccc8..ab3a27b65 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupItemModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class ReceiverGroupItemModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs similarity index 89% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs index 8ad94e451..9af8a9f07 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/ReceiverGroupModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class ReceiverGroupModel : AuditEntityModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendOrdinaryMessageModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs similarity index 92% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendOrdinaryMessageModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs index 46c631ddb..2fbdb54e3 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendOrdinaryMessageModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class SendOrdinaryMessageModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendRuleModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendRuleModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs index 4108b7ff9..6a02b1a0c 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendRuleModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class SendRuleModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendTemplateMessageModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs similarity index 93% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendTemplateMessageModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs index 13c927c5f..08cb07f3b 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/SendTemplateMessageModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class SendTemplateMessageModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageChannelModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs similarity index 82% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageChannelModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs index 5323807d7..4d7cf3711 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageChannelModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class WebsiteMessageChannelModel : WebsiteMessageModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs similarity index 93% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs index 365da1872..efeceb5c0 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Model/WebsiteMessageModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Model; +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; public class WebsiteMessageModel : AuditEntityModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IChannelService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs similarity index 84% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IChannelService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs index a696cfec1..f13b62319 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IChannelService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; public interface IChannelService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTaskService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTaskService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs index 99390630d..e19aded92 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTaskService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; public interface IMessageTaskService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTemplateService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs similarity index 86% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTemplateService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs index a96c9de0d..a72efd7ee 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IMessageTemplateService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; public interface IMessageTemplateService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IReceiverGroupService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IReceiverGroupService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs index f23ebfe32..784e10b8d 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IReceiverGroupService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; public interface IReceiverGroupService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IWebsiteMessageService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs similarity index 93% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IWebsiteMessageService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs index f0bfef41a..d7030a6fc 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/Service/IWebsiteMessageService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Mc.Service; +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; public interface IWebsiteMessageService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/_Imports.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs similarity index 59% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/_Imports.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs index 69c7f3d4e..e2152a3c0 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Mc/_Imports.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs @@ -1,8 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Mc.Enum; -global using Masa.BuildingBlocks.BasicAbility.Mc.Model; -global using Masa.BuildingBlocks.BasicAbility.Mc.Service; +global using Masa.BuildingBlocks.StackSdks.Mc.Enum; +global using Masa.BuildingBlocks.StackSdks.Mc.Model; +global using Masa.BuildingBlocks.StackSdks.Mc.Service; global using Masa.BuildingBlocks.Ddd.Domain.Repositories; global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/AppTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs similarity index 84% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/AppTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs index 3fd4cee9d..61c8a96b2 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/AppTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Enum; +namespace Masa.BuildingBlocks.StackSdks.Pm.Enum; public enum AppTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/ServiceTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs similarity index 83% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/ServiceTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs index 0867e2fe8..6d38f766f 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Enum/ServiceTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Enum; +namespace Masa.BuildingBlocks.StackSdks.Pm.Enum; public enum ServiceTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/IPmClient.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/IPmClient.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs index 37287260e..76d8c48a9 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/IPmClient.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm; +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.BuildingBlocks.StackSdks.Pm; public interface IPmClient { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Masa.BuildingBlocks.BasicAbility.Scheduler.csproj b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj similarity index 100% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Masa.BuildingBlocks.BasicAbility.Scheduler.csproj rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppDetailModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs similarity index 92% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppDetailModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs index 5b769ec04..5aa26698c 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppDetailModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class AppDetailModel : BaseModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs index 21d98bfa8..b364aaa64 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/AppModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +using Masa.BuildingBlocks.StackSdks.Pm.Enum; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class AppModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/BaseModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs similarity index 86% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/BaseModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs index 919ec48bc..07ad7a895 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/BaseModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class BaseModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterDetailModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterDetailModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs index bf2560aab..41fc6b4e4 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterDetailModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class ClusterDetailModel : BaseModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs index 33cc88537..6a1b19dbe 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ClusterModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class ClusterModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentClusterModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs similarity index 90% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentClusterModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs index f24e3e1b0..ee1916645 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentClusterModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class EnvironmentClusterModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentDetailModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs similarity index 89% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentDetailModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs index 4482ba7bb..32c517967 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentDetailModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class EnvironmentDetailModel : BaseModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs index d620467c6..c939ab264 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/EnvironmentModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class EnvironmentModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectAppsModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs similarity index 92% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectAppsModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs index 612467c68..0ce6b7eb6 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectAppsModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class ProjectAppsModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectDetailModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs similarity index 90% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectDetailModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs index b0095c6e5..50a80f1de 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectDetailModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class ProjectDetailModel : BaseModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs similarity index 91% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs index 7a084c692..49368da25 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class ProjectModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectTypeModel.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs similarity index 82% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectTypeModel.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs index 5fc2c8d9b..b8751e6b8 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Model/ProjectTypeModel.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Model; +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; public class ProjectTypeModel { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IAppService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs similarity index 82% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IAppService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs index 7e701914b..122c00bc2 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IAppService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Service; +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Service; public interface IAppService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IClusterService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IClusterService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs index 0ef028687..01bc8cbe1 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IClusterService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Service; +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Service; public interface IClusterService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IEnvironmentService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs similarity index 74% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IEnvironmentService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs index 1012be517..c6ed3a684 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IEnvironmentService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Service; +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Service; public interface IEnvironmentService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IProjectService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IProjectService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs index 3bcbcae28..464a7ca6b 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/Service/IProjectService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Pm.Service; +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Service; public interface IProjectService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/_Imports.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs similarity index 51% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/_Imports.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs index 38feeda8f..4b1a5eaaa 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Pm/_Imports.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Pm.Enum; -global using Masa.BuildingBlocks.BasicAbility.Pm.Model; -global using Masa.BuildingBlocks.BasicAbility.Pm.Service; +global using Masa.BuildingBlocks.StackSdks.Pm.Enum; +global using Masa.BuildingBlocks.StackSdks.Pm.Model; +global using Masa.BuildingBlocks.StackSdks.Pm.Service; global using System.ComponentModel; diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpMethods.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs similarity index 79% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpMethods.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs index 74ac7e427..7263de700 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpMethods.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; public enum HttpMethods { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpVerifyTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpVerifyTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs index ddcb4c6b8..c7213212b 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/HttpVerifyTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; public enum HttpVerifyTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/JobTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs similarity index 79% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/JobTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs index 3af93d261..e0a928ea7 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/JobTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; public enum JobTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/RunTimeoutStrategyTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs similarity index 79% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/RunTimeoutStrategyTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs index 56fdbedfe..8df0a446a 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/RunTimeoutStrategyTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; public enum RunTimeoutStrategyTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleBlockStrategyTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleBlockStrategyTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs index 9a2b88f05..d9bd4f523 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleBlockStrategyTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; public enum ScheduleBlockStrategyTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs index 455f19d3a..a406828e8 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; public enum ScheduleExpiredStrategyTypes { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerClient.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs similarity index 84% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerClient.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs index c8518b74d..744e46613 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerClient.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler; +namespace Masa.BuildingBlocks.StackSdks.Scheduler; public interface ISchedulerClient { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerJob.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs similarity index 85% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerJob.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs index 2aa73bb87..4e9bafa62 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/ISchedulerJob.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler; +namespace Masa.BuildingBlocks.StackSdks.Scheduler; public interface ISchedulerJob { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Masa.BuildingBlocks.BasicAbility.Tsc.csproj b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj similarity index 100% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Tsc/Masa.BuildingBlocks.BasicAbility.Tsc.csproj rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/JobContext.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs similarity index 88% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/JobContext.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs index 871f29bca..89d51ab50 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/JobContext.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the Apache License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Model; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; public class JobContext { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobAppConfig.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs similarity index 89% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobAppConfig.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs index e5a63cbc2..890aa16d8 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobAppConfig.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Model; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; public class SchedulerJobAppConfig { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs similarity index 87% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs index d50584dd5..ab5feef95 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Model; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; public class SchedulerJobDaprServiceInvocationConfig { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobHttpConfig.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs similarity index 91% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobHttpConfig.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs index 1b4577f17..bebb18f00 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Model/SchedulerJobHttpConfig.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Model; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; public class SchedulerJobHttpConfig { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/AddSchedulerJobRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs similarity index 95% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/AddSchedulerJobRequest.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs index dd9d9a0f9..1ba5c2afd 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/AddSchedulerJobRequest.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; public class AddSchedulerJobRequest { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerJobRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerJobRequest.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs index ae6e6140a..9a7997211 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerJobRequest.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; public class BaseSchedulerJobRequest { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerTaskRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs similarity index 81% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerTaskRequest.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs index aa9b5843f..16e1a1287 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/BaseSchedulerTaskRequest.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; public class BaseSchedulerTaskRequest { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/ChangeEnabledStatusRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/ChangeEnabledStatusRequest.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs index e0fa6c434..550257661 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/ChangeEnabledStatusRequest.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; public class ChangeEnabledStatusRequest : BaseSchedulerJobRequest { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/StartSchedulerTaskRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs similarity index 80% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/StartSchedulerTaskRequest.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs index 01a3bbfd4..9699187ab 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Request/StartSchedulerTaskRequest.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Request; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; public class StartSchedulerTaskRequest : BaseSchedulerTaskRequest { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerJobService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs similarity index 88% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerJobService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs index e174e1e39..fd7d7bc3f 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerJobService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Service; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Service; public interface ISchedulerJobService { diff --git a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerTaskService.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs similarity index 83% rename from src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerTaskService.cs rename to src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs index d0af3ab77..524d0b4da 100644 --- a/src/BuildingBlocks/src/BasicAbility/Masa.BuildingBlocks.BasicAbility.Scheduler/Service/ISchedulerTaskService.cs +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.BasicAbility.Scheduler.Service; +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Service; public interface ISchedulerTaskService { diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs new file mode 100644 index 000000000..54eafd273 --- /dev/null +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; +global using Masa.BuildingBlocks.StackSdks.Scheduler.Model; +global using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +global using Masa.BuildingBlocks.StackSdks.Scheduler.Service; diff --git a/src/Contrib/README.md b/src/Contrib/README.md index cd64f439a..2ca4fdd4c 100644 --- a/src/Contrib/README.md +++ b/src/Contrib/README.md @@ -56,11 +56,11 @@ The purpose of MASA.Contrib is based on [MASA.BuildingBlocks](https://github.com * Storage: cloud storage * [Aliyun Storage](./src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md) * Operational capacity - * [Auth](./src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md): Authentication and Authorization - * [Dcc](./src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md): Distributed Configuration Center - * [PM](./src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md): Project Management - * [Scheduler](./src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md): Distributed Scheduler - * [TSC](./src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md): Troubleshooting Console + * [Auth](./src/StackSdks/Masa.Contrib.StackSdks.Auth/README.md): Authentication and Authorization + * [Dcc](./src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md): Distributed Configuration Center + * [PM](./src/StackSdks/Masa.Contrib.StackSdks.Pm/README.md): Project Management + * [Scheduler](./src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md): Distributed Scheduler + * [TSC](./src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md): Troubleshooting Console diff --git a/src/Contrib/README.zh-CN.md b/src/Contrib/README.zh-CN.md index 5676458a7..a70304ddd 100644 --- a/src/Contrib/README.zh-CN.md +++ b/src/Contrib/README.zh-CN.md @@ -56,11 +56,11 @@ MASA.Contrib是基于[MASA.BuildingBlocks](https://github.com/masastack/MASA.Bui * Storage: 云存储 * [阿里云存储](./src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md) * 业务能力 - * [Auth](./src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md): 权限认证 - * [Dcc](./src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md): 分布式配置中心 - * [PM](./src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md): 项目管理 - * [Scheduler](./src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md): 分布式调度中心 - * [TSC](./src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md): 故障排除平台 + * [Auth](./src/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md): 权限认证 + * [Dcc](./src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md): 分布式配置中心 + * [PM](./src/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md): 项目管理 + * [Scheduler](./src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md): 分布式调度中心 + * [TSC](./src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md): 故障排除平台 ## 如何克隆 diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/_Imports.cs b/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/_Imports.cs deleted file mode 100644 index 26abf4b07..000000000 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.BasicAbility.Dcc; -global using Masa.BuildingBlocks.BasicAbility.Dcc.Model; -global using Masa.BuildingBlocks.BasicAbility.Dcc.Service; -global using Masa.Contrib.BasicAbility.Dcc.Service; -global using Masa.Utils.Caching.Core.Interfaces; -global using Masa.Utils.Caching.Redis.Models; -global using Masa.Utils.Configuration.Json; -global using Microsoft.Extensions.DependencyInjection; -global using static Masa.Contrib.BasicAbility.Dcc.Internal.Constants; diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.md b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.md index 957dc208b..804ce4cba 100644 --- a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.md +++ b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.md @@ -19,7 +19,7 @@ Example: ```C# Install-Package Masa.Contrib.Configuration -Install-Package Masa.Contrib.BasicAbility.Dcc //DCC can provide remote configuration capabilities +Install-Package Masa.Contrib.StackSdks.Dcc //DCC can provide remote configuration capabilities ​```json { //Custom configuration diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md index 5dd54a18b..84b722cd6 100644 --- a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md +++ b/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md @@ -19,7 +19,7 @@ IConfiguration ```C# Install-Package Masa.Contrib.Configuration -Install-Package Masa.Contrib.BasicAbility.Dcc //DCC可提供远程配置的能力 +Install-Package Masa.Contrib.StackSdks.Dcc //DCC可提供远程配置的能力 ``` appsettings.json diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/AuthClient.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/AuthClient.cs similarity index 91% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/AuthClient.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/AuthClient.cs index 8ac52793f..8e068c579 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/AuthClient.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/AuthClient.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth; +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth; public class AuthClient : IAuthClient { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Constants.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Constants.cs similarity index 88% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Constants.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Constants.cs index 43bb0f175..6ccb1b334 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Constants.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Constants.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth; +namespace Masa.Contrib.StackSdks.Auth; internal class Constants { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/EnvironmentProvider.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs similarity index 93% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/EnvironmentProvider.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs index 794133c33..16bcddfe1 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/EnvironmentProvider.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth; +namespace Masa.Contrib.StackSdks.Auth; public class EnvironmentProvider : IEnvironmentProvider { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/HttpEnvironmentDelegatingHandler.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs similarity index 96% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/HttpEnvironmentDelegatingHandler.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs index bca846c8e..f3a585544 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/HttpEnvironmentDelegatingHandler.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth; +namespace Masa.Contrib.StackSdks.Auth; public class HttpEnvironmentDelegatingHandler : DelegatingHandler { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj similarity index 86% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj index abc121653..10a53527f 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Masa.Contrib.BasicAbility.Auth.csproj +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.md similarity index 73% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.md index 5e18d7f30..1002e93ed 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.md @@ -1,6 +1,6 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.BasicAbility.Auth +## Masa.Contrib.StackSdks.Auth Injecting IAuthClient interface,cal the service to obtain the capabilities provided by the auth SDK. SDK need to get current user ID dependency Masa.Contrib.Identity.IdentityModel(../../Identity/Masa.Contrib.Identity.IdentityModel/README.zh,Therefore,the identitymodel service needs to be added before use. @@ -9,11 +9,11 @@ SDK need to get current user ID dependency Masa.Contrib.Identity.IdentityModel(. ```c# IAuthClient -├── UserService -├── SubjectService -├── TeamService -├── PermissionService -└── ProjectService +├── UserService +├── SubjectService +├── TeamService +├── PermissionService +└── ProjectService ``` ### Use Introduction @@ -21,7 +21,7 @@ IAuthClient #### Install dependent package ```C# -Install-Package Masa.Contrib.BasicAbility.Auth +Install-Package Masa.Contrib.StackSdks.Auth ``` #### Register auth service diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md similarity index 92% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md index db93895e3..c96527330 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/README.zh-CN.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md @@ -1,6 +1,6 @@ 中 | [EN](README.md) -## Masa.Contrib.BasicAbility.Auth +## Masa.Contrib.StackSdks.Auth 通过注入IAuthClient接口,调用对应Service获取Auth SDK 提供的能力。 SDK获取当前用户ID依赖Masa.Contrib.Identity.IdentityModel(../../Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.zh,所以使用前需添加IdentityModel服务。 @@ -20,7 +20,7 @@ IAuthClient #### 安装依赖包 ```C# -Install-Package Masa.Contrib.BasicAbility.Auth +Install-Package Masa.Contrib.StackSdks.Auth ``` #### 注册相关服务 diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/PermissionService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs similarity index 97% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/PermissionService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs index 3799b1ea3..d842e5337 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/PermissionService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Service; +namespace Masa.Contrib.StackSdks.Auth.Service; public class PermissionService : IPermissionService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/ProjectService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs similarity index 94% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/ProjectService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs index 396dd423e..56ad9f017 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/ProjectService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Service; +namespace Masa.Contrib.StackSdks.Auth.Service; public class ProjectService : IProjectService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/SubjectService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs similarity index 91% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/SubjectService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs index 8ed57be5e..951b1d275 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/SubjectService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Service; +namespace Masa.Contrib.StackSdks.Auth.Service; public class SubjectService : ISubjectService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/TeamService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs similarity index 96% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/TeamService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs index 2cef018f3..0be09d4ef 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/TeamService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Service; +namespace Masa.Contrib.StackSdks.Auth.Service; public class TeamService : ITeamService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/UserService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs similarity index 99% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/UserService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs index d347b0ffb..04f804f52 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/Service/UserService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Service; +namespace Masa.Contrib.StackSdks.Auth.Service; public class UserService : IUserService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/ServiceCollectionExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/ServiceCollectionExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/_Imports.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs similarity index 58% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/_Imports.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs index 54a7e4cf0..20f702dd3 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Auth/_Imports.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs @@ -1,16 +1,15 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Auth; -global using Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; -global using Masa.BuildingBlocks.BasicAbility.Auth.Service; +global using Masa.BuildingBlocks.StackSdks.Auth; +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; +global using Masa.BuildingBlocks.StackSdks.Auth.Service; global using Masa.BuildingBlocks.Identity.IdentityModel; global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.BasicAbility.Auth; -global using Masa.Contrib.BasicAbility.Auth.Service; global using Masa.Contrib.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Contrib.StackSdks.Auth; global using Microsoft.AspNetCore.Http; global using System.Text.Json; -global using static Masa.Contrib.BasicAbility.Auth.Constants; +global using static Masa.Contrib.StackSdks.Auth.Constants; diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/DccClient.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/DccClient.cs similarity index 82% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/DccClient.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/DccClient.cs index fc7f49a17..51cb140f6 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/DccClient.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/DccClient.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Dcc; +using Masa.Contrib.StackSdks.Dcc.Service; + +namespace Masa.Contrib.StackSdks.Dcc; public class DccClient : IDccClient { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Internal/Constants.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs similarity index 84% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Internal/Constants.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs index 64cf2d051..34bd828b5 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Internal/Constants.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Dcc.Internal +namespace Masa.Contrib.StackSdks.Dcc.Internal { internal class Constants { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj similarity index 78% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj index e87b3a220..869ee3b80 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Masa.Contrib.BasicAbility.Dcc.csproj +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md similarity index 91% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md index afbea9727..7761d2106 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md @@ -1,6 +1,6 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.BasicAbility.Dcc +## Masa.Contrib.StackSdks.Dcc Effect: @@ -14,7 +14,7 @@ IDccClient Example: ```C# -Install-Package Masa.Contrib.BasicAbility.Dcc +Install-Package Masa.Contrib.StackSdks.Dcc ``` appsettings.json diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md similarity index 91% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md index aa1b281f3..aa18c6961 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/README.zh-CN.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md @@ -1,6 +1,6 @@ 中 | [EN](README.md) -## Masa.Contrib.BasicAbility.Dcc +## Masa.Contrib.StackSdks.Dcc 作用: @@ -14,7 +14,7 @@ IDccClient 用例: ```C# -Install-Package Masa.Contrib.BasicAbility.Dcc +Install-Package Masa.Contrib.StackSdks.Dcc ``` appsettings.json diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Service/LabelService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs similarity index 92% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Service/LabelService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs index 7a110729c..2027a94d8 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/Service/LabelService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Dcc.Service; +namespace Masa.Contrib.StackSdks.Dcc.Service; public class LabelService : ILabelService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/ServiceCollectionExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs similarity index 96% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/ServiceCollectionExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs index 1f9ca25ba..ed7d4fddf 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Dcc/ServiceCollectionExtensions.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Dcc; +namespace Microsoft.Extensions.DependencyInjection; public static class ServiceCollectionExtensions { diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs new file mode 100644 index 000000000..d6da4100d --- /dev/null +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Dcc; +global using Masa.BuildingBlocks.StackSdks.Dcc.Model; +global using Masa.BuildingBlocks.StackSdks.Dcc.Service; +global using Masa.Contrib.StackSdks.Dcc; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Redis.Models; +global using Masa.Utils.Configuration.Json; +global using static Masa.Contrib.StackSdks.Dcc.Internal.Constants; diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Constants.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Constants.cs similarity index 86% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Constants.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Constants.cs index 150f4581d..303977772 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Constants.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Constants.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc; +namespace Masa.Contrib.StackSdks.Mc; internal class Constants { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs similarity index 95% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/HttpClientAuthorizationDelegatingHandler.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs index 0f567cc95..c332463de 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/HttpClientAuthorizationDelegatingHandler.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc; +namespace Masa.Contrib.StackSdks.Mc; public class HttpClientAuthorizationDelegatingHandler : DelegatingHandler { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/DictionaryExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs similarity index 98% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/DictionaryExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs index 07faf46c8..189f232c5 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/DictionaryExtensions.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace System.Collections.Concurrent; +namespace Masa.Contrib.StackSdks.Mc.Infrastructure.Extensions; /// /// Extension methods for Dictionary. diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs similarity index 97% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs index 85bade60a..0af3e10dd 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace System.Collections.Concurrent; +namespace Masa.Contrib.StackSdks.Mc.Infrastructure.Extensions; public static class ExtraPropertiesExtensions { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Helper/TypeHelper.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs similarity index 98% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Helper/TypeHelper.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs index e75189fea..9c62f2d6e 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Infrastructure/Helper/TypeHelper.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Infrastructure.Helper; +namespace Masa.Contrib.StackSdks.Mc.Infrastructure.Helper; public static class TypeHelper { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj similarity index 75% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj index 683f3e221..78a55f2c9 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Masa.Contrib.BasicAbility.Mc.csproj +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/McClient.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/McClient.cs similarity index 91% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/McClient.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/McClient.cs index 2d36b136b..fc89ba5c5 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/McClient.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/McClient.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc; +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc; public class McClient: IMcClient { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ChannelService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs similarity index 94% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ChannelService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs index 8ef58d3d0..b4698a133 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ChannelService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Service; +namespace Masa.Contrib.StackSdks.Mc.Service; public class ChannelService : IChannelService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTaskService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs similarity index 95% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTaskService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs index 0ec4753d4..d467c7041 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTaskService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Service; +namespace Masa.Contrib.StackSdks.Mc.Service; public class MessageTaskService : IMessageTaskService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTemplateService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs similarity index 94% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTemplateService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs index 7d86b70d2..514e10c31 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/MessageTemplateService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Service; +namespace Masa.Contrib.StackSdks.Mc.Service; public class MessageTemplateService : IMessageTemplateService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ReceiverGroupService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs similarity index 94% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ReceiverGroupService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs index ec6a8c23e..500b1b8b2 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/ReceiverGroupService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Service; +namespace Masa.Contrib.StackSdks.Mc.Service; public class ReceiverGroupService : IReceiverGroupService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/WebsiteMessageService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs similarity index 97% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/WebsiteMessageService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs index 704cff7e0..50d900667 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/Service/WebsiteMessageService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs @@ -1,4 +1,4 @@ -namespace Masa.Contrib.BasicAbility.Mc.Service; +namespace Masa.Contrib.StackSdks.Mc.Service; public class WebsiteMessageService : IWebsiteMessageService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/ServiceCollectionExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/ServiceCollectionExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/_Imports.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs similarity index 60% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/_Imports.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs index c0ad44a6c..5d3a074ce 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Mc/_Imports.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs @@ -1,20 +1,20 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Mc; -global using Masa.BuildingBlocks.BasicAbility.Mc.Model; -global using Masa.BuildingBlocks.BasicAbility.Mc.Service; +global using Masa.BuildingBlocks.StackSdks.Mc; +global using Masa.BuildingBlocks.StackSdks.Mc.Model; +global using Masa.BuildingBlocks.StackSdks.Mc.Service; global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.BasicAbility.Mc; -global using Masa.Contrib.BasicAbility.Mc.Infrastructure.Helper; -global using Masa.Contrib.BasicAbility.Mc.Service; global using Masa.Contrib.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Contrib.StackSdks.Mc; +global using Masa.Contrib.StackSdks.Mc.Infrastructure.Helper; global using Microsoft.AspNetCore.Authentication; global using Microsoft.AspNetCore.Http; +global using System.Collections.Concurrent; global using System.ComponentModel; global using System.Diagnostics.CodeAnalysis; global using System.Globalization; global using System.Reflection; -global using static Masa.Contrib.BasicAbility.Mc.Constants; +global using static Masa.Contrib.StackSdks.Mc.Constants; diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Constants.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Constants.cs similarity index 86% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Constants.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Constants.cs index 5b0725e49..38ebfe1e9 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Constants.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Constants.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm; +namespace Masa.Contrib.StackSdks.Pm; public class Constants { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj similarity index 84% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj index dd59469b9..88d00062a 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Masa.Contrib.BasicAbility.Pm.csproj +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/PmClient.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/PmClient.cs similarity index 80% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/PmClient.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/PmClient.cs index 845a3a0e2..2c90caf79 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/PmClient.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/PmClient.cs @@ -1,7 +1,11 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm; +using Masa.BuildingBlocks.StackSdks.Pm; +using Masa.BuildingBlocks.StackSdks.Pm.Service; +using Masa.Contrib.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm; public class PmClient : IPmClient { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.md similarity index 89% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.md index 50f7f81ac..65f5356d1 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.md @@ -1,6 +1,6 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.BasicAbility.Pm +## Masa.Contrib.StackSdks.Pm Effect: @@ -17,7 +17,7 @@ IPmClient Example: ```C# -Install-Package Masa.Contrib.BasicAbility.Pm +Install-Package Masa.Contrib.StackSdks.Pm ``` ```C# diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md similarity index 89% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md index 39704a0db..d0d654591 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/README.zh-CN.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md @@ -1,6 +1,6 @@ 中 | [EN](README.md) -## Masa.Contrib.BasicAbility.Pm +## Masa.Contrib.StackSdks.Pm 作用: @@ -17,7 +17,7 @@ IPmClient 用例: ```C# -Install-Package Masa.Contrib.BasicAbility.Pm +Install-Package Masa.Contrib.StackSdks.Pm ``` ```C# diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/AppService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/AppService.cs similarity index 91% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/AppService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/AppService.cs index 40a3c6e24..43bbd29ac 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/AppService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/AppService.cs @@ -1,7 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm.Service; +using Masa.BuildingBlocks.StackSdks.Pm.Model; +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm.Service; public class AppService : IAppService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ClusterService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs similarity index 90% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ClusterService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs index 9d03a3fd6..0f967212d 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ClusterService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs @@ -1,7 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm.Service; +using Masa.BuildingBlocks.StackSdks.Pm.Model; +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm.Service; public class ClusterService : IClusterService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/EnvironmentService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs similarity index 84% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/EnvironmentService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs index 3776c92a0..c84048516 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/EnvironmentService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs @@ -1,7 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm.Service; +using Masa.BuildingBlocks.StackSdks.Pm.Model; +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm.Service; public class EnvironmentService : IEnvironmentService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ProjectService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs similarity index 93% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ProjectService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs index 1f603f936..32602236d 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/Service/ProjectService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs @@ -1,7 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm.Service; +using Masa.BuildingBlocks.StackSdks.Pm.Model; +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm.Service; public class ProjectService : IProjectService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/ServiceCollectionExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs similarity index 97% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/ServiceCollectionExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs index a3b037996..c516b59e2 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/ServiceCollectionExtensions.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs @@ -1,6 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Masa.BuildingBlocks.StackSdks.Pm; + namespace Microsoft.Extensions.DependencyInjection; public static class ServiceCollectionExtensions diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/_Imports.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/_Imports.cs similarity index 52% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/_Imports.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/_Imports.cs index c8397c3a4..65e519dcd 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Pm/_Imports.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/_Imports.cs @@ -1,13 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Pm; -global using Masa.BuildingBlocks.BasicAbility.Pm.Model; -global using Masa.BuildingBlocks.BasicAbility.Pm.Service; global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.BasicAbility.Pm; -global using Masa.Contrib.BasicAbility.Pm.Service; global using Masa.Contrib.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; -global using static Masa.Contrib.BasicAbility.Pm.Constants; +global using Masa.Contrib.StackSdks.Pm; +global using static Masa.Contrib.StackSdks.Pm.Constants; diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Constants.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Constants.cs similarity index 87% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Constants.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Constants.cs index de50d9580..f1cca0b64 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Constants.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Constants.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Scheduler; +namespace Masa.Contrib.StackSdks.Scheduler; internal class Constants { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs similarity index 95% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/HttpClientAuthorizationDelegatingHandler.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs index 0eccbd702..07ca11efa 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/HttpClientAuthorizationDelegatingHandler.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Scheduler; +namespace Masa.Contrib.StackSdks.Scheduler; public class HttpClientAuthorizationDelegatingHandler : DelegatingHandler { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj similarity index 81% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj index f8e74bad6..bc1aaed01 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Masa.Contrib.BasicAbility.Scheduler.csproj +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md similarity index 89% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md index 421eec9d7..b89680e04 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md @@ -1,6 +1,6 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.BasicAbility.Scheduler +## Masa.Contrib.StackSdks.Scheduler Effect: @@ -15,7 +15,7 @@ ISchedulerClient Example: ```C# -Install-Package Masa.Contrib.BasicAbility.Scheduler +Install-Package Masa.Contrib.StackSdks.Scheduler ``` ```C# diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md similarity index 89% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md index eebecf034..85cff55be 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/README.zh-CN.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md @@ -1,6 +1,6 @@ 中 | [EN](README.md) -## Masa.Contrib.BasicAbility.Scheduler +## Masa.Contrib.StackSdks.Scheduler 作用: @@ -15,7 +15,7 @@ ISchedulerClient 用例: ```C# -Install-Package Masa.Contrib.BasicAbility.Scheduler +Install-Package Masa.Contrib.StackSdks.Scheduler ``` ```C# diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/SchedulerClient.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs similarity index 79% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/SchedulerClient.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs index f67b49b42..4d0da0a96 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/SchedulerClient.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs @@ -1,7 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Scheduler; +using Masa.BuildingBlocks.StackSdks.Scheduler; +using Masa.BuildingBlocks.StackSdks.Scheduler.Service; + +namespace Masa.Contrib.StackSdks.Scheduler; public class SchedulerClient : ISchedulerClient { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/ServiceCollectionExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs similarity index 97% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/ServiceCollectionExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs index a624dafbc..0f295327b 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/ServiceCollectionExtensions.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs @@ -1,6 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Masa.BuildingBlocks.StackSdks.Scheduler; + namespace Microsoft.Extensions.DependencyInjection; public static class ServiceCollectionExtensions diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerJobService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs similarity index 91% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerJobService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs index cd777eb44..d6f9953e8 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerJobService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs @@ -1,7 +1,11 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Scheduler.Services; +using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; +using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +using Masa.BuildingBlocks.StackSdks.Scheduler.Service; + +namespace Masa.Contrib.StackSdks.Scheduler.Services; public class SchedulerJobService : ISchedulerJobService { @@ -25,13 +29,13 @@ public async Task AddAsync(AddSchedulerJobRequest request) switch (request.JobType) { - case BuildingBlocks.BasicAbility.Scheduler.Enum.JobTypes.JobApp: + case JobTypes.JobApp: ArgumentNullException.ThrowIfNull(request.JobAppConfig, nameof(request.JobAppConfig)); break; - case BuildingBlocks.BasicAbility.Scheduler.Enum.JobTypes.Http: + case JobTypes.Http: ArgumentNullException.ThrowIfNull(request.HttpConfig, nameof(request.HttpConfig)); break; - case BuildingBlocks.BasicAbility.Scheduler.Enum.JobTypes.DaprServiceInvocation: + case JobTypes.DaprServiceInvocation: ArgumentNullException.ThrowIfNull(request.DaprServiceInvocationConfig, nameof(request.DaprServiceInvocationConfig)); break; } diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerTaskService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs similarity index 90% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerTaskService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs index 646bef817..e7db74b1d 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/Services/SchedulerTaskService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs @@ -1,7 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Scheduler.Services; +using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +using Masa.BuildingBlocks.StackSdks.Scheduler.Service; + +namespace Masa.Contrib.StackSdks.Scheduler.Services; public class SchedulerTaskService : ISchedulerTaskService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/_Imports.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs similarity index 56% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/_Imports.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs index 9dddd3d09..57d942dd5 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Scheduler/_Imports.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs @@ -1,16 +1,13 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Scheduler; -global using Masa.BuildingBlocks.BasicAbility.Scheduler.Request; -global using Masa.BuildingBlocks.BasicAbility.Scheduler.Service; global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.BasicAbility.Scheduler; -global using Masa.Contrib.BasicAbility.Scheduler.Services; +global using Masa.Contrib.StackSdks.Scheduler; +global using Masa.Contrib.StackSdks.Scheduler.Services; global using Masa.Contrib.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; global using Microsoft.AspNetCore.Authentication; global using Microsoft.AspNetCore.Http; global using Microsoft.Extensions.Logging; -global using static Masa.Contrib.BasicAbility.Scheduler.Constants; +global using static Masa.Contrib.StackSdks.Scheduler.Constants; diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/CallerProviderExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs similarity index 90% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/CallerProviderExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs index 50c9d1063..9175c268c 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/CallerProviderExtensions.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -[assembly: InternalsVisibleTo("Masa.Contrib.BasicAbility.Tsc.Tests")] +[assembly: InternalsVisibleTo("Masa.Contrib.StackSdks.Tsc.Tests")] namespace Masa.Contrib.Service.Caller; internal static class CallerProviderExtensions diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/ServiceExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs similarity index 90% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/ServiceExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs index 163b295c0..978cfe506 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/ServiceExtensions.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs @@ -1,8 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -[assembly: InternalsVisibleTo("Masa.Contrib.BasicAbility.Tsc.Tests")] -namespace Masa.Contrib.BasicAbility.Tsc; +[assembly: InternalsVisibleTo("Masa.Contrib.StackSdks.Tsc.Tests")] +namespace Microsoft.Extensions.DependencyInjection; public static class ServiceExtensions { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/StreamExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Extensions/StreamExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Logging/OpenTelemetryLoggingExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Logging/OpenTelemetryLoggingExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj similarity index 91% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj index d7b4ca258..0d6a90a42 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Masa.Contrib.BasicAbility.Tsc.csproj +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj @@ -20,7 +20,7 @@ - + diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/MasaObservableOptions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs similarity index 91% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/MasaObservableOptions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs index 0e4a79636..b97e729c6 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/MasaObservableOptions.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the Apache License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Tsc; +namespace Masa.Contrib.StackSdks.Tsc; public class MasaObservableOptions { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Metrics/MasaServiceExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Metrics/MasaServiceExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTelemetryAttributeName.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs similarity index 99% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTelemetryAttributeName.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs index 579040201..0958eca3c 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTelemetryAttributeName.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the Apache License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Tsc; +namespace Masa.Contrib.StackSdks.Tsc; /// /// Constants for semantic attribute names outlined by the OpenTelemetry specifications. diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md similarity index 94% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md index 6fe3299bc..ec4fb286a 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md @@ -1,6 +1,6 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.BasicAbility.Tsc +## Masa.Contrib.StackSdks.Tsc effect: @@ -10,7 +10,7 @@ Example: ```C# -Install-Package Masa.Contrib.BasicAbility.Tsc +Install-Package Masa.Contrib.StackSdks.Tsc ``` how to use: diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md similarity index 93% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md index 1bda3131c..76f1c5a14 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/README.zh-CN.md +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md @@ -1,6 +1,6 @@ 中 | [EN](README.md) -## Masa.Contrib.BasicAbility.Tsc +## Masa.Contrib.StackSdks.Tsc 作用: @@ -10,7 +10,7 @@ 用例: ```C# -Install-Package Masa.Contrib.BasicAbility.Tsc +Install-Package Masa.Contrib.StackSdks.Tsc ``` 如何使用: diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/LogService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs similarity index 95% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/LogService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs index 897e9d9dd..b8b9473ef 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/LogService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Tsc.Service; +namespace Masa.Contrib.StackSdks.Tsc.Service; public class LogService : ILogService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/MetricService.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs similarity index 97% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/MetricService.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs index e0313a0c1..85aff1e37 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Service/MetricService.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Tsc.Service; +namespace Masa.Contrib.StackSdks.Tsc.Service; internal class MetricService : IMetricService { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/ActivityExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/ActivityExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/MasaServiceExtensions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/MasaServiceExtensions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs similarity index 100% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/TscClient.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/TscClient.cs similarity index 74% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/TscClient.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/TscClient.cs index 67e2a052f..24ad7afae 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/TscClient.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/TscClient.cs @@ -1,8 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -[assembly: InternalsVisibleTo("Masa.Contrib.BasicAbility.Tsc.Tests")] -namespace Masa.Contrib.BasicAbility.Tsc; +using Masa.Contrib.StackSdks.Tsc.Service; + +[assembly: InternalsVisibleTo("Masa.Contrib.StackSdks.Tsc.Tests")] +namespace Masa.Contrib.StackSdks.Tsc; internal class TscClient : ITscClient { diff --git a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/_Imports.cs b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs similarity index 79% rename from src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/_Imports.cs rename to src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs index 47fc6c8c6..c98d95f23 100644 --- a/src/Contrib/src/BasicAbility/Masa.Contrib.BasicAbility.Tsc/_Imports.cs +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs @@ -1,12 +1,11 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Tsc; -global using Masa.BuildingBlocks.BasicAbility.Tsc.Model; -global using Masa.BuildingBlocks.BasicAbility.Tsc.Service; +global using Masa.BuildingBlocks.StackSdks.Tsc; +global using Masa.BuildingBlocks.StackSdks.Tsc.Model; +global using Masa.BuildingBlocks.StackSdks.Tsc.Service; global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.BasicAbility.Tsc; -global using Masa.Contrib.BasicAbility.Tsc.Service; +global using Masa.Contrib.StackSdks.Tsc; global using Masa.Contrib.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; global using Microsoft.AspNetCore.Http; diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/AuthClientTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs similarity index 96% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/AuthClientTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs index 52ec9fa95..2b27fb6b0 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/AuthClientTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Tests; +namespace Masa.Contrib.StackSdks.Auth.Tests; [TestClass] public class AuthClientTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj similarity index 78% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj index 7bd572c9a..8c996881e 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/Masa.Contrib.BasicAbility.Auth.Tests.csproj +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj @@ -19,8 +19,8 @@ - - + + diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/PermissionServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs similarity index 98% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/PermissionServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs index 7481c8c59..fcc459f0c 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/PermissionServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Tests; +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; [TestClass] public class PermissionServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/ProjectServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs similarity index 93% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/ProjectServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs index 54ad837a8..ef19e7308 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/ProjectServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Tests; +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; [TestClass] public class ProjectServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/SubjectServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs similarity index 91% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/SubjectServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs index c349f6cae..c510438ec 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/SubjectServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Tests; +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; [TestClass] public class SubjectServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/TeamServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs similarity index 96% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/TeamServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs index 92a6b8c1e..f5c8561f0 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/TeamServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Tests; +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; [TestClass] public class TeamServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/UserServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs similarity index 99% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/UserServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs index 494305b7c..718c24c7d 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/UserServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Auth.Tests; +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; [TestClass] public class UserServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/_Imports.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs similarity index 63% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/_Imports.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs index 336ffec61..76252fde4 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Auth.Tests/_Imports.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs @@ -1,12 +1,11 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Auth; -global using Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Enum; -global using Masa.BuildingBlocks.BasicAbility.Auth.Contracts.Model; +global using Masa.BuildingBlocks.StackSdks.Auth; +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; global using Masa.BuildingBlocks.Identity.IdentityModel; global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.BasicAbility.Auth.Service; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; global using Moq; diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/DccClientTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs similarity index 96% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/DccClientTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs index 9c0137731..fe85d35f9 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/DccClientTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Dcc.Tests; +namespace Masa.Contrib.StackSdks.Dcc.Tests; [TestClass] public class DccClientTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/LabelServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs similarity index 97% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/LabelServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs index d3d8bd3f4..be35f83e3 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/LabelServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Dcc.Tests; +namespace Masa.Contrib.StackSdks.Dcc.Tests; [TestClass] public class LabelServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj similarity index 79% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj index a89d78099..f53aaba79 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests.csproj +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj @@ -4,7 +4,6 @@ net6.0 enable enable - false @@ -30,8 +29,8 @@ - - + + diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/_Imports.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs similarity index 79% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/_Imports.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs index f19509048..1bd727faa 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/_Imports.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs @@ -1,8 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Dcc; -global using Masa.BuildingBlocks.BasicAbility.Dcc.Model; +global using Masa.BuildingBlocks.StackSdks.Dcc; +global using Masa.BuildingBlocks.StackSdks.Dcc.Model; global using Masa.Utils.Caching.Core.Interfaces; global using Masa.Utils.Caching.Redis.Models; global using Masa.Utils.Configuration.Json; diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/appsettings.json b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json similarity index 100% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Dcc.Tests/Masa.Contrib.BasicAbility.Dcc.Tests/appsettings.json rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ChannelServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs similarity index 94% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ChannelServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs index f207e8df2..f3770e583 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ChannelServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Tests; +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; [TestClass] public class ChannelServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj similarity index 73% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj index 8012c84a7..04af889ac 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/Masa.Contrib.BasicAbility.Mc.Tests.csproj +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj @@ -3,7 +3,6 @@ net6.0 enable - false @@ -15,8 +14,8 @@ - - + + diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/McClientTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs similarity index 95% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/McClientTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs index 6ab73c254..7add33b0f 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/McClientTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Tests; +namespace Masa.Contrib.StackSdks.Mc.Tests; [TestClass] public class McClientTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTaskServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs similarity index 96% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTaskServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs index a2065da62..3b10fcf88 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTaskServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Tests; +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; [TestClass] public class MessageTaskServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTemplateServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs similarity index 95% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTemplateServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs index 24a4912ba..bf36d9c4f 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/MessageTemplateServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Tests; +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; [TestClass] public class MessageTemplateServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ReceiverGroupServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs similarity index 95% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ReceiverGroupServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs index de41dafdc..d4837f198 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/ReceiverGroupServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Tests; +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; [TestClass] public class ReceiverGroupServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/WebsiteMessageServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs similarity index 98% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/WebsiteMessageServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs index 6db943d29..3b46137aa 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/WebsiteMessageServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Mc.Tests; +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; [TestClass] public class WebsiteMessageServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/_Imports.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs similarity index 73% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/_Imports.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs index 4e8fbcf04..d8723b800 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Mc.Tests/_Imports.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs @@ -1,10 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Mc; -global using Masa.BuildingBlocks.BasicAbility.Mc.Model; +global using Masa.BuildingBlocks.StackSdks.Mc; +global using Masa.BuildingBlocks.StackSdks.Mc.Model; global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.BasicAbility.Mc.Service; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; global using Moq; diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/AppServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs similarity index 98% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/AppServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs index 6ef7f6baf..a362f262c 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/AppServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm.Tests; +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.Contrib.StackSdks.Pm.Tests; [TestClass] public class AppServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ClusterServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs similarity index 98% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ClusterServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs index f69ec23df..b25ef71d7 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ClusterServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm.Tests; +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.Contrib.StackSdks.Pm.Tests; [TestClass] public class ClusterServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/EnvironmentServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs similarity index 96% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/EnvironmentServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs index f56084506..dbfb3af8f 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/EnvironmentServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm.Tests; +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.Contrib.StackSdks.Pm.Tests; [TestClass] public class EnvironmentServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj similarity index 79% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj index ca6a141da..b2e37dc84 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/Masa.Contrib.BasicAbility.Pm.Tests.csproj +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj @@ -3,7 +3,6 @@ net6.0 enable - false @@ -18,8 +17,8 @@ - - + + diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/PmClientTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs similarity index 96% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/PmClientTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs index 735333cb5..91340da45 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/PmClientTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm.Tests; +using Masa.BuildingBlocks.StackSdks.Pm; + +namespace Masa.Contrib.StackSdks.Pm.Tests; [TestClass] public class PmClientTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ProjectServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs similarity index 98% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ProjectServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs index 2982e4786..704b28e30 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/ProjectServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Pm.Tests; +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.Contrib.StackSdks.Pm.Tests; [TestClass] public class ProjectServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/_Imports.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs similarity index 81% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/_Imports.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs index 8b19b361e..5e7752b4e 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Pm.Tests/_Imports.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs @@ -1,8 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Pm; -global using Masa.BuildingBlocks.BasicAbility.Pm.Model; global using Masa.BuildingBlocks.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj similarity index 72% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj index 8195f8453..61afc9440 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/Masa.Contrib.BasicAbility.Scheduler.Tests.csproj +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj @@ -3,7 +3,6 @@ net6.0 enable - false @@ -18,8 +17,9 @@ - - + + + diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerClientTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs similarity index 94% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerClientTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs index 46959a645..8bf68e47e 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerClientTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Scheduler.Tests; +using Masa.BuildingBlocks.StackSdks.Scheduler; + +namespace Masa.Contrib.StackSdks.Scheduler.Tests; [TestClass] public class SchedulerClientTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerJobServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs similarity index 98% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerJobServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs index ac2c87c62..b13e932b5 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerJobServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs @@ -1,7 +1,12 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Scheduler.Tests; +using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; +using Masa.BuildingBlocks.StackSdks.Scheduler.Model; +using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +using Masa.Contrib.StackSdks.Scheduler; + +namespace Masa.Contrib.StackSdks.Scheduler.Tests; [TestClass] public class SchedulerJobServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerTaskServiceTest.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs similarity index 92% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerTaskServiceTest.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs index 558b6ba14..3a640a9cc 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/SchedulerTaskServiceTest.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs @@ -1,7 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Scheduler.Tests; +using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +using Masa.Contrib.StackSdks.Scheduler; + +namespace Masa.Contrib.StackSdks.Scheduler.Tests; [TestClass] public class SchedulerTaskServiceTest diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/_Imports.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs similarity index 67% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/_Imports.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs index 9819249f7..1e55edbd1 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Scheduler.Tests/_Imports.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs @@ -1,10 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Scheduler; -global using Masa.BuildingBlocks.BasicAbility.Scheduler.Enum; -global using Masa.BuildingBlocks.BasicAbility.Scheduler.Model; -global using Masa.BuildingBlocks.BasicAbility.Scheduler.Request; global using Masa.BuildingBlocks.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs similarity index 92% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs index a84ee144e..69d64d3c6 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Tsc.Tests.Extensions; +namespace Masa.Contrib.StackSdks.Tsc.Tests.Extensions; [TestClass] public class CallerProviderExtensionsTests diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj similarity index 70% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj index 213b0d84b..23280069c 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Masa.Contrib.BasicAbility.Tsc.Tests.csproj +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj @@ -3,7 +3,6 @@ net6.0 enable - false @@ -16,8 +15,8 @@ - - + + diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/LogServiceTests.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs similarity index 96% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/LogServiceTests.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs index 7f4ebd859..db1f238fd 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/LogServiceTests.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs @@ -1,7 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Tsc.Tests; +using Masa.Contrib.StackSdks.Tsc; +using Masa.Contrib.StackSdks.Tsc.Service; + +namespace Masa.Contrib.StackSdks.Tsc.Tests.Service; [TestClass] public class LogServiceTests diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/MetricServiceTests.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs similarity index 96% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/MetricServiceTests.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs index 1b49815d4..ad339c2bf 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/Service/MetricServiceTests.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs @@ -1,7 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.BasicAbility.Tsc.Tests.Service; +using Masa.Contrib.StackSdks.Tsc; +using Masa.Contrib.StackSdks.Tsc.Service; + +namespace Masa.Contrib.StackSdks.Tsc.Tests.Service; [TestClass] public class MetricServiceTests diff --git a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/_Imports.cs b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs similarity index 77% rename from src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/_Imports.cs rename to src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs index ca1068508..fc66f44d2 100644 --- a/src/Contrib/test/BasicAbility/Masa.Contrib.BasicAbility.Tsc.Test/_Imports.cs +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs @@ -1,10 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.BasicAbility.Tsc.Enums; -global using Masa.BuildingBlocks.BasicAbility.Tsc.Model; +global using Masa.BuildingBlocks.StackSdks.Tsc.Enums; +global using Masa.BuildingBlocks.StackSdks.Tsc.Model; global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.BasicAbility.Tsc.Service; global using Masa.Contrib.Service.Caller; global using Microsoft.VisualStudio.TestTools.UnitTesting; global using Moq; From ac4a7a743fce12a1583a3aab8b39c0921ffd168a Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Mon, 1 Aug 2022 16:31:32 +0800 Subject: [PATCH 03/29] chore: using global version --- .../Masa.Contrib.StackSdks.Mc.Tests.csproj | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj index 04af889ac..4deeadc85 100644 --- a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj @@ -7,11 +7,14 @@ - - - - - + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From 35a5e717fe02709d47b0e61d55a0daaa280e7b6c Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Mon, 1 Aug 2022 16:31:32 +0800 Subject: [PATCH 04/29] refactor: Removed using Utils from nuget package --- Directory.Build.props | 1 - src/Contrib/Directory.Build.props | 3 +-- ...Contrib.Authentication.Oidc.Cache.Storage.csproj | 5 ----- .../Masa.Contrib.Authentication.Oidc.Cache.csproj | 7 ++----- ...b.Authentication.Oidc.EntityFrameworkCore.csproj | 2 +- ...ontrib.Configuration.ConfigurationApi.Dcc.csproj | 4 ++-- .../Masa.Contrib.Data.DistributedLock.Local.csproj | 7 ++----- ...trib.Data.DistributedLock.Medallion.Redis.csproj | 2 +- ...sa.Contrib.Data.DistributedLock.Medallion.csproj | 2 +- ...a.IdGenerator.Snowflake.Distributed.Redis.csproj | 5 +---- .../Masa.Contrib.Data.IdGenerator.Snowflake.csproj | 4 ++-- .../Masa.Contrib.Data.Mapping.Mapster.csproj | 2 +- .../Masa.Contrib.Data.Contracts.EF.csproj | 2 +- .../Masa.Contrib.Dispatcher.Events.csproj | 4 ++-- ...Contrib.Dispatcher.IntegrationEvents.Dapr.csproj | 4 ++-- ...Dispatcher.IntegrationEvents.EventLogs.EF.csproj | 2 +- ...Masa.Contrib.Dispatcher.IntegrationEvents.csproj | 4 ++-- .../Masa.Contrib.Identity.IdentityModel.csproj | 2 +- .../Masa.Contrib.Isolation.csproj | 5 +---- ...b.SearchEngine.AutoComplete.ElasticSearch.csproj | 2 +- .../Masa.Contrib.Service.Caller.csproj | 5 +---- .../Masa.Contrib.Service.MinimalAPIs.csproj | 4 ++-- .../Masa.Contrib.StackSdks.Auth.csproj | 6 +++--- .../Masa - Backup.Contrib.StackSdks.Dcc.csproj | 13 +++++++++++++ .../Masa.Contrib.StackSdks.Dcc.csproj | 9 +++------ .../Masa.Contrib.StackSdks.Pm.csproj | 9 +++------ .../Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj | 2 +- .../Masa.Contrib.StackSdks.Mc.Tests.csproj | 13 ++++++++----- 28 files changed, 59 insertions(+), 71 deletions(-) create mode 100644 src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa - Backup.Contrib.StackSdks.Dcc.csproj diff --git a/Directory.Build.props b/Directory.Build.props index 904f99252..f4d92ef39 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,7 +6,6 @@ 16.9.4 3.0.2 4.16.1 - 0.5.0 7.3.0 1.5.0 3.19.1 diff --git a/src/Contrib/Directory.Build.props b/src/Contrib/Directory.Build.props index 4542bd522..d57b293e4 100644 --- a/src/Contrib/Directory.Build.props +++ b/src/Contrib/Directory.Build.props @@ -6,14 +6,13 @@ 16.9.4 3.0.2 4.16.1 - 0.5.0 7.3.0 1.5.0 3.19.1 1.0.4 11.1.0 11.1.2 - + 1.3.0 1.0.0-beta2 1.0.0-rc9.3 diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj index fd6d2ef88..b4441e7be 100644 --- a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj +++ b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj @@ -9,11 +9,6 @@ - - - - - diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj index fdbced3af..b27940889 100644 --- a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj +++ b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj @@ -6,13 +6,10 @@ enable - - - - - + + diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj index 456821bbb..04fe17702 100644 --- a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj +++ b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj @@ -7,13 +7,13 @@ - + diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj index 92a1fa2a8..d258bbb9c 100644 --- a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj +++ b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj @@ -7,8 +7,6 @@ - - @@ -17,6 +15,8 @@ + + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj index 0b3e325e3..a91a396ac 100644 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj +++ b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj @@ -6,13 +6,10 @@ enable - - - - - + + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj index d7b417220..7b7acbe4a 100644 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj +++ b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj @@ -8,10 +8,10 @@ - + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj index 31037573b..67b5a06f8 100644 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj +++ b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj @@ -8,11 +8,11 @@ - + diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj index 4bf0a3b20..616fe923e 100644 --- a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj +++ b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj @@ -7,11 +7,8 @@ + - - - - diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj index ba95d01a3..36bedc9af 100644 --- a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj +++ b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj @@ -7,13 +7,13 @@ - - + + diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj index 2e4ea322c..e9ae0a831 100644 --- a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj +++ b/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj @@ -8,12 +8,12 @@ - + diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj index c4feba61c..3c56f3d53 100644 --- a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj +++ b/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj @@ -7,11 +7,11 @@ - + diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj index b294cca50..9febbc666 100644 --- a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj +++ b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj @@ -7,8 +7,6 @@ - - @@ -18,6 +16,8 @@ + + diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj index 91e349687..c892388ae 100644 --- a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj +++ b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj @@ -8,12 +8,12 @@ - - + + diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj index e1d63c8fc..40d037ca4 100644 --- a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj +++ b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj @@ -7,13 +7,13 @@ - + diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj index 8e5b7f72a..8b4473928 100644 --- a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj +++ b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj @@ -7,13 +7,13 @@ - - + + diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj index e08b4cbc8..13ffee9e9 100644 --- a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj +++ b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj @@ -7,12 +7,12 @@ - + diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj index d2a64afdc..7b28bf928 100644 --- a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj +++ b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj @@ -6,16 +6,13 @@ enable - - - - + diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj index ec818def9..662ab0a12 100644 --- a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj +++ b/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj @@ -8,12 +8,12 @@ - + diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj index 85386307b..463513716 100644 --- a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj +++ b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj @@ -6,11 +6,8 @@ enable - - - - + diff --git a/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj index 364cd3abc..9a23324a4 100644 --- a/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj +++ b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj @@ -6,13 +6,13 @@ - - + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj index 10a53527f..a63cc32f9 100644 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -7,14 +7,14 @@ - - + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa - Backup.Contrib.StackSdks.Dcc.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa - Backup.Contrib.StackSdks.Dcc.csproj new file mode 100644 index 000000000..5f83a5972 --- /dev/null +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa - Backup.Contrib.StackSdks.Dcc.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj index 869ee3b80..a0ccc4732 100644 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj @@ -6,14 +6,11 @@ enable - - - - - - + + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj index 88d00062a..035c7a045 100644 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj +++ b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj @@ -6,16 +6,13 @@ enable - - - - - - + + + diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj index 18472f3e1..77e67b3f1 100644 --- a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj +++ b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj @@ -8,7 +8,6 @@ - @@ -24,6 +23,7 @@ + diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj index 04af889ac..4deeadc85 100644 --- a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj +++ b/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj @@ -7,11 +7,14 @@ - - - - - + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From 02ac32564fce9a232da76ebcee5abe5ecc7336bf Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Tue, 2 Aug 2022 15:33:55 +0800 Subject: [PATCH 05/29] chore: init --- Masa.Framework.sln | 602 ++++++++-------- .../Benchmarks.cs | 2 +- ...a.IdGenerator.Snowflake.Benchmarks.csproj} | 2 +- .../Program.cs | 16 + .../_Imports.cs | 11 + .../DistributedBenchmarks.cs | 45 ++ ...wflake.Distributed.Redis.Benchmarks.csproj | 22 + .../Program.cs | 3 +- .../_Imports.cs | 0 .../Benchmarks.cs | 2 +- .../AddShoppingCartEventHandler.cs | 4 +- .../Extensions/EventHandlers/CouponHandler.cs | 4 +- .../Extensions/Events/AddShoppingCartEvent.cs | 2 +- .../Extensions/Events/RegisterUserEvent.cs | 2 +- .../Middleware/LoggingMiddleware.cs | 2 +- ...ntrib.Dispatcher.Events.Benchmarks.csproj} | 2 +- .../Program.cs | 2 +- .../_Imports.cs | 4 +- .../_Imports.cs | 1 + .../KafkaOptions.cs | 2 +- ...ontrib.Configuration.AutoMap.Tests.csproj} | 0 ...tion.MountErrorSectionAutoMap.Tests.csproj | 14 - .../MountSectionRedisOptions.cs | 9 - .../_Imports.cs | 4 - .../Config/MountSectionRedisOptions.cs} | 7 +- .../ConfigurationTest.cs | 16 +- .../Masa.Contrib.Configuration.Tests.csproj | 7 +- .../_Imports.cs | 2 - .../DistributedBenchmarks.cs | 45 -- .../DomainEvents/RegisterUserDomainEvent.cs | 11 - .../DomainEvents/UpdateUserDomainEvent.cs | 14 - .../Events/RegisterUserEvent.cs | 13 - ...a.Contrib.Ddd.Domain.Entities.Tests.csproj | 14 - .../User.cs | 40 -- .../_Imports.cs | 6 - .../CustomDbContext.cs | 13 - .../DomainEventTest.cs | 120 ---- .../Handlers/UserHandler.cs | 49 -- ...Contrib.Ddd.Domain.Integrated.Tests.csproj | 35 - .../_Imports.cs | 20 - .../Entities/User.cs | 11 - ...epository.EF.CustomRepository.Tests.csproj | 14 - .../Repositories/IUserRepository.cs | 9 - .../_Imports.cs | 6 - .../BaseRepositoryTest.cs | 98 --- .../Domain/Repositories/IOrderRepository.cs | 14 - .../Infrastructure/CustomDbContext.cs | 11 - .../Repositories/OrderRepository.cs | 36 - ...trib.Ddd.Domain.Repository.EF.Tests.csproj | 15 +- .../RepositoryTest.cs | 664 ++++-------------- .../TestBase.cs | 21 - .../_Imports.cs | 24 +- .../DomainEventBusTest.cs | 340 --------- .../DomainIntegrationEventBusTest.cs | 49 -- .../Events/AddUserIntegrationDomainEvent.cs | 11 - .../Events/CreateProductDomainCommand.cs | 9 - .../Events/CustomDomainCommand.cs | 16 - .../Events/CustomDomainEvent.cs | 16 - .../Events/ForgetPasswordEvent.cs | 21 - .../PaymentFailedIntegrationDomainEvent.cs | 11 - .../Events/PaymentSucceededDomainEvent.cs | 9 - .../PaymentSucceededIntegraionDomainEvent.cs | 9 - .../Events/ProductItemDomainQuery.cs | 11 - ...sterUserSucceededDomainIntegrationEvent.cs | 11 - .../PaymentSucceededDomainEventHandller.cs | 22 - .../Masa.Contrib.Ddd.Domain.Tests.csproj | 32 - .../Services/UserDomainService.cs | 19 - .../Masa.Contrib.Ddd.Domain.Tests/_Imports.cs | 17 - .../CustomDbContext.cs | 9 - .../EventHandlers/CouponHandler.cs | 13 - .../FeaturesTest.cs | 24 +- ...asa.Contrib.Dispatcher.Events.Tests.csproj | 2 - .../_Imports.cs | 2 - ....Dispatcher.IntegrationEvents.Tests.csproj | 1 - .../Masa.Contrib.Dispatcher.Tests.csproj | 35 - .../AutomaticCallerTest.cs | 2 - .../_Imports.cs | 1 + .../CallerTest.cs | 204 ------ .../Callers/GithubCaller.cs | 13 - .../Masa.Utils.Caller.Core.Tests.csproj | 23 - .../Masa.Utils.Caller.Core.Tests/_Imports.cs | 8 - .../Masa.Utils.Caller.IntegratedTests.csproj | 28 - .../_Imports.cs | 11 - .../CustomHttpClientCallerProvider.cs | 2 +- .../Queries/UserDetailQury.cs | 2 +- .../{ => Application}/Queries/UserListQury.cs | 2 +- .../Requesties/RegisterUser.cs | 2 +- .../Response/BaseResponse.cs | 2 +- .../AutomaticCallerTest.cs | 11 +- .../Masa.Utils.Caller.Tests/CallerTest.cs | 233 ++++-- .../HttpClientCallerTest.cs | 2 - .../Infrastructure}/Callers/DaprCaller.cs | 7 +- .../Infrastructure}/Callers/GithubCaller.cs | 9 +- .../Infrastructure}/Callers/RoleCaller.cs | 2 +- .../Infrastructure}/Callers/UserCaller.cs | 2 +- .../Callers/UserDaprCallerBase.cs | 2 +- .../DefaultXmlResponseMessage.cs | 4 +- .../{ => Infrastructure}/Utils/XmlUtils.cs | 2 +- .../{ => Infrastructure}/XmlRequestMessage.cs | 4 +- .../TypeConvertTest.cs | 99 +++ .../test/Masa.Utils.Caller.Tests/_Imports.cs | 13 +- ...ependencyInjection.Repository.Tests.csproj | 14 - .../DependencyInjectionTest.cs | 26 +- .../{ => Domain}/Models/User.cs | 2 +- .../Domain/Repositories}/IRepository.cs | 2 +- .../Services}/ICalculateProviderService.cs | 2 +- .../Services}/IClientFactory.cs | 2 +- .../Repositories}/BaseRepository.cs | 2 +- .../Services/BaseService.cs | 2 +- .../Services/CustomizeClientFactory.cs | 4 +- .../Services/EmptyClientFactory.cs | 4 +- .../Services/GoodsBaseService.cs | 2 +- .../Services/GoodsService.cs | 2 +- .../Services/NullCalculateProviderService.cs | 4 +- .../Services/OrderBaseService.cs | 2 +- .../Services/OrderService.cs | 2 +- .../Services/UserBaseService.cs | 2 +- .../Services/UserService.cs | 2 +- .../Infrastructure}/UserDbContext.cs | 2 +- ...xtensions.DependencyInjection.Tests.csproj | 1 - .../_Imports.cs | 10 +- .../Command/RegisterUserCommand.cs | 2 +- .../Events/AddGoodsIntegrationEvent.cs | 2 +- .../Application/Events/RegisterUserEvent.cs | 2 +- .../Application/Queries/CheckUserQuery.cs | 2 +- .../Queries/CheckUserQueryValidator.cs | 2 +- .../Application/Queries/UserAgeQuery.cs | 2 +- .../Queries/UserAgeQueryValidator.cs | 2 +- .../Application/UserHandler.cs | 7 +- .../Domain/Aggregate/User.cs | 2 +- .../Infrastructure/CustomDbContext.cs | 4 +- .../Extensions/DefaultPublisher.cs | 2 +- .../Extensions/DispatcherOptionsExtensions.cs | 4 +- .../Middleware/RecordMiddleware.cs | 2 +- .../Middleware/ValidatorMiddleware.cs | 2 +- .../Masa.EventBus.IntegrationTests.csproj | 33 + .../TestBase.cs | 2 +- .../TestDispatcher.cs | 10 +- .../_Imports.cs | 11 +- 139 files changed, 975 insertions(+), 2678 deletions(-) rename src/Contrib/{test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests => perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks}/Benchmarks.cs (97%) rename src/Contrib/{test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj => perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj} (76%) create mode 100644 src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs create mode 100644 src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs create mode 100644 src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs create mode 100644 src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj rename src/Contrib/{test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests => perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks}/Program.cs (79%) rename src/Contrib/{test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests => perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks}/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests => perf/Masa.Contrib.Dispatcher.Events.Benchmarks}/Benchmarks.cs (96%) rename src/Contrib/{test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests => perf/Masa.Contrib.Dispatcher.Events.Benchmarks}/Extensions/EventHandlers/AddShoppingCartEventHandler.cs (76%) rename src/Contrib/{test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests => perf/Masa.Contrib.Dispatcher.Events.Benchmarks}/Extensions/EventHandlers/CouponHandler.cs (91%) rename src/Contrib/{test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests => perf/Masa.Contrib.Dispatcher.Events.Benchmarks}/Extensions/Events/AddShoppingCartEvent.cs (77%) rename src/Contrib/{test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests => perf/Masa.Contrib.Dispatcher.Events.Benchmarks}/Extensions/Events/RegisterUserEvent.cs (76%) rename src/Contrib/{test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests => perf/Masa.Contrib.Dispatcher.Events.Benchmarks}/Extensions/Middleware/LoggingMiddleware.cs (88%) rename src/Contrib/{test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj => perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj} (85%) rename src/Contrib/{test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests => perf/Masa.Contrib.Dispatcher.Events.Benchmarks}/Program.cs (88%) rename src/Contrib/{test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests => perf/Masa.Contrib.Dispatcher.Events.Benchmarks}/_Imports.cs (78%) rename src/Contrib/test/Configuration/{Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests => Masa.Contrib.Configuration.AutoMap.Tests}/KafkaOptions.cs (82%) rename src/Contrib/test/Configuration/{Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj => Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj} (100%) delete mode 100644 src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj delete mode 100644 src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/MountSectionRedisOptions.cs delete mode 100644 src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/_Imports.cs rename src/{Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/_Imports.cs => Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs} (60%) delete mode 100644 src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/DistributedBenchmarks.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/RegisterUserDomainEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/UpdateUserDomainEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Events/RegisterUserEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/User.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/_Imports.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/CustomDbContext.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/DomainEventTest.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Handlers/UserHandler.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/_Imports.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Entities/User.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Repositories/IUserRepository.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/_Imports.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/BaseRepositoryTest.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Repositories/IOrderRepository.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/CustomDbContext.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/Repositories/OrderRepository.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/TestBase.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainIntegrationEventBusTest.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/AddUserIntegrationDomainEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CreateProductDomainCommand.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainCommand.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ForgetPasswordEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentFailedIntegrationDomainEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededDomainEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededIntegraionDomainEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ProductItemDomainQuery.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/RegisterUserSucceededDomainIntegrationEvent.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Handlers/PaymentSucceededDomainEventHandller.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Services/UserDomainService.cs delete mode 100644 src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/_Imports.cs delete mode 100644 src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/CustomDbContext.cs delete mode 100644 src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/CouponHandler.cs delete mode 100644 src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj delete mode 100644 src/Utils/test/Masa.Utils.Caller.Core.Tests/CallerTest.cs delete mode 100644 src/Utils/test/Masa.Utils.Caller.Core.Tests/Callers/GithubCaller.cs delete mode 100644 src/Utils/test/Masa.Utils.Caller.Core.Tests/Masa.Utils.Caller.Core.Tests.csproj delete mode 100644 src/Utils/test/Masa.Utils.Caller.Core.Tests/_Imports.cs delete mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/Masa.Utils.Caller.IntegratedTests.csproj delete mode 100644 src/Utils/test/Masa.Utils.Caller.IntegratedTests/_Imports.cs rename src/Utils/test/Masa.Utils.Caller.Tests/{ => Application}/CustomHttpClientCallerProvider.cs (90%) rename src/Utils/test/Masa.Utils.Caller.Tests/{ => Application}/Queries/UserDetailQury.cs (92%) rename src/Utils/test/Masa.Utils.Caller.Tests/{ => Application}/Queries/UserListQury.cs (86%) rename src/Utils/test/Masa.Utils.Caller.Tests/{ => Application}/Requesties/RegisterUser.cs (89%) rename src/Utils/test/Masa.Utils.Caller.Tests/{ => Application}/Response/BaseResponse.cs (86%) rename src/Utils/test/{Masa.Utils.Caller.IntegratedTests => Masa.Utils.Caller.Tests}/AutomaticCallerTest.cs (86%) rename src/Utils/test/{Masa.Utils.Caller.IntegratedTests => Masa.Utils.Caller.Tests/Infrastructure}/Callers/DaprCaller.cs (73%) rename src/Utils/test/{Masa.Utils.Caller.IntegratedTests => Masa.Utils.Caller.Tests/Infrastructure}/Callers/GithubCaller.cs (67%) rename src/Utils/test/{Masa.Utils.Caller.IntegratedTests => Masa.Utils.Caller.Tests/Infrastructure}/Callers/RoleCaller.cs (83%) rename src/Utils/test/{Masa.Utils.Caller.IntegratedTests => Masa.Utils.Caller.Tests/Infrastructure}/Callers/UserCaller.cs (83%) rename src/Utils/test/{Masa.Utils.Caller.IntegratedTests => Masa.Utils.Caller.Tests/Infrastructure}/Callers/UserDaprCallerBase.cs (87%) rename src/Utils/test/Masa.Utils.Caller.Tests/{ => Infrastructure}/DefaultXmlResponseMessage.cs (97%) rename src/Utils/test/Masa.Utils.Caller.Tests/{ => Infrastructure}/Utils/XmlUtils.cs (93%) rename src/Utils/test/Masa.Utils.Caller.Tests/{ => Infrastructure}/XmlRequestMessage.cs (86%) delete mode 100644 src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Domain}/Models/User.cs (77%) rename src/Utils/test/{Masa.Utils.Extensions.DependencyInjection.Repository.Tests => Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories}/IRepository.cs (82%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{IServices => Domain/Services}/ICalculateProviderService.cs (76%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{IServices => Domain/Services}/IClientFactory.cs (75%) rename src/Utils/test/{Masa.Utils.Extensions.DependencyInjection.Repository.Tests => Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories}/BaseRepository.cs (83%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/BaseService.cs (81%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/CustomizeClientFactory.cs (66%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/EmptyClientFactory.cs (63%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/GoodsBaseService.cs (76%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/GoodsService.cs (78%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/NullCalculateProviderService.cs (62%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/OrderBaseService.cs (76%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/OrderService.cs (70%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/UserBaseService.cs (75%) rename src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/{ => Infrastructure}/Services/UserService.cs (78%) rename src/Utils/test/{Masa.Utils.Extensions.DependencyInjection.Repository.Tests => Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure}/UserDbContext.cs (71%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Application/Command/RegisterUserCommand.cs (83%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Application/Events/AddGoodsIntegrationEvent.cs (87%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Application/Events/RegisterUserEvent.cs (81%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Application/Queries/CheckUserQuery.cs (81%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Application/Queries/CheckUserQueryValidator.cs (85%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Application/Queries/UserAgeQuery.cs (81%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Application/Queries/UserAgeQueryValidator.cs (85%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Application/UserHandler.cs (87%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Domain/Aggregate/User.cs (84%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Infrastructure/CustomDbContext.cs (74%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Infrastructure/Extensions/DefaultPublisher.cs (84%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Infrastructure/Extensions/DispatcherOptionsExtensions.cs (62%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Infrastructure/Middleware/RecordMiddleware.cs (87%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/Infrastructure/Middleware/ValidatorMiddleware.cs (92%) create mode 100644 test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/TestBase.cs (97%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/TestDispatcher.cs (85%) rename {src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests => test/Masa.EventBus.IntegrationTests}/_Imports.cs (71%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index ede631c72..b71a65c68 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -65,20 +65,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{5944A182-13B8-4DA6-AEE2-0A01E64A9648}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{88740F49-00A1-40F8-B141-78EFA7CE2B4D}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{801BB9FA-307C-4A93-A116-16BAEC637C1E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1F8E0520-6670-4561-B92B-37B725CBE243}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Configuration.Tests\Masa.BuildingBlocks.Configuration.Tests.csproj", "{B228589B-4106-4CF8-B165-26636B94BE2C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{355663A0-EF0B-4C26-92A4-1589A7FFC9E6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{D0BE0F45-2C77-45AB-B861-EBEE34C187B2}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{77025FC5-67D5-49CE-8FA6-8FCB9D125B29}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{08649D7D-EF5A-4626-9959-935CA85DF770}" @@ -177,10 +167,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Token", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis.Tests", "src\Utils\test\Masa.Utils.Caching.Redis.Tests\Masa.Utils.Caching.Redis.Tests.csproj", "{D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core.Tests", "src\Utils\test\Masa.Utils.Caller.Core.Tests\Masa.Utils.Caller.Core.Tests.csproj", "{E8282BC0-5F46-4A96-80A6-1326F97E16C4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.IntegratedTests", "src\Utils\test\Masa.Utils.Caller.IntegratedTests\Masa.Utils.Caller.IntegratedTests.csproj", "{4428D240-7BF5-46BF-9FB7-EF531FA5C088}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Tests", "src\Utils\test\Masa.Utils.Caller.Tests\Masa.Utils.Caller.Tests.csproj", "{675D2886-B4E9-4B14-A02D-44B5204EE2E0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations.Tests", "src\Utils\test\Masa.Utils.Data.DataAnnotations.Tests\Masa.Utils.Data.DataAnnotations.Tests.csproj", "{2A57A40F-92F5-4ACE-95AA-763915578282}" @@ -189,8 +175,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsear EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus.Test", "src\Utils\test\Masa.Utils.Data.Prometheus.Test\Masa.Utils.Data.Prometheus.Test.csproj", "{B44F4054-5B66-4937-A99D-216DEFBAD0EF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Repository.Tests", "src\Utils\test\Masa.Utils.Extensions.DependencyInjection.Repository.Tests\Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj", "{072E41B5-B2BF-4493-9D26-15D4BB490318}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Tests", "src\Utils\test\Masa.Utils.Extensions.DependencyInjection.Tests\Masa.Utils.Extensions.DependencyInjection.Tests.csproj", "{A4F3852E-DC6B-43A8-A40A-899089546444}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell.Tests", "src\Utils\test\Masa.Utils.Ldap.Tests\Masa.Utils.Ldap.Novell.Tests\Masa.Utils.Ldap.Novell.Tests.csproj", "{CDA1B479-9B9A-43BD-A499-F8FAA6476F09}" @@ -201,10 +185,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contrib", "Contrib", "{950D EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{53543535-E81D-4B28-8EB0-89E9A8FDD496}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E3F32658-290D-4A85-A123-11FF6169774D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{19999563-8BBA-48A3-A087-EDEC1185E5C8}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun", "src\Contrib\src\Storage\Masa.Contrib.Storage.ObjectStorage.Aliyun\Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj", "{4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E38DF0DC-C0C9-4BB9-983C-F435A73334CF}" @@ -337,38 +317,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.EntityFrameworkCore", "src\Contrib\src\Authentication\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj", "{5A42D577-38AA-4A5B-866A-01FE1339F2AB}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DistributedLock", "DistributedLock", "{89639A47-CA9E-46C6-8CFB-CFB4FC18785E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdGenerator", "IdGenerator", "{3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{C73BD9CA-4C96-44E8-8A19-AED45D50B0E8}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj", "{B189564D-F638-4D3F-8AA6-B9C62D8F49BE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests\Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj", "{C517C235-8969-478B-941B-2E40897F4C71}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests\Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj", "{E7F0C1EC-A954-4325-8AA4-91148F334BEA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.AutoMap.Tests\Masa.Contrib.Configuration.AutoMap.Tests.csproj", "{C517C235-8969-478B-941B-2E40897F4C71}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj", "{41817AD2-D1DA-4698-B87D-910524CE4B7A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.Tests\Masa.Contrib.Configuration.Tests.csproj", "{36629279-FD56-452B-88C2-5C8271500042}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{8F668369-606C-4EC5-B0F5-8095D2720642}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Tests\Masa.Contrib.Ddd.Domain.Tests.csproj", "{CE986B6E-7B18-4E1C-AB35-7993193A56C0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Integrated.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Integrated.Tests\Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj", "{7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj", "{91A658A2-3326-4730-B039-73709697938B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Entities.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Entities.Tests\Masa.Contrib.Ddd.Domain.Entities.Tests.csproj", "{73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests\Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj", "{850FF743-77FF-49CB-BE4A-C4F561E1FDCA}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj", "{40D7AED3-982D-440B-BCD5-C1EFFC59514D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj", "{87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}" @@ -391,8 +347,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Int EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj", "{B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Tests\Masa.Contrib.Dispatcher.Tests.csproj", "{AE626BF6-3202-46B2-BB1A-0E71ED462C84}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{985B71A9-DF28-4B70-9DA5-1D60B82E8551}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Auth\Masa.Contrib.StackSdks.Auth.csproj", "{140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}" @@ -407,8 +361,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Sche EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Tsc\Masa.Contrib.StackSdks.Tsc.csproj", "{7BF99E7E-37EB-46D6-8808-2254430C3645}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Tsc.Test\Masa.Contrib.StackSdks.Tsc.Tests.csproj", "{5EF602A6-3996-44D3-A6C0-5319C9BF8B21}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Mc.Tests\Masa.Contrib.StackSdks.Mc.Tests.csproj", "{37138DEF-EEE4-4363-A307-0027B4C6ACD8}" @@ -419,10 +371,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm.T EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Scheduler.Tests\Masa.Contrib.StackSdks.Scheduler.Tests.csproj", "{9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{965C3DBE-2DF3-4BCF-A7BB-C26BEB2F8CCA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{58344864-F2A8-4C95-AB75-B5150C3A383A}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.MultiEnvironment.Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj", "{CC7ED747-8BCE-4B49-8855-AE4697792A81}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.MultiTenant.Tests\Masa.Contrib.Isolation.MultiTenant.Tests.csproj", "{605A3653-C7E3-4EC2-8749-979E4A0227D0}" @@ -435,8 +383,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel.Tests", "src\Contrib\test\Identity\Masa.Contrib.Identity.IdentityModel.Tests\Masa.Contrib.Identity.IdentityModel.Tests.csproj", "{CC9C8421-68D2-4645-B97E-512FAC691703}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{16FABF17-EC86-4B86-9130-19D8635219C0}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local.Tests", "src\Contrib\test\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Local.Tests\Masa.Contrib.Data.DistributedLock.Local.Tests.csproj", "{1551B2ED-9931-4A03-8853-1C3E5504C43D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Tests", "src\Contrib\test\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Tests\Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj", "{CB1F1533-E430-47C5-AD52-04922CC959A5}" @@ -449,40 +395,104 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF.Te EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests", "src\Contrib\test\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj", "{1787BF8C-3C05-4E07-8868-E839544F9522}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests", "src\Contrib\test\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj", "{F2766BE2-8387-49E6-B17D-5B7DA791DC75}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests", "src\Contrib\test\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj", "{F673CF31-D8CF-4F3E-B294-0802589F5BF2}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{9FBFDCBB-DB43-4259-B67C-693394134F09}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster.Tests", "src\Contrib\test\Data\Mapping\Masa.Contrib.Data.Mapping.Mapster.Tests\Masa.Contrib.Data.Mapping.Mapster.Tests.csproj", "{0D9CDEA2-0DC6-490A-9145-782259B63739}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{B0982BE8-DE6E-4763-8AA0-77C426DCE199}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs.Tests", "src\Contrib\test\Service\Masa.Contrib.Service.MinimalAPIs.Tests\Masa.Contrib.Service.MinimalAPIs.Tests.csproj", "{80512601-4B59-4A1B-984F-8E81E3242F97}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.AutomaticCaller.Tests", "src\Contrib\test\Service\Caller\Masa.Contrib.Service.Caller.AutomaticCaller.Tests\Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj", "{96C2CD33-8A8C-4206-9C73-97E8D748F397}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.Tests", "src\Contrib\test\Service\Caller\Masa.Contrib.Service.Caller.Tests\Masa.Contrib.Service.Caller.Tests.csproj", "{FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{8B778866-D908-456F-943A-1172B52360AD}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{B7B1D4FB-8113-4B29-92DB-3BC3960BB9A5}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests", "src\Contrib\test\Storage\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj", "{76117457-EC1B-4844-825A-20A760B42C44}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{92F310E1-6CD0-4066-9703-B81B4AC07819}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests", "src\Contrib\test\SearchEngine\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj", "{89EE0C4D-6C29-472E-9109-84327DB489A1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{AF35D4CC-EBE2-4F2B-8622-7A93A8CF9EF8}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs.Tests", "src\Contrib\test\ReadWriteSpliting\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj", "{F45CBF27-1D45-404C-9B09-5CC781AF5942}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Dcc.Tests\Masa.Contrib.StackSdks.Dcc.Tests.csproj", "{2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.StackSdks.Tsc", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdk.Tsc\Masa.BuildingBlocks.StackSdks.Tsc.csproj", "{8EA836C9-BE07-4EDE-A983-122A1D9FB499}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{2DC587FC-4D6D-400D-9504-69D9664A4124}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitignore = .gitignore + .gitmodules = .gitmodules + Directory.Build.props = Directory.Build.props + LICENSE.txt = LICENSE.txt + NuGet.Config = NuGet.Config + README.md = README.md + README.zh-CN.md = README.zh-CN.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E747043D-81E2-4A89-8B5B-1258ED45F941}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{B7D7027F-F125-40DD-92A2-A5CEE9E969CC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks", "src\Contrib\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj", "{49DB6925-62FF-4CF3-A041-A7F117AD6256}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{09AD9DFA-6AD8-4872-AA96-29C3234828CD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Snowflake", "Snowflake", "{5BD3D50F-5CB6-4554-9497-0F1680152D95}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SequentialGuid", "SequentialGuid", "{516A316F-BE2B-4931-88DD-4C08DECE8E56}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Local", "Local", "{2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Medallion", "Medallion", "{81DF5E8A-2AFE-47FC-BE66-40BC557A03AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Dispatcher.Events.Benchmarks", "src\Contrib\perf\Masa.Contrib.Dispatcher.Events.Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks.csproj", "{76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dcc", "Dcc", "{F7DEBE88-8324-47F9-B240-4F19F706B50B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mc", "Mc", "{DFCA5F96-FFC3-44D7-85D8-1749F0D3845E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pm", "Pm", "{EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scheduler", "Scheduler", "{A7C74F80-E9E4-401F-93F4-560EC1BAC88E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tsc", "Tsc", "{4FB42611-1B54-4ABF-988A-714EE9E8C492}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{D2ED2CE3-2273-4FA0-86A8-BB8DC3522823}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MultiEnvironment", "MultiEnvironment", "{353C56BA-CD53-46F2-9D2F-8FAD89CD20A6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MultiTenant", "MultiTenant", "{74739F71-A6F5-4BDF-B398-46A84715FA9E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataAnnotations", "DataAnnotations", "{F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elasticsearch", "Elasticsearch", "{08FED323-7D60-4B8B-AD36-C55B40C96D1C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Prometheus", "Prometheus", "{2879EB9A-D18B-4C57-B041-365F7DAEEBC4}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cryptography", "Cryptography", "{2A8759AF-76F5-4F6A-8420-D2890B612AB2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependencyInjection", "DependencyInjection", "{33D4C640-954B-4468-95A4-2322DAB0B184}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConfigurationApi", "ConfigurationApi", "{CD7414D5-4DE9-4339-B833-29EF41B3AC76}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IntegrationEvents", "IntegrationEvents", "{EAF8FB96-6D0E-4FCD-B991-C845903ECA8B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dapr", "Dapr", "{FF832650-37C7-48FF-B078-77CACF37966E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EventLogs", "EventLogs", "{46DE49C1-D700-4C46-849A-7F485D87A518}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Events", "Events", "{6B1042A4-A6D5-4307-B163-803164E4A742}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.EventBus.IntegrationTests", "test\Masa.EventBus.IntegrationTests\Masa.EventBus.IntegrationTests.csproj", "{BDA1DB4F-C408-445D-9391-EC9765CF7349}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{215F07C3-74EE-4FAA-A821-09CF70B8C950}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{70449866-CC6B-438B-B8DC-CBAB436EFD00}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -715,22 +725,6 @@ Global {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|Any CPU.Build.0 = Release|Any CPU {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|x64.ActiveCfg = Release|Any CPU {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|x64.Build.0 = Release|Any CPU - {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Debug|x64.ActiveCfg = Debug|Any CPU - {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Debug|x64.Build.0 = Debug|Any CPU - {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Release|Any CPU.Build.0 = Release|Any CPU - {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Release|x64.ActiveCfg = Release|Any CPU - {355663A0-EF0B-4C26-92A4-1589A7FFC9E6}.Release|x64.Build.0 = Release|Any CPU - {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Debug|x64.ActiveCfg = Debug|Any CPU - {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Debug|x64.Build.0 = Debug|Any CPU - {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Release|Any CPU.Build.0 = Release|Any CPU - {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Release|x64.ActiveCfg = Release|Any CPU - {D0BE0F45-2C77-45AB-B861-EBEE34C187B2}.Release|x64.Build.0 = Release|Any CPU {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|Any CPU.Build.0 = Debug|Any CPU {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -955,22 +949,6 @@ Global {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|Any CPU.Build.0 = Release|Any CPU {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|x64.ActiveCfg = Release|Any CPU {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|x64.Build.0 = Release|Any CPU - {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Debug|x64.ActiveCfg = Debug|Any CPU - {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Debug|x64.Build.0 = Debug|Any CPU - {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Release|Any CPU.Build.0 = Release|Any CPU - {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Release|x64.ActiveCfg = Release|Any CPU - {E8282BC0-5F46-4A96-80A6-1326F97E16C4}.Release|x64.Build.0 = Release|Any CPU - {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Debug|x64.ActiveCfg = Debug|Any CPU - {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Debug|x64.Build.0 = Debug|Any CPU - {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Release|Any CPU.Build.0 = Release|Any CPU - {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Release|x64.ActiveCfg = Release|Any CPU - {4428D240-7BF5-46BF-9FB7-EF531FA5C088}.Release|x64.Build.0 = Release|Any CPU {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|Any CPU.Build.0 = Debug|Any CPU {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1003,14 +981,6 @@ Global {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|Any CPU.Build.0 = Release|Any CPU {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|x64.ActiveCfg = Release|Any CPU {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|x64.Build.0 = Release|Any CPU - {072E41B5-B2BF-4493-9D26-15D4BB490318}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {072E41B5-B2BF-4493-9D26-15D4BB490318}.Debug|Any CPU.Build.0 = Debug|Any CPU - {072E41B5-B2BF-4493-9D26-15D4BB490318}.Debug|x64.ActiveCfg = Debug|Any CPU - {072E41B5-B2BF-4493-9D26-15D4BB490318}.Debug|x64.Build.0 = Debug|Any CPU - {072E41B5-B2BF-4493-9D26-15D4BB490318}.Release|Any CPU.ActiveCfg = Release|Any CPU - {072E41B5-B2BF-4493-9D26-15D4BB490318}.Release|Any CPU.Build.0 = Release|Any CPU - {072E41B5-B2BF-4493-9D26-15D4BB490318}.Release|x64.ActiveCfg = Release|Any CPU - {072E41B5-B2BF-4493-9D26-15D4BB490318}.Release|x64.Build.0 = Release|Any CPU {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|Any CPU.Build.0 = Debug|Any CPU {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1451,14 +1421,6 @@ Global {C517C235-8969-478B-941B-2E40897F4C71}.Release|Any CPU.Build.0 = Release|Any CPU {C517C235-8969-478B-941B-2E40897F4C71}.Release|x64.ActiveCfg = Release|Any CPU {C517C235-8969-478B-941B-2E40897F4C71}.Release|x64.Build.0 = Release|Any CPU - {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Debug|x64.ActiveCfg = Debug|Any CPU - {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Debug|x64.Build.0 = Debug|Any CPU - {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Release|Any CPU.Build.0 = Release|Any CPU - {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Release|x64.ActiveCfg = Release|Any CPU - {E7F0C1EC-A954-4325-8AA4-91148F334BEA}.Release|x64.Build.0 = Release|Any CPU {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|Any CPU.Build.0 = Debug|Any CPU {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1475,54 +1437,6 @@ Global {36629279-FD56-452B-88C2-5C8271500042}.Release|Any CPU.Build.0 = Release|Any CPU {36629279-FD56-452B-88C2-5C8271500042}.Release|x64.ActiveCfg = Release|Any CPU {36629279-FD56-452B-88C2-5C8271500042}.Release|x64.Build.0 = Release|Any CPU - {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Debug|x64.ActiveCfg = Debug|Any CPU - {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Debug|x64.Build.0 = Debug|Any CPU - {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Release|Any CPU.Build.0 = Release|Any CPU - {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Release|x64.ActiveCfg = Release|Any CPU - {CE986B6E-7B18-4E1C-AB35-7993193A56C0}.Release|x64.Build.0 = Release|Any CPU - {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Debug|x64.ActiveCfg = Debug|Any CPU - {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Debug|x64.Build.0 = Debug|Any CPU - {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Release|Any CPU.Build.0 = Release|Any CPU - {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Release|x64.ActiveCfg = Release|Any CPU - {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD}.Release|x64.Build.0 = Release|Any CPU - {91A658A2-3326-4730-B039-73709697938B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91A658A2-3326-4730-B039-73709697938B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91A658A2-3326-4730-B039-73709697938B}.Debug|x64.ActiveCfg = Debug|Any CPU - {91A658A2-3326-4730-B039-73709697938B}.Debug|x64.Build.0 = Debug|Any CPU - {91A658A2-3326-4730-B039-73709697938B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91A658A2-3326-4730-B039-73709697938B}.Release|Any CPU.Build.0 = Release|Any CPU - {91A658A2-3326-4730-B039-73709697938B}.Release|x64.ActiveCfg = Release|Any CPU - {91A658A2-3326-4730-B039-73709697938B}.Release|x64.Build.0 = Release|Any CPU - {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Debug|x64.ActiveCfg = Debug|Any CPU - {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Debug|x64.Build.0 = Debug|Any CPU - {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Release|Any CPU.Build.0 = Release|Any CPU - {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Release|x64.ActiveCfg = Release|Any CPU - {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3}.Release|x64.Build.0 = Release|Any CPU - {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Debug|x64.ActiveCfg = Debug|Any CPU - {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Debug|x64.Build.0 = Debug|Any CPU - {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Release|Any CPU.Build.0 = Release|Any CPU - {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Release|x64.ActiveCfg = Release|Any CPU - {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E}.Release|x64.Build.0 = Release|Any CPU - {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Debug|x64.ActiveCfg = Debug|Any CPU - {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Debug|x64.Build.0 = Debug|Any CPU - {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Release|Any CPU.Build.0 = Release|Any CPU - {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Release|x64.ActiveCfg = Release|Any CPU - {850FF743-77FF-49CB-BE4A-C4F561E1FDCA}.Release|x64.Build.0 = Release|Any CPU {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|Any CPU.Build.0 = Debug|Any CPU {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1611,14 +1525,6 @@ Global {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|Any CPU.Build.0 = Release|Any CPU {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|x64.ActiveCfg = Release|Any CPU {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|x64.Build.0 = Release|Any CPU - {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Debug|x64.ActiveCfg = Debug|Any CPU - {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Debug|x64.Build.0 = Debug|Any CPU - {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Release|Any CPU.Build.0 = Release|Any CPU - {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Release|x64.ActiveCfg = Release|Any CPU - {AE626BF6-3202-46B2-BB1A-0E71ED462C84}.Release|x64.Build.0 = Release|Any CPU {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|Any CPU.Build.0 = Debug|Any CPU {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1803,14 +1709,6 @@ Global {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|Any CPU.Build.0 = Release|Any CPU {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|x64.ActiveCfg = Release|Any CPU {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|x64.Build.0 = Release|Any CPU - {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Debug|x64.ActiveCfg = Debug|Any CPU - {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Debug|x64.Build.0 = Debug|Any CPU - {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Release|Any CPU.Build.0 = Release|Any CPU - {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Release|x64.ActiveCfg = Release|Any CPU - {F2766BE2-8387-49E6-B17D-5B7DA791DC75}.Release|x64.Build.0 = Release|Any CPU {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|Any CPU.Build.0 = Debug|Any CPU {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1891,6 +1789,62 @@ Global {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|Any CPU.Build.0 = Release|Any CPU {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|x64.ActiveCfg = Release|Any CPU {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|x64.Build.0 = Release|Any CPU + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Debug|x64.ActiveCfg = Debug|Any CPU + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Debug|x64.Build.0 = Debug|Any CPU + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Release|Any CPU.Build.0 = Release|Any CPU + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Release|x64.ActiveCfg = Release|Any CPU + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Release|x64.Build.0 = Release|Any CPU + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Debug|x64.ActiveCfg = Debug|Any CPU + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Debug|x64.Build.0 = Debug|Any CPU + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Release|Any CPU.Build.0 = Release|Any CPU + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Release|x64.ActiveCfg = Release|Any CPU + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Release|x64.Build.0 = Release|Any CPU + {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Debug|Any CPU.Build.0 = Debug|Any CPU + {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Debug|x64.ActiveCfg = Debug|Any CPU + {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Debug|x64.Build.0 = Debug|Any CPU + {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Release|Any CPU.ActiveCfg = Release|Any CPU + {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Release|Any CPU.Build.0 = Release|Any CPU + {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Release|x64.ActiveCfg = Release|Any CPU + {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Release|x64.Build.0 = Release|Any CPU + {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Debug|x64.ActiveCfg = Debug|Any CPU + {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Debug|x64.Build.0 = Debug|Any CPU + {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Release|Any CPU.Build.0 = Release|Any CPU + {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Release|x64.ActiveCfg = Release|Any CPU + {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Release|x64.Build.0 = Release|Any CPU + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Debug|x64.ActiveCfg = Debug|Any CPU + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Debug|x64.Build.0 = Debug|Any CPU + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Release|Any CPU.Build.0 = Release|Any CPU + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Release|x64.ActiveCfg = Release|Any CPU + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Release|x64.Build.0 = Release|Any CPU + {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Debug|x64.ActiveCfg = Debug|Any CPU + {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Debug|x64.Build.0 = Debug|Any CPU + {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|Any CPU.Build.0 = Release|Any CPU + {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|x64.ActiveCfg = Release|Any CPU + {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|x64.Build.0 = Release|Any CPU + {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Debug|Any CPU.Build.0 = Debug|Any CPU + {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Debug|x64.ActiveCfg = Debug|Any CPU + {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Debug|x64.Build.0 = Debug|Any CPU + {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Release|Any CPU.ActiveCfg = Release|Any CPU + {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Release|Any CPU.Build.0 = Release|Any CPU + {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Release|x64.ActiveCfg = Release|Any CPU + {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1913,7 +1867,6 @@ Global {C3451307-3743-4911-A401-7F28889703D3} = {08649D7D-EF5A-4626-9959-935CA85DF770} {736F69E9-89D0-47E2-99AF-9412AAE1C6BB} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} {4B818EE6-8E13-40DA-B99A-218BB228EE91} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} {30DC35DF-9D86-443C-B26C-9053E6FCA434} = {08649D7D-EF5A-4626-9959-935CA85DF770} {4B94CAF6-134D-4F89-8F2D-72A4FB363B59} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} {54936F20-EEFC-405B-8646-76F200A5C8F7} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} @@ -1922,29 +1875,12 @@ Global {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B} = {7064C470-7D0B-4CE2-A80C-BEE376DDC956} {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {981E883E-CCDC-400B-8FB1-76E1E65C32AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {0D34A7F0-DC77-4789-A136-93089CBD15C3} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {DA816A33-F164-4456-92DD-A672BAD1A6B1} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {ABF6E41A-CBF9-49DE-87FC-9D88F440A104} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} {5944A182-13B8-4DA6-AEE2-0A01E64A9648} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} - {88740F49-00A1-40F8-B141-78EFA7CE2B4D} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {801BB9FA-307C-4A93-A116-16BAEC637C1E} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {1F8E0520-6670-4561-B92B-37B725CBE243} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {B228589B-4106-4CF8-B165-26636B94BE2C} = {1F8E0520-6670-4561-B92B-37B725CBE243} - {355663A0-EF0B-4C26-92A4-1589A7FFC9E6} = {1F8E0520-6670-4561-B92B-37B725CBE243} - {D0BE0F45-2C77-45AB-B861-EBEE34C187B2} = {1F8E0520-6670-4561-B92B-37B725CBE243} - {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} - {08649D7D-EF5A-4626-9959-935CA85DF770} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} - {8663AD83-4E2C-47EF-BF28-1427E82F1A36} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} - {FE0F37B3-7727-4A08-AEA1-437F53982658} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} - {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} - {4B812744-1CB5-4760-9719-2220EACC566C} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} {322F0F91-E181-4139-87DE-974CCF2339BA} = {4B812744-1CB5-4760-9719-2220EACC566C} - {232840A6-183C-4D3A-A086-582FD449D300} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} - {7064C470-7D0B-4CE2-A80C-BEE376DDC956} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} - {E8CE3469-6E0F-495C-937E-D9820DE3DA89} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} - {46C33E74-835B-4CB4-861D-42A781A2502C} = {88740F49-00A1-40F8-B141-78EFA7CE2B4D} {02B35A90-23DF-4341-89CF-E911ED210FBE} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} @@ -1959,13 +1895,10 @@ Global {049430DA-664C-4C77-A679-0CF12217ABB2} = {02B35A90-23DF-4341-89CF-E911ED210FBE} {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} {64B72C9E-85BD-4C41-B67D-892157600F5B} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} - {354D1855-EE83-41EF-BFFC-1348F77A66DB} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} {A88B4DB8-2441-488D-B097-68F02F18DECC} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} {3B5C4669-07C6-49F0-BC69-70A8980FC605} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {81618F3D-ED3C-44C5-9BAD-8F04CF601D42} = {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} - {F6E5B615-A85D-4FB4-97D0-698098D7616F} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {7A628B6A-AFE4-4235-95AA-9A711268B9B1} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {E417DAE3-A1D2-430D-A6C7-C8BDE083D851} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {9A6A3012-6A11-415B-BC58-E2268BE7022E} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} @@ -1973,47 +1906,20 @@ Global {0F43C687-59EF-4164-B3A5-E53C3BF86892} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} {BE11C98A-5680-491E-86E9-93B0A83909EA} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} {E2B9737D-9630-4705-B2DF-21C2EB607F65} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} {8C154ACF-ED6E-43C4-906E-2D36CBC8D112} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} {CC117C03-267A-4145-B258-922C35484883} = {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} {1AD1F4E7-84DA-4CE8-BC69-7D713413560D} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} {9DEA348B-8915-4BAA-AE04-99BF5FC6131B} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} - {E85FA5C9-C7D9-4461-99DE-11675749E38E} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} {FB66887D-E08C-4551-B838-EAF49C1D1EE7} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {E8282BC0-5F46-4A96-80A6-1326F97E16C4} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {4428D240-7BF5-46BF-9FB7-EF531FA5C088} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {675D2886-B4E9-4B14-A02D-44B5204EE2E0} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {2A57A40F-92F5-4ACE-95AA-763915578282} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {B44F4054-5B66-4937-A99D-216DEFBAD0EF} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {072E41B5-B2BF-4493-9D26-15D4BB490318} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {A4F3852E-DC6B-43A8-A40A-899089546444} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B} = {77025FC5-67D5-49CE-8FA6-8FCB9D125B29} {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} - {53543535-E81D-4B28-8EB0-89E9A8FDD496} = {E3F32658-290D-4A85-A123-11FF6169774D} - {E3F32658-290D-4A85-A123-11FF6169774D} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {19999563-8BBA-48A3-A087-EDEC1185E5C8} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} - {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} = {E3F32658-290D-4A85-A123-11FF6169774D} {89B2A360-4806-41B2-9CE1-F2E556BB222D} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} {45B8C34E-A62D-4809-BA0F-6046AFAB2851} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} - {C72508E7-CEF3-4E36-BF39-F3908EE338B7} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {65605EB9-FA98-42CE-8F40-117D89D59786} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} = {E3F32658-290D-4A85-A123-11FF6169774D} {4F26D6F5-32FA-4EE6-8588-A325734E4386} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} - {0C5262F4-DC7E-493F-AB87-A72063ABCA00} = {E3F32658-290D-4A85-A123-11FF6169774D} {FE906D46-B113-4600-AC2C-7523937B96AB} = {0C5262F4-DC7E-493F-AB87-A72063ABCA00} {6FF949B6-F1C6-4056-B9DA-CC6120D427FC} = {FE906D46-B113-4600-AC2C-7523937B96AB} - {920E6762-32FE-4BEC-AD0C-6F28119C6804} = {E3F32658-290D-4A85-A123-11FF6169774D} - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} {672C436B-ECE4-4722-8B7D-4EF1E45194B0} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} = {E3F32658-290D-4A85-A123-11FF6169774D} {5D9F3039-D6FE-4F2E-9752-486ADF970093} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {E99EB5EE-6C3A-4878-9407-BB4060F5E200} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} @@ -2029,112 +1935,158 @@ Global {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {A9D8D7E4-591D-479B-B0A5-07F30F831199} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {14D3C601-C29B-48D2-8312-556319D04619} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {19C7B778-345C-407B-BE72-67BF04784F35} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {7DC7F500-F004-4DAC-9F16-D6878B3808E1} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {9B615187-D90E-4334-BBD8-5973A12442F9} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {8E00F570-6926-4304-BAE0-C9E7FA9A4213} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {A69815D7-1C4F-4484-8E0B-7E6765203AC0} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {524C5CA0-036E-480A-86E4-513232422F26} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} {1A3740CF-C51F-4E7A-BA27-6BF8652021BF} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {217AB0A8-8750-4696-8E43-E11F82A191CB} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {C92637A7-77FC-4995-8024-B28F6C58AEA8} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} {2BDF6D68-91FF-4220-8D78-90AA024275C3} = {14D3C601-C29B-48D2-8312-556319D04619} - {542D8266-668F-49FA-BFE1-814AB96720DD} = {E3F32658-290D-4A85-A123-11FF6169774D} {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8} = {542D8266-668F-49FA-BFE1-814AB96720DD} - {83AA938C-9182-4E65-A42A-79CAE68888E9} = {E3F32658-290D-4A85-A123-11FF6169774D} - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592} = {83AA938C-9182-4E65-A42A-79CAE68888E9} - {66DEC85C-7433-4902-B01A-8F98D1A87385} = {83AA938C-9182-4E65-A42A-79CAE68888E9} - {8BE42490-F83D-48D7-8C5D-1665AC84229C} = {83AA938C-9182-4E65-A42A-79CAE68888E9} - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11} = {83AA938C-9182-4E65-A42A-79CAE68888E9} - {BA74E50F-C553-40D6-8578-BCB4A3F5E585} = {E3F32658-290D-4A85-A123-11FF6169774D} - {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} = {E3F32658-290D-4A85-A123-11FF6169774D} {2DEE608F-965F-4298-9B71-D7B32CBA66BD} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} {E7C80137-1D51-4215-BED7-C739BC663BE2} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} - {DC9F9523-A2F9-47AA-B6D9-40AC14797548} = {E3F32658-290D-4A85-A123-11FF6169774D} {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} {1F04359A-64BB-4C86-8D2F-161C49F2CDEB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} {5A42D577-38AA-4A5B-866A-01FE1339F2AB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} - {89639A47-CA9E-46C6-8CFB-CFB4FC18785E} = {16FABF17-EC86-4B86-9130-19D8635219C0} - {3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997} = {16FABF17-EC86-4B86-9130-19D8635219C0} - {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} - {C517C235-8969-478B-941B-2E40897F4C71} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} - {E7F0C1EC-A954-4325-8AA4-91148F334BEA} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} - {41817AD2-D1DA-4698-B87D-910524CE4B7A} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} - {36629279-FD56-452B-88C2-5C8271500042} = {C73BD9CA-4C96-44E8-8A19-AED45D50B0E8} - {8F668369-606C-4EC5-B0F5-8095D2720642} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {CE986B6E-7B18-4E1C-AB35-7993193A56C0} = {8F668369-606C-4EC5-B0F5-8095D2720642} - {7ED6FF8C-ECC5-4945-AECD-FE28FFEAF0CD} = {8F668369-606C-4EC5-B0F5-8095D2720642} - {91A658A2-3326-4730-B039-73709697938B} = {8F668369-606C-4EC5-B0F5-8095D2720642} - {3F4007B4-B902-4BC7-9D11-80E3AEEB1CE3} = {8F668369-606C-4EC5-B0F5-8095D2720642} - {73034AF7-90A6-40AB-A2E8-389B5A2A2B0E} = {8F668369-606C-4EC5-B0F5-8095D2720642} - {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {850FF743-77FF-49CB-BE4A-C4F561E1FDCA} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {40D7AED3-982D-440B-BCD5-C1EFFC59514D} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {A1D7408C-AB95-4CFF-89F8-24797A865DBF} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {8680EA03-13A7-4F4A-A579-EB2CB6411C21} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {4CE930E3-12E4-4BFA-962E-3477B7AB6930} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {8903DCD8-A68D-4164-83EE-DE07385DDDD6} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {E2E68FF1-9CB5-424F-9D91-130A48462E54} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {472122D3-114E-424D-AF47-B3D7E94057A8} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {AE626BF6-3202-46B2-BB1A-0E71ED462C84} = {47FF7E3C-E3B6-414E-9F14-B5CF0AD936BA} - {985B71A9-DF28-4B70-9DA5-1D60B82E8551} = {E3F32658-290D-4A85-A123-11FF6169774D} - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {F9C27912-F7EC-47B6-A385-064BD4B92EDA} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {332D590C-11EC-481D-AC55-6279548F1CF4} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {7BF99E7E-37EB-46D6-8808-2254430C3645} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} - {37138DEF-EEE4-4363-A307-0027B4C6ACD8} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} - {A93F1887-0011-466C-8EB8-3A338AEA5A4B} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} - {965C3DBE-2DF3-4BCF-A7BB-C26BEB2F8CCA} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {58344864-F2A8-4C95-AB75-B5150C3A383A} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {CC7ED747-8BCE-4B49-8855-AE4697792A81} = {58344864-F2A8-4C95-AB75-B5150C3A383A} - {605A3653-C7E3-4EC2-8749-979E4A0227D0} = {58344864-F2A8-4C95-AB75-B5150C3A383A} - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC} = {58344864-F2A8-4C95-AB75-B5150C3A383A} - {50C13F5E-BA3A-4B04-A730-BAA584E051AB} = {58344864-F2A8-4C95-AB75-B5150C3A383A} - {C8AD2261-D325-414D-9B2D-B2A9D27C242F} = {58344864-F2A8-4C95-AB75-B5150C3A383A} - {CC9C8421-68D2-4645-B97E-512FAC691703} = {965C3DBE-2DF3-4BCF-A7BB-C26BEB2F8CCA} - {16FABF17-EC86-4B86-9130-19D8635219C0} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {1551B2ED-9931-4A03-8853-1C3E5504C43D} = {89639A47-CA9E-46C6-8CFB-CFB4FC18785E} - {CB1F1533-E430-47C5-AD52-04922CC959A5} = {89639A47-CA9E-46C6-8CFB-CFB4FC18785E} - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574} = {16FABF17-EC86-4B86-9130-19D8635219C0} - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9} = {16FABF17-EC86-4B86-9130-19D8635219C0} - {D05ADEA6-2267-4DC1-901A-BD18B697E889} = {16FABF17-EC86-4B86-9130-19D8635219C0} - {1787BF8C-3C05-4E07-8868-E839544F9522} = {3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997} - {F2766BE2-8387-49E6-B17D-5B7DA791DC75} = {3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997} - {F673CF31-D8CF-4F3E-B294-0802589F5BF2} = {3CAE8AEB-A98D-4A1C-B1EF-1F4065EDD997} - {9FBFDCBB-DB43-4259-B67C-693394134F09} = {16FABF17-EC86-4B86-9130-19D8635219C0} - {0D9CDEA2-0DC6-490A-9145-782259B63739} = {9FBFDCBB-DB43-4259-B67C-693394134F09} - {B0982BE8-DE6E-4763-8AA0-77C426DCE199} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {80512601-4B59-4A1B-984F-8E81E3242F97} = {B0982BE8-DE6E-4763-8AA0-77C426DCE199} - {96C2CD33-8A8C-4206-9C73-97E8D748F397} = {8B778866-D908-456F-943A-1172B52360AD} - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31} = {8B778866-D908-456F-943A-1172B52360AD} - {8B778866-D908-456F-943A-1172B52360AD} = {B0982BE8-DE6E-4763-8AA0-77C426DCE199} - {B7B1D4FB-8113-4B29-92DB-3BC3960BB9A5} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {76117457-EC1B-4844-825A-20A760B42C44} = {B7B1D4FB-8113-4B29-92DB-3BC3960BB9A5} - {92F310E1-6CD0-4066-9703-B81B4AC07819} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {89EE0C4D-6C29-472E-9109-84327DB489A1} = {92F310E1-6CD0-4066-9703-B81B4AC07819} - {AF35D4CC-EBE2-4F2B-8622-7A93A8CF9EF8} = {19999563-8BBA-48A3-A087-EDEC1185E5C8} - {F45CBF27-1D45-404C-9B09-5CC781AF5942} = {AF35D4CC-EBE2-4F2B-8622-7A93A8CF9EF8} - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36} = {CD8E78AE-7AC0-44EE-9FCE-7F1EEEB66692} {8EA836C9-BE07-4EDE-A983-122A1D9FB499} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {08649D7D-EF5A-4626-9959-935CA85DF770} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {8663AD83-4E2C-47EF-BF28-1427E82F1A36} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {FE0F37B3-7727-4A08-AEA1-437F53982658} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {7064C470-7D0B-4CE2-A80C-BEE376DDC956} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {4B812744-1CB5-4760-9719-2220EACC566C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {232840A6-183C-4D3A-A086-582FD449D300} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {E8CE3469-6E0F-495C-937E-D9820DE3DA89} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {0D34A7F0-DC77-4789-A136-93089CBD15C3} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {46C33E74-835B-4CB4-861D-42A781A2502C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {B228589B-4106-4CF8-B165-26636B94BE2C} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC} = {232840A6-183C-4D3A-A086-582FD449D300} + {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {DC9F9523-A2F9-47AA-B6D9-40AC14797548} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {BA74E50F-C553-40D6-8578-BCB4A3F5E585} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {83AA938C-9182-4E65-A42A-79CAE68888E9} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {542D8266-668F-49FA-BFE1-814AB96720DD} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {920E6762-32FE-4BEC-AD0C-6F28119C6804} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {0C5262F4-DC7E-493F-AB87-A72063ABCA00} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {985B71A9-DF28-4B70-9DA5-1D60B82E8551} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {53543535-E81D-4B28-8EB0-89E9A8FDD496} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {0D9CDEA2-0DC6-490A-9145-782259B63739} = {14D3C601-C29B-48D2-8312-556319D04619} + {5BD3D50F-5CB6-4554-9497-0F1680152D95} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {C92637A7-77FC-4995-8024-B28F6C58AEA8} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {49DB6925-62FF-4CF3-A041-A7F117AD6256} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {09AD9DFA-6AD8-4872-AA96-29C3234828CD} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {F673CF31-D8CF-4F3E-B294-0802589F5BF2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {516A316F-BE2B-4931-88DD-4C08DECE8E56} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {217AB0A8-8750-4696-8E43-E11F82A191CB} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} + {1787BF8C-3C05-4E07-8868-E839544F9522} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} + {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {19C7B778-345C-407B-BE72-67BF04784F35} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} + {1551B2ED-9931-4A03-8853-1C3E5504C43D} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} + {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {7DC7F500-F004-4DAC-9F16-D6878B3808E1} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {9B615187-D90E-4334-BBD8-5973A12442F9} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {8E00F570-6926-4304-BAE0-C9E7FA9A4213} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {A69815D7-1C4F-4484-8E0B-7E6765203AC0} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {524C5CA0-036E-480A-86E4-513232422F26} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {CB1F1533-E430-47C5-AD52-04922CC959A5} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {D05ADEA6-2267-4DC1-901A-BD18B697E889} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {CC9C8421-68D2-4645-B97E-512FAC691703} = {542D8266-668F-49FA-BFE1-814AB96720DD} + {76117457-EC1B-4844-825A-20A760B42C44} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} + {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} + {F7DEBE88-8324-47F9-B240-4F19F706B50B} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {4FB42611-1B54-4ABF-988A-714EE9E8C492} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {EAAD274F-9C5D-4531-A4E5-A5764E9D644A} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} + {F9C27912-F7EC-47B6-A385-064BD4B92EDA} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} + {F346B708-0D1B-4BA7-AA86-1B977BA88FB6} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} + {332D590C-11EC-481D-AC55-6279548F1CF4} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} + {7BF99E7E-37EB-46D6-8808-2254430C3645} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} + {A93F1887-0011-466C-8EB8-3A338AEA5A4B} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} + {37138DEF-EEE4-4363-A307-0027B4C6ACD8} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} + {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} + {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} + {80512601-4B59-4A1B-984F-8E81E3242F97} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} + {96C2CD33-8A8C-4206-9C73-97E8D748F397} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {C72508E7-CEF3-4E36-BF39-F3908EE338B7} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {65605EB9-FA98-42CE-8F40-117D89D59786} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {89EE0C4D-6C29-472E-9109-84327DB489A1} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} + {F45CBF27-1D45-404C-9B09-5CC781AF5942} = {FE906D46-B113-4600-AC2C-7523937B96AB} + {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF} = {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC} = {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} + {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8} = {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} + {74739F71-A6F5-4BDF-B398-46A84715FA9E} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9} = {74739F71-A6F5-4BDF-B398-46A84715FA9E} + {605A3653-C7E3-4EC2-8749-979E4A0227D0} = {74739F71-A6F5-4BDF-B398-46A84715FA9E} + {CC7ED747-8BCE-4B49-8855-AE4697792A81} = {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} + {50C13F5E-BA3A-4B04-A730-BAA584E051AB} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {C8AD2261-D325-414D-9B2D-B2A9D27C242F} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} + {354D1855-EE83-41EF-BFFC-1348F77A66DB} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} + {2A57A40F-92F5-4ACE-95AA-763915578282} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} + {08FED323-7D60-4B8B-AD36-C55B40C96D1C} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} + {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} + {B44F4054-5B66-4937-A99D-216DEFBAD0EF} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} + {2A8759AF-76F5-4F6A-8420-D2890B612AB2} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B} = {2A8759AF-76F5-4F6A-8420-D2890B612AB2} + {E85FA5C9-C7D9-4461-99DE-11675749E38E} = {2A8759AF-76F5-4F6A-8420-D2890B612AB2} + {33D4C640-954B-4468-95A4-2322DAB0B184} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} + {F6E5B615-A85D-4FB4-97D0-698098D7616F} = {33D4C640-954B-4468-95A4-2322DAB0B184} + {A4F3852E-DC6B-43A8-A40A-899089546444} = {33D4C640-954B-4468-95A4-2322DAB0B184} + {675D2886-B4E9-4B14-A02D-44B5204EE2E0} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {CD7414D5-4DE9-4339-B833-29EF41B3AC76} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} + {36629279-FD56-452B-88C2-5C8271500042} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} + {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} = {83AA938C-9182-4E65-A42A-79CAE68888E9} + {66DEC85C-7433-4902-B01A-8F98D1A87385} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} + {FF832650-37C7-48FF-B078-77CACF37966E} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} + {8BE42490-F83D-48D7-8C5D-1665AC84229C} = {FF832650-37C7-48FF-B078-77CACF37966E} + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2} = {FF832650-37C7-48FF-B078-77CACF37966E} + {46DE49C1-D700-4C46-849A-7F485D87A518} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11} = {46DE49C1-D700-4C46-849A-7F485D87A518} + {472122D3-114E-424D-AF47-B3D7E94057A8} = {46DE49C1-D700-4C46-849A-7F485D87A518} + {6B1042A4-A6D5-4307-B163-803164E4A742} = {83AA938C-9182-4E65-A42A-79CAE68888E9} + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {E2E68FF1-9CB5-424F-9D91-130A48462E54} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {BDA1DB4F-C408-445D-9391-EC9765CF7349} = {E747043D-81E2-4A89-8B5B-1258ED45F941} + {215F07C3-74EE-4FAA-A821-09CF70B8C950} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} + {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {40D7AED3-982D-440B-BCD5-C1EFFC59514D} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {A1D7408C-AB95-4CFF-89F8-24797A865DBF} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {8680EA03-13A7-4F4A-A579-EB2CB6411C21} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {4CE930E3-12E4-4BFA-962E-3477B7AB6930} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {8903DCD8-A68D-4164-83EE-DE07385DDDD6} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {70449866-CC6B-438B-B8DC-CBAB436EFD00} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} + {41817AD2-D1DA-4698-B87D-910524CE4B7A} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} + {C517C235-8969-478B-941B-2E40897F4C71} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Benchmarks.cs b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs similarity index 97% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Benchmarks.cs rename to src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs index 3bfe9f631..f9899456b 100644 --- a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Benchmarks.cs +++ b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks; [MarkdownExporter, AsciiDocExporter, HtmlExporter] [SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 1000)] diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj similarity index 76% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj rename to src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj index 32c9e5f7b..673bb2d99 100644 --- a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests.csproj +++ b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs new file mode 100644 index 000000000..422680280 --- /dev/null +++ b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks; + +class Program +{ + static void Main(string[] args) + { + var config = DefaultConfig.Instance + .AddValidator(ExecutionValidator.FailOnError) + .WithOptions(ConfigOptions.DisableOptimizationsValidator); + BenchmarkRunner.Run(config); + Console.ReadLine(); + } +} diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs new file mode 100644 index 000000000..1dda9dd1e --- /dev/null +++ b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using BenchmarkDotNet.Attributes; +global using BenchmarkDotNet.Configs; +global using BenchmarkDotNet.Engines; +global using BenchmarkDotNet.Jobs; +global using BenchmarkDotNet.Running; +global using BenchmarkDotNet.Validators; +global using Masa.BuildingBlocks.Data; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs new file mode 100644 index 000000000..f3a67128f --- /dev/null +++ b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks; + +/// +/// Only supports the use of Redis environment +/// +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 1000)] +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 10000)] +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100000)] +[MinColumn, MaxColumn, MeanColumn, MedianColumn] +public class DistributedBenchmarks +{ + private IIdGenerator _idGenerator; + + [GlobalSetup] + public void GlobalSetup() + { + IServiceCollection services = new ServiceCollection(); + services.AddMasaRedisCache(opt => + { + opt.Password = ""; + opt.DefaultDatabase = 2; + opt.Servers = new List() + { + new("127.0.0.1", 6379) + }; + }); + services.AddSnowflake(options => + { + options.UseRedis(); + options.EnableMachineClock = true; + }); + var serviceProvider = services.BuildServiceProvider(); + _idGenerator = serviceProvider.GetRequiredService>(); + _idGenerator.NewId(); + } + + [Benchmark] + public void Distributed() + { + _idGenerator.NewId(); + } +} diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj new file mode 100644 index 000000000..6c43d7f04 --- /dev/null +++ b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj @@ -0,0 +1,22 @@ + + + + Exe + net6.0 + AnyCPU + false + enable + false + enable + + + + + + + + + + + + diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Program.cs b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs similarity index 79% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Program.cs rename to src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs index 178a1766a..d8860fe0a 100644 --- a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/Program.cs +++ b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks; class Program { @@ -10,7 +10,6 @@ static void Main(string[] args) var config = DefaultConfig.Instance .AddValidator(ExecutionValidator.FailOnError) .WithOptions(ConfigOptions.DisableOptimizationsValidator); - BenchmarkRunner.Run(config); // BenchmarkRunner.Run(config); Console.ReadLine(); } diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/_Imports.cs b/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs similarity index 100% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/_Imports.cs rename to src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Benchmarks.cs b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs similarity index 96% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Benchmarks.cs rename to src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs index 2320cdf25..b09f5a7cd 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Benchmarks.cs +++ b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests; +namespace Masa.Contrib.Dispatcher.Events.Benchmarks; [MarkdownExporter, AsciiDocExporter, HtmlExporter] [SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100)] diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/AddShoppingCartEventHandler.cs b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs similarity index 76% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/AddShoppingCartEventHandler.cs rename to src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs index 8405f5277..b788ac541 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/AddShoppingCartEventHandler.cs +++ b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.Extensions.EventHandlers; +using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; + +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; public class AddShoppingCartEventHandler : IRequestHandler { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/CouponHandler.cs b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs similarity index 91% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/CouponHandler.cs rename to src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs index bfbada3cb..87c019e6e 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/EventHandlers/CouponHandler.cs +++ b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.Extensions.EventHandlers; +using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; + +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; public class CouponHandler { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/AddShoppingCartEvent.cs b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs similarity index 77% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/AddShoppingCartEvent.cs rename to src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs index 223a79654..4b92d5b9d 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/AddShoppingCartEvent.cs +++ b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.Extensions.Events; +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; public record AddShoppingCartEvent : Event, IRequest { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/RegisterUserEvent.cs b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs similarity index 76% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/RegisterUserEvent.cs rename to src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs index aef9ee10c..c3c720563 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Events/RegisterUserEvent.cs +++ b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.Extensions.Events; +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; public record RegisterUserEvent : Event { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Middleware/LoggingMiddleware.cs b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs similarity index 88% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Middleware/LoggingMiddleware.cs rename to src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs index edb4fe3fb..9aed0a5bf 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Extensions/Middleware/LoggingMiddleware.cs +++ b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.Extensions.Middleware; +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Middleware; public class LoggingMiddleware : Middleware where TEvent : notnull, IEvent { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj similarity index 85% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj rename to src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj index f549a7ca6..075382f3f 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.csproj +++ b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Program.cs b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs similarity index 88% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Program.cs rename to src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs index 32266acee..e1b4af502 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/Program.cs +++ b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests; +namespace Masa.Contrib.Dispatcher.Events.Benchmarks; class Program { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/_Imports.cs b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs similarity index 78% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/_Imports.cs rename to src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs index 44ae67ddd..cb2ba6dbc 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests/_Imports.cs +++ b/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs @@ -8,8 +8,8 @@ global using BenchmarkDotNet.Running; global using BenchmarkDotNet.Validators; global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.Extensions.EventHandlers; -global using Masa.Contrib.Dispatcher.Events.BenchmarkDotnet.Tests.Extensions.Events; +global using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; +global using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; global using Masa.Contrib.Dispatcher.Events.Enums; global using MediatR; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs index 60870a180..5fea19f73 100644 --- a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs +++ b/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs @@ -14,3 +14,4 @@ global using System.Linq.Expressions; global using System.Reflection; global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; +global using System.Runtime.CompilerServices; diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/KafkaOptions.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs similarity index 82% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/KafkaOptions.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs index 2434ce0cf..376df7c4a 100644 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/KafkaOptions.cs +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests; +namespace Masa.Contrib.Configuration.AutoMap.Tests; public class KafkaOptions : LocalMasaConfigurationOptions { diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests.csproj rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj deleted file mode 100644 index fe17a392b..000000000 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - - - diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/MountSectionRedisOptions.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/MountSectionRedisOptions.cs deleted file mode 100644 index 127825e9f..000000000 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/MountSectionRedisOptions.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests; - -public class MountSectionRedisOptions : ConfigurationApiMasaConfigurationOptions -{ - public override string AppId => "Test"; -} diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/_Imports.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/_Imports.cs deleted file mode 100644 index 9b4cbcf83..000000000 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/_Imports.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs similarity index 60% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/_Imports.cs rename to src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs index e3720125e..e4b10e038 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/_Imports.cs +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs @@ -1,4 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Microsoft.Extensions.DependencyInjection; +namespace Masa.Contrib.Configuration.Tests.Config; + +public class MountSectionRedisOptions +{ + +} diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs index 9d0eb461c..8c3d6da3a 100644 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs @@ -1,6 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Masa.Contrib.Configuration.AutoMap.Tests; + namespace Masa.Contrib.Configuration.Tests; [TestClass] @@ -42,7 +44,7 @@ public void TestAddJsonFileShouldReturnRabbitMqOptionAndSystemOptionsExist() var serviceProvider = builder.Services.BuildServiceProvider(); var rabbitMqOptions = serviceProvider.GetRequiredService>(); Assert.IsTrue(rabbitMqOptions is - { Value.HostName: "localhost", Value.UserName: "admin", Value.Password: "admin", Value.VirtualHost: "/", Value.Port: "5672" }); + { Value.HostName: "localhost", Value.UserName: "admin", Value.Password: "admin", Value.VirtualHost: "/", Value.Port: "5672" }); var systemOptions = serviceProvider.GetRequiredService>(); Assert.IsTrue(systemOptions is { Value.Name: "Masa TEST" }); @@ -77,7 +79,7 @@ public void TestManuallyMappingShouldReturnRedisExist() var serviceProvider = builder.Services.BuildServiceProvider(); var rabbitMqOptions = serviceProvider.GetRequiredService>(); Assert.IsTrue(rabbitMqOptions is - { Value.HostName: "localhost", Value.UserName: "admin", Value.Password: "admin", Value.VirtualHost: "/", Value.Port: "5672" }); + { Value.HostName: "localhost", Value.UserName: "admin", Value.Password: "admin", Value.VirtualHost: "/", Value.Port: "5672" }); var systemOptions = serviceProvider.GetRequiredService>(); Assert.IsTrue(systemOptions is { Value.Name: "Masa TEST" }); @@ -142,7 +144,7 @@ public void TestAutoMapSectionErrorShouldThrowException() builder.Configuration.AddConfiguration(chainedConfiguration.Build()); Assert.ThrowsException(() - => builder.AddMasaConfiguration(typeof(ConfigurationTest).Assembly, typeof(KafkaOptions).Assembly) + => builder.AddMasaConfiguration() , $"Check if the mapping section is correct,section name is [{It.IsAny()}]"); } @@ -169,8 +171,12 @@ public void TestSpecifyAssembliesShouldThrowException() Assert.ThrowsException(() => { return builder.AddMasaConfiguration(configurationBuilder => - configurationBuilder.AddJsonFile("redis.json", true, true), - typeof(ConfigurationTest).Assembly, typeof(MountSectionRedisOptions).Assembly); + { + configurationBuilder + .AddJsonFile("rabbitMq.json", true, true) + .AddJsonFile("redis.json", true, true); + configurationBuilder.UseMasaOptions(option => option.MappingConfigurationApi("Test")); + }); }, $"Check if the mapping section is correct,section name is [{It.IsAny()}]"); } diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj index 2791c5711..a1ba1d7c7 100644 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj @@ -21,7 +21,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + @@ -40,12 +40,11 @@ Always - + - - + diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/_Imports.cs b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/_Imports.cs index 350e1e75e..6cfdf19bb 100644 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/_Imports.cs +++ b/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/_Imports.cs @@ -3,8 +3,6 @@ global using Masa.BuildingBlocks.Configuration; global using Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests; -global using Masa.Contrib.Configuration.ErrorSectionAutoMap.Tests; -global using Masa.Contrib.Configuration.MountErrorSectionAutoMap.Tests; global using Masa.Contrib.Configuration.Tests.Config; global using Microsoft.AspNetCore.Builder; global using Microsoft.Extensions.Configuration; diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/DistributedBenchmarks.cs b/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/DistributedBenchmarks.cs deleted file mode 100644 index f0935150d..000000000 --- a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests/DistributedBenchmarks.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.BenchmarkDotnet.Tests; - -/// -/// Only supports the use of Redis environment -/// -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 1000)] -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 10000)] -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100000)] -[MinColumn, MaxColumn, MeanColumn, MedianColumn] -public class DistributedBenchmarks -{ - // private IIdGenerator _idGenerator; - - // [GlobalSetup] - // public void GlobalSetup() - // { - // IServiceCollection services = new ServiceCollection(); - // services.AddMasaRedisCache(opt => - // { - // opt.Password = ""; - // opt.DefaultDatabase = 2; - // opt.Servers = new List() - // { - // new("127.0.0.1", 6379) - // }; - // }); - // services.AddSnowflake(options => - // { - // options.UseRedis(); - // options.EnableMachineClock = true; - // }); - // var serviceProvider = services.BuildServiceProvider(); - // _idGenerator = serviceProvider.GetRequiredService>(); - // _idGenerator.NewId(); - // } - // - // [Benchmark] - // public void Distributed() - // { - // _idGenerator.NewId(); - // } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/RegisterUserDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/RegisterUserDomainEvent.cs deleted file mode 100644 index c48ae9589..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/RegisterUserDomainEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Entities.Tests.DomainEvents; - -public record RegisterUserDomainEvent : DomainEvent -{ - public Guid Id { get; set; } - - public string Name { get; set; } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/UpdateUserDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/UpdateUserDomainEvent.cs deleted file mode 100644 index fca8a0570..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/DomainEvents/UpdateUserDomainEvent.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Entities.Tests.DomainEvents; - -/// -/// todo: It doesn't make sense to send events just for the test loop -/// -public record UpdateUserDomainEvent : DomainEvent -{ - public Guid Id { get; set; } - - public string Name { get; set; } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Events/RegisterUserEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Events/RegisterUserEvent.cs deleted file mode 100644 index 4b35b967a..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Events/RegisterUserEvent.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Entities.Tests.Events; - -public record RegisterUserEvent : DomainEvent -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - public bool IsSendDomainEvent { get; set; } = true; -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj deleted file mode 100644 index 6abf2488b..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/Masa.Contrib.Ddd.Domain.Entities.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/User.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/User.cs deleted file mode 100644 index 0d51b45f9..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/User.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.Ddd.Domain.Entities.Tests.Events; - -namespace Masa.Contrib.Ddd.Domain.Entities.Tests; - -public class User : AggregateRoot -{ - public string Name { get; set; } - - public User() - { - Id = Guid.NewGuid(); - } - - public User(Guid id, string name, bool isSendDomainEvent) - { - Id = id; - Name = name; - if (isSendDomainEvent) - { - this.AddDomainEvent(new RegisterUserDomainEvent() - { - Id = Id, - Name = name - }); - } - } - - public void UpdateName(string name) - { - this.Name = name; - this.AddDomainEvent(new UpdateUserDomainEvent() - { - Id = Id, - Name = name - }); - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/_Imports.cs deleted file mode 100644 index 12ba3224b..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Entities.Tests/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.Contrib.Ddd.Domain.Entities.Tests.DomainEvents; diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/CustomDbContext.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/CustomDbContext.cs deleted file mode 100644 index 8272e9dc7..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/CustomDbContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Integrated.Tests; - -public class CustomDbContext : MasaDbContext -{ - public DbSet User { get; set; } - - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/DomainEventTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/DomainEventTest.cs deleted file mode 100644 index f59257e89..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/DomainEventTest.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Integrated.Tests; - -[TestClass] -public class DomainEventTest -{ - private IServiceProvider _serviceProvider; - - [TestInitialize] - public void Initialize() - { - IServiceCollection services = new ServiceCollection(); - services.Configure(options => - { - options.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = $"Data Source=test_{Guid.NewGuid()}" - }; - }); - services.AddDomainEventBus(dispatchOptions => - { - dispatchOptions - .UseIntegrationEventBus(options => - { - options.UseDapr(); - options.UseEventLog(); - }) - .UseEventBus() - .UseUoW(dbOptions => dbOptions.UseSqlite()) - .UseRepository(); - }); - _serviceProvider = services.BuildServiceProvider(); - } - - [TestMethod] - public async Task TestInsertAsyncReturnUserNameEqualTom() - { - var services = new ServiceCollection(); - services.AddDomainEventBus(dispatcherOptions => - { - dispatcherOptions - .UseIntegrationEventBus(options => - { - options.UseDapr(); - options.UseEventLog(); - }) - .UseEventBus() - .UseUoW(dbOptions => dbOptions.UseTestSqlite($"data source=test-{Guid.NewGuid()}")) - .UseRepository(); - }); - var serviceProvider = services.BuildServiceProvider(); - var dbContext = serviceProvider.GetRequiredService(); - await dbContext.Database.EnsureCreatedAsync(); - var eventBus = serviceProvider.GetRequiredService(); - var @event = new RegisterUserEvent() - { - Id = Guid.NewGuid(), - Name = "Jim" - }; - await eventBus.PublishAsync(@event); - - var user = await dbContext.Set().Where(u => u.Id == @event.Id).AsNoTracking().FirstOrDefaultAsync(); - Assert.IsNotNull(user); - Assert.IsTrue(user.Name == "Tom2"); - } - - [TestMethod] - public async Task TestPublishMultiCommandReturnDataIs2() - { - var dbContext = _serviceProvider.GetRequiredService(); - await dbContext.Database.EnsureCreatedAsync(); - var eventBus = _serviceProvider.GetRequiredService(); - - var @event = new RegisterUserEvent() - { - Id = Guid.NewGuid(), - Name = "Jim1", - IsSendDomainEvent = false - }; - await eventBus.PublishAsync(@event); - - @event = new RegisterUserEvent() - { - Id = Guid.NewGuid(), - Name = "Jim2", - IsSendDomainEvent = false - }; - await eventBus.PublishAsync(@event); - - Assert.IsTrue(dbContext.Set().Count() == 2); - } - - [TestMethod] - public async Task TestPublishMultiCommandReturnDataIs1() - { - var dbContext = _serviceProvider.GetRequiredService(); - await dbContext.Database.EnsureCreatedAsync(); - var eventBus = _serviceProvider.GetRequiredService(); - - var @event = new RegisterUserEvent() - { - Id = Guid.NewGuid(), - Name = "error", - IsSendDomainEvent = false - }; - await Assert.ThrowsExceptionAsync(async () => await eventBus.PublishAsync(@event), "custom exception"); - - @event = new RegisterUserEvent() - { - Id = Guid.NewGuid(), - Name = "Jim2", - IsSendDomainEvent = false - }; - await eventBus.PublishAsync(@event); - - Assert.IsTrue(dbContext.Set().Count() == 1); - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Handlers/UserHandler.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Handlers/UserHandler.cs deleted file mode 100644 index 8e1eecf9d..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Handlers/UserHandler.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Integrated.Tests.Handlers; - -public class UserHandler -{ - private readonly IRepository _repository; - - public UserHandler(IRepository repository) - => _repository = repository; - - [EventHandler] - public async Task RegisterUser(RegisterUserEvent @event) - { - var user = new User(@event.Id, @event.Name,@event.IsSendDomainEvent); - await _repository.AddAsync(user); - - if (user.Name.Contains("error")) - { - throw new Exception("custom exception");// Throwing exceptions manually - } - } - - /// - /// todo: Event sequence is sent only for testing aggregate root - /// - [EventHandler] - public async Task RegisterUserByDomainEvent(RegisterUserDomainEvent @event) - { - var user = await _repository.FindAsync(@event.Id); - if (user != null) - { - user.UpdateName("Tom"); - await _repository.UpdateAsync(user); - } - } - - [EventHandler] - public async Task UpdateUser(UpdateUserDomainEvent @event) - { - var user = await _repository.FindAsync(@event.Id); - if (user != null && user.Name == "Tom") - { - user.Name = "Tom2"; - await _repository.UpdateAsync(user); - } - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj deleted file mode 100644 index f72e01398..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/Masa.Contrib.Ddd.Domain.Integrated.Tests.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/_Imports.cs deleted file mode 100644 index 068367831..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Integrated.Tests/_Imports.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.UoW.EF; -global using Masa.Contrib.Ddd.Domain.Entities.Tests; -global using Masa.Contrib.Ddd.Domain.Entities.Tests.DomainEvents; -global using Masa.Contrib.Ddd.Domain.Entities.Tests.Events; -global using Masa.Contrib.Ddd.Domain.Repository.EF; -global using Masa.Contrib.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System; diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Entities/User.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Entities/User.cs deleted file mode 100644 index 124317760..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Entities/User.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.Entities; - -public class User : AggregateRoot -{ - public string Name { get; set; } - - public bool Gender { get; set; } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj deleted file mode 100644 index 745b2b5ed..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Repositories/IUserRepository.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Repositories/IUserRepository.cs deleted file mode 100644 index e348592c2..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/Repositories/IUserRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.Repositories; - -public interface IUserRepository : IRepository -{ - -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/_Imports.cs deleted file mode 100644 index 87965649d..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.Entities; diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/BaseRepositoryTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/BaseRepositoryTest.cs deleted file mode 100644 index 742cbc573..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/BaseRepositoryTest.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests; - -[TestClass] -public class BaseRepositoryTest : TestBase -{ - private IServiceCollection _services = default!; - private Assembly[] _assemblies; - private Mock _uoW; - private Mock _dispatcherOptions = default!; - - [TestInitialize] - public void Initialize() - { - _services = new ServiceCollection(); - _assemblies = new Assembly[1] - { - typeof(BaseRepositoryTest).Assembly - }; - _uoW = new(); - _dispatcherOptions = new(); - _dispatcherOptions.Setup(options => options.Services).Returns(() => _services); - } - - [TestMethod] - public void TestNullServices() - { - Assert.ThrowsException(() => - { - _dispatcherOptions.Setup(options => options.Services).Returns(() => null!); - var options = _dispatcherOptions.Object.UseRepository(); - }); - } - - [TestMethod] - public void TestUseCustomRepositoryAndNotImplementation() - { - Mock uoW = new(); - _services.AddScoped(_ => uoW.Object); - - Assembly[] assemblies = { typeof(TestBase).Assembly, typeof(IUserRepository).Assembly }; - _dispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies).Verifiable(); - Assert.ThrowsException(() - => _dispatcherOptions.Object.UseRepository() - ); - } - - [TestMethod] - public void TestNullUnitOfWork() - { - _dispatcherOptions.Setup(option => option.Assemblies).Returns(_assemblies).Verifiable(); - var ex = Assert.ThrowsException(() => - { - _dispatcherOptions.Object.UseRepository(); - }); - Assert.IsTrue(ex.Message == "Please add UoW first."); - } - - [TestMethod] - public void TestNullAssembly() - { - _services.AddScoped(typeof(IUnitOfWork), _ => _uoW.Object); - _services.AddDbContext(options => options.UseSqlite(Connection)); - - Assert.ThrowsException(() => - { - _dispatcherOptions.Object.UseRepository(); - }); - } - - [TestMethod] - public void TestAddMultRepository() - { - _dispatcherOptions.Setup(option => option.Assemblies).Returns(_assemblies).Verifiable(); - _services.AddScoped(typeof(IUnitOfWork), _ => _uoW.Object); - _services.AddMasaDbContext(options => options.UseSqlite(Connection)); - _dispatcherOptions.Object.UseRepository().UseRepository(); - - var serviceProvider = _services.BuildServiceProvider(); - var repository = serviceProvider.GetServices>(); - Assert.IsTrue(repository.Count() == 1); - } - - [TestMethod] - public void TestEntityRepositoryShouldBeExist() - { - _dispatcherOptions.Setup(option => option.Assemblies).Returns(_assemblies).Verifiable(); - _services.AddScoped(typeof(IUnitOfWork), _ => _uoW.Object); - _services.AddMasaDbContext(options => options.UseTestSqlite(Connection)); - _dispatcherOptions.Object.UseRepository().UseRepository(); - - var serviceProvider = _services.BuildServiceProvider(); - var repository = serviceProvider.GetServices>(); - Assert.IsTrue(repository.Count() == 1); - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Repositories/IOrderRepository.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Repositories/IOrderRepository.cs deleted file mode 100644 index 070c1a005..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Repositories/IOrderRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Repositories; - -public interface IOrderRepository : IRepository -{ - Task AddAsync(Orders order); -} - -public interface ICustomOrderRepository : IRepository -{ - -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/CustomDbContext.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/CustomDbContext.cs deleted file mode 100644 index 607af5cc7..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/CustomDbContext.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Infrastructure; - -public class CustomDbContext : MasaDbContext -{ - public DbSet Orders { get; set; } - - public CustomDbContext(MasaDbContextOptions options) : base(options) { } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/Repositories/OrderRepository.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/Repositories/OrderRepository.cs deleted file mode 100644 index 88a79437d..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Infrastructure/Repositories/OrderRepository.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Infrastructure.Repositories; - -public class OrderRepository : Repository, IOrderRepository -{ - public OrderRepository(CustomDbContext context, IUnitOfWork unitOfWork) : base(context, unitOfWork) - { - } - - public async Task AddAsync(Orders order) - { - try - { - if (UnitOfWork.UseTransaction) - _ = base.UnitOfWork.Transaction; - - await base.AddAsync(order, default); - await base.UnitOfWork.SaveChangesAsync(); - await base.UnitOfWork.CommitAsync(); - } - catch (Exception) - { - if (UnitOfWork.UseTransaction) - await base.UnitOfWork.RollbackAsync(); - } - } -} - -public class CustomOrderRepository : Repository, ICustomOrderRepository -{ - public CustomOrderRepository(CustomDbContext context, IUnitOfWork unitOfWork) : base(context, unitOfWork) - { - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj index 205d9be33..227f5d15f 100644 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj +++ b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -8,10 +8,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - @@ -22,11 +18,8 @@ - - - - - - + + + diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs index 74f5ea469..5c71a7669 100644 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs +++ b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs @@ -1,592 +1,232 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests; [TestClass] -public class RepositoryTest : TestBase +public class RepositoryTest { - private IServiceCollection _services = default!; - private Assembly[] _assemblies; - private Mock _dispatcherOptions = default!; - private CustomDbContext _dbContext; - private UnitOfWork _uoW; - [TestInitialize] - public async Task InitializeAsync() + public void Initialize() { - await InitializeAsync(null); } - public async Task InitializeAsync(Action? action) + [TestMethod] + public async Task TestAddRangeReturnEntityStateEqualChangedAsync() { - _services = new ServiceCollection(); - _assemblies = new[] - { - typeof(BaseRepositoryTest).Assembly - }; - _dispatcherOptions = new Mock(); - _dispatcherOptions.Setup(options => options.Services).Returns(() => _services); - _dispatcherOptions.Setup(options => options.Assemblies).Returns(() => _assemblies); - if (action == null) - _services.AddMasaDbContext(options => options.UseTestSqlite(Connection)); - else - action.Invoke(_services); - - var serviceProvider = _services.BuildServiceProvider(); - _dbContext = serviceProvider.GetRequiredService(); - await _dbContext.Database.EnsureCreatedAsync(); - _uoW = new UnitOfWork(serviceProvider); - _dispatcherOptions.Object.UseUoW(); - } + Mock dbContext = new(); + dbContext + .Setup(context => context.AddRangeAsync(It.IsAny(), default)) + .Verifiable(); - private async Task> InitDataAsync() - { - _dispatcherOptions.Object.UseRepository(); + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - var serviceProvider = _services.BuildServiceProvider(); - var orders = new List + var orders = new List() { - new(1) - { - OrderNumber = 9999999, - Description = "Apple" - }, - new(2) - { - OrderNumber = 9999999, - Description = "HuaWei" - } + new(9999) }; - - var repository = serviceProvider.GetRequiredService>(); await repository.AddRangeAsync(orders); - await repository.UnitOfWork.SaveChangesAsync(); - return repository; - } - - private async Task> InitDataAndReturnRepositoryAsync() - { - _dispatcherOptions.Object.UseRepository(); - - var serviceProvider = _services.BuildServiceProvider(); - var orders = new List - { - new(1) - { - OrderNumber = 9999999, - Description = "Apple" - }, - new(2) - { - OrderNumber = 9999999, - Description = "HuaWei" - } - }; - - var repository = serviceProvider.GetRequiredService>(); - await repository.AddRangeAsync(orders); - await repository.UnitOfWork.SaveChangesAsync(); - return repository; - } - - [TestMethod] - public async Task TestAddAsync() - { - var repository = await InitDataAsync(); - - var orderList = await repository.GetListAsync(order => order.OrderNumber == 9999999); - Assert.IsNotNull(orderList); - Assert.IsTrue(orderList.Count() == 2); - - Assert.IsTrue(await repository.GetCountAsync(order => order.Description == "Apple") == 1); - } - - [TestMethod] - public async Task TestRemoveAsync() - { - var repository = await InitDataAsync(); - - await repository.AddAsync(new Orders(3) - { - OrderNumber = 9999997, - Description = "Google" - }); - await repository.AddAsync(new Orders(4) - { - OrderNumber = 9999996, - Description = "Microsoft" - }); - await repository.RemoveAsync(order => order.Description == "Apple"); - await repository.UnitOfWork.SaveChangesAsync(); - Assert.IsTrue(await repository.GetCountAsync() == 3); - - var order = await repository.FindAsync( - new List> - { - new(nameof(Orders.Description), "Google") - }); - await repository.RemoveAsync(order!); - await repository.UnitOfWork.SaveChangesAsync(); - Assert.IsTrue(await repository.GetCountAsync(order => order.Description == "Google") == 0); - } - - [TestMethod] - public async Task TestRemoveRangeAsync() - { - var repository = await InitDataAsync(); - - Assert.IsTrue(await repository.GetCountAsync() == 2); - - var remainingOrders = await repository.GetListAsync(); - await repository.RemoveRangeAsync(remainingOrders); - await repository.UnitOfWork.SaveChangesAsync(); - - Assert.IsTrue(await repository.GetCountAsync() == 0); + dbContext.Verify(context => context.AddRangeAsync(It.IsAny>(), default), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); } [TestMethod] - public async Task TestGetPaginatedListAsync() + public async Task TestAddRangeAndUseTransactionReturnEntityStateEqualChangedAsync() { - _dispatcherOptions.Object.UseRepository(); - var serviceProvider = _services.BuildServiceProvider(); - var customOrderRepository = serviceProvider.GetRequiredService(); + Mock dbContext = new(); + dbContext + .Setup(context => context.AddRangeAsync(It.IsAny(), default)) + .Verifiable(); - var orders = new List - { - new(1) - { - Description = "HuaWei", - OrderNumber = 20220228 - }, - new(2) - { - Description = "Microsoft", - OrderNumber = 20220227 - }, - new(3) - { - Description = "Apple", - OrderNumber = 20220227 - } - }; - await customOrderRepository.AddRangeAsync(orders); - await customOrderRepository.UnitOfWork.SaveChangesAsync(); - - var sorting = new Dictionary( - new List> - { - new("OrderNumber", true), - new("Description", false) - }); - var list = await customOrderRepository.GetPaginatedListAsync( - 0, - 10, - sorting); - Assert.IsTrue(list[0].Id == 1); - Assert.IsTrue(list[1].Id == 3); - Assert.IsTrue(list[2].Id == 2); - - sorting = new Dictionary( - new List> - { - new("OrderNumber", false), - new("Description", true) - }); - list = await customOrderRepository.GetPaginatedListAsync( - order => order.Id != 3, - 0, - 10, - sorting); - Assert.IsTrue(list[0].Id == 2); - Assert.IsTrue(list[1].Id == 1); - - list = await customOrderRepository.GetPaginatedListAsync( - order => order.Id != 3, - 0, - 10); - Assert.IsTrue(list[0].Id == 1); //If you do not specify a sort value, the database will sort by default - Assert.IsTrue(list[1].Id == 2); - - list = await customOrderRepository.GetPaginatedListAsync(0, 10); - Assert.IsTrue(list[0].Id == 1); //If you do not specify a sort value, the database will sort by default - Assert.IsTrue(list[1].Id == 2); - } + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); - [TestMethod] - public async Task TestTranscationFailedAsync() - { - _dispatcherOptions.Object.UseRepository(); - var serviceProvider = _services.BuildServiceProvider(); - var repository = serviceProvider.GetRequiredService(); - var order = new Orders(1) + var orders = new List() { - OrderNumber = 1 + new(9999) }; - await repository.AddAsync(order); - Assert.IsTrue(await repository.GetCountAsync() == 0); - } - - [TestMethod] - public async Task TestTranscationSucceededAsync() - { - _dispatcherOptions.Object.UseRepository(); - var serviceProvider = _services.BuildServiceProvider(); - var repository = serviceProvider.GetRequiredService(); - var order = new Orders(1) - { - OrderNumber = 1, - Description = "Apple" - }; - await repository.AddAsync(order); - Assert.IsTrue(await repository.GetCountAsync() == 1); + await repository.AddRangeAsync(orders); + dbContext.Verify(context => context.AddRangeAsync(It.IsAny>(), default), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); } [TestMethod] - public async Task TestUpdateAsync() + public async Task TestUpdateRangeReturnEntityStateEqualChangedAsync() { - await InitializeAsync(services => - services.AddMasaDbContext(options => - { - options.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseSqlite(Connection) - .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); - })); - - _dispatcherOptions.Object.UseRepository(); - var serviceProvider = _services.BuildServiceProvider(); - var dbContext = serviceProvider.GetRequiredService(); + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().UpdateRange(It.IsAny>())) + .Verifiable(); - var repository = serviceProvider.GetRequiredService(); + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - var order = new Orders(1) + var orders = new List() { - OrderNumber = 1, - Description = "Apple" + new(9999) }; - await repository.AddAsync(order, default); - await repository.UnitOfWork.SaveChangesAsync(); - dbContext.Entry(order).State = Microsoft.EntityFrameworkCore.EntityState.Detached; - - order = await repository.FindAsync(order => order.Description == "Apple"); - order!.Description = "Apple Company"; - await repository.UnitOfWork.SaveChangesAsync(); - - order = await repository.FindAsync(order => order.Description == "Apple"); - Assert.IsNotNull(order); - - await repository.UpdateAsync(order); - await repository.UnitOfWork.SaveChangesAsync(); - dbContext.Entry(order).State = Microsoft.EntityFrameworkCore.EntityState.Detached; - Assert.IsTrue(await repository.GetCountAsync() == 1); - - order = await repository.FindAsync(order => order.Description == "Apple"); - Assert.IsNotNull(order); - - order.Description = "Apple Company"; - await repository.UpdateRangeAsync(new List - { order }); - await repository.UnitOfWork.SaveChangesAsync(); - - dbContext.Entry(order).State = Microsoft.EntityFrameworkCore.EntityState.Detached; - - order = await repository.FindAsync(order => order.Description == "Apple"); - Assert.IsNull(order); - } - - [TestMethod] - public async Task TestFindAsync() - { - await InitDataAsync(); - var repository = _services.BuildServiceProvider() - .GetRequiredService>(); - - var order = await repository.FindAsync(2); - Assert.IsNotNull(order); - Assert.IsTrue(order.Description == "HuaWei"); - } - - [TestMethod] - public void TestCustomOrderRepository() - { - _dispatcherOptions.Object.UseRepository(); - - var serviceProvider = _services.BuildServiceProvider(); - var customOrderRepository = serviceProvider.GetService(); - Assert.IsNotNull(customOrderRepository); + await repository.UpdateRangeAsync(orders); + dbContext.Verify(context => context.Set().UpdateRange(It.IsAny>()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); } [TestMethod] - public async Task TestEntityStateAsync() + public async Task TestUpdateRangeAndUseTransactionReturnEntityStateEqualChangedAsync() { - var repository = new Repository(_dbContext, _uoW); - Assert.IsTrue(repository.EntityState == Masa.BuildingBlocks.Data.UoW.EntityState.UnChanged); + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().UpdateRange(It.IsAny>())) + .Verifiable(); - await repository.AddAsync(new Orders(9999) - { - Description = "HuaWei" - }); - Assert.IsTrue(repository.EntityState == BuildingBlocks.Data.UoW.EntityState.Changed); - await repository.UnitOfWork.SaveChangesAsync(); - Assert.IsTrue(repository.EntityState == BuildingBlocks.Data.UoW.EntityState.UnChanged); - } - - [TestMethod] - public async Task TestCommitStateAsync() - { - var repository = new Repository(_dbContext, _uoW); - Assert.IsTrue(repository.CommitState == CommitState.Commited); - - await repository.AddAsync(new Orders(9999) - { - Description = "HuaWei" - }); - Assert.IsTrue(repository.CommitState == CommitState.UnCommited); - await repository.UnitOfWork.SaveChangesAsync(); - Assert.IsTrue(repository.CommitState == CommitState.UnCommited); - await repository.UnitOfWork.CommitAsync(); - Assert.IsTrue(repository.CommitState == CommitState.Commited); - } - - [TestMethod] - public async Task TestCommitStateAndNotUseTransactionAsync() - { - _uoW.UseTransaction = false; - var repository = new Repository(_dbContext, _uoW); - Assert.IsTrue(repository.CommitState == CommitState.Commited); - - await repository.AddAsync(new Orders(9999) - { - Description = "HuaWei" - }); - Assert.IsTrue(repository.CommitState == CommitState.Commited); - await repository.UnitOfWork.SaveChangesAsync(); - Assert.IsTrue(repository.CommitState == CommitState.Commited); - - var order = await repository.GetCountAsync(o => o.Id == 9999); - Assert.IsNotNull(order); - } - - [TestMethod] - public async Task TestServiceLifeAsync() - { - var services = new ServiceCollection(); - services.AddMasaDbContext(options => options.UseTestSqlite(Connection)); - var serviceProvider = services.BuildServiceProvider(); + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); - await using (var scope = serviceProvider.CreateAsyncScope()) + var orders = new List() { - var dbContext = scope.ServiceProvider.GetRequiredService(); - var uow = new UnitOfWork(scope.ServiceProvider); - var repository = new Repository(dbContext, uow); - await repository.AddAsync(new Orders(1) - { - Description = "HuaWei" - }); - await repository.UnitOfWork.SaveChangesAsync(); - Assert.IsTrue(await repository.GetCountAsync() == 1); - } - } - - [TestMethod] - public async Task TestGetPaginatedListByAscAsyncReturnFirstOrderIdIs1() - { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) - { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); - - var paginatedList = await repository.GetPaginatedListAsync(0, 2, "Id", false); - Assert.IsTrue(paginatedList.Count == 2 && paginatedList.First().Id == 1); + new(9999) + }; + await repository.UpdateRangeAsync(orders); + dbContext.Verify(context => context.Set().UpdateRange(It.IsAny>()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); } [TestMethod] - public async Task TestGetPaginatedListByDescAsyncReturnFirstOrderIdIs3() + public async Task TestUpdateReturnEntityStateEqualChangedAsync() { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) - { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().Update(It.IsAny())) + .Verifiable(); - var paginatedList = await repository.GetPaginatedListAsync(0, 2, "Id"); - Assert.IsTrue(paginatedList.Count == 2 && paginatedList.First().Id == 3); - } - - [TestMethod] - public async Task TestGetPaginatedListByIdGreatherThan1AndAscAsyncReturnFirstOrderIdIs2() - { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) - { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - var paginatedList = await repository.GetPaginatedListAsync(o => o.Id > 1, 0, 2, "Id", false); - Assert.IsTrue(paginatedList.Count == 2 && paginatedList.First().Id == 2); + var order = new Orders(999); + await repository.UpdateAsync(order); + dbContext.Verify(context => context.Set().Update(It.IsAny()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); } [TestMethod] - public async Task TestGetPaginatedListByIdGreatherThan1AndDescAsyncReturnFirstOrderIdIs3() + public async Task TestUpdateAndUseTransactionReturnEntityStateEqualChangedAsync() { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) - { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); - - var paginatedList = await repository.GetPaginatedListAsync(o => o.Id > 1, 0, 2, "Id"); - Assert.IsTrue(paginatedList.Count == 2 && paginatedList.First().Id == 3); - } + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().Update(It.IsAny())) + .Verifiable(); - [TestMethod] - public async Task TestGetPaginatedListByOptionsAsyncReturnFirstOrderIdIs1() - { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) - { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); - var paginatedList = await repository.GetPaginatedListAsync(new PaginatedOptions(1, 1, "Id", false)); - Assert.IsTrue(paginatedList is { Total: 3 } && paginatedList.Result.First().Id == 1); + var order = new Orders(999); + await repository.UpdateAsync(order); + dbContext.Verify(context => context.Set().Update(It.IsAny()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); } - [TestMethod] - public async Task TestGetPaginatedListByOptionsAndDescAsyncReturnFirstOrderIdIs2() + public async Task TestRemoveRangeReturnEntityStateEqualChangedAsync() { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) - { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().RemoveRange(It.IsAny>())) + .Verifiable(); - var paginatedList = await repository.GetPaginatedListAsync(new PaginatedOptions(2, 1, "Id", true)); - Assert.IsTrue(paginatedList is { Total: 3 } && paginatedList.Result.First().Id == 2); - } + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - [TestMethod] - public async Task TestGetPaginatedListByIdGreatherThen2AsyncReturnFirstOrderIdIs2AndCountIs2() - { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) + var orders = new List() { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); - - var paginatedList = await repository.GetPaginatedListAsync(o => o.Id > 1, new PaginatedOptions(2, 1, "Id")); - Assert.IsTrue(paginatedList is { Total: 2 } && paginatedList.Result.First().Id == 2); + new(9999) + }; + await repository.RemoveRangeAsync(orders); + dbContext.Verify(context => context.Set().RemoveRange(It.IsAny>()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); } [TestMethod] - public async Task TestGetListByDescAsyncReturnFirstOrderIdIs1() + public async Task TestRemoveRangeAndUseTransactionReturnEntityStateEqualChangedAsync() { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) - { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().RemoveRange(It.IsAny>())) + .Verifiable(); - var paginatedList = (await repository.GetListAsync("Id", false)).ToList(); - Assert.IsTrue(paginatedList.Count == 3 && paginatedList.First().Id == 1); - } + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); - [TestMethod] - public async Task TestGetListByAscAsyncReturnFirstOrderIdIs3() - { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) + var orders = new List() { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); - - var paginatedList = (await repository.GetListAsync("Id")).ToList(); - Assert.IsTrue(paginatedList.Count == 3 && paginatedList.First().Id == 3); + new(9999) + }; + await repository.RemoveRangeAsync(orders); + dbContext.Verify(context => context.Set().RemoveRange(It.IsAny>()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); } - [TestMethod] - public async Task TestGetListByIdGreatherThan1AndAscAsyncReturnFirstOrderIdIs2() - { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) - { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); - - var paginatedList = (await repository.GetListAsync(o => o.Id > 1, "Id", false)).ToList(); - Assert.IsTrue(paginatedList.Count == 2 && paginatedList.First().Id == 2); - } [TestMethod] - public async Task TestGetListByGreatherThan1AndDescAsyncReturnFirstOrderIdIs3() + public async Task TestRemoveReturnEntityStateEqualChangedAsync() { - var repository = await InitDataAsync(); - await repository.AddAsync(new Orders(3) - { - OrderNumber = 99998, - Description = "Microsoft" - }); - await repository.UnitOfWork.SaveChangesAsync(); + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().Remove(It.IsAny())) + .Verifiable(); - var paginatedList = (await repository.GetListAsync(o => o.Id > 1, "Id")).ToList(); - Assert.IsTrue(paginatedList.Count == 2 && paginatedList.First().Id == 3); - } + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - [TestMethod] - public void TestPaginatedOptionsConstructorAndSortingIsNullReturnSortingIsNull() - { - int page = 1; - int pageSize = 20; - var pageOptions = new PaginatedOptions(page, pageSize); - Assert.IsTrue(pageOptions.Sorting == null); + var order = new Orders(999); + await repository.RemoveAsync(order); + dbContext.Verify(context => context.Set().Remove(It.IsAny()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); } [TestMethod] - public void TestPaginatedOptionsConstructorReturnSortingCountIs1() + public async Task TestRemoveAndUseTransactionReturnEntityStateEqualChangedAsync() { - int page = 1; - int pageSize = 20; - var pageOptions = new PaginatedOptions(page, pageSize, "Id"); - Assert.IsTrue(pageOptions.Page == page && pageOptions.PageSize == pageSize && pageOptions.Sorting!.Count == 1); - } + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().Remove(It.IsAny())) + .Verifiable(); - [TestMethod] - public async Task TestRemoveIdEqual1ReturnCountIs1() - { - var repository = await InitDataAndReturnRepositoryAsync(); - await repository.RemoveAsync(1); - await repository.UnitOfWork.SaveChangesAsync(); - Assert.IsTrue(await repository.GetCountAsync() == 1); - } + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); - [TestMethod] - public async Task TestRemoveIdEqual1Or2ReturnCountIs0() - { - var repository = await InitDataAndReturnRepositoryAsync(); - await repository.RemoveRangeAsync(new[] { 1, 2 }); - await repository.UnitOfWork.SaveChangesAsync(); - Assert.IsTrue(await repository.GetCountAsync() == 0); + var order = new Orders(999); + await repository.RemoveAsync(order); + dbContext.Verify(context => context.Set().Remove(It.IsAny()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); } } diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/TestBase.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/TestBase.cs deleted file mode 100644 index 93c20f4c9..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/TestBase.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests; - -public class TestBase : IDisposable -{ - protected readonly string ConnectionString = "DataSource=:memory:"; - protected readonly SqliteConnection Connection; - - protected TestBase() - { - Connection = new SqliteConnection(ConnectionString); - Connection.Open(); - } - - public void Dispose() - { - Connection.Close(); - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs index b76fd004d..74b5a26bc 100644 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs +++ b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs @@ -1,24 +1,16 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.BuildingBlocks.Ddd.Domain.Values; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.UoW.EF; -global using Masa.Contrib.Ddd.Domain.Repository.EF.CustomRepository.Tests.Repositories; -global using Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; -global using Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Repositories; -global using Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Infrastructure; -global using Microsoft.Data.Sqlite; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; global using System; global using System.Collections.Generic; global using System.Linq; global using System.Reflection; +global using Microsoft.EntityFrameworkCore; +global using Moq; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; +global using Masa.BuildingBlocks.Ddd.Domain.Values; +global using Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; +global using Masa.BuildingBlocks.Data.UoW; +global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs deleted file mode 100644 index 8b92262c7..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainEventBusTest.cs +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.Ddd.Domain.Entities.Tests; - -namespace Masa.Contrib.Ddd.Domain.Tests; - -[TestClass] -public class DomainEventBusTest -{ - private Assembly[] _defaultAssemblies = default!; - private IServiceCollection _services = default!; - private Mock _eventBus = default!; - private Mock _integrationEventBus = default!; - private Mock _uoW = default!; - private IOptions _dispatcherOptions = default!; - - [TestInitialize] - public void Initialize() - { - _defaultAssemblies = AppDomain.CurrentDomain.GetAssemblies(); - _services = new ServiceCollection(); - _eventBus = new(); - _integrationEventBus = new(); - _uoW = new(); - _dispatcherOptions = Microsoft.Extensions.Options.Options.Create(new Options.DispatcherOptions(new ServiceCollection(), _defaultAssemblies)); - } - - [TestMethod] - public void TestGetAllEventTypes() - { - var assemblies = AppDomain.CurrentDomain.GetAssemblies(); - var eventTypes = assemblies.SelectMany(assembly => assembly.GetTypes()) - .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)); - _eventBus.Setup(eventBus => eventBus.GetAllEventTypes()).Returns(() => eventTypes); - var domainEventBus = new DomainEventBus(_eventBus.Object, _integrationEventBus.Object, _uoW.Object, _dispatcherOptions); - - Assert.IsTrue(domainEventBus.GetAllEventTypes().Count() == eventTypes.Count(), ""); - } - - [TestMethod] - public async Task TestPublishDomainEventAsync() - { - var domainEventBus = new DomainEventBus(_eventBus.Object, _integrationEventBus.Object, _uoW.Object, _dispatcherOptions); - _eventBus.Setup(eventBus => eventBus.PublishAsync(It.IsAny())).Verifiable(); - - var domainEvent = new PaymentSucceededDomainEvent(new Random().Next(10000, 1000000).ToString()); - await domainEventBus.PublishAsync(domainEvent); - - _eventBus.Verify(eventBus => eventBus.PublishAsync(domainEvent), Times.Once, "PublishAsync is executed multiple times"); - _integrationEventBus.Verify(integrationEventBus => integrationEventBus.PublishAsync(domainEvent), Times.Never, "integrationEventBus should not be executed"); - Assert.IsTrue(domainEvent.UnitOfWork!.Equals(_uoW.Object)); - } - - [TestMethod] - public async Task TestPublishIntegrationDomainEventAsync() - { - var domainEventBus = new DomainEventBus(_eventBus.Object, _integrationEventBus.Object, _uoW.Object, _dispatcherOptions); - _integrationEventBus.Setup(integrationEventBus => integrationEventBus.PublishAsync(It.IsAny())).Verifiable(); - var integrationDomainEvent = new PaymentFailedIntegrationDomainEvent() - { - OrderId = new Random().Next(10000, 1000000).ToString() - }; - await domainEventBus.PublishAsync(integrationDomainEvent); - - _eventBus.Verify(eventBus => eventBus.PublishAsync(It.IsAny()), Times.Never, "eventBus should not be executed"); - _integrationEventBus.Verify(integrationEventBus => integrationEventBus.PublishAsync(It.IsAny()), Times.Once, " PublishAsync is executed multiple times"); - } - - [TestMethod] - public async Task TestPublishDomainCommandAsync() - { - _uoW.Setup(u => u.CommitAsync(default)).Verifiable(); - var domainEventBus = new DomainEventBus(_eventBus.Object, _integrationEventBus.Object, _uoW.Object, _dispatcherOptions); - _eventBus.Setup(eventBus => eventBus.PublishAsync(It.IsAny())) - .Callback((domainEvent) => - { - Mock> userRepository = new(); - var user = new User() - { - Name = "Jim" - }; - userRepository.Setup(repository => repository.AddAsync(It.IsAny(), CancellationToken.None)).Verifiable(); - domainEvent.UnitOfWork!.CommitAsync(); - }); - - var @command = new CreateProductDomainCommand() - { - Name = "Phone" - }; - await domainEventBus.PublishAsync(@command); - - _eventBus.Verify(eventBus => eventBus.PublishAsync(@command), Times.Once, "PublishAsync is executed multiple times"); - _uoW.Verify(u => u.CommitAsync(default), Times.Once); - } - - [TestMethod] - public void TestAddMultDomainEventBusAsync() - { - _services.AddScoped(_ => _eventBus.Object); - _services.AddScoped(_ => _integrationEventBus.Object); - _services.AddScoped(_ => _uoW.Object); - - _services.AddDomainEventBus(new[] { typeof(DomainEventBusTest).Assembly }).AddDomainEventBus(); - var serviceProvider = _services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - Assert.IsTrue(serviceProvider.GetServices>().Count() == 1); - } - - [TestMethod] - public void TestNotUseEventBus() - { - var ex = Assert.ThrowsException(() - => _services.AddDomainEventBus() - ); - Assert.IsTrue(ex.Message == "Please add EventBus first."); - } - - [TestMethod] - public void TestNotUseUnitOfWork() - { - var eventBus = new Mock(); - _services.AddScoped(_ => eventBus.Object); - - var ex = Assert.ThrowsException(() => - _services.AddDomainEventBus(new Assembly[1] { typeof(DomainEventBusTest).Assembly })); - Assert.IsTrue(ex.Message == "Please add UoW first."); - } - - [TestMethod] - public void TestNotUseIntegrationEventBus() - { - var services = new ServiceCollection(); - - var eventBus = new Mock(); - services.AddScoped(_ => eventBus.Object); - - var uoW = new Mock(); - services.AddScoped(_ => uoW.Object); - - var ex = Assert.ThrowsException(() - => services.AddDomainEventBus(new Assembly[1] { typeof(DomainEventBusTest).Assembly }) - ); - Assert.IsTrue(ex.Message == "Please add IntegrationEventBus first."); - } - - [TestMethod] - public void TestNotRepository() - { - var services = new ServiceCollection(); - - var eventBus = new Mock(); - services.AddScoped(_ => eventBus.Object); - - var uoW = new Mock(); - services.AddScoped(_ => uoW.Object); - - var integrationEventBus = new Mock(); - services.AddScoped(_ => integrationEventBus.Object); - - Assert.ThrowsException(() => - { - services.AddDomainEventBus(new Assembly[1] { typeof(User).Assembly }); - }); - } - - [TestMethod] - public void TestUserRepository() - { - var services = new ServiceCollection(); - - var eventBus = new Mock(); - services.AddScoped(_ => eventBus.Object); - - var uoW = new Mock(); - services.AddScoped(_ => uoW.Object); - - var integrationEventBus = new Mock(); - services.AddScoped(_ => integrationEventBus.Object); - - Mock> repository = new(); - services.AddScoped(_ => repository.Object); - services.AddDomainEventBus(new[] { typeof(User).Assembly, typeof(DomainEventBusTest).Assembly }); - } - - [TestMethod] - public async Task TestPublishQueueAsync() - { - var domainEvent = new PaymentSucceededDomainEvent("ef5f84db-76e4-4c79-9815-99a1543b6589"); - var integrationDomainEvent = new PaymentFailedIntegrationDomainEvent { OrderId = "d65c1a0c-6e44-40ce-9737-738fa1dcdab4" }; - - _eventBus - .Setup(eventBus => eventBus.PublishAsync(It.IsAny())) - .Callback(() => - { - _integrationEventBus.Verify(integrationEventBus => integrationEventBus.PublishAsync(integrationDomainEvent), Times.Never, "Sent in the wrong order"); - }); - - _integrationEventBus - .Setup(integrationEventBus => integrationEventBus.PublishAsync(It.IsAny())) - .Callback(() => - { - _eventBus.Verify(eventBus => eventBus.PublishAsync((IDomainEvent)domainEvent), Times.Once, "Sent in the wrong order"); - }); - - var uoW = new Mock(); - uoW.Setup(u => u.CommitAsync(default)).Verifiable(); - - var options = Microsoft.Extensions.Options.Options.Create(new Options.DispatcherOptions(_services, AppDomain.CurrentDomain.GetAssemblies())); - - var domainEventBus = new DomainEventBus(_eventBus.Object, _integrationEventBus.Object, uoW.Object, options); - - await domainEventBus.Enqueue(domainEvent); - await domainEventBus.Enqueue(integrationDomainEvent); - - await domainEventBus.PublishQueueAsync(); - - _eventBus.Verify(eventBus => eventBus.PublishAsync((IDomainEvent)domainEvent), Times.Once, "Sent in the wrong order"); - _integrationEventBus.Verify(integrationEventBus => integrationEventBus.PublishAsync(integrationDomainEvent), Times.Never, "Sent in the wrong order"); - } - - [TestMethod] - public async Task TestPublishDomainQueryAsync() - { - var services = new ServiceCollection(); - - var eventBus = new Mock(); - eventBus.Setup(e => e.PublishAsync(It.IsAny())) - .Callback(query => - { - if (query.ProductId == "2f8d4c3c-1736-4e56-a188-f865da6a63d1") - query.Result = "apple"; - }); - var integrationEventBus = new Mock(); - var uoW = new Mock(); - uoW.Setup(u => u.CommitAsync(default)).Verifiable(); - - var options = Microsoft.Extensions.Options.Options.Create(new Options.DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies())); - - var domainEventBus = new DomainEventBus(eventBus.Object, integrationEventBus.Object, uoW.Object, options); - - var query = new ProductItemDomainQuery() { ProductId = "2f8d4c3c-1736-4e56-a188-f865da6a63d1" }; - - await domainEventBus.PublishAsync(query); - Assert.IsTrue(query.Result == "apple"); - } - - [TestMethod] - public async Task TestCommitAsync() - { - var services = new ServiceCollection(); - - _uoW.Setup(uow => uow.CommitAsync(CancellationToken.None)).Verifiable(); - Mock> options = new(); - - var domainEventBus = new DomainEventBus(_eventBus.Object, _integrationEventBus.Object, _uoW.Object, options.Object); - await domainEventBus.CommitAsync(CancellationToken.None); - - _uoW.Verify(u => u.CommitAsync(default), Times.Once, "CommitAsync must be called only once"); - } - - [TestMethod] - public void TestParameterInitialization() - { - var id = Guid.NewGuid(); - var createTime = DateTime.UtcNow; - - var domainCommand = new CustomDomainCommand(); - Assert.IsTrue(domainCommand.GetEventId() != default); - Assert.IsTrue(domainCommand.GetCreationTime() != default && domainCommand.GetCreationTime() >= createTime); - - domainCommand = new CustomDomainCommand(id, createTime); - Assert.IsTrue(domainCommand.GetEventId() == id); - Assert.IsTrue(domainCommand.GetCreationTime() == createTime); - - var domainEvent = new CustomDomainEvent(); - Assert.IsTrue(domainEvent.GetEventId() != default); - Assert.IsTrue(domainEvent.GetCreationTime() != default && domainEvent.GetCreationTime() >= createTime); - - domainEvent = new CustomDomainEvent(id, createTime); - Assert.IsTrue(domainEvent.GetEventId() == id); - Assert.IsTrue(domainEvent.GetCreationTime() == createTime); - - var domainQuery = new ProductItemDomainQuery() - { - ProductId = Guid.NewGuid().ToString() - }; - Assert.IsTrue(domainQuery.GetEventId() != default); - Assert.IsTrue(domainQuery.GetCreationTime() != default && domainQuery.GetCreationTime() >= createTime); - } - - [TestMethod] - public void TestDomainQueryUnitOfWork() - { - var domainQuery = new ProductItemDomainQuery() - { - ProductId = Guid.NewGuid().ToString() - }; - Assert.ThrowsException(() => - { - domainQuery.UnitOfWork = _uoW.Object; - }); - Assert.IsNull(domainQuery.UnitOfWork); - } - - [TestMethod] - public async Task TestDomainServiceAsync() - { - _integrationEventBus.Setup(integrationEventBus => integrationEventBus.PublishAsync(It.IsAny())).Verifiable(); - - _services.AddDomainEventBus(new[] { typeof(DomainEventBusTest).Assembly }, - options => - { - options.Services.AddScoped(_ => _eventBus.Object); - options.Services.AddScoped(_ => _integrationEventBus.Object); - options.Services.AddScoped(_ => _uoW.Object); - }); - var serviceProvider = _services.BuildServiceProvider(); - - var userDomainService = serviceProvider.GetRequiredService(); - var domainIntegrationEvent = new RegisterUserSucceededDomainIntegrationEvent() { Account = "Tom" }; - await userDomainService.RegisterUserSucceededAsync(domainIntegrationEvent); - - _integrationEventBus.Verify(integrationEventBus => integrationEventBus.PublishAsync(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestPublishEvent() - { - var domainEventBus = new DomainEventBus(_eventBus.Object, _integrationEventBus.Object, _uoW.Object, _dispatcherOptions); - _eventBus.Setup(eventBus => eventBus.PublishAsync(It.IsAny())).Verifiable(); - - var @event = new ForgetPasswordEvent() - { - Account = "Tom" - }; - await domainEventBus.PublishAsync(@event); - _eventBus.Verify(eventBus => eventBus.PublishAsync(@event), Times.Once); - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainIntegrationEventBusTest.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainIntegrationEventBusTest.cs deleted file mode 100644 index ca330c3c5..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/DomainIntegrationEventBusTest.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests; - -[TestClass] -public class DomainIntegrationEventBus -{ - private Assembly[] _defaultAssemblies = default!; - private IServiceCollection _services = default!; - private Mock _integrationEventBus = default!; - private Mock _uoW = default!; - private IOptions _dispatcherOptions = default!; - - [TestInitialize] - public void Initialize() - { - _defaultAssemblies = AppDomain.CurrentDomain.GetAssemblies(); - _services = new ServiceCollection(); - _integrationEventBus = new(); - _integrationEventBus.Setup(eventBus => eventBus.PublishAsync(It.IsAny())).Verifiable(); - _uoW = new(); - _dispatcherOptions = Microsoft.Extensions.Options.Options.Create(new Options.DispatcherOptions(new ServiceCollection(), _defaultAssemblies)); - } - - [TestMethod] - public async Task PublishQueueAsync() - { - _services.AddEventBus(_defaultAssemblies); - var serviceProvider = _services.BuildServiceProvider(); - var eventBus = serviceProvider.GetRequiredService(); - var payment = new - { - orderId = Guid.NewGuid(), - money = 100, - payTime = DateTime.UtcNow - }; - var domainEventBus = new DomainEventBus(eventBus, _integrationEventBus.Object, _uoW.Object, _dispatcherOptions); - - var domainEvent = new PaymentSucceededDomainEvent(payment.orderId.ToString()); - await domainEventBus.Enqueue(domainEvent); - - var integraionDomainEvent = new PaymentSucceededIntegraionDomainEvent(payment.orderId.ToString(), payment.money, payment.payTime); - await domainEventBus.Enqueue(integraionDomainEvent); - await domainEventBus.PublishQueueAsync(); - Assert.IsTrue(domainEvent.Result); - _integrationEventBus.Verify(eventBus => eventBus.PublishAsync(It.IsAny()), Times.Once); - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/AddUserIntegrationDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/AddUserIntegrationDomainEvent.cs deleted file mode 100644 index caf173dec..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/AddUserIntegrationDomainEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public record AddUserIntegrationDomainEvent : IntegrationDomainEvent -{ - public string Name { get; set; } - - public override string Topic { get; set; } = nameof(AddUserIntegrationDomainEvent); -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CreateProductDomainCommand.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CreateProductDomainCommand.cs deleted file mode 100644 index 0675abdcf..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CreateProductDomainCommand.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public record CreateProductDomainCommand : DomainCommand -{ - public string Name { get; set; } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainCommand.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainCommand.cs deleted file mode 100644 index 6c6528998..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainCommand.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public record CustomDomainCommand : DomainCommand -{ - public CustomDomainCommand() : base() - { - - } - - public CustomDomainCommand(Guid eventId, DateTime creationTime) : base(eventId, creationTime) - { - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainEvent.cs deleted file mode 100644 index 21581a308..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/CustomDomainEvent.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public record CustomDomainEvent : DomainEvent -{ - public CustomDomainEvent() : base() - { - - } - - public CustomDomainEvent(Guid eventId, DateTime creationTime) : base(eventId, creationTime) - { - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ForgetPasswordEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ForgetPasswordEvent.cs deleted file mode 100644 index 0cfa471b6..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ForgetPasswordEvent.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public class ForgetPasswordEvent : IEvent -{ - public Guid Id { get; set; } = Guid.NewGuid(); - - public DateTime CreationTime { get; set; } = DateTime.UtcNow; - - public string Account { get; set; } - - public Guid GetEventId() => Id; - - public void SetEventId(Guid eventId) => Id = eventId; - - public DateTime GetCreationTime() => CreationTime; - - public void SetCreationTime(DateTime creationTime) => CreationTime = creationTime; -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentFailedIntegrationDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentFailedIntegrationDomainEvent.cs deleted file mode 100644 index 964a5bd54..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentFailedIntegrationDomainEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public record PaymentFailedIntegrationDomainEvent : IntegrationDomainEvent -{ - public string OrderId { get; set; } - - public override string Topic { get; set; } = nameof(PaymentFailedIntegrationDomainEvent); -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededDomainEvent.cs deleted file mode 100644 index 98ebc2056..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededDomainEvent.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public record PaymentSucceededDomainEvent(string OrderId) : DomainEvent -{ - public bool Result { get; set; } = false; -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededIntegraionDomainEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededIntegraionDomainEvent.cs deleted file mode 100644 index 71d5c3283..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/PaymentSucceededIntegraionDomainEvent.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public record PaymentSucceededIntegraionDomainEvent(string OrderId, decimal Money, DateTime PayTime) : IntegrationDomainEvent -{ - public override string Topic { get; set; } = nameof(PaymentSucceededIntegraionDomainEvent); -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ProductItemDomainQuery.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ProductItemDomainQuery.cs deleted file mode 100644 index a49d7eaf2..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/ProductItemDomainQuery.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public record ProductItemDomainQuery : DomainQuery -{ - public string ProductId { get; set; } - - public override string Result { get; set; } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/RegisterUserSucceededDomainIntegrationEvent.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/RegisterUserSucceededDomainIntegrationEvent.cs deleted file mode 100644 index 59375f5c2..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Events/RegisterUserSucceededDomainIntegrationEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Events; - -public record RegisterUserSucceededDomainIntegrationEvent : IntegrationDomainEvent -{ - public override string Topic { get; set; } = nameof(RegisterUserSucceededDomainIntegrationEvent); - - public string Account { get; init; } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Handlers/PaymentSucceededDomainEventHandller.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Handlers/PaymentSucceededDomainEventHandller.cs deleted file mode 100644 index 51b60a596..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Handlers/PaymentSucceededDomainEventHandller.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Handlers; - -public class PaymentSucceededDomainEventHandller -{ - private readonly ILogger? _logger; - - public PaymentSucceededDomainEventHandller(ILogger? logger = null) - { - _logger = logger; - } - - [EventHandler] - public Task PaymentSucceeded(PaymentSucceededDomainEvent domainEvent) - { - _logger?.LogInformation("PaymentSucceeded: OrderId: {OrderId}", domainEvent.OrderId); - domainEvent.Result = true; - return Task.CompletedTask; - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj deleted file mode 100644 index 3a5fbcc20..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Masa.Contrib.Ddd.Domain.Tests.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Services/UserDomainService.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Services/UserDomainService.cs deleted file mode 100644 index a030d5489..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/Services/UserDomainService.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Tests.Services; - -public class UserDomainService : DomainService -{ - public UserDomainService(IDomainEventBus eventBus) : base(eventBus) - { - } - - public async Task RegisterUserSucceededAsync(RegisterUserSucceededDomainIntegrationEvent domainIntegrationEvent) - { - // TODO Simulate a successful message for registered users - - await EventBus.PublishAsync(domainIntegrationEvent); - return "succeed"; - } -} diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/_Imports.cs b/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/_Imports.cs deleted file mode 100644 index 6be17b92e..000000000 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Tests/_Imports.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Ddd.Domain.Tests.Events; -global using Masa.Contrib.Ddd.Domain.Tests.Services; -global using Masa.Contrib.Dispatcher.Events; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Reflection; diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/CustomDbContext.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/CustomDbContext.cs deleted file mode 100644 index e320f72cc..000000000 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/CustomDbContext.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests; - -public class CustomDbContext : MasaDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) { } -} diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/CouponHandler.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/CouponHandler.cs deleted file mode 100644 index 74423a6b4..000000000 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/CouponHandler.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; - -public class CouponHandler -{ - [EventHandler] - public Task SendCouponAsync(SendCouponEvent @event) - { - throw new UserFriendlyException("custom exception"); - } -} diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs index 33000a439..4f804f982 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs @@ -364,7 +364,7 @@ public void TestOrderLessThanZero() { Assert.ThrowsException(() => { - new EventHandlerAttribute(-10); + _ = new EventHandlerAttribute(-10); }, "The order must be greater than or equal to 0"); } @@ -377,26 +377,4 @@ public async Task TestEventBusExceptionAsync() var eventBus = services.BuildServiceProvider().GetRequiredService(); await Assert.ThrowsExceptionAsync(async () => await eventBus.PublishAsync(registerUserEvent)); } - - [TestMethod] - public async Task TestEventBusFailedReturnExceptionIsUserFriendException() - { - var services = new ServiceCollection(); - services.AddTestEventBus( - new[] { typeof(FeaturesTest).Assembly }, - ServiceLifetime.Scoped, - builder => - { - builder.UseUoW(optionBuilder => - { - optionBuilder.UseTestSqlite($"data source=test-{Guid.NewGuid()}"); - }); - }); - - var serviceProvider = services.BuildServiceProvider(); - var dbContext = serviceProvider.GetRequiredService(); - await dbContext.Database.EnsureCreatedAsync(); - var eventBus = serviceProvider.GetRequiredService(); - await Assert.ThrowsExceptionAsync(async () => await eventBus.PublishAsync(new SendCouponEvent())); - } } diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj index 6465510fc..d84543741 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj @@ -26,8 +26,6 @@ - - diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs index d5eb5c797..85935366e 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs @@ -4,8 +4,6 @@ global using Masa.BuildingBlocks.Data.UoW; global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.UoW.EF; global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.Events; global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj index 6a62382b6..d3810a9c5 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj +++ b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj @@ -20,7 +20,6 @@ - diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj b/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj deleted file mode 100644 index 15dd0abec..000000000 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Masa.Contrib.Dispatcher.Tests.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - net6.0 - enable - enable - - false - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs index 2b97c2fd9..621ac7bfd 100644 --- a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs +++ b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs @@ -1,8 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using DaprCaller = Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers.DaprCaller; - namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests; [TestClass] diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs index 58e77bd7b..ffe46821b 100644 --- a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs +++ b/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs @@ -11,3 +11,4 @@ global using Microsoft.Extensions.Options; global using Microsoft.VisualStudio.TestTools.UnitTesting; global using System.Net; +global using DaprCaller = Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers.DaprCaller; diff --git a/src/Utils/test/Masa.Utils.Caller.Core.Tests/CallerTest.cs b/src/Utils/test/Masa.Utils.Caller.Core.Tests/CallerTest.cs deleted file mode 100644 index 24f0efc41..000000000 --- a/src/Utils/test/Masa.Utils.Caller.Core.Tests/CallerTest.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core.Tests; - -[TestClass] -public class CallerTest -{ - [TestMethod] - public void TestCallerProviderServiceLifetime() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "http"; - clientBuilder.IsDefault = true; - clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - var callerProvider1 = serviceProvider.GetRequiredService(); - var callerProvider2 = serviceProvider.GetRequiredService(); - Assert.IsTrue(callerProvider1 == callerProvider2); - } - - [TestMethod] - public void TestCaller() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "http"; - clientBuilder.IsDefault = true; - clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; - }); - opt.UseDapr(clientBuilder => - { - clientBuilder.Name = "dapr"; - clientBuilder.IsDefault = false; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - var callerProvider = serviceProvider.GetRequiredService(); - Assert.IsNotNull(callerProvider); - - var caller = serviceProvider.GetRequiredService().CreateClient(); - var daprCaller = serviceProvider.GetRequiredService().CreateClient("dapr"); - var httpCaller = serviceProvider.GetRequiredService().CreateClient("http"); - - Assert.IsTrue(caller.GetType().FullName != daprCaller.GetType().FullName); - Assert.IsTrue(caller.GetType().FullName == httpCaller.GetType().FullName); - } - - [TestMethod] - public void TestMultiDefaultCaller() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - opt.UseHttpClient(builder => - { - builder.Name = "gitee"; - builder.BaseAddress = "https://gitee.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestMultiDefaultCaller2() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "gitee"; - builder.BaseAddress = "https://gitee.com/masastack"; - builder.IsDefault = true; - }); - }); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestRepeatCallerName() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestRepeatCallerName2() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestRepeatCallerName3() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = typeof(GithubCaller).FullName!; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestAddMultiCaller() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "masastack"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "masastack2"; - builder.BaseAddress = "https://github.com/masastack"; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack")); - Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack2")); - } -} diff --git a/src/Utils/test/Masa.Utils.Caller.Core.Tests/Callers/GithubCaller.cs b/src/Utils/test/Masa.Utils.Caller.Core.Tests/Callers/GithubCaller.cs deleted file mode 100644 index 0dac01c59..000000000 --- a/src/Utils/test/Masa.Utils.Caller.Core.Tests/Callers/GithubCaller.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core.Tests.Callers; - -public class GithubCaller : HttpClientCallerBase -{ - public GithubCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - protected override string BaseAddress { get; set; } = default!; -} diff --git a/src/Utils/test/Masa.Utils.Caller.Core.Tests/Masa.Utils.Caller.Core.Tests.csproj b/src/Utils/test/Masa.Utils.Caller.Core.Tests/Masa.Utils.Caller.Core.Tests.csproj deleted file mode 100644 index 5bbd621bd..000000000 --- a/src/Utils/test/Masa.Utils.Caller.Core.Tests/Masa.Utils.Caller.Core.Tests.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - - - diff --git a/src/Utils/test/Masa.Utils.Caller.Core.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Caller.Core.Tests/_Imports.cs deleted file mode 100644 index ae2f7853a..000000000 --- a/src/Utils/test/Masa.Utils.Caller.Core.Tests/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Caller.Core.Tests.Callers; -global using Masa.Utils.Caller.DaprClient; -global using Masa.Utils.Caller.HttpClient; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Masa.Utils.Caller.IntegratedTests.csproj b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Masa.Utils.Caller.IntegratedTests.csproj deleted file mode 100644 index 61700680e..000000000 --- a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Masa.Utils.Caller.IntegratedTests.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - net6.0 - enable - false - enable - Masa.Utils.Caller.IntegratedTest - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/_Imports.cs b/src/Utils/test/Masa.Utils.Caller.IntegratedTests/_Imports.cs deleted file mode 100644 index 297838fd6..000000000 --- a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Caller.Core; -global using Masa.Utils.Caller.DaprClient; -global using Masa.Utils.Caller.HttpClient; -global using Masa.Utils.Caller.IntegratedTest.Callers; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System.Net; diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/CustomHttpClientCallerProvider.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs similarity index 90% rename from src/Utils/test/Masa.Utils.Caller.Tests/CustomHttpClientCallerProvider.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs index e46ce062b..33f0fece9 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/CustomHttpClientCallerProvider.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.Tests; +namespace Masa.Utils.Caller.Tests.Application; public class CustomHttpClientCallerProvider : HttpClientCallerProvider { diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserDetailQury.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs similarity index 92% rename from src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserDetailQury.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs index 2b82607ad..af0eb4647 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserDetailQury.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.Tests.Queries; +namespace Masa.Utils.Caller.Tests.Application.Queries; public class UserDetailQury { diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserListQury.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs similarity index 86% rename from src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserListQury.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs index d3302d97c..c495925aa 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/Queries/UserListQury.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.Tests.Queries; +namespace Masa.Utils.Caller.Tests.Application.Queries; public class UserListQury { diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Requesties/RegisterUser.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs similarity index 89% rename from src/Utils/test/Masa.Utils.Caller.Tests/Requesties/RegisterUser.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs index 2f4e3608f..e23908161 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/Requesties/RegisterUser.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.Tests.Requesties; +namespace Masa.Utils.Caller.Tests.Application.Requesties; [XmlRoot] public class RegisterUser diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Response/BaseResponse.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs similarity index 86% rename from src/Utils/test/Masa.Utils.Caller.Tests/Response/BaseResponse.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs index 9dc1f20a3..a0e7c009a 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/Response/BaseResponse.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.Tests.Response; +namespace Masa.Utils.Caller.Tests.Application.Response; [Serializable] [XmlRoot] diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/AutomaticCallerTest.cs b/src/Utils/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs similarity index 86% rename from src/Utils/test/Masa.Utils.Caller.IntegratedTests/AutomaticCallerTest.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs index 81d14f34b..034c60d20 100644 --- a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/AutomaticCallerTest.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.IntegratedTest; +namespace Masa.Utils.Caller.Tests; [TestClass] public class AutomaticCallerTest @@ -24,15 +24,6 @@ public async Task TestGetAsync() Assert.IsTrue(await githubCaller.GetAsync()); } - [TestMethod] - public void TestRepeatAddCaller() - { - Assert.ThrowsException(() => - { - _builder.Services.AddCaller().AddCaller(); - }); - } - [TestMethod] public void TestDaprCallerReturnCallerProviderIsNotNull() { diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs b/src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs index 576c4ba35..209a7e84d 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs @@ -31,108 +31,205 @@ public async Task TestGetAsync() Assert.IsTrue(await GetAsync(githubCaller)); } - private async Task GetAsync(ICallerProvider callerProvider) + [TestMethod] + public void TestCallerProviderServiceLifetime() { - var res = await callerProvider.GetAsync(""); - return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "http"; + clientBuilder.IsDefault = true; + clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + var callerProvider1 = serviceProvider.GetRequiredService(); + var callerProvider2 = serviceProvider.GetRequiredService(); + Assert.IsTrue(callerProvider1 == callerProvider2); } [TestMethod] - public void TestConvertToDictionaryByDynamic() + public void TestCaller() { - var provider = new DefaultTypeConvertProvider(); - var dictionary = new Dictionary - { - { "account", "jim" }, - { "age", "18" } - }; - var request = new + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => { - account = "jim", - age = 18 - }; - var result = provider.ConvertToDictionary(request); - Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + opt.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "http"; + clientBuilder.IsDefault = true; + clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; + }); + opt.UseDapr(clientBuilder => + { + clientBuilder.Name = "dapr"; + clientBuilder.IsDefault = false; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + var callerProvider = serviceProvider.GetRequiredService(); + Assert.IsNotNull(callerProvider); + + var caller = serviceProvider.GetRequiredService().CreateClient(); + var daprCaller = serviceProvider.GetRequiredService().CreateClient("dapr"); + var httpCaller = serviceProvider.GetRequiredService().CreateClient("http"); + + Assert.IsTrue(caller.GetType().FullName != daprCaller.GetType().FullName); + Assert.IsTrue(caller.GetType().FullName == httpCaller.GetType().FullName); } [TestMethod] - public void TestConvertToDictionaryByObject() + public void TestMultiDefaultCaller() { - var provider = new DefaultTypeConvertProvider(); - var query = new UserListQury("Jim"); - var dictionary = new Dictionary + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => { - { "name", query.Name } - }; - var result = provider.ConvertToDictionary(query); - Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + opt.UseHttpClient(builder => + { + builder.Name = "gitee"; + builder.BaseAddress = "https://gitee.com/masastack"; + builder.IsDefault = true; + }); + }); + }); } [TestMethod] - public void TestConvertToDictionaryByObject2() + public void TestMultiDefaultCaller2() { - var provider = new DefaultTypeConvertProvider(); - var query = new UserDetailQury("Jim", "Music", "Game"); - var result = provider.ConvertToDictionary(query); - Assert.IsTrue(result.Count == 2); - Assert.IsTrue(result["name"] == query.Name); - Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => { - "Music", - "Game" - })); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "gitee"; + builder.BaseAddress = "https://gitee.com/masastack"; + builder.IsDefault = true; + }); + }); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); } [TestMethod] - public void TestConvertToDictionaryByObject3() + public void TestRepeatCallerName() { - var provider = new DefaultTypeConvertProvider(); - - List tags = null!; - var query = new UserDetailQury("Jim", tags); - var result = provider.ConvertToDictionary(query); - - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["name"] == query.Name); + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); } [TestMethod] - public void TestConvertToDictionaryByObject4() + public void TestRepeatCallerName2() { - var provider = new DefaultTypeConvertProvider(); - var query = new UserDetailQury(null!, "Music", "Game"); - var result = provider.ConvertToDictionary(query); - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => { - "Music", - "Game" - })); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); } [TestMethod] - public void TestConvertToDictionaryByObject5() + public void TestRepeatCallerName3() { - var provider = new DefaultTypeConvertProvider(); - var dic = new Dictionary() + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => { - { "Account", "Jim" } - }; - var result = provider.ConvertToDictionary(dic); - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["Account"] == "Jim"); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = typeof(GithubCaller).FullName!; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); } [TestMethod] - public void TestConvertToDictionaryByObject6() + public void TestAddMultiCaller() { - var provider = new DefaultTypeConvertProvider(); - var dic = new List>() + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => { - new("Account", "Jim") - }; - var result = provider.ConvertToDictionary(dic); - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["Account"] == "Jim"); + opt.UseHttpClient(builder => + { + builder.Name = "masastack"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "masastack2"; + builder.BaseAddress = "https://github.com/masastack"; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack")); + Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack2")); + } + + private async Task GetAsync(ICallerProvider callerProvider) + { + var res = await callerProvider.GetAsync(""); + return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; } } diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs b/src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs index eba6de05c..b775e3adf 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs @@ -1,8 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using System.Net.Http.Json; - namespace Masa.Utils.Caller.Tests; [TestClass] diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/DaprCaller.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs similarity index 73% rename from src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/DaprCaller.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs index f66919cc7..ca9efb69c 100644 --- a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/DaprCaller.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs @@ -1,16 +1,15 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.IntegratedTest.Callers; +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; public class DaprCaller : DaprCallerBase { + protected override string AppId { get; set; } = "DaprCaller"; + public DaprCaller(IServiceProvider serviceProvider) : base(serviceProvider) { - AppId = "DaprCaller"; } - protected override string AppId { get; set; } - public bool CallerProviderIsNotNull() => CallerProvider != null; } diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/GithubCaller.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs similarity index 67% rename from src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/GithubCaller.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs index f2b5a6b0e..b663f2d11 100644 --- a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/GithubCaller.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs @@ -1,17 +1,16 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.IntegratedTest.Callers; +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; public class GithubCaller : HttpClientCallerBase { + protected override string BaseAddress { get; set; } = "https://github.com/masastack"; + public GithubCaller(IServiceProvider serviceProvider) : base(serviceProvider) { - BaseAddress = "https://github.com/masastack"; } - protected override string BaseAddress { get; set; } - public async Task GetAsync() { var res = await CallerProvider.GetAsync(""); diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/RoleCaller.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs similarity index 83% rename from src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/RoleCaller.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs index e900c6d7c..e961ef0cf 100644 --- a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/RoleCaller.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.IntegratedTest.Callers; +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; public class RoleCaller: UserDaprCallerBase { diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserCaller.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs similarity index 83% rename from src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserCaller.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs index bb8d37930..6186c323c 100644 --- a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserCaller.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.IntegratedTest.Callers; +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; public class UserCaller : UserDaprCallerBase { diff --git a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserDaprCallerBase.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs similarity index 87% rename from src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserDaprCallerBase.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs index 8d7d93b6a..6f46b6f3a 100644 --- a/src/Utils/test/Masa.Utils.Caller.IntegratedTests/Callers/UserDaprCallerBase.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.IntegratedTest.Callers; +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; public abstract class UserDaprCallerBase : DaprCallerBase { diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/DefaultXmlResponseMessage.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs similarity index 97% rename from src/Utils/test/Masa.Utils.Caller.Tests/DefaultXmlResponseMessage.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs index c5d255338..b52af2eae 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/DefaultXmlResponseMessage.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.Tests; +using Masa.Utils.Caller.Tests.Infrastructure.Utils; + +namespace Masa.Utils.Caller.Tests.Infrastructure; public class DefaultXmlResponseMessage : IResponseMessage { diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Utils/XmlUtils.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs similarity index 93% rename from src/Utils/test/Masa.Utils.Caller.Tests/Utils/XmlUtils.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs index cf6636256..e277a9828 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/Utils/XmlUtils.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.Tests.Utils; +namespace Masa.Utils.Caller.Tests.Infrastructure.Utils; public class XmlUtils { diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/XmlRequestMessage.cs b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs similarity index 86% rename from src/Utils/test/Masa.Utils.Caller.Tests/XmlRequestMessage.cs rename to src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs index 03cf5703c..04d178945 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/XmlRequestMessage.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Caller.Tests; +using Masa.Utils.Caller.Tests.Infrastructure.Utils; + +namespace Masa.Utils.Caller.Tests.Infrastructure; public class XmlRequestMessage : IRequestMessage { diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs b/src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs index c0ef20ca4..cf898eef8 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs @@ -27,4 +27,103 @@ public void TestConvertToKeyValuePairs() Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "2")); Assert.IsTrue(result.Any(x => x.Key == "text" && x.Value == "masa")); } + + [TestMethod] + public void TestConvertToDictionaryByDynamic() + { + var provider = new DefaultTypeConvertProvider(); + var dictionary = new Dictionary + { + { "account", "jim" }, + { "age", "18" } + }; + var request = new + { + account = "jim", + age = 18 + }; + var result = provider.ConvertToDictionary(request); + Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + } + + [TestMethod] + public void TestConvertToDictionaryByObject() + { + var provider = new DefaultTypeConvertProvider(); + var query = new UserListQury("Jim"); + var dictionary = new Dictionary + { + { "name", query.Name } + }; + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + } + + [TestMethod] + public void TestConvertToDictionaryByObject2() + { + var provider = new DefaultTypeConvertProvider(); + var query = new UserDetailQury("Jim", "Music", "Game"); + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(result.Count == 2); + Assert.IsTrue(result["name"] == query.Name); + Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + { + "Music", + "Game" + })); + } + + [TestMethod] + public void TestConvertToDictionaryByObject3() + { + var provider = new DefaultTypeConvertProvider(); + + List tags = null!; + var query = new UserDetailQury("Jim", tags); + var result = provider.ConvertToDictionary(query); + + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["name"] == query.Name); + } + + [TestMethod] + public void TestConvertToDictionaryByObject4() + { + var provider = new DefaultTypeConvertProvider(); + var query = new UserDetailQury(null!, "Music", "Game"); + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + { + "Music", + "Game" + })); + } + + [TestMethod] + public void TestConvertToDictionaryByObject5() + { + var provider = new DefaultTypeConvertProvider(); + var dic = new Dictionary() + { + { "Account", "Jim" } + }; + var result = provider.ConvertToDictionary(dic); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Account"] == "Jim"); + } + + [TestMethod] + public void TestConvertToDictionaryByObject6() + { + var provider = new DefaultTypeConvertProvider(); + var dic = new List>() + { + new("Account", "Jim") + }; + var result = provider.ConvertToDictionary(dic); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Account"] == "Jim"); + } } diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs index f7a1a4d87..610dc2069 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs +++ b/src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs @@ -3,10 +3,6 @@ global using Masa.Utils.Caller.Core; global using Masa.Utils.Caller.HttpClient; -global using Masa.Utils.Caller.Tests.Queries; -global using Masa.Utils.Caller.Tests.Requesties; -global using Masa.Utils.Caller.Tests.Response; -global using Masa.Utils.Caller.Tests.Utils; global using Masa.Utils.Exceptions; global using Microsoft.AspNetCore.Builder; global using Microsoft.Extensions.DependencyInjection; @@ -19,3 +15,12 @@ global using System.Text; global using System.Text.Json.Serialization; global using System.Xml.Serialization; +global using System.Net.Http.Json; +global using Masa.Utils.Caller.Tests.Application; +global using Masa.Utils.Caller.Tests.Application.Requesties; +global using Masa.Utils.Caller.Tests.Application.Response; +global using Masa.Utils.Caller.Tests.Infrastructure; +global using Masa.Utils.Caller.Tests.Infrastructure.Utils; +global using Masa.Utils.Caller.Tests.Application.Queries; +global using Masa.Utils.Caller.DaprClient; +global using Masa.Utils.Caller.Tests.Infrastructure.Callers; diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj deleted file mode 100644 index 8d15c0631..000000000 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs index 432d7c5d4..b5a8f6f04 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs @@ -1,6 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Models; + namespace Masa.Utils.Extensions.DependencyInjection.Tests; [TestClass] @@ -140,18 +142,17 @@ public void TestAddAutoInject() } [TestMethod] - public void TestAddAutoInjectByAssemblies() + public void TestAddAutoInjectAndEmptyAssemblyReturnServiceIsNull() { var services = new ServiceCollection(); - services.AddAutoInject(typeof(IRepository<>).Assembly); + services.AddAutoInject(Array.Empty()); var serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService>()); - + Assert.IsNull(serviceProvider.GetService>()); Assert.IsNull(serviceProvider.GetService()); } [TestMethod] - public void TestAddAutoInjectMultiByAssemblies() + public void TestAddAutoInjectMultiReturnCountIs1() { var services = new ServiceCollection(); services @@ -160,21 +161,6 @@ public void TestAddAutoInjectMultiByAssemblies() var serviceProvider = services.BuildServiceProvider(); Assert.IsNotNull(serviceProvider.GetService>()); Assert.IsTrue(serviceProvider.GetServices>().Count() == 1); - - Assert.IsNull(serviceProvider.GetService()); - } - - [TestMethod] - public void TestAddAutoInjectByTypes() - { - var services = new ServiceCollection(); - services - .AddAutoInject(typeof(IRepository<>)); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService>()); - Assert.IsTrue(serviceProvider.GetServices>().Count() == 1); - - Assert.IsNull(serviceProvider.GetService()); } [TestMethod] diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Models/User.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs similarity index 77% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Models/User.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs index 2e1dd4d58..4af51dc42 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Models/User.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Models; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Models; public class User { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/IRepository.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs similarity index 82% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/IRepository.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs index a4c96af33..d363a2f37 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/IRepository.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Repository.Tests; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Repositories; public interface IRepository : IScopedDependency where TEntity : class diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/ICalculateProviderService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs similarity index 76% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/ICalculateProviderService.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs index e7f251f30..ddac42e82 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/ICalculateProviderService.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.IServices; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; public interface ICalculateProviderService : ISingletonDependency { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/IClientFactory.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs similarity index 75% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/IClientFactory.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs index 891342f63..1838c2b90 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/IServices/IClientFactory.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.IServices; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; public interface IClientFactory : ISingletonDependency { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/BaseRepository.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs similarity index 83% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/BaseRepository.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs index 81c1a1e7a..71e1049fb 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/BaseRepository.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Repository.Tests; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Repositories; public abstract class BaseRepository : IRepository where TEntity : class diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/BaseService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs similarity index 81% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/BaseService.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs index 8b735d8ab..6970d36a4 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/BaseService.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; public class BaseService : ISingletonDependency, IAutoFireDependency { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/CustomizeClientFactory.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs similarity index 66% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/CustomizeClientFactory.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs index 235eaf7b5..3cafaac57 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/CustomizeClientFactory.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; [Dependency(ReplaceServices = true)] public class CustomizeClientFactory : IClientFactory diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/EmptyClientFactory.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs similarity index 63% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/EmptyClientFactory.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs index 33d11b243..71f985d86 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/EmptyClientFactory.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; public class EmptyClientFactory : IClientFactory { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsBaseService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs similarity index 76% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsBaseService.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs index 816751eb4..12bc32ea4 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsBaseService.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; [IgnoreInjection] public class GoodsBaseService : BaseService diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs similarity index 78% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsService.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs index 5dcfb1e84..7e37ed57a 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/GoodsService.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; public class GoodsService : GoodsBaseService { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/NullCalculateProviderService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs similarity index 62% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/NullCalculateProviderService.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs index 46b60d915..969a46ac6 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/NullCalculateProviderService.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; public class NullCalculateProviderService : ICalculateProviderService { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderBaseService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs similarity index 76% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderBaseService.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs index 974aa7fb8..3122560e1 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderBaseService.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; [IgnoreInjection(true)] public class OrderBaseService : BaseService diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs similarity index 70% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderService.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs index 719d8548a..3c36039d8 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/OrderService.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; public class OrderService : OrderBaseService { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserBaseService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs similarity index 75% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserBaseService.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs index 5dbe3a7d9..d6bf617fc 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserBaseService.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; public abstract class UserBaseService : BaseService { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserService.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs similarity index 78% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserService.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs index 904763ce6..ae22aec6c 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Services/UserService.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Services; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; public class UserService : UserBaseService { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/UserDbContext.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs similarity index 71% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/UserDbContext.cs rename to src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs index 446c3af3d..bbd222358 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Repository.Tests/UserDbContext.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Utils.Extensions.DependencyInjection.Repository.Tests; +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure; public class UserDbContext { diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj index 8d677c87a..bb8ea291c 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj @@ -16,7 +16,6 @@ - diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs index 1c6e40493..15641777d 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs +++ b/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs @@ -1,9 +1,11 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.Utils.Extensions.DependencyInjection.Repository.Tests; -global using Masa.Utils.Extensions.DependencyInjection.Tests.IServices; -global using Masa.Utils.Extensions.DependencyInjection.Tests.Models; -global using Masa.Utils.Extensions.DependencyInjection.Tests.Services; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Repositories; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System.Reflection; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Repositories; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Command/RegisterUserCommand.cs b/test/Masa.EventBus.IntegrationTests/Application/Command/RegisterUserCommand.cs similarity index 83% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Command/RegisterUserCommand.cs rename to test/Masa.EventBus.IntegrationTests/Application/Command/RegisterUserCommand.cs index 1e2ac3b44..258f34b1c 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Command/RegisterUserCommand.cs +++ b/test/Masa.EventBus.IntegrationTests/Application/Command/RegisterUserCommand.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Application.Command; +namespace Masa.EventBus.IntegrationTests.Application.Command; public record RegisterUserCommand : BuildingBlocks.ReadWriteSpliting.Cqrs.Commands.Command { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/AddGoodsIntegrationEvent.cs b/test/Masa.EventBus.IntegrationTests/Application/Events/AddGoodsIntegrationEvent.cs similarity index 87% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/AddGoodsIntegrationEvent.cs rename to test/Masa.EventBus.IntegrationTests/Application/Events/AddGoodsIntegrationEvent.cs index 651dbb098..7e9106990 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/AddGoodsIntegrationEvent.cs +++ b/test/Masa.EventBus.IntegrationTests/Application/Events/AddGoodsIntegrationEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Application.Events; +namespace Masa.EventBus.IntegrationTests.Application.Events; public record AddGoodsIntegrationEvent : IntegrationEvent { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/RegisterUserEvent.cs b/test/Masa.EventBus.IntegrationTests/Application/Events/RegisterUserEvent.cs similarity index 81% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/RegisterUserEvent.cs rename to test/Masa.EventBus.IntegrationTests/Application/Events/RegisterUserEvent.cs index dfdc69a94..6fa6183a0 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Events/RegisterUserEvent.cs +++ b/test/Masa.EventBus.IntegrationTests/Application/Events/RegisterUserEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Application.Events; +namespace Masa.EventBus.IntegrationTests.Application.Events; public record RegisterUserEvent : Event { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQuery.cs b/test/Masa.EventBus.IntegrationTests/Application/Queries/CheckUserQuery.cs similarity index 81% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQuery.cs rename to test/Masa.EventBus.IntegrationTests/Application/Queries/CheckUserQuery.cs index 666cebd28..eab124c93 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQuery.cs +++ b/test/Masa.EventBus.IntegrationTests/Application/Queries/CheckUserQuery.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Application.Queries; +namespace Masa.EventBus.IntegrationTests.Application.Queries; public record CheckUserQuery : Query { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQueryValidator.cs b/test/Masa.EventBus.IntegrationTests/Application/Queries/CheckUserQueryValidator.cs similarity index 85% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQueryValidator.cs rename to test/Masa.EventBus.IntegrationTests/Application/Queries/CheckUserQueryValidator.cs index 8ca0d20c2..ad2ec783b 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/CheckUserQueryValidator.cs +++ b/test/Masa.EventBus.IntegrationTests/Application/Queries/CheckUserQueryValidator.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Application.Queries; +namespace Masa.EventBus.IntegrationTests.Application.Queries; public class CheckUserQueryValidator : AbstractValidator { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQuery.cs b/test/Masa.EventBus.IntegrationTests/Application/Queries/UserAgeQuery.cs similarity index 81% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQuery.cs rename to test/Masa.EventBus.IntegrationTests/Application/Queries/UserAgeQuery.cs index c316d3301..767019652 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQuery.cs +++ b/test/Masa.EventBus.IntegrationTests/Application/Queries/UserAgeQuery.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Application.Queries; +namespace Masa.EventBus.IntegrationTests.Application.Queries; public record UserAgeQuery : Query { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQueryValidator.cs b/test/Masa.EventBus.IntegrationTests/Application/Queries/UserAgeQueryValidator.cs similarity index 85% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQueryValidator.cs rename to test/Masa.EventBus.IntegrationTests/Application/Queries/UserAgeQueryValidator.cs index 483d24dc2..6355c3c78 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/Queries/UserAgeQueryValidator.cs +++ b/test/Masa.EventBus.IntegrationTests/Application/Queries/UserAgeQueryValidator.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Application.Queries; +namespace Masa.EventBus.IntegrationTests.Application.Queries; public class UserAgeQueryValidator: AbstractValidator { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/UserHandler.cs b/test/Masa.EventBus.IntegrationTests/Application/UserHandler.cs similarity index 87% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/UserHandler.cs rename to test/Masa.EventBus.IntegrationTests/Application/UserHandler.cs index d8636ffe1..d23c68ab4 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Application/UserHandler.cs +++ b/test/Masa.EventBus.IntegrationTests/Application/UserHandler.cs @@ -1,7 +1,12 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Application; +using Masa.EventBus.IntegrationTests.Application.Command; +using Masa.EventBus.IntegrationTests.Application.Events; +using Masa.EventBus.IntegrationTests.Application.Queries; +using Masa.EventBus.IntegrationTests.Domain.Aggregate; + +namespace Masa.EventBus.IntegrationTests.Application; public class UserHandler { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Domain/Aggregate/User.cs b/test/Masa.EventBus.IntegrationTests/Domain/Aggregate/User.cs similarity index 84% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Domain/Aggregate/User.cs rename to test/Masa.EventBus.IntegrationTests/Domain/Aggregate/User.cs index 74b68af82..1fd986461 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Domain/Aggregate/User.cs +++ b/test/Masa.EventBus.IntegrationTests/Domain/Aggregate/User.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Domain.Aggregate; +namespace Masa.EventBus.IntegrationTests.Domain.Aggregate; public class User : AggregateRoot { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/CustomDbContext.cs b/test/Masa.EventBus.IntegrationTests/Infrastructure/CustomDbContext.cs similarity index 74% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/CustomDbContext.cs rename to test/Masa.EventBus.IntegrationTests/Infrastructure/CustomDbContext.cs index efbc24096..e898bd894 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/CustomDbContext.cs +++ b/test/Masa.EventBus.IntegrationTests/Infrastructure/CustomDbContext.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Infrastructure; +using Masa.EventBus.IntegrationTests.Domain.Aggregate; + +namespace Masa.EventBus.IntegrationTests.Infrastructure; public class CustomDbContext : MasaDbContext { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DefaultPublisher.cs b/test/Masa.EventBus.IntegrationTests/Infrastructure/Extensions/DefaultPublisher.cs similarity index 84% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DefaultPublisher.cs rename to test/Masa.EventBus.IntegrationTests/Infrastructure/Extensions/DefaultPublisher.cs index 97421f123..e016c2f22 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DefaultPublisher.cs +++ b/test/Masa.EventBus.IntegrationTests/Infrastructure/Extensions/DefaultPublisher.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Infrastructure.Extensions; +namespace Masa.EventBus.IntegrationTests.Infrastructure.Extensions; public class DefaultPublisher : IPublisher { diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs b/test/Masa.EventBus.IntegrationTests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs similarity index 62% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs rename to test/Masa.EventBus.IntegrationTests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs index 02a1d4f71..83a0da8ae 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs +++ b/test/Masa.EventBus.IntegrationTests/Infrastructure/Extensions/DispatcherOptionsExtensions.cs @@ -1,11 +1,11 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Infrastructure.Extensions; +namespace Masa.EventBus.IntegrationTests.Infrastructure.Extensions; public static class DispatcherOptionsExtensions { - public static IDispatcherOptions UseTestPub(this IntegrationEvents.Options.DispatcherOptions dispatcherOptions) + public static IDispatcherOptions UseTestPub(this Contrib.Dispatcher.IntegrationEvents.Options.DispatcherOptions dispatcherOptions) { dispatcherOptions.Services.TryAddSingleton(); return dispatcherOptions; diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/RecordMiddleware.cs b/test/Masa.EventBus.IntegrationTests/Infrastructure/Middleware/RecordMiddleware.cs similarity index 87% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/RecordMiddleware.cs rename to test/Masa.EventBus.IntegrationTests/Infrastructure/Middleware/RecordMiddleware.cs index 4215067b1..b3deb4d9d 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/RecordMiddleware.cs +++ b/test/Masa.EventBus.IntegrationTests/Infrastructure/Middleware/RecordMiddleware.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Infrastructure.Middleware; +namespace Masa.EventBus.IntegrationTests.Infrastructure.Middleware; public class RecordMiddleware : Middleware where TEvent : IEvent diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/ValidatorMiddleware.cs b/test/Masa.EventBus.IntegrationTests/Infrastructure/Middleware/ValidatorMiddleware.cs similarity index 92% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/ValidatorMiddleware.cs rename to test/Masa.EventBus.IntegrationTests/Infrastructure/Middleware/ValidatorMiddleware.cs index 6137e5e31..1c4b8f321 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/Infrastructure/Middleware/ValidatorMiddleware.cs +++ b/test/Masa.EventBus.IntegrationTests/Infrastructure/Middleware/ValidatorMiddleware.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests.Infrastructure.Middleware; +namespace Masa.EventBus.IntegrationTests.Infrastructure.Middleware; public class ValidatorMiddleware : Middleware where TEvent : notnull, IEvent diff --git a/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj new file mode 100644 index 000000000..f404733be --- /dev/null +++ b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj @@ -0,0 +1,33 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestBase.cs b/test/Masa.EventBus.IntegrationTests/TestBase.cs similarity index 97% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestBase.cs rename to test/Masa.EventBus.IntegrationTests/TestBase.cs index a2fa3fd52..8f05a6bdc 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestBase.cs +++ b/test/Masa.EventBus.IntegrationTests/TestBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests; +namespace Masa.EventBus.IntegrationTests; [TestClass] public class TestBase diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestDispatcher.cs b/test/Masa.EventBus.IntegrationTests/TestDispatcher.cs similarity index 85% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestDispatcher.cs rename to test/Masa.EventBus.IntegrationTests/TestDispatcher.cs index 157916e38..de6ace755 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/TestDispatcher.cs +++ b/test/Masa.EventBus.IntegrationTests/TestDispatcher.cs @@ -1,7 +1,15 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Tests; +using Masa.EventBus.IntegrationTests.Application.Command; +using Masa.EventBus.IntegrationTests.Application.Events; +using Masa.EventBus.IntegrationTests.Application.Queries; +using Masa.EventBus.IntegrationTests.Domain.Aggregate; +using Masa.EventBus.IntegrationTests.Infrastructure; +using Masa.EventBus.IntegrationTests.Infrastructure.Extensions; +using Masa.EventBus.IntegrationTests.Infrastructure.Middleware; + +namespace Masa.EventBus.IntegrationTests; [TestClass] public class TestDispatcher : TestBase diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/_Imports.cs b/test/Masa.EventBus.IntegrationTests/_Imports.cs similarity index 71% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/_Imports.cs rename to test/Masa.EventBus.IntegrationTests/_Imports.cs index ff52fc709..a4005053d 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Tests/_Imports.cs +++ b/test/Masa.EventBus.IntegrationTests/_Imports.cs @@ -16,14 +16,11 @@ global using Masa.Contrib.Dispatcher.Events; global using Masa.Contrib.Dispatcher.IntegrationEvents; global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; -global using Masa.Contrib.Dispatcher.Tests.Application.Command; -global using Masa.Contrib.Dispatcher.Tests.Application.Events; -global using Masa.Contrib.Dispatcher.Tests.Application.Queries; -global using Masa.Contrib.Dispatcher.Tests.Domain.Aggregate; -global using Masa.Contrib.Dispatcher.Tests.Infrastructure; -global using Masa.Contrib.Dispatcher.Tests.Infrastructure.Extensions; -global using Masa.Contrib.Dispatcher.Tests.Infrastructure.Middleware; global using Microsoft.EntityFrameworkCore; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.DependencyInjection.Extensions; global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Masa.EventBus.IntegrationTests.Domain.Aggregate; +global using Masa.EventBus.IntegrationTests.Infrastructure; +global using Masa.EventBus.IntegrationTests.Infrastructure.Extensions; +global using Masa.EventBus.IntegrationTests.Infrastructure.Middleware; From 526d358036b60cdde23c3025221ed7e6edc2d5b7 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Tue, 2 Aug 2022 15:35:56 +0800 Subject: [PATCH 06/29] ci: remove buildingBlocks dependencies --- .github/workflows/pr_run_test_ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr_run_test_ci.yml b/.github/workflows/pr_run_test_ci.yml index 9d046a145..1e49ece11 100644 --- a/.github/workflows/pr_run_test_ci.yml +++ b/.github/workflows/pr_run_test_ci.yml @@ -21,8 +21,6 @@ jobs: with: dotnet-version: '6.0.x' include-prerelease: true - - name: dependencies - run: git clone -b main https://github.com/masastack/MASA.BuildingBlocks.git ./src/BuildingBlocks/MASA.BuildingBlocks - name: Configure sysctl limits run: | From dad1d90f0953c890274e6247b5cd8b61b58b6d9e Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Tue, 2 Aug 2022 15:39:45 +0800 Subject: [PATCH 07/29] ci: Adjust gitignore --- .gitignore | 1 - .../Model/Log/FieldAggregationRequest.cs | 13 +++++++++++++ .../Model/Log/LogAggregationRequest.cs | 15 +++++++++++++++ .../Model/Log/LogLatestRequest.cs | 15 +++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs create mode 100644 src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs create mode 100644 src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs diff --git a/.gitignore b/.gitignore index 158c0d5f1..dec3e088a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,6 @@ x86/ bld/ [Bb]in/ [Oo]bj/ -[Ll]og/ # Visual Studio 2015 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs new file mode 100644 index 000000000..b74a374dc --- /dev/null +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; + +public class FieldAggregationRequest +{ + public string Name { get; set; } + + public string Alias { get; set; } + + public AggregationTypes AggregationType { get; set; } +} diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs new file mode 100644 index 000000000..5fe6fae08 --- /dev/null +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; + +public class LogAggregationRequest +{ + public IEnumerable FieldMaps { get; set; } + + public string Query { get; set; } + + public DateTime Start { get; set; } + + public DateTime End { get; set; } +} diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs new file mode 100644 index 000000000..0e2020489 --- /dev/null +++ b/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; + +public class LogLatestRequest +{ + public string Query { get; set; } + + public DateTime Start { get; set; } + + public DateTime End { get; set; } + + public bool IsDesc { get; set; } = true; +} From e374c53372c69912bf8b1097f27e2f0389ebbc0e Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Tue, 2 Aug 2022 15:57:14 +0800 Subject: [PATCH 08/29] chore: Add Scenes --- Masa.Framework.sln | 241 +++++++++++++++++++++++---------------------- 1 file changed, 122 insertions(+), 119 deletions(-) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index b71a65c68..a6c3dfe9e 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -413,7 +413,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSplit EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Dcc.Tests\Masa.Contrib.StackSdks.Dcc.Tests.csproj", "{2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.StackSdks.Tsc", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdk.Tsc\Masa.BuildingBlocks.StackSdks.Tsc.csproj", "{8EA836C9-BE07-4EDE-A983-122A1D9FB499}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Tsc", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdk.Tsc\Masa.BuildingBlocks.StackSdks.Tsc.csproj", "{8EA836C9-BE07-4EDE-A983-122A1D9FB499}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{2DC587FC-4D6D-400D-9504-69D9664A4124}" ProjectSection(SolutionItems) = preProject @@ -429,13 +429,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E747043D-81E2-4A89-8B5B-1258ED45F941}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{B7D7027F-F125-40DD-92A2-A5CEE9E969CC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{B7D7027F-F125-40DD-92A2-A5CEE9E969CC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks", "src\Contrib\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj", "{49DB6925-62FF-4CF3-A041-A7F117AD6256}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks", "src\Contrib\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj", "{49DB6925-62FF-4CF3-A041-A7F117AD6256}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{09AD9DFA-6AD8-4872-AA96-29C3234828CD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{09AD9DFA-6AD8-4872-AA96-29C3234828CD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Snowflake", "Snowflake", "{5BD3D50F-5CB6-4554-9497-0F1680152D95}" EndProject @@ -445,7 +445,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Local", "Local", "{2F4D44EC EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Medallion", "Medallion", "{81DF5E8A-2AFE-47FC-BE66-40BC557A03AB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Dispatcher.Events.Benchmarks", "src\Contrib\perf\Masa.Contrib.Dispatcher.Events.Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks.csproj", "{76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Benchmarks", "src\Contrib\perf\Masa.Contrib.Dispatcher.Events.Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks.csproj", "{76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB}" EndProject @@ -485,14 +485,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EventLogs", "EventLogs", "{ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Events", "Events", "{6B1042A4-A6D5-4307-B163-803164E4A742}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.EventBus.IntegrationTests", "test\Masa.EventBus.IntegrationTests\Masa.EventBus.IntegrationTests.csproj", "{BDA1DB4F-C408-445D-9391-EC9765CF7349}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.EventBus.IntegrationTests", "test\Masa.EventBus.IntegrationTests\Masa.EventBus.IntegrationTests.csproj", "{BDA1DB4F-C408-445D-9391-EC9765CF7349}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{215F07C3-74EE-4FAA-A821-09CF70B8C950}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{215F07C3-74EE-4FAA-A821-09CF70B8C950}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{70449866-CC6B-438B-B8DC-CBAB436EFD00}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{EE77C779-1031-4494-9850-3F2D85D8FA10}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1867,6 +1869,7 @@ Global {C3451307-3743-4911-A401-7F28889703D3} = {08649D7D-EF5A-4626-9959-935CA85DF770} {736F69E9-89D0-47E2-99AF-9412AAE1C6BB} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} {4B818EE6-8E13-40DA-B99A-218BB228EE91} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {30DC35DF-9D86-443C-B26C-9053E6FCA434} = {08649D7D-EF5A-4626-9959-935CA85DF770} {4B94CAF6-134D-4F89-8F2D-72A4FB363B59} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} {54936F20-EEFC-405B-8646-76F200A5C8F7} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} @@ -1875,12 +1878,24 @@ Global {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B} = {7064C470-7D0B-4CE2-A80C-BEE376DDC956} {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {981E883E-CCDC-400B-8FB1-76E1E65C32AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {0D34A7F0-DC77-4789-A136-93089CBD15C3} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {DA816A33-F164-4456-92DD-A672BAD1A6B1} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {ABF6E41A-CBF9-49DE-87FC-9D88F440A104} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} {5944A182-13B8-4DA6-AEE2-0A01E64A9648} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} {801BB9FA-307C-4A93-A116-16BAEC637C1E} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {B228589B-4106-4CF8-B165-26636B94BE2C} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} + {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {08649D7D-EF5A-4626-9959-935CA85DF770} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {8663AD83-4E2C-47EF-BF28-1427E82F1A36} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {FE0F37B3-7727-4A08-AEA1-437F53982658} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {4B812744-1CB5-4760-9719-2220EACC566C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {322F0F91-E181-4139-87DE-974CCF2339BA} = {4B812744-1CB5-4760-9719-2220EACC566C} + {232840A6-183C-4D3A-A086-582FD449D300} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {7064C470-7D0B-4CE2-A80C-BEE376DDC956} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {E8CE3469-6E0F-495C-937E-D9820DE3DA89} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {46C33E74-835B-4CB4-861D-42A781A2502C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {02B35A90-23DF-4341-89CF-E911ED210FBE} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} @@ -1895,10 +1910,13 @@ Global {049430DA-664C-4C77-A679-0CF12217ABB2} = {02B35A90-23DF-4341-89CF-E911ED210FBE} {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} {64B72C9E-85BD-4C41-B67D-892157600F5B} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} + {354D1855-EE83-41EF-BFFC-1348F77A66DB} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} + {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} {A88B4DB8-2441-488D-B097-68F02F18DECC} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} {3B5C4669-07C6-49F0-BC69-70A8980FC605} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {81618F3D-ED3C-44C5-9BAD-8F04CF601D42} = {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} + {F6E5B615-A85D-4FB4-97D0-698098D7616F} = {33D4C640-954B-4468-95A4-2322DAB0B184} {7A628B6A-AFE4-4235-95AA-9A711268B9B1} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {E417DAE3-A1D2-430D-A6C7-C8BDE083D851} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {9A6A3012-6A11-415B-BC58-E2268BE7022E} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} @@ -1906,20 +1924,42 @@ Global {0F43C687-59EF-4164-B3A5-E53C3BF86892} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} {BE11C98A-5680-491E-86E9-93B0A83909EA} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} {E2B9737D-9630-4705-B2DF-21C2EB607F65} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} {8C154ACF-ED6E-43C4-906E-2D36CBC8D112} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} {CC117C03-267A-4145-B258-922C35484883} = {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} {1AD1F4E7-84DA-4CE8-BC69-7D713413560D} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} {9DEA348B-8915-4BAA-AE04-99BF5FC6131B} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {E85FA5C9-C7D9-4461-99DE-11675749E38E} = {2A8759AF-76F5-4F6A-8420-D2890B612AB2} {FB66887D-E08C-4551-B838-EAF49C1D1EE7} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {675D2886-B4E9-4B14-A02D-44B5204EE2E0} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {2A57A40F-92F5-4ACE-95AA-763915578282} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} + {A89E129A-BBEA-431E-96D5-9AAEAA245A3C} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} + {B44F4054-5B66-4937-A99D-216DEFBAD0EF} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} + {A4F3852E-DC6B-43A8-A40A-899089546444} = {33D4C640-954B-4468-95A4-2322DAB0B184} + {CDA1B479-9B9A-43BD-A499-F8FAA6476F09} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} + {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B} = {2A8759AF-76F5-4F6A-8420-D2890B612AB2} {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} + {53543535-E81D-4B28-8EB0-89E9A8FDD496} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} + {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {89B2A360-4806-41B2-9CE1-F2E556BB222D} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} {45B8C34E-A62D-4809-BA0F-6046AFAB2851} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} + {C72508E7-CEF3-4E36-BF39-F3908EE338B7} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {65605EB9-FA98-42CE-8F40-117D89D59786} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {4F26D6F5-32FA-4EE6-8588-A325734E4386} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} + {0C5262F4-DC7E-493F-AB87-A72063ABCA00} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {FE906D46-B113-4600-AC2C-7523937B96AB} = {0C5262F4-DC7E-493F-AB87-A72063ABCA00} {6FF949B6-F1C6-4056-B9DA-CC6120D427FC} = {FE906D46-B113-4600-AC2C-7523937B96AB} + {920E6762-32FE-4BEC-AD0C-6F28119C6804} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {36A7B94C-1CC6-4C12-AB47-240FEB02EECF} = {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} + {E2115E04-198A-48A6-9DD0-F1F8335F3FD8} = {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} + {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9} = {74739F71-A6F5-4BDF-B398-46A84715FA9E} {672C436B-ECE4-4722-8B7D-4EF1E45194B0} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {5D9F3039-D6FE-4F2E-9752-486ADF970093} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {E99EB5EE-6C3A-4878-9407-BB4060F5E200} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} @@ -1935,57 +1975,7 @@ Global {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {A9D8D7E4-591D-479B-B0A5-07F30F831199} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {14D3C601-C29B-48D2-8312-556319D04619} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {2BDF6D68-91FF-4220-8D78-90AA024275C3} = {14D3C601-C29B-48D2-8312-556319D04619} - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8} = {542D8266-668F-49FA-BFE1-814AB96720DD} - {2DEE608F-965F-4298-9B71-D7B32CBA66BD} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} - {E7C80137-1D51-4215-BED7-C739BC663BE2} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} - {5A42D577-38AA-4A5B-866A-01FE1339F2AB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} - {8EA836C9-BE07-4EDE-A983-122A1D9FB499} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {08649D7D-EF5A-4626-9959-935CA85DF770} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {8663AD83-4E2C-47EF-BF28-1427E82F1A36} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {FE0F37B3-7727-4A08-AEA1-437F53982658} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {7064C470-7D0B-4CE2-A80C-BEE376DDC956} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {4B812744-1CB5-4760-9719-2220EACC566C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {232840A6-183C-4D3A-A086-582FD449D300} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {E8CE3469-6E0F-495C-937E-D9820DE3DA89} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {0D34A7F0-DC77-4789-A136-93089CBD15C3} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {46C33E74-835B-4CB4-861D-42A781A2502C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {B228589B-4106-4CF8-B165-26636B94BE2C} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC} = {232840A6-183C-4D3A-A086-582FD449D300} - {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {DC9F9523-A2F9-47AA-B6D9-40AC14797548} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {BA74E50F-C553-40D6-8578-BCB4A3F5E585} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {83AA938C-9182-4E65-A42A-79CAE68888E9} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {542D8266-668F-49FA-BFE1-814AB96720DD} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {920E6762-32FE-4BEC-AD0C-6F28119C6804} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {0C5262F4-DC7E-493F-AB87-A72063ABCA00} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {985B71A9-DF28-4B70-9DA5-1D60B82E8551} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {53543535-E81D-4B28-8EB0-89E9A8FDD496} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {0D9CDEA2-0DC6-490A-9145-782259B63739} = {14D3C601-C29B-48D2-8312-556319D04619} - {5BD3D50F-5CB6-4554-9497-0F1680152D95} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {C92637A7-77FC-4995-8024-B28F6C58AEA8} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {49DB6925-62FF-4CF3-A041-A7F117AD6256} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {09AD9DFA-6AD8-4872-AA96-29C3234828CD} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {F673CF31-D8CF-4F3E-B294-0802589F5BF2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {516A316F-BE2B-4931-88DD-4C08DECE8E56} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {217AB0A8-8750-4696-8E43-E11F82A191CB} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} - {1787BF8C-3C05-4E07-8868-E839544F9522} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} - {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} {19C7B778-345C-407B-BE72-67BF04784F35} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} - {1551B2ED-9931-4A03-8853-1C3E5504C43D} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} - {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} {7DC7F500-F004-4DAC-9F16-D6878B3808E1} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} @@ -1996,97 +1986,110 @@ Global {A69815D7-1C4F-4484-8E0B-7E6765203AC0} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} {524C5CA0-036E-480A-86E4-513232422F26} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {CB1F1533-E430-47C5-AD52-04922CC959A5} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {D05ADEA6-2267-4DC1-901A-BD18B697E889} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {CC9C8421-68D2-4645-B97E-512FAC691703} = {542D8266-668F-49FA-BFE1-814AB96720DD} - {76117457-EC1B-4844-825A-20A760B42C44} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} - {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {1A3740CF-C51F-4E7A-BA27-6BF8652021BF} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {217AB0A8-8750-4696-8E43-E11F82A191CB} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} + {C92637A7-77FC-4995-8024-B28F6C58AEA8} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {2BDF6D68-91FF-4220-8D78-90AA024275C3} = {14D3C601-C29B-48D2-8312-556319D04619} + {542D8266-668F-49FA-BFE1-814AB96720DD} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8} = {542D8266-668F-49FA-BFE1-814AB96720DD} + {83AA938C-9182-4E65-A42A-79CAE68888E9} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {8A7A91C6-C2F5-4C68-A53F-555EF93DB592} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {66DEC85C-7433-4902-B01A-8F98D1A87385} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} + {8BE42490-F83D-48D7-8C5D-1665AC84229C} = {FF832650-37C7-48FF-B078-77CACF37966E} + {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11} = {46DE49C1-D700-4C46-849A-7F485D87A518} + {BA74E50F-C553-40D6-8578-BCB4A3F5E585} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {2DEE608F-965F-4298-9B71-D7B32CBA66BD} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} + {E7C80137-1D51-4215-BED7-C739BC663BE2} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} + {DC9F9523-A2F9-47AA-B6D9-40AC14797548} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} + {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} + {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} + {1F04359A-64BB-4C86-8D2F-161C49F2CDEB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} + {5A42D577-38AA-4A5B-866A-01FE1339F2AB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} + {B189564D-F638-4D3F-8AA6-B9C62D8F49BE} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} + {C517C235-8969-478B-941B-2E40897F4C71} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} + {41817AD2-D1DA-4698-B87D-910524CE4B7A} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} + {36629279-FD56-452B-88C2-5C8271500042} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} + {40D7AED3-982D-440B-BCD5-C1EFFC59514D} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {A1D7408C-AB95-4CFF-89F8-24797A865DBF} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {8680EA03-13A7-4F4A-A579-EB2CB6411C21} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {4CE930E3-12E4-4BFA-962E-3477B7AB6930} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {8903DCD8-A68D-4164-83EE-DE07385DDDD6} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {E2E68FF1-9CB5-424F-9D91-130A48462E54} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {7FFFE514-2221-4FB1-AD37-EE56A392C3E2} = {FF832650-37C7-48FF-B078-77CACF37966E} + {472122D3-114E-424D-AF47-B3D7E94057A8} = {46DE49C1-D700-4C46-849A-7F485D87A518} + {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} + {985B71A9-DF28-4B70-9DA5-1D60B82E8551} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} - {F7DEBE88-8324-47F9-B240-4F19F706B50B} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {4FB42611-1B54-4ABF-988A-714EE9E8C492} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} {EAAD274F-9C5D-4531-A4E5-A5764E9D644A} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} {F9C27912-F7EC-47B6-A385-064BD4B92EDA} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} {F346B708-0D1B-4BA7-AA86-1B977BA88FB6} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} {332D590C-11EC-481D-AC55-6279548F1CF4} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} {7BF99E7E-37EB-46D6-8808-2254430C3645} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} - {A93F1887-0011-466C-8EB8-3A338AEA5A4B} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} + {5EF602A6-3996-44D3-A6C0-5319C9BF8B21} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} {37138DEF-EEE4-4363-A307-0027B4C6ACD8} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} + {A93F1887-0011-466C-8EB8-3A338AEA5A4B} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} + {CC7ED747-8BCE-4B49-8855-AE4697792A81} = {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} + {605A3653-C7E3-4EC2-8749-979E4A0227D0} = {74739F71-A6F5-4BDF-B398-46A84715FA9E} + {2D61CA3A-A40C-466D-9E87-59A32A86B7BC} = {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} + {50C13F5E-BA3A-4B04-A730-BAA584E051AB} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {C8AD2261-D325-414D-9B2D-B2A9D27C242F} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {CC9C8421-68D2-4645-B97E-512FAC691703} = {542D8266-668F-49FA-BFE1-814AB96720DD} + {1551B2ED-9931-4A03-8853-1C3E5504C43D} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} + {CB1F1533-E430-47C5-AD52-04922CC959A5} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {0607F6E0-84AC-4FBC-9717-6F0B1D18E574} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {1041A4C4-D422-4AD8-B511-B8E7FBA548C9} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {D05ADEA6-2267-4DC1-901A-BD18B697E889} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {1787BF8C-3C05-4E07-8868-E839544F9522} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} + {F673CF31-D8CF-4F3E-B294-0802589F5BF2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {0D9CDEA2-0DC6-490A-9145-782259B63739} = {14D3C601-C29B-48D2-8312-556319D04619} {80512601-4B59-4A1B-984F-8E81E3242F97} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} - {96C2CD33-8A8C-4206-9C73-97E8D748F397} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {96C2CD33-8A8C-4206-9C73-97E8D748F397} = {EE77C779-1031-4494-9850-3F2D85D8FA10} {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {C72508E7-CEF3-4E36-BF39-F3908EE338B7} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {65605EB9-FA98-42CE-8F40-117D89D59786} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {76117457-EC1B-4844-825A-20A760B42C44} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} {89EE0C4D-6C29-472E-9109-84327DB489A1} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} {F45CBF27-1D45-404C-9B09-5CC781AF5942} = {FE906D46-B113-4600-AC2C-7523937B96AB} + {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} + {8EA836C9-BE07-4EDE-A983-122A1D9FB499} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} + {B7D7027F-F125-40DD-92A2-A5CEE9E969CC} = {232840A6-183C-4D3A-A086-582FD449D300} + {49DB6925-62FF-4CF3-A041-A7F117AD6256} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {09AD9DFA-6AD8-4872-AA96-29C3234828CD} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {5BD3D50F-5CB6-4554-9497-0F1680152D95} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {516A316F-BE2B-4931-88DD-4C08DECE8E56} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} + {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {F7DEBE88-8324-47F9-B240-4F19F706B50B} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} + {4FB42611-1B54-4ABF-988A-714EE9E8C492} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF} = {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC} = {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8} = {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} {74739F71-A6F5-4BDF-B398-46A84715FA9E} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9} = {74739F71-A6F5-4BDF-B398-46A84715FA9E} - {605A3653-C7E3-4EC2-8749-979E4A0227D0} = {74739F71-A6F5-4BDF-B398-46A84715FA9E} - {CC7ED747-8BCE-4B49-8855-AE4697792A81} = {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} - {50C13F5E-BA3A-4B04-A730-BAA584E051AB} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {C8AD2261-D325-414D-9B2D-B2A9D27C242F} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9} = {02B35A90-23DF-4341-89CF-E911ED210FBE} {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} - {354D1855-EE83-41EF-BFFC-1348F77A66DB} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} - {2A57A40F-92F5-4ACE-95AA-763915578282} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} {08FED323-7D60-4B8B-AD36-C55B40C96D1C} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} - {B44F4054-5B66-4937-A99D-216DEFBAD0EF} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} {2A8759AF-76F5-4F6A-8420-D2890B612AB2} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B} = {2A8759AF-76F5-4F6A-8420-D2890B612AB2} - {E85FA5C9-C7D9-4461-99DE-11675749E38E} = {2A8759AF-76F5-4F6A-8420-D2890B612AB2} {33D4C640-954B-4468-95A4-2322DAB0B184} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {F6E5B615-A85D-4FB4-97D0-698098D7616F} = {33D4C640-954B-4468-95A4-2322DAB0B184} - {A4F3852E-DC6B-43A8-A40A-899089546444} = {33D4C640-954B-4468-95A4-2322DAB0B184} - {675D2886-B4E9-4B14-A02D-44B5204EE2E0} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} {CD7414D5-4DE9-4339-B833-29EF41B3AC76} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} - {36629279-FD56-452B-88C2-5C8271500042} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} = {83AA938C-9182-4E65-A42A-79CAE68888E9} - {66DEC85C-7433-4902-B01A-8F98D1A87385} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} {FF832650-37C7-48FF-B078-77CACF37966E} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} - {8BE42490-F83D-48D7-8C5D-1665AC84229C} = {FF832650-37C7-48FF-B078-77CACF37966E} - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2} = {FF832650-37C7-48FF-B078-77CACF37966E} {46DE49C1-D700-4C46-849A-7F485D87A518} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11} = {46DE49C1-D700-4C46-849A-7F485D87A518} - {472122D3-114E-424D-AF47-B3D7E94057A8} = {46DE49C1-D700-4C46-849A-7F485D87A518} {6B1042A4-A6D5-4307-B163-803164E4A742} = {83AA938C-9182-4E65-A42A-79CAE68888E9} - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {E2E68FF1-9CB5-424F-9D91-130A48462E54} = {6B1042A4-A6D5-4307-B163-803164E4A742} {BDA1DB4F-C408-445D-9391-EC9765CF7349} = {E747043D-81E2-4A89-8B5B-1258ED45F941} {215F07C3-74EE-4FAA-A821-09CF70B8C950} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {40D7AED3-982D-440B-BCD5-C1EFFC59514D} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {A1D7408C-AB95-4CFF-89F8-24797A865DBF} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {8680EA03-13A7-4F4A-A579-EB2CB6411C21} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {4CE930E3-12E4-4BFA-962E-3477B7AB6930} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {8903DCD8-A68D-4164-83EE-DE07385DDDD6} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} {70449866-CC6B-438B-B8DC-CBAB436EFD00} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} - {41817AD2-D1DA-4698-B87D-910524CE4B7A} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} - {C517C235-8969-478B-941B-2E40897F4C71} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} + {EE77C779-1031-4494-9850-3F2D85D8FA10} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} From 4690d9773d7a78ee0b00bb235e5b4e1bb8016ff0 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Tue, 2 Aug 2022 16:09:27 +0800 Subject: [PATCH 09/29] chore: remove src by utils --- Masa.Framework.sln | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index a6c3dfe9e..e34fbf49c 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -65,8 +65,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{5944A182-13B8-4DA6-AEE2-0A01E64A9648}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{801BB9FA-307C-4A93-A116-16BAEC637C1E}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Configuration.Tests\Masa.BuildingBlocks.Configuration.Tests.csproj", "{B228589B-4106-4CF8-B165-26636B94BE2C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD}" @@ -1883,7 +1881,6 @@ Global {DA816A33-F164-4456-92DD-A672BAD1A6B1} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {ABF6E41A-CBF9-49DE-87FC-9D88F440A104} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} {5944A182-13B8-4DA6-AEE2-0A01E64A9648} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} - {801BB9FA-307C-4A93-A116-16BAEC637C1E} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} {B228589B-4106-4CF8-B165-26636B94BE2C} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {08649D7D-EF5A-4626-9959-935CA85DF770} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} @@ -1896,14 +1893,6 @@ Global {7064C470-7D0B-4CE2-A80C-BEE376DDC956} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {E8CE3469-6E0F-495C-937E-D9820DE3DA89} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {46C33E74-835B-4CB4-861D-42A781A2502C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {02B35A90-23DF-4341-89CF-E911ED210FBE} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} - {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} - {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} - {F262689D-5BE8-45E9-B090-0CFF81315FB9} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} - {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} - {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} - {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} - {46C86695-A597-47F3-944E-03C63CA678F4} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} {DBD1137D-0208-4CF4-BB45-36FE023B4FED} = {02B35A90-23DF-4341-89CF-E911ED210FBE} {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B} = {02B35A90-23DF-4341-89CF-E911ED210FBE} {A93D1699-A8B1-432E-8929-5800F4FE5AA7} = {02B35A90-23DF-4341-89CF-E911ED210FBE} @@ -1920,13 +1909,11 @@ Global {7A628B6A-AFE4-4235-95AA-9A711268B9B1} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {E417DAE3-A1D2-430D-A6C7-C8BDE083D851} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {9A6A3012-6A11-415B-BC58-E2268BE7022E} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {7A8F1593-C00F-4D90-9029-11BF75B3C926} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} {0F43C687-59EF-4164-B3A5-E53C3BF86892} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} {BE11C98A-5680-491E-86E9-93B0A83909EA} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} {E2B9737D-9630-4705-B2DF-21C2EB607F65} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} {8C154ACF-ED6E-43C4-906E-2D36CBC8D112} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} - {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} = {801BB9FA-307C-4A93-A116-16BAEC637C1E} {CC117C03-267A-4145-B258-922C35484883} = {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} {1AD1F4E7-84DA-4CE8-BC69-7D713413560D} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} {9DEA348B-8915-4BAA-AE04-99BF5FC6131B} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} @@ -2090,6 +2077,16 @@ Global {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} = {6B1042A4-A6D5-4307-B163-803164E4A742} {70449866-CC6B-438B-B8DC-CBAB436EFD00} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} {EE77C779-1031-4494-9850-3F2D85D8FA10} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {02B35A90-23DF-4341-89CF-E911ED210FBE} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {7A8F1593-C00F-4D90-9029-11BF75B3C926} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {F262689D-5BE8-45E9-B090-0CFF81315FB9} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {46C86695-A597-47F3-944E-03C63CA678F4} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} From 0c1b44ce7aa102eb1a13788c4e6452578b872be0 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Tue, 2 Aug 2022 19:52:52 +0800 Subject: [PATCH 10/29] refactor: Refactor repo structure --- Directory.Build.props | 3 + Masa.Framework.sln | 3603 +++++++++-------- .../design => design}/CodeMap.dgml | 0 .../Caches/IApiResourceCache.cs | 0 .../Caches/IApiScopeCache.cs | 0 .../Caches/IClientCache.cs | 0 .../Caches/IIdentityResourceCache.cs | 0 ...ingBlocks.Authentication.Oidc.Cache.csproj | 14 + .../_Imports.cs | 0 .../Constants/GrantTypeConsts.cs | 0 .../Constants/GrantTypes.cs | 0 .../Entities/Abstract/Property.cs | 0 .../Entities/Abstract/Secret.cs | 0 .../Entities/ApiResource.cs | 0 .../Entities/ApiResourceClaim.cs | 0 .../Entities/ApiResourceProperty.cs | 0 .../Entities/ApiResourceScope.cs | 0 .../Entities/ApiResourceSecret.cs | 0 .../Entities/ApiScope.cs | 0 .../Entities/ApiScopeClaim.cs | 0 .../Entities/ApiScopeProperty.cs | 0 .../Entities/Client.cs | 0 .../Entities/ClientClaim.cs | 0 .../Entities/ClientCorsOrigin.cs | 0 .../Entities/ClientGrantType.cs | 0 .../Entities/ClientIdPRestriction.cs | 0 .../Entities/ClientPostLogoutRedirectUri.cs | 0 .../Entities/ClientProperty.cs | 0 .../Entities/ClientRedirectUri.cs | 0 .../Entities/ClientScope.cs | 0 .../Entities/ClientSecret.cs | 0 .../Entities/DeviceFlowCodes.cs | 0 .../Entities/IdentityResource.cs | 0 .../Entities/IdentityResourceClaim.cs | 0 .../Entities/IdentityResourceProperty.cs | 0 .../Entities/PersistedGrant.cs | 0 .../Entities/UserClaim.cs | 0 .../Enums/ClientTypes.cs | 0 .../Enums/TokenExpiration.cs | 0 .../Enums/TokenUsage.cs | 0 ...gBlocks.Authentication.Oidc.Domain.csproj} | 2 +- .../Repositories/IApiResourceRepository.cs | 0 .../Repositories/IApiScopeRepository.cs | 0 .../Repositories/IClientRepository.cs | 0 .../IIdentityResourceRepository.cs | 0 .../Repositories/IRepositoryBase.cs | 0 .../Repositories/IUserClaimRepository.cs | 0 .../_Imports.cs | 0 .../Constans/GrantType.cs | 0 .../Constans/GrantTypes.cs | 0 .../Constans/StandardIdentityResources.cs | 0 .../Constans/StandardUserClaims.cs | 0 .../Enums/AccessTokenType.cs | 0 .../Enums/TokenExpiration.cs | 0 .../Enums/TokenUsage.cs | 0 ...ngBlocks.Authentication.Oidc.Models.csproj | 0 .../Models/ApiResourceModel.cs | 0 .../Models/ApiScopeModel.cs | 0 .../Models/ClientClaimModel.cs | 0 .../Models/ClientModel.cs | 0 .../Models/DeviceCodeModel.cs | 0 .../Models/GrantType.cs | 0 .../Models/IdentityResourceModel.cs | 0 .../Models/PersistedGrantFilter.cs | 0 .../Models/PersistedGrantModel.cs | 0 .../Models/ResourceModel.cs | 0 .../Models/ResourcesModel.cs | 0 .../Models/SecretModel.cs | 0 .../_Imports.cs | 0 ...gBlocks.Authentication.Oidc.Storage.csproj | 2 +- .../Stores/IClientStore.cs | 0 .../Stores/IDeviceFlowStore.cs | 0 .../Stores/IPersistedGrantStore.cs | 0 .../Stores/IResourceStore.cs | 0 .../_Imports.cs | 0 .../AbstractConfigurationRepository.cs | 0 .../ConfigurationTypes.cs | 0 .../IConfigurationApi.cs | 0 .../IConfigurationApiClient.cs | 0 .../IConfigurationApiManage.cs | 0 .../IConfigurationRepository.cs | 0 .../IMasaConfiguration.cs | 0 .../IMasaConfigurationBuilder.cs | 0 .../IRepositoryChangeListener.cs | 0 .../Masa.BuildingBlocks.Configuration.csproj | 0 .../Options/ConfigurationRelationOptions.cs | 0 .../Options/IMasaConfigurationOptions.cs | 0 .../Options/MasaConfigurationOptions.cs | 0 .../Properties.cs | 0 .../SectionTypes.cs | 0 .../_Imports.cs | 0 ....BuildingBlocks.Configuration.Tests.csproj | 3 +- .../TestProperties.cs | 0 .../_Imports.cs | 0 .../DataFiltering/IDataFilter.cs | 0 .../DataFiltering/ISoftDelete.cs | 0 .../Masa.BuildingBlocks.Data.Contracts.csproj | 0 .../Paginated/BasePaginatedList.cs | 0 .../_Imports.cs | 0 .../BaseDbConnectionStringProvider.cs | 0 .../DefaultConcurrencyStampProvider.cs | 0 .../Concurrency/IConcurrencyStampProvider.cs | 0 .../Concurrency/IHasConcurrencyStamp.cs | 0 .../ConnectionStringNameAttribute.cs | 0 .../ConnectionStrings.cs | 0 .../Enum/SequentialGuidType.cs | 0 .../Enum/TimestampType.cs | 0 .../IConnectionStringProvider.cs | 0 .../IDbConnectionStringProvider.cs | 0 .../IDistributedLock.cs | 0 .../IMasaDbContext.cs | 0 .../IdGenerator/IGuidGenerator.cs | 0 .../IdGenerator/IIdGenerator.cs | 0 .../IdGenerator/ISequentialGuidGenerator.cs | 0 .../IdGenerator/ISnowflakeGenerator.cs | 0 .../IdGenerator/IdGeneratorFactory.cs | 0 .../Masa.BuildingBlocks.Data.csproj | 0 .../Options/MasaDbConnectionOptions.cs | 0 .../MasaDbContextConfigurationOptions.cs | 0 .../System/SequentialGuid.cs | 0 .../System/Snowflake.cs | 0 .../src}/Masa.BuildingBlocks.Data/_Imports.cs | 0 .../IMapping.cs | 0 .../Mapper.cs | 0 .../Masa.BuildingBlocks.Data.Mapping.csproj | 0 .../Options/Enum/MapMode.cs | 0 .../Options/MapOptions.cs | 0 .../_Imports.cs | 0 ...ildingBlocks.Data.MappingExtensions.csproj | 0 .../ObjectExtensions.cs | 0 .../_Imports.cs | 0 .../CommitState.cs | 0 .../EntityState.cs | 0 .../ITransaction.cs | 0 .../IUnitOfWork.cs | 0 .../IUnitOfWorkAccessor.cs | 0 .../IUnitOfWorkManager.cs | 0 .../Masa.BuildingBlocks.Data.UoW.csproj | 2 +- .../Masa.BuildingBlocks.Data.UoW/_Imports.cs | 0 .../Entities/AggregateRoot.cs | 0 .../Entities/Auditing/AuditAggregateRoot.cs | 0 .../Entities/Auditing/AuditEntity.cs | 0 .../Entities/Auditing/IAuditAggregateRoot.cs | 0 .../Entities/Auditing/IAuditEntity.cs | 0 .../Entities/Entity.cs | 0 .../Entities/Full/FullAggregateRoot.cs | 0 .../Entities/Full/FullEntity.cs | 0 .../Entities/Full/IFullAggregateRoot.cs | 0 .../Entities/Full/IFullEntity.cs | 0 .../Entities/IAggregateRoot.cs | 0 .../Entities/IEntity.cs | 0 .../Entities/IGenerateDomainEvents.cs | 0 .../Events/DomainCommand.cs | 0 .../Events/DomainEvent.cs | 0 .../Events/DomainQuery.cs | 0 .../Events/IDomainCommand.cs | 0 .../Events/IDomainEvent.cs | 0 .../Events/IDomainEventBus.cs | 0 .../Events/IDomainQuery.cs | 0 .../Events/IIntegrationDomainEvent.cs | 0 .../Events/IntegrationDomainEvent.cs | 0 .../Masa.BuildingBlocks.Ddd.Domain.csproj | 16 + .../Repositories/BaseRepository.cs | 0 .../Repositories/IRepository.cs | 0 .../Repositories/PaginatedList.cs | 0 .../Repositories/PaginatedOptions.cs | 0 .../SeedWork/Enumeration.cs | 0 .../Services/IDomainService.cs | 0 .../Specifications/BaseSpecification.cs | 0 .../Specifications/ISpecification.cs | 0 .../Values/ValueObject.cs | 0 .../_Imports.cs | 0 ...asa.BuildingBlocks.Ddd.Domain.Tests.csproj | 2 +- .../TestEntity.cs | 0 .../TestValueObject.cs | 0 .../_Imports.cs | 0 src/BuildingBlocks/Directory.Build.props | 20 - .../Event.cs | 0 .../IDispatcherOptions.cs | 0 .../IEvent.cs | 0 .../IEventBus.cs | 0 .../IEventBusBuilder.cs | 0 .../IEventHandler.cs | 0 .../IMiddleware.cs | 0 .../ISagaEventHandler.cs | 0 ...sa.BuildingBlocks.Dispatcher.Events.csproj | 0 .../Middleware.cs | 0 .../_Imports.cs | 0 .../IDistributedDispatcherOptions.cs | 0 .../IIntegrationEvent.cs | 0 .../IIntegrationEventBus.cs | 0 .../ITopic.cs | 0 .../IntegrationEvent.cs | 0 .../IntegrationEventStates.cs | 0 .../Logs/IIntegrationEventLogService.cs | 0 .../Logs/IntegrationEventLog.cs | 0 ...Blocks.Dispatcher.IntegrationEvents.csproj | 14 + .../_Imports.cs | 0 .../DefaultTypeConvertProvider.cs | 0 .../Entities/IIdentityUser.cs | 0 .../Entities/IdentityRole.cs | 0 .../Entities/IdentityUser.cs | 0 .../Isolation/IIsolatedIdentityUser.cs | 0 .../IMultiEnvironmentIdentityUser.cs | 0 .../Isolation/IMultiTenantIdentityUser.cs | 0 .../Isolation/IsolatedIdentityUser.cs | 0 .../Isolation/MultiEnvironmentIdentityUser.cs | 0 .../Isolation/MultiTenantIdentityUser.cs | 0 .../Enum/IdentityType.cs | 0 .../IIsolatedUserContext.cs | 0 .../IMultiEnvironmentUserContext.cs | 0 .../IMultiTenantUserContext.cs | 0 .../ITypeConvertProvider.cs | 0 .../IUserContext.cs | 0 .../IUserSetter.cs | 0 .../Internal/DisposeAction.cs | 0 ...ildingBlocks.Identity.IdentityModel.csproj | 0 .../UserContext.cs | 0 .../_Imports.cs | 0 .../Environment/IEnvironmentContext.cs | 0 .../Environment/IEnvironmentSetter.cs | 0 .../Environment/IMultiEnvironment.cs | 0 .../IConvertProvider.cs | 0 .../IIsolation.cs | 0 .../IIsolationBuilder.cs | 0 .../IParserProvider.cs | 0 .../Masa.BuildingBlocks.Isolation.csproj | 2 +- .../Middleware/IIsolationMiddleware.cs | 0 .../MultiTenant/IMultiTenant.cs | 0 .../MultiTenant/ITenantContext.cs | 0 .../MultiTenant/ITenantSetter.cs | 0 .../MultiTenant/Tenant.cs | 0 .../Options/IsolationDbConnectionOptions.cs | 0 .../Options/IsolationOptions.cs | 0 .../Parser/CookieParserProvider.cs | 0 .../EnvironmentVariablesParserProvider.cs | 0 .../Parser/FormParserProvider.cs | 0 .../Parser/HeaderParserProvider.cs | 0 .../Parser/HttpContextItemParserProvider.cs | 0 .../Parser/QueryStringParserProvider.cs | 0 .../Parser/RouteParserProvider.cs | 0 .../Masa.BuildingBlocks.Isolation/_Imports.cs | 0 src/BuildingBlocks/Masa.BuildingBlocks.sln | 285 -- src/BuildingBlocks/README.md | 67 - src/BuildingBlocks/README.zh-CN.md | 65 - .../Commands/Command.cs | 0 .../Commands/ICommand.cs | 0 .../Commands/ICommandHandler.cs | 0 ...ildingBlocks.ReadWriteSpliting.Cqrs.csproj | 14 + .../Queries/IQuery.cs | 0 .../Queries/IQueryHandler.cs | 0 .../Queries/Query.cs | 0 .../_Imports.cs | 0 ...cks.ReadWriteSpliting.EventSourcing.csproj | 0 .../AutoCompleteDocument.cs | 0 .../BaseAutoCompleteClient.cs | 0 .../IAutoCompleteClient.cs | 0 .../IAutoCompleteFactory.cs | 0 ...ingBlocks.SearchEngine.AutoComplete.csproj | 0 .../Options/AutoCompleteOptions.cs | 0 .../Options/SetOptions.cs | 0 .../Response/DeleteMultiResponse.cs | 0 .../Response/DeleteRangeResponseItems.cs | 0 .../Response/DeleteResponse.cs | 0 .../Response/GetResponse.cs | 0 .../Response/ResponseBase.cs | 0 .../Response/SetResponse.cs | 0 .../Response/SetResponseItems.cs | 0 .../SearchType.cs | 0 .../_Imports.cs | 0 .../CustomAutoCompleteClient.cs | 0 ...cks.SearchEngine.AutoComplete.Tests.csproj | 2 +- .../TestAutoCompleteClient.cs | 0 .../_Imports.cs | 0 .../AbstractCaller.cs | 0 .../AddCallerExtensions.cs | 0 .../CallerBase.cs | 0 .../ICaller.cs | 0 .../ICallerFactory.cs | 0 .../IRequestMessage.cs | 0 .../IResponseMessage.cs | 0 .../ITypeConvertor.cs | 0 .../Masa.BuildingBlocks.Service.Caller.csproj | 0 .../Masa.Utils.Caller.Core.csproj | 0 .../Options/CallerFactoryOptions.cs | 0 .../Options/CallerOptions.cs | 0 .../Options/CallerRelationOptions.cs | 0 .../_Imports.cs | 0 .../IService.cs | 0 ....BuildingBlocks.Service.MinimalAPIs.csproj | 0 .../_Imports.cs | 0 .../BaseMessage.cs | 0 .../BaseRequest.cs | 0 .../BaseResponse.cs | 0 ...sa.BuildingBlocks.Service.Contracts.csproj | 0 .../Enum/GenderTypes.cs | 0 .../Enum/StaffTypes.cs | 0 .../Enum/SubjectTypes.cs | 0 .../Enum/TeamTypes.cs | 0 ...dingBlocks.StackSdks.Auth.Contracts.csproj | 0 .../Model/AddUserModel.cs | 0 .../Model/AddressValueModel.cs | 0 .../Model/AppModel.cs | 0 .../Model/CollectMenuModel.cs | 0 .../Model/DisableUserModel.cs | 0 .../Model/MenuModel.cs | 0 .../Model/NavModel.cs | 0 .../Model/ProjectModel.cs | 0 .../Model/RoleModel.cs | 0 .../Model/StaffDetailModel.cs | 0 .../Model/StaffModel.cs | 0 .../Model/SubjectModel.cs | 0 .../Model/TeamDetailModel.cs | 0 .../Model/TeamModel.cs | 0 .../Model/TeamPersonnelModel.cs | 0 .../Model/UpdateUserBasicInfoModel.cs | 0 .../Model/UpdateUserPasswordModel.cs | 0 .../Model/UpsertUserModel.cs | 0 .../Model/UserModel.cs | 0 .../Model/UserPortraitModel.cs | 0 .../Model/UserSimpleModel.cs | 0 .../Model/UserVisitedModel.cs | 0 .../_Imports.cs | 0 .../IAuthClient.cs | 0 .../IEnvironmentProvider.cs | 0 .../Masa.BuildingBlocks.StackSdks.Auth.csproj | 0 .../Service/IPermissionService.cs | 0 .../Service/IProjectService.cs | 0 .../Service/ISubjectService.cs | 0 .../Service/ITeamService.cs | 0 .../Service/IUserService.cs | 0 .../_Imports.cs | 0 .../IDccClient.cs | 0 .../Masa.BuildingBlocks.StackSdks.Dcc.csproj | 0 .../Model/LabelModel.cs | 0 .../Service/ILabelService.cs | 0 .../_Imports.cs | 0 .../Enum/ChannelTypes.cs | 0 .../Enum/MessageTaskReceiverTypes.cs | 0 .../Enum/MessageTaskSelectReceiverTypes.cs | 0 .../Enum/MessageTaskSources.cs | 0 .../Enum/MessageTaskStatuses.cs | 0 .../Enum/MessageTemplateAuditStatuses.cs | 0 .../Enum/MessageTemplateStates.cs | 0 .../Enum/MessageTypes.cs | 0 .../Enum/ReceiverGroupItemTypes.cs | 0 .../Enum/SendTargets.cs | 0 .../Enum/WebsiteMessageFilterType.cs | 0 .../IMcClient.cs | 0 .../ExtraPropertyDictionary.cs | 0 .../Masa.BuildingBlocks.StackSdks.Mc.csproj | 2 +- .../Model/AuditEntityModel.cs | 0 .../Model/ChannelModel.cs | 0 .../Model/EntityModel.cs | 0 .../Model/GetChannelModel.cs | 0 .../Model/GetMessageTemplateModel.cs | 0 .../Model/GetNoticeListModel.cs | 0 .../Model/GetReceiverGroupModel.cs | 0 .../Model/GetWebsiteMessageModel.cs | 0 .../Model/MessageInfoModel.cs | 0 .../Model/MessageInfoUpsertModel.cs | 0 .../Model/MessageTaskModel.cs | 0 .../Model/MessageTaskReceiverModel.cs | 0 .../Model/MessageTemplateItemModel.cs | 0 .../Model/MessageTemplateModel.cs | 0 .../Model/PaginatedListModel.cs | 0 .../Model/PaginatedOptionsModel.cs | 0 .../Model/ReadAllWebsiteMessageModel.cs | 0 .../Model/ReadWebsiteMessageModel.cs | 0 .../Model/ReceiverGroupItemModel.cs | 0 .../Model/ReceiverGroupModel.cs | 0 .../Model/SendOrdinaryMessageModel.cs | 0 .../Model/SendRuleModel.cs | 0 .../Model/SendTemplateMessageModel.cs | 0 .../Model/WebsiteMessageChannelModel.cs | 0 .../Model/WebsiteMessageModel.cs | 0 .../Service/IChannelService.cs | 0 .../Service/IMessageTaskService.cs | 0 .../Service/IMessageTemplateService.cs | 0 .../Service/IReceiverGroupService.cs | 0 .../Service/IWebsiteMessageService.cs | 0 .../_Imports.cs | 0 .../Enum/AppTypes.cs | 0 .../Enum/ServiceTypes.cs | 0 .../IPmClient.cs | 0 .../Masa.BuildingBlocks.StackSdks.Pm.csproj | 0 .../Model/AppDetailModel.cs | 0 .../Model/AppModel.cs | 0 .../Model/BaseModel.cs | 0 .../Model/ClusterDetailModel.cs | 0 .../Model/ClusterModel.cs | 0 .../Model/EnvironmentClusterModel.cs | 0 .../Model/EnvironmentDetailModel.cs | 0 .../Model/EnvironmentModel.cs | 0 .../Model/ProjectAppsModel.cs | 0 .../Model/ProjectDetailModel.cs | 0 .../Model/ProjectModel.cs | 0 .../Model/ProjectTypeModel.cs | 0 .../Service/IAppService.cs | 0 .../Service/IClusterService.cs | 0 .../Service/IEnvironmentService.cs | 0 .../Service/IProjectService.cs | 0 .../_Imports.cs | 0 .../Enum/HttpMethods.cs | 0 .../Enum/HttpVerifyTypes.cs | 0 .../Enum/JobTypes.cs | 0 .../Enum/RunTimeoutStrategyTypes.cs | 0 .../Enum/ScheduleBlockStrategyTypes.cs | 0 .../Enum/ScheduleExpiredStrategyTypes.cs | 0 .../ISchedulerClient.cs | 0 .../ISchedulerJob.cs | 0 ....BuildingBlocks.StackSdks.Scheduler.csproj | 0 .../Model/JobContext.cs | 0 .../Model/SchedulerJobAppConfig.cs | 0 ...SchedulerJobDaprServiceInvocationConfig.cs | 0 .../Model/SchedulerJobHttpConfig.cs | 0 .../Request/AddSchedulerJobRequest.cs | 0 .../Request/BaseSchedulerJobRequest.cs | 0 .../Request/BaseSchedulerTaskRequest.cs | 0 .../Request/ChangeEnabledStatusRequest.cs | 0 .../Request/StartSchedulerTaskRequest.cs | 0 .../Service/ISchedulerJobService.cs | 0 .../Service/ISchedulerTaskService.cs | 0 .../_Imports.cs | 0 .../Enums/AggregationTypes.cs | 0 .../ITscClient.cs | 0 .../Masa.BuildingBlocks.StackSdks.Tsc.csproj | 0 .../Model/Log/FieldAggregationRequest.cs | 0 .../Model/Log/LogAggregationRequest.cs | 0 .../Model/Log/LogLatestRequest.cs | 0 .../Model/Metric/LableValuesRequest.cs | 0 .../Model/Metric/ValuesRequest.cs | 0 .../Service/ILogService.cs | 0 .../Service/IMetricService.cs | 0 .../_Imports.cs | 0 .../BucketNameAttribute.cs | 0 .../BucketNames.cs | 0 .../DefaultClientContainer.cs | 0 .../DefaultClientFactory.cs | 0 .../IBucketNameProvider.cs | 0 .../IClient.cs | 0 .../IClientContainer.cs | 0 .../IClientFactory.cs | 0 ...uildingBlocks.Storage.ObjectStorage.csproj | 0 .../Response/TemporaryCredentialsResponse.cs | 0 .../StorageOptions.cs | 0 .../_Imports.cs | 0 ...ingBlocks.Authentication.Oidc.Cache.csproj | 14 - .../Masa.BuildingBlocks.Ddd.Domain.csproj | 16 - ...Blocks.Dispatcher.IntegrationEvents.csproj | 14 - ...ildingBlocks.ReadWriteSpliting.Cqrs.csproj | 14 - .../Caches/ApiResourceCache.cs | 0 .../Caches/ApiScopeCache.cs | 0 .../Caches/ClientCache.cs | 0 .../Caches/IdentityResourceCache.cs | 0 ...a.Contrib.Authentication.Oidc.Cache.csproj | 15 + .../Models/CacheKeyConstants.cs | 0 .../Models/Mapper.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../Utils/CollectionExtensions.cs | 0 .../_Imports.cs | 0 .../Caches/SyncCache.cs | 0 .../DbContexts/OidcDbContext.cs | 0 ...ApiResourceClaimEntityTypeConfiguration.cs | 0 .../ApiResourceEntityTypeConfiguration.cs | 0 ...ResourcePropertyEntityTypeConfiguration.cs | 0 ...ApiResourceScopeEntityTypeConfiguration.cs | 0 ...piResourceSecretEntityTypeConfiguration.cs | 0 .../ApiScopeClaimEntityTypeConfiguration.cs | 0 .../ApiScopeEntityTypeConfiguration.cs | 0 ...ApiScopePropertyEntityTypeConfiguration.cs | 0 .../ClientClaimEntityTypeConfiguration.cs | 0 ...ClientCorsOriginEntityTypeConfiguration.cs | 0 .../ClientEntityTypeConfiguration.cs | 0 .../ClientGrantTypeEntityTypeConfiguration.cs | 0 ...ntIdPRestrictionEntityTypeConfiguration.cs | 0 ...ogoutRedirectUriEntityTypeConfiguration.cs | 0 .../ClientPropertyEntityTypeConfiguration.cs | 0 ...lientRedirectUriEntityTypeConfiguration.cs | 0 .../ClientScopeEntityTypeConfiguration.cs | 0 .../ClientSecretEntityTypeConfiguration.cs | 0 .../DeviceFlowCodesEntityTypeConfiguration.cs | 0 ...ityResourceClaimEntityTypeConfiguration.cs | 0 ...IdentityResourceEntityTypeConfiguration.cs | 0 ...ResourcePropertyEntityTypeConfiguration.cs | 0 .../PersistedGrantEntityTypeConfiguration.cs | 0 .../UserClaimEntityTypeConfiguration.cs | 0 ...entication.Oidc.EntityFrameworkCore.csproj | 19 + .../Options/OidcDbContextOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../Repositories/ApiResourceRepository.cs | 0 .../Repositories/ApiScopeRepository.cs | 0 .../Repositories/ClientRepository.cs | 0 .../IdentityResourceRepository.cs | 0 .../Repositories/UserClaimRepository.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 ...b.Authentication.Oidc.Cache.Storage.csproj | 4 +- .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../Stores/ClientStore.cs | 0 .../Stores/DeviceFlowStore.cs | 0 .../Stores/PersistedGrantStore.cs | 0 .../Stores/ResourceStore.cs | 0 .../_Imports.cs | 0 .../ConfigurationOptions.cs | 0 .../DefaultConfigurationApi.cs | 0 .../DefaultMasaConfiguration.cs | 0 .../DefaultMasaConfigurationSourceProvider.cs | 0 .../IMasaConfigurationSourceProvider.cs | 0 .../Internal/ConfigurationExtensions.cs | 0 .../LocalMasaConfigurationOptions.cs | 0 .../LocalMasaConfigurationRepository.cs | 0 .../Masa.Contrib.Configuration.csproj | 2 +- .../MasaConfigurationBuilder.cs | 0 .../MasaConfigurationExtensions.cs | 0 .../MasaConfigurationProvider.cs | 0 .../MasaConfigurationSource.cs | 0 .../MasaRelationOptions.cs | 0 .../src}/Masa.Contrib.Configuration/README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../WebApplicationBuilderExtensions.cs | 0 .../Masa.Contrib.Configuration/_Imports.cs | 0 .../EsOptions.cs | 0 ...AutoMap.NoArgumentConstructor.Tests.csproj | 2 +- .../KafkaOptions.cs | 0 ...Contrib.Configuration.AutoMap.Tests.csproj | 2 +- .../Config/MountSectionRedisOptions.cs | 0 .../Config/RabbitMqOptions.cs | 0 .../Config/RedisOptions.cs | 0 .../Config/SystemOptions.cs | 0 .../ConfigurationTest.cs | 0 .../Masa.Contrib.Configuration.Tests.csproj | 2 +- .../_Imports.cs | 0 .../appsettings.json | 0 .../customAppConfig.json | 0 .../rabbitMq.json | 0 .../redis.json | 0 .../ConfigurationApiClient.cs | 0 .../ConfigurationApiExtensions.cs | 0 .../ConfigurationApiManage.cs | 0 .../Internal/ConfigFormats.cs | 0 .../Internal/ConfigurationApiBase.cs | 0 .../Internal/Constants.cs | 0 .../Internal/DccConfigurationRepository.cs | 0 .../Internal/DccFactory.cs | 0 .../Internal/Model/Property.cs | 0 .../Internal/Model/PublishRelease.cs | 0 .../Internal/Model/StaticConfig.cs | 0 .../Internal/Options/DccOptions.cs | 0 .../Parser/JsonConfigurationParser.cs | 0 .../Parser/PropertyConfigurationParser.cs | 0 .../Internal/Parser/XmlConfigurationParser.cs | 0 ....Configuration.ConfigurationApi.Dcc.csproj | 24 + .../MasaConfigurationExtensions.cs | 0 ...onfigurationApiMasaConfigurationOptions.cs | 0 .../Options/DccConfigurationOptions.cs | 0 .../Options/DccExpandSectionOptions.cs | 0 .../Options/DccSectionOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../CustomMemoryCacheClientFactory.cs | 0 .../DccClientTest.cs | 0 .../DccManageTest.cs | 0 .../DccTest.cs | 0 .../Internal/Common/SerializeCommon.cs | 0 .../Internal/Config/Property.cs | 0 .../Internal/Config/PublishRelease.cs | 0 .../Internal/CustomConfigurationApiClient.cs | 0 .../Internal/CustomTrigger.cs | 0 .../Internal/Enum/ConfigFormats.cs | 0 .../Internal/Model/Brands.cs | 0 ...guration.ConfigurationApi.Dcc.Tests.csproj | 6 +- .../_Imports.cs | 0 .../appsettings.json | 0 .../expandSections.json | 0 .../DataFiltering/DataFilter.cs | 0 .../SoftDeleteSaveChangesFilter.cs | 0 .../Internal/DataFilterState.cs | 0 .../Internal/DisposeAction.cs | 0 .../Internal/InstanceBuilder.cs | 0 .../Internal/NullDisposable.cs | 0 .../Masa.Contrib.Data.Contracts.EF.csproj | 4 +- .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../Options/FilterOptions.cs | 0 .../_Imports.cs | 0 .../DataFilterTest.cs | 0 ...asa.Contrib.Data.Contracts.EF.Tests.csproj | 2 +- .../_Imports.cs | 0 .../DefaultLocalDistributedLock.cs | 0 .../ArgumentNullOrWhiteSpaceException.cs | 0 .../Internal/DisposeAction.cs | 0 ....Contrib.Data.DistributedLock.Local.csproj | 15 + .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../LocalDistributedLockTest.cs | 0 ...ib.Data.DistributedLock.Local.Tests.csproj | 2 +- .../_Imports.cs | 0 ...ata.DistributedLock.Medallion.Azure.csproj | 0 .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...istributedLock.Medallion.FileSystem.csproj | 0 .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...ata.DistributedLock.Medallion.MySql.csproj | 2 +- .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...ta.DistributedLock.Medallion.Oracle.csproj | 2 +- .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...istributedLock.Medallion.PostgreSql.csproj | 2 +- .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../ConfigurationOptionsExtensions.cs | 0 ...ata.DistributedLock.Medallion.Redis.csproj | 2 +- .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...DistributedLock.Medallion.SqlServer.csproj | 2 +- .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...stributedLock.Medallion.WaitHandles.csproj | 0 .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...DistributedLock.Medallion.ZooKeeper.csproj | 0 .../MedallionBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../DefaultMedallionDistributedLock.cs | 0 .../ArgumentNullOrWhiteSpaceException.cs | 0 .../Internal/DisposeAction.cs | 0 ...trib.Data.DistributedLock.Medallion.csproj | 18 + .../MedallionBuilder.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../DefaultMedallionDistributedLockTest.cs | 0 ...ata.DistributedLock.Medallion.Tests.csproj | 0 .../_Imports.cs | 0 .../Internal/Parser.cs | 0 ...rib.Data.EntityFrameworkCore.Cosmos.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...b.Data.EntityFrameworkCore.InMemory.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...trib.Data.EntityFrameworkCore.MySql.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...rib.Data.EntityFrameworkCore.Oracle.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...ta.EntityFrameworkCore.Pomelo.MySql.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...Data.EntityFrameworkCore.PostgreSql.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ....Data.EntityFrameworkCore.SqlServer.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...rib.Data.EntityFrameworkCore.Sqlite.csproj | 0 .../MasaDbContextBuilderExtensions.cs | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../DbConnectionStringProvider.cs | 0 .../DefaultConnectionStringProvider.cs | 0 .../EntityTypeBuilderExtensions.cs | 0 .../Filters/ISaveChangesFilter.cs | 0 .../Filters/SaveChangeFilter.cs | 0 .../IModelCreatingProvider.cs | 0 ...sa.Contrib.Data.EntityFrameworkCore.csproj | 10 +- .../MasaDbContext.cs | 0 .../MasaDbContextBuilder.cs | 0 .../MasaDbContextOptions.cs | 0 .../MasaDbContextOptionsBuilder.cs | 0 .../MasaDbContextOptionsBuilder`.cs | 0 .../MasaDbContextOptions`.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../CustomDbContext.cs | 0 .../DbContextTest.cs | 0 .../DefaultConnectionStringProviderTest.cs | 0 .../Internal/PaginatedOptions.cs | 0 .../Internal/Repository.cs | 0 ...trib.Data.EntityFrameworkCore.Tests.csproj | 6 +- .../Models/Address.cs | 0 .../Models/Hobby.cs | 0 .../Models/Student.cs | 0 .../TestBase.cs | 0 .../_Imports.cs | 0 ...Contrib.Data.IdGenerator.NormalGuid.csproj | 2 +- .../NormalGuidGenerator.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 ...rib.Data.IdGenerator.SequentialGuid.csproj | 2 +- .../README.md | 0 .../README.zh-CN.md | 0 .../SequentialGuidGenerator.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 ...ta.IdGenerator.SequentialGuid.Tests.csproj | 0 .../SequentialGuidGeneratorTest.cs | 0 .../_Imports.cs | 0 .../Benchmarks.cs | 0 ...ta.IdGenerator.Snowflake.Benchmarks.csproj | 2 +- .../Program.cs | 0 .../_Imports.cs | 0 .../DistributedBenchmarks.cs | 0 ...wflake.Distributed.Redis.Benchmarks.csproj | 8 +- .../Program.cs | 0 .../_Imports.cs | 0 .../BaseRedis.cs | 0 .../DistributedIdGeneratorOptions.cs | 0 .../DistributedWorkerProvider.cs | 0 .../IdGeneratorOptionsExtensions.cs | 0 .../Internal/SnowflakeExtensions.cs | 0 .../MachineClockIdGenerator.cs | 0 ...nerator.Snowflake.Distributed.Redis.csproj | 14 + .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../BaseIdGenerator.cs | 0 .../DefaultWorkerProvider.cs | 0 .../IWorkerProvider.cs | 0 .../IdGeneratorOptions.cs | 0 .../Internal/Const.cs | 0 .../Internal/EnironmentExtensions.cs | 0 .../Internal/SnowflakeExtensions.cs | 0 .../Internal/SnowflakeIdGenerator.cs | 0 .../Internal/WorkerIdBackgroundServices.cs | 0 .../MachineClockIdGenerator.cs | 0 ....Contrib.Data.IdGenerator.Snowflake.csproj | 19 + .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../CustomDistributedWorkerProvider.cs | 0 .../IdGeneratorTest.cs | 0 ...ib.Data.IdGenerator.Snowflake.Tests.csproj | 2 +- .../_Imports.cs | 0 .../DefaultMapper.cs | 0 .../DefaultMappingConfigProvider.cs | 0 .../IMappingConfigProvider.cs | 0 .../Internal/InvokeBuilder.cs | 0 .../Internal/Options/MapTypeOptions.cs | 0 .../Internal/TypeAdapterSetterExpand.cs | 0 .../Masa.Contrib.Data.Mapping.Mapster.csproj | 4 +- .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../BaseMappingTest.cs | 0 .../Domain/Aggregates/Orders/Order.cs | 0 .../Domain/Aggregates/Orders/OrderItem.cs | 0 .../Domain/Aggregates/Users/User.cs | 0 .../Domain/ValueObjects/AddressItem.cs | 0 .../MappingExtensionsTest.cs | 0 .../MappingFormTest.cs | 0 .../MappingTest.cs | 0 ....Contrib.Data.Mapping.Mapster.Tests.csproj | 4 +- .../Requests/AddressItemRequest.cs | 0 .../Requests/Orders/OrderItemRequest.cs | 0 .../Requests/Orders/OrderMultiRequest.cs | 0 .../Requests/Orders/OrderRequest.cs | 0 .../Requests/Users/CreateFullUserRequest.cs | 0 .../Requests/Users/CreateUserRequest.cs | 0 .../_Imports.cs | 0 .../DefaultConnectionStringProvider.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../Internal/Const.cs | 0 .../Masa.Contrib.Data.UoW.EF.csproj | 6 +- .../src}/Masa.Contrib.Data.UoW.EF/README.md | 0 .../Masa.Contrib.Data.UoW.EF/README.zh-CN.md | 0 .../Masa.Contrib.Data.UoW.EF/Transaction.cs | 0 .../Masa.Contrib.Data.UoW.EF/UnitOfWork.cs | 0 .../UnitOfWorkAccessor.cs | 0 .../UnitOfWorkManager.cs | 0 .../src}/Masa.Contrib.Data.UoW.EF/_Imports.cs | 0 .../CustomDbContext.cs | 0 .../Masa.Contrib.Data.UoW.EF.Tests.csproj | 6 +- .../TestBase.cs | 0 .../TestUnitOfWork.cs | 0 .../_Imports.cs | 0 .../appsettings.json | 0 .../DispatcherOptionsExtensions.cs | 0 .../Internal/LinqExtensions.cs | 0 .../ServiceCollectionRepositoryExtensions.cs | 0 .../Internal/TypeExtensions.cs | 0 ...sa.Contrib.Ddd.Domain.Repository.EF.csproj | 2 +- .../README.md | 0 .../README.zh-CN.md | 0 .../Repository.cs | 0 .../_Imports.cs | 0 .../Masa.Contrib.Ddd.Domain/DomainEventBus.cs | 0 .../Masa.Contrib.Ddd.Domain/DomainService.cs | 0 .../Masa.Contrib.Ddd.Domain.csproj | 2 +- .../Options/DispatcherOptions.cs | 0 .../src}/Masa.Contrib.Ddd.Domain/README.md | 0 .../Masa.Contrib.Ddd.Domain/README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../src}/Masa.Contrib.Ddd.Domain/_Imports.cs | 0 .../Domain/Entities/Address.cs | 0 .../Domain/Entities/OrderItem.cs | 0 .../Domain/Entities/Orders.cs | 0 ...trib.Ddd.Domain.Repository.EF.Tests.csproj | 6 +- .../RepositoryTest.cs | 0 .../_Imports.cs | 0 src/Contrib/Directory.Build.props | 20 - .../{ => Dispatcher/Events}/docs/LoadEvent.md | 0 .../Benchmarks.cs | 0 .../AddShoppingCartEventHandler.cs | 0 .../Extensions/EventHandlers/CouponHandler.cs | 0 .../Extensions/Events/AddShoppingCartEvent.cs | 0 .../Extensions/Events/RegisterUserEvent.cs | 0 .../Middleware/LoggingMiddleware.cs | 0 ...ontrib.Dispatcher.Events.Benchmarks.csproj | 2 +- .../Program.cs | 0 .../_Imports.cs | 0 .../DefaultExceptionStrategyProvider.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../Enums/FailureLevels.cs | 0 .../EventBus.cs | 0 .../EventBusBuilder.cs | 0 .../EventHandlerAttribute.cs | 0 .../IExceptionStrategyProvider.cs | 0 .../IInitializeServiceProvider.cs | 0 .../Dispatch/DispatchRelationNetwork.cs | 0 .../Internal/Dispatch/Dispatcher.cs | 0 .../Internal/Dispatch/DispatcherBase.cs | 0 .../Internal/Dispatch/SagaDispatcher.cs | 0 .../Internal/DispatcherExtensions.cs | 0 .../Internal/Expressions/InvokeBuilder.cs | 0 .../Internal/InitializeServiceProvider.cs | 0 .../Middleware/TransactionMiddleware.cs | 0 .../Masa.Contrib.Dispatcher.Events.csproj | 23 + .../Options/DispatchRelationOptions.cs | 0 .../Options/DispatcherOptions.cs | 0 .../Masa.Contrib.Dispatcher.Events/README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../Strategies/ExecutionStrategy.cs | 0 .../Strategies/IExecutionStrategy.cs | 0 .../Strategies/StrategyOptions.cs | 0 .../_Imports.cs | 0 .../EventHandlers/AddGoodsHandler.cs | 0 .../Events/AddGoodsEvent.cs | 0 ....Events.CheckMethodsParameter.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/DeleteGoodsHandler.cs | 0 .../Events/DeleteGoodsEvent.cs | 0 ....CheckMethodsParameterNotNull.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/AddCatalogHandler.cs | 0 .../Events/AddCatalogEvent.cs | 0 ...nts.CheckMethodsParameterType.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/AddBasketHandler.cs | 0 .../Events/AddBasketEvent.cs | 0 ...tcher.Events.CheckMethodsType.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/Handler.cs | 0 .../Events/CalculateEvent.cs | 0 ...ispatcher.Events.HandlerOrder.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/UserEventHandler.cs | 0 .../Events/BindPhoneNumberEvent.cs | 0 ...cher.Events.OnlyCancelHandler.Tests.csproj | 2 +- .../_Imports.cs | 0 .../EventHandlers/EditCategoryHandler.cs | 0 .../Events/EditCategoryEvent.cs | 0 ...tcher.Events.OrderEqualBySaga.Tests.csproj | 2 +- .../_Imports.cs | 0 .../AssemblyResolutionTests.cs | 0 .../ChoreTest.cs | 0 .../ChangePasswordEventHandler.cs | 0 .../EventHandlers/MarketingEventHandler.cs | 0 .../OrderPaymentSucceededEventHandler.cs | 0 .../EventHandlers/RegisterUserEventHandler.cs | 0 .../EventHandlers/ShipOrderEventHandler.cs | 0 .../EventHandlers/ShoppingCardEventHandler.cs | 0 .../EventHandlers/TransferEventHandler.cs | 0 .../Events/AddShoppingCartEvent.cs | 0 .../Events/AddUserEvent.cs | 0 .../Events/ChangePasswordEvent.cs | 0 .../Events/ComputeEvent.cs | 0 .../Events/DeductionMoneyEvent.cs | 0 .../Events/IncreaseMoneyEvent.cs | 0 .../OrderPaymentFailedIntegrationEvent.cs | 0 .../Events/OrderPaymentSucceededEvent.cs | 0 .../Events/RegisterUserEvent.cs | 0 .../Events/SendCouponEvent.cs | 0 .../Events/ShipOrderEvent.cs | 0 .../Events/TransferEvent.cs | 0 .../FeaturesTest.cs | 0 ...asa.Contrib.Dispatcher.Events.Tests.csproj | 3 +- .../Middleware/LoggingMiddleware.cs | 0 .../SagaTest.cs | 0 .../TestBase.cs | 0 .../_Imports.cs | 0 .../DispatcherOptionsExtensions.cs | 0 ...b.Dispatcher.IntegrationEvents.Dapr.csproj | 4 +- .../Options/DispatcherOptions.cs | 0 .../Publisher.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../IntegrationEventLogContext.cs | 0 ...egrationEventLogEntityTypeConfiguration.cs | 0 ...ntegrationEventLogModelCreatingProvider.cs | 0 .../IntegrationEventLogService.cs | 0 ...cher.IntegrationEvents.EventLogs.EF.csproj | 6 +- .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../IProcessingServer.cs | 0 .../IProcessor.cs | 0 .../IPublisher.cs | 0 .../IntegrationEventBus.cs | 0 .../IntegrationEventHostedService.cs | 0 .../Internal/IntegrationEventLogItem.cs | 0 .../Internal/LocalQueueProcessor.cs | 0 ...ontrib.Dispatcher.IntegrationEvents.csproj | 19 + .../Options/DispatcherOptions.cs | 0 .../DeleteLocalQueueExpiresProcessor.cs | 0 .../DeletePublishedExpireEventProcessor.cs | 0 .../Processor/InfiniteLoopProcessor.cs | 0 .../Processor/ProcessorBase.cs | 0 .../Processor/RetryByDataProcessor.cs | 0 .../Processor/RetryByLocalQueueProcessor.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../Servers/DefaultHostedService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../DispatcherOptionTest.cs | 0 .../IntegrationEventBusTest.cs | 0 ...atcher.IntegrationEvents.Dapr.Tests.csproj | 3 +- .../ProcessorTest.cs | 0 .../_Imports.cs | 0 .../Domain/Entities/User.cs | 0 .../Events/IntegrationEvent.cs | 0 .../OrderPaymentSucceededIntegrationEvent.cs | 0 .../Infrastructure/CustomDbContext.cs | 0 .../IntegrationEventLogContextTest.cs | 0 .../IntegrationEventLogServiceTest.cs | 0 ...ntegrationEvents.EventLogs.EF.Tests.csproj | 4 +- .../TestBase.cs | 0 .../_Imports.cs | 0 .../BackgroundServiceTest.cs | 0 .../DispatcherOptionTest.cs | 0 .../Events/CreateUserEvent.cs | 0 .../Events/PaySuccessedIntegrationEvent.cs | 0 .../Events/RegisterUserIntegrationEvent.cs | 0 .../CustomIntegrationEventHostedService.cs | 0 .../CustomIntegrationEventLogService.cs | 0 .../Infrastructure/CustomProcessor.cs | 0 .../IntegrationEventBusTest.cs | 0 ....Dispatcher.IntegrationEvents.Tests.csproj | 2 +- .../ProcessorTest.cs | 0 .../_Imports.cs | 0 .../ClaimExtensions.cs | 0 .../Const/ClaimType.cs | 0 .../DefaultIsolatedUserContext.cs | 0 .../DefaultMultiEnvironmentUserContext.cs | 0 .../DefaultMultiTenantUserContext.cs | 0 .../DefaultUserContext.cs | 0 .../HttpContextCurrentPrincipalAccessor.cs | 0 .../ICurrentPrincipalAccessor.cs | 0 .../IdentityClaimOptions.cs | 0 ...Masa.Contrib.Identity.IdentityModel.csproj | 18 + .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../ThreadCurrentPrincipalAccessor.cs | 0 .../_Imports.cs | 0 ...ontrib.Identity.IdentityModel.Tests.csproj | 2 +- .../TestIdentity.cs | 0 .../_Imports.cs | 0 ...efaultIsolationConnectionStringProvider.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../IsolationBuilder.cs | 0 .../IsolationBuilderExtensions.cs | 0 .../IsolationDbContextProvider.cs | 0 .../Masa.Contrib.Isolation.csproj | 18 + .../Middleware/IsolationMiddleware.cs | 0 .../src}/Masa.Contrib.Isolation/README.md | 0 .../Masa.Contrib.Isolation/README.zh-CN.md | 0 .../src}/Masa.Contrib.Isolation/_Imports.cs | 0 .../Masa.Contrib.Isolation.Tests.csproj | 6 +- .../RequestCookieCollection.cs | 0 ...TestDbIsolationConnectionStringProvider.cs | 0 .../TestIsolation.cs | 0 .../TestParserProvider.cs | 0 .../UnitOfWorkAccessor.cs | 0 .../Masa.Contrib.Isolation.Tests/_Imports.cs | 0 .../EnvironmentContext.cs | 0 .../IsolationBuilderExtensions.cs | 0 ....Contrib.Isolation.MultiEnvironment.csproj | 14 + .../Middleware/MultiEnvironmentMiddleware.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 ...ib.Isolation.MultiEnvironment.Tests.csproj | 2 +- .../TestEnvironment.cs | 0 .../TestMiddleware.cs | 0 .../_Imports.cs | 0 .../ConvertProvider.cs | 0 .../IsolationBuilderExtensions.cs | 0 .../Masa.Contrib.Isolation.MultiTenant.csproj | 14 + .../Middleware/MultiTenantMiddleware.cs | 0 .../MultiTenantOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../TenantContext.cs | 0 .../_Imports.cs | 0 ...Contrib.Isolation.MultiTenant.Tests.csproj | 2 +- .../TestMiddleware.cs | 0 .../TestTenant.cs | 0 .../_Imports.cs | 0 .../DispatcherOptionsExtensions.cs | 0 .../Internal/TypeExtensions.cs | 0 .../IsolationDbContext.cs | 0 .../IsolationSaveChangesFilter.cs | 0 .../Masa.Contrib.Isolation.UoW.EF.csproj | 4 +- .../Masa.Contrib.Isolation.UoW.EF/README.md | 0 .../README.zh-CN.md | 0 .../Masa.Contrib.Isolation.UoW.EF/_Imports.cs | 0 .../CustomDbContext.cs | 0 ...Masa.Contrib.Isolation.UoW.EF.Tests.csproj | 12 +- .../TestBase.cs | 0 .../TestIsolation.cs | 0 .../_Imports.cs | 0 .../appsettings.json | 0 .../CustomDbContext.cs | 0 .../EdgeDriverTest.cs | 0 .../EventHandlers/AddRoleEventHandler.cs | 0 .../EventHandlers/RegisterUserEventHandler.cs | 0 .../Events/AddRoleEvent.cs | 0 .../Events/RegisterUserEvent.cs | 0 ....Contrib.Isolation.UoW.EF.Web.Tests.csproj | 35 + .../TestBase.cs | 0 .../_Imports.cs | 0 .../appsettings.json | 0 src/Contrib/README.md | 105 - src/Contrib/README.zh-CN.md | 104 - .../Commands/CommandHandler.cs | 0 ...Masa.Contrib.ReadWriteSpliting.Cqrs.csproj | 2 +- .../Queries/QueryHandler.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../Commands/CreateProductionCommand.cs | 0 .../CqrsTest.cs | 0 .../CreateProductionCommandHandler.cs | 0 ...ontrib.ReadWriteSpliting.Cqrs.Tests.csproj | 4 +- .../ProductionQueryHandler.cs | 0 .../Queries/ProductionItemQuery.cs | 0 .../_Imports.cs | 0 .../AutoCompleteClient.cs | 0 .../AutoCompleteFactory.cs | 0 ...chEngine.AutoComplete.ElasticSearch.csproj | 4 +- .../Options/AutoCompleteOptions.cs | 0 .../Options/AutoCompleteRelationsOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../AutoCompleteTest.cs | 0 ...ne.AutoComplete.ElasticSearch.Tests.csproj | 2 +- .../Model/Employee.cs | 0 .../_Imports.cs | 0 .../CallerOptionsExtensions.cs | 0 .../DaprCaller.cs | 0 .../DaprCallerBase.cs | 0 .../DefaultDaprClientBuilder.cs | 0 .../HttpMessageHandlerBuilder.cs | 0 .../IDaprRequestMessage.cs | 0 ...a.Contrib.Service.Caller.DaprClient.csproj | 2 +- .../MasaDaprClientBuilder.cs | 0 .../MasaDaprClientBuilderExtensions.cs | 0 .../Options/CallerDaprClientOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../CallerOptionsExtensions.cs | 0 .../HttpClientCaller.cs | 0 .../HttpClientCallerBase.cs | 0 ...a.Contrib.Service.Caller.HttpClient.csproj | 2 +- .../MasaHttpClientBuilder.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../_Imports.cs | 0 .../DefaultCallerFactory.cs | 0 .../DefaultRequestMessage.cs | 0 .../DefaultResponseMessage.cs | 0 .../DefaultTypeConvertor.cs | 0 .../Internal/CallerDependExtensions.cs | 0 .../Internal/ErrorMessages.cs | 0 .../Internal/Options/PropertyInfoMember.cs | 0 .../Internal/XmlUtils.cs | 0 .../JsonRequestMessage.cs | 0 .../Masa.Contrib.Service.Caller.csproj | 14 + .../Masa.Contrib.Service.Caller/README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../XmlRequestMessage.cs | 0 .../Masa.Contrib.Service.Caller/_Imports.cs | 0 .../AutomaticCallerTest.cs | 0 .../CallerTest.cs | 0 .../Callers/DaprCaller.cs | 0 .../Callers/GithubCaller.cs | 0 .../Callers/RoleCaller.cs | 0 .../Callers/UserCaller.cs | 0 .../Callers/UserDaprCallerBase.cs | 0 .../DefaultDaprRequestMessage.cs | 0 ...ervice.Caller.AutomaticCaller.Tests.csproj | 6 +- .../_Imports.cs | 0 .../CallerTest.cs | 0 .../CustomHttpClientCaller.cs | 0 .../DefaultXmlResponseMessage.cs | 0 .../HttpClientCallerTest.cs | 0 .../Masa.Contrib.Service.Caller.Tests.csproj | 6 +- .../Queries/UserDetailQuery.cs | 0 .../Queries/UserListQuery.cs | 0 .../Requesties/RegisterUser.cs | 0 .../Response/BaseResponse.cs | 0 .../TypeConvertTest.cs | 0 .../Utils/XmlUtils.cs | 0 .../_Imports.cs | 0 .../Masa.Contrib.Service.MinimalAPIs.csproj | 18 + .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceBase.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 ...a.Contrib.Service.MinimalAPIs.Tests.csproj | 2 +- .../MinimalAPITest.cs | 0 .../Services/CustomService.cs | 0 .../_Imports.cs | 0 .../Masa.Contrib.StackSdks.Auth/AuthClient.cs | 0 .../Masa.Contrib.StackSdks.Auth/Constants.cs | 0 .../EnvironmentProvider.cs | 0 .../HttpEnvironmentDelegatingHandler.cs | 0 .../Masa.Contrib.StackSdks.Auth.csproj | 22 + .../Masa.Contrib.StackSdks.Auth/README.md | 0 .../README.zh-CN.md | 0 .../Service/PermissionService.cs | 0 .../Service/ProjectService.cs | 0 .../Service/SubjectService.cs | 0 .../Service/TeamService.cs | 0 .../Service/UserService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.StackSdks.Auth/_Imports.cs | 0 .../AuthClientTest.cs | 0 .../Masa.Contrib.StackSdks.Auth.Tests.csproj | 6 +- .../PermissionServiceTest.cs | 0 .../ProjectServiceTest.cs | 0 .../SubjectServiceTest.cs | 0 .../TeamServiceTest.cs | 0 .../UserServiceTest.cs | 0 .../_Imports.cs | 0 .../Masa.Contrib.StackSdks.Dcc/DccClient.cs | 0 .../Internal/Constants.cs | 0 .../Masa.Contrib.StackSdks.Dcc.csproj | 16 + .../src}/Masa.Contrib.StackSdks.Dcc/README.md | 0 .../README.zh-CN.md | 0 .../Service/LabelService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.StackSdks.Dcc/_Imports.cs | 0 .../DccClientTest.cs | 0 .../LabelServiceTest.cs | 0 .../Masa.Contrib.StackSdks.Dcc.Tests.csproj | 4 +- .../_Imports.cs | 0 .../appsettings.json | 0 .../Masa.Contrib.StackSdks.Mc/Constants.cs | 0 ...ttpClientAuthorizationDelegatingHandler.cs | 0 .../Extensions/DictionaryExtensions.cs | 0 .../Extensions/ExtraPropertiesExtensions.cs | 0 .../Infrastructure/Helper/TypeHelper.cs | 0 .../Masa.Contrib.StackSdks.Mc.csproj | 15 + .../Masa.Contrib.StackSdks.Mc/McClient.cs | 0 .../Service/ChannelService.cs | 0 .../Service/MessageTaskService.cs | 0 .../Service/MessageTemplateService.cs | 0 .../Service/ReceiverGroupService.cs | 0 .../Service/WebsiteMessageService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.StackSdks.Mc/_Imports.cs | 0 .../ChannelServiceTest.cs | 0 .../Masa.Contrib.StackSdks.Mc.Tests.csproj | 4 +- .../McClientTest.cs | 0 .../MessageTaskServiceTest.cs | 0 .../MessageTemplateServiceTest.cs | 0 .../ReceiverGroupServiceTest.cs | 0 .../WebsiteMessageServiceTest.cs | 0 .../_Imports.cs | 0 .../Masa.Contrib.StackSdks.Pm/Constants.cs | 0 .../Masa.Contrib.StackSdks.Pm.csproj | 18 + .../Masa.Contrib.StackSdks.Pm/PmClient.cs | 0 .../src}/Masa.Contrib.StackSdks.Pm/README.md | 0 .../Masa.Contrib.StackSdks.Pm/README.zh-CN.md | 0 .../Service/AppService.cs | 0 .../Service/ClusterService.cs | 0 .../Service/EnvironmentService.cs | 0 .../Service/ProjectService.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.StackSdks.Pm/_Imports.cs | 0 .../AppServiceTest.cs | 0 .../ClusterServiceTest.cs | 0 .../EnvironmentServiceTest.cs | 0 .../Masa.Contrib.StackSdks.Pm.Tests.csproj | 4 +- .../PmClientTest.cs | 0 .../ProjectServiceTest.cs | 0 .../_Imports.cs | 0 .../Constants.cs | 0 ...ttpClientAuthorizationDelegatingHandler.cs | 0 .../Masa.Contrib.StackSdks.Scheduler.csproj | 20 + .../README.md | 0 .../README.zh-CN.md | 0 .../SchedulerClient.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Services/SchedulerJobService.cs | 0 .../Services/SchedulerTaskService.cs | 0 .../_Imports.cs | 0 ...a.Contrib.StackSdks.Scheduler.Tests.csproj | 4 +- .../SchedulerClientTest.cs | 0 .../SchedulerJobServiceTest.cs | 0 .../SchedulerTaskServiceTest.cs | 0 .../_Imports.cs | 0 .../Extensions/CallerProviderExtensions.cs | 0 .../Extensions/ServiceExtensions.cs | 0 .../Extensions/StreamExtensions.cs | 0 .../Logging/OpenTelemetryLoggingExtensions.cs | 0 .../Masa.Contrib.StackSdks.Tsc.csproj | 6 +- .../MasaObservableOptions.cs | 0 .../Metrics/MasaServiceExtensions.cs | 0 .../OpenTelemetryAttributeName.cs | 0 .../OpenTemetry/ResourceBuilderExtenstions.cs | 0 .../src}/Masa.Contrib.StackSdks.Tsc/README.md | 0 .../README.zh-CN.md | 0 .../Service/LogService.cs | 0 .../Service/MetricService.cs | 0 .../Tracing/ActivityExtensions.cs | 0 ...NetCoreInstrumentationOptionsExtensions.cs | 0 .../Tracing/MasaServiceExtensions.cs | 0 .../OpenTelemetryInstrumentationOptions.cs | 0 .../Masa.Contrib.StackSdks.Tsc/TscClient.cs | 0 .../Masa.Contrib.StackSdks.Tsc/_Imports.cs | 0 .../CallerProviderExtensionsTests.cs | 0 .../Masa.Contrib.StackSdks.Tsc.Tests.csproj | 4 +- .../Service/LogServiceTests.cs | 0 .../Service/MetricServiceTests.cs | 0 .../_Imports.cs | 0 .../BaseClient.cs | 0 .../BucketNameProvider.cs | 0 .../DefaultCredentialProvider.cs | 0 .../DefaultOssClientFactory.cs | 0 .../DefaultStorageClient.cs | 0 .../IAliyunStorageOptionProvider.cs | 0 .../ICredentialProvider.cs | 0 .../IOssClientFactory.cs | 0 .../Internal/Const.cs | 0 .../DefaultAliyunStorageOptionProvider.cs | 0 .../Internal/ObjectStorageExtensions.cs | 0 .../Internal/Response/UploadObjectResponse.cs | 0 ...ontrib.Storage.ObjectStorage.Aliyun.csproj | 4 +- .../Options/AliyunOptions.cs | 0 .../Options/AliyunStorageConfigureOptions.cs | 0 .../Options/AliyunStorageOptions.cs | 0 .../Options/AliyunStsOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../BaseTest.cs | 0 .../CustomCredentialProvider.cs | 0 .../CustomNullClient.cs | 0 .../CustomizeClient.cs | 0 ....Storage.ObjectStorage.Aliyun.Tests.csproj | 2 +- .../StorageContainer.cs | 0 .../TestALiYunStorageOptions.cs | 0 .../TestClient.cs | 0 .../TestCredentialProvider.cs | 0 .../TestStorage.cs | 0 .../_Imports.cs | 0 .../appsettings.json | 0 ...a.Contrib.Authentication.Oidc.Cache.csproj | 15 - ...entication.Oidc.EntityFrameworkCore.csproj | 19 - ....Configuration.ConfigurationApi.Dcc.csproj | 24 - ....Contrib.Data.DistributedLock.Local.csproj | 15 - ...trib.Data.DistributedLock.Medallion.csproj | 18 - ...nerator.Snowflake.Distributed.Redis.csproj | 14 - ....Contrib.Data.IdGenerator.Snowflake.csproj | 19 - .../Masa.Contrib.Dispatcher.Events.csproj | 23 - ...ontrib.Dispatcher.IntegrationEvents.csproj | 19 - ...Masa.Contrib.Identity.IdentityModel.csproj | 18 - ....Contrib.Isolation.MultiEnvironment.csproj | 14 - .../Masa.Contrib.Isolation.MultiTenant.csproj | 14 - .../Masa.Contrib.Isolation.csproj | 18 - .../Masa.Contrib.Service.Caller.csproj | 13 - .../Masa.Contrib.Service.MinimalAPIs.csproj | 18 - .../Masa.Contrib.StackSdks.Auth.csproj | 23 - .../Masa.Contrib.StackSdks.Dcc.csproj | 16 - .../Masa.Contrib.StackSdks.Mc.csproj | 15 - .../Masa.Contrib.StackSdks.Pm.csproj | 18 - .../Masa.Contrib.StackSdks.Scheduler.csproj | 20 - ....Contrib.Isolation.UoW.EF.Web.Tests.csproj | 35 - .../DependencyInjection/CachingBuilder.cs | 0 ...DistributedCacheClientBuilderExtensions.cs | 0 .../DependencyInjection/ICachingBuilder.cs | 0 .../DistributedCacheClientFactory.cs | 0 ...DistributedCacheClientFactoryExtensions.cs | 0 .../Helpers/SubscribeHelper.cs | 0 .../Interfaces/ICacheClient.cs | 0 .../Interfaces/ICacheClientFactory.cs | 0 .../Interfaces/IDistributedCacheClient.cs | 0 .../IDistributedCacheClientFactory.cs | 0 .../Masa.Utils.Caching.Core.csproj | 0 .../Models/CombinedCacheEntryOptions.cs | 0 .../Models/SubscribeKeyTypes.cs | 0 .../Models/SubscribeOperation.cs | 0 .../Models/SubscribeOptions.cs | 0 .../src}/Masa.Utils.Caching.Core/_Imports.cs | 0 ...lientFactoryServiceCollectionExtensions.cs | 0 .../Extensions/JsonSerializerExtensions.cs | 0 .../Extensions/RedisExtensions.cs | 0 .../Helpers/RedisHelper.cs | 0 .../Internal/Enum/CompressMode.cs | 0 .../Masa.Utils.Caching.Redis.csproj | 3 +- .../Models/RedisConfigurationOptions.cs | 0 .../Models/RedisServerOptions.cs | 0 .../RedisCacheClient.cs | 0 .../RedisCacheClientFactory.cs | 0 .../src}/Masa.Utils.Caching.Redis/_Imports.cs | 0 .../ConvertToValueTest.cs | 0 .../Masa.Utils.Caching.Redis.Tests.csproj | 2 +- .../_Imports.cs | 0 .../MemoryCacheClientBuilderExtensions.cs | 0 ...heClientFactoryCachingBuilderExtensions.cs | 0 .../Interfaces/IMemoryCacheClient.cs | 0 .../Interfaces/IMemoryCacheClientFactory.cs | 0 ...asa.Utils.Caching.DistributedMemory.csproj | 2 +- .../MemoryCacheClient.cs | 0 .../MemoryCacheClientFactory.cs | 0 .../MemoryCacheClientFactoryExtensions.cs | 0 .../Models/MasaMemoryCacheOptions.cs | 0 .../_Imports.cs | 0 .../Masa.Utils.Caching.Memory.csproj | 0 .../Masa.Utils.Caching.Memory/MemoryCache.cs | 0 .../Masa.Utils.Caching.Memory/_Imports.cs | 0 .../AbstractCallerProvider.cs | 0 .../AddCallerExtensions.cs | 0 .../src}/Masa.Utils.Caller.Core/CallerBase.cs | 0 .../Masa.Utils.Caller.Core/CallerOptions.cs | 0 .../DefaultCallerFactory.cs | 0 .../DefaultRequestIdGenerator.cs | 0 .../DefaultRequestMessage.cs | 0 .../DefaultResponseMessage.cs | 0 .../DefaultTypeConvertProvider.cs | 0 .../Masa.Utils.Caller.Core/ICallerFactory.cs | 0 .../Masa.Utils.Caller.Core/ICallerProvider.cs | 0 .../IRequestIdGenerator.cs | 0 .../Masa.Utils.Caller.Core/IRequestMessage.cs | 0 .../IResponseMessage.cs | 0 .../ITypeConvertProvider.cs | 0 .../Internal/CallerDependExtensions.cs | 0 .../Internal/CallerRelations.cs | 0 .../Masa.Utils.Caller.Core/Internal/Const.cs | 0 .../Internal/Options/PropertyInfoMember.cs | 0 .../JsonRequestMessage.cs | 0 .../Masa.Utils.Caller.Core.csproj | 2 +- .../src}/Masa.Utils.Caller.Core/README.md | 0 .../Masa.Utils.Caller.Core/README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../src}/Masa.Utils.Caller.Core/_Imports.cs | 0 .../CallerOptionsExtensions.cs | 0 .../DaprCallerBase.cs | 0 .../DaprCallerProvider.cs | 0 .../Masa.Utils.Caller.DaprClient.csproj | 0 .../MasaDaprClientBuilder.cs | 0 .../Masa.Utils.Caller.DaprClient/README.md | 0 .../README.zh-CN.md | 0 .../Masa.Utils.Caller.DaprClient/_Imports.cs | 0 .../CallerOptionsExtensions.cs | 0 .../HttpClientCallerBase.cs | 0 .../HttpClientCallerProvider.cs | 0 .../Masa.Utils.Caller.HttpClient.csproj | 0 .../MasaHttpClientBuilder.cs | 0 .../Masa.Utils.Caller.HttpClient/README.md | 0 .../README.zh-CN.md | 0 .../Masa.Utils.Caller.HttpClient/_Imports.cs | 0 .../CustomHttpClientCallerProvider.cs | 0 .../Application/Queries/UserDetailQury.cs | 0 .../Application/Queries/UserListQury.cs | 0 .../Application/Requesties/RegisterUser.cs | 0 .../Application/Response/BaseResponse.cs | 0 .../AutomaticCallerTest.cs | 0 .../Masa.Utils.Caller.Tests/CallerTest.cs | 0 .../HttpClientCallerTest.cs | 0 .../Infrastructure/Callers/DaprCaller.cs | 0 .../Infrastructure/Callers/GithubCaller.cs | 0 .../Infrastructure/Callers/RoleCaller.cs | 0 .../Infrastructure/Callers/UserCaller.cs | 0 .../Callers/UserDaprCallerBase.cs | 0 .../DefaultXmlResponseMessage.cs | 0 .../Infrastructure/Utils/XmlUtils.cs | 0 .../Infrastructure/XmlRequestMessage.cs | 0 .../Masa.Utils.Caller.Tests.csproj | 6 +- .../TypeConvertTest.cs | 0 .../test/Masa.Utils.Caller.Tests/_Imports.cs | 0 .../Masa.Utils.Configuration.Dcc.csproj | 0 .../AppSettings.cs | 0 .../JsonConfiguration.cs | 0 .../JsonFileOptions.cs | 0 .../Masa.Utils.Configuration.Json.csproj | 0 .../DataAnnotations/MinCountAttribute.cs | 0 .../DataAnnotations/NonDefaultAttribute.cs | 0 .../Masa.Utils.Data.DataAnnotations.csproj | 0 .../_Imports.cs | 0 ...sa.Utils.Data.DataAnnotations.Tests.csproj | 2 +- .../MinCountAttributeTests.cs | 0 .../NonDefaultAttributeTests.cs | 0 .../TokenFilters/IPinYinTokenFilter.cs | 0 .../PinYinTokenFilterDescriptor.cs | 0 .../Masa.Utils.Data.Elasticsearch/Const.cs | 0 .../DefaultElasticsearchFactory.cs | 0 .../DefaultMasaElasticClient.cs | 0 .../ElasticsearchOptions.cs | 0 .../ElasticsearchRelations.cs | 0 .../IElasticsearchFactory.cs | 0 .../IMasaElasticClient.cs | 0 .../BulkOperation/BulkDeleteOperation.cs | 0 .../Internal/DeleteMultiExtensions.cs | 0 .../Masa.Utils.Data.Elasticsearch.csproj | 0 .../MasaElasticsearchBuilder.cs | 0 .../Options/Alias/BindAliasIndexOptions.cs | 0 .../Options/Alias/UnBindAliasIndexOptions.cs | 0 .../Options/ConnectionSettingsOptions.cs | 0 .../Document/Count/CountDocumentRequest.cs | 0 .../Create/CreateDocumentItemRequest.cs | 0 .../Document/Create/CreateDocumentRequest.cs | 0 .../Create/CreateMultiDocumentRequest.cs | 0 .../Document/Delete/DeleteDocumentRequest.cs | 0 .../Delete/DeleteMultiDocumentRequest.cs | 0 .../Options/Document/DocumentOptions.cs | 0 .../Document/Exist/ExistDocumentRequest.cs | 0 .../Document/Get/GetDocumentRequest.cs | 0 .../Document/Get/GetMultiDocumentRequest.cs | 0 .../Document/Query/PaginatedOptions.cs | 0 .../Document/Query/QueryBaseOptions.cs | 0 .../Options/Document/Query/QueryOptions.cs | 0 .../Set/SetDocumentItemBaseRequest.cs | 0 .../Document/Set/SetDocumentRequest.cs | 0 .../Document/SingleDocumentBaseRequest.cs | 0 .../Update/UpdateDocumentBaseRequest.cs | 0 .../Document/Update/UpdateDocumentRequest.cs | 0 .../Update/UpdateMultiDocumentRequest.cs | 0 .../Options/ElasticsearchRelationsOptions.cs | 0 .../Options/Index/CreateIndexOptions.cs | 0 .../Options/Index/DeleteIndexOptions.cs | 0 .../Options/StaticConnectionPoolOptions.cs | 0 .../Masa.Utils.Data.Elasticsearch/README.md | 0 .../README.zh-CN.md | 0 .../Response/Alias/BulkAliasResponse.cs | 0 .../Response/Alias/GetAliasResponse.cs | 0 .../Response/BulkResponse.cs | 0 .../Response/BulkResponseItems.cs | 0 .../Response/CreateMultiResponse.cs | 0 .../Response/CreateResponse.cs | 0 .../Response/DeleteMultiResponse.cs | 0 .../Response/DeleteRangeResponseItems.cs | 0 .../Response/DeleteResponse.cs | 0 .../Document/ClearDocumentResponse.cs | 0 .../Document/CountDocumentResponse.cs | 0 .../Response/ExistsResponse.cs | 0 .../Response/GetMultiResponse.cs | 0 .../Response/GetMultiResponseItems.cs | 0 .../Response/GetResponse.cs | 0 .../Response/Index/CreateIndexResponse.cs | 0 .../Response/Index/DeleteIndexResponse.cs | 0 .../Response/Index/GetIndexByAliasResponse.cs | 0 .../Response/Index/GetIndexResponse.cs | 0 .../Response/ResponseBase.cs | 0 .../Response/SearchPaginatedResponse.cs | 0 .../Response/SearchResponse.cs | 0 .../Response/SetResponse.cs | 0 .../Response/UpdateMultiResponse.cs | 0 .../Response/UpdateResponse.cs | 0 .../ServiceCollectionExtensions.Extensions.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Utils.Data.Elasticsearch/_Imports.cs | 0 .../DefaultMasaElasticClientTests.cs | 0 ...Masa.Utils.Data.Elasticsearch.Tests.csproj | 2 +- .../Models/AutoCompleteDocument.cs | 0 .../_Imports.cs | 0 .../Enums/ResultStatuses.cs | 0 .../Enums/ResultTypes.cs | 0 .../Extensions/CallerProviderExtensions.cs | 0 .../Extensions/ObjectExtensions.cs | 0 .../Extensions/StringExtensions.cs | 0 .../IMasaPrometheusClient.cs | 0 .../Masa.Utils.Data.Prometheus.csproj} | 2 +- .../MasaPrometheusClient.cs | 0 .../Reponse/Exemplar/ExemplarDataModel.cs | 0 .../Model/Reponse/Exemplar/ExemplarModel.cs | 0 .../Exemplar/ExemplarResultResponse.cs | 0 .../Reponse/MetaData/LabelResultResponse.cs | 0 .../Reponse/MetaData/SeriesResultResponse.cs | 0 .../Query/QueryResultCommonResponse.cs | 0 .../Reponse/Query/QueryResultDataResponse.cs | 0 .../Query/QueryResultInstantVectorResponse.cs | 0 .../Query/QueryResultMatrixRangeResponse.cs | 0 .../Model/Reponse/ResultBaseResponse.cs | 0 .../Model/Request/LableValueQueryRequest.cs | 0 .../Model/Request/MetaDataQueryRequest.cs | 0 .../Model/Request/QueryExemplarRequest.cs | 0 .../Model/Request/QueryRangeRequest.cs | 0 .../Model/Request/QueryRequest.cs | 0 .../src}/Masa.Utils.Data.Prometheus/README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Utils.Data.Prometheus/_Imports.cs | 0 .../Extensions/ObjectExtensionsTests.cs | 0 .../Extensions/StringExtensionsTests.cs | 0 .../Masa.Utils.Data.Prometheus.Test.csproj | 2 +- .../MasaPrometheusClientTests.cs | 0 .../UserStruct.cs | 0 .../_Imports.cs | 0 .../DaprBackgroundService.cs | 0 .../DefaultAppPortProvider.cs | 0 .../IAppPortProvider.cs | 0 ...a.Utils.Development.Dapr.AspNetCore.csproj | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../CommandLineBuilder.cs | 0 .../Configurations/DaprRuntimeOptions.cs | 0 .../DaprExtensions.cs | 0 .../DaprOptions.cs | 0 .../DaprProcess.cs | 0 .../DaprProvider.cs | 0 .../EnvironmentExtensions.cs | 0 .../IDaprProcess.cs | 0 .../IDaprProvider.cs | 0 .../Internal/CommandArgumentBuilder.cs | 0 .../Internal/Const.cs | 0 .../Internal/DaprCoreOptions.cs | 0 .../Internal/DaprProcessStatus.cs | 0 .../Internal/NetworkUtils.cs | 0 .../Internal/ProcessUtils.cs | 0 .../Masa.Utils.Development.Dapr/LogLevel.cs | 0 .../Masa.Utils.Development.Dapr.csproj | 0 .../Process/IProcess.cs | 0 .../Process/IProcessProvider.cs | 0 .../Process/ProcessProvider.cs | 0 .../Process/SystemProcess.cs | 0 .../Masa.Utils.Development.Dapr/Protocol.cs | 0 .../Masa.Utils.Development.Dapr/README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Utils.Development.Dapr/_Imports.cs | 0 src/Utils/Directory.Build.props | 18 - .../ApplicationBuilderExtensions.cs | 0 .../Extensions/MvcBuilderExtensions.cs | 0 .../Handlers/ExceptionHandlerMiddleware.cs | 0 .../Handlers/ExceptionHandlingMiddleware.cs | 0 .../Handlers/GlobalExceptionFilter.cs | 0 .../IMasaExceptionHandler.cs | 0 .../Internal/Constant.cs | 0 .../Internal/ExceptionExtensions.cs | 0 .../Internal/ExceptionHandlerExtensions.cs | 0 .../Internal/HttpResponseExtensions.cs | 0 .../Masa.Utils.Exceptions.csproj | 2 + .../Masa.Utils.Exceptions/MasaException.cs | 0 .../MasaExceptionContext.cs | 0 .../MasaHttpStatusCode.cs | 0 .../Options/MasaExceptionHandlerOptions.cs | 0 .../Options/MasaExceptionHandlingOptions.cs | 0 .../MasaExceptionLogRelationOptions.cs | 0 .../src/Masa.Utils.Exceptions/README.md | 0 .../src/Masa.Utils.Exceptions/README.zh-CN.md | 0 .../Results/DefaultExceptionResult.cs | 0 .../InternalServerErrorObjectResult.cs | 0 .../Results/UserFriendlyExceptionResult.cs | 0 .../UserFriendlyException.cs | 0 .../src/Masa.Utils.Exceptions/_Imports.cs | 0 .../BaseTypeProvider.cs | 0 .../DefaultServiceRegister.cs | 0 .../DefaultTypeProvider.cs | 0 .../DependencyAttribute.cs | 0 .../IAutoFireDependency.cs | 0 .../IScopedDependency.cs | 0 .../IServiceRegister.cs | 0 .../ISingletonDependency.cs | 0 .../ITransientDependency.cs | 0 .../ITypeProvider.cs | 0 .../IgnoreInjectionAttribute.cs | 0 ...tils.Extensions.DependencyInjection.csproj | 0 .../Options/ServiceDescriptorOptions.cs | 0 .../README.md | 0 .../README.zh-CN.md | 0 .../ServiceCollectionDescriptorExtensions.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../_Imports.cs | 0 .../DependencyInjectionTest.cs | 0 .../Domain/Models/User.cs | 0 .../Domain/Repositories/IRepository.cs | 0 .../Services/ICalculateProviderService.cs | 0 .../Domain/Services/IClientFactory.cs | 0 .../Repositories/BaseRepository.cs | 0 .../Infrastructure/Services/BaseService.cs | 0 .../Services/CustomizeClientFactory.cs | 0 .../Services/EmptyClientFactory.cs | 0 .../Services/GoodsBaseService.cs | 0 .../Infrastructure/Services/GoodsService.cs | 0 .../Services/NullCalculateProviderService.cs | 0 .../Services/OrderBaseService.cs | 0 .../Infrastructure/Services/OrderService.cs | 0 .../Services/UserBaseService.cs | 0 .../Infrastructure/Services/UserService.cs | 0 .../Infrastructure/UserDbContext.cs | 0 ...xtensions.DependencyInjection.Tests.csproj | 2 +- .../_Imports.cs | 0 .../Masa.Utils.Extensions.DotNet.csproj | 0 .../TypeExtensions.cs | 0 .../EnumExtensions.cs | 0 .../Masa.Utils.Extensions.Enums/EnumUtil.cs | 0 .../Masa.Utils.Extensions.Enums.csproj | 0 .../Model/EnumObject.cs | 0 .../src}/Masa.Utils.Extensions.Enums/_Enum.cs | 0 .../Masa.Utils.Extensions.Enums/_Imports.cs | 0 .../ExpressionExtensions.cs | 0 .../Masa.Utils.Extensions.Expressions.csproj | 0 .../_Imports.cs | 0 .../FluentValidationExtensions.cs | 0 ...nsions.Validations.FluentValidation.csproj | 0 .../RegularHelper.cs | 0 .../_Imports.cs | 0 .../Entries/LdapAddress.cs | 0 .../Entries/LdapUser.cs | 0 .../Extensions/LdapAttributeSetExtensions.cs | 0 .../Extensions/ServiceCollectionExtensions.cs | 0 .../Masa.Utils.Ldap.Novell/ILdapFactory.cs | 0 .../Masa.Utils.Ldap.Novell/ILdapProvider.cs | 0 .../Masa.Utils.Ldap.Novell/LdapFactory.cs | 0 .../Masa.Utils.Ldap.Novell/LdapOptions.cs | 0 .../Masa.Utils.Ldap.Novell/LdapProvider.cs | 0 .../Masa.Utils.Ldap.Novell.csproj | 0 .../src}/Masa.Utils.Ldap.Novell/_Imports.cs | 0 .../Masa.Utils.Ldap.Novell.Tests/LdapTest.cs | 0 .../Masa.Utils.Ldap.Novell.Tests.csproj | 2 +- .../Masa.Utils.Ldap.Novell.Tests/_Imports.cs | 0 .../appsettings.json | 0 src/Utils/Masa.Utils.sln | 320 -- .../Masa.Utils.Models.Config/AppConfig.cs | 0 .../Masa.Utils.Models.Config.csproj | 0 src/Utils/README.md | 74 - src/Utils/README.zh-CN.md | 74 - .../Attributes/MasaAuthorizeAttribute.cs | 0 .../Constants/MasaClaimTypes.cs | 0 .../Extensions/ClaimsIdentityExtensions.cs | 0 .../ICurrentPrincipalAccessor.cs | 0 .../Masa.Utils.Security.Authentication.csproj | 3 +- .../MasaUser.cs | 0 .../ThreadCurrentPrincipalAccessor.cs | 0 .../_Imports.cs | 0 ...curity.Authentication.OpenIdConnect.csproj | 0 .../MasaOpenIdConnectOptions.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../AesUtils.cs | 0 .../Base64Utils.cs | 0 .../DESEncryType.cs | 0 .../DesUtils.cs | 0 .../EncryptBase.cs | 0 .../EncryptType.cs | 0 .../FillType.cs | 0 .../GlobalConfigurationUtils.cs | 0 .../HashAlgorithmBase.cs | 0 .../MD5Utils.cs | 0 .../Masa.Utils.Security.Cryptography.csproj | 0 .../SHA1Utils.cs | 0 .../SHA256Utils.cs | 0 .../SHA384Utils.cs | 0 .../SHA512Utils.cs | 0 .../_Imports.cs | 0 .../AesTest.cs | 0 .../DesTest.cs | 0 ...a.Utils.Security.Cryptography.Tests.csproj | 2 +- .../_Imports.cs | 0 .../DefaultJwtProvider.cs | 0 .../Masa.Utils.Security.Token/IJwtProvider.cs | 0 .../Masa.Utils.Security.Token/JwtUtils.cs | 0 .../Masa.Utils.Security.Token.csproj | 0 .../Model/JwtConfigurationOptions.cs | 0 .../ServiceCollectionExtensions.cs | 0 .../Masa.Utils.Security.Token/_Imports.cs | 0 .../Masa.Utils.Data.Prometheus.csproj | 14 - .../Masa.EventBus.IntegrationTests.csproj | 16 +- 1755 files changed, 2435 insertions(+), 3528 deletions(-) rename {src/BuildingBlocks/design => design}/CodeMap.dgml (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs (100%) create mode 100644 src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs (100%) rename src/{Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa - Backup.Contrib.StackSdks.Dcc.csproj => BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj} (60%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Domain/src}/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Models/src}/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj (72%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs (100%) rename src/BuildingBlocks/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/Properties.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/SectionTypes.cs (100%) rename src/BuildingBlocks/{src/Configuration => Configuration/src}/Masa.BuildingBlocks.Configuration/_Imports.cs (100%) rename src/BuildingBlocks/{ => Configuration}/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj (83%) rename src/BuildingBlocks/{ => Configuration}/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs (100%) rename src/BuildingBlocks/{ => Configuration}/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Contracts/src}/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Contracts/src}/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Contracts/src}/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj (100%) rename src/BuildingBlocks/{src/Data => Data/Contracts/src}/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Contracts/src}/Masa.BuildingBlocks.Data.Contracts/_Imports.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/ConnectionStrings.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/Enum/TimestampType.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/IDistributedLock.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/IMasaDbContext.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/System/SequentialGuid.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/System/Snowflake.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Data/src}/Masa.BuildingBlocks.Data/_Imports.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Mapping/src}/Masa.BuildingBlocks.Data.Mapping/IMapping.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Mapping/src}/Masa.BuildingBlocks.Data.Mapping/Mapper.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Mapping/src}/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj (100%) rename src/BuildingBlocks/{src/Data => Data/Mapping/src}/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Mapping/src}/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Mapping/src}/Masa.BuildingBlocks.Data.Mapping/_Imports.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Mapping/src}/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj (100%) rename src/BuildingBlocks/{src/Data => Data/Mapping/src}/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs (100%) rename src/BuildingBlocks/{src/Data => Data/Mapping/src}/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs (100%) rename src/BuildingBlocks/{src/Data => Data/UoW/src}/Masa.BuildingBlocks.Data.UoW/CommitState.cs (100%) rename src/BuildingBlocks/{src/Data => Data/UoW/src}/Masa.BuildingBlocks.Data.UoW/EntityState.cs (100%) rename src/BuildingBlocks/{src/Data => Data/UoW/src}/Masa.BuildingBlocks.Data.UoW/ITransaction.cs (100%) rename src/BuildingBlocks/{src/Data => Data/UoW/src}/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs (100%) rename src/BuildingBlocks/{src/Data => Data/UoW/src}/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs (100%) rename src/BuildingBlocks/{src/Data => Data/UoW/src}/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs (100%) rename src/BuildingBlocks/{src/Data => Data/UoW/src}/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj (68%) rename src/BuildingBlocks/{src/Data => Data/UoW/src}/Masa.BuildingBlocks.Data.UoW/_Imports.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs (100%) create mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs (100%) rename src/BuildingBlocks/{src/Ddd => Ddd/Domain/src}/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs (100%) rename src/BuildingBlocks/{ => Ddd/Domain}/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj (85%) rename src/BuildingBlocks/{ => Ddd/Domain}/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs (100%) rename src/BuildingBlocks/{ => Ddd/Domain}/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs (100%) rename src/BuildingBlocks/{ => Ddd/Domain}/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs (100%) delete mode 100644 src/BuildingBlocks/Directory.Build.props rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/Event.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/Events/src}/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs (100%) rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs (100%) create mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj rename src/BuildingBlocks/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs (100%) rename src/BuildingBlocks/{src/Identity => Identity/IdentityModel/src}/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/IConvertProvider.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/IIsolation.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/IParserProvider.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj (80%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs (100%) rename src/BuildingBlocks/{src/Isolation => Isolation/src}/Masa.BuildingBlocks.Isolation/_Imports.cs (100%) delete mode 100644 src/BuildingBlocks/Masa.BuildingBlocks.sln delete mode 100644 src/BuildingBlocks/README.md delete mode 100644 src/BuildingBlocks/README.zh-CN.md rename src/BuildingBlocks/{src/ReadWriteSpliting => ReadWriteSpliting/Cqrs/src}/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs (100%) rename src/BuildingBlocks/{src/ReadWriteSpliting => ReadWriteSpliting/Cqrs/src}/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs (100%) rename src/BuildingBlocks/{src/ReadWriteSpliting => ReadWriteSpliting/Cqrs/src}/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs (100%) create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj rename src/BuildingBlocks/{src/ReadWriteSpliting => ReadWriteSpliting/Cqrs/src}/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs (100%) rename src/BuildingBlocks/{src/ReadWriteSpliting => ReadWriteSpliting/Cqrs/src}/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs (100%) rename src/BuildingBlocks/{src/ReadWriteSpliting => ReadWriteSpliting/Cqrs/src}/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs (100%) rename src/BuildingBlocks/{src/ReadWriteSpliting => ReadWriteSpliting/Cqrs/src}/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs (100%) rename src/BuildingBlocks/{src/ReadWriteSpliting => ReadWriteSpliting/EventSourcing/src}/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs (100%) rename src/BuildingBlocks/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs (100%) rename src/BuildingBlocks/{ => SearchEngine/AutoComplete}/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs (100%) rename src/BuildingBlocks/{ => SearchEngine/AutoComplete}/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj (81%) rename src/BuildingBlocks/{ => SearchEngine/AutoComplete}/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs (100%) rename src/BuildingBlocks/{ => SearchEngine/AutoComplete}/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/CallerBase.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/ICaller.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Caller/src}/Masa.BuildingBlocks.Service.Caller/_Imports.cs (100%) rename src/BuildingBlocks/{src/Service => Service/MinimalAPIs/src}/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs (100%) rename src/BuildingBlocks/{src/Service => Service/MinimalAPIs/src}/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj (100%) rename src/BuildingBlocks/{src/Service => Service/MinimalAPIs/src}/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Service/src}/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Service/src}/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Service/src}/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs (100%) rename src/BuildingBlocks/{src/Service => Service/Service/src}/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Auth/src}/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Dcc/src}/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Dcc/src}/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Dcc/src}/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Dcc/src}/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Dcc/src}/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj (64%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Mc/src}/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Pm/src}/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Scheduler/src}/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs (100%) rename src/BuildingBlocks/{src/StackSdks => StackSdks/Tsc/src}/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs (100%) rename src/BuildingBlocks/{src/Storage => Storage/ObjectStorage/src}/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs (100%) delete mode 100644 src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj delete mode 100644 src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj delete mode 100644 src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj delete mode 100644 src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs (100%) create mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/README.md (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Cache/src}/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs (100%) create mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/EntityFrameworkCore/src}/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj (54%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs (100%) rename src/Contrib/{src/Authentication => Authentication/Oidc/Storage/src}/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/ConfigurationOptions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/DefaultConfigurationApi.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj (68%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/MasaConfigurationProvider.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/MasaConfigurationSource.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/MasaRelationOptions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/README.md (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/README.zh-CN.md (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/Configuration/src}/Masa.Contrib.Configuration/_Imports.cs (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj (75%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj (68%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj (94%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/_Imports.cs (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/appsettings.json (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/customAppConfig.json (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/rabbitMq.json (100%) rename src/Contrib/{test/Configuration => Configuration/Configuration/test}/Masa.Contrib.Configuration.Tests/redis.json (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs (100%) create mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md (100%) rename src/Contrib/{src/Configuration => Configuration/ConfigurationApi/src}/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj (75%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json (100%) rename src/Contrib/{test/Configuration => Configuration/ConfigurationApi/test}/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json (100%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs (100%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs (100%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs (100%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs (100%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs (100%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs (100%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj (58%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs (100%) rename src/Contrib/{src/Data => Data/Contracts/src}/Masa.Contrib.Data.Contracts.EF/_Imports.cs (100%) rename src/Contrib/{test/Data => Data/Contracts/test}/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs (100%) rename src/Contrib/{test/Data => Data/Contracts/test}/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj (90%) rename src/Contrib/{test/Data => Data/Contracts/test}/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Local/src}/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Local/src}/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Local/src}/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs (100%) create mode 100644 src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Local/src}/Masa.Contrib.Data.DistributedLock.Local/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Local/src}/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Local/src}/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Local/src}/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs (100%) rename src/Contrib/{test/Data/DistributedLock => Data/DistributedLock/Local/test}/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs (100%) rename src/Contrib/{test/Data/DistributedLock => Data/DistributedLock/Local/test}/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj (80%) rename src/Contrib/{test/Data/DistributedLock => Data/DistributedLock/Local/test}/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj (76%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj (76%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj (76%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj (77%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj (79%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs (100%) create mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion/README.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Data/DistributedLock => Data/DistributedLock/Medallion/src}/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs (100%) rename src/Contrib/{test/Data/DistributedLock => Data/DistributedLock/Medallion/test}/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs (100%) rename src/Contrib/{test/Data/DistributedLock => Data/DistributedLock/Medallion/test}/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj (100%) rename src/Contrib/{test/Data/DistributedLock => Data/DistributedLock/Medallion/test}/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj (50%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/README.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Data/EntityFrameworkCore => Data/EntityFrameworkCore/src}/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj (70%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs (100%) rename src/Contrib/{test/Data => Data/EntityFrameworkCore/test}/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/NormalGuid/src}/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj (73%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/NormalGuid/src}/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/NormalGuid/src}/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/NormalGuid/src}/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/NormalGuid/src}/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/NormalGuid/src}/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/SequentialGuid/src}/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj (73%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/SequentialGuid/src}/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/SequentialGuid/src}/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/SequentialGuid/src}/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/SequentialGuid/src}/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/SequentialGuid/src}/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs (100%) rename src/Contrib/{test/Data/IdGenerator => Data/IdGenerator/SequentialGuid/test}/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj (100%) rename src/Contrib/{test/Data/IdGenerator => Data/IdGenerator/SequentialGuid/test}/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs (100%) rename src/Contrib/{test/Data/IdGenerator => Data/IdGenerator/SequentialGuid/test}/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs (100%) rename src/Contrib/{ => Data/IdGenerator/Snowflake}/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs (100%) rename src/Contrib/{ => Data/IdGenerator/Snowflake}/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj (80%) rename src/Contrib/{ => Data/IdGenerator/Snowflake}/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs (100%) rename src/Contrib/{ => Data/IdGenerator/Snowflake}/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs (100%) rename src/Contrib/{ => Data/IdGenerator/Snowflake}/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs (100%) rename src/Contrib/{ => Data/IdGenerator/Snowflake}/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj (72%) rename src/Contrib/{ => Data/IdGenerator/Snowflake}/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs (100%) rename src/Contrib/{ => Data/IdGenerator/Snowflake}/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs (100%) create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs (100%) create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/README.md (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Data/IdGenerator => Data/IdGenerator/Snowflake/src}/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs (100%) rename src/Contrib/{test/Data/IdGenerator => Data/IdGenerator/Snowflake/test}/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs (100%) rename src/Contrib/{test/Data/IdGenerator => Data/IdGenerator/Snowflake/test}/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs (100%) rename src/Contrib/{test/Data/IdGenerator => Data/IdGenerator/Snowflake/test}/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj (76%) rename src/Contrib/{test/Data/IdGenerator => Data/IdGenerator/Snowflake/test}/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj (61%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/README.md (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Data/Mapping => Data/Mapping/Mapster/src}/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj (70%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs (100%) rename src/Contrib/{test/Data/Mapping => Data/Mapping/Mapster/test}/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/Internal/Const.cs (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj (51%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/README.md (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/README.zh-CN.md (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/Transaction.cs (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs (100%) rename src/Contrib/{src/Data => Data/UoW/src}/Masa.Contrib.Data.UoW.EF/_Imports.cs (100%) rename src/Contrib/{test/Data => Data/UoW/test}/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs (100%) rename src/Contrib/{test/Data => Data/UoW/test}/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj (82%) rename src/Contrib/{test/Data => Data/UoW/test}/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs (100%) rename src/Contrib/{test/Data => Data/UoW/test}/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs (100%) rename src/Contrib/{test/Data => Data/UoW/test}/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs (100%) rename src/Contrib/{test/Data => Data/UoW/test}/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj (76%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain.Repository.EF/README.md (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain/DomainEventBus.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain/DomainService.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj (76%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain/README.md (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain/README.zh-CN.md (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Ddd => Ddd/Domain/src}/Masa.Contrib.Ddd.Domain/_Imports.cs (100%) rename src/Contrib/{test/Ddd => Ddd/Domain/test}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs (100%) rename src/Contrib/{test/Ddd => Ddd/Domain/test}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs (100%) rename src/Contrib/{test/Ddd => Ddd/Domain/test}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs (100%) rename src/Contrib/{test/Ddd => Ddd/Domain/test}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj (83%) rename src/Contrib/{test/Ddd => Ddd/Domain/test}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs (100%) rename src/Contrib/{test/Ddd => Ddd/Domain/test}/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs (100%) delete mode 100644 src/Contrib/Directory.Build.props rename src/Contrib/{ => Dispatcher/Events}/docs/LoadEvent.md (100%) rename src/Contrib/{ => Dispatcher/Events}/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs (100%) rename src/Contrib/{ => Dispatcher/Events}/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs (100%) rename src/Contrib/{ => Dispatcher/Events}/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs (100%) rename src/Contrib/{ => Dispatcher/Events}/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs (100%) rename src/Contrib/{ => Dispatcher/Events}/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs (100%) rename src/Contrib/{ => Dispatcher/Events}/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs (100%) rename src/Contrib/{ => Dispatcher/Events}/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj (85%) rename src/Contrib/{ => Dispatcher/Events}/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs (100%) rename src/Contrib/{ => Dispatcher/Events}/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/EventBus.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs (100%) create mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/README.md (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/README.zh-CN.md (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/Events/src}/Masa.Contrib.Dispatcher.Events/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj (68%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj (67%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj (67%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj (67%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj (67%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj (67%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj (67%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj (95%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/Events/test}/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj (70%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj (50%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs (100%) create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/README.md (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Dispatcher => Dispatcher/IntegrationEvents/src}/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj (89%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj (78%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj (88%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs (100%) rename src/Contrib/{test/Dispatcher => Dispatcher/IntegrationEvents/test}/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs (100%) create mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/README.md (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs (100%) rename src/Contrib/{src/Identity => Identity/IdentityModel/src}/Masa.Contrib.Identity.IdentityModel/_Imports.cs (100%) rename src/Contrib/{test/Identity => Identity/IdentityModel/test}/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj (90%) rename src/Contrib/{test/Identity => Identity/IdentityModel/test}/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs (100%) rename src/Contrib/{test/Identity => Identity/IdentityModel/test}/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs (100%) rename src/Contrib/{src/Isolation => Isolation/Isolation/src}/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs (100%) rename src/Contrib/{src/Isolation => Isolation/Isolation/src}/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs (100%) rename src/Contrib/{src/Isolation => Isolation/Isolation/src}/Masa.Contrib.Isolation/IsolationBuilder.cs (100%) rename src/Contrib/{src/Isolation => Isolation/Isolation/src}/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs (100%) rename src/Contrib/{src/Isolation => Isolation/Isolation/src}/Masa.Contrib.Isolation/IsolationDbContextProvider.cs (100%) create mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj rename src/Contrib/{src/Isolation => Isolation/Isolation/src}/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs (100%) rename src/Contrib/{src/Isolation => Isolation/Isolation/src}/Masa.Contrib.Isolation/README.md (100%) rename src/Contrib/{src/Isolation => Isolation/Isolation/src}/Masa.Contrib.Isolation/README.zh-CN.md (100%) rename src/Contrib/{src/Isolation => Isolation/Isolation/src}/Masa.Contrib.Isolation/_Imports.cs (100%) rename src/Contrib/{test/Isolation => Isolation/Isolation/test}/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj (74%) rename src/Contrib/{test/Isolation => Isolation/Isolation/test}/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs (100%) rename src/Contrib/{test/Isolation => Isolation/Isolation/test}/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs (100%) rename src/Contrib/{test/Isolation => Isolation/Isolation/test}/Masa.Contrib.Isolation.Tests/TestIsolation.cs (100%) rename src/Contrib/{test/Isolation => Isolation/Isolation/test}/Masa.Contrib.Isolation.Tests/TestParserProvider.cs (100%) rename src/Contrib/{test/Isolation => Isolation/Isolation/test}/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs (100%) rename src/Contrib/{test/Isolation => Isolation/Isolation/test}/Masa.Contrib.Isolation.Tests/_Imports.cs (100%) rename src/Contrib/{src/Isolation => Isolation/MultiEnvironment/src}/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs (100%) rename src/Contrib/{src/Isolation => Isolation/MultiEnvironment/src}/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs (100%) create mode 100644 src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj rename src/Contrib/{src/Isolation => Isolation/MultiEnvironment/src}/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs (100%) rename src/Contrib/{src/Isolation => Isolation/MultiEnvironment/src}/Masa.Contrib.Isolation.MultiEnvironment/README.md (100%) rename src/Contrib/{src/Isolation => Isolation/MultiEnvironment/src}/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md (100%) rename src/Contrib/{src/Isolation => Isolation/MultiEnvironment/src}/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs (100%) rename src/Contrib/{test/Isolation => Isolation/MultiEnvironment/test}/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj (88%) rename src/Contrib/{test/Isolation => Isolation/MultiEnvironment/test}/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs (100%) rename src/Contrib/{test/Isolation => Isolation/MultiEnvironment/test}/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs (100%) rename src/Contrib/{test/Isolation => Isolation/MultiEnvironment/test}/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs (100%) rename src/Contrib/{src/Isolation => Isolation/MultiTenant/src}/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs (100%) rename src/Contrib/{src/Isolation => Isolation/MultiTenant/src}/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs (100%) create mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj rename src/Contrib/{src/Isolation => Isolation/MultiTenant/src}/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs (100%) rename src/Contrib/{src/Isolation => Isolation/MultiTenant/src}/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs (100%) rename src/Contrib/{src/Isolation => Isolation/MultiTenant/src}/Masa.Contrib.Isolation.MultiTenant/README.md (100%) rename src/Contrib/{src/Isolation => Isolation/MultiTenant/src}/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md (100%) rename src/Contrib/{src/Isolation => Isolation/MultiTenant/src}/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs (100%) rename src/Contrib/{src/Isolation => Isolation/MultiTenant/src}/Masa.Contrib.Isolation.MultiTenant/_Imports.cs (100%) rename src/Contrib/{test/Isolation => Isolation/MultiTenant/test}/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj (89%) rename src/Contrib/{test/Isolation => Isolation/MultiTenant/test}/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs (100%) rename src/Contrib/{test/Isolation => Isolation/MultiTenant/test}/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs (100%) rename src/Contrib/{test/Isolation => Isolation/MultiTenant/test}/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs (100%) rename src/Contrib/{src/Isolation => Isolation/UoW/src}/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs (100%) rename src/Contrib/{src/Isolation => Isolation/UoW/src}/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs (100%) rename src/Contrib/{src/Isolation => Isolation/UoW/src}/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs (100%) rename src/Contrib/{src/Isolation => Isolation/UoW/src}/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs (100%) rename src/Contrib/{src/Isolation => Isolation/UoW/src}/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj (67%) rename src/Contrib/{src/Isolation => Isolation/UoW/src}/Masa.Contrib.Isolation.UoW.EF/README.md (100%) rename src/Contrib/{src/Isolation => Isolation/UoW/src}/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md (100%) rename src/Contrib/{src/Isolation => Isolation/UoW/src}/Masa.Contrib.Isolation.UoW.EF/_Imports.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj (60%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs (100%) create mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs (100%) rename src/Contrib/{test/Isolation => Isolation/UoW/test}/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json (100%) delete mode 100644 src/Contrib/README.md delete mode 100644 src/Contrib/README.zh-CN.md rename src/Contrib/{src/ReadWriteSpliting/Cqrs => ReadWriteSpliting/Cqrs/src}/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs (100%) rename src/Contrib/{src/ReadWriteSpliting/Cqrs => ReadWriteSpliting/Cqrs/src}/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj (72%) rename src/Contrib/{src/ReadWriteSpliting/Cqrs => ReadWriteSpliting/Cqrs/src}/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs (100%) rename src/Contrib/{src/ReadWriteSpliting/Cqrs => ReadWriteSpliting/Cqrs/src}/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md (100%) rename src/Contrib/{src/ReadWriteSpliting/Cqrs => ReadWriteSpliting/Cqrs/src}/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md (100%) rename src/Contrib/{src/ReadWriteSpliting/Cqrs => ReadWriteSpliting/Cqrs/src}/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs (100%) rename src/Contrib/{test/ReadWriteSpliting => ReadWriteSpliting/Cqrs/test}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs (100%) rename src/Contrib/{test/ReadWriteSpliting => ReadWriteSpliting/Cqrs/test}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs (100%) rename src/Contrib/{test/ReadWriteSpliting => ReadWriteSpliting/Cqrs/test}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs (100%) rename src/Contrib/{test/ReadWriteSpliting => ReadWriteSpliting/Cqrs/test}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj (80%) rename src/Contrib/{test/ReadWriteSpliting => ReadWriteSpliting/Cqrs/test}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs (100%) rename src/Contrib/{test/ReadWriteSpliting => ReadWriteSpliting/Cqrs/test}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs (100%) rename src/Contrib/{test/ReadWriteSpliting => ReadWriteSpliting/Cqrs/test}/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs (100%) rename src/Contrib/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs (100%) rename src/Contrib/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs (100%) rename src/Contrib/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj (56%) rename src/Contrib/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs (100%) rename src/Contrib/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs (100%) rename src/Contrib/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md (100%) rename src/Contrib/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md (100%) rename src/Contrib/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/SearchEngine => SearchEngine/AutoComplete/src}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs (100%) rename src/Contrib/{test/SearchEngine => SearchEngine/AutoComplete/test}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs (100%) rename src/Contrib/{test/SearchEngine => SearchEngine/AutoComplete/test}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj (86%) rename src/Contrib/{test/SearchEngine => SearchEngine/AutoComplete/test}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs (100%) rename src/Contrib/{test/SearchEngine => SearchEngine/AutoComplete/test}/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj (68%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/README.md (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj (69%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.HttpClient/README.md (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/JsonRequestMessage.cs (100%) create mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/README.md (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/README.zh-CN.md (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/XmlRequestMessage.cs (100%) rename src/Contrib/{src/Service/Caller => Service/Caller/src}/Masa.Contrib.Service.Caller/_Imports.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj (69%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/CallerTest.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj (63%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs (100%) rename src/Contrib/{test/Service/Caller => Service/Caller/test}/Masa.Contrib.Service.Caller.Tests/_Imports.cs (100%) create mode 100644 src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj rename src/Contrib/{src/Service => Service/MinimalAPIs/src}/Masa.Contrib.Service.MinimalAPIs/README.md (100%) rename src/Contrib/{src/Service => Service/MinimalAPIs/src}/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md (100%) rename src/Contrib/{src/Service => Service/MinimalAPIs/src}/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs (100%) rename src/Contrib/{src/Service => Service/MinimalAPIs/src}/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Service => Service/MinimalAPIs/src}/Masa.Contrib.Service.MinimalAPIs/_Imports.cs (100%) rename src/Contrib/{test/Service => Service/MinimalAPIs/test}/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj (90%) rename src/Contrib/{test/Service => Service/MinimalAPIs/test}/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs (100%) rename src/Contrib/{test/Service => Service/MinimalAPIs/test}/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs (100%) rename src/Contrib/{test/Service => Service/MinimalAPIs/test}/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/AuthClient.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/Constants.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs (100%) create mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/README.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/README.zh-CN.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/Service/UserService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Auth/src}/Masa.Contrib.StackSdks.Auth/_Imports.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Auth/test}/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Auth/test}/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj (68%) rename src/Contrib/{test/StackSdks => StackSdks/Auth/test}/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Auth/test}/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Auth/test}/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Auth/test}/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Auth/test}/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Auth/test}/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Dcc/src}/Masa.Contrib.StackSdks.Dcc/DccClient.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Dcc/src}/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs (100%) create mode 100644 src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj rename src/Contrib/{src/StackSdks => StackSdks/Dcc/src}/Masa.Contrib.StackSdks.Dcc/README.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Dcc/src}/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Dcc/src}/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Dcc/src}/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Dcc/src}/Masa.Contrib.StackSdks.Dcc/_Imports.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Dcc/test}/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Dcc/test}/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Dcc/test}/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj (80%) rename src/Contrib/{test/StackSdks => StackSdks/Dcc/test}/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Dcc/test}/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/Constants.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs (100%) create mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/McClient.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Mc/src}/Masa.Contrib.StackSdks.Mc/_Imports.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Mc/test}/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Mc/test}/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj (75%) rename src/Contrib/{test/StackSdks => StackSdks/Mc/test}/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Mc/test}/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Mc/test}/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Mc/test}/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Mc/test}/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Mc/test}/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/Constants.cs (100%) create mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/PmClient.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/README.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/README.zh-CN.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/Service/AppService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Pm/src}/Masa.Contrib.StackSdks.Pm/_Imports.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Pm/test}/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Pm/test}/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Pm/test}/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Pm/test}/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj (75%) rename src/Contrib/{test/StackSdks => StackSdks/Pm/test}/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Pm/test}/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Pm/test}/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Scheduler/src}/Masa.Contrib.StackSdks.Scheduler/Constants.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Scheduler/src}/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs (100%) create mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj rename src/Contrib/{src/StackSdks => StackSdks/Scheduler/src}/Masa.Contrib.StackSdks.Scheduler/README.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Scheduler/src}/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Scheduler/src}/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Scheduler/src}/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Scheduler/src}/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Scheduler/src}/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Scheduler/src}/Masa.Contrib.StackSdks.Scheduler/_Imports.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Scheduler/test}/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj (74%) rename src/Contrib/{test/StackSdks => StackSdks/Scheduler/test}/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Scheduler/test}/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Scheduler/test}/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Scheduler/test}/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj (76%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/README.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/TscClient.cs (100%) rename src/Contrib/{src/StackSdks => StackSdks/Tsc/src}/Masa.Contrib.StackSdks.Tsc/_Imports.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Tsc/test}/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Tsc/test}/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj (72%) rename src/Contrib/{test/StackSdks => StackSdks/Tsc/test}/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Tsc/test}/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs (100%) rename src/Contrib/{test/StackSdks => StackSdks/Tsc/test}/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj (76%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs (100%) rename src/Contrib/{src/Storage => Storage/ObjectStorage/src}/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj (91%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs (100%) rename src/Contrib/{test/Storage => Storage/ObjectStorage/test}/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json (100%) delete mode 100644 src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj delete mode 100644 src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj delete mode 100644 src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj delete mode 100644 src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj delete mode 100644 src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj delete mode 100644 src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj delete mode 100644 src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj delete mode 100644 src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj delete mode 100644 src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj delete mode 100644 src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj delete mode 100644 src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj delete mode 100644 src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj delete mode 100644 src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj delete mode 100644 src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj delete mode 100644 src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj delete mode 100644 src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj delete mode 100644 src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj delete mode 100644 src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj delete mode 100644 src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj delete mode 100644 src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj delete mode 100644 src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs (100%) rename src/Utils/{src/Caching => Caching/Caching/src}/Masa.Utils.Caching.Core/_Imports.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj (83%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/RedisCacheClient.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs (100%) rename src/Utils/{src/Caching => Caching/Distributed/src}/Masa.Utils.Caching.Redis/_Imports.cs (100%) rename src/Utils/{ => Caching/Distributed}/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs (100%) rename src/Utils/{ => Caching/Distributed}/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj (85%) rename src/Utils/{ => Caching/Distributed}/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs (100%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs (100%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs (100%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs (100%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs (100%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj (83%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs (100%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs (100%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs (100%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs (100%) rename src/Utils/{src/Caching => Caching/DistributedMemory/src}/Masa.Utils.Caching.DistributedMemory/_Imports.cs (100%) rename src/Utils/{src/Caching => Caching/Memory/src}/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj (100%) rename src/Utils/{src/Caching => Caching/Memory/src}/Masa.Utils.Caching.Memory/MemoryCache.cs (100%) rename src/Utils/{src/Caching => Caching/Memory/src}/Masa.Utils.Caching.Memory/_Imports.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/AbstractCallerProvider.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/AddCallerExtensions.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/CallerBase.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/CallerOptions.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/DefaultCallerFactory.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/DefaultRequestMessage.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/DefaultResponseMessage.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/ICallerFactory.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/ICallerProvider.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/IRequestIdGenerator.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/IRequestMessage.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/IResponseMessage.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/ITypeConvertProvider.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/Internal/CallerRelations.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/Internal/Const.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/JsonRequestMessage.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj (84%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/README.md (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/README.zh-CN.md (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.Core/_Imports.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.DaprClient/README.md (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.DaprClient/README.zh-CN.md (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.DaprClient/_Imports.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.HttpClient/README.md (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.HttpClient/README.zh-CN.md (100%) rename src/Utils/{src/Caller => Caller/src}/Masa.Utils.Caller.HttpClient/_Imports.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/CallerTest.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj (68%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs (100%) rename src/Utils/{ => Caller}/test/Masa.Utils.Caller.Tests/_Imports.cs (100%) rename src/Utils/{src/Configuration => Configuration/src}/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj (100%) rename src/Utils/{src/Configuration => Configuration/src}/Masa.Utils.Configuration.Json/AppSettings.cs (100%) rename src/Utils/{src/Configuration => Configuration/src}/Masa.Utils.Configuration.Json/JsonConfiguration.cs (100%) rename src/Utils/{src/Configuration => Configuration/src}/Masa.Utils.Configuration.Json/JsonFileOptions.cs (100%) rename src/Utils/{src/Configuration => Configuration/src}/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj (100%) rename src/Utils/{src/Data => Data/DataAnnotations/src}/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs (100%) rename src/Utils/{src/Data => Data/DataAnnotations/src}/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs (100%) rename src/Utils/{src/Data => Data/DataAnnotations/src}/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj (100%) rename src/Utils/{src/Data => Data/DataAnnotations/src}/Masa.Utils.Data.DataAnnotations/_Imports.cs (100%) rename src/Utils/{ => Data/DataAnnotations}/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj (84%) rename src/Utils/{ => Data/DataAnnotations}/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs (100%) rename src/Utils/{ => Data/DataAnnotations}/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Const.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/README.md (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/README.zh-CN.md (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Data => Data/Elasticsearch/src}/Masa.Utils.Data.Elasticsearch/_Imports.cs (100%) rename src/Utils/{ => Data/Elasticsearch}/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs (100%) rename src/Utils/{ => Data/Elasticsearch}/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj (85%) rename src/Utils/{ => Data/Elasticsearch}/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs (100%) rename src/Utils/{ => Data/Elasticsearch}/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs (100%) rename src/{BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj => Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj} (65%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/README.md (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/README.zh-CN.md (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Data => Data/Prometheus/src}/Masa.Utils.Data.Prometheus/_Imports.cs (100%) rename src/Utils/{ => Data/Prometheus}/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs (100%) rename src/Utils/{ => Data/Prometheus}/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs (100%) rename src/Utils/{ => Data/Prometheus}/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj (86%) rename src/Utils/{ => Data/Prometheus}/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs (100%) rename src/Utils/{ => Data/Prometheus}/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs (100%) rename src/Utils/{ => Data/Prometheus}/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr.AspNetCore/README.md (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/CommandLineBuilder.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/DaprExtensions.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/DaprOptions.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/DaprProcess.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/DaprProvider.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/IDaprProcess.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/IDaprProvider.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Internal/Const.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/LogLevel.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Process/IProcess.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Process/SystemProcess.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/Protocol.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/README.md (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/README.zh-CN.md (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Development => Development/Dapr/src}/Masa.Utils.Development.Dapr/_Imports.cs (100%) delete mode 100644 src/Utils/Directory.Build.props rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Internal/Constant.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj (99%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/MasaException.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/MasaExceptionContext.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/README.md (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/README.zh-CN.md (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/UserFriendlyException.cs (100%) rename src/Utils/{ => Exceptions}/src/Masa.Utils.Exceptions/_Imports.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/README.md (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Extensions => Extensions/DependencyInjection/src}/Masa.Utils.Extensions.DependencyInjection/_Imports.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs (100%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj (82%) rename src/Utils/{ => Extensions/DependencyInjection}/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs (100%) rename src/Utils/{src/Extensions => Extensions/DotNet/src}/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj (100%) rename src/Utils/{src/Extensions => Extensions/DotNet/src}/Masa.Utils.Extensions.DotNet/TypeExtensions.cs (100%) rename src/Utils/{src/Extensions => Extensions/Enums/src}/Masa.Utils.Extensions.Enums/EnumExtensions.cs (100%) rename src/Utils/{src/Extensions => Extensions/Enums/src}/Masa.Utils.Extensions.Enums/EnumUtil.cs (100%) rename src/Utils/{src/Extensions => Extensions/Enums/src}/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj (100%) rename src/Utils/{src/Extensions => Extensions/Enums/src}/Masa.Utils.Extensions.Enums/Model/EnumObject.cs (100%) rename src/Utils/{src/Extensions => Extensions/Enums/src}/Masa.Utils.Extensions.Enums/_Enum.cs (100%) rename src/Utils/{src/Extensions => Extensions/Enums/src}/Masa.Utils.Extensions.Enums/_Imports.cs (100%) rename src/Utils/{src/Extensions => Extensions/Expressions/src}/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs (100%) rename src/Utils/{src/Extensions => Extensions/Expressions/src}/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj (100%) rename src/Utils/{src/Extensions => Extensions/Expressions/src}/Masa.Utils.Extensions.Expressions/_Imports.cs (100%) rename src/Utils/{src/Extensions/Validations => Extensions/Validations/src}/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs (100%) rename src/Utils/{src/Extensions/Validations => Extensions/Validations/src}/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj (100%) rename src/Utils/{src/Extensions/Validations => Extensions/Validations/src}/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs (100%) rename src/Utils/{src/Extensions/Validations => Extensions/Validations/src}/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/ILdapFactory.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/ILdapProvider.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/LdapFactory.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/LdapOptions.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/LdapProvider.cs (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj (100%) rename src/Utils/{src/Ldap => Ldap/Novell/src}/Masa.Utils.Ldap.Novell/_Imports.cs (100%) rename src/Utils/{ => Ldap/Novell}/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs (100%) rename src/Utils/{ => Ldap/Novell}/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj (90%) rename src/Utils/{ => Ldap/Novell}/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs (100%) rename src/Utils/{ => Ldap/Novell}/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json (100%) delete mode 100644 src/Utils/Masa.Utils.sln rename src/Utils/{src/Models => Models/Config/src}/Masa.Utils.Models.Config/AppConfig.cs (100%) rename src/Utils/{src/Models => Models/Config/src}/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj (100%) delete mode 100644 src/Utils/README.md delete mode 100644 src/Utils/README.zh-CN.md rename src/Utils/{src/Security => Security/Authentication/Authentication/src}/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs (100%) rename src/Utils/{src/Security => Security/Authentication/Authentication/src}/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs (100%) rename src/Utils/{src/Security => Security/Authentication/Authentication/src}/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs (100%) rename src/Utils/{src/Security => Security/Authentication/Authentication/src}/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs (100%) rename src/Utils/{src/Security => Security/Authentication/Authentication/src}/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj (73%) rename src/Utils/{src/Security => Security/Authentication/Authentication/src}/Masa.Utils.Security.Authentication/MasaUser.cs (100%) rename src/Utils/{src/Security => Security/Authentication/Authentication/src}/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs (100%) rename src/Utils/{src/Security => Security/Authentication/Authentication/src}/Masa.Utils.Security.Authentication/_Imports.cs (100%) rename src/Utils/{src/Security => Security/Authentication/OpenIdConnect/src}/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj (100%) rename src/Utils/{src/Security => Security/Authentication/OpenIdConnect/src}/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs (100%) rename src/Utils/{src/Security => Security/Authentication/OpenIdConnect/src}/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/AesUtils.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/Base64Utils.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/DESEncryType.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/DesUtils.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/EncryptBase.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/EncryptType.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/FillType.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/MD5Utils.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/SHA1Utils.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/SHA256Utils.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/SHA384Utils.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/SHA512Utils.cs (100%) rename src/Utils/{src/Security => Security/Cryptography/src}/Masa.Utils.Security.Cryptography/_Imports.cs (100%) rename src/Utils/{ => Security/Cryptography}/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs (100%) rename src/Utils/{ => Security/Cryptography}/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs (100%) rename src/Utils/{ => Security/Cryptography}/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj (85%) rename src/Utils/{ => Security/Cryptography}/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs (100%) rename src/Utils/{src/Security => Security/Token/src}/Masa.Utils.Security.Token/DefaultJwtProvider.cs (100%) rename src/Utils/{src/Security => Security/Token/src}/Masa.Utils.Security.Token/IJwtProvider.cs (100%) rename src/Utils/{src/Security => Security/Token/src}/Masa.Utils.Security.Token/JwtUtils.cs (100%) rename src/Utils/{src/Security => Security/Token/src}/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj (100%) rename src/Utils/{src/Security => Security/Token/src}/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs (100%) rename src/Utils/{src/Security => Security/Token/src}/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs (100%) rename src/Utils/{src/Security => Security/Token/src}/Masa.Utils.Security.Token/_Imports.cs (100%) delete mode 100644 src/Utils/src/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj diff --git a/Directory.Build.props b/Directory.Build.props index f4d92ef39..62965ceac 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -12,6 +12,9 @@ 1.0.4 11.1.0 11.1.2 + 2.2.4 + 7.17.4 + 6.15.0 1.3.0 1.0.0-beta2 diff --git a/Masa.Framework.sln b/Masa.Framework.sln index e34fbf49c..aab2eeefd 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -5,493 +5,551 @@ VisualStudioVersion = 17.0.31521.260 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildingBlocks", "BuildingBlocks", "{DC578D74-98F0-4F19-A230-CFA8DAEE0AF1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration", "src\BuildingBlocks\src\Configuration\Masa.BuildingBlocks.Configuration\Masa.BuildingBlocks.Configuration.csproj", "{374B7E56-A815-4F56-A4C2-6094B5A97EE7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Contracts", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.Contracts\Masa.BuildingBlocks.Data.Contracts.csproj", "{7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{0D34A7F0-DC77-4789-A136-93089CBD15C3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.UoW", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.UoW\Masa.BuildingBlocks.Data.UoW.csproj", "{E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{5944A182-13B8-4DA6-AEE2-0A01E64A9648}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain", "src\BuildingBlocks\src\Ddd\Masa.BuildingBlocks.Ddd.Domain\Masa.BuildingBlocks.Ddd.Domain.csproj", "{2971858E-2CCA-4688-B8CA-84F130AD5AA9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.Events", "src\BuildingBlocks\src\Dispatcher\Masa.BuildingBlocks.Dispatcher.Events\Masa.BuildingBlocks.Dispatcher.Events.csproj", "{2503F67B-63BB-4364-8B31-1DD3049C92B7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{08649D7D-EF5A-4626-9959-935CA85DF770}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.IntegrationEvents", "src\BuildingBlocks\src\Dispatcher\Masa.BuildingBlocks.Dispatcher.IntegrationEvents\Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj", "{88BC8170-9123-48C0-A914-11D3CE805196}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{8663AD83-4E2C-47EF-BF28-1427E82F1A36}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.Cqrs", "src\BuildingBlocks\src\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj", "{316B1D0A-9CF7-4E5C-A39A-8A389B075A19}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{FE0F37B3-7727-4A08-AEA1-437F53982658}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete", "src\BuildingBlocks\src\SearchEngine\Masa.BuildingBlocks.SearchEngine.AutoComplete\Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj", "{2F4986D6-3F56-4C05-8A1D-399594F96093}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.MinimalAPIs", "src\BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.MinimalAPIs\Masa.BuildingBlocks.Service.MinimalAPIs.csproj", "{E72E105D-B15F-4D69-9A13-CAA49D4889D6}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{4B812744-1CB5-4760-9719-2220EACC566C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolation", "src\BuildingBlocks\src\Isolation\Masa.BuildingBlocks.Isolation\Masa.BuildingBlocks.Isolation.csproj", "{B689E82B-B3E8-4C83-B56C-D4C27206AAC6}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{232840A6-183C-4D3A-A086-582FD449D300}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Storage.ObjectStorage", "src\BuildingBlocks\src\Storage\Masa.BuildingBlocks.Storage.ObjectStorage\Masa.BuildingBlocks.Storage.ObjectStorage.csproj", "{74283F68-6B38-4CF4-B0CB-AAD65618ADB8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{7064C470-7D0B-4CE2-A80C-BEE376DDC956}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Pm", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Pm\Masa.BuildingBlocks.StackSdks.Pm.csproj", "{AB6FAB84-5218-48A8-8F94-03B02ECD098F}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E8CE3469-6E0F-495C-937E-D9820DE3DA89}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Mapping", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.Mapping\Masa.BuildingBlocks.Data.Mapping.csproj", "{5A3338F1-9963-4CAC-85A3-7AB263CB15B0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{46C33E74-835B-4CB4-861D-42A781A2502C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data\Masa.BuildingBlocks.Data.csproj", "{C3451307-3743-4911-A401-7F28889703D3}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching", "Caching", "{02B35A90-23DF-4341-89CF-E911ED210FBE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Contracts", "src\BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.Contracts\Masa.BuildingBlocks.Service.Contracts.csproj", "{736F69E9-89D0-47E2-99AF-9412AAE1C6BB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Auth\Masa.BuildingBlocks.StackSdks.Auth.csproj", "{4B818EE6-8E13-40DA-B99A-218BB228EE91}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{BCDB0439-8542-4DE7-A8C2-9BB582AE8C42}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development", "{F262689D-5BE8-45E9-B090-0CFF81315FB9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.MappingExtensions", "src\BuildingBlocks\src\Data\Masa.BuildingBlocks.Data.MappingExtensions\Masa.BuildingBlocks.Data.MappingExtensions.csproj", "{30DC35DF-9D86-443C-B26C-9053E6FCA434}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Cache", "src\BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Cache\Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj", "{4B94CAF6-134D-4F89-8F2D-72A4FB363B59}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ldap", "Ldap", "{8A795434-6928-41F6-B8B1-3F6DAC62D1A0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{54936F20-EEFC-405B-8646-76F200A5C8F7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{611ECFDA-B435-4106-BDB8-DD8C39FEBF08}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{546EE1A2-DB6B-49D3-8919-33624FEF2498}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Validations", "Validations", "{B1984322-509A-4E96-BFB0-A0D5DEDFB92D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\BuildingBlocks\src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{B603B92A-1203-4E28-9D15-2AF1CE4E9510}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{7A8F1593-C00F-4D90-9029-11BF75B3C926}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\src\Identity\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{1677DDFE-BBCF-4BA3-B5A7-9168BB27838E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Dcc", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Dcc\Masa.BuildingBlocks.StackSdks.Dcc.csproj", "{FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B9256C4D-86F4-4E67-8774-C3EF971EC811}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth.Contracts", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Auth.Contracts\Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj", "{981E883E-CCDC-400B-8FB1-76E1E65C32AF}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contrib", "Contrib", "{950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{0D34A7F0-DC77-4789-A136-93089CBD15C3}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{53543535-E81D-4B28-8EB0-89E9A8FDD496}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Scheduler", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Scheduler\Masa.BuildingBlocks.StackSdks.Scheduler.csproj", "{0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E38DF0DC-C0C9-4BB9-983C-F435A73334CF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Mc", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdks.Mc\Masa.BuildingBlocks.StackSdks.Mc.csproj", "{DA816A33-F164-4456-92DD-A672BAD1A6B1}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{45B8C34E-A62D-4809-BA0F-6046AFAB2851}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Caller", "src\BuildingBlocks\src\Service\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{ABF6E41A-CBF9-49DE-87FC-9D88F440A104}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{7B9CD814-DD10-4C63-B442-2168A0E0B6DE}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{5944A182-13B8-4DA6-AEE2-0A01E64A9648}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{0C5262F4-DC7E-493F-AB87-A72063ABCA00}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Configuration.Tests\Masa.BuildingBlocks.Configuration.Tests.csproj", "{B228589B-4106-4CF8-B165-26636B94BE2C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cqrs", "Cqrs", "{FE906D46-B113-4600-AC2C-7523937B96AB}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{920E6762-32FE-4BEC-AD0C-6F28119C6804}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{08649D7D-EF5A-4626-9959-935CA85DF770}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{8663AD83-4E2C-47EF-BF28-1427E82F1A36}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{FE0F37B3-7727-4A08-AEA1-437F53982658}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DistributedLock", "DistributedLock", "{8910E0AA-9BFB-4E69-A821-A411FEDBAFD4}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdGenerator", "IdGenerator", "{A9D8D7E4-591D-479B-B0A5-07F30F831199}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{4B812744-1CB5-4760-9719-2220EACC566C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{14D3C601-C29B-48D2-8312-556319D04619}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing", "src\BuildingBlocks\src\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj", "{322F0F91-E181-4139-87DE-974CCF2339BA}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{542D8266-668F-49FA-BFE1-814AB96720DD}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{232840A6-183C-4D3A-A086-582FD449D300}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{83AA938C-9182-4E65-A42A-79CAE68888E9}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{7064C470-7D0B-4CE2-A80C-BEE376DDC956}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{BA74E50F-C553-40D6-8578-BCB4A3F5E585}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E8CE3469-6E0F-495C-937E-D9820DE3DA89}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{32BC64A9-9BC9-44F3-8978-96D30CBC7A34}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{46C33E74-835B-4CB4-861D-42A781A2502C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{DC9F9523-A2F9-47AA-B6D9-40AC14797548}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching", "Caching", "{02B35A90-23DF-4341-89CF-E911ED210FBE}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{985B71A9-DF28-4B70-9DA5-1D60B82E8551}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{2DC587FC-4D6D-400D-9504-69D9664A4124}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitignore = .gitignore + .gitmodules = .gitmodules + Directory.Build.props = Directory.Build.props + LICENSE.txt = LICENSE.txt + NuGet.Config = NuGet.Config + README.md = README.md + README.zh-CN.md = README.zh-CN.md + EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{BCDB0439-8542-4DE7-A8C2-9BB582AE8C42}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E747043D-81E2-4A89-8B5B-1258ED45F941}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development", "{F262689D-5BE8-45E9-B090-0CFF81315FB9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Snowflake", "Snowflake", "{5BD3D50F-5CB6-4554-9497-0F1680152D95}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SequentialGuid", "SequentialGuid", "{516A316F-BE2B-4931-88DD-4C08DECE8E56}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ldap", "Ldap", "{8A795434-6928-41F6-B8B1-3F6DAC62D1A0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Local", "Local", "{2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{611ECFDA-B435-4106-BDB8-DD8C39FEBF08}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Medallion", "Medallion", "{81DF5E8A-2AFE-47FC-BE66-40BC557A03AB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Exceptions", "src\Utils\src\Masa.Utils.Exceptions\Masa.Utils.Exceptions.csproj", "{46C86695-A597-47F3-944E-03C63CA678F4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Core", "src\Utils\src\Caching\Masa.Utils.Caching.Core\Masa.Utils.Caching.Core.csproj", "{DBD1137D-0208-4CF4-BB45-36FE023B4FED}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dcc", "Dcc", "{F7DEBE88-8324-47F9-B240-4F19F706B50B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.DistributedMemory", "src\Utils\src\Caching\Masa.Utils.Caching.DistributedMemory\Masa.Utils.Caching.DistributedMemory.csproj", "{8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mc", "Mc", "{DFCA5F96-FFC3-44D7-85D8-1749F0D3845E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Memory", "src\Utils\src\Caching\Masa.Utils.Caching.Memory\Masa.Utils.Caching.Memory.csproj", "{A93D1699-A8B1-432E-8929-5800F4FE5AA7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pm", "Pm", "{EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis", "src\Utils\src\Caching\Masa.Utils.Caching.Redis\Masa.Utils.Caching.Redis.csproj", "{049430DA-664C-4C77-A679-0CF12217ABB2}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scheduler", "Scheduler", "{A7C74F80-E9E4-401F-93F4-560EC1BAC88E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Json", "src\Utils\src\Configuration\Masa.Utils.Configuration.Json\Masa.Utils.Configuration.Json.csproj", "{6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tsc", "Tsc", "{4FB42611-1B54-4ABF-988A-714EE9E8C492}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Dcc", "src\Utils\src\Configuration\Masa.Utils.Configuration.Dcc\Masa.Utils.Configuration.Dcc.csproj", "{64B72C9E-85BD-4C41-B67D-892157600F5B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataAnnotations", "DataAnnotations", "{F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations", "src\Utils\src\Data\Masa.Utils.Data.DataAnnotations\Masa.Utils.Data.DataAnnotations.csproj", "{354D1855-EE83-41EF-BFFC-1348F77A66DB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elasticsearch", "Elasticsearch", "{08FED323-7D60-4B8B-AD36-C55B40C96D1C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch", "src\Utils\src\Data\Masa.Utils.Data.Elasticsearch\Masa.Utils.Data.Elasticsearch.csproj", "{8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Prometheus", "Prometheus", "{2879EB9A-D18B-4C57-B041-365F7DAEEBC4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr", "src\Utils\src\Development\Masa.Utils.Development.Dapr\Masa.Utils.Development.Dapr.csproj", "{A88B4DB8-2441-488D-B097-68F02F18DECC}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependencyInjection", "DependencyInjection", "{33D4C640-954B-4468-95A4-2322DAB0B184}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr.AspNetCore", "src\Utils\src\Development\Masa.Utils.Development.Dapr.AspNetCore\Masa.Utils.Development.Dapr.AspNetCore.csproj", "{3B5C4669-07C6-49F0-BC69-70A8980FC605}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConfigurationApi", "ConfigurationApi", "{CD7414D5-4DE9-4339-B833-29EF41B3AC76}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Validations", "Validations", "{B1984322-509A-4E96-BFB0-A0D5DEDFB92D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IntegrationEvents", "IntegrationEvents", "{EAF8FB96-6D0E-4FCD-B991-C845903ECA8B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Validations.FluentValidation", "src\Utils\src\Extensions\Validations\Masa.Utils.Extensions.Validations.FluentValidation\Masa.Utils.Extensions.Validations.FluentValidation.csproj", "{81618F3D-ED3C-44C5-9BAD-8F04CF601D42}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dapr", "Dapr", "{FF832650-37C7-48FF-B078-77CACF37966E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection", "src\Utils\src\Extensions\Masa.Utils.Extensions.DependencyInjection\Masa.Utils.Extensions.DependencyInjection.csproj", "{F6E5B615-A85D-4FB4-97D0-698098D7616F}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EventLogs", "EventLogs", "{46DE49C1-D700-4C46-849A-7F485D87A518}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DotNet", "src\Utils\src\Extensions\Masa.Utils.Extensions.DotNet\Masa.Utils.Extensions.DotNet.csproj", "{7A628B6A-AFE4-4235-95AA-9A711268B9B1}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Events", "Events", "{6B1042A4-A6D5-4307-B163-803164E4A742}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Expressions", "src\Utils\src\Extensions\Masa.Utils.Extensions.Expressions\Masa.Utils.Extensions.Expressions.csproj", "{E417DAE3-A1D2-430D-A6C7-C8BDE083D851}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.EventBus.IntegrationTests", "test\Masa.EventBus.IntegrationTests\Masa.EventBus.IntegrationTests.csproj", "{BDA1DB4F-C408-445D-9391-EC9765CF7349}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Enums", "src\Utils\src\Extensions\Masa.Utils.Extensions.Enums\Masa.Utils.Extensions.Enums.csproj", "{9A6A3012-6A11-415B-BC58-E2268BE7022E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{7A8F1593-C00F-4D90-9029-11BF75B3C926}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{70449866-CC6B-438B-B8DC-CBAB436EFD00}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core", "src\Utils\src\Caller\Masa.Utils.Caller.Core\Masa.Utils.Caller.Core.csproj", "{0F43C687-59EF-4164-B3A5-E53C3BF86892}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{EE77C779-1031-4494-9850-3F2D85D8FA10}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.DaprClient", "src\Utils\src\Caller\Masa.Utils.Caller.DaprClient\Masa.Utils.Caller.DaprClient.csproj", "{BE11C98A-5680-491E-86E9-93B0A83909EA}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oidc", "Oidc", "{BB0DFD22-33FF-465F-8788-D583BE39BC6D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.HttpClient", "src\Utils\src\Caller\Masa.Utils.Caller.HttpClient\Masa.Utils.Caller.HttpClient.csproj", "{E2B9737D-9630-4705-B2DF-21C2EB607F65}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data", "src\BuildingBlocks\Data\Data\src\Masa.BuildingBlocks.Data\Masa.BuildingBlocks.Data.csproj", "{A91E96C6-9437-4335-A629-D4B3E921F9E8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus", "src\Utils\src\Data\Masa.Utils.Data.Prometheus\Masa.Utils.Data.Prometheus.csproj", "{3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Mapping", "src\BuildingBlocks\Data\Mapping\src\Masa.BuildingBlocks.Data.Mapping\Masa.BuildingBlocks.Data.Mapping.csproj", "{78D31C12-2E54-4C66-9849-B9664B9A5897}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell", "src\Utils\src\Ldap\Masa.Utils.Ldap.Novell\Masa.Utils.Ldap.Novell.csproj", "{8C154ACF-ED6E-43C4-906E-2D36CBC8D112}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.MappingExtensions", "src\BuildingBlocks\Data\Mapping\src\Masa.BuildingBlocks.Data.MappingExtensions\Masa.BuildingBlocks.Data.MappingExtensions.csproj", "{03C37CB5-A325-4CB0-965A-A5FD67D14091}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{1677DDFE-BBCF-4BA3-B5A7-9168BB27838E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{4E20DC14-D9E4-484D-B99A-C4A759D1612E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Models.Config", "src\Utils\src\Models\Masa.Utils.Models.Config\Masa.Utils.Models.Config.csproj", "{CC117C03-267A-4145-B258-922C35484883}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.UoW", "src\BuildingBlocks\Data\UoW\src\Masa.BuildingBlocks.Data.UoW\Masa.BuildingBlocks.Data.UoW.csproj", "{BDA33777-F759-4050-85F5-68EB4996ADD7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication", "src\Utils\src\Security\Masa.Utils.Security.Authentication\Masa.Utils.Security.Authentication.csproj", "{1AD1F4E7-84DA-4CE8-BC69-7D713413560D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Contracts", "src\BuildingBlocks\Data\Contracts\src\Masa.BuildingBlocks.Data.Contracts\Masa.BuildingBlocks.Data.Contracts.csproj", "{A71C1D90-5513-4255-84A0-32384474E82C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B9256C4D-86F4-4E67-8774-C3EF971EC811}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Storage.ObjectStorage", "src\BuildingBlocks\Storage\ObjectStorage\src\Masa.BuildingBlocks.Storage.ObjectStorage\Masa.BuildingBlocks.Storage.ObjectStorage.csproj", "{AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication.OpenIdConnect", "src\Utils\src\Security\Masa.Utils.Security.Authentication.OpenIdConnect\Masa.Utils.Security.Authentication.OpenIdConnect.csproj", "{9DEA348B-8915-4BAA-AE04-99BF5FC6131B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.MinimalAPIs", "src\BuildingBlocks\Service\MinimalAPIs\src\Masa.BuildingBlocks.Service.MinimalAPIs\Masa.BuildingBlocks.Service.MinimalAPIs.csproj", "{AC537AD9-9CC3-420F-A17C-D77C4069A576}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography", "src\Utils\src\Security\Masa.Utils.Security.Cryptography\Masa.Utils.Security.Cryptography.csproj", "{E85FA5C9-C7D9-4461-99DE-11675749E38E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Caller", "src\BuildingBlocks\Service\Caller\src\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{617653DE-4377-4428-954B-E5FB4690E875}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Token", "src\Utils\src\Security\Masa.Utils.Security.Token\Masa.Utils.Security.Token.csproj", "{FB66887D-E08C-4551-B838-EAF49C1D1EE7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{CD0CAD92-5784-471A-BC57-2DC888FA0A00}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis.Tests", "src\Utils\test\Masa.Utils.Caching.Redis.Tests\Masa.Utils.Caching.Redis.Tests.csproj", "{D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MinimalAPIs", "MinimalAPIs", "{5D6E1CE0-D783-4F5C-9962-9AE073A62F30}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Tests", "src\Utils\test\Masa.Utils.Caller.Tests\Masa.Utils.Caller.Tests.csproj", "{675D2886-B4E9-4B14-A02D-44B5204EE2E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Contracts", "src\BuildingBlocks\Service\Service\src\Masa.BuildingBlocks.Service.Contracts\Masa.BuildingBlocks.Service.Contracts.csproj", "{741E75F7-9286-4C01-8C67-AA8515670DF7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations.Tests", "src\Utils\test\Masa.Utils.Data.DataAnnotations.Tests\Masa.Utils.Data.DataAnnotations.Tests.csproj", "{2A57A40F-92F5-4ACE-95AA-763915578282}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AutoComplete", "AutoComplete", "{D98F5757-375F-46D1-9903-5D8D57A6748F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch.Tests", "src\Utils\test\Masa.Utils.Data.Elasticsearch.Tests\Masa.Utils.Data.Elasticsearch.Tests.csproj", "{A89E129A-BBEA-431E-96D5-9AAEAA245A3C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete", "src\BuildingBlocks\SearchEngine\AutoComplete\src\Masa.BuildingBlocks.SearchEngine.AutoComplete\Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj", "{404CD919-D15D-49D6-8D26-E96486E62700}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus.Test", "src\Utils\test\Masa.Utils.Data.Prometheus.Test\Masa.Utils.Data.Prometheus.Test.csproj", "{B44F4054-5B66-4937-A99D-216DEFBAD0EF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\SearchEngine\AutoComplete\test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{47597D41-C795-43FE-8B76-069D9E1C364C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Tests", "src\Utils\test\Masa.Utils.Extensions.DependencyInjection.Tests\Masa.Utils.Extensions.DependencyInjection.Tests.csproj", "{A4F3852E-DC6B-43A8-A40A-899089546444}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.Events", "src\BuildingBlocks\Dispatcher\Events\src\Masa.BuildingBlocks.Dispatcher.Events\Masa.BuildingBlocks.Dispatcher.Events.csproj", "{3E9E2661-DDD6-4D33-BCA7-EA07784F6723}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell.Tests", "src\Utils\test\Masa.Utils.Ldap.Tests\Masa.Utils.Ldap.Novell.Tests\Masa.Utils.Ldap.Novell.Tests.csproj", "{CDA1B479-9B9A-43BD-A499-F8FAA6476F09}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.IntegrationEvents", "src\BuildingBlocks\Dispatcher\IntegrationEvents\src\Masa.BuildingBlocks.Dispatcher.IntegrationEvents\Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj", "{3FCB8575-6211-4E91-BCF8-1D2D380843B9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography.Tests", "src\Utils\test\Masa.Utils.Security.Cryptography.Tests\Masa.Utils.Security.Cryptography.Tests.csproj", "{AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain", "src\BuildingBlocks\Ddd\Domain\src\Masa.BuildingBlocks.Ddd.Domain\Masa.BuildingBlocks.Ddd.Domain.csproj", "{3016EDC5-4BE6-4CE2-8B18-6EE226920393}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contrib", "Contrib", "{950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.Cqrs", "src\BuildingBlocks\ReadWriteSpliting\Cqrs\src\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj", "{2809DB8A-95FA-4330-97C7-4A4936CD0EA9}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{53543535-E81D-4B28-8EB0-89E9A8FDD496}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing", "src\BuildingBlocks\ReadWriteSpliting\EventSourcing\src\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj", "{54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun", "src\Contrib\src\Storage\Masa.Contrib.Storage.ObjectStorage.Aliyun\Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj", "{4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "src\BuildingBlocks\Ddd\Domain\test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{45BAE42F-4801-4758-9CDA-0D900C734369}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E38DF0DC-C0C9-4BB9-983C-F435A73334CF}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdentityModel", "IdentityModel", "{0329A13A-436E-4E00-A1C7-243F9DD4B7D2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs", "src\Contrib\src\Service\Masa.Contrib.Service.MinimalAPIs\Masa.Contrib.Service.MinimalAPIs.csproj", "{89B2A360-4806-41B2-9CE1-F2E556BB222D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\Identity\IdentityModel\src\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{9DE85526-8B33-4291-B285-4BECF431D6FA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{45B8C34E-A62D-4809-BA0F-6046AFAB2851}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolation", "src\BuildingBlocks\Isolation\src\Masa.BuildingBlocks.Isolation\Masa.BuildingBlocks.Isolation.csproj", "{DCA283C7-2492-4461-BD34-AB00191C46F7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller", "src\Contrib\src\Service\Caller\Masa.Contrib.Service.Caller\Masa.Contrib.Service.Caller.csproj", "{C72508E7-CEF3-4E36-BF39-F3908EE338B7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration", "src\BuildingBlocks\Configuration\src\Masa.BuildingBlocks.Configuration\Masa.BuildingBlocks.Configuration.csproj", "{1EF25877-2E8F-4FF1-A530-F3DEB512E238}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.DaprClient", "src\Contrib\src\Service\Caller\Masa.Contrib.Service.Caller.DaprClient\Masa.Contrib.Service.Caller.DaprClient.csproj", "{65605EB9-FA98-42CE-8F40-117D89D59786}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration.Tests", "src\BuildingBlocks\Configuration\test\Masa.BuildingBlocks.Configuration.Tests\Masa.BuildingBlocks.Configuration.Tests.csproj", "{1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.HttpClient", "src\Contrib\src\Service\Caller\Masa.Contrib.Service.Caller.HttpClient\Masa.Contrib.Service.Caller.HttpClient.csproj", "{5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth", "src\BuildingBlocks\StackSdks\Auth\src\Masa.BuildingBlocks.StackSdks.Auth\Masa.BuildingBlocks.StackSdks.Auth.csproj", "{06918731-F657-417E-A74D-E2D7E77351B1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{7B9CD814-DD10-4C63-B442-2168A0E0B6DE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth.Contracts", "src\BuildingBlocks\StackSdks\Auth\src\Masa.BuildingBlocks.StackSdks.Auth.Contracts\Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj", "{1818788E-7C68-4280-93A8-63D01168C6B6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch", "src\Contrib\src\SearchEngine\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj", "{4F26D6F5-32FA-4EE6-8588-A325734E4386}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{DC292168-27F4-4469-8CDA-92FB4212EF53}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{0C5262F4-DC7E-493F-AB87-A72063ABCA00}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Dcc", "src\BuildingBlocks\StackSdks\Dcc\src\Masa.BuildingBlocks.StackSdks.Dcc\Masa.BuildingBlocks.StackSdks.Dcc.csproj", "{872994E4-7D87-483A-B6DD-E68DE4526497}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cqrs", "Cqrs", "{FE906D46-B113-4600-AC2C-7523937B96AB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dcc", "Dcc", "{BEC84962-7BBD-4C11-8FD1-D175AC54FE83}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs", "src\Contrib\src\ReadWriteSpliting\Cqrs\Masa.Contrib.ReadWriteSpliting.Cqrs\Masa.Contrib.ReadWriteSpliting.Cqrs.csproj", "{6FF949B6-F1C6-4056-B9DA-CC6120D427FC}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pm", "Pm", "{40EC04A2-9862-43E5-A1B8-69CED1BE646C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{920E6762-32FE-4BEC-AD0C-6F28119C6804}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mc", "Mc", "{6092474F-2AF3-4C24-A121-74F7A0C87E09}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation", "src\Contrib\src\Isolation\Masa.Contrib.Isolation\Masa.Contrib.Isolation.csproj", "{36A7B94C-1CC6-4C12-AB47-240FEB02EECF}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scheduler", "Scheduler", "{EB4B7EA5-274B-4AF0-8F4B-BB474BB63D6D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment", "src\Contrib\src\Isolation\Masa.Contrib.Isolation.MultiEnvironment\Masa.Contrib.Isolation.MultiEnvironment.csproj", "{E2115E04-198A-48A6-9DD0-F1F8335F3FD8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tsc", "Tsc", "{D4A6B54C-70DE-4CE0-B115-30694548E253}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant", "src\Contrib\src\Isolation\Masa.Contrib.Isolation.MultiTenant\Masa.Contrib.Isolation.MultiTenant.csproj", "{85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Mc", "src\BuildingBlocks\StackSdks\Mc\src\Masa.BuildingBlocks.StackSdks.Mc\Masa.BuildingBlocks.StackSdks.Mc.csproj", "{A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF", "src\Contrib\src\Isolation\Masa.Contrib.Isolation.UoW.EF\Masa.Contrib.Isolation.UoW.EF.csproj", "{672C436B-ECE4-4722-8B7D-4EF1E45194B0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Pm", "src\BuildingBlocks\StackSdks\Pm\src\Masa.BuildingBlocks.StackSdks.Pm\Masa.BuildingBlocks.StackSdks.Pm.csproj", "{C7A93ED9-5D0B-4F32-AA8A-69A515C32342}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Scheduler", "src\BuildingBlocks\StackSdks\Scheduler\src\Masa.BuildingBlocks.StackSdks.Scheduler\Masa.BuildingBlocks.StackSdks.Scheduler.csproj", "{8B0D2243-5E00-472E-82EC-572905A373AF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF", "src\Contrib\src\Data\Masa.Contrib.Data.UoW.EF\Masa.Contrib.Data.UoW.EF.csproj", "{5D9F3039-D6FE-4F2E-9752-486ADF970093}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Tsc", "src\BuildingBlocks\StackSdks\Tsc\src\Masa.BuildingBlocks.StackSdk.Tsc\Masa.BuildingBlocks.StackSdks.Tsc.csproj", "{94F98C15-6E92-466A-A93D-EB37CC877F99}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF", "src\Contrib\src\Data\Masa.Contrib.Data.Contracts.EF\Masa.Contrib.Data.Contracts.EF.csproj", "{E99EB5EE-6C3A-4878-9407-BB4060F5E200}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.csproj", "{6920A090-9B17-4C6B-B86D-7807C7D32BA0}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Cosmos", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.Cosmos\Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj", "{DA7F5603-FEC0-4090-9561-77B317D9EFA4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Cosmos", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Cosmos\Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj", "{7A4F49AC-A597-4D41-B380-675787D00CCD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.InMemory", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.InMemory\Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj", "{E48D5AFE-8392-46D4-92C5-E3C6332035AB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.InMemory", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.InMemory\Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj", "{39F57444-3DB4-458D-9CEB-6484069BD7E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.MySql", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.MySql\Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj", "{84B7A048-5B99-429A-8322-0DE98560C2D0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.MySql", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.MySql\Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj", "{8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Oracle", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.Oracle\Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj", "{7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Oracle", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Oracle\Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj", "{12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj", "{074FE1B1-CC4A-4E2F-88FB-BD0131C88306}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj", "{55887169-B044-47AA-8554-E5F51935FF38}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.PostgreSql", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj", "{C9FF6E3A-B173-4070-8DA8-84EDE6F77298}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.PostgreSql", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj", "{90D60969-E01C-4993-9DC4-794180FF49E5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Sqlite", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.Sqlite\Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj", "{C598E4D8-634C-40B2-BD77-ED69AD4BF211}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Sqlite", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Sqlite\Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj", "{12E3C29F-AE3A-4BC9-A7CE-904269223C3B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.SqlServer", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.SqlServer\Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj", "{5238486B-2E9E-44CE-84BC-1BF55AB59EE5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.SqlServer", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.SqlServer\Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj", "{430DC17D-B161-48D6-B4CE-17913C1AABBE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Tests", "src\Contrib\Data\EntityFrameworkCore\test\Masa.Contrib.Data.EntityFrameworkCore.Tests\Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj", "{9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore", "src\Contrib\src\Data\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.csproj", "{76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.NormalGuid", "src\Contrib\Data\IdGenerator\NormalGuid\src\Masa.Contrib.Data.IdGenerator.NormalGuid\Masa.Contrib.Data.IdGenerator.NormalGuid.csproj", "{29071256-A255-4881-8BF7-63EA598313F8}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DistributedLock", "DistributedLock", "{8910E0AA-9BFB-4E69-A821-A411FEDBAFD4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NormalGuid", "NormalGuid", "{EDCE6A71-453E-4FB4-B01B-D8DBE16F1C49}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdGenerator", "IdGenerator", "{A9D8D7E4-591D-479B-B0A5-07F30F831199}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid", "src\Contrib\Data\IdGenerator\SequentialGuid\src\Masa.Contrib.Data.IdGenerator.SequentialGuid\Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj", "{4CE43CE6-A150-44B9-9896-EB5D28B994B0}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{14D3C601-C29B-48D2-8312-556319D04619}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake", "src\Contrib\Data\IdGenerator\Snowflake\src\Masa.Contrib.Data.IdGenerator.Snowflake\Masa.Contrib.Data.IdGenerator.Snowflake.csproj", "{747A2EBA-BF28-4153-BF03-3300DA570061}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Local\Masa.Contrib.Data.DistributedLock.Local.csproj", "{19C7B778-345C-407B-BE72-67BF04784F35}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis", "src\Contrib\Data\IdGenerator\Snowflake\src\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj", "{13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion\Masa.Contrib.Data.DistributedLock.Medallion.csproj", "{7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests", "src\Contrib\Data\IdGenerator\Snowflake\test\Masa.Contrib.Data.IdGenerator.Snowflake.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj", "{6521511B-CE2E-485D-B72C-C22D89A191A2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Azure", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Azure\Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj", "{2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj", "{F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.FileSystem", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj", "{7DC7F500-F004-4DAC-9F16-D6878B3808E1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{6A44C395-D619-496E-A5A8-8F8FFA51177A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.MySql", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.MySql\Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj", "{9B615187-D90E-4334-BBD8-5973A12442F9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Exceptions", "Exceptions", "{F4CC0091-D652-4445-A9FD-9D2CE13A2286}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Oracle", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Oracle\Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj", "{F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Exceptions", "src\Utils\Exceptions\src\Masa.Utils.Exceptions\Masa.Utils.Exceptions.csproj", "{93510E80-4378-4504-A220-C71D0A61ADD6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj", "{8E00F570-6926-4304-BAE0-C9E7FA9A4213}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dapr", "Dapr", "{B5A410AD-C1F1-4D48-B78D-85D10ACA7881}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Redis", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Redis\Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj", "{89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr", "src\Utils\Development\Dapr\src\Masa.Utils.Development.Dapr\Masa.Utils.Development.Dapr.csproj", "{1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.SqlServer", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj", "{A69815D7-1C4F-4484-8E0B-7E6765203AC0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr.AspNetCore", "src\Utils\Development\Dapr\src\Masa.Utils.Development.Dapr.AspNetCore\Masa.Utils.Development.Dapr.AspNetCore.csproj", "{D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj", "{FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations", "src\Utils\Data\DataAnnotations\src\Masa.Utils.Data.DataAnnotations\Masa.Utils.Data.DataAnnotations.csproj", "{D66370B6-8E54-4E95-92CD-81236916A4D1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper", "src\Contrib\src\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj", "{524C5CA0-036E-480A-86E4-513232422F26}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations.Tests", "src\Utils\Data\DataAnnotations\test\Masa.Utils.Data.DataAnnotations.Tests\Masa.Utils.Data.DataAnnotations.Tests.csproj", "{47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.NormalGuid", "src\Contrib\src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.NormalGuid\Masa.Contrib.Data.IdGenerator.NormalGuid.csproj", "{1A3740CF-C51F-4E7A-BA27-6BF8652021BF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch", "src\Utils\Data\Elasticsearch\src\Masa.Utils.Data.Elasticsearch\Masa.Utils.Data.Elasticsearch.csproj", "{D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid", "src\Contrib\src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.SequentialGuid\Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj", "{217AB0A8-8750-4696-8E43-E11F82A191CB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch.Tests", "src\Utils\Data\Elasticsearch\test\Masa.Utils.Data.Elasticsearch.Tests\Masa.Utils.Data.Elasticsearch.Tests.csproj", "{A2707F9F-80CC-41F9-9ED6-B45E5732CC56}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake", "src\Contrib\src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake\Masa.Contrib.Data.IdGenerator.Snowflake.csproj", "{C92637A7-77FC-4995-8024-B28F6C58AEA8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus", "src\Utils\Data\Prometheus\src\Masa.Utils.Data.Prometheus\Masa.Utils.Data.Prometheus.csproj", "{7961AAE6-FDC0-43C3-A546-4DBFE340660D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis", "src\Contrib\src\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj", "{87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus.Test", "src\Utils\Data\Prometheus\test\Masa.Utils.Data.Prometheus.Test\Masa.Utils.Data.Prometheus.Test.csproj", "{6BB1FCDF-1E26-4837-984D-DA74D558A49B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster", "src\Contrib\src\Data\Mapping\Masa.Contrib.Data.Mapping.Mapster\Masa.Contrib.Data.Mapping.Mapster.csproj", "{2BDF6D68-91FF-4220-8D78-90AA024275C3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection", "src\Utils\Extensions\DependencyInjection\src\Masa.Utils.Extensions.DependencyInjection\Masa.Utils.Extensions.DependencyInjection.csproj", "{35F1DB8E-6479-4619-82BB-946BC7EC959E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{542D8266-668F-49FA-BFE1-814AB96720DD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Tests", "src\Utils\Extensions\DependencyInjection\test\Masa.Utils.Extensions.DependencyInjection.Tests\Masa.Utils.Extensions.DependencyInjection.Tests.csproj", "{0F4E4A62-04C7-4635-8543-D595B45D2D76}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel", "src\Contrib\src\Identity\Masa.Contrib.Identity.IdentityModel\Masa.Contrib.Identity.IdentityModel.csproj", "{AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Validations.FluentValidation", "src\Utils\Extensions\Validations\src\Masa.Utils.Extensions.Validations.FluentValidation\Masa.Utils.Extensions.Validations.FluentValidation.csproj", "{564A2C45-D42B-4A6C-A539-B10863D8E67C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{83AA938C-9182-4E65-A42A-79CAE68888E9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DotNet", "src\Utils\Extensions\DotNet\src\Masa.Utils.Extensions.DotNet\Masa.Utils.Extensions.DotNet.csproj", "{C31555B0-FCAA-44F9-8284-96FBDD7FAD37}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events", "src\Contrib\src\Dispatcher\Masa.Contrib.Dispatcher.Events\Masa.Contrib.Dispatcher.Events.csproj", "{8A7A91C6-C2F5-4C68-A53F-555EF93DB592}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Enums", "src\Utils\Extensions\Enums\src\Masa.Utils.Extensions.Enums\Masa.Utils.Extensions.Enums.csproj", "{965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents", "src\Contrib\src\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.csproj", "{66DEC85C-7433-4902-B01A-8F98D1A87385}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Expressions", "src\Utils\Extensions\Expressions\src\Masa.Utils.Extensions.Expressions\Masa.Utils.Extensions.Expressions.csproj", "{267429BB-FCFF-491B-B618-174DC3152EF7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr", "src\Contrib\src\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj", "{8BE42490-F83D-48D7-8C5D-1665AC84229C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell", "src\Utils\Ldap\Novell\src\Masa.Utils.Ldap.Novell\Masa.Utils.Ldap.Novell.csproj", "{9F6F4116-8029-4788-9561-A0791EDFB720}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF", "src\Contrib\src\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj", "{3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell.Tests", "src\Utils\Ldap\Novell\test\Masa.Utils.Ldap.Tests\Masa.Utils.Ldap.Novell.Tests\Masa.Utils.Ldap.Novell.Tests.csproj", "{C89383DE-0284-4E0F-94E2-ED2F7B4B5656}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{BA74E50F-C553-40D6-8578-BCB4A3F5E585}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Models.Config", "src\Utils\Models\Config\src\Masa.Utils.Models.Config\Masa.Utils.Models.Config.csproj", "{823B06D1-85E5-400B-885D-2B3CFD01487D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{32BC64A9-9BC9-44F3-8978-96D30CBC7A34}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core", "src\Utils\Caller\src\Masa.Utils.Caller.Core\Masa.Utils.Caller.Core.csproj", "{CC0C0477-2C69-4BB2-A433-15A0C25E782C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain", "src\Contrib\src\Ddd\Masa.Contrib.Ddd.Domain\Masa.Contrib.Ddd.Domain.csproj", "{2DEE608F-965F-4298-9B71-D7B32CBA66BD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.DaprClient", "src\Utils\Caller\src\Masa.Utils.Caller.DaprClient\Masa.Utils.Caller.DaprClient.csproj", "{74A8DA40-CB46-4B95-96DF-46A18090D987}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF", "src\Contrib\src\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF\Masa.Contrib.Ddd.Domain.Repository.EF.csproj", "{E7C80137-1D51-4215-BED7-C739BC663BE2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.HttpClient", "src\Utils\Caller\src\Masa.Utils.Caller.HttpClient\Masa.Utils.Caller.HttpClient.csproj", "{53562602-1F63-4B2C-8921-B5BB826984F8}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{DC9F9523-A2F9-47AA-B6D9-40AC14797548}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Tests", "src\Utils\Caller\test\Masa.Utils.Caller.Tests\Masa.Utils.Caller.Tests.csproj", "{651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration", "src\Contrib\src\Configuration\Masa.Contrib.Configuration\Masa.Contrib.Configuration.csproj", "{4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Core", "src\Utils\Caching\Caching\src\Masa.Utils.Caching.Core\Masa.Utils.Caching.Core.csproj", "{EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc", "src\Contrib\src\Configuration\Masa.Contrib.Configuration.ConfigurationApi.Dcc\Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj", "{1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis", "src\Utils\Caching\Distributed\src\Masa.Utils.Caching.Redis\Masa.Utils.Caching.Redis.csproj", "{EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache", "src\Contrib\src\Authentication\Masa.Contrib.Authentication.Oidc.Cache\Masa.Contrib.Authentication.Oidc.Cache.csproj", "{B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.DistributedMemory", "src\Utils\Caching\DistributedMemory\src\Masa.Utils.Caching.DistributedMemory\Masa.Utils.Caching.DistributedMemory.csproj", "{B2465420-C899-4077-B6D3-B62405D5BFE2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache.Storage", "src\Contrib\src\Authentication\Masa.Contrib.Authentication.Oidc.Cache.Storage\Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj", "{1F04359A-64BB-4C86-8D2F-161C49F2CDEB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Memory", "src\Utils\Caching\Memory\src\Masa.Utils.Caching.Memory\Masa.Utils.Caching.Memory.csproj", "{5243EAA7-17B4-4810-ACDD-FCB28E1C477D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.EntityFrameworkCore", "src\Contrib\src\Authentication\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj", "{5A42D577-38AA-4A5B-866A-01FE1339F2AB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis.Tests", "src\Utils\Caching\Distributed\test\Masa.Utils.Caching.Redis.Tests\Masa.Utils.Caching.Redis.Tests.csproj", "{36BA4778-011A-4B0F-8C6A-C169E012AE66}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj", "{B189564D-F638-4D3F-8AA6-B9C62D8F49BE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Dcc", "src\Utils\Configuration\src\Masa.Utils.Configuration.Dcc\Masa.Utils.Configuration.Dcc.csproj", "{E624718C-38CD-41AA-BBA0-415008BE86BF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.AutoMap.Tests\Masa.Contrib.Configuration.AutoMap.Tests.csproj", "{C517C235-8969-478B-941B-2E40897F4C71}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Json", "src\Utils\Configuration\src\Masa.Utils.Configuration.Json\Masa.Utils.Configuration.Json.csproj", "{3F2A0172-118E-439E-BD4A-5E0F95361838}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj", "{41817AD2-D1DA-4698-B87D-910524CE4B7A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local", "src\Contrib\Data\DistributedLock\Local\src\Masa.Contrib.Data.DistributedLock.Local\Masa.Contrib.Data.DistributedLock.Local.csproj", "{9D295FC2-32A9-487A-BAE3-348F6360729D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests", "src\Contrib\test\Configuration\Masa.Contrib.Configuration.Tests\Masa.Contrib.Configuration.Tests.csproj", "{36629279-FD56-452B-88C2-5C8271500042}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local.Tests", "src\Contrib\Data\DistributedLock\Local\test\Masa.Contrib.Data.DistributedLock.Local.Tests\Masa.Contrib.Data.DistributedLock.Local.Tests.csproj", "{D215BD91-4D7B-437E-BC2A-14D9B81649E5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj", "{40D7AED3-982D-440B-BCD5-C1EFFC59514D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion\Masa.Contrib.Data.DistributedLock.Medallion.csproj", "{FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj", "{87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Azure", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.Azure\Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj", "{89B90362-4C48-4FBD-A0B7-47E34D3326F0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj", "{A1D7408C-AB95-4CFF-89F8-24797A865DBF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.FileSystem", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj", "{5C84C069-DB54-409A-BC0F-CBC066860CBA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj", "{7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.MySql", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.MySql\Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj", "{A02A0101-3C0E-4971-AB0C-CC762C0E3955}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj", "{8680EA03-13A7-4F4A-A579-EB2CB6411C21}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Oracle", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.Oracle\Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj", "{B469E3EE-637F-4A0A-852D-6A33F896B906}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj", "{4CE930E3-12E4-4BFA-962E-3477B7AB6930}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj", "{2B288DAC-2E49-4980-B234-6E114FB1B2F1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj", "{8903DCD8-A68D-4164-83EE-DE07385DDDD6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Redis", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.Redis\Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj", "{5DAFE25B-EA24-429E-A3D2-7CD28565E444}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.Events.Tests\Masa.Contrib.Dispatcher.Events.Tests.csproj", "{E2E68FF1-9CB5-424F-9D91-130A48462E54}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.SqlServer", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj", "{EAF59CBD-2310-4BF0-AE28-580D451F9C86}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj", "{7FFFE514-2221-4FB1-AD37-EE56A392C3E2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj", "{DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj", "{472122D3-114E-424D-AF47-B3D7E94057A8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj", "{EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Tests", "src\Contrib\test\Dispatcher\Masa.Contrib.Dispatcher.IntegrationEvents.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj", "{B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contracts", "Contracts", "{AF7F4D54-CE14-4BE1-8E9E-2D56C6809508}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{985B71A9-DF28-4B70-9DA5-1D60B82E8551}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF", "src\Contrib\Data\Contracts\src\Masa.Contrib.Data.Contracts.EF\Masa.Contrib.Data.Contracts.EF.csproj", "{ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Auth\Masa.Contrib.StackSdks.Auth.csproj", "{140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF.Tests", "src\Contrib\Data\Contracts\test\Masa.Contrib.Data.Contracts.EF.Tests\Masa.Contrib.Data.Contracts.EF.Tests.csproj", "{9C25DDE5-65D9-492D-9C04-F3D64EE706A1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Dcc\Masa.Contrib.StackSdks.Dcc.csproj", "{EAAD274F-9C5D-4531-A4E5-A5764E9D644A}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{8FE4210C-9D74-4E8B-84CD-4E96751A50DD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Mc\Masa.Contrib.StackSdks.Mc.csproj", "{F9C27912-F7EC-47B6-A385-064BD4B92EDA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF", "src\Contrib\Data\UoW\src\Masa.Contrib.Data.UoW.EF\Masa.Contrib.Data.UoW.EF.csproj", "{A2EDB5D7-9675-403A-9FC2-FDAA49555097}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Pm\Masa.Contrib.StackSdks.Pm.csproj", "{F346B708-0D1B-4BA7-AA86-1B977BA88FB6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF.Tests", "src\Contrib\Data\UoW\test\Masa.Contrib.Data.UoW.EF.Tests\Masa.Contrib.Data.UoW.EF.Tests.csproj", "{D7D46284-47DF-488A-8D04-421CBAAF6943}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Scheduler\Masa.Contrib.StackSdks.Scheduler.csproj", "{332D590C-11EC-481D-AC55-6279548F1CF4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration", "src\Contrib\Configuration\Configuration\src\Masa.Contrib.Configuration\Masa.Contrib.Configuration.csproj", "{DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc", "src\Contrib\src\StackSdks\Masa.Contrib.StackSdks.Tsc\Masa.Contrib.StackSdks.Tsc.csproj", "{7BF99E7E-37EB-46D6-8808-2254430C3645}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests", "src\Contrib\Configuration\Configuration\test\Masa.Contrib.Configuration.Tests\Masa.Contrib.Configuration.Tests.csproj", "{848EC46B-2C09-4E4E-9D09-D876862B52CD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Tsc.Test\Masa.Contrib.StackSdks.Tsc.Tests.csproj", "{5EF602A6-3996-44D3-A6C0-5319C9BF8B21}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{CDE13B76-107F-4282-BEAE-26843BD46140}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Mc.Tests\Masa.Contrib.StackSdks.Mc.Tests.csproj", "{37138DEF-EEE4-4363-A307-0027B4C6ACD8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests", "src\Contrib\Configuration\Configuration\test\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj", "{1226DCD2-D128-4976-8806-2A369F87058B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Auth.Tests\Masa.Contrib.StackSdks.Auth.Tests.csproj", "{A93F1887-0011-466C-8EB8-3A338AEA5A4B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.Tests", "src\Contrib\Configuration\Configuration\test\Masa.Contrib.Configuration.AutoMap.Tests\Masa.Contrib.Configuration.AutoMap.Tests.csproj", "{80F6E78A-4ADB-4E51-9570-A9200048F48F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Pm.Tests\Masa.Contrib.StackSdks.Pm.Tests.csproj", "{A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc", "src\Contrib\Configuration\ConfigurationApi\src\Masa.Contrib.Configuration.ConfigurationApi.Dcc\Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj", "{97708A6F-A6F9-4E7A-9069-65ABBBA12D06}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Scheduler.Tests\Masa.Contrib.StackSdks.Scheduler.Tests.csproj", "{9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests", "src\Contrib\Configuration\ConfigurationApi\test\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj", "{85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.MultiEnvironment.Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj", "{CC7ED747-8BCE-4B49-8855-AE4697792A81}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain", "src\Contrib\Ddd\Domain\src\Masa.Contrib.Ddd.Domain\Masa.Contrib.Ddd.Domain.csproj", "{6E74144B-0816-4161-AACC-8C696E0E9C34}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.MultiTenant.Tests\Masa.Contrib.Isolation.MultiTenant.Tests.csproj", "{605A3653-C7E3-4EC2-8749-979E4A0227D0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF", "src\Contrib\Ddd\Domain\src\Masa.Contrib.Ddd.Domain.Repository.EF\Masa.Contrib.Ddd.Domain.Repository.EF.csproj", "{C903135B-E0CE-4DB0-B8BF-FF59816C24D8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.Tests\Masa.Contrib.Isolation.Tests.csproj", "{2D61CA3A-A40C-466D-9E87-59A32A86B7BC}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.UoW.EF.Tests\Masa.Contrib.Isolation.UoW.EF.Tests.csproj", "{50C13F5E-BA3A-4B04-A730-BAA584E051AB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\Ddd\Domain\test\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{D3C16432-EAD0-4DE5-9544-16D36A67C2C2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Web.Tests", "src\Contrib\test\Isolation\Masa.Contrib.Isolation.UoW.EF.Web.Tests\Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj", "{C8AD2261-D325-414D-9B2D-B2A9D27C242F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events", "src\Contrib\Dispatcher\Events\src\Masa.Contrib.Dispatcher.Events\Masa.Contrib.Dispatcher.Events.csproj", "{F0353FB0-27F0-4957-8D69-4AEE40A09801}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel.Tests", "src\Contrib\test\Identity\Masa.Contrib.Identity.IdentityModel.Tests\Masa.Contrib.Identity.IdentityModel.Tests.csproj", "{CC9C8421-68D2-4645-B97E-512FAC691703}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.Tests\Masa.Contrib.Dispatcher.Events.Tests.csproj", "{3735BFA1-F935-42EF-A316-BEEF0A138781}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local.Tests", "src\Contrib\test\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Local.Tests\Masa.Contrib.Data.DistributedLock.Local.Tests.csproj", "{1551B2ED-9931-4A03-8853-1C3E5504C43D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj", "{A3DE164B-54D1-440F-A9E9-19A5C667E073}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Tests", "src\Contrib\test\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Medallion.Tests\Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj", "{CB1F1533-E430-47C5-AD52-04922CC959A5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj", "{175CDD95-C2C2-4665-8CC3-5D1D6BC94098}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF.Tests", "src\Contrib\test\Data\Masa.Contrib.Data.Contracts.EF.Tests\Masa.Contrib.Data.Contracts.EF.Tests.csproj", "{0607F6E0-84AC-4FBC-9717-6F0B1D18E574}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj", "{D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Tests", "src\Contrib\test\Data\Masa.Contrib.Data.EntityFrameworkCore.Tests\Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj", "{1041A4C4-D422-4AD8-B511-B8E7FBA548C9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj", "{1BC59353-A6FF-4C0C-9B47-37884621E228}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF.Tests", "src\Contrib\test\Data\Masa.Contrib.Data.UoW.EF.Tests\Masa.Contrib.Data.UoW.EF.Tests.csproj", "{D05ADEA6-2267-4DC1-901A-BD18B697E889}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj", "{19902ADB-7C37-4E38-ABC0-28BCDE2D164D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests", "src\Contrib\test\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj", "{1787BF8C-3C05-4E07-8868-E839544F9522}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj", "{F92CC9A7-BE67-48F3-8DAE-D59821F031FD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests", "src\Contrib\test\Data\IdGenerator\Masa.Contrib.Data.IdGenerator.Snowflake.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj", "{F673CF31-D8CF-4F3E-B294-0802589F5BF2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj", "{CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster.Tests", "src\Contrib\test\Data\Mapping\Masa.Contrib.Data.Mapping.Mapster.Tests\Masa.Contrib.Data.Mapping.Mapster.Tests.csproj", "{0D9CDEA2-0DC6-490A-9145-782259B63739}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Benchmarks", "src\Contrib\Dispatcher\Events\perf\Masa.Contrib.Dispatcher.Events.Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks.csproj", "{5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs.Tests", "src\Contrib\test\Service\Masa.Contrib.Service.MinimalAPIs.Tests\Masa.Contrib.Service.MinimalAPIs.Tests.csproj", "{80512601-4B59-4A1B-984F-8E81E3242F97}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents", "src\Contrib\Dispatcher\IntegrationEvents\src\Masa.Contrib.Dispatcher.IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.csproj", "{885CDA4A-9831-4159-A0A7-9062CF93180A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.AutomaticCaller.Tests", "src\Contrib\test\Service\Caller\Masa.Contrib.Service.Caller.AutomaticCaller.Tests\Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj", "{96C2CD33-8A8C-4206-9C73-97E8D748F397}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Tests", "src\Contrib\Dispatcher\IntegrationEvents\test\Masa.Contrib.Dispatcher.IntegrationEvents.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj", "{60A51206-8F7F-4F43-B473-006F0DB380CB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.Tests", "src\Contrib\test\Service\Caller\Masa.Contrib.Service.Caller.Tests\Masa.Contrib.Service.Caller.Tests.csproj", "{FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr", "src\Contrib\Dispatcher\IntegrationEvents\src\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj", "{51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests", "src\Contrib\test\Storage\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj", "{76117457-EC1B-4844-825A-20A760B42C44}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF", "src\Contrib\Dispatcher\IntegrationEvents\src\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj", "{B98309A2-D2D0-41BB-A7C6-8BA24B29D105}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests", "src\Contrib\test\SearchEngine\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj", "{89EE0C4D-6C29-472E-9109-84327DB489A1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests", "src\Contrib\Dispatcher\IntegrationEvents\test\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj", "{682FAD0B-5989-436C-9B7D-F15F10CB90FF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs.Tests", "src\Contrib\test\ReadWriteSpliting\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj", "{F45CBF27-1D45-404C-9B09-5CC781AF5942}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests", "src\Contrib\Dispatcher\IntegrationEvents\test\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj", "{8219C9CC-1260-4175-94E5-C36A336C8ADE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc.Tests", "src\Contrib\test\StackSdks\Masa.Contrib.StackSdks.Dcc.Tests\Masa.Contrib.StackSdks.Dcc.Tests.csproj", "{2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel", "src\Contrib\Identity\IdentityModel\src\Masa.Contrib.Identity.IdentityModel\Masa.Contrib.Identity.IdentityModel.csproj", "{9A15A065-8559-49E2-8818-9E8A9186A105}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Tsc", "src\BuildingBlocks\src\StackSdks\Masa.BuildingBlocks.StackSdk.Tsc\Masa.BuildingBlocks.StackSdks.Tsc.csproj", "{8EA836C9-BE07-4EDE-A983-122A1D9FB499}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel.Tests", "src\Contrib\Identity\IdentityModel\test\Masa.Contrib.Identity.IdentityModel.Tests\Masa.Contrib.Identity.IdentityModel.Tests.csproj", "{FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{2DC587FC-4D6D-400D-9504-69D9664A4124}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - .gitignore = .gitignore - .gitmodules = .gitmodules - Directory.Build.props = Directory.Build.props - LICENSE.txt = LICENSE.txt - NuGet.Config = NuGet.Config - README.md = README.md - README.zh-CN.md = README.zh-CN.md - EndProjectSection +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{C80C7EEF-1862-4607-8260-9FF0890DC573}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E747043D-81E2-4A89-8B5B-1258ED45F941}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation", "src\Contrib\Isolation\Isolation\src\Masa.Contrib.Isolation\Masa.Contrib.Isolation.csproj", "{2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.Tests", "src\Contrib\Isolation\Isolation\test\Masa.Contrib.Isolation.Tests\Masa.Contrib.Isolation.Tests.csproj", "{D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{B7D7027F-F125-40DD-92A2-A5CEE9E969CC}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MultiEnvironment", "MultiEnvironment", "{A4573B93-FE93-47A4-B700-B6B45516E7AA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks", "src\Contrib\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj", "{49DB6925-62FF-4CF3-A041-A7F117AD6256}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment", "src\Contrib\Isolation\MultiEnvironment\src\Masa.Contrib.Isolation.MultiEnvironment\Masa.Contrib.Isolation.MultiEnvironment.csproj", "{1EF70F79-B605-4729-99E7-E85386AAC649}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{09AD9DFA-6AD8-4872-AA96-29C3234828CD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment.Tests", "src\Contrib\Isolation\MultiEnvironment\test\Masa.Contrib.Isolation.MultiEnvironment.Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj", "{2CA6351B-DEA7-4343-91C1-8C20507343EE}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Snowflake", "Snowflake", "{5BD3D50F-5CB6-4554-9497-0F1680152D95}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MultiTenant", "MultiTenant", "{3440FA45-ADEA-4202-AF43-62E6F5904893}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SequentialGuid", "SequentialGuid", "{516A316F-BE2B-4931-88DD-4C08DECE8E56}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant", "src\Contrib\Isolation\MultiTenant\src\Masa.Contrib.Isolation.MultiTenant\Masa.Contrib.Isolation.MultiTenant.csproj", "{6C1A8E47-8391-416B-9407-2A1F97A62776}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Local", "Local", "{2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant.Tests", "src\Contrib\Isolation\MultiTenant\test\Masa.Contrib.Isolation.MultiTenant.Tests\Masa.Contrib.Isolation.MultiTenant.Tests.csproj", "{E7A282E3-CC87-48C9-A80B-664A5390C715}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Medallion", "Medallion", "{81DF5E8A-2AFE-47FC-BE66-40BC557A03AB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{26CFEFAA-EA53-4163-A2B9-4B5318AF27DD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Benchmarks", "src\Contrib\perf\Masa.Contrib.Dispatcher.Events.Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks.csproj", "{76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF", "src\Contrib\Isolation\UoW\src\Masa.Contrib.Isolation.UoW.EF\Masa.Contrib.Isolation.UoW.EF.csproj", "{D3B70875-76B0-4F48-9798-4A700E4902E5}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Tests", "src\Contrib\Isolation\UoW\test\Masa.Contrib.Isolation.UoW.EF.Tests\Masa.Contrib.Isolation.UoW.EF.Tests.csproj", "{0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dcc", "Dcc", "{F7DEBE88-8324-47F9-B240-4F19F706B50B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Web.Tests", "src\Contrib\Isolation\UoW\test\Masa.Contrib.Isolation.UoW.EF.Web.Tests\Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj", "{0665C217-CDF0-4153-93DA-886230CB19CF}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mc", "Mc", "{DFCA5F96-FFC3-44D7-85D8-1749F0D3845E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs", "src\Contrib\ReadWriteSpliting\Cqrs\src\Masa.Contrib.ReadWriteSpliting.Cqrs\Masa.Contrib.ReadWriteSpliting.Cqrs.csproj", "{88A46A64-0877-44BB-87FB-C3A046104A17}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pm", "Pm", "{EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs.Tests", "src\Contrib\ReadWriteSpliting\Cqrs\test\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj", "{3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scheduler", "Scheduler", "{A7C74F80-E9E4-401F-93F4-560EC1BAC88E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch", "src\Contrib\SearchEngine\AutoComplete\src\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj", "{8E8F56D5-E686-4F4A-A9AD-B81D9243B446}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tsc", "Tsc", "{4FB42611-1B54-4ABF-988A-714EE9E8C492}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests", "src\Contrib\SearchEngine\AutoComplete\test\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj", "{0D4A2924-A7B1-4141-9871-FF1E8B46A752}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{D2ED2CE3-2273-4FA0-86A8-BB8DC3522823}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs", "src\Contrib\Service\MinimalAPIs\src\Masa.Contrib.Service.MinimalAPIs\Masa.Contrib.Service.MinimalAPIs.csproj", "{0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MultiEnvironment", "MultiEnvironment", "{353C56BA-CD53-46F2-9D2F-8FAD89CD20A6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs.Tests", "src\Contrib\Service\MinimalAPIs\test\Masa.Contrib.Service.MinimalAPIs.Tests\Masa.Contrib.Service.MinimalAPIs.Tests.csproj", "{F49D6ED6-9FD3-4C19-A30B-2C4198437D59}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MultiTenant", "MultiTenant", "{74739F71-A6F5-4BDF-B398-46A84715FA9E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller", "src\Contrib\Service\Caller\src\Masa.Contrib.Service.Caller\Masa.Contrib.Service.Caller.csproj", "{63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataAnnotations", "DataAnnotations", "{F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.DaprClient", "src\Contrib\Service\Caller\src\Masa.Contrib.Service.Caller.DaprClient\Masa.Contrib.Service.Caller.DaprClient.csproj", "{43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elasticsearch", "Elasticsearch", "{08FED323-7D60-4B8B-AD36-C55B40C96D1C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.HttpClient", "src\Contrib\Service\Caller\src\Masa.Contrib.Service.Caller.HttpClient\Masa.Contrib.Service.Caller.HttpClient.csproj", "{7BD12A3E-CB73-4B28-9509-26BEB096ABEB}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Prometheus", "Prometheus", "{2879EB9A-D18B-4C57-B041-365F7DAEEBC4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.AutomaticCaller.Tests", "src\Contrib\Service\Caller\test\Masa.Contrib.Service.Caller.AutomaticCaller.Tests\Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj", "{BB05402F-7BE8-4965-9518-BE869ACE5EFC}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cryptography", "Cryptography", "{2A8759AF-76F5-4F6A-8420-D2890B612AB2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.Tests", "src\Contrib\Service\Caller\test\Masa.Contrib.Service.Caller.Tests\Masa.Contrib.Service.Caller.Tests.csproj", "{E85AB70D-DF15-4A99-AFDA-530A5A9363FD}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependencyInjection", "DependencyInjection", "{33D4C640-954B-4468-95A4-2322DAB0B184}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth", "src\Contrib\StackSdks\Auth\src\Masa.Contrib.StackSdks.Auth\Masa.Contrib.StackSdks.Auth.csproj", "{5E77B9D1-80A7-4761-9431-3D9C7E25324B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConfigurationApi", "ConfigurationApi", "{CD7414D5-4DE9-4339-B833-29EF41B3AC76}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth.Tests", "src\Contrib\StackSdks\Auth\test\Masa.Contrib.StackSdks.Auth.Tests\Masa.Contrib.StackSdks.Auth.Tests.csproj", "{B69BDE42-349F-4E9C-B2ED-280B907BE1AE}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IntegrationEvents", "IntegrationEvents", "{EAF8FB96-6D0E-4FCD-B991-C845903ECA8B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc", "src\Contrib\StackSdks\Dcc\src\Masa.Contrib.StackSdks.Dcc\Masa.Contrib.StackSdks.Dcc.csproj", "{DC60715E-80FD-4911-8A65-DC14A7A66FA9}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dapr", "Dapr", "{FF832650-37C7-48FF-B078-77CACF37966E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc.Tests", "src\Contrib\StackSdks\Dcc\test\Masa.Contrib.StackSdks.Dcc.Tests\Masa.Contrib.StackSdks.Dcc.Tests.csproj", "{4BEEE39F-0760-434F-9389-6194037781DE}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EventLogs", "EventLogs", "{46DE49C1-D700-4C46-849A-7F485D87A518}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc", "src\Contrib\StackSdks\Mc\src\Masa.Contrib.StackSdks.Mc\Masa.Contrib.StackSdks.Mc.csproj", "{F201EB09-2EE2-4203-A829-044C7EC2D112}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Events", "Events", "{6B1042A4-A6D5-4307-B163-803164E4A742}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc.Tests", "src\Contrib\StackSdks\Mc\test\Masa.Contrib.StackSdks.Mc.Tests\Masa.Contrib.StackSdks.Mc.Tests.csproj", "{77466E5C-4DF7-4C7C-B251-689052D51B38}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.EventBus.IntegrationTests", "test\Masa.EventBus.IntegrationTests\Masa.EventBus.IntegrationTests.csproj", "{BDA1DB4F-C408-445D-9391-EC9765CF7349}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm", "src\Contrib\StackSdks\Pm\src\Masa.Contrib.StackSdks.Pm\Masa.Contrib.StackSdks.Pm.csproj", "{C650E615-4FAD-4CA9-B81C-3CF461805005}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\test\Ddd\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{215F07C3-74EE-4FAA-A821-09CF70B8C950}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm.Tests", "src\Contrib\StackSdks\Pm\test\Masa.Contrib.StackSdks.Pm.Tests\Masa.Contrib.StackSdks.Pm.Tests.csproj", "{0420C60C-6075-4BED-A0F0-9540A0D2CD8F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler", "src\Contrib\StackSdks\Scheduler\src\Masa.Contrib.StackSdks.Scheduler\Masa.Contrib.StackSdks.Scheduler.csproj", "{8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{70449866-CC6B-438B-B8DC-CBAB436EFD00}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler.Tests", "src\Contrib\StackSdks\Scheduler\test\Masa.Contrib.StackSdks.Scheduler.Tests\Masa.Contrib.StackSdks.Scheduler.Tests.csproj", "{254521CF-58A2-4FFB-BCA3-78B187E985DB}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{EE77C779-1031-4494-9850-3F2D85D8FA10}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc", "src\Contrib\StackSdks\Tsc\src\Masa.Contrib.StackSdks.Tsc\Masa.Contrib.StackSdks.Tsc.csproj", "{3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc.Tests", "src\Contrib\StackSdks\Tsc\test\Masa.Contrib.StackSdks.Tsc.Test\Masa.Contrib.StackSdks.Tsc.Tests.csproj", "{76251F5E-89BD-4E56-81CA-AD111361CAD4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun", "src\Contrib\Storage\ObjectStorage\src\Masa.Contrib.Storage.ObjectStorage.Aliyun\Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj", "{F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests", "src\Contrib\Storage\ObjectStorage\test\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj", "{3211BD54-4209-428E-9F11-D2F8181A890D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster", "src\Contrib\Data\Mapping\Mapster\src\Masa.Contrib.Data.Mapping.Mapster\Masa.Contrib.Data.Mapping.Mapster.csproj", "{9815A23B-6101-4C13-89CA-A07B85623E0E}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster.Tests", "src\Contrib\Data\Mapping\Mapster\test\Masa.Contrib.Data.Mapping.Mapster.Tests\Masa.Contrib.Data.Mapping.Mapster.Tests.csproj", "{88C1C77A-0F9F-436B-98FB-E696F35EB62E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oidc", "Oidc", "{A88DBDC2-DB29-4F80-82BB-B8D511E4A495}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{77EE6274-B332-4DA0-8AF1-73EE3561AA47}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication", "src\Utils\Security\Authentication\Authentication\src\Masa.Utils.Security.Authentication\Masa.Utils.Security.Authentication.csproj", "{B111B6B8-DC60-4D9D-896C-EE52B834A3DB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication.OpenIdConnect", "src\Utils\Security\Authentication\OpenIdConnect\src\Masa.Utils.Security.Authentication.OpenIdConnect\Masa.Utils.Security.Authentication.OpenIdConnect.csproj", "{7836A5A0-798F-4167-818C-EA770135D1B0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenIdConnect", "OpenIdConnect", "{2449469D-7B4C-4A4E-936B-E6653E08EDC6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cryptography", "Cryptography", "{64F32D02-05E0-43D3-BCD5-578D4D5620DD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Token", "Token", "{DE8CDE2C-F7D3-4515-9231-28FD787118DD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography", "src\Utils\Security\Cryptography\src\Masa.Utils.Security.Cryptography\Masa.Utils.Security.Cryptography.csproj", "{358C26DC-44F6-4177-9035-9574A87DD422}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography.Tests", "src\Utils\Security\Cryptography\test\Masa.Utils.Security.Cryptography.Tests\Masa.Utils.Security.Cryptography.Tests.csproj", "{A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Token", "src\Utils\Security\Token\src\Masa.Utils.Security.Token\Masa.Utils.Security.Token.csproj", "{94667017-2F5A-49DF-850B-238EB0C7E17D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cache", "Cache", "{2E7704B8-3E6A-4F0B-ABA8-D28732C9A88A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{21E669BD-CF41-41F0-BACF-E03629F1C0AA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{503812F4-2C93-4C8C-85C0-6CDF8FADE897}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{3801D850-9F29-451E-84FD-A85192195CD7}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Cache", "src\BuildingBlocks\Authentication\Oidc\Cache\src\Masa.BuildingBlocks.Authentication.Oidc.Cache\Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj", "{B795CBE6-3AAA-481E-85F6-C406C15AA586}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\BuildingBlocks\Authentication\Oidc\Domain\src\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{6C7C865D-F813-4CCB-9256-81F8FB511888}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\BuildingBlocks\Authentication\Oidc\Models\src\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{53574F47-0E4E-4317-8E14-D8BCD2EDFD57}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\BuildingBlocks\Authentication\Oidc\Storage\src\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{46AB3663-0FE2-4E44-A9FD-67AFA69611C6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{85316CEE-D995-44FF-A10D-4B23E983910C}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cache", "Cache", "{2B38DDA0-4007-4BA3-93B4-017071E68E19}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{2E319AE8-ACC3-49AD-A9F4-E0FAFBECAFF4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache", "src\Contrib\Authentication\Oidc\Cache\src\Masa.Contrib.Authentication.Oidc.Cache\Masa.Contrib.Authentication.Oidc.Cache.csproj", "{6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.EntityFrameworkCore", "src\Contrib\Authentication\Oidc\EntityFrameworkCore\src\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj", "{15698F80-DFB5-485A-9B76-074ACA1A7D8D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache.Storage", "src\Contrib\Authentication\Oidc\Storage\src\Masa.Contrib.Authentication.Oidc.Cache.Storage\Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj", "{12D7F445-1A22-4695-B174-6FC44C806377}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -501,1334 +559,6 @@ Global Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|x64.ActiveCfg = Debug|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Debug|x64.Build.0 = Debug|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|Any CPU.Build.0 = Release|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|x64.ActiveCfg = Release|Any CPU - {374B7E56-A815-4F56-A4C2-6094B5A97EE7}.Release|x64.Build.0 = Release|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|x64.ActiveCfg = Debug|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Debug|x64.Build.0 = Debug|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|Any CPU.Build.0 = Release|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|x64.ActiveCfg = Release|Any CPU - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B}.Release|x64.Build.0 = Release|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|x64.ActiveCfg = Debug|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Debug|x64.Build.0 = Debug|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|Any CPU.Build.0 = Release|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|x64.ActiveCfg = Release|Any CPU - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A}.Release|x64.Build.0 = Release|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|x64.ActiveCfg = Debug|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Debug|x64.Build.0 = Debug|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|Any CPU.Build.0 = Release|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|x64.ActiveCfg = Release|Any CPU - {2971858E-2CCA-4688-B8CA-84F130AD5AA9}.Release|x64.Build.0 = Release|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|x64.ActiveCfg = Debug|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Debug|x64.Build.0 = Debug|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|Any CPU.Build.0 = Release|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|x64.ActiveCfg = Release|Any CPU - {2503F67B-63BB-4364-8B31-1DD3049C92B7}.Release|x64.Build.0 = Release|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|x64.ActiveCfg = Debug|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Debug|x64.Build.0 = Debug|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Release|Any CPU.Build.0 = Release|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Release|x64.ActiveCfg = Release|Any CPU - {88BC8170-9123-48C0-A914-11D3CE805196}.Release|x64.Build.0 = Release|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|Any CPU.Build.0 = Debug|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|x64.ActiveCfg = Debug|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Debug|x64.Build.0 = Debug|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|Any CPU.ActiveCfg = Release|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|Any CPU.Build.0 = Release|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|x64.ActiveCfg = Release|Any CPU - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19}.Release|x64.Build.0 = Release|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|x64.ActiveCfg = Debug|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Debug|x64.Build.0 = Debug|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|Any CPU.Build.0 = Release|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|x64.ActiveCfg = Release|Any CPU - {2F4986D6-3F56-4C05-8A1D-399594F96093}.Release|x64.Build.0 = Release|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|x64.ActiveCfg = Debug|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Debug|x64.Build.0 = Debug|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|Any CPU.Build.0 = Release|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|x64.ActiveCfg = Release|Any CPU - {E72E105D-B15F-4D69-9A13-CAA49D4889D6}.Release|x64.Build.0 = Release|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|x64.ActiveCfg = Debug|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Debug|x64.Build.0 = Debug|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|Any CPU.Build.0 = Release|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|x64.ActiveCfg = Release|Any CPU - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6}.Release|x64.Build.0 = Release|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|x64.ActiveCfg = Debug|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Debug|x64.Build.0 = Debug|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|Any CPU.Build.0 = Release|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|x64.ActiveCfg = Release|Any CPU - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8}.Release|x64.Build.0 = Release|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|x64.ActiveCfg = Debug|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Debug|x64.Build.0 = Debug|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|Any CPU.Build.0 = Release|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|x64.ActiveCfg = Release|Any CPU - {AB6FAB84-5218-48A8-8F94-03B02ECD098F}.Release|x64.Build.0 = Release|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|x64.ActiveCfg = Debug|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Debug|x64.Build.0 = Debug|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|Any CPU.Build.0 = Release|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|x64.ActiveCfg = Release|Any CPU - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0}.Release|x64.Build.0 = Release|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Debug|x64.ActiveCfg = Debug|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Debug|x64.Build.0 = Debug|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Release|Any CPU.Build.0 = Release|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Release|x64.ActiveCfg = Release|Any CPU - {C3451307-3743-4911-A401-7F28889703D3}.Release|x64.Build.0 = Release|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|x64.ActiveCfg = Debug|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Debug|x64.Build.0 = Debug|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|Any CPU.Build.0 = Release|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|x64.ActiveCfg = Release|Any CPU - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB}.Release|x64.Build.0 = Release|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|x64.ActiveCfg = Debug|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Debug|x64.Build.0 = Debug|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|Any CPU.Build.0 = Release|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|x64.ActiveCfg = Release|Any CPU - {4B818EE6-8E13-40DA-B99A-218BB228EE91}.Release|x64.Build.0 = Release|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|Any CPU.Build.0 = Debug|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|x64.ActiveCfg = Debug|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Debug|x64.Build.0 = Debug|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|Any CPU.ActiveCfg = Release|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|Any CPU.Build.0 = Release|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|x64.ActiveCfg = Release|Any CPU - {30DC35DF-9D86-443C-B26C-9053E6FCA434}.Release|x64.Build.0 = Release|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|x64.ActiveCfg = Debug|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Debug|x64.Build.0 = Debug|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|Any CPU.Build.0 = Release|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|x64.ActiveCfg = Release|Any CPU - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59}.Release|x64.Build.0 = Release|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|x64.ActiveCfg = Debug|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Debug|x64.Build.0 = Debug|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|Any CPU.Build.0 = Release|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|x64.ActiveCfg = Release|Any CPU - {54936F20-EEFC-405B-8646-76F200A5C8F7}.Release|x64.Build.0 = Release|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|Any CPU.Build.0 = Debug|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|x64.ActiveCfg = Debug|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Debug|x64.Build.0 = Debug|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|Any CPU.ActiveCfg = Release|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|Any CPU.Build.0 = Release|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|x64.ActiveCfg = Release|Any CPU - {546EE1A2-DB6B-49D3-8919-33624FEF2498}.Release|x64.Build.0 = Release|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|x64.ActiveCfg = Debug|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Debug|x64.Build.0 = Debug|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|Any CPU.Build.0 = Release|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|x64.ActiveCfg = Release|Any CPU - {B603B92A-1203-4E28-9D15-2AF1CE4E9510}.Release|x64.Build.0 = Release|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|x64.ActiveCfg = Debug|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Debug|x64.Build.0 = Debug|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|Any CPU.Build.0 = Release|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|x64.ActiveCfg = Release|Any CPU - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B}.Release|x64.Build.0 = Release|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|x64.ActiveCfg = Debug|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Debug|x64.Build.0 = Debug|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|Any CPU.Build.0 = Release|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|x64.ActiveCfg = Release|Any CPU - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF}.Release|x64.Build.0 = Release|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|x64.ActiveCfg = Debug|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Debug|x64.Build.0 = Debug|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|Any CPU.Build.0 = Release|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|x64.ActiveCfg = Release|Any CPU - {981E883E-CCDC-400B-8FB1-76E1E65C32AF}.Release|x64.Build.0 = Release|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|x64.ActiveCfg = Debug|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Debug|x64.Build.0 = Debug|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|Any CPU.Build.0 = Release|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|x64.ActiveCfg = Release|Any CPU - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE}.Release|x64.Build.0 = Release|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|x64.ActiveCfg = Debug|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Debug|x64.Build.0 = Debug|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|Any CPU.Build.0 = Release|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|x64.ActiveCfg = Release|Any CPU - {DA816A33-F164-4456-92DD-A672BAD1A6B1}.Release|x64.Build.0 = Release|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|x64.ActiveCfg = Debug|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Debug|x64.Build.0 = Debug|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|Any CPU.Build.0 = Release|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|x64.ActiveCfg = Release|Any CPU - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104}.Release|x64.Build.0 = Release|Any CPU - {B228589B-4106-4CF8-B165-26636B94BE2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B228589B-4106-4CF8-B165-26636B94BE2C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B228589B-4106-4CF8-B165-26636B94BE2C}.Debug|x64.ActiveCfg = Debug|Any CPU - {B228589B-4106-4CF8-B165-26636B94BE2C}.Debug|x64.Build.0 = Debug|Any CPU - {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|Any CPU.Build.0 = Release|Any CPU - {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|x64.ActiveCfg = Release|Any CPU - {B228589B-4106-4CF8-B165-26636B94BE2C}.Release|x64.Build.0 = Release|Any CPU - {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|x64.ActiveCfg = Debug|Any CPU - {322F0F91-E181-4139-87DE-974CCF2339BA}.Debug|x64.Build.0 = Debug|Any CPU - {322F0F91-E181-4139-87DE-974CCF2339BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {322F0F91-E181-4139-87DE-974CCF2339BA}.Release|Any CPU.Build.0 = Release|Any CPU - {322F0F91-E181-4139-87DE-974CCF2339BA}.Release|x64.ActiveCfg = Release|Any CPU - {322F0F91-E181-4139-87DE-974CCF2339BA}.Release|x64.Build.0 = Release|Any CPU - {46C86695-A597-47F3-944E-03C63CA678F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46C86695-A597-47F3-944E-03C63CA678F4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46C86695-A597-47F3-944E-03C63CA678F4}.Debug|x64.ActiveCfg = Debug|Any CPU - {46C86695-A597-47F3-944E-03C63CA678F4}.Debug|x64.Build.0 = Debug|Any CPU - {46C86695-A597-47F3-944E-03C63CA678F4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46C86695-A597-47F3-944E-03C63CA678F4}.Release|Any CPU.Build.0 = Release|Any CPU - {46C86695-A597-47F3-944E-03C63CA678F4}.Release|x64.ActiveCfg = Release|Any CPU - {46C86695-A597-47F3-944E-03C63CA678F4}.Release|x64.Build.0 = Release|Any CPU - {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Debug|x64.ActiveCfg = Debug|Any CPU - {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Debug|x64.Build.0 = Debug|Any CPU - {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Release|Any CPU.Build.0 = Release|Any CPU - {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Release|x64.ActiveCfg = Release|Any CPU - {DBD1137D-0208-4CF4-BB45-36FE023B4FED}.Release|x64.Build.0 = Release|Any CPU - {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Debug|x64.ActiveCfg = Debug|Any CPU - {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Debug|x64.Build.0 = Debug|Any CPU - {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Release|Any CPU.Build.0 = Release|Any CPU - {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Release|x64.ActiveCfg = Release|Any CPU - {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B}.Release|x64.Build.0 = Release|Any CPU - {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Debug|x64.ActiveCfg = Debug|Any CPU - {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Debug|x64.Build.0 = Debug|Any CPU - {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Release|Any CPU.Build.0 = Release|Any CPU - {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Release|x64.ActiveCfg = Release|Any CPU - {A93D1699-A8B1-432E-8929-5800F4FE5AA7}.Release|x64.Build.0 = Release|Any CPU - {049430DA-664C-4C77-A679-0CF12217ABB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {049430DA-664C-4C77-A679-0CF12217ABB2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {049430DA-664C-4C77-A679-0CF12217ABB2}.Debug|x64.ActiveCfg = Debug|Any CPU - {049430DA-664C-4C77-A679-0CF12217ABB2}.Debug|x64.Build.0 = Debug|Any CPU - {049430DA-664C-4C77-A679-0CF12217ABB2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {049430DA-664C-4C77-A679-0CF12217ABB2}.Release|Any CPU.Build.0 = Release|Any CPU - {049430DA-664C-4C77-A679-0CF12217ABB2}.Release|x64.ActiveCfg = Release|Any CPU - {049430DA-664C-4C77-A679-0CF12217ABB2}.Release|x64.Build.0 = Release|Any CPU - {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Debug|x64.ActiveCfg = Debug|Any CPU - {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Debug|x64.Build.0 = Debug|Any CPU - {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Release|Any CPU.Build.0 = Release|Any CPU - {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Release|x64.ActiveCfg = Release|Any CPU - {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD}.Release|x64.Build.0 = Release|Any CPU - {64B72C9E-85BD-4C41-B67D-892157600F5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {64B72C9E-85BD-4C41-B67D-892157600F5B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {64B72C9E-85BD-4C41-B67D-892157600F5B}.Debug|x64.ActiveCfg = Debug|Any CPU - {64B72C9E-85BD-4C41-B67D-892157600F5B}.Debug|x64.Build.0 = Debug|Any CPU - {64B72C9E-85BD-4C41-B67D-892157600F5B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {64B72C9E-85BD-4C41-B67D-892157600F5B}.Release|Any CPU.Build.0 = Release|Any CPU - {64B72C9E-85BD-4C41-B67D-892157600F5B}.Release|x64.ActiveCfg = Release|Any CPU - {64B72C9E-85BD-4C41-B67D-892157600F5B}.Release|x64.Build.0 = Release|Any CPU - {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Debug|x64.ActiveCfg = Debug|Any CPU - {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Debug|x64.Build.0 = Debug|Any CPU - {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Release|Any CPU.Build.0 = Release|Any CPU - {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Release|x64.ActiveCfg = Release|Any CPU - {354D1855-EE83-41EF-BFFC-1348F77A66DB}.Release|x64.Build.0 = Release|Any CPU - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Debug|x64.ActiveCfg = Debug|Any CPU - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Debug|x64.Build.0 = Debug|Any CPU - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Release|Any CPU.Build.0 = Release|Any CPU - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Release|x64.ActiveCfg = Release|Any CPU - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C}.Release|x64.Build.0 = Release|Any CPU - {A88B4DB8-2441-488D-B097-68F02F18DECC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A88B4DB8-2441-488D-B097-68F02F18DECC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A88B4DB8-2441-488D-B097-68F02F18DECC}.Debug|x64.ActiveCfg = Debug|Any CPU - {A88B4DB8-2441-488D-B097-68F02F18DECC}.Debug|x64.Build.0 = Debug|Any CPU - {A88B4DB8-2441-488D-B097-68F02F18DECC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A88B4DB8-2441-488D-B097-68F02F18DECC}.Release|Any CPU.Build.0 = Release|Any CPU - {A88B4DB8-2441-488D-B097-68F02F18DECC}.Release|x64.ActiveCfg = Release|Any CPU - {A88B4DB8-2441-488D-B097-68F02F18DECC}.Release|x64.Build.0 = Release|Any CPU - {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Debug|x64.ActiveCfg = Debug|Any CPU - {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Debug|x64.Build.0 = Debug|Any CPU - {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Release|Any CPU.Build.0 = Release|Any CPU - {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Release|x64.ActiveCfg = Release|Any CPU - {3B5C4669-07C6-49F0-BC69-70A8980FC605}.Release|x64.Build.0 = Release|Any CPU - {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Debug|Any CPU.Build.0 = Debug|Any CPU - {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Debug|x64.ActiveCfg = Debug|Any CPU - {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Debug|x64.Build.0 = Debug|Any CPU - {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Release|Any CPU.ActiveCfg = Release|Any CPU - {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Release|Any CPU.Build.0 = Release|Any CPU - {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Release|x64.ActiveCfg = Release|Any CPU - {81618F3D-ED3C-44C5-9BAD-8F04CF601D42}.Release|x64.Build.0 = Release|Any CPU - {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Debug|x64.ActiveCfg = Debug|Any CPU - {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Debug|x64.Build.0 = Debug|Any CPU - {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Release|Any CPU.Build.0 = Release|Any CPU - {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Release|x64.ActiveCfg = Release|Any CPU - {F6E5B615-A85D-4FB4-97D0-698098D7616F}.Release|x64.Build.0 = Release|Any CPU - {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Debug|x64.ActiveCfg = Debug|Any CPU - {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Debug|x64.Build.0 = Debug|Any CPU - {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Release|Any CPU.Build.0 = Release|Any CPU - {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Release|x64.ActiveCfg = Release|Any CPU - {7A628B6A-AFE4-4235-95AA-9A711268B9B1}.Release|x64.Build.0 = Release|Any CPU - {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Debug|x64.ActiveCfg = Debug|Any CPU - {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Debug|x64.Build.0 = Debug|Any CPU - {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Release|Any CPU.Build.0 = Release|Any CPU - {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Release|x64.ActiveCfg = Release|Any CPU - {E417DAE3-A1D2-430D-A6C7-C8BDE083D851}.Release|x64.Build.0 = Release|Any CPU - {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Debug|x64.ActiveCfg = Debug|Any CPU - {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Debug|x64.Build.0 = Debug|Any CPU - {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Release|Any CPU.Build.0 = Release|Any CPU - {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Release|x64.ActiveCfg = Release|Any CPU - {9A6A3012-6A11-415B-BC58-E2268BE7022E}.Release|x64.Build.0 = Release|Any CPU - {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Debug|x64.ActiveCfg = Debug|Any CPU - {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Debug|x64.Build.0 = Debug|Any CPU - {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Release|Any CPU.Build.0 = Release|Any CPU - {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Release|x64.ActiveCfg = Release|Any CPU - {0F43C687-59EF-4164-B3A5-E53C3BF86892}.Release|x64.Build.0 = Release|Any CPU - {BE11C98A-5680-491E-86E9-93B0A83909EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BE11C98A-5680-491E-86E9-93B0A83909EA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BE11C98A-5680-491E-86E9-93B0A83909EA}.Debug|x64.ActiveCfg = Debug|Any CPU - {BE11C98A-5680-491E-86E9-93B0A83909EA}.Debug|x64.Build.0 = Debug|Any CPU - {BE11C98A-5680-491E-86E9-93B0A83909EA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BE11C98A-5680-491E-86E9-93B0A83909EA}.Release|Any CPU.Build.0 = Release|Any CPU - {BE11C98A-5680-491E-86E9-93B0A83909EA}.Release|x64.ActiveCfg = Release|Any CPU - {BE11C98A-5680-491E-86E9-93B0A83909EA}.Release|x64.Build.0 = Release|Any CPU - {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Debug|x64.ActiveCfg = Debug|Any CPU - {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Debug|x64.Build.0 = Debug|Any CPU - {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Release|Any CPU.Build.0 = Release|Any CPU - {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Release|x64.ActiveCfg = Release|Any CPU - {E2B9737D-9630-4705-B2DF-21C2EB607F65}.Release|x64.Build.0 = Release|Any CPU - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Debug|x64.ActiveCfg = Debug|Any CPU - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Debug|x64.Build.0 = Debug|Any CPU - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Release|Any CPU.Build.0 = Release|Any CPU - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Release|x64.ActiveCfg = Release|Any CPU - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558}.Release|x64.Build.0 = Release|Any CPU - {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Debug|x64.ActiveCfg = Debug|Any CPU - {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Debug|x64.Build.0 = Debug|Any CPU - {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Release|Any CPU.Build.0 = Release|Any CPU - {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Release|x64.ActiveCfg = Release|Any CPU - {8C154ACF-ED6E-43C4-906E-2D36CBC8D112}.Release|x64.Build.0 = Release|Any CPU - {CC117C03-267A-4145-B258-922C35484883}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC117C03-267A-4145-B258-922C35484883}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC117C03-267A-4145-B258-922C35484883}.Debug|x64.ActiveCfg = Debug|Any CPU - {CC117C03-267A-4145-B258-922C35484883}.Debug|x64.Build.0 = Debug|Any CPU - {CC117C03-267A-4145-B258-922C35484883}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC117C03-267A-4145-B258-922C35484883}.Release|Any CPU.Build.0 = Release|Any CPU - {CC117C03-267A-4145-B258-922C35484883}.Release|x64.ActiveCfg = Release|Any CPU - {CC117C03-267A-4145-B258-922C35484883}.Release|x64.Build.0 = Release|Any CPU - {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Debug|x64.ActiveCfg = Debug|Any CPU - {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Debug|x64.Build.0 = Debug|Any CPU - {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Release|Any CPU.Build.0 = Release|Any CPU - {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Release|x64.ActiveCfg = Release|Any CPU - {1AD1F4E7-84DA-4CE8-BC69-7D713413560D}.Release|x64.Build.0 = Release|Any CPU - {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Debug|x64.ActiveCfg = Debug|Any CPU - {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Debug|x64.Build.0 = Debug|Any CPU - {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Release|Any CPU.Build.0 = Release|Any CPU - {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Release|x64.ActiveCfg = Release|Any CPU - {9DEA348B-8915-4BAA-AE04-99BF5FC6131B}.Release|x64.Build.0 = Release|Any CPU - {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Debug|x64.ActiveCfg = Debug|Any CPU - {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Debug|x64.Build.0 = Debug|Any CPU - {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Release|Any CPU.Build.0 = Release|Any CPU - {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Release|x64.ActiveCfg = Release|Any CPU - {E85FA5C9-C7D9-4461-99DE-11675749E38E}.Release|x64.Build.0 = Release|Any CPU - {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Debug|x64.ActiveCfg = Debug|Any CPU - {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Debug|x64.Build.0 = Debug|Any CPU - {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Release|Any CPU.Build.0 = Release|Any CPU - {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Release|x64.ActiveCfg = Release|Any CPU - {FB66887D-E08C-4551-B838-EAF49C1D1EE7}.Release|x64.Build.0 = Release|Any CPU - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Debug|x64.ActiveCfg = Debug|Any CPU - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Debug|x64.Build.0 = Debug|Any CPU - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|Any CPU.Build.0 = Release|Any CPU - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|x64.ActiveCfg = Release|Any CPU - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9}.Release|x64.Build.0 = Release|Any CPU - {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|x64.ActiveCfg = Debug|Any CPU - {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Debug|x64.Build.0 = Debug|Any CPU - {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Release|Any CPU.Build.0 = Release|Any CPU - {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Release|x64.ActiveCfg = Release|Any CPU - {675D2886-B4E9-4B14-A02D-44B5204EE2E0}.Release|x64.Build.0 = Release|Any CPU - {2A57A40F-92F5-4ACE-95AA-763915578282}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2A57A40F-92F5-4ACE-95AA-763915578282}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2A57A40F-92F5-4ACE-95AA-763915578282}.Debug|x64.ActiveCfg = Debug|Any CPU - {2A57A40F-92F5-4ACE-95AA-763915578282}.Debug|x64.Build.0 = Debug|Any CPU - {2A57A40F-92F5-4ACE-95AA-763915578282}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2A57A40F-92F5-4ACE-95AA-763915578282}.Release|Any CPU.Build.0 = Release|Any CPU - {2A57A40F-92F5-4ACE-95AA-763915578282}.Release|x64.ActiveCfg = Release|Any CPU - {2A57A40F-92F5-4ACE-95AA-763915578282}.Release|x64.Build.0 = Release|Any CPU - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Debug|x64.ActiveCfg = Debug|Any CPU - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Debug|x64.Build.0 = Debug|Any CPU - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Release|Any CPU.Build.0 = Release|Any CPU - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Release|x64.ActiveCfg = Release|Any CPU - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C}.Release|x64.Build.0 = Release|Any CPU - {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Debug|x64.ActiveCfg = Debug|Any CPU - {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Debug|x64.Build.0 = Debug|Any CPU - {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|Any CPU.Build.0 = Release|Any CPU - {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|x64.ActiveCfg = Release|Any CPU - {B44F4054-5B66-4937-A99D-216DEFBAD0EF}.Release|x64.Build.0 = Release|Any CPU - {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|x64.ActiveCfg = Debug|Any CPU - {A4F3852E-DC6B-43A8-A40A-899089546444}.Debug|x64.Build.0 = Debug|Any CPU - {A4F3852E-DC6B-43A8-A40A-899089546444}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4F3852E-DC6B-43A8-A40A-899089546444}.Release|Any CPU.Build.0 = Release|Any CPU - {A4F3852E-DC6B-43A8-A40A-899089546444}.Release|x64.ActiveCfg = Release|Any CPU - {A4F3852E-DC6B-43A8-A40A-899089546444}.Release|x64.Build.0 = Release|Any CPU - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Debug|x64.ActiveCfg = Debug|Any CPU - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Debug|x64.Build.0 = Debug|Any CPU - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Release|Any CPU.Build.0 = Release|Any CPU - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Release|x64.ActiveCfg = Release|Any CPU - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09}.Release|x64.Build.0 = Release|Any CPU - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Debug|x64.Build.0 = Debug|Any CPU - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Release|Any CPU.Build.0 = Release|Any CPU - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Release|x64.ActiveCfg = Release|Any CPU - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B}.Release|x64.Build.0 = Release|Any CPU - {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Debug|x64.ActiveCfg = Debug|Any CPU - {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Debug|x64.Build.0 = Debug|Any CPU - {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Release|Any CPU.Build.0 = Release|Any CPU - {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Release|x64.ActiveCfg = Release|Any CPU - {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D}.Release|x64.Build.0 = Release|Any CPU - {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Debug|x64.ActiveCfg = Debug|Any CPU - {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Debug|x64.Build.0 = Debug|Any CPU - {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Release|Any CPU.Build.0 = Release|Any CPU - {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Release|x64.ActiveCfg = Release|Any CPU - {89B2A360-4806-41B2-9CE1-F2E556BB222D}.Release|x64.Build.0 = Release|Any CPU - {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Debug|x64.ActiveCfg = Debug|Any CPU - {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Debug|x64.Build.0 = Debug|Any CPU - {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Release|Any CPU.Build.0 = Release|Any CPU - {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Release|x64.ActiveCfg = Release|Any CPU - {C72508E7-CEF3-4E36-BF39-F3908EE338B7}.Release|x64.Build.0 = Release|Any CPU - {65605EB9-FA98-42CE-8F40-117D89D59786}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65605EB9-FA98-42CE-8F40-117D89D59786}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65605EB9-FA98-42CE-8F40-117D89D59786}.Debug|x64.ActiveCfg = Debug|Any CPU - {65605EB9-FA98-42CE-8F40-117D89D59786}.Debug|x64.Build.0 = Debug|Any CPU - {65605EB9-FA98-42CE-8F40-117D89D59786}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65605EB9-FA98-42CE-8F40-117D89D59786}.Release|Any CPU.Build.0 = Release|Any CPU - {65605EB9-FA98-42CE-8F40-117D89D59786}.Release|x64.ActiveCfg = Release|Any CPU - {65605EB9-FA98-42CE-8F40-117D89D59786}.Release|x64.Build.0 = Release|Any CPU - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Debug|x64.ActiveCfg = Debug|Any CPU - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Debug|x64.Build.0 = Debug|Any CPU - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Release|Any CPU.Build.0 = Release|Any CPU - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Release|x64.ActiveCfg = Release|Any CPU - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382}.Release|x64.Build.0 = Release|Any CPU - {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Debug|x64.ActiveCfg = Debug|Any CPU - {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Debug|x64.Build.0 = Debug|Any CPU - {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Release|Any CPU.Build.0 = Release|Any CPU - {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Release|x64.ActiveCfg = Release|Any CPU - {4F26D6F5-32FA-4EE6-8588-A325734E4386}.Release|x64.Build.0 = Release|Any CPU - {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Debug|x64.ActiveCfg = Debug|Any CPU - {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Debug|x64.Build.0 = Debug|Any CPU - {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Release|Any CPU.Build.0 = Release|Any CPU - {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Release|x64.ActiveCfg = Release|Any CPU - {6FF949B6-F1C6-4056-B9DA-CC6120D427FC}.Release|x64.Build.0 = Release|Any CPU - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Debug|x64.ActiveCfg = Debug|Any CPU - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Debug|x64.Build.0 = Debug|Any CPU - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Release|Any CPU.Build.0 = Release|Any CPU - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Release|x64.ActiveCfg = Release|Any CPU - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF}.Release|x64.Build.0 = Release|Any CPU - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Debug|x64.ActiveCfg = Debug|Any CPU - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Debug|x64.Build.0 = Debug|Any CPU - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Release|Any CPU.Build.0 = Release|Any CPU - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Release|x64.ActiveCfg = Release|Any CPU - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8}.Release|x64.Build.0 = Release|Any CPU - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Debug|x64.ActiveCfg = Debug|Any CPU - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Debug|x64.Build.0 = Debug|Any CPU - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Release|Any CPU.Build.0 = Release|Any CPU - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Release|x64.ActiveCfg = Release|Any CPU - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9}.Release|x64.Build.0 = Release|Any CPU - {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Debug|x64.ActiveCfg = Debug|Any CPU - {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Debug|x64.Build.0 = Debug|Any CPU - {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Release|Any CPU.Build.0 = Release|Any CPU - {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Release|x64.ActiveCfg = Release|Any CPU - {672C436B-ECE4-4722-8B7D-4EF1E45194B0}.Release|x64.Build.0 = Release|Any CPU - {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Debug|x64.ActiveCfg = Debug|Any CPU - {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Debug|x64.Build.0 = Debug|Any CPU - {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Release|Any CPU.Build.0 = Release|Any CPU - {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Release|x64.ActiveCfg = Release|Any CPU - {5D9F3039-D6FE-4F2E-9752-486ADF970093}.Release|x64.Build.0 = Release|Any CPU - {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Debug|x64.ActiveCfg = Debug|Any CPU - {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Debug|x64.Build.0 = Debug|Any CPU - {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Release|Any CPU.Build.0 = Release|Any CPU - {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Release|x64.ActiveCfg = Release|Any CPU - {E99EB5EE-6C3A-4878-9407-BB4060F5E200}.Release|x64.Build.0 = Release|Any CPU - {7A4F49AC-A597-4D41-B380-675787D00CCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A4F49AC-A597-4D41-B380-675787D00CCD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A4F49AC-A597-4D41-B380-675787D00CCD}.Debug|x64.ActiveCfg = Debug|Any CPU - {7A4F49AC-A597-4D41-B380-675787D00CCD}.Debug|x64.Build.0 = Debug|Any CPU - {7A4F49AC-A597-4D41-B380-675787D00CCD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A4F49AC-A597-4D41-B380-675787D00CCD}.Release|Any CPU.Build.0 = Release|Any CPU - {7A4F49AC-A597-4D41-B380-675787D00CCD}.Release|x64.ActiveCfg = Release|Any CPU - {7A4F49AC-A597-4D41-B380-675787D00CCD}.Release|x64.Build.0 = Release|Any CPU - {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Debug|x64.ActiveCfg = Debug|Any CPU - {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Debug|x64.Build.0 = Debug|Any CPU - {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Release|Any CPU.Build.0 = Release|Any CPU - {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Release|x64.ActiveCfg = Release|Any CPU - {39F57444-3DB4-458D-9CEB-6484069BD7E0}.Release|x64.Build.0 = Release|Any CPU - {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Debug|x64.ActiveCfg = Debug|Any CPU - {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Debug|x64.Build.0 = Debug|Any CPU - {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Release|Any CPU.Build.0 = Release|Any CPU - {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Release|x64.ActiveCfg = Release|Any CPU - {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF}.Release|x64.Build.0 = Release|Any CPU - {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Debug|x64.ActiveCfg = Debug|Any CPU - {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Debug|x64.Build.0 = Debug|Any CPU - {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Release|Any CPU.Build.0 = Release|Any CPU - {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Release|x64.ActiveCfg = Release|Any CPU - {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6}.Release|x64.Build.0 = Release|Any CPU - {55887169-B044-47AA-8554-E5F51935FF38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {55887169-B044-47AA-8554-E5F51935FF38}.Debug|Any CPU.Build.0 = Debug|Any CPU - {55887169-B044-47AA-8554-E5F51935FF38}.Debug|x64.ActiveCfg = Debug|Any CPU - {55887169-B044-47AA-8554-E5F51935FF38}.Debug|x64.Build.0 = Debug|Any CPU - {55887169-B044-47AA-8554-E5F51935FF38}.Release|Any CPU.ActiveCfg = Release|Any CPU - {55887169-B044-47AA-8554-E5F51935FF38}.Release|Any CPU.Build.0 = Release|Any CPU - {55887169-B044-47AA-8554-E5F51935FF38}.Release|x64.ActiveCfg = Release|Any CPU - {55887169-B044-47AA-8554-E5F51935FF38}.Release|x64.Build.0 = Release|Any CPU - {90D60969-E01C-4993-9DC4-794180FF49E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {90D60969-E01C-4993-9DC4-794180FF49E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {90D60969-E01C-4993-9DC4-794180FF49E5}.Debug|x64.ActiveCfg = Debug|Any CPU - {90D60969-E01C-4993-9DC4-794180FF49E5}.Debug|x64.Build.0 = Debug|Any CPU - {90D60969-E01C-4993-9DC4-794180FF49E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {90D60969-E01C-4993-9DC4-794180FF49E5}.Release|Any CPU.Build.0 = Release|Any CPU - {90D60969-E01C-4993-9DC4-794180FF49E5}.Release|x64.ActiveCfg = Release|Any CPU - {90D60969-E01C-4993-9DC4-794180FF49E5}.Release|x64.Build.0 = Release|Any CPU - {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Debug|x64.ActiveCfg = Debug|Any CPU - {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Debug|x64.Build.0 = Debug|Any CPU - {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Release|Any CPU.Build.0 = Release|Any CPU - {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Release|x64.ActiveCfg = Release|Any CPU - {12E3C29F-AE3A-4BC9-A7CE-904269223C3B}.Release|x64.Build.0 = Release|Any CPU - {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Debug|x64.ActiveCfg = Debug|Any CPU - {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Debug|x64.Build.0 = Debug|Any CPU - {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Release|Any CPU.Build.0 = Release|Any CPU - {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Release|x64.ActiveCfg = Release|Any CPU - {430DC17D-B161-48D6-B4CE-17913C1AABBE}.Release|x64.Build.0 = Release|Any CPU - {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Debug|x64.ActiveCfg = Debug|Any CPU - {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Debug|x64.Build.0 = Debug|Any CPU - {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Release|Any CPU.Build.0 = Release|Any CPU - {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Release|x64.ActiveCfg = Release|Any CPU - {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E}.Release|x64.Build.0 = Release|Any CPU - {19C7B778-345C-407B-BE72-67BF04784F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {19C7B778-345C-407B-BE72-67BF04784F35}.Debug|Any CPU.Build.0 = Debug|Any CPU - {19C7B778-345C-407B-BE72-67BF04784F35}.Debug|x64.ActiveCfg = Debug|Any CPU - {19C7B778-345C-407B-BE72-67BF04784F35}.Debug|x64.Build.0 = Debug|Any CPU - {19C7B778-345C-407B-BE72-67BF04784F35}.Release|Any CPU.ActiveCfg = Release|Any CPU - {19C7B778-345C-407B-BE72-67BF04784F35}.Release|Any CPU.Build.0 = Release|Any CPU - {19C7B778-345C-407B-BE72-67BF04784F35}.Release|x64.ActiveCfg = Release|Any CPU - {19C7B778-345C-407B-BE72-67BF04784F35}.Release|x64.Build.0 = Release|Any CPU - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Debug|x64.ActiveCfg = Debug|Any CPU - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Debug|x64.Build.0 = Debug|Any CPU - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Release|Any CPU.Build.0 = Release|Any CPU - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Release|x64.ActiveCfg = Release|Any CPU - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700}.Release|x64.Build.0 = Release|Any CPU - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Debug|x64.ActiveCfg = Debug|Any CPU - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Debug|x64.Build.0 = Debug|Any CPU - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Release|Any CPU.Build.0 = Release|Any CPU - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Release|x64.ActiveCfg = Release|Any CPU - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479}.Release|x64.Build.0 = Release|Any CPU - {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Debug|x64.ActiveCfg = Debug|Any CPU - {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Debug|x64.Build.0 = Debug|Any CPU - {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Release|Any CPU.Build.0 = Release|Any CPU - {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Release|x64.ActiveCfg = Release|Any CPU - {7DC7F500-F004-4DAC-9F16-D6878B3808E1}.Release|x64.Build.0 = Release|Any CPU - {9B615187-D90E-4334-BBD8-5973A12442F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9B615187-D90E-4334-BBD8-5973A12442F9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9B615187-D90E-4334-BBD8-5973A12442F9}.Debug|x64.ActiveCfg = Debug|Any CPU - {9B615187-D90E-4334-BBD8-5973A12442F9}.Debug|x64.Build.0 = Debug|Any CPU - {9B615187-D90E-4334-BBD8-5973A12442F9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9B615187-D90E-4334-BBD8-5973A12442F9}.Release|Any CPU.Build.0 = Release|Any CPU - {9B615187-D90E-4334-BBD8-5973A12442F9}.Release|x64.ActiveCfg = Release|Any CPU - {9B615187-D90E-4334-BBD8-5973A12442F9}.Release|x64.Build.0 = Release|Any CPU - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Debug|x64.ActiveCfg = Debug|Any CPU - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Debug|x64.Build.0 = Debug|Any CPU - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Release|Any CPU.Build.0 = Release|Any CPU - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Release|x64.ActiveCfg = Release|Any CPU - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F}.Release|x64.Build.0 = Release|Any CPU - {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Debug|x64.ActiveCfg = Debug|Any CPU - {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Debug|x64.Build.0 = Debug|Any CPU - {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Release|Any CPU.Build.0 = Release|Any CPU - {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Release|x64.ActiveCfg = Release|Any CPU - {8E00F570-6926-4304-BAE0-C9E7FA9A4213}.Release|x64.Build.0 = Release|Any CPU - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Debug|x64.ActiveCfg = Debug|Any CPU - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Debug|x64.Build.0 = Debug|Any CPU - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Release|Any CPU.Build.0 = Release|Any CPU - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Release|x64.ActiveCfg = Release|Any CPU - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034}.Release|x64.Build.0 = Release|Any CPU - {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Debug|x64.ActiveCfg = Debug|Any CPU - {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Debug|x64.Build.0 = Debug|Any CPU - {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Release|Any CPU.Build.0 = Release|Any CPU - {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Release|x64.ActiveCfg = Release|Any CPU - {A69815D7-1C4F-4484-8E0B-7E6765203AC0}.Release|x64.Build.0 = Release|Any CPU - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Debug|x64.ActiveCfg = Debug|Any CPU - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Debug|x64.Build.0 = Debug|Any CPU - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Release|Any CPU.Build.0 = Release|Any CPU - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Release|x64.ActiveCfg = Release|Any CPU - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B}.Release|x64.Build.0 = Release|Any CPU - {524C5CA0-036E-480A-86E4-513232422F26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {524C5CA0-036E-480A-86E4-513232422F26}.Debug|Any CPU.Build.0 = Debug|Any CPU - {524C5CA0-036E-480A-86E4-513232422F26}.Debug|x64.ActiveCfg = Debug|Any CPU - {524C5CA0-036E-480A-86E4-513232422F26}.Debug|x64.Build.0 = Debug|Any CPU - {524C5CA0-036E-480A-86E4-513232422F26}.Release|Any CPU.ActiveCfg = Release|Any CPU - {524C5CA0-036E-480A-86E4-513232422F26}.Release|Any CPU.Build.0 = Release|Any CPU - {524C5CA0-036E-480A-86E4-513232422F26}.Release|x64.ActiveCfg = Release|Any CPU - {524C5CA0-036E-480A-86E4-513232422F26}.Release|x64.Build.0 = Release|Any CPU - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Debug|x64.ActiveCfg = Debug|Any CPU - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Debug|x64.Build.0 = Debug|Any CPU - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Release|Any CPU.Build.0 = Release|Any CPU - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Release|x64.ActiveCfg = Release|Any CPU - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF}.Release|x64.Build.0 = Release|Any CPU - {217AB0A8-8750-4696-8E43-E11F82A191CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {217AB0A8-8750-4696-8E43-E11F82A191CB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {217AB0A8-8750-4696-8E43-E11F82A191CB}.Debug|x64.ActiveCfg = Debug|Any CPU - {217AB0A8-8750-4696-8E43-E11F82A191CB}.Debug|x64.Build.0 = Debug|Any CPU - {217AB0A8-8750-4696-8E43-E11F82A191CB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {217AB0A8-8750-4696-8E43-E11F82A191CB}.Release|Any CPU.Build.0 = Release|Any CPU - {217AB0A8-8750-4696-8E43-E11F82A191CB}.Release|x64.ActiveCfg = Release|Any CPU - {217AB0A8-8750-4696-8E43-E11F82A191CB}.Release|x64.Build.0 = Release|Any CPU - {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Debug|x64.ActiveCfg = Debug|Any CPU - {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Debug|x64.Build.0 = Debug|Any CPU - {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Release|Any CPU.Build.0 = Release|Any CPU - {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Release|x64.ActiveCfg = Release|Any CPU - {C92637A7-77FC-4995-8024-B28F6C58AEA8}.Release|x64.Build.0 = Release|Any CPU - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Debug|x64.ActiveCfg = Debug|Any CPU - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Debug|x64.Build.0 = Debug|Any CPU - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Release|Any CPU.Build.0 = Release|Any CPU - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Release|x64.ActiveCfg = Release|Any CPU - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2}.Release|x64.Build.0 = Release|Any CPU - {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Debug|x64.ActiveCfg = Debug|Any CPU - {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Debug|x64.Build.0 = Debug|Any CPU - {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Release|Any CPU.Build.0 = Release|Any CPU - {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Release|x64.ActiveCfg = Release|Any CPU - {2BDF6D68-91FF-4220-8D78-90AA024275C3}.Release|x64.Build.0 = Release|Any CPU - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Debug|x64.ActiveCfg = Debug|Any CPU - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Debug|x64.Build.0 = Debug|Any CPU - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Release|Any CPU.Build.0 = Release|Any CPU - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Release|x64.ActiveCfg = Release|Any CPU - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8}.Release|x64.Build.0 = Release|Any CPU - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Debug|x64.ActiveCfg = Debug|Any CPU - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Debug|x64.Build.0 = Debug|Any CPU - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Release|Any CPU.Build.0 = Release|Any CPU - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Release|x64.ActiveCfg = Release|Any CPU - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592}.Release|x64.Build.0 = Release|Any CPU - {66DEC85C-7433-4902-B01A-8F98D1A87385}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66DEC85C-7433-4902-B01A-8F98D1A87385}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66DEC85C-7433-4902-B01A-8F98D1A87385}.Debug|x64.ActiveCfg = Debug|Any CPU - {66DEC85C-7433-4902-B01A-8F98D1A87385}.Debug|x64.Build.0 = Debug|Any CPU - {66DEC85C-7433-4902-B01A-8F98D1A87385}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66DEC85C-7433-4902-B01A-8F98D1A87385}.Release|Any CPU.Build.0 = Release|Any CPU - {66DEC85C-7433-4902-B01A-8F98D1A87385}.Release|x64.ActiveCfg = Release|Any CPU - {66DEC85C-7433-4902-B01A-8F98D1A87385}.Release|x64.Build.0 = Release|Any CPU - {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Debug|x64.ActiveCfg = Debug|Any CPU - {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Debug|x64.Build.0 = Debug|Any CPU - {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Release|Any CPU.Build.0 = Release|Any CPU - {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Release|x64.ActiveCfg = Release|Any CPU - {8BE42490-F83D-48D7-8C5D-1665AC84229C}.Release|x64.Build.0 = Release|Any CPU - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Debug|x64.ActiveCfg = Debug|Any CPU - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Debug|x64.Build.0 = Debug|Any CPU - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Release|Any CPU.Build.0 = Release|Any CPU - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Release|x64.ActiveCfg = Release|Any CPU - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11}.Release|x64.Build.0 = Release|Any CPU - {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Debug|x64.ActiveCfg = Debug|Any CPU - {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Debug|x64.Build.0 = Debug|Any CPU - {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Release|Any CPU.Build.0 = Release|Any CPU - {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Release|x64.ActiveCfg = Release|Any CPU - {2DEE608F-965F-4298-9B71-D7B32CBA66BD}.Release|x64.Build.0 = Release|Any CPU - {E7C80137-1D51-4215-BED7-C739BC663BE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E7C80137-1D51-4215-BED7-C739BC663BE2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E7C80137-1D51-4215-BED7-C739BC663BE2}.Debug|x64.ActiveCfg = Debug|Any CPU - {E7C80137-1D51-4215-BED7-C739BC663BE2}.Debug|x64.Build.0 = Debug|Any CPU - {E7C80137-1D51-4215-BED7-C739BC663BE2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E7C80137-1D51-4215-BED7-C739BC663BE2}.Release|Any CPU.Build.0 = Release|Any CPU - {E7C80137-1D51-4215-BED7-C739BC663BE2}.Release|x64.ActiveCfg = Release|Any CPU - {E7C80137-1D51-4215-BED7-C739BC663BE2}.Release|x64.Build.0 = Release|Any CPU - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Debug|x64.ActiveCfg = Debug|Any CPU - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Debug|x64.Build.0 = Debug|Any CPU - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Release|Any CPU.Build.0 = Release|Any CPU - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Release|x64.ActiveCfg = Release|Any CPU - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A}.Release|x64.Build.0 = Release|Any CPU - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Debug|x64.ActiveCfg = Debug|Any CPU - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Debug|x64.Build.0 = Debug|Any CPU - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Release|Any CPU.Build.0 = Release|Any CPU - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Release|x64.ActiveCfg = Release|Any CPU - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58}.Release|x64.Build.0 = Release|Any CPU - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Debug|x64.ActiveCfg = Debug|Any CPU - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Debug|x64.Build.0 = Debug|Any CPU - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Release|Any CPU.Build.0 = Release|Any CPU - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Release|x64.ActiveCfg = Release|Any CPU - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2}.Release|x64.Build.0 = Release|Any CPU - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Debug|x64.ActiveCfg = Debug|Any CPU - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Debug|x64.Build.0 = Debug|Any CPU - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Release|Any CPU.Build.0 = Release|Any CPU - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Release|x64.ActiveCfg = Release|Any CPU - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB}.Release|x64.Build.0 = Release|Any CPU - {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Debug|x64.ActiveCfg = Debug|Any CPU - {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Debug|x64.Build.0 = Debug|Any CPU - {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Release|Any CPU.Build.0 = Release|Any CPU - {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Release|x64.ActiveCfg = Release|Any CPU - {5A42D577-38AA-4A5B-866A-01FE1339F2AB}.Release|x64.Build.0 = Release|Any CPU - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Debug|x64.ActiveCfg = Debug|Any CPU - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Debug|x64.Build.0 = Debug|Any CPU - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Release|Any CPU.Build.0 = Release|Any CPU - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Release|x64.ActiveCfg = Release|Any CPU - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE}.Release|x64.Build.0 = Release|Any CPU - {C517C235-8969-478B-941B-2E40897F4C71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C517C235-8969-478B-941B-2E40897F4C71}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C517C235-8969-478B-941B-2E40897F4C71}.Debug|x64.ActiveCfg = Debug|Any CPU - {C517C235-8969-478B-941B-2E40897F4C71}.Debug|x64.Build.0 = Debug|Any CPU - {C517C235-8969-478B-941B-2E40897F4C71}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C517C235-8969-478B-941B-2E40897F4C71}.Release|Any CPU.Build.0 = Release|Any CPU - {C517C235-8969-478B-941B-2E40897F4C71}.Release|x64.ActiveCfg = Release|Any CPU - {C517C235-8969-478B-941B-2E40897F4C71}.Release|x64.Build.0 = Release|Any CPU - {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|x64.ActiveCfg = Debug|Any CPU - {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Debug|x64.Build.0 = Debug|Any CPU - {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Release|Any CPU.Build.0 = Release|Any CPU - {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Release|x64.ActiveCfg = Release|Any CPU - {41817AD2-D1DA-4698-B87D-910524CE4B7A}.Release|x64.Build.0 = Release|Any CPU - {36629279-FD56-452B-88C2-5C8271500042}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36629279-FD56-452B-88C2-5C8271500042}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36629279-FD56-452B-88C2-5C8271500042}.Debug|x64.ActiveCfg = Debug|Any CPU - {36629279-FD56-452B-88C2-5C8271500042}.Debug|x64.Build.0 = Debug|Any CPU - {36629279-FD56-452B-88C2-5C8271500042}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36629279-FD56-452B-88C2-5C8271500042}.Release|Any CPU.Build.0 = Release|Any CPU - {36629279-FD56-452B-88C2-5C8271500042}.Release|x64.ActiveCfg = Release|Any CPU - {36629279-FD56-452B-88C2-5C8271500042}.Release|x64.Build.0 = Release|Any CPU - {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|x64.ActiveCfg = Debug|Any CPU - {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Debug|x64.Build.0 = Debug|Any CPU - {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Release|Any CPU.Build.0 = Release|Any CPU - {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Release|x64.ActiveCfg = Release|Any CPU - {40D7AED3-982D-440B-BCD5-C1EFFC59514D}.Release|x64.Build.0 = Release|Any CPU - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Debug|x64.ActiveCfg = Debug|Any CPU - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Debug|x64.Build.0 = Debug|Any CPU - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Release|Any CPU.Build.0 = Release|Any CPU - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Release|x64.ActiveCfg = Release|Any CPU - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C}.Release|x64.Build.0 = Release|Any CPU - {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Debug|x64.ActiveCfg = Debug|Any CPU - {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Debug|x64.Build.0 = Debug|Any CPU - {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Release|Any CPU.Build.0 = Release|Any CPU - {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Release|x64.ActiveCfg = Release|Any CPU - {A1D7408C-AB95-4CFF-89F8-24797A865DBF}.Release|x64.Build.0 = Release|Any CPU - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Debug|x64.ActiveCfg = Debug|Any CPU - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Debug|x64.Build.0 = Debug|Any CPU - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Release|Any CPU.Build.0 = Release|Any CPU - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Release|x64.ActiveCfg = Release|Any CPU - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9}.Release|x64.Build.0 = Release|Any CPU - {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Debug|x64.ActiveCfg = Debug|Any CPU - {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Debug|x64.Build.0 = Debug|Any CPU - {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Release|Any CPU.Build.0 = Release|Any CPU - {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Release|x64.ActiveCfg = Release|Any CPU - {8680EA03-13A7-4F4A-A579-EB2CB6411C21}.Release|x64.Build.0 = Release|Any CPU - {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Debug|x64.ActiveCfg = Debug|Any CPU - {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Debug|x64.Build.0 = Debug|Any CPU - {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Release|Any CPU.Build.0 = Release|Any CPU - {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Release|x64.ActiveCfg = Release|Any CPU - {4CE930E3-12E4-4BFA-962E-3477B7AB6930}.Release|x64.Build.0 = Release|Any CPU - {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Debug|x64.ActiveCfg = Debug|Any CPU - {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Debug|x64.Build.0 = Debug|Any CPU - {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Release|Any CPU.Build.0 = Release|Any CPU - {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Release|x64.ActiveCfg = Release|Any CPU - {8903DCD8-A68D-4164-83EE-DE07385DDDD6}.Release|x64.Build.0 = Release|Any CPU - {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Debug|x64.ActiveCfg = Debug|Any CPU - {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Debug|x64.Build.0 = Debug|Any CPU - {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Release|Any CPU.Build.0 = Release|Any CPU - {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Release|x64.ActiveCfg = Release|Any CPU - {E2E68FF1-9CB5-424F-9D91-130A48462E54}.Release|x64.Build.0 = Release|Any CPU - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Debug|x64.ActiveCfg = Debug|Any CPU - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Debug|x64.Build.0 = Debug|Any CPU - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Release|Any CPU.Build.0 = Release|Any CPU - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Release|x64.ActiveCfg = Release|Any CPU - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2}.Release|x64.Build.0 = Release|Any CPU - {472122D3-114E-424D-AF47-B3D7E94057A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {472122D3-114E-424D-AF47-B3D7E94057A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {472122D3-114E-424D-AF47-B3D7E94057A8}.Debug|x64.ActiveCfg = Debug|Any CPU - {472122D3-114E-424D-AF47-B3D7E94057A8}.Debug|x64.Build.0 = Debug|Any CPU - {472122D3-114E-424D-AF47-B3D7E94057A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {472122D3-114E-424D-AF47-B3D7E94057A8}.Release|Any CPU.Build.0 = Release|Any CPU - {472122D3-114E-424D-AF47-B3D7E94057A8}.Release|x64.ActiveCfg = Release|Any CPU - {472122D3-114E-424D-AF47-B3D7E94057A8}.Release|x64.Build.0 = Release|Any CPU - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Debug|x64.ActiveCfg = Debug|Any CPU - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Debug|x64.Build.0 = Debug|Any CPU - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|Any CPU.Build.0 = Release|Any CPU - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|x64.ActiveCfg = Release|Any CPU - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2}.Release|x64.Build.0 = Release|Any CPU - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|x64.ActiveCfg = Debug|Any CPU - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Debug|x64.Build.0 = Debug|Any CPU - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Release|Any CPU.Build.0 = Release|Any CPU - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Release|x64.ActiveCfg = Release|Any CPU - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F}.Release|x64.Build.0 = Release|Any CPU - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Debug|x64.ActiveCfg = Debug|Any CPU - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Debug|x64.Build.0 = Debug|Any CPU - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Release|Any CPU.Build.0 = Release|Any CPU - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Release|x64.ActiveCfg = Release|Any CPU - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A}.Release|x64.Build.0 = Release|Any CPU - {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Debug|x64.ActiveCfg = Debug|Any CPU - {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Debug|x64.Build.0 = Debug|Any CPU - {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Release|Any CPU.Build.0 = Release|Any CPU - {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Release|x64.ActiveCfg = Release|Any CPU - {F9C27912-F7EC-47B6-A385-064BD4B92EDA}.Release|x64.Build.0 = Release|Any CPU - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Debug|x64.ActiveCfg = Debug|Any CPU - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Debug|x64.Build.0 = Debug|Any CPU - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Release|Any CPU.Build.0 = Release|Any CPU - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Release|x64.ActiveCfg = Release|Any CPU - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6}.Release|x64.Build.0 = Release|Any CPU - {332D590C-11EC-481D-AC55-6279548F1CF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {332D590C-11EC-481D-AC55-6279548F1CF4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {332D590C-11EC-481D-AC55-6279548F1CF4}.Debug|x64.ActiveCfg = Debug|Any CPU - {332D590C-11EC-481D-AC55-6279548F1CF4}.Debug|x64.Build.0 = Debug|Any CPU - {332D590C-11EC-481D-AC55-6279548F1CF4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {332D590C-11EC-481D-AC55-6279548F1CF4}.Release|Any CPU.Build.0 = Release|Any CPU - {332D590C-11EC-481D-AC55-6279548F1CF4}.Release|x64.ActiveCfg = Release|Any CPU - {332D590C-11EC-481D-AC55-6279548F1CF4}.Release|x64.Build.0 = Release|Any CPU - {7BF99E7E-37EB-46D6-8808-2254430C3645}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7BF99E7E-37EB-46D6-8808-2254430C3645}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7BF99E7E-37EB-46D6-8808-2254430C3645}.Debug|x64.ActiveCfg = Debug|Any CPU - {7BF99E7E-37EB-46D6-8808-2254430C3645}.Debug|x64.Build.0 = Debug|Any CPU - {7BF99E7E-37EB-46D6-8808-2254430C3645}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7BF99E7E-37EB-46D6-8808-2254430C3645}.Release|Any CPU.Build.0 = Release|Any CPU - {7BF99E7E-37EB-46D6-8808-2254430C3645}.Release|x64.ActiveCfg = Release|Any CPU - {7BF99E7E-37EB-46D6-8808-2254430C3645}.Release|x64.Build.0 = Release|Any CPU - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Debug|x64.ActiveCfg = Debug|Any CPU - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Debug|x64.Build.0 = Debug|Any CPU - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|Any CPU.Build.0 = Release|Any CPU - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|x64.ActiveCfg = Release|Any CPU - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21}.Release|x64.Build.0 = Release|Any CPU - {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|x64.ActiveCfg = Debug|Any CPU - {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Debug|x64.Build.0 = Debug|Any CPU - {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Release|Any CPU.Build.0 = Release|Any CPU - {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Release|x64.ActiveCfg = Release|Any CPU - {37138DEF-EEE4-4363-A307-0027B4C6ACD8}.Release|x64.Build.0 = Release|Any CPU - {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Debug|x64.ActiveCfg = Debug|Any CPU - {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Debug|x64.Build.0 = Debug|Any CPU - {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Release|Any CPU.Build.0 = Release|Any CPU - {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Release|x64.ActiveCfg = Release|Any CPU - {A93F1887-0011-466C-8EB8-3A338AEA5A4B}.Release|x64.Build.0 = Release|Any CPU - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Debug|x64.ActiveCfg = Debug|Any CPU - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Debug|x64.Build.0 = Debug|Any CPU - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Release|Any CPU.Build.0 = Release|Any CPU - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Release|x64.ActiveCfg = Release|Any CPU - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680}.Release|x64.Build.0 = Release|Any CPU - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Debug|x64.ActiveCfg = Debug|Any CPU - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Debug|x64.Build.0 = Debug|Any CPU - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Release|Any CPU.Build.0 = Release|Any CPU - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Release|x64.ActiveCfg = Release|Any CPU - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD}.Release|x64.Build.0 = Release|Any CPU - {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Debug|x64.ActiveCfg = Debug|Any CPU - {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Debug|x64.Build.0 = Debug|Any CPU - {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Release|Any CPU.Build.0 = Release|Any CPU - {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Release|x64.ActiveCfg = Release|Any CPU - {CC7ED747-8BCE-4B49-8855-AE4697792A81}.Release|x64.Build.0 = Release|Any CPU - {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Debug|x64.ActiveCfg = Debug|Any CPU - {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Debug|x64.Build.0 = Debug|Any CPU - {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Release|Any CPU.Build.0 = Release|Any CPU - {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Release|x64.ActiveCfg = Release|Any CPU - {605A3653-C7E3-4EC2-8749-979E4A0227D0}.Release|x64.Build.0 = Release|Any CPU - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Debug|x64.ActiveCfg = Debug|Any CPU - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Debug|x64.Build.0 = Debug|Any CPU - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Release|Any CPU.Build.0 = Release|Any CPU - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Release|x64.ActiveCfg = Release|Any CPU - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC}.Release|x64.Build.0 = Release|Any CPU - {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Debug|x64.ActiveCfg = Debug|Any CPU - {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Debug|x64.Build.0 = Debug|Any CPU - {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Release|Any CPU.Build.0 = Release|Any CPU - {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Release|x64.ActiveCfg = Release|Any CPU - {50C13F5E-BA3A-4B04-A730-BAA584E051AB}.Release|x64.Build.0 = Release|Any CPU - {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Debug|x64.ActiveCfg = Debug|Any CPU - {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Debug|x64.Build.0 = Debug|Any CPU - {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Release|Any CPU.Build.0 = Release|Any CPU - {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Release|x64.ActiveCfg = Release|Any CPU - {C8AD2261-D325-414D-9B2D-B2A9D27C242F}.Release|x64.Build.0 = Release|Any CPU - {CC9C8421-68D2-4645-B97E-512FAC691703}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC9C8421-68D2-4645-B97E-512FAC691703}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC9C8421-68D2-4645-B97E-512FAC691703}.Debug|x64.ActiveCfg = Debug|Any CPU - {CC9C8421-68D2-4645-B97E-512FAC691703}.Debug|x64.Build.0 = Debug|Any CPU - {CC9C8421-68D2-4645-B97E-512FAC691703}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC9C8421-68D2-4645-B97E-512FAC691703}.Release|Any CPU.Build.0 = Release|Any CPU - {CC9C8421-68D2-4645-B97E-512FAC691703}.Release|x64.ActiveCfg = Release|Any CPU - {CC9C8421-68D2-4645-B97E-512FAC691703}.Release|x64.Build.0 = Release|Any CPU - {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Debug|x64.ActiveCfg = Debug|Any CPU - {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Debug|x64.Build.0 = Debug|Any CPU - {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Release|Any CPU.Build.0 = Release|Any CPU - {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Release|x64.ActiveCfg = Release|Any CPU - {1551B2ED-9931-4A03-8853-1C3E5504C43D}.Release|x64.Build.0 = Release|Any CPU - {CB1F1533-E430-47C5-AD52-04922CC959A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CB1F1533-E430-47C5-AD52-04922CC959A5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CB1F1533-E430-47C5-AD52-04922CC959A5}.Debug|x64.ActiveCfg = Debug|Any CPU - {CB1F1533-E430-47C5-AD52-04922CC959A5}.Debug|x64.Build.0 = Debug|Any CPU - {CB1F1533-E430-47C5-AD52-04922CC959A5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CB1F1533-E430-47C5-AD52-04922CC959A5}.Release|Any CPU.Build.0 = Release|Any CPU - {CB1F1533-E430-47C5-AD52-04922CC959A5}.Release|x64.ActiveCfg = Release|Any CPU - {CB1F1533-E430-47C5-AD52-04922CC959A5}.Release|x64.Build.0 = Release|Any CPU - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Debug|x64.ActiveCfg = Debug|Any CPU - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Debug|x64.Build.0 = Debug|Any CPU - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Release|Any CPU.Build.0 = Release|Any CPU - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Release|x64.ActiveCfg = Release|Any CPU - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574}.Release|x64.Build.0 = Release|Any CPU - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Debug|x64.ActiveCfg = Debug|Any CPU - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Debug|x64.Build.0 = Debug|Any CPU - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Release|Any CPU.Build.0 = Release|Any CPU - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Release|x64.ActiveCfg = Release|Any CPU - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9}.Release|x64.Build.0 = Release|Any CPU - {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Debug|x64.ActiveCfg = Debug|Any CPU - {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Debug|x64.Build.0 = Debug|Any CPU - {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Release|Any CPU.Build.0 = Release|Any CPU - {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Release|x64.ActiveCfg = Release|Any CPU - {D05ADEA6-2267-4DC1-901A-BD18B697E889}.Release|x64.Build.0 = Release|Any CPU - {1787BF8C-3C05-4E07-8868-E839544F9522}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1787BF8C-3C05-4E07-8868-E839544F9522}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1787BF8C-3C05-4E07-8868-E839544F9522}.Debug|x64.ActiveCfg = Debug|Any CPU - {1787BF8C-3C05-4E07-8868-E839544F9522}.Debug|x64.Build.0 = Debug|Any CPU - {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|Any CPU.Build.0 = Release|Any CPU - {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|x64.ActiveCfg = Release|Any CPU - {1787BF8C-3C05-4E07-8868-E839544F9522}.Release|x64.Build.0 = Release|Any CPU - {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|x64.ActiveCfg = Debug|Any CPU - {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Debug|x64.Build.0 = Debug|Any CPU - {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Release|Any CPU.Build.0 = Release|Any CPU - {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Release|x64.ActiveCfg = Release|Any CPU - {F673CF31-D8CF-4F3E-B294-0802589F5BF2}.Release|x64.Build.0 = Release|Any CPU - {0D9CDEA2-0DC6-490A-9145-782259B63739}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D9CDEA2-0DC6-490A-9145-782259B63739}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D9CDEA2-0DC6-490A-9145-782259B63739}.Debug|x64.ActiveCfg = Debug|Any CPU - {0D9CDEA2-0DC6-490A-9145-782259B63739}.Debug|x64.Build.0 = Debug|Any CPU - {0D9CDEA2-0DC6-490A-9145-782259B63739}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D9CDEA2-0DC6-490A-9145-782259B63739}.Release|Any CPU.Build.0 = Release|Any CPU - {0D9CDEA2-0DC6-490A-9145-782259B63739}.Release|x64.ActiveCfg = Release|Any CPU - {0D9CDEA2-0DC6-490A-9145-782259B63739}.Release|x64.Build.0 = Release|Any CPU - {80512601-4B59-4A1B-984F-8E81E3242F97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {80512601-4B59-4A1B-984F-8E81E3242F97}.Debug|Any CPU.Build.0 = Debug|Any CPU - {80512601-4B59-4A1B-984F-8E81E3242F97}.Debug|x64.ActiveCfg = Debug|Any CPU - {80512601-4B59-4A1B-984F-8E81E3242F97}.Debug|x64.Build.0 = Debug|Any CPU - {80512601-4B59-4A1B-984F-8E81E3242F97}.Release|Any CPU.ActiveCfg = Release|Any CPU - {80512601-4B59-4A1B-984F-8E81E3242F97}.Release|Any CPU.Build.0 = Release|Any CPU - {80512601-4B59-4A1B-984F-8E81E3242F97}.Release|x64.ActiveCfg = Release|Any CPU - {80512601-4B59-4A1B-984F-8E81E3242F97}.Release|x64.Build.0 = Release|Any CPU - {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Debug|Any CPU.Build.0 = Debug|Any CPU - {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Debug|x64.ActiveCfg = Debug|Any CPU - {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Debug|x64.Build.0 = Debug|Any CPU - {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Release|Any CPU.ActiveCfg = Release|Any CPU - {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Release|Any CPU.Build.0 = Release|Any CPU - {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Release|x64.ActiveCfg = Release|Any CPU - {96C2CD33-8A8C-4206-9C73-97E8D748F397}.Release|x64.Build.0 = Release|Any CPU - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Debug|x64.ActiveCfg = Debug|Any CPU - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Debug|x64.Build.0 = Debug|Any CPU - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Release|Any CPU.Build.0 = Release|Any CPU - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Release|x64.ActiveCfg = Release|Any CPU - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31}.Release|x64.Build.0 = Release|Any CPU - {76117457-EC1B-4844-825A-20A760B42C44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76117457-EC1B-4844-825A-20A760B42C44}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76117457-EC1B-4844-825A-20A760B42C44}.Debug|x64.ActiveCfg = Debug|Any CPU - {76117457-EC1B-4844-825A-20A760B42C44}.Debug|x64.Build.0 = Debug|Any CPU - {76117457-EC1B-4844-825A-20A760B42C44}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76117457-EC1B-4844-825A-20A760B42C44}.Release|Any CPU.Build.0 = Release|Any CPU - {76117457-EC1B-4844-825A-20A760B42C44}.Release|x64.ActiveCfg = Release|Any CPU - {76117457-EC1B-4844-825A-20A760B42C44}.Release|x64.Build.0 = Release|Any CPU - {89EE0C4D-6C29-472E-9109-84327DB489A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89EE0C4D-6C29-472E-9109-84327DB489A1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89EE0C4D-6C29-472E-9109-84327DB489A1}.Debug|x64.ActiveCfg = Debug|Any CPU - {89EE0C4D-6C29-472E-9109-84327DB489A1}.Debug|x64.Build.0 = Debug|Any CPU - {89EE0C4D-6C29-472E-9109-84327DB489A1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89EE0C4D-6C29-472E-9109-84327DB489A1}.Release|Any CPU.Build.0 = Release|Any CPU - {89EE0C4D-6C29-472E-9109-84327DB489A1}.Release|x64.ActiveCfg = Release|Any CPU - {89EE0C4D-6C29-472E-9109-84327DB489A1}.Release|x64.Build.0 = Release|Any CPU - {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Debug|x64.ActiveCfg = Debug|Any CPU - {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Debug|x64.Build.0 = Debug|Any CPU - {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|Any CPU.Build.0 = Release|Any CPU - {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|x64.ActiveCfg = Release|Any CPU - {F45CBF27-1D45-404C-9B09-5CC781AF5942}.Release|x64.Build.0 = Release|Any CPU - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Debug|x64.ActiveCfg = Debug|Any CPU - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Debug|x64.Build.0 = Debug|Any CPU - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Release|Any CPU.Build.0 = Release|Any CPU - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Release|x64.ActiveCfg = Release|Any CPU - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36}.Release|x64.Build.0 = Release|Any CPU - {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Debug|x64.ActiveCfg = Debug|Any CPU - {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Debug|x64.Build.0 = Debug|Any CPU - {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|Any CPU.Build.0 = Release|Any CPU - {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|x64.ActiveCfg = Release|Any CPU - {8EA836C9-BE07-4EDE-A983-122A1D9FB499}.Release|x64.Build.0 = Release|Any CPU - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Debug|x64.ActiveCfg = Debug|Any CPU - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Debug|x64.Build.0 = Debug|Any CPU - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Release|Any CPU.Build.0 = Release|Any CPU - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Release|x64.ActiveCfg = Release|Any CPU - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F}.Release|x64.Build.0 = Release|Any CPU - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Debug|x64.ActiveCfg = Debug|Any CPU - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Debug|x64.Build.0 = Debug|Any CPU - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Release|Any CPU.Build.0 = Release|Any CPU - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Release|x64.ActiveCfg = Release|Any CPU - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC}.Release|x64.Build.0 = Release|Any CPU - {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Debug|Any CPU.Build.0 = Debug|Any CPU - {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Debug|x64.ActiveCfg = Debug|Any CPU - {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Debug|x64.Build.0 = Debug|Any CPU - {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Release|Any CPU.ActiveCfg = Release|Any CPU - {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Release|Any CPU.Build.0 = Release|Any CPU - {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Release|x64.ActiveCfg = Release|Any CPU - {49DB6925-62FF-4CF3-A041-A7F117AD6256}.Release|x64.Build.0 = Release|Any CPU - {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Debug|x64.ActiveCfg = Debug|Any CPU - {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Debug|x64.Build.0 = Debug|Any CPU - {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Release|Any CPU.Build.0 = Release|Any CPU - {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Release|x64.ActiveCfg = Release|Any CPU - {09AD9DFA-6AD8-4872-AA96-29C3234828CD}.Release|x64.Build.0 = Release|Any CPU - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Debug|x64.ActiveCfg = Debug|Any CPU - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Debug|x64.Build.0 = Debug|Any CPU - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Release|Any CPU.Build.0 = Release|Any CPU - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Release|x64.ActiveCfg = Release|Any CPU - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E}.Release|x64.Build.0 = Release|Any CPU {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Debug|Any CPU.Build.0 = Debug|Any CPU {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1837,235 +567,1387 @@ Global {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|Any CPU.Build.0 = Release|Any CPU {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|x64.ActiveCfg = Release|Any CPU {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|x64.Build.0 = Release|Any CPU - {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Debug|Any CPU.Build.0 = Debug|Any CPU - {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Debug|x64.ActiveCfg = Debug|Any CPU - {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Debug|x64.Build.0 = Debug|Any CPU - {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Release|Any CPU.ActiveCfg = Release|Any CPU - {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Release|Any CPU.Build.0 = Release|Any CPU - {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Release|x64.ActiveCfg = Release|Any CPU - {215F07C3-74EE-4FAA-A821-09CF70B8C950}.Release|x64.Build.0 = Release|Any CPU + {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Debug|x64.ActiveCfg = Debug|Any CPU + {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Debug|x64.Build.0 = Debug|Any CPU + {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Release|Any CPU.Build.0 = Release|Any CPU + {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Release|x64.ActiveCfg = Release|Any CPU + {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Release|x64.Build.0 = Release|Any CPU + {78D31C12-2E54-4C66-9849-B9664B9A5897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78D31C12-2E54-4C66-9849-B9664B9A5897}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78D31C12-2E54-4C66-9849-B9664B9A5897}.Debug|x64.ActiveCfg = Debug|Any CPU + {78D31C12-2E54-4C66-9849-B9664B9A5897}.Debug|x64.Build.0 = Debug|Any CPU + {78D31C12-2E54-4C66-9849-B9664B9A5897}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78D31C12-2E54-4C66-9849-B9664B9A5897}.Release|Any CPU.Build.0 = Release|Any CPU + {78D31C12-2E54-4C66-9849-B9664B9A5897}.Release|x64.ActiveCfg = Release|Any CPU + {78D31C12-2E54-4C66-9849-B9664B9A5897}.Release|x64.Build.0 = Release|Any CPU + {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Debug|Any CPU.Build.0 = Debug|Any CPU + {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Debug|x64.ActiveCfg = Debug|Any CPU + {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Debug|x64.Build.0 = Debug|Any CPU + {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Release|Any CPU.ActiveCfg = Release|Any CPU + {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Release|Any CPU.Build.0 = Release|Any CPU + {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Release|x64.ActiveCfg = Release|Any CPU + {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Release|x64.Build.0 = Release|Any CPU + {BDA33777-F759-4050-85F5-68EB4996ADD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BDA33777-F759-4050-85F5-68EB4996ADD7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BDA33777-F759-4050-85F5-68EB4996ADD7}.Debug|x64.ActiveCfg = Debug|Any CPU + {BDA33777-F759-4050-85F5-68EB4996ADD7}.Debug|x64.Build.0 = Debug|Any CPU + {BDA33777-F759-4050-85F5-68EB4996ADD7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BDA33777-F759-4050-85F5-68EB4996ADD7}.Release|Any CPU.Build.0 = Release|Any CPU + {BDA33777-F759-4050-85F5-68EB4996ADD7}.Release|x64.ActiveCfg = Release|Any CPU + {BDA33777-F759-4050-85F5-68EB4996ADD7}.Release|x64.Build.0 = Release|Any CPU + {A71C1D90-5513-4255-84A0-32384474E82C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A71C1D90-5513-4255-84A0-32384474E82C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A71C1D90-5513-4255-84A0-32384474E82C}.Debug|x64.ActiveCfg = Debug|Any CPU + {A71C1D90-5513-4255-84A0-32384474E82C}.Debug|x64.Build.0 = Debug|Any CPU + {A71C1D90-5513-4255-84A0-32384474E82C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A71C1D90-5513-4255-84A0-32384474E82C}.Release|Any CPU.Build.0 = Release|Any CPU + {A71C1D90-5513-4255-84A0-32384474E82C}.Release|x64.ActiveCfg = Release|Any CPU + {A71C1D90-5513-4255-84A0-32384474E82C}.Release|x64.Build.0 = Release|Any CPU + {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Debug|x64.ActiveCfg = Debug|Any CPU + {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Debug|x64.Build.0 = Debug|Any CPU + {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Release|Any CPU.Build.0 = Release|Any CPU + {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Release|x64.ActiveCfg = Release|Any CPU + {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Release|x64.Build.0 = Release|Any CPU + {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Debug|x64.ActiveCfg = Debug|Any CPU + {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Debug|x64.Build.0 = Debug|Any CPU + {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Release|Any CPU.Build.0 = Release|Any CPU + {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Release|x64.ActiveCfg = Release|Any CPU + {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Release|x64.Build.0 = Release|Any CPU + {617653DE-4377-4428-954B-E5FB4690E875}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {617653DE-4377-4428-954B-E5FB4690E875}.Debug|Any CPU.Build.0 = Debug|Any CPU + {617653DE-4377-4428-954B-E5FB4690E875}.Debug|x64.ActiveCfg = Debug|Any CPU + {617653DE-4377-4428-954B-E5FB4690E875}.Debug|x64.Build.0 = Debug|Any CPU + {617653DE-4377-4428-954B-E5FB4690E875}.Release|Any CPU.ActiveCfg = Release|Any CPU + {617653DE-4377-4428-954B-E5FB4690E875}.Release|Any CPU.Build.0 = Release|Any CPU + {617653DE-4377-4428-954B-E5FB4690E875}.Release|x64.ActiveCfg = Release|Any CPU + {617653DE-4377-4428-954B-E5FB4690E875}.Release|x64.Build.0 = Release|Any CPU + {741E75F7-9286-4C01-8C67-AA8515670DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {741E75F7-9286-4C01-8C67-AA8515670DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {741E75F7-9286-4C01-8C67-AA8515670DF7}.Debug|x64.ActiveCfg = Debug|Any CPU + {741E75F7-9286-4C01-8C67-AA8515670DF7}.Debug|x64.Build.0 = Debug|Any CPU + {741E75F7-9286-4C01-8C67-AA8515670DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {741E75F7-9286-4C01-8C67-AA8515670DF7}.Release|Any CPU.Build.0 = Release|Any CPU + {741E75F7-9286-4C01-8C67-AA8515670DF7}.Release|x64.ActiveCfg = Release|Any CPU + {741E75F7-9286-4C01-8C67-AA8515670DF7}.Release|x64.Build.0 = Release|Any CPU + {404CD919-D15D-49D6-8D26-E96486E62700}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {404CD919-D15D-49D6-8D26-E96486E62700}.Debug|Any CPU.Build.0 = Debug|Any CPU + {404CD919-D15D-49D6-8D26-E96486E62700}.Debug|x64.ActiveCfg = Debug|Any CPU + {404CD919-D15D-49D6-8D26-E96486E62700}.Debug|x64.Build.0 = Debug|Any CPU + {404CD919-D15D-49D6-8D26-E96486E62700}.Release|Any CPU.ActiveCfg = Release|Any CPU + {404CD919-D15D-49D6-8D26-E96486E62700}.Release|Any CPU.Build.0 = Release|Any CPU + {404CD919-D15D-49D6-8D26-E96486E62700}.Release|x64.ActiveCfg = Release|Any CPU + {404CD919-D15D-49D6-8D26-E96486E62700}.Release|x64.Build.0 = Release|Any CPU + {47597D41-C795-43FE-8B76-069D9E1C364C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {47597D41-C795-43FE-8B76-069D9E1C364C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47597D41-C795-43FE-8B76-069D9E1C364C}.Debug|x64.ActiveCfg = Debug|Any CPU + {47597D41-C795-43FE-8B76-069D9E1C364C}.Debug|x64.Build.0 = Debug|Any CPU + {47597D41-C795-43FE-8B76-069D9E1C364C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {47597D41-C795-43FE-8B76-069D9E1C364C}.Release|Any CPU.Build.0 = Release|Any CPU + {47597D41-C795-43FE-8B76-069D9E1C364C}.Release|x64.ActiveCfg = Release|Any CPU + {47597D41-C795-43FE-8B76-069D9E1C364C}.Release|x64.Build.0 = Release|Any CPU + {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Debug|x64.ActiveCfg = Debug|Any CPU + {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Debug|x64.Build.0 = Debug|Any CPU + {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Release|Any CPU.Build.0 = Release|Any CPU + {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Release|x64.ActiveCfg = Release|Any CPU + {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Release|x64.Build.0 = Release|Any CPU + {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Debug|x64.ActiveCfg = Debug|Any CPU + {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Debug|x64.Build.0 = Debug|Any CPU + {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Release|Any CPU.Build.0 = Release|Any CPU + {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Release|x64.ActiveCfg = Release|Any CPU + {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Release|x64.Build.0 = Release|Any CPU + {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Debug|x64.ActiveCfg = Debug|Any CPU + {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Debug|x64.Build.0 = Debug|Any CPU + {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Release|Any CPU.Build.0 = Release|Any CPU + {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Release|x64.ActiveCfg = Release|Any CPU + {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Release|x64.Build.0 = Release|Any CPU + {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Debug|x64.ActiveCfg = Debug|Any CPU + {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Debug|x64.Build.0 = Debug|Any CPU + {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Release|Any CPU.Build.0 = Release|Any CPU + {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Release|x64.ActiveCfg = Release|Any CPU + {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Release|x64.Build.0 = Release|Any CPU + {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Debug|x64.ActiveCfg = Debug|Any CPU + {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Debug|x64.Build.0 = Debug|Any CPU + {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Release|Any CPU.Build.0 = Release|Any CPU + {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Release|x64.ActiveCfg = Release|Any CPU + {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Release|x64.Build.0 = Release|Any CPU + {45BAE42F-4801-4758-9CDA-0D900C734369}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45BAE42F-4801-4758-9CDA-0D900C734369}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45BAE42F-4801-4758-9CDA-0D900C734369}.Debug|x64.ActiveCfg = Debug|Any CPU + {45BAE42F-4801-4758-9CDA-0D900C734369}.Debug|x64.Build.0 = Debug|Any CPU + {45BAE42F-4801-4758-9CDA-0D900C734369}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45BAE42F-4801-4758-9CDA-0D900C734369}.Release|Any CPU.Build.0 = Release|Any CPU + {45BAE42F-4801-4758-9CDA-0D900C734369}.Release|x64.ActiveCfg = Release|Any CPU + {45BAE42F-4801-4758-9CDA-0D900C734369}.Release|x64.Build.0 = Release|Any CPU + {9DE85526-8B33-4291-B285-4BECF431D6FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9DE85526-8B33-4291-B285-4BECF431D6FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9DE85526-8B33-4291-B285-4BECF431D6FA}.Debug|x64.ActiveCfg = Debug|Any CPU + {9DE85526-8B33-4291-B285-4BECF431D6FA}.Debug|x64.Build.0 = Debug|Any CPU + {9DE85526-8B33-4291-B285-4BECF431D6FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9DE85526-8B33-4291-B285-4BECF431D6FA}.Release|Any CPU.Build.0 = Release|Any CPU + {9DE85526-8B33-4291-B285-4BECF431D6FA}.Release|x64.ActiveCfg = Release|Any CPU + {9DE85526-8B33-4291-B285-4BECF431D6FA}.Release|x64.Build.0 = Release|Any CPU + {DCA283C7-2492-4461-BD34-AB00191C46F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DCA283C7-2492-4461-BD34-AB00191C46F7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DCA283C7-2492-4461-BD34-AB00191C46F7}.Debug|x64.ActiveCfg = Debug|Any CPU + {DCA283C7-2492-4461-BD34-AB00191C46F7}.Debug|x64.Build.0 = Debug|Any CPU + {DCA283C7-2492-4461-BD34-AB00191C46F7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DCA283C7-2492-4461-BD34-AB00191C46F7}.Release|Any CPU.Build.0 = Release|Any CPU + {DCA283C7-2492-4461-BD34-AB00191C46F7}.Release|x64.ActiveCfg = Release|Any CPU + {DCA283C7-2492-4461-BD34-AB00191C46F7}.Release|x64.Build.0 = Release|Any CPU + {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Debug|x64.ActiveCfg = Debug|Any CPU + {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Debug|x64.Build.0 = Debug|Any CPU + {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Release|Any CPU.Build.0 = Release|Any CPU + {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Release|x64.ActiveCfg = Release|Any CPU + {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Release|x64.Build.0 = Release|Any CPU + {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Debug|x64.ActiveCfg = Debug|Any CPU + {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Debug|x64.Build.0 = Debug|Any CPU + {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Release|Any CPU.Build.0 = Release|Any CPU + {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Release|x64.ActiveCfg = Release|Any CPU + {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Release|x64.Build.0 = Release|Any CPU + {06918731-F657-417E-A74D-E2D7E77351B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06918731-F657-417E-A74D-E2D7E77351B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06918731-F657-417E-A74D-E2D7E77351B1}.Debug|x64.ActiveCfg = Debug|Any CPU + {06918731-F657-417E-A74D-E2D7E77351B1}.Debug|x64.Build.0 = Debug|Any CPU + {06918731-F657-417E-A74D-E2D7E77351B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06918731-F657-417E-A74D-E2D7E77351B1}.Release|Any CPU.Build.0 = Release|Any CPU + {06918731-F657-417E-A74D-E2D7E77351B1}.Release|x64.ActiveCfg = Release|Any CPU + {06918731-F657-417E-A74D-E2D7E77351B1}.Release|x64.Build.0 = Release|Any CPU + {1818788E-7C68-4280-93A8-63D01168C6B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1818788E-7C68-4280-93A8-63D01168C6B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1818788E-7C68-4280-93A8-63D01168C6B6}.Debug|x64.ActiveCfg = Debug|Any CPU + {1818788E-7C68-4280-93A8-63D01168C6B6}.Debug|x64.Build.0 = Debug|Any CPU + {1818788E-7C68-4280-93A8-63D01168C6B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1818788E-7C68-4280-93A8-63D01168C6B6}.Release|Any CPU.Build.0 = Release|Any CPU + {1818788E-7C68-4280-93A8-63D01168C6B6}.Release|x64.ActiveCfg = Release|Any CPU + {1818788E-7C68-4280-93A8-63D01168C6B6}.Release|x64.Build.0 = Release|Any CPU + {872994E4-7D87-483A-B6DD-E68DE4526497}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {872994E4-7D87-483A-B6DD-E68DE4526497}.Debug|Any CPU.Build.0 = Debug|Any CPU + {872994E4-7D87-483A-B6DD-E68DE4526497}.Debug|x64.ActiveCfg = Debug|Any CPU + {872994E4-7D87-483A-B6DD-E68DE4526497}.Debug|x64.Build.0 = Debug|Any CPU + {872994E4-7D87-483A-B6DD-E68DE4526497}.Release|Any CPU.ActiveCfg = Release|Any CPU + {872994E4-7D87-483A-B6DD-E68DE4526497}.Release|Any CPU.Build.0 = Release|Any CPU + {872994E4-7D87-483A-B6DD-E68DE4526497}.Release|x64.ActiveCfg = Release|Any CPU + {872994E4-7D87-483A-B6DD-E68DE4526497}.Release|x64.Build.0 = Release|Any CPU + {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Debug|x64.ActiveCfg = Debug|Any CPU + {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Debug|x64.Build.0 = Debug|Any CPU + {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Release|Any CPU.Build.0 = Release|Any CPU + {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Release|x64.ActiveCfg = Release|Any CPU + {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Release|x64.Build.0 = Release|Any CPU + {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Debug|x64.ActiveCfg = Debug|Any CPU + {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Debug|x64.Build.0 = Debug|Any CPU + {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Release|Any CPU.Build.0 = Release|Any CPU + {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Release|x64.ActiveCfg = Release|Any CPU + {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Release|x64.Build.0 = Release|Any CPU + {8B0D2243-5E00-472E-82EC-572905A373AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B0D2243-5E00-472E-82EC-572905A373AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B0D2243-5E00-472E-82EC-572905A373AF}.Debug|x64.ActiveCfg = Debug|Any CPU + {8B0D2243-5E00-472E-82EC-572905A373AF}.Debug|x64.Build.0 = Debug|Any CPU + {8B0D2243-5E00-472E-82EC-572905A373AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B0D2243-5E00-472E-82EC-572905A373AF}.Release|Any CPU.Build.0 = Release|Any CPU + {8B0D2243-5E00-472E-82EC-572905A373AF}.Release|x64.ActiveCfg = Release|Any CPU + {8B0D2243-5E00-472E-82EC-572905A373AF}.Release|x64.Build.0 = Release|Any CPU + {94F98C15-6E92-466A-A93D-EB37CC877F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94F98C15-6E92-466A-A93D-EB37CC877F99}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94F98C15-6E92-466A-A93D-EB37CC877F99}.Debug|x64.ActiveCfg = Debug|Any CPU + {94F98C15-6E92-466A-A93D-EB37CC877F99}.Debug|x64.Build.0 = Debug|Any CPU + {94F98C15-6E92-466A-A93D-EB37CC877F99}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94F98C15-6E92-466A-A93D-EB37CC877F99}.Release|Any CPU.Build.0 = Release|Any CPU + {94F98C15-6E92-466A-A93D-EB37CC877F99}.Release|x64.ActiveCfg = Release|Any CPU + {94F98C15-6E92-466A-A93D-EB37CC877F99}.Release|x64.Build.0 = Release|Any CPU + {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Debug|x64.ActiveCfg = Debug|Any CPU + {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Debug|x64.Build.0 = Debug|Any CPU + {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Release|Any CPU.Build.0 = Release|Any CPU + {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Release|x64.ActiveCfg = Release|Any CPU + {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Release|x64.Build.0 = Release|Any CPU + {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Debug|x64.ActiveCfg = Debug|Any CPU + {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Debug|x64.Build.0 = Debug|Any CPU + {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Release|Any CPU.Build.0 = Release|Any CPU + {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Release|x64.ActiveCfg = Release|Any CPU + {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Release|x64.Build.0 = Release|Any CPU + {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Debug|x64.ActiveCfg = Debug|Any CPU + {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Debug|x64.Build.0 = Debug|Any CPU + {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Release|Any CPU.Build.0 = Release|Any CPU + {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Release|x64.ActiveCfg = Release|Any CPU + {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Release|x64.Build.0 = Release|Any CPU + {84B7A048-5B99-429A-8322-0DE98560C2D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {84B7A048-5B99-429A-8322-0DE98560C2D0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {84B7A048-5B99-429A-8322-0DE98560C2D0}.Debug|x64.ActiveCfg = Debug|Any CPU + {84B7A048-5B99-429A-8322-0DE98560C2D0}.Debug|x64.Build.0 = Debug|Any CPU + {84B7A048-5B99-429A-8322-0DE98560C2D0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {84B7A048-5B99-429A-8322-0DE98560C2D0}.Release|Any CPU.Build.0 = Release|Any CPU + {84B7A048-5B99-429A-8322-0DE98560C2D0}.Release|x64.ActiveCfg = Release|Any CPU + {84B7A048-5B99-429A-8322-0DE98560C2D0}.Release|x64.Build.0 = Release|Any CPU + {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Debug|x64.ActiveCfg = Debug|Any CPU + {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Debug|x64.Build.0 = Debug|Any CPU + {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Release|Any CPU.Build.0 = Release|Any CPU + {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Release|x64.ActiveCfg = Release|Any CPU + {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Release|x64.Build.0 = Release|Any CPU + {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Debug|Any CPU.Build.0 = Debug|Any CPU + {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Debug|x64.ActiveCfg = Debug|Any CPU + {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Debug|x64.Build.0 = Debug|Any CPU + {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Release|Any CPU.ActiveCfg = Release|Any CPU + {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Release|Any CPU.Build.0 = Release|Any CPU + {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Release|x64.ActiveCfg = Release|Any CPU + {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Release|x64.Build.0 = Release|Any CPU + {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Debug|x64.ActiveCfg = Debug|Any CPU + {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Debug|x64.Build.0 = Debug|Any CPU + {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Release|Any CPU.Build.0 = Release|Any CPU + {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Release|x64.ActiveCfg = Release|Any CPU + {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Release|x64.Build.0 = Release|Any CPU + {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Debug|x64.ActiveCfg = Debug|Any CPU + {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Debug|x64.Build.0 = Debug|Any CPU + {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Release|Any CPU.Build.0 = Release|Any CPU + {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Release|x64.ActiveCfg = Release|Any CPU + {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Release|x64.Build.0 = Release|Any CPU + {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Debug|x64.ActiveCfg = Debug|Any CPU + {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Debug|x64.Build.0 = Debug|Any CPU + {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Release|Any CPU.Build.0 = Release|Any CPU + {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Release|x64.ActiveCfg = Release|Any CPU + {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Release|x64.Build.0 = Release|Any CPU + {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Debug|x64.ActiveCfg = Debug|Any CPU + {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Debug|x64.Build.0 = Debug|Any CPU + {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Release|Any CPU.Build.0 = Release|Any CPU + {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Release|x64.ActiveCfg = Release|Any CPU + {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Release|x64.Build.0 = Release|Any CPU + {29071256-A255-4881-8BF7-63EA598313F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29071256-A255-4881-8BF7-63EA598313F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29071256-A255-4881-8BF7-63EA598313F8}.Debug|x64.ActiveCfg = Debug|Any CPU + {29071256-A255-4881-8BF7-63EA598313F8}.Debug|x64.Build.0 = Debug|Any CPU + {29071256-A255-4881-8BF7-63EA598313F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29071256-A255-4881-8BF7-63EA598313F8}.Release|Any CPU.Build.0 = Release|Any CPU + {29071256-A255-4881-8BF7-63EA598313F8}.Release|x64.ActiveCfg = Release|Any CPU + {29071256-A255-4881-8BF7-63EA598313F8}.Release|x64.Build.0 = Release|Any CPU + {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Debug|x64.ActiveCfg = Debug|Any CPU + {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Debug|x64.Build.0 = Debug|Any CPU + {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Release|Any CPU.Build.0 = Release|Any CPU + {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Release|x64.ActiveCfg = Release|Any CPU + {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Release|x64.Build.0 = Release|Any CPU + {747A2EBA-BF28-4153-BF03-3300DA570061}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {747A2EBA-BF28-4153-BF03-3300DA570061}.Debug|Any CPU.Build.0 = Debug|Any CPU + {747A2EBA-BF28-4153-BF03-3300DA570061}.Debug|x64.ActiveCfg = Debug|Any CPU + {747A2EBA-BF28-4153-BF03-3300DA570061}.Debug|x64.Build.0 = Debug|Any CPU + {747A2EBA-BF28-4153-BF03-3300DA570061}.Release|Any CPU.ActiveCfg = Release|Any CPU + {747A2EBA-BF28-4153-BF03-3300DA570061}.Release|Any CPU.Build.0 = Release|Any CPU + {747A2EBA-BF28-4153-BF03-3300DA570061}.Release|x64.ActiveCfg = Release|Any CPU + {747A2EBA-BF28-4153-BF03-3300DA570061}.Release|x64.Build.0 = Release|Any CPU + {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Debug|x64.ActiveCfg = Debug|Any CPU + {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Debug|x64.Build.0 = Debug|Any CPU + {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Release|Any CPU.Build.0 = Release|Any CPU + {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Release|x64.ActiveCfg = Release|Any CPU + {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Release|x64.Build.0 = Release|Any CPU + {6521511B-CE2E-485D-B72C-C22D89A191A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6521511B-CE2E-485D-B72C-C22D89A191A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6521511B-CE2E-485D-B72C-C22D89A191A2}.Debug|x64.ActiveCfg = Debug|Any CPU + {6521511B-CE2E-485D-B72C-C22D89A191A2}.Debug|x64.Build.0 = Debug|Any CPU + {6521511B-CE2E-485D-B72C-C22D89A191A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6521511B-CE2E-485D-B72C-C22D89A191A2}.Release|Any CPU.Build.0 = Release|Any CPU + {6521511B-CE2E-485D-B72C-C22D89A191A2}.Release|x64.ActiveCfg = Release|Any CPU + {6521511B-CE2E-485D-B72C-C22D89A191A2}.Release|x64.Build.0 = Release|Any CPU + {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Debug|x64.ActiveCfg = Debug|Any CPU + {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Debug|x64.Build.0 = Debug|Any CPU + {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Release|Any CPU.Build.0 = Release|Any CPU + {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Release|x64.ActiveCfg = Release|Any CPU + {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Release|x64.Build.0 = Release|Any CPU + {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Debug|x64.ActiveCfg = Debug|Any CPU + {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Debug|x64.Build.0 = Debug|Any CPU + {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Release|Any CPU.Build.0 = Release|Any CPU + {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Release|x64.ActiveCfg = Release|Any CPU + {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Release|x64.Build.0 = Release|Any CPU + {93510E80-4378-4504-A220-C71D0A61ADD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {93510E80-4378-4504-A220-C71D0A61ADD6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {93510E80-4378-4504-A220-C71D0A61ADD6}.Debug|x64.ActiveCfg = Debug|Any CPU + {93510E80-4378-4504-A220-C71D0A61ADD6}.Debug|x64.Build.0 = Debug|Any CPU + {93510E80-4378-4504-A220-C71D0A61ADD6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {93510E80-4378-4504-A220-C71D0A61ADD6}.Release|Any CPU.Build.0 = Release|Any CPU + {93510E80-4378-4504-A220-C71D0A61ADD6}.Release|x64.ActiveCfg = Release|Any CPU + {93510E80-4378-4504-A220-C71D0A61ADD6}.Release|x64.Build.0 = Release|Any CPU + {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Debug|x64.ActiveCfg = Debug|Any CPU + {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Debug|x64.Build.0 = Debug|Any CPU + {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Release|Any CPU.Build.0 = Release|Any CPU + {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Release|x64.ActiveCfg = Release|Any CPU + {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Release|x64.Build.0 = Release|Any CPU + {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Debug|x64.ActiveCfg = Debug|Any CPU + {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Debug|x64.Build.0 = Debug|Any CPU + {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Release|Any CPU.Build.0 = Release|Any CPU + {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Release|x64.ActiveCfg = Release|Any CPU + {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Release|x64.Build.0 = Release|Any CPU + {D66370B6-8E54-4E95-92CD-81236916A4D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D66370B6-8E54-4E95-92CD-81236916A4D1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D66370B6-8E54-4E95-92CD-81236916A4D1}.Debug|x64.ActiveCfg = Debug|Any CPU + {D66370B6-8E54-4E95-92CD-81236916A4D1}.Debug|x64.Build.0 = Debug|Any CPU + {D66370B6-8E54-4E95-92CD-81236916A4D1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D66370B6-8E54-4E95-92CD-81236916A4D1}.Release|Any CPU.Build.0 = Release|Any CPU + {D66370B6-8E54-4E95-92CD-81236916A4D1}.Release|x64.ActiveCfg = Release|Any CPU + {D66370B6-8E54-4E95-92CD-81236916A4D1}.Release|x64.Build.0 = Release|Any CPU + {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Debug|x64.ActiveCfg = Debug|Any CPU + {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Debug|x64.Build.0 = Debug|Any CPU + {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Release|Any CPU.Build.0 = Release|Any CPU + {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Release|x64.ActiveCfg = Release|Any CPU + {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Release|x64.Build.0 = Release|Any CPU + {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Debug|x64.ActiveCfg = Debug|Any CPU + {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Debug|x64.Build.0 = Debug|Any CPU + {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Release|Any CPU.Build.0 = Release|Any CPU + {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Release|x64.ActiveCfg = Release|Any CPU + {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Release|x64.Build.0 = Release|Any CPU + {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Debug|x64.ActiveCfg = Debug|Any CPU + {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Debug|x64.Build.0 = Debug|Any CPU + {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Release|Any CPU.Build.0 = Release|Any CPU + {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Release|x64.ActiveCfg = Release|Any CPU + {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Release|x64.Build.0 = Release|Any CPU + {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Debug|x64.ActiveCfg = Debug|Any CPU + {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Debug|x64.Build.0 = Debug|Any CPU + {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Release|Any CPU.Build.0 = Release|Any CPU + {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Release|x64.ActiveCfg = Release|Any CPU + {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Release|x64.Build.0 = Release|Any CPU + {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Debug|x64.ActiveCfg = Debug|Any CPU + {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Debug|x64.Build.0 = Debug|Any CPU + {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Release|Any CPU.Build.0 = Release|Any CPU + {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Release|x64.ActiveCfg = Release|Any CPU + {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Release|x64.Build.0 = Release|Any CPU + {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Debug|x64.ActiveCfg = Debug|Any CPU + {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Debug|x64.Build.0 = Debug|Any CPU + {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Release|Any CPU.Build.0 = Release|Any CPU + {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Release|x64.ActiveCfg = Release|Any CPU + {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Release|x64.Build.0 = Release|Any CPU + {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Debug|x64.ActiveCfg = Debug|Any CPU + {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Debug|x64.Build.0 = Debug|Any CPU + {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Release|Any CPU.Build.0 = Release|Any CPU + {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Release|x64.ActiveCfg = Release|Any CPU + {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Release|x64.Build.0 = Release|Any CPU + {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Debug|x64.ActiveCfg = Debug|Any CPU + {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Debug|x64.Build.0 = Debug|Any CPU + {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Release|Any CPU.Build.0 = Release|Any CPU + {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Release|x64.ActiveCfg = Release|Any CPU + {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Release|x64.Build.0 = Release|Any CPU + {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Debug|x64.ActiveCfg = Debug|Any CPU + {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Debug|x64.Build.0 = Debug|Any CPU + {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Release|Any CPU.Build.0 = Release|Any CPU + {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Release|x64.ActiveCfg = Release|Any CPU + {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Release|x64.Build.0 = Release|Any CPU + {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Debug|x64.Build.0 = Debug|Any CPU + {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Release|Any CPU.Build.0 = Release|Any CPU + {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Release|x64.ActiveCfg = Release|Any CPU + {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Release|x64.Build.0 = Release|Any CPU + {267429BB-FCFF-491B-B618-174DC3152EF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {267429BB-FCFF-491B-B618-174DC3152EF7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {267429BB-FCFF-491B-B618-174DC3152EF7}.Debug|x64.ActiveCfg = Debug|Any CPU + {267429BB-FCFF-491B-B618-174DC3152EF7}.Debug|x64.Build.0 = Debug|Any CPU + {267429BB-FCFF-491B-B618-174DC3152EF7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {267429BB-FCFF-491B-B618-174DC3152EF7}.Release|Any CPU.Build.0 = Release|Any CPU + {267429BB-FCFF-491B-B618-174DC3152EF7}.Release|x64.ActiveCfg = Release|Any CPU + {267429BB-FCFF-491B-B618-174DC3152EF7}.Release|x64.Build.0 = Release|Any CPU + {9F6F4116-8029-4788-9561-A0791EDFB720}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F6F4116-8029-4788-9561-A0791EDFB720}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F6F4116-8029-4788-9561-A0791EDFB720}.Debug|x64.ActiveCfg = Debug|Any CPU + {9F6F4116-8029-4788-9561-A0791EDFB720}.Debug|x64.Build.0 = Debug|Any CPU + {9F6F4116-8029-4788-9561-A0791EDFB720}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F6F4116-8029-4788-9561-A0791EDFB720}.Release|Any CPU.Build.0 = Release|Any CPU + {9F6F4116-8029-4788-9561-A0791EDFB720}.Release|x64.ActiveCfg = Release|Any CPU + {9F6F4116-8029-4788-9561-A0791EDFB720}.Release|x64.Build.0 = Release|Any CPU + {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Debug|x64.ActiveCfg = Debug|Any CPU + {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Debug|x64.Build.0 = Debug|Any CPU + {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Release|Any CPU.Build.0 = Release|Any CPU + {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Release|x64.ActiveCfg = Release|Any CPU + {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Release|x64.Build.0 = Release|Any CPU + {823B06D1-85E5-400B-885D-2B3CFD01487D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {823B06D1-85E5-400B-885D-2B3CFD01487D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {823B06D1-85E5-400B-885D-2B3CFD01487D}.Debug|x64.ActiveCfg = Debug|Any CPU + {823B06D1-85E5-400B-885D-2B3CFD01487D}.Debug|x64.Build.0 = Debug|Any CPU + {823B06D1-85E5-400B-885D-2B3CFD01487D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {823B06D1-85E5-400B-885D-2B3CFD01487D}.Release|Any CPU.Build.0 = Release|Any CPU + {823B06D1-85E5-400B-885D-2B3CFD01487D}.Release|x64.ActiveCfg = Release|Any CPU + {823B06D1-85E5-400B-885D-2B3CFD01487D}.Release|x64.Build.0 = Release|Any CPU + {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Debug|x64.ActiveCfg = Debug|Any CPU + {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Debug|x64.Build.0 = Debug|Any CPU + {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Release|Any CPU.Build.0 = Release|Any CPU + {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Release|x64.ActiveCfg = Release|Any CPU + {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Release|x64.Build.0 = Release|Any CPU + {74A8DA40-CB46-4B95-96DF-46A18090D987}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74A8DA40-CB46-4B95-96DF-46A18090D987}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74A8DA40-CB46-4B95-96DF-46A18090D987}.Debug|x64.ActiveCfg = Debug|Any CPU + {74A8DA40-CB46-4B95-96DF-46A18090D987}.Debug|x64.Build.0 = Debug|Any CPU + {74A8DA40-CB46-4B95-96DF-46A18090D987}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74A8DA40-CB46-4B95-96DF-46A18090D987}.Release|Any CPU.Build.0 = Release|Any CPU + {74A8DA40-CB46-4B95-96DF-46A18090D987}.Release|x64.ActiveCfg = Release|Any CPU + {74A8DA40-CB46-4B95-96DF-46A18090D987}.Release|x64.Build.0 = Release|Any CPU + {53562602-1F63-4B2C-8921-B5BB826984F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {53562602-1F63-4B2C-8921-B5BB826984F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {53562602-1F63-4B2C-8921-B5BB826984F8}.Debug|x64.ActiveCfg = Debug|Any CPU + {53562602-1F63-4B2C-8921-B5BB826984F8}.Debug|x64.Build.0 = Debug|Any CPU + {53562602-1F63-4B2C-8921-B5BB826984F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53562602-1F63-4B2C-8921-B5BB826984F8}.Release|Any CPU.Build.0 = Release|Any CPU + {53562602-1F63-4B2C-8921-B5BB826984F8}.Release|x64.ActiveCfg = Release|Any CPU + {53562602-1F63-4B2C-8921-B5BB826984F8}.Release|x64.Build.0 = Release|Any CPU + {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Debug|Any CPU.Build.0 = Debug|Any CPU + {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Debug|x64.ActiveCfg = Debug|Any CPU + {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Debug|x64.Build.0 = Debug|Any CPU + {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Release|Any CPU.ActiveCfg = Release|Any CPU + {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Release|Any CPU.Build.0 = Release|Any CPU + {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Release|x64.ActiveCfg = Release|Any CPU + {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Release|x64.Build.0 = Release|Any CPU + {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Debug|x64.ActiveCfg = Debug|Any CPU + {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Debug|x64.Build.0 = Debug|Any CPU + {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Release|Any CPU.Build.0 = Release|Any CPU + {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Release|x64.ActiveCfg = Release|Any CPU + {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Release|x64.Build.0 = Release|Any CPU + {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Debug|x64.ActiveCfg = Debug|Any CPU + {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Debug|x64.Build.0 = Debug|Any CPU + {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Release|Any CPU.Build.0 = Release|Any CPU + {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Release|x64.ActiveCfg = Release|Any CPU + {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Release|x64.Build.0 = Release|Any CPU + {B2465420-C899-4077-B6D3-B62405D5BFE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B2465420-C899-4077-B6D3-B62405D5BFE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B2465420-C899-4077-B6D3-B62405D5BFE2}.Debug|x64.ActiveCfg = Debug|Any CPU + {B2465420-C899-4077-B6D3-B62405D5BFE2}.Debug|x64.Build.0 = Debug|Any CPU + {B2465420-C899-4077-B6D3-B62405D5BFE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B2465420-C899-4077-B6D3-B62405D5BFE2}.Release|Any CPU.Build.0 = Release|Any CPU + {B2465420-C899-4077-B6D3-B62405D5BFE2}.Release|x64.ActiveCfg = Release|Any CPU + {B2465420-C899-4077-B6D3-B62405D5BFE2}.Release|x64.Build.0 = Release|Any CPU + {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Debug|x64.ActiveCfg = Debug|Any CPU + {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Debug|x64.Build.0 = Debug|Any CPU + {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Release|Any CPU.Build.0 = Release|Any CPU + {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Release|x64.ActiveCfg = Release|Any CPU + {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Release|x64.Build.0 = Release|Any CPU + {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Debug|x64.ActiveCfg = Debug|Any CPU + {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Debug|x64.Build.0 = Debug|Any CPU + {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Release|Any CPU.Build.0 = Release|Any CPU + {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Release|x64.ActiveCfg = Release|Any CPU + {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Release|x64.Build.0 = Release|Any CPU + {E624718C-38CD-41AA-BBA0-415008BE86BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E624718C-38CD-41AA-BBA0-415008BE86BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E624718C-38CD-41AA-BBA0-415008BE86BF}.Debug|x64.ActiveCfg = Debug|Any CPU + {E624718C-38CD-41AA-BBA0-415008BE86BF}.Debug|x64.Build.0 = Debug|Any CPU + {E624718C-38CD-41AA-BBA0-415008BE86BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E624718C-38CD-41AA-BBA0-415008BE86BF}.Release|Any CPU.Build.0 = Release|Any CPU + {E624718C-38CD-41AA-BBA0-415008BE86BF}.Release|x64.ActiveCfg = Release|Any CPU + {E624718C-38CD-41AA-BBA0-415008BE86BF}.Release|x64.Build.0 = Release|Any CPU + {3F2A0172-118E-439E-BD4A-5E0F95361838}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F2A0172-118E-439E-BD4A-5E0F95361838}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F2A0172-118E-439E-BD4A-5E0F95361838}.Debug|x64.ActiveCfg = Debug|Any CPU + {3F2A0172-118E-439E-BD4A-5E0F95361838}.Debug|x64.Build.0 = Debug|Any CPU + {3F2A0172-118E-439E-BD4A-5E0F95361838}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F2A0172-118E-439E-BD4A-5E0F95361838}.Release|Any CPU.Build.0 = Release|Any CPU + {3F2A0172-118E-439E-BD4A-5E0F95361838}.Release|x64.ActiveCfg = Release|Any CPU + {3F2A0172-118E-439E-BD4A-5E0F95361838}.Release|x64.Build.0 = Release|Any CPU + {9D295FC2-32A9-487A-BAE3-348F6360729D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9D295FC2-32A9-487A-BAE3-348F6360729D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9D295FC2-32A9-487A-BAE3-348F6360729D}.Debug|x64.ActiveCfg = Debug|Any CPU + {9D295FC2-32A9-487A-BAE3-348F6360729D}.Debug|x64.Build.0 = Debug|Any CPU + {9D295FC2-32A9-487A-BAE3-348F6360729D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D295FC2-32A9-487A-BAE3-348F6360729D}.Release|Any CPU.Build.0 = Release|Any CPU + {9D295FC2-32A9-487A-BAE3-348F6360729D}.Release|x64.ActiveCfg = Release|Any CPU + {9D295FC2-32A9-487A-BAE3-348F6360729D}.Release|x64.Build.0 = Release|Any CPU + {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Debug|x64.ActiveCfg = Debug|Any CPU + {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Debug|x64.Build.0 = Debug|Any CPU + {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Release|Any CPU.Build.0 = Release|Any CPU + {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Release|x64.ActiveCfg = Release|Any CPU + {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Release|x64.Build.0 = Release|Any CPU + {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Debug|x64.ActiveCfg = Debug|Any CPU + {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Debug|x64.Build.0 = Debug|Any CPU + {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Release|Any CPU.Build.0 = Release|Any CPU + {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Release|x64.ActiveCfg = Release|Any CPU + {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Release|x64.Build.0 = Release|Any CPU + {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Debug|x64.ActiveCfg = Debug|Any CPU + {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Debug|x64.Build.0 = Debug|Any CPU + {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Release|Any CPU.Build.0 = Release|Any CPU + {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Release|x64.ActiveCfg = Release|Any CPU + {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Release|x64.Build.0 = Release|Any CPU + {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Debug|x64.ActiveCfg = Debug|Any CPU + {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Debug|x64.Build.0 = Debug|Any CPU + {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Release|Any CPU.Build.0 = Release|Any CPU + {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Release|x64.ActiveCfg = Release|Any CPU + {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Release|x64.Build.0 = Release|Any CPU + {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Debug|x64.ActiveCfg = Debug|Any CPU + {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Debug|x64.Build.0 = Debug|Any CPU + {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Release|Any CPU.Build.0 = Release|Any CPU + {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Release|x64.ActiveCfg = Release|Any CPU + {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Release|x64.Build.0 = Release|Any CPU + {B469E3EE-637F-4A0A-852D-6A33F896B906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B469E3EE-637F-4A0A-852D-6A33F896B906}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B469E3EE-637F-4A0A-852D-6A33F896B906}.Debug|x64.ActiveCfg = Debug|Any CPU + {B469E3EE-637F-4A0A-852D-6A33F896B906}.Debug|x64.Build.0 = Debug|Any CPU + {B469E3EE-637F-4A0A-852D-6A33F896B906}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B469E3EE-637F-4A0A-852D-6A33F896B906}.Release|Any CPU.Build.0 = Release|Any CPU + {B469E3EE-637F-4A0A-852D-6A33F896B906}.Release|x64.ActiveCfg = Release|Any CPU + {B469E3EE-637F-4A0A-852D-6A33F896B906}.Release|x64.Build.0 = Release|Any CPU + {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Debug|x64.ActiveCfg = Debug|Any CPU + {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Debug|x64.Build.0 = Debug|Any CPU + {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Release|Any CPU.Build.0 = Release|Any CPU + {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Release|x64.ActiveCfg = Release|Any CPU + {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Release|x64.Build.0 = Release|Any CPU + {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Debug|x64.ActiveCfg = Debug|Any CPU + {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Debug|x64.Build.0 = Debug|Any CPU + {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Release|Any CPU.Build.0 = Release|Any CPU + {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Release|x64.ActiveCfg = Release|Any CPU + {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Release|x64.Build.0 = Release|Any CPU + {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Debug|x64.ActiveCfg = Debug|Any CPU + {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Debug|x64.Build.0 = Debug|Any CPU + {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Release|Any CPU.Build.0 = Release|Any CPU + {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Release|x64.ActiveCfg = Release|Any CPU + {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Release|x64.Build.0 = Release|Any CPU + {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Debug|x64.ActiveCfg = Debug|Any CPU + {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Debug|x64.Build.0 = Debug|Any CPU + {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Release|Any CPU.Build.0 = Release|Any CPU + {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Release|x64.ActiveCfg = Release|Any CPU + {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Release|x64.Build.0 = Release|Any CPU + {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Debug|x64.ActiveCfg = Debug|Any CPU + {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Debug|x64.Build.0 = Debug|Any CPU + {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Release|Any CPU.Build.0 = Release|Any CPU + {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Release|x64.ActiveCfg = Release|Any CPU + {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Release|x64.Build.0 = Release|Any CPU + {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Debug|x64.ActiveCfg = Debug|Any CPU + {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Debug|x64.Build.0 = Debug|Any CPU + {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Release|Any CPU.Build.0 = Release|Any CPU + {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Release|x64.ActiveCfg = Release|Any CPU + {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Release|x64.Build.0 = Release|Any CPU + {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Debug|x64.ActiveCfg = Debug|Any CPU + {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Debug|x64.Build.0 = Debug|Any CPU + {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Release|Any CPU.Build.0 = Release|Any CPU + {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Release|x64.ActiveCfg = Release|Any CPU + {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Release|x64.Build.0 = Release|Any CPU + {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Debug|x64.ActiveCfg = Debug|Any CPU + {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Debug|x64.Build.0 = Debug|Any CPU + {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Release|Any CPU.Build.0 = Release|Any CPU + {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Release|x64.ActiveCfg = Release|Any CPU + {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Release|x64.Build.0 = Release|Any CPU + {D7D46284-47DF-488A-8D04-421CBAAF6943}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7D46284-47DF-488A-8D04-421CBAAF6943}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7D46284-47DF-488A-8D04-421CBAAF6943}.Debug|x64.ActiveCfg = Debug|Any CPU + {D7D46284-47DF-488A-8D04-421CBAAF6943}.Debug|x64.Build.0 = Debug|Any CPU + {D7D46284-47DF-488A-8D04-421CBAAF6943}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7D46284-47DF-488A-8D04-421CBAAF6943}.Release|Any CPU.Build.0 = Release|Any CPU + {D7D46284-47DF-488A-8D04-421CBAAF6943}.Release|x64.ActiveCfg = Release|Any CPU + {D7D46284-47DF-488A-8D04-421CBAAF6943}.Release|x64.Build.0 = Release|Any CPU + {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Debug|x64.ActiveCfg = Debug|Any CPU + {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Debug|x64.Build.0 = Debug|Any CPU + {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Release|Any CPU.Build.0 = Release|Any CPU + {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Release|x64.ActiveCfg = Release|Any CPU + {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Release|x64.Build.0 = Release|Any CPU + {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Debug|x64.ActiveCfg = Debug|Any CPU + {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Debug|x64.Build.0 = Debug|Any CPU + {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Release|Any CPU.Build.0 = Release|Any CPU + {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Release|x64.ActiveCfg = Release|Any CPU + {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Release|x64.Build.0 = Release|Any CPU + {1226DCD2-D128-4976-8806-2A369F87058B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1226DCD2-D128-4976-8806-2A369F87058B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1226DCD2-D128-4976-8806-2A369F87058B}.Debug|x64.ActiveCfg = Debug|Any CPU + {1226DCD2-D128-4976-8806-2A369F87058B}.Debug|x64.Build.0 = Debug|Any CPU + {1226DCD2-D128-4976-8806-2A369F87058B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1226DCD2-D128-4976-8806-2A369F87058B}.Release|Any CPU.Build.0 = Release|Any CPU + {1226DCD2-D128-4976-8806-2A369F87058B}.Release|x64.ActiveCfg = Release|Any CPU + {1226DCD2-D128-4976-8806-2A369F87058B}.Release|x64.Build.0 = Release|Any CPU + {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Debug|x64.ActiveCfg = Debug|Any CPU + {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Debug|x64.Build.0 = Debug|Any CPU + {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Release|Any CPU.Build.0 = Release|Any CPU + {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Release|x64.ActiveCfg = Release|Any CPU + {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Release|x64.Build.0 = Release|Any CPU + {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Debug|x64.ActiveCfg = Debug|Any CPU + {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Debug|x64.Build.0 = Debug|Any CPU + {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Release|Any CPU.Build.0 = Release|Any CPU + {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Release|x64.ActiveCfg = Release|Any CPU + {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Release|x64.Build.0 = Release|Any CPU + {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Debug|x64.ActiveCfg = Debug|Any CPU + {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Debug|x64.Build.0 = Debug|Any CPU + {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Release|Any CPU.Build.0 = Release|Any CPU + {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Release|x64.ActiveCfg = Release|Any CPU + {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Release|x64.Build.0 = Release|Any CPU + {6E74144B-0816-4161-AACC-8C696E0E9C34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E74144B-0816-4161-AACC-8C696E0E9C34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E74144B-0816-4161-AACC-8C696E0E9C34}.Debug|x64.ActiveCfg = Debug|Any CPU + {6E74144B-0816-4161-AACC-8C696E0E9C34}.Debug|x64.Build.0 = Debug|Any CPU + {6E74144B-0816-4161-AACC-8C696E0E9C34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E74144B-0816-4161-AACC-8C696E0E9C34}.Release|Any CPU.Build.0 = Release|Any CPU + {6E74144B-0816-4161-AACC-8C696E0E9C34}.Release|x64.ActiveCfg = Release|Any CPU + {6E74144B-0816-4161-AACC-8C696E0E9C34}.Release|x64.Build.0 = Release|Any CPU + {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Debug|x64.ActiveCfg = Debug|Any CPU + {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Debug|x64.Build.0 = Debug|Any CPU + {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Release|Any CPU.Build.0 = Release|Any CPU + {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Release|x64.ActiveCfg = Release|Any CPU + {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Release|x64.Build.0 = Release|Any CPU + {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Debug|x64.ActiveCfg = Debug|Any CPU + {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Debug|x64.Build.0 = Debug|Any CPU + {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Release|Any CPU.Build.0 = Release|Any CPU + {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Release|x64.ActiveCfg = Release|Any CPU + {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Release|x64.Build.0 = Release|Any CPU + {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Debug|x64.ActiveCfg = Debug|Any CPU + {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Debug|x64.Build.0 = Debug|Any CPU + {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Release|Any CPU.Build.0 = Release|Any CPU + {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Release|x64.ActiveCfg = Release|Any CPU + {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Release|x64.Build.0 = Release|Any CPU + {3735BFA1-F935-42EF-A316-BEEF0A138781}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3735BFA1-F935-42EF-A316-BEEF0A138781}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3735BFA1-F935-42EF-A316-BEEF0A138781}.Debug|x64.ActiveCfg = Debug|Any CPU + {3735BFA1-F935-42EF-A316-BEEF0A138781}.Debug|x64.Build.0 = Debug|Any CPU + {3735BFA1-F935-42EF-A316-BEEF0A138781}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3735BFA1-F935-42EF-A316-BEEF0A138781}.Release|Any CPU.Build.0 = Release|Any CPU + {3735BFA1-F935-42EF-A316-BEEF0A138781}.Release|x64.ActiveCfg = Release|Any CPU + {3735BFA1-F935-42EF-A316-BEEF0A138781}.Release|x64.Build.0 = Release|Any CPU + {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Debug|x64.ActiveCfg = Debug|Any CPU + {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Debug|x64.Build.0 = Debug|Any CPU + {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Release|Any CPU.Build.0 = Release|Any CPU + {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Release|x64.ActiveCfg = Release|Any CPU + {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Release|x64.Build.0 = Release|Any CPU + {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Debug|Any CPU.Build.0 = Debug|Any CPU + {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Debug|x64.ActiveCfg = Debug|Any CPU + {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Debug|x64.Build.0 = Debug|Any CPU + {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Release|Any CPU.ActiveCfg = Release|Any CPU + {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Release|Any CPU.Build.0 = Release|Any CPU + {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Release|x64.ActiveCfg = Release|Any CPU + {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Release|x64.Build.0 = Release|Any CPU + {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Debug|x64.ActiveCfg = Debug|Any CPU + {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Debug|x64.Build.0 = Debug|Any CPU + {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Release|Any CPU.Build.0 = Release|Any CPU + {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Release|x64.ActiveCfg = Release|Any CPU + {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Release|x64.Build.0 = Release|Any CPU + {1BC59353-A6FF-4C0C-9B47-37884621E228}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1BC59353-A6FF-4C0C-9B47-37884621E228}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1BC59353-A6FF-4C0C-9B47-37884621E228}.Debug|x64.ActiveCfg = Debug|Any CPU + {1BC59353-A6FF-4C0C-9B47-37884621E228}.Debug|x64.Build.0 = Debug|Any CPU + {1BC59353-A6FF-4C0C-9B47-37884621E228}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1BC59353-A6FF-4C0C-9B47-37884621E228}.Release|Any CPU.Build.0 = Release|Any CPU + {1BC59353-A6FF-4C0C-9B47-37884621E228}.Release|x64.ActiveCfg = Release|Any CPU + {1BC59353-A6FF-4C0C-9B47-37884621E228}.Release|x64.Build.0 = Release|Any CPU + {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Debug|x64.ActiveCfg = Debug|Any CPU + {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Debug|x64.Build.0 = Debug|Any CPU + {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Release|Any CPU.Build.0 = Release|Any CPU + {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Release|x64.ActiveCfg = Release|Any CPU + {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Release|x64.Build.0 = Release|Any CPU + {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Debug|x64.ActiveCfg = Debug|Any CPU + {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Debug|x64.Build.0 = Debug|Any CPU + {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Release|Any CPU.Build.0 = Release|Any CPU + {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Release|x64.ActiveCfg = Release|Any CPU + {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Release|x64.Build.0 = Release|Any CPU + {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Debug|x64.ActiveCfg = Debug|Any CPU + {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Debug|x64.Build.0 = Debug|Any CPU + {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Release|Any CPU.Build.0 = Release|Any CPU + {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Release|x64.ActiveCfg = Release|Any CPU + {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Release|x64.Build.0 = Release|Any CPU + {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Debug|x64.ActiveCfg = Debug|Any CPU + {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Debug|x64.Build.0 = Debug|Any CPU + {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Release|Any CPU.Build.0 = Release|Any CPU + {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Release|x64.ActiveCfg = Release|Any CPU + {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Release|x64.Build.0 = Release|Any CPU + {885CDA4A-9831-4159-A0A7-9062CF93180A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {885CDA4A-9831-4159-A0A7-9062CF93180A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {885CDA4A-9831-4159-A0A7-9062CF93180A}.Debug|x64.ActiveCfg = Debug|Any CPU + {885CDA4A-9831-4159-A0A7-9062CF93180A}.Debug|x64.Build.0 = Debug|Any CPU + {885CDA4A-9831-4159-A0A7-9062CF93180A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {885CDA4A-9831-4159-A0A7-9062CF93180A}.Release|Any CPU.Build.0 = Release|Any CPU + {885CDA4A-9831-4159-A0A7-9062CF93180A}.Release|x64.ActiveCfg = Release|Any CPU + {885CDA4A-9831-4159-A0A7-9062CF93180A}.Release|x64.Build.0 = Release|Any CPU + {60A51206-8F7F-4F43-B473-006F0DB380CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60A51206-8F7F-4F43-B473-006F0DB380CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60A51206-8F7F-4F43-B473-006F0DB380CB}.Debug|x64.ActiveCfg = Debug|Any CPU + {60A51206-8F7F-4F43-B473-006F0DB380CB}.Debug|x64.Build.0 = Debug|Any CPU + {60A51206-8F7F-4F43-B473-006F0DB380CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60A51206-8F7F-4F43-B473-006F0DB380CB}.Release|Any CPU.Build.0 = Release|Any CPU + {60A51206-8F7F-4F43-B473-006F0DB380CB}.Release|x64.ActiveCfg = Release|Any CPU + {60A51206-8F7F-4F43-B473-006F0DB380CB}.Release|x64.Build.0 = Release|Any CPU + {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Debug|x64.ActiveCfg = Debug|Any CPU + {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Debug|x64.Build.0 = Debug|Any CPU + {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Release|Any CPU.Build.0 = Release|Any CPU + {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Release|x64.ActiveCfg = Release|Any CPU + {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Release|x64.Build.0 = Release|Any CPU + {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Debug|x64.ActiveCfg = Debug|Any CPU + {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Debug|x64.Build.0 = Debug|Any CPU + {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Release|Any CPU.Build.0 = Release|Any CPU + {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Release|x64.ActiveCfg = Release|Any CPU + {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Release|x64.Build.0 = Release|Any CPU + {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Debug|x64.ActiveCfg = Debug|Any CPU + {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Debug|x64.Build.0 = Debug|Any CPU + {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Release|Any CPU.Build.0 = Release|Any CPU + {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Release|x64.ActiveCfg = Release|Any CPU + {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Release|x64.Build.0 = Release|Any CPU + {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Debug|x64.ActiveCfg = Debug|Any CPU + {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Debug|x64.Build.0 = Debug|Any CPU + {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Release|Any CPU.Build.0 = Release|Any CPU + {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Release|x64.ActiveCfg = Release|Any CPU + {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Release|x64.Build.0 = Release|Any CPU + {9A15A065-8559-49E2-8818-9E8A9186A105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A15A065-8559-49E2-8818-9E8A9186A105}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A15A065-8559-49E2-8818-9E8A9186A105}.Debug|x64.ActiveCfg = Debug|Any CPU + {9A15A065-8559-49E2-8818-9E8A9186A105}.Debug|x64.Build.0 = Debug|Any CPU + {9A15A065-8559-49E2-8818-9E8A9186A105}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A15A065-8559-49E2-8818-9E8A9186A105}.Release|Any CPU.Build.0 = Release|Any CPU + {9A15A065-8559-49E2-8818-9E8A9186A105}.Release|x64.ActiveCfg = Release|Any CPU + {9A15A065-8559-49E2-8818-9E8A9186A105}.Release|x64.Build.0 = Release|Any CPU + {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Debug|x64.ActiveCfg = Debug|Any CPU + {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Debug|x64.Build.0 = Debug|Any CPU + {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Release|Any CPU.Build.0 = Release|Any CPU + {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Release|x64.ActiveCfg = Release|Any CPU + {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Release|x64.Build.0 = Release|Any CPU + {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Debug|x64.ActiveCfg = Debug|Any CPU + {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Debug|x64.Build.0 = Debug|Any CPU + {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Release|Any CPU.Build.0 = Release|Any CPU + {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Release|x64.ActiveCfg = Release|Any CPU + {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Release|x64.Build.0 = Release|Any CPU + {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Debug|x64.ActiveCfg = Debug|Any CPU + {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Debug|x64.Build.0 = Debug|Any CPU + {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Release|Any CPU.Build.0 = Release|Any CPU + {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Release|x64.ActiveCfg = Release|Any CPU + {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Release|x64.Build.0 = Release|Any CPU + {1EF70F79-B605-4729-99E7-E85386AAC649}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1EF70F79-B605-4729-99E7-E85386AAC649}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1EF70F79-B605-4729-99E7-E85386AAC649}.Debug|x64.ActiveCfg = Debug|Any CPU + {1EF70F79-B605-4729-99E7-E85386AAC649}.Debug|x64.Build.0 = Debug|Any CPU + {1EF70F79-B605-4729-99E7-E85386AAC649}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1EF70F79-B605-4729-99E7-E85386AAC649}.Release|Any CPU.Build.0 = Release|Any CPU + {1EF70F79-B605-4729-99E7-E85386AAC649}.Release|x64.ActiveCfg = Release|Any CPU + {1EF70F79-B605-4729-99E7-E85386AAC649}.Release|x64.Build.0 = Release|Any CPU + {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Debug|x64.ActiveCfg = Debug|Any CPU + {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Debug|x64.Build.0 = Debug|Any CPU + {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Release|Any CPU.Build.0 = Release|Any CPU + {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Release|x64.ActiveCfg = Release|Any CPU + {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Release|x64.Build.0 = Release|Any CPU + {6C1A8E47-8391-416B-9407-2A1F97A62776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C1A8E47-8391-416B-9407-2A1F97A62776}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C1A8E47-8391-416B-9407-2A1F97A62776}.Debug|x64.ActiveCfg = Debug|Any CPU + {6C1A8E47-8391-416B-9407-2A1F97A62776}.Debug|x64.Build.0 = Debug|Any CPU + {6C1A8E47-8391-416B-9407-2A1F97A62776}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6C1A8E47-8391-416B-9407-2A1F97A62776}.Release|Any CPU.Build.0 = Release|Any CPU + {6C1A8E47-8391-416B-9407-2A1F97A62776}.Release|x64.ActiveCfg = Release|Any CPU + {6C1A8E47-8391-416B-9407-2A1F97A62776}.Release|x64.Build.0 = Release|Any CPU + {E7A282E3-CC87-48C9-A80B-664A5390C715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E7A282E3-CC87-48C9-A80B-664A5390C715}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E7A282E3-CC87-48C9-A80B-664A5390C715}.Debug|x64.ActiveCfg = Debug|Any CPU + {E7A282E3-CC87-48C9-A80B-664A5390C715}.Debug|x64.Build.0 = Debug|Any CPU + {E7A282E3-CC87-48C9-A80B-664A5390C715}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E7A282E3-CC87-48C9-A80B-664A5390C715}.Release|Any CPU.Build.0 = Release|Any CPU + {E7A282E3-CC87-48C9-A80B-664A5390C715}.Release|x64.ActiveCfg = Release|Any CPU + {E7A282E3-CC87-48C9-A80B-664A5390C715}.Release|x64.Build.0 = Release|Any CPU + {D3B70875-76B0-4F48-9798-4A700E4902E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3B70875-76B0-4F48-9798-4A700E4902E5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3B70875-76B0-4F48-9798-4A700E4902E5}.Debug|x64.ActiveCfg = Debug|Any CPU + {D3B70875-76B0-4F48-9798-4A700E4902E5}.Debug|x64.Build.0 = Debug|Any CPU + {D3B70875-76B0-4F48-9798-4A700E4902E5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3B70875-76B0-4F48-9798-4A700E4902E5}.Release|Any CPU.Build.0 = Release|Any CPU + {D3B70875-76B0-4F48-9798-4A700E4902E5}.Release|x64.ActiveCfg = Release|Any CPU + {D3B70875-76B0-4F48-9798-4A700E4902E5}.Release|x64.Build.0 = Release|Any CPU + {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Debug|x64.ActiveCfg = Debug|Any CPU + {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Debug|x64.Build.0 = Debug|Any CPU + {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Release|Any CPU.Build.0 = Release|Any CPU + {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Release|x64.ActiveCfg = Release|Any CPU + {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Release|x64.Build.0 = Release|Any CPU + {0665C217-CDF0-4153-93DA-886230CB19CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0665C217-CDF0-4153-93DA-886230CB19CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0665C217-CDF0-4153-93DA-886230CB19CF}.Debug|x64.ActiveCfg = Debug|Any CPU + {0665C217-CDF0-4153-93DA-886230CB19CF}.Debug|x64.Build.0 = Debug|Any CPU + {0665C217-CDF0-4153-93DA-886230CB19CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0665C217-CDF0-4153-93DA-886230CB19CF}.Release|Any CPU.Build.0 = Release|Any CPU + {0665C217-CDF0-4153-93DA-886230CB19CF}.Release|x64.ActiveCfg = Release|Any CPU + {0665C217-CDF0-4153-93DA-886230CB19CF}.Release|x64.Build.0 = Release|Any CPU + {88A46A64-0877-44BB-87FB-C3A046104A17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88A46A64-0877-44BB-87FB-C3A046104A17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88A46A64-0877-44BB-87FB-C3A046104A17}.Debug|x64.ActiveCfg = Debug|Any CPU + {88A46A64-0877-44BB-87FB-C3A046104A17}.Debug|x64.Build.0 = Debug|Any CPU + {88A46A64-0877-44BB-87FB-C3A046104A17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88A46A64-0877-44BB-87FB-C3A046104A17}.Release|Any CPU.Build.0 = Release|Any CPU + {88A46A64-0877-44BB-87FB-C3A046104A17}.Release|x64.ActiveCfg = Release|Any CPU + {88A46A64-0877-44BB-87FB-C3A046104A17}.Release|x64.Build.0 = Release|Any CPU + {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Debug|x64.ActiveCfg = Debug|Any CPU + {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Debug|x64.Build.0 = Debug|Any CPU + {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Release|Any CPU.Build.0 = Release|Any CPU + {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Release|x64.ActiveCfg = Release|Any CPU + {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Release|x64.Build.0 = Release|Any CPU + {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Debug|x64.ActiveCfg = Debug|Any CPU + {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Debug|x64.Build.0 = Debug|Any CPU + {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Release|Any CPU.Build.0 = Release|Any CPU + {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Release|x64.ActiveCfg = Release|Any CPU + {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Release|x64.Build.0 = Release|Any CPU + {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Debug|x64.ActiveCfg = Debug|Any CPU + {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Debug|x64.Build.0 = Debug|Any CPU + {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Release|Any CPU.Build.0 = Release|Any CPU + {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Release|x64.ActiveCfg = Release|Any CPU + {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Release|x64.Build.0 = Release|Any CPU + {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Debug|x64.ActiveCfg = Debug|Any CPU + {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Debug|x64.Build.0 = Debug|Any CPU + {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Release|Any CPU.Build.0 = Release|Any CPU + {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Release|x64.ActiveCfg = Release|Any CPU + {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Release|x64.Build.0 = Release|Any CPU + {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Debug|x64.ActiveCfg = Debug|Any CPU + {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Debug|x64.Build.0 = Debug|Any CPU + {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Release|Any CPU.Build.0 = Release|Any CPU + {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Release|x64.ActiveCfg = Release|Any CPU + {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Release|x64.Build.0 = Release|Any CPU + {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Debug|Any CPU.Build.0 = Debug|Any CPU + {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Debug|x64.ActiveCfg = Debug|Any CPU + {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Debug|x64.Build.0 = Debug|Any CPU + {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Release|Any CPU.ActiveCfg = Release|Any CPU + {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Release|Any CPU.Build.0 = Release|Any CPU + {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Release|x64.ActiveCfg = Release|Any CPU + {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Release|x64.Build.0 = Release|Any CPU + {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Debug|x64.ActiveCfg = Debug|Any CPU + {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Debug|x64.Build.0 = Debug|Any CPU + {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Release|Any CPU.Build.0 = Release|Any CPU + {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Release|x64.ActiveCfg = Release|Any CPU + {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Release|x64.Build.0 = Release|Any CPU + {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Debug|x64.ActiveCfg = Debug|Any CPU + {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Debug|x64.Build.0 = Debug|Any CPU + {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Release|Any CPU.Build.0 = Release|Any CPU + {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Release|x64.ActiveCfg = Release|Any CPU + {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Release|x64.Build.0 = Release|Any CPU + {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Debug|x64.ActiveCfg = Debug|Any CPU + {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Debug|x64.Build.0 = Debug|Any CPU + {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Release|Any CPU.Build.0 = Release|Any CPU + {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Release|x64.ActiveCfg = Release|Any CPU + {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Release|x64.Build.0 = Release|Any CPU + {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Debug|x64.ActiveCfg = Debug|Any CPU + {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Debug|x64.Build.0 = Debug|Any CPU + {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Release|Any CPU.Build.0 = Release|Any CPU + {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Release|x64.ActiveCfg = Release|Any CPU + {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Release|x64.Build.0 = Release|Any CPU + {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Debug|x64.ActiveCfg = Debug|Any CPU + {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Debug|x64.Build.0 = Debug|Any CPU + {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Release|Any CPU.Build.0 = Release|Any CPU + {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Release|x64.ActiveCfg = Release|Any CPU + {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Release|x64.Build.0 = Release|Any CPU + {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Debug|x64.ActiveCfg = Debug|Any CPU + {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Debug|x64.Build.0 = Debug|Any CPU + {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Release|Any CPU.Build.0 = Release|Any CPU + {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Release|x64.ActiveCfg = Release|Any CPU + {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Release|x64.Build.0 = Release|Any CPU + {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Debug|x64.ActiveCfg = Debug|Any CPU + {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Debug|x64.Build.0 = Debug|Any CPU + {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Release|Any CPU.Build.0 = Release|Any CPU + {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Release|x64.ActiveCfg = Release|Any CPU + {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Release|x64.Build.0 = Release|Any CPU + {4BEEE39F-0760-434F-9389-6194037781DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4BEEE39F-0760-434F-9389-6194037781DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4BEEE39F-0760-434F-9389-6194037781DE}.Debug|x64.ActiveCfg = Debug|Any CPU + {4BEEE39F-0760-434F-9389-6194037781DE}.Debug|x64.Build.0 = Debug|Any CPU + {4BEEE39F-0760-434F-9389-6194037781DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4BEEE39F-0760-434F-9389-6194037781DE}.Release|Any CPU.Build.0 = Release|Any CPU + {4BEEE39F-0760-434F-9389-6194037781DE}.Release|x64.ActiveCfg = Release|Any CPU + {4BEEE39F-0760-434F-9389-6194037781DE}.Release|x64.Build.0 = Release|Any CPU + {F201EB09-2EE2-4203-A829-044C7EC2D112}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F201EB09-2EE2-4203-A829-044C7EC2D112}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F201EB09-2EE2-4203-A829-044C7EC2D112}.Debug|x64.ActiveCfg = Debug|Any CPU + {F201EB09-2EE2-4203-A829-044C7EC2D112}.Debug|x64.Build.0 = Debug|Any CPU + {F201EB09-2EE2-4203-A829-044C7EC2D112}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F201EB09-2EE2-4203-A829-044C7EC2D112}.Release|Any CPU.Build.0 = Release|Any CPU + {F201EB09-2EE2-4203-A829-044C7EC2D112}.Release|x64.ActiveCfg = Release|Any CPU + {F201EB09-2EE2-4203-A829-044C7EC2D112}.Release|x64.Build.0 = Release|Any CPU + {77466E5C-4DF7-4C7C-B251-689052D51B38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77466E5C-4DF7-4C7C-B251-689052D51B38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77466E5C-4DF7-4C7C-B251-689052D51B38}.Debug|x64.ActiveCfg = Debug|Any CPU + {77466E5C-4DF7-4C7C-B251-689052D51B38}.Debug|x64.Build.0 = Debug|Any CPU + {77466E5C-4DF7-4C7C-B251-689052D51B38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77466E5C-4DF7-4C7C-B251-689052D51B38}.Release|Any CPU.Build.0 = Release|Any CPU + {77466E5C-4DF7-4C7C-B251-689052D51B38}.Release|x64.ActiveCfg = Release|Any CPU + {77466E5C-4DF7-4C7C-B251-689052D51B38}.Release|x64.Build.0 = Release|Any CPU + {C650E615-4FAD-4CA9-B81C-3CF461805005}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C650E615-4FAD-4CA9-B81C-3CF461805005}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C650E615-4FAD-4CA9-B81C-3CF461805005}.Debug|x64.ActiveCfg = Debug|Any CPU + {C650E615-4FAD-4CA9-B81C-3CF461805005}.Debug|x64.Build.0 = Debug|Any CPU + {C650E615-4FAD-4CA9-B81C-3CF461805005}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C650E615-4FAD-4CA9-B81C-3CF461805005}.Release|Any CPU.Build.0 = Release|Any CPU + {C650E615-4FAD-4CA9-B81C-3CF461805005}.Release|x64.ActiveCfg = Release|Any CPU + {C650E615-4FAD-4CA9-B81C-3CF461805005}.Release|x64.Build.0 = Release|Any CPU + {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Debug|x64.ActiveCfg = Debug|Any CPU + {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Debug|x64.Build.0 = Debug|Any CPU + {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Release|Any CPU.Build.0 = Release|Any CPU + {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Release|x64.ActiveCfg = Release|Any CPU + {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Release|x64.Build.0 = Release|Any CPU + {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Debug|x64.ActiveCfg = Debug|Any CPU + {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Debug|x64.Build.0 = Debug|Any CPU + {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Release|Any CPU.Build.0 = Release|Any CPU + {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Release|x64.ActiveCfg = Release|Any CPU + {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Release|x64.Build.0 = Release|Any CPU + {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Debug|x64.ActiveCfg = Debug|Any CPU + {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Debug|x64.Build.0 = Debug|Any CPU + {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Release|Any CPU.Build.0 = Release|Any CPU + {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Release|x64.ActiveCfg = Release|Any CPU + {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Release|x64.Build.0 = Release|Any CPU + {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Debug|x64.ActiveCfg = Debug|Any CPU + {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Debug|x64.Build.0 = Debug|Any CPU + {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Release|Any CPU.Build.0 = Release|Any CPU + {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Release|x64.ActiveCfg = Release|Any CPU + {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Release|x64.Build.0 = Release|Any CPU + {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Debug|x64.ActiveCfg = Debug|Any CPU + {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Debug|x64.Build.0 = Debug|Any CPU + {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Release|Any CPU.Build.0 = Release|Any CPU + {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Release|x64.ActiveCfg = Release|Any CPU + {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Release|x64.Build.0 = Release|Any CPU + {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Debug|x64.ActiveCfg = Debug|Any CPU + {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Debug|x64.Build.0 = Debug|Any CPU + {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Release|Any CPU.Build.0 = Release|Any CPU + {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Release|x64.ActiveCfg = Release|Any CPU + {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Release|x64.Build.0 = Release|Any CPU + {3211BD54-4209-428E-9F11-D2F8181A890D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3211BD54-4209-428E-9F11-D2F8181A890D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3211BD54-4209-428E-9F11-D2F8181A890D}.Debug|x64.ActiveCfg = Debug|Any CPU + {3211BD54-4209-428E-9F11-D2F8181A890D}.Debug|x64.Build.0 = Debug|Any CPU + {3211BD54-4209-428E-9F11-D2F8181A890D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3211BD54-4209-428E-9F11-D2F8181A890D}.Release|Any CPU.Build.0 = Release|Any CPU + {3211BD54-4209-428E-9F11-D2F8181A890D}.Release|x64.ActiveCfg = Release|Any CPU + {3211BD54-4209-428E-9F11-D2F8181A890D}.Release|x64.Build.0 = Release|Any CPU + {9815A23B-6101-4C13-89CA-A07B85623E0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9815A23B-6101-4C13-89CA-A07B85623E0E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9815A23B-6101-4C13-89CA-A07B85623E0E}.Debug|x64.ActiveCfg = Debug|Any CPU + {9815A23B-6101-4C13-89CA-A07B85623E0E}.Debug|x64.Build.0 = Debug|Any CPU + {9815A23B-6101-4C13-89CA-A07B85623E0E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9815A23B-6101-4C13-89CA-A07B85623E0E}.Release|Any CPU.Build.0 = Release|Any CPU + {9815A23B-6101-4C13-89CA-A07B85623E0E}.Release|x64.ActiveCfg = Release|Any CPU + {9815A23B-6101-4C13-89CA-A07B85623E0E}.Release|x64.Build.0 = Release|Any CPU + {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Debug|x64.ActiveCfg = Debug|Any CPU + {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Debug|x64.Build.0 = Debug|Any CPU + {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Release|Any CPU.Build.0 = Release|Any CPU + {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Release|x64.ActiveCfg = Release|Any CPU + {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Release|x64.Build.0 = Release|Any CPU + {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Debug|x64.ActiveCfg = Debug|Any CPU + {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Debug|x64.Build.0 = Debug|Any CPU + {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Release|Any CPU.Build.0 = Release|Any CPU + {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Release|x64.ActiveCfg = Release|Any CPU + {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Release|x64.Build.0 = Release|Any CPU + {7836A5A0-798F-4167-818C-EA770135D1B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7836A5A0-798F-4167-818C-EA770135D1B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7836A5A0-798F-4167-818C-EA770135D1B0}.Debug|x64.ActiveCfg = Debug|Any CPU + {7836A5A0-798F-4167-818C-EA770135D1B0}.Debug|x64.Build.0 = Debug|Any CPU + {7836A5A0-798F-4167-818C-EA770135D1B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7836A5A0-798F-4167-818C-EA770135D1B0}.Release|Any CPU.Build.0 = Release|Any CPU + {7836A5A0-798F-4167-818C-EA770135D1B0}.Release|x64.ActiveCfg = Release|Any CPU + {7836A5A0-798F-4167-818C-EA770135D1B0}.Release|x64.Build.0 = Release|Any CPU + {358C26DC-44F6-4177-9035-9574A87DD422}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {358C26DC-44F6-4177-9035-9574A87DD422}.Debug|Any CPU.Build.0 = Debug|Any CPU + {358C26DC-44F6-4177-9035-9574A87DD422}.Debug|x64.ActiveCfg = Debug|Any CPU + {358C26DC-44F6-4177-9035-9574A87DD422}.Debug|x64.Build.0 = Debug|Any CPU + {358C26DC-44F6-4177-9035-9574A87DD422}.Release|Any CPU.ActiveCfg = Release|Any CPU + {358C26DC-44F6-4177-9035-9574A87DD422}.Release|Any CPU.Build.0 = Release|Any CPU + {358C26DC-44F6-4177-9035-9574A87DD422}.Release|x64.ActiveCfg = Release|Any CPU + {358C26DC-44F6-4177-9035-9574A87DD422}.Release|x64.Build.0 = Release|Any CPU + {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Debug|x64.ActiveCfg = Debug|Any CPU + {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Debug|x64.Build.0 = Debug|Any CPU + {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Release|Any CPU.Build.0 = Release|Any CPU + {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Release|x64.ActiveCfg = Release|Any CPU + {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Release|x64.Build.0 = Release|Any CPU + {94667017-2F5A-49DF-850B-238EB0C7E17D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {94667017-2F5A-49DF-850B-238EB0C7E17D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {94667017-2F5A-49DF-850B-238EB0C7E17D}.Debug|x64.ActiveCfg = Debug|Any CPU + {94667017-2F5A-49DF-850B-238EB0C7E17D}.Debug|x64.Build.0 = Debug|Any CPU + {94667017-2F5A-49DF-850B-238EB0C7E17D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {94667017-2F5A-49DF-850B-238EB0C7E17D}.Release|Any CPU.Build.0 = Release|Any CPU + {94667017-2F5A-49DF-850B-238EB0C7E17D}.Release|x64.ActiveCfg = Release|Any CPU + {94667017-2F5A-49DF-850B-238EB0C7E17D}.Release|x64.Build.0 = Release|Any CPU + {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Debug|x64.ActiveCfg = Debug|Any CPU + {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Debug|x64.Build.0 = Debug|Any CPU + {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Release|Any CPU.Build.0 = Release|Any CPU + {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Release|x64.ActiveCfg = Release|Any CPU + {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Release|x64.Build.0 = Release|Any CPU + {6C7C865D-F813-4CCB-9256-81F8FB511888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6C7C865D-F813-4CCB-9256-81F8FB511888}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6C7C865D-F813-4CCB-9256-81F8FB511888}.Debug|x64.ActiveCfg = Debug|Any CPU + {6C7C865D-F813-4CCB-9256-81F8FB511888}.Debug|x64.Build.0 = Debug|Any CPU + {6C7C865D-F813-4CCB-9256-81F8FB511888}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6C7C865D-F813-4CCB-9256-81F8FB511888}.Release|Any CPU.Build.0 = Release|Any CPU + {6C7C865D-F813-4CCB-9256-81F8FB511888}.Release|x64.ActiveCfg = Release|Any CPU + {6C7C865D-F813-4CCB-9256-81F8FB511888}.Release|x64.Build.0 = Release|Any CPU + {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Debug|Any CPU.Build.0 = Debug|Any CPU + {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Debug|x64.ActiveCfg = Debug|Any CPU + {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Debug|x64.Build.0 = Debug|Any CPU + {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Release|Any CPU.Build.0 = Release|Any CPU + {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Release|x64.ActiveCfg = Release|Any CPU + {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Release|x64.Build.0 = Release|Any CPU + {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Debug|x64.ActiveCfg = Debug|Any CPU + {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Debug|x64.Build.0 = Debug|Any CPU + {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Release|Any CPU.Build.0 = Release|Any CPU + {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Release|x64.ActiveCfg = Release|Any CPU + {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Release|x64.Build.0 = Release|Any CPU + {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Debug|x64.ActiveCfg = Debug|Any CPU + {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Debug|x64.Build.0 = Debug|Any CPU + {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Release|Any CPU.Build.0 = Release|Any CPU + {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Release|x64.ActiveCfg = Release|Any CPU + {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Release|x64.Build.0 = Release|Any CPU + {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Debug|x64.ActiveCfg = Debug|Any CPU + {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Debug|x64.Build.0 = Debug|Any CPU + {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Release|Any CPU.Build.0 = Release|Any CPU + {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Release|x64.ActiveCfg = Release|Any CPU + {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Release|x64.Build.0 = Release|Any CPU + {12D7F445-1A22-4695-B174-6FC44C806377}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12D7F445-1A22-4695-B174-6FC44C806377}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12D7F445-1A22-4695-B174-6FC44C806377}.Debug|x64.ActiveCfg = Debug|Any CPU + {12D7F445-1A22-4695-B174-6FC44C806377}.Debug|x64.Build.0 = Debug|Any CPU + {12D7F445-1A22-4695-B174-6FC44C806377}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12D7F445-1A22-4695-B174-6FC44C806377}.Release|Any CPU.Build.0 = Release|Any CPU + {12D7F445-1A22-4695-B174-6FC44C806377}.Release|x64.ActiveCfg = Release|Any CPU + {12D7F445-1A22-4695-B174-6FC44C806377}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} - {374B7E56-A815-4F56-A4C2-6094B5A97EE7} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} - {7DAC3708-4415-490B-AAE8-0DAA74E2EA8B} = {08649D7D-EF5A-4626-9959-935CA85DF770} - {E5A8DB4E-1205-4CE9-B802-3D6ADADF737A} = {08649D7D-EF5A-4626-9959-935CA85DF770} - {2971858E-2CCA-4688-B8CA-84F130AD5AA9} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} - {2503F67B-63BB-4364-8B31-1DD3049C92B7} = {FE0F37B3-7727-4A08-AEA1-437F53982658} - {88BC8170-9123-48C0-A914-11D3CE805196} = {FE0F37B3-7727-4A08-AEA1-437F53982658} - {316B1D0A-9CF7-4E5C-A39A-8A389B075A19} = {4B812744-1CB5-4760-9719-2220EACC566C} - {2F4986D6-3F56-4C05-8A1D-399594F96093} = {232840A6-183C-4D3A-A086-582FD449D300} - {E72E105D-B15F-4D69-9A13-CAA49D4889D6} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} - {B689E82B-B3E8-4C83-B56C-D4C27206AAC6} = {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} - {74283F68-6B38-4CF4-B0CB-AAD65618ADB8} = {46C33E74-835B-4CB4-861D-42A781A2502C} - {AB6FAB84-5218-48A8-8F94-03B02ECD098F} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {5A3338F1-9963-4CAC-85A3-7AB263CB15B0} = {08649D7D-EF5A-4626-9959-935CA85DF770} - {C3451307-3743-4911-A401-7F28889703D3} = {08649D7D-EF5A-4626-9959-935CA85DF770} - {736F69E9-89D0-47E2-99AF-9412AAE1C6BB} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} - {4B818EE6-8E13-40DA-B99A-218BB228EE91} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {30DC35DF-9D86-443C-B26C-9053E6FCA434} = {08649D7D-EF5A-4626-9959-935CA85DF770} - {4B94CAF6-134D-4F89-8F2D-72A4FB363B59} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} - {54936F20-EEFC-405B-8646-76F200A5C8F7} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} - {546EE1A2-DB6B-49D3-8919-33624FEF2498} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} - {B603B92A-1203-4E28-9D15-2AF1CE4E9510} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} - {18634B69-0ED1-4C64-9735-4DFD2B2B0E9B} = {7064C470-7D0B-4CE2-A80C-BEE376DDC956} - {FF3FD53D-D23E-48AC-98B6-3B028B4DE8AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {981E883E-CCDC-400B-8FB1-76E1E65C32AF} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} {0D34A7F0-DC77-4789-A136-93089CBD15C3} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {0EB0CB69-4C44-4462-A92A-A9B9FDA171DE} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {DA816A33-F164-4456-92DD-A672BAD1A6B1} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {ABF6E41A-CBF9-49DE-87FC-9D88F440A104} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} {5944A182-13B8-4DA6-AEE2-0A01E64A9648} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} - {B228589B-4106-4CF8-B165-26636B94BE2C} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {08649D7D-EF5A-4626-9959-935CA85DF770} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {8663AD83-4E2C-47EF-BF28-1427E82F1A36} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {FE0F37B3-7727-4A08-AEA1-437F53982658} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {4B812744-1CB5-4760-9719-2220EACC566C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {322F0F91-E181-4139-87DE-974CCF2339BA} = {4B812744-1CB5-4760-9719-2220EACC566C} {232840A6-183C-4D3A-A086-582FD449D300} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {7064C470-7D0B-4CE2-A80C-BEE376DDC956} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {E8CE3469-6E0F-495C-937E-D9820DE3DA89} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {46C33E74-835B-4CB4-861D-42A781A2502C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {DBD1137D-0208-4CF4-BB45-36FE023B4FED} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {8C24FE14-9F28-46AF-B8BA-393D4EFFE97B} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {A93D1699-A8B1-432E-8929-5800F4FE5AA7} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {049430DA-664C-4C77-A679-0CF12217ABB2} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {6E0E6CB0-DA27-44FF-AEB7-B6D10C8520BD} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} - {64B72C9E-85BD-4C41-B67D-892157600F5B} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} - {354D1855-EE83-41EF-BFFC-1348F77A66DB} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} - {8C5F78FD-DAF4-45E4-969A-0ADC4CC6E00C} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} - {A88B4DB8-2441-488D-B097-68F02F18DECC} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} - {3B5C4669-07C6-49F0-BC69-70A8980FC605} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} + {02B35A90-23DF-4341-89CF-E911ED210FBE} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {F262689D-5BE8-45E9-B090-0CFF81315FB9} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {81618F3D-ED3C-44C5-9BAD-8F04CF601D42} = {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} - {F6E5B615-A85D-4FB4-97D0-698098D7616F} = {33D4C640-954B-4468-95A4-2322DAB0B184} - {7A628B6A-AFE4-4235-95AA-9A711268B9B1} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {E417DAE3-A1D2-430D-A6C7-C8BDE083D851} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {9A6A3012-6A11-415B-BC58-E2268BE7022E} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {0F43C687-59EF-4164-B3A5-E53C3BF86892} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} - {BE11C98A-5680-491E-86E9-93B0A83909EA} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} - {E2B9737D-9630-4705-B2DF-21C2EB607F65} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} - {3F9311DF-A09A-4364-8DFB-AD5A4CCC4558} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} - {8C154ACF-ED6E-43C4-906E-2D36CBC8D112} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} - {CC117C03-267A-4145-B258-922C35484883} = {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} - {1AD1F4E7-84DA-4CE8-BC69-7D713413560D} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} - {9DEA348B-8915-4BAA-AE04-99BF5FC6131B} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} - {E85FA5C9-C7D9-4461-99DE-11675749E38E} = {2A8759AF-76F5-4F6A-8420-D2890B612AB2} - {FB66887D-E08C-4551-B838-EAF49C1D1EE7} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} - {D9BE5EBD-124B-4B5A-B17B-015E44B98CE9} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {675D2886-B4E9-4B14-A02D-44B5204EE2E0} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} - {2A57A40F-92F5-4ACE-95AA-763915578282} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} - {A89E129A-BBEA-431E-96D5-9AAEAA245A3C} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} - {B44F4054-5B66-4937-A99D-216DEFBAD0EF} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} - {A4F3852E-DC6B-43A8-A40A-899089546444} = {33D4C640-954B-4468-95A4-2322DAB0B184} - {CDA1B479-9B9A-43BD-A499-F8FAA6476F09} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} - {AC4270B4-29A5-41E4-A86A-4158E2AF8C6B} = {2A8759AF-76F5-4F6A-8420-D2890B612AB2} + {7A8F1593-C00F-4D90-9029-11BF75B3C926} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} {53543535-E81D-4B28-8EB0-89E9A8FDD496} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {4AEA2C8C-ACE2-4BBA-BCF0-71AD8E50823D} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {89B2A360-4806-41B2-9CE1-F2E556BB222D} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} {45B8C34E-A62D-4809-BA0F-6046AFAB2851} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} - {C72508E7-CEF3-4E36-BF39-F3908EE338B7} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {65605EB9-FA98-42CE-8F40-117D89D59786} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {5022CEEA-B4E1-4000-BD28-E2CCEEA2D382} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {4F26D6F5-32FA-4EE6-8588-A325734E4386} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} {0C5262F4-DC7E-493F-AB87-A72063ABCA00} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {FE906D46-B113-4600-AC2C-7523937B96AB} = {0C5262F4-DC7E-493F-AB87-A72063ABCA00} - {6FF949B6-F1C6-4056-B9DA-CC6120D427FC} = {FE906D46-B113-4600-AC2C-7523937B96AB} {920E6762-32FE-4BEC-AD0C-6F28119C6804} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {36A7B94C-1CC6-4C12-AB47-240FEB02EECF} = {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} - {E2115E04-198A-48A6-9DD0-F1F8335F3FD8} = {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} - {85E1CD26-31AB-450D-BB33-7F69FAB5F4A9} = {74739F71-A6F5-4BDF-B398-46A84715FA9E} - {672C436B-ECE4-4722-8B7D-4EF1E45194B0} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {5D9F3039-D6FE-4F2E-9752-486ADF970093} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {E99EB5EE-6C3A-4878-9407-BB4060F5E200} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {7A4F49AC-A597-4D41-B380-675787D00CCD} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {39F57444-3DB4-458D-9CEB-6484069BD7E0} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {8D3F47AA-ADFB-47AD-9BF9-B6BFFE1E00DF} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {12CE2D3F-F587-4BAD-8252-60F3F57BC2D6} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {55887169-B044-47AA-8554-E5F51935FF38} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {90D60969-E01C-4993-9DC4-794180FF49E5} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {12E3C29F-AE3A-4BC9-A7CE-904269223C3B} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {430DC17D-B161-48D6-B4CE-17913C1AABBE} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {76541C8D-4876-4E9E-9459-FBAF1BD8BA2E} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {A9D8D7E4-591D-479B-B0A5-07F30F831199} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} {14D3C601-C29B-48D2-8312-556319D04619} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {19C7B778-345C-407B-BE72-67BF04784F35} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} - {7B9D8EC0-3D82-4C1F-9687-EAF1AE796700} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {2BDB0371-D8BB-4517-9FA7-CCF05EA2C479} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {7DC7F500-F004-4DAC-9F16-D6878B3808E1} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {9B615187-D90E-4334-BBD8-5973A12442F9} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {F3BBE0D2-7E14-471D-AE9B-85D076A3F89F} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {8E00F570-6926-4304-BAE0-C9E7FA9A4213} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {89F2AE57-97D5-49F4-A5C5-1D8D1EAA7034} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {A69815D7-1C4F-4484-8E0B-7E6765203AC0} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {FB2C0849-7F5A-4578-9386-6A26F9CBBD2B} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {524C5CA0-036E-480A-86E4-513232422F26} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {1A3740CF-C51F-4E7A-BA27-6BF8652021BF} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {217AB0A8-8750-4696-8E43-E11F82A191CB} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} - {C92637A7-77FC-4995-8024-B28F6C58AEA8} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {87B4CA7B-76BD-4E5B-87AC-0B791F2687C2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {2BDF6D68-91FF-4220-8D78-90AA024275C3} = {14D3C601-C29B-48D2-8312-556319D04619} {542D8266-668F-49FA-BFE1-814AB96720DD} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {AAE8F8AE-65F3-4DD9-BB9B-95CCBD60EFE8} = {542D8266-668F-49FA-BFE1-814AB96720DD} {83AA938C-9182-4E65-A42A-79CAE68888E9} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {8A7A91C6-C2F5-4C68-A53F-555EF93DB592} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {66DEC85C-7433-4902-B01A-8F98D1A87385} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} - {8BE42490-F83D-48D7-8C5D-1665AC84229C} = {FF832650-37C7-48FF-B078-77CACF37966E} - {3E2FAFFD-0871-4BF1-8A7B-B729DD939D11} = {46DE49C1-D700-4C46-849A-7F485D87A518} {BA74E50F-C553-40D6-8578-BCB4A3F5E585} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {2DEE608F-965F-4298-9B71-D7B32CBA66BD} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} - {E7C80137-1D51-4215-BED7-C739BC663BE2} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} {DC9F9523-A2F9-47AA-B6D9-40AC14797548} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {4A2E63F1-AFDA-4F26-8745-150FFE5E2F3A} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} - {1282BEA0-B1E0-425C-8CF1-2F7254A3EB58} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} - {B80E1F47-4D96-47CD-A113-B44BEA1BB2A2} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} - {1F04359A-64BB-4C86-8D2F-161C49F2CDEB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} - {5A42D577-38AA-4A5B-866A-01FE1339F2AB} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} - {B189564D-F638-4D3F-8AA6-B9C62D8F49BE} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} - {C517C235-8969-478B-941B-2E40897F4C71} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} - {41817AD2-D1DA-4698-B87D-910524CE4B7A} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} - {36629279-FD56-452B-88C2-5C8271500042} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} - {40D7AED3-982D-440B-BCD5-C1EFFC59514D} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {87E332AA-5C0D-4CA7-89F6-D734F3B70B5C} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {A1D7408C-AB95-4CFF-89F8-24797A865DBF} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {7AD74A5F-C3F5-46D3-A921-E5C8C94D68C9} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {8680EA03-13A7-4F4A-A579-EB2CB6411C21} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {4CE930E3-12E4-4BFA-962E-3477B7AB6930} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {8903DCD8-A68D-4164-83EE-DE07385DDDD6} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {E2E68FF1-9CB5-424F-9D91-130A48462E54} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {7FFFE514-2221-4FB1-AD37-EE56A392C3E2} = {FF832650-37C7-48FF-B078-77CACF37966E} - {472122D3-114E-424D-AF47-B3D7E94057A8} = {46DE49C1-D700-4C46-849A-7F485D87A518} - {B58E67E1-C0B1-4586-BDC7-DF3B72E632E2} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} {985B71A9-DF28-4B70-9DA5-1D60B82E8551} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {140EE15C-4E28-4BAB-8B0D-46E17D28BF9F} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} - {EAAD274F-9C5D-4531-A4E5-A5764E9D644A} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} - {F9C27912-F7EC-47B6-A385-064BD4B92EDA} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} - {F346B708-0D1B-4BA7-AA86-1B977BA88FB6} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} - {332D590C-11EC-481D-AC55-6279548F1CF4} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} - {7BF99E7E-37EB-46D6-8808-2254430C3645} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} - {5EF602A6-3996-44D3-A6C0-5319C9BF8B21} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} - {37138DEF-EEE4-4363-A307-0027B4C6ACD8} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} - {A93F1887-0011-466C-8EB8-3A338AEA5A4B} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} - {A1EE1EEE-ACD6-4951-AAEF-701FB83C2680} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} - {9E0BBDD7-9D7A-4173-A1CA-6284CD1092BD} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} - {CC7ED747-8BCE-4B49-8855-AE4697792A81} = {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} - {605A3653-C7E3-4EC2-8749-979E4A0227D0} = {74739F71-A6F5-4BDF-B398-46A84715FA9E} - {2D61CA3A-A40C-466D-9E87-59A32A86B7BC} = {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} - {50C13F5E-BA3A-4B04-A730-BAA584E051AB} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {C8AD2261-D325-414D-9B2D-B2A9D27C242F} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {CC9C8421-68D2-4645-B97E-512FAC691703} = {542D8266-668F-49FA-BFE1-814AB96720DD} - {1551B2ED-9931-4A03-8853-1C3E5504C43D} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} - {CB1F1533-E430-47C5-AD52-04922CC959A5} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {0607F6E0-84AC-4FBC-9717-6F0B1D18E574} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {1041A4C4-D422-4AD8-B511-B8E7FBA548C9} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {D05ADEA6-2267-4DC1-901A-BD18B697E889} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {1787BF8C-3C05-4E07-8868-E839544F9522} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} - {F673CF31-D8CF-4F3E-B294-0802589F5BF2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {0D9CDEA2-0DC6-490A-9145-782259B63739} = {14D3C601-C29B-48D2-8312-556319D04619} - {80512601-4B59-4A1B-984F-8E81E3242F97} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} - {96C2CD33-8A8C-4206-9C73-97E8D748F397} = {EE77C779-1031-4494-9850-3F2D85D8FA10} - {FD39743A-5BE3-40E8-AAA5-04DEAA0CEA31} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {76117457-EC1B-4844-825A-20A760B42C44} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} - {89EE0C4D-6C29-472E-9109-84327DB489A1} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} - {F45CBF27-1D45-404C-9B09-5CC781AF5942} = {FE906D46-B113-4600-AC2C-7523937B96AB} - {2715E67E-6111-4CCD-9C6E-BA8AE47E6D36} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} - {8EA836C9-BE07-4EDE-A983-122A1D9FB499} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {EB907B3B-2049-43D2-A773-AF5ABA2A3C0F} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} - {B7D7027F-F125-40DD-92A2-A5CEE9E969CC} = {232840A6-183C-4D3A-A086-582FD449D300} - {49DB6925-62FF-4CF3-A041-A7F117AD6256} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {09AD9DFA-6AD8-4872-AA96-29C3234828CD} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} {5BD3D50F-5CB6-4554-9497-0F1680152D95} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} {516A316F-BE2B-4931-88DD-4C08DECE8E56} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {76E486CD-3BFA-4DAF-A52C-BE6EAED35E1E} = {6B1042A4-A6D5-4307-B163-803164E4A742} {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} {F7DEBE88-8324-47F9-B240-4F19F706B50B} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} {4FB42611-1B54-4ABF-988A-714EE9E8C492} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {D2ED2CE3-2273-4FA0-86A8-BB8DC3522823} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {353C56BA-CD53-46F2-9D2F-8FAD89CD20A6} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {74739F71-A6F5-4BDF-B398-46A84715FA9E} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} {08FED323-7D60-4B8B-AD36-C55B40C96D1C} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} - {2A8759AF-76F5-4F6A-8420-D2890B612AB2} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} {33D4C640-954B-4468-95A4-2322DAB0B184} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} {CD7414D5-4DE9-4339-B833-29EF41B3AC76} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} = {83AA938C-9182-4E65-A42A-79CAE68888E9} @@ -2073,20 +1955,209 @@ Global {46DE49C1-D700-4C46-849A-7F485D87A518} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} {6B1042A4-A6D5-4307-B163-803164E4A742} = {83AA938C-9182-4E65-A42A-79CAE68888E9} {BDA1DB4F-C408-445D-9391-EC9765CF7349} = {E747043D-81E2-4A89-8B5B-1258ED45F941} - {215F07C3-74EE-4FAA-A821-09CF70B8C950} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {70449866-CC6B-438B-B8DC-CBAB436EFD00} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} + {70449866-CC6B-438B-B8DC-CBAB436EFD00} = {CDE13B76-107F-4282-BEAE-26843BD46140} {EE77C779-1031-4494-9850-3F2D85D8FA10} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {02B35A90-23DF-4341-89CF-E911ED210FBE} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {7A8F1593-C00F-4D90-9029-11BF75B3C926} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {F262689D-5BE8-45E9-B090-0CFF81315FB9} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {46C86695-A597-47F3-944E-03C63CA678F4} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {BB0DFD22-33FF-465F-8788-D583BE39BC6D} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} + {A91E96C6-9437-4335-A629-D4B3E921F9E8} = {08649D7D-EF5A-4626-9959-935CA85DF770} + {78D31C12-2E54-4C66-9849-B9664B9A5897} = {4E20DC14-D9E4-484D-B99A-C4A759D1612E} + {03C37CB5-A325-4CB0-965A-A5FD67D14091} = {4E20DC14-D9E4-484D-B99A-C4A759D1612E} + {4E20DC14-D9E4-484D-B99A-C4A759D1612E} = {08649D7D-EF5A-4626-9959-935CA85DF770} + {BDA33777-F759-4050-85F5-68EB4996ADD7} = {08649D7D-EF5A-4626-9959-935CA85DF770} + {A71C1D90-5513-4255-84A0-32384474E82C} = {08649D7D-EF5A-4626-9959-935CA85DF770} + {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43} = {46C33E74-835B-4CB4-861D-42A781A2502C} + {AC537AD9-9CC3-420F-A17C-D77C4069A576} = {5D6E1CE0-D783-4F5C-9962-9AE073A62F30} + {617653DE-4377-4428-954B-E5FB4690E875} = {CD0CAD92-5784-471A-BC57-2DC888FA0A00} + {CD0CAD92-5784-471A-BC57-2DC888FA0A00} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} + {5D6E1CE0-D783-4F5C-9962-9AE073A62F30} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} + {741E75F7-9286-4C01-8C67-AA8515670DF7} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} + {D98F5757-375F-46D1-9903-5D8D57A6748F} = {232840A6-183C-4D3A-A086-582FD449D300} + {404CD919-D15D-49D6-8D26-E96486E62700} = {D98F5757-375F-46D1-9903-5D8D57A6748F} + {47597D41-C795-43FE-8B76-069D9E1C364C} = {D98F5757-375F-46D1-9903-5D8D57A6748F} + {3E9E2661-DDD6-4D33-BCA7-EA07784F6723} = {FE0F37B3-7727-4A08-AEA1-437F53982658} + {3FCB8575-6211-4E91-BCF8-1D2D380843B9} = {FE0F37B3-7727-4A08-AEA1-437F53982658} + {3016EDC5-4BE6-4CE2-8B18-6EE226920393} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} + {2809DB8A-95FA-4330-97C7-4A4936CD0EA9} = {4B812744-1CB5-4760-9719-2220EACC566C} + {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B} = {4B812744-1CB5-4760-9719-2220EACC566C} + {45BAE42F-4801-4758-9CDA-0D900C734369} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} + {0329A13A-436E-4E00-A1C7-243F9DD4B7D2} = {7064C470-7D0B-4CE2-A80C-BEE376DDC956} + {9DE85526-8B33-4291-B285-4BECF431D6FA} = {0329A13A-436E-4E00-A1C7-243F9DD4B7D2} + {DCA283C7-2492-4461-BD34-AB00191C46F7} = {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} + {1EF25877-2E8F-4FF1-A530-F3DEB512E238} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} + {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} + {06918731-F657-417E-A74D-E2D7E77351B1} = {DC292168-27F4-4469-8CDA-92FB4212EF53} + {1818788E-7C68-4280-93A8-63D01168C6B6} = {DC292168-27F4-4469-8CDA-92FB4212EF53} + {DC292168-27F4-4469-8CDA-92FB4212EF53} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {872994E4-7D87-483A-B6DD-E68DE4526497} = {BEC84962-7BBD-4C11-8FD1-D175AC54FE83} + {BEC84962-7BBD-4C11-8FD1-D175AC54FE83} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {40EC04A2-9862-43E5-A1B8-69CED1BE646C} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {6092474F-2AF3-4C24-A121-74F7A0C87E09} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {EB4B7EA5-274B-4AF0-8F4B-BB474BB63D6D} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {D4A6B54C-70DE-4CE0-B115-30694548E253} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} + {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED} = {6092474F-2AF3-4C24-A121-74F7A0C87E09} + {C7A93ED9-5D0B-4F32-AA8A-69A515C32342} = {40EC04A2-9862-43E5-A1B8-69CED1BE646C} + {8B0D2243-5E00-472E-82EC-572905A373AF} = {EB4B7EA5-274B-4AF0-8F4B-BB474BB63D6D} + {94F98C15-6E92-466A-A93D-EB37CC877F99} = {D4A6B54C-70DE-4CE0-B115-30694548E253} + {6920A090-9B17-4C6B-B86D-7807C7D32BA0} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {DA7F5603-FEC0-4090-9561-77B317D9EFA4} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {E48D5AFE-8392-46D4-92C5-E3C6332035AB} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {84B7A048-5B99-429A-8322-0DE98560C2D0} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {074FE1B1-CC4A-4E2F-88FB-BD0131C88306} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {C9FF6E3A-B173-4070-8DA8-84EDE6F77298} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {C598E4D8-634C-40B2-BD77-ED69AD4BF211} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {5238486B-2E9E-44CE-84BC-1BF55AB59EE5} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} + {29071256-A255-4881-8BF7-63EA598313F8} = {EDCE6A71-453E-4FB4-B01B-D8DBE16F1C49} + {EDCE6A71-453E-4FB4-B01B-D8DBE16F1C49} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} + {4CE43CE6-A150-44B9-9896-EB5D28B994B0} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} + {747A2EBA-BF28-4153-BF03-3300DA570061} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {6521511B-CE2E-485D-B72C-C22D89A191A2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {6A44C395-D619-496E-A5A8-8F8FFA51177A} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} + {F4CC0091-D652-4445-A9FD-9D2CE13A2286} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {93510E80-4378-4504-A220-C71D0A61ADD6} = {F4CC0091-D652-4445-A9FD-9D2CE13A2286} + {B5A410AD-C1F1-4D48-B78D-85D10ACA7881} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} + {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6} = {B5A410AD-C1F1-4D48-B78D-85D10ACA7881} + {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0} = {B5A410AD-C1F1-4D48-B78D-85D10ACA7881} + {D66370B6-8E54-4E95-92CD-81236916A4D1} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} + {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} + {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} + {A2707F9F-80CC-41F9-9ED6-B45E5732CC56} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} + {7961AAE6-FDC0-43C3-A546-4DBFE340660D} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} + {6BB1FCDF-1E26-4837-984D-DA74D558A49B} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} + {35F1DB8E-6479-4619-82BB-946BC7EC959E} = {33D4C640-954B-4468-95A4-2322DAB0B184} + {0F4E4A62-04C7-4635-8543-D595B45D2D76} = {33D4C640-954B-4468-95A4-2322DAB0B184} + {564A2C45-D42B-4A6C-A539-B10863D8E67C} = {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} + {C31555B0-FCAA-44F9-8284-96FBDD7FAD37} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} + {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} + {267429BB-FCFF-491B-B618-174DC3152EF7} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} + {9F6F4116-8029-4788-9561-A0791EDFB720} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} + {C89383DE-0284-4E0F-94E2-ED2F7B4B5656} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} + {823B06D1-85E5-400B-885D-2B3CFD01487D} = {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} + {CC0C0477-2C69-4BB2-A433-15A0C25E782C} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {74A8DA40-CB46-4B95-96DF-46A18090D987} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {53562602-1F63-4B2C-8921-B5BB826984F8} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} + {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {B2465420-C899-4077-B6D3-B62405D5BFE2} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {5243EAA7-17B4-4810-ACDD-FCB28E1C477D} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {36BA4778-011A-4B0F-8C6A-C169E012AE66} = {02B35A90-23DF-4341-89CF-E911ED210FBE} + {E624718C-38CD-41AA-BBA0-415008BE86BF} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} + {3F2A0172-118E-439E-BD4A-5E0F95361838} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} + {9D295FC2-32A9-487A-BAE3-348F6360729D} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} + {D215BD91-4D7B-437E-BC2A-14D9B81649E5} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} + {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {89B90362-4C48-4FBD-A0B7-47E34D3326F0} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {5C84C069-DB54-409A-BC0F-CBC066860CBA} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {A02A0101-3C0E-4971-AB0C-CC762C0E3955} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {B469E3EE-637F-4A0A-852D-6A33F896B906} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {2B288DAC-2E49-4980-B234-6E114FB1B2F1} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {5DAFE25B-EA24-429E-A3D2-7CD28565E444} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {EAF59CBD-2310-4BF0-AE28-580D451F9C86} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} + {AF7F4D54-CE14-4BE1-8E9E-2D56C6809508} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1} = {AF7F4D54-CE14-4BE1-8E9E-2D56C6809508} + {9C25DDE5-65D9-492D-9C04-F3D64EE706A1} = {AF7F4D54-CE14-4BE1-8E9E-2D56C6809508} + {8FE4210C-9D74-4E8B-84CD-4E96751A50DD} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} + {A2EDB5D7-9675-403A-9FC2-FDAA49555097} = {8FE4210C-9D74-4E8B-84CD-4E96751A50DD} + {D7D46284-47DF-488A-8D04-421CBAAF6943} = {8FE4210C-9D74-4E8B-84CD-4E96751A50DD} + {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005} = {CDE13B76-107F-4282-BEAE-26843BD46140} + {848EC46B-2C09-4E4E-9D09-D876862B52CD} = {CDE13B76-107F-4282-BEAE-26843BD46140} + {CDE13B76-107F-4282-BEAE-26843BD46140} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} + {1226DCD2-D128-4976-8806-2A369F87058B} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} + {80F6E78A-4ADB-4E51-9570-A9200048F48F} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} + {97708A6F-A6F9-4E7A-9069-65ABBBA12D06} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} + {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} + {6E74144B-0816-4161-AACC-8C696E0E9C34} = {C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA} + {C903135B-E0CE-4DB0-B8BF-FF59816C24D8} = {C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA} + {C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} + {D3C16432-EAD0-4DE5-9544-16D36A67C2C2} = {C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA} + {F0353FB0-27F0-4957-8D69-4AEE40A09801} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {3735BFA1-F935-42EF-A316-BEEF0A138781} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {A3DE164B-54D1-440F-A9E9-19A5C667E073} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {175CDD95-C2C2-4665-8CC3-5D1D6BC94098} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {1BC59353-A6FF-4C0C-9B47-37884621E228} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {19902ADB-7C37-4E38-ABC0-28BCDE2D164D} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {F92CC9A7-BE67-48F3-8DAE-D59821F031FD} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} + {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7} = {6B1042A4-A6D5-4307-B163-803164E4A742} + {885CDA4A-9831-4159-A0A7-9062CF93180A} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} + {60A51206-8F7F-4F43-B473-006F0DB380CB} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} + {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0} = {FF832650-37C7-48FF-B078-77CACF37966E} + {B98309A2-D2D0-41BB-A7C6-8BA24B29D105} = {46DE49C1-D700-4C46-849A-7F485D87A518} + {682FAD0B-5989-436C-9B7D-F15F10CB90FF} = {FF832650-37C7-48FF-B078-77CACF37966E} + {8219C9CC-1260-4175-94E5-C36A336C8ADE} = {46DE49C1-D700-4C46-849A-7F485D87A518} + {9A15A065-8559-49E2-8818-9E8A9186A105} = {542D8266-668F-49FA-BFE1-814AB96720DD} + {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A} = {542D8266-668F-49FA-BFE1-814AB96720DD} + {C80C7EEF-1862-4607-8260-9FF0890DC573} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB} = {C80C7EEF-1862-4607-8260-9FF0890DC573} + {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1} = {C80C7EEF-1862-4607-8260-9FF0890DC573} + {A4573B93-FE93-47A4-B700-B6B45516E7AA} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {1EF70F79-B605-4729-99E7-E85386AAC649} = {A4573B93-FE93-47A4-B700-B6B45516E7AA} + {2CA6351B-DEA7-4343-91C1-8C20507343EE} = {A4573B93-FE93-47A4-B700-B6B45516E7AA} + {3440FA45-ADEA-4202-AF43-62E6F5904893} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {6C1A8E47-8391-416B-9407-2A1F97A62776} = {3440FA45-ADEA-4202-AF43-62E6F5904893} + {E7A282E3-CC87-48C9-A80B-664A5390C715} = {3440FA45-ADEA-4202-AF43-62E6F5904893} + {26CFEFAA-EA53-4163-A2B9-4B5318AF27DD} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} + {D3B70875-76B0-4F48-9798-4A700E4902E5} = {26CFEFAA-EA53-4163-A2B9-4B5318AF27DD} + {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3} = {26CFEFAA-EA53-4163-A2B9-4B5318AF27DD} + {0665C217-CDF0-4153-93DA-886230CB19CF} = {26CFEFAA-EA53-4163-A2B9-4B5318AF27DD} + {88A46A64-0877-44BB-87FB-C3A046104A17} = {FE906D46-B113-4600-AC2C-7523937B96AB} + {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B} = {FE906D46-B113-4600-AC2C-7523937B96AB} + {8E8F56D5-E686-4F4A-A9AD-B81D9243B446} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} + {0D4A2924-A7B1-4141-9871-FF1E8B46A752} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} + {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} + {F49D6ED6-9FD3-4C19-A30B-2C4198437D59} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} + {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {7BD12A3E-CB73-4B28-9509-26BEB096ABEB} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {BB05402F-7BE8-4965-9518-BE869ACE5EFC} = {EE77C779-1031-4494-9850-3F2D85D8FA10} + {E85AB70D-DF15-4A99-AFDA-530A5A9363FD} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} + {5E77B9D1-80A7-4761-9431-3D9C7E25324B} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} + {B69BDE42-349F-4E9C-B2ED-280B907BE1AE} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} + {DC60715E-80FD-4911-8A65-DC14A7A66FA9} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} + {4BEEE39F-0760-434F-9389-6194037781DE} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} + {F201EB09-2EE2-4203-A829-044C7EC2D112} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} + {77466E5C-4DF7-4C7C-B251-689052D51B38} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} + {C650E615-4FAD-4CA9-B81C-3CF461805005} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} + {0420C60C-6075-4BED-A0F0-9540A0D2CD8F} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} + {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} + {254521CF-58A2-4FFB-BCA3-78B187E985DB} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} + {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} + {76251F5E-89BD-4E56-81CA-AD111361CAD4} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} + {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} + {3211BD54-4209-428E-9F11-D2F8181A890D} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} + {9815A23B-6101-4C13-89CA-A07B85623E0E} = {14D3C601-C29B-48D2-8312-556319D04619} + {88C1C77A-0F9F-436B-98FB-E696F35EB62E} = {14D3C601-C29B-48D2-8312-556319D04619} + {A88DBDC2-DB29-4F80-82BB-B8D511E4A495} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} + {77EE6274-B332-4DA0-8AF1-73EE3561AA47} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {B111B6B8-DC60-4D9D-896C-EE52B834A3DB} = {77EE6274-B332-4DA0-8AF1-73EE3561AA47} + {7836A5A0-798F-4167-818C-EA770135D1B0} = {2449469D-7B4C-4A4E-936B-E6653E08EDC6} + {2449469D-7B4C-4A4E-936B-E6653E08EDC6} = {77EE6274-B332-4DA0-8AF1-73EE3561AA47} + {64F32D02-05E0-43D3-BCD5-578D4D5620DD} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {DE8CDE2C-F7D3-4515-9231-28FD787118DD} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} + {358C26DC-44F6-4177-9035-9574A87DD422} = {64F32D02-05E0-43D3-BCD5-578D4D5620DD} + {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB} = {64F32D02-05E0-43D3-BCD5-578D4D5620DD} + {94667017-2F5A-49DF-850B-238EB0C7E17D} = {DE8CDE2C-F7D3-4515-9231-28FD787118DD} + {2E7704B8-3E6A-4F0B-ABA8-D28732C9A88A} = {BB0DFD22-33FF-465F-8788-D583BE39BC6D} + {21E669BD-CF41-41F0-BACF-E03629F1C0AA} = {BB0DFD22-33FF-465F-8788-D583BE39BC6D} + {503812F4-2C93-4C8C-85C0-6CDF8FADE897} = {BB0DFD22-33FF-465F-8788-D583BE39BC6D} + {3801D850-9F29-451E-84FD-A85192195CD7} = {BB0DFD22-33FF-465F-8788-D583BE39BC6D} + {B795CBE6-3AAA-481E-85F6-C406C15AA586} = {2E7704B8-3E6A-4F0B-ABA8-D28732C9A88A} + {6C7C865D-F813-4CCB-9256-81F8FB511888} = {21E669BD-CF41-41F0-BACF-E03629F1C0AA} + {53574F47-0E4E-4317-8E14-D8BCD2EDFD57} = {503812F4-2C93-4C8C-85C0-6CDF8FADE897} + {46AB3663-0FE2-4E44-A9FD-67AFA69611C6} = {3801D850-9F29-451E-84FD-A85192195CD7} + {85316CEE-D995-44FF-A10D-4B23E983910C} = {A88DBDC2-DB29-4F80-82BB-B8D511E4A495} + {2B38DDA0-4007-4BA3-93B4-017071E68E19} = {A88DBDC2-DB29-4F80-82BB-B8D511E4A495} + {2E319AE8-ACC3-49AD-A9F4-E0FAFBECAFF4} = {A88DBDC2-DB29-4F80-82BB-B8D511E4A495} + {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731} = {2B38DDA0-4007-4BA3-93B4-017071E68E19} + {15698F80-DFB5-485A-9B76-074ACA1A7D8D} = {85316CEE-D995-44FF-A10D-4B23E983910C} + {12D7F445-1A22-4695-B174-6FC44C806377} = {2E319AE8-ACC3-49AD-A9F4-E0FAFBECAFF4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/BuildingBlocks/design/CodeMap.dgml b/design/CodeMap.dgml similarity index 100% rename from src/BuildingBlocks/design/CodeMap.dgml rename to design/CodeMap.dgml diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs rename to src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs rename to src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs rename to src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs rename to src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs diff --git a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj new file mode 100644 index 000000000..60c4173a3 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs rename to src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa - Backup.Contrib.StackSdks.Dcc.csproj b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj similarity index 60% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa - Backup.Contrib.StackSdks.Dcc.csproj rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj index 5f83a5972..d8fac4d15 100644 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa - Backup.Contrib.StackSdks.Dcc.csproj +++ b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs rename to src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs rename to src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj similarity index 72% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj rename to src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj index ed98caad6..fc833a901 100644 --- a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj +++ b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs rename to src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs rename to src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs rename to src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs rename to src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs rename to src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Properties.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Properties.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/SectionTypes.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/SectionTypes.cs diff --git a/src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs rename to src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/_Imports.cs diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj b/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj similarity index 83% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj rename to src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj index a241a60f8..c22e10cd7 100644 --- a/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj +++ b/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj @@ -15,8 +15,7 @@ - + - diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs b/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs similarity index 100% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs rename to src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs b/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs similarity index 100% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs rename to src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs rename to src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs rename to src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj rename to src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs rename to src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs rename to src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/_Imports.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStrings.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStrings.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/TimestampType.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/TimestampType.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDistributedLock.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDistributedLock.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IMasaDbContext.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IMasaDbContext.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/SequentialGuid.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/SequentialGuid.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/Snowflake.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/Snowflake.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/_Imports.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data/_Imports.cs rename to src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/_Imports.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/IMapping.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/IMapping.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/IMapping.cs rename to src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/IMapping.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Mapper.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Mapper.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Mapper.cs rename to src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Mapper.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj rename to src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs rename to src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs rename to src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/_Imports.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.Mapping/_Imports.cs rename to src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/_Imports.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj rename to src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs rename to src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs rename to src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/CommitState.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs rename to src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/CommitState.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/EntityState.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs rename to src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/EntityState.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/ITransaction.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs rename to src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/ITransaction.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs rename to src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs rename to src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs rename to src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj similarity index 68% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj rename to src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj index 876b59650..c4592d734 100644 --- a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj +++ b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs rename to src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/_Imports.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj new file mode 100644 index 000000000..5a09c7f7a --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj @@ -0,0 +1,16 @@ + + + + net6.0 + enable + enable + + + + + + + + + + diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs rename to src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj b/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj similarity index 85% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj rename to src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj index fb220f4c5..7fda59921 100644 --- a/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj +++ b/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs b/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs similarity index 100% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs rename to src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs b/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs similarity index 100% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs rename to src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs b/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs similarity index 100% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs rename to src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs diff --git a/src/BuildingBlocks/Directory.Build.props b/src/BuildingBlocks/Directory.Build.props deleted file mode 100644 index 628190679..000000000 --- a/src/BuildingBlocks/Directory.Build.props +++ /dev/null @@ -1,20 +0,0 @@ - - - 6.0.0 - 2.2.3 - 16.9.4 - 3.0.2 - 3.19.1 - - $(AssemblyName) - packageIcon.png - masastack - © masastack Corporation. All rights reserved. - packageIcon.png - https://github.com/masastack/Masa.BuildingBlocks - git - true - $(MSBuildThisFileDirectory) - LICENSE.txt - - diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Event.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Event.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs rename to src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs rename to src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs rename to src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs rename to src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs rename to src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs rename to src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs rename to src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs rename to src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs rename to src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj new file mode 100644 index 000000000..ea60cc945 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs rename to src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs diff --git a/src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Identity/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs rename to src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IConvertProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IConvertProvider.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolation.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolation.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IParserProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IParserProvider.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj similarity index 80% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj index efde41b45..a4f2b3006 100644 --- a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj +++ b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs diff --git a/src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs rename to src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/_Imports.cs diff --git a/src/BuildingBlocks/Masa.BuildingBlocks.sln b/src/BuildingBlocks/Masa.BuildingBlocks.sln deleted file mode 100644 index daac12ade..000000000 --- a/src/BuildingBlocks/Masa.BuildingBlocks.sln +++ /dev/null @@ -1,285 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31521.260 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{FBD326D3-E59C-433E-A88E-14E179E3093D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "I18n", "I18n", "{EA2668AF-28E3-42C5-9FA5-8C9FF377180E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{022D6FF5-4B65-4213-9A97-C69E2B2F99E1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Observability", "Observability", "{75050CBC-A0F2-408A-A582-54EF37450B29}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{509BDB5A-5D32-478F-BF27-F0470C18C7C9}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{8C39C640-0E8A-43A7-890C-9742B6B70AA4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{593A3114-D1E0-47ED-BC37-58E08886175B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testable", "Testable", "{57AD498B-D9AF-4479-8C14-45507F6509F5}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{9CB643CA-AA09-46E7-8CB9-E1D55E84B32B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{64FB8703-E922-45DE-9D01-3FE9EFE56727}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{77D17E30-CB7C-4DD7-8CF1-9D5350FF2304}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6ED365E6-4A1A-499F-85FB-F22E865CA4BA}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "design", "design", "{43157B67-5CDB-4D28-9095-9586C685CA6B}" - ProjectSection(SolutionItems) = preProject - design\CodeMap.dgml = design\CodeMap.dgml - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{884D1A0A-A24F-4ED9-BBFE-DCC4E47CF26D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.MinimalAPIs", "src\Service\Masa.BuildingBlocks.Service.MinimalAPIs\Masa.BuildingBlocks.Service.MinimalAPIs.csproj", "{F128E74B-CEC4-4915-AEE2-FF69E60D17F0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete", "src\SearchEngine\Masa.BuildingBlocks.SearchEngine.AutoComplete\Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj", "{9782B9B5-22D0-432A-9BC5-D830C9478D38}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing", "src\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj", "{6175D1D5-8007-4951-BF12-0064B8201C35}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.Events", "src\Dispatcher\Masa.BuildingBlocks.Dispatcher.Events\Masa.BuildingBlocks.Dispatcher.Events.csproj", "{EECA2E9C-36B4-4DCE-93F7-487955B6260E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.IntegrationEvents", "src\Dispatcher\Masa.BuildingBlocks.Dispatcher.IntegrationEvents\Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj", "{4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Contracts", "src\Data\Masa.BuildingBlocks.Data.Contracts\Masa.BuildingBlocks.Data.Contracts.csproj", "{B735824E-D918-4140-AE94-CA4172BF59EB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.UoW", "src\Data\Masa.BuildingBlocks.Data.UoW\Masa.BuildingBlocks.Data.UoW.csproj", "{41F94385-3EAC-4617-8C2B-74D606B0A6A6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration", "src\Configuration\Masa.BuildingBlocks.Configuration\Masa.BuildingBlocks.Configuration.csproj", "{E86483C1-1479-453A-8ABC-35DAC95AC056}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain", "src\Ddd\Masa.BuildingBlocks.Ddd.Domain\Masa.BuildingBlocks.Ddd.Domain.csproj", "{7B99E2A1-95AE-4C98-8C06-A5CE43969512}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.Cqrs", "src\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj", "{10CC5E31-EE6C-440B-A71F-9E3C8608410D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration.Tests", "test\Masa.BuildingBlocks.Configuration.Tests\Masa.BuildingBlocks.Configuration.Tests.csproj", "{F48B8455-B7A2-402C-8F88-16733A825EAF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Pm", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Pm\Masa.BuildingBlocks.StackSdks.Pm.csproj", "{5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolation", "src\Isolation\Masa.BuildingBlocks.Isolation\Masa.BuildingBlocks.Isolation.csproj", "{5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{4CC735F3-DB32-4D9D-863D-BB6E1BA362B9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Storage.ObjectStorage", "src\Storage\Masa.BuildingBlocks.Storage.ObjectStorage\Masa.BuildingBlocks.Storage.ObjectStorage.csproj", "{D52E223F-F406-47A7-BF3E-924DC2D74981}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{F8681808-45F3-4C2D-8A37-D24C0A3414A5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Mapping", "src\Data\Masa.BuildingBlocks.Data.Mapping\Masa.BuildingBlocks.Data.Mapping.csproj", "{EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data", "src\Data\Masa.BuildingBlocks.Data\Masa.BuildingBlocks.Data.csproj", "{4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Contracts", "src\Service\Masa.BuildingBlocks.Service.Contracts\Masa.BuildingBlocks.Service.Contracts.csproj", "{775797E2-8576-4050-8649-18AAD00D0A87}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.MappingExtensions", "src\Data\Masa.BuildingBlocks.Data.MappingExtensions\Masa.BuildingBlocks.Data.MappingExtensions.csproj", "{42D62996-F3FA-406F-AECD-BEACE557E0DB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{7078E83D-778C-4CE0-829F-7F0AD969361E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Cache", "src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Cache\Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj", "{CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{639F5AB4-3648-4AFE-95E3-5909C054E39C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\Authentication\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{701DF095-CF25-4311-9129-279A1834D8A3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Scheduler", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Scheduler\Masa.BuildingBlocks.StackSdks.Scheduler.csproj", "{E9B586D1-CCEF-450E-9E29-E102B141C32F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth.Contracts", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Auth.Contracts\Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj", "{A006D835-D5A1-440E-A55A-58BE27794515}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Auth\Masa.BuildingBlocks.StackSdks.Auth.csproj", "{8EE885E8-7D15-4810-9E1B-871089319080}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Dcc", "src\StackSdks\Masa.BuildingBlocks.StackSdks.Dcc\Masa.BuildingBlocks.StackSdks.Dcc.csproj", "{BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.Service.Caller", "src\Service\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{C4BF6451-134A-4113-8B13-5F8CE95E1B72}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{C79B289A-DCFA-4763-BF44-55ED03E7E5BA}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\Identity\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{F9178604-E581-4C7B-B5F2-936231ED2CC1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F128E74B-CEC4-4915-AEE2-FF69E60D17F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F128E74B-CEC4-4915-AEE2-FF69E60D17F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F128E74B-CEC4-4915-AEE2-FF69E60D17F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F128E74B-CEC4-4915-AEE2-FF69E60D17F0}.Release|Any CPU.Build.0 = Release|Any CPU - {9782B9B5-22D0-432A-9BC5-D830C9478D38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9782B9B5-22D0-432A-9BC5-D830C9478D38}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9782B9B5-22D0-432A-9BC5-D830C9478D38}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9782B9B5-22D0-432A-9BC5-D830C9478D38}.Release|Any CPU.Build.0 = Release|Any CPU - {6175D1D5-8007-4951-BF12-0064B8201C35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6175D1D5-8007-4951-BF12-0064B8201C35}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6175D1D5-8007-4951-BF12-0064B8201C35}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6175D1D5-8007-4951-BF12-0064B8201C35}.Release|Any CPU.Build.0 = Release|Any CPU - {EECA2E9C-36B4-4DCE-93F7-487955B6260E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EECA2E9C-36B4-4DCE-93F7-487955B6260E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EECA2E9C-36B4-4DCE-93F7-487955B6260E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EECA2E9C-36B4-4DCE-93F7-487955B6260E}.Release|Any CPU.Build.0 = Release|Any CPU - {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE}.Release|Any CPU.Build.0 = Release|Any CPU - {B735824E-D918-4140-AE94-CA4172BF59EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B735824E-D918-4140-AE94-CA4172BF59EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B735824E-D918-4140-AE94-CA4172BF59EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B735824E-D918-4140-AE94-CA4172BF59EB}.Release|Any CPU.Build.0 = Release|Any CPU - {41F94385-3EAC-4617-8C2B-74D606B0A6A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41F94385-3EAC-4617-8C2B-74D606B0A6A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41F94385-3EAC-4617-8C2B-74D606B0A6A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41F94385-3EAC-4617-8C2B-74D606B0A6A6}.Release|Any CPU.Build.0 = Release|Any CPU - {E86483C1-1479-453A-8ABC-35DAC95AC056}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E86483C1-1479-453A-8ABC-35DAC95AC056}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E86483C1-1479-453A-8ABC-35DAC95AC056}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E86483C1-1479-453A-8ABC-35DAC95AC056}.Release|Any CPU.Build.0 = Release|Any CPU - {7B99E2A1-95AE-4C98-8C06-A5CE43969512}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7B99E2A1-95AE-4C98-8C06-A5CE43969512}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B99E2A1-95AE-4C98-8C06-A5CE43969512}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7B99E2A1-95AE-4C98-8C06-A5CE43969512}.Release|Any CPU.Build.0 = Release|Any CPU - {10CC5E31-EE6C-440B-A71F-9E3C8608410D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {10CC5E31-EE6C-440B-A71F-9E3C8608410D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {10CC5E31-EE6C-440B-A71F-9E3C8608410D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {10CC5E31-EE6C-440B-A71F-9E3C8608410D}.Release|Any CPU.Build.0 = Release|Any CPU - {F48B8455-B7A2-402C-8F88-16733A825EAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F48B8455-B7A2-402C-8F88-16733A825EAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F48B8455-B7A2-402C-8F88-16733A825EAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F48B8455-B7A2-402C-8F88-16733A825EAF}.Release|Any CPU.Build.0 = Release|Any CPU - {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB}.Release|Any CPU.Build.0 = Release|Any CPU - {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217}.Release|Any CPU.Build.0 = Release|Any CPU - {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8}.Release|Any CPU.Build.0 = Release|Any CPU - {D52E223F-F406-47A7-BF3E-924DC2D74981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D52E223F-F406-47A7-BF3E-924DC2D74981}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D52E223F-F406-47A7-BF3E-924DC2D74981}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D52E223F-F406-47A7-BF3E-924DC2D74981}.Release|Any CPU.Build.0 = Release|Any CPU - {F8681808-45F3-4C2D-8A37-D24C0A3414A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F8681808-45F3-4C2D-8A37-D24C0A3414A5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F8681808-45F3-4C2D-8A37-D24C0A3414A5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F8681808-45F3-4C2D-8A37-D24C0A3414A5}.Release|Any CPU.Build.0 = Release|Any CPU - {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB}.Release|Any CPU.Build.0 = Release|Any CPU - {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855}.Release|Any CPU.Build.0 = Release|Any CPU - {775797E2-8576-4050-8649-18AAD00D0A87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {775797E2-8576-4050-8649-18AAD00D0A87}.Debug|Any CPU.Build.0 = Debug|Any CPU - {775797E2-8576-4050-8649-18AAD00D0A87}.Release|Any CPU.ActiveCfg = Release|Any CPU - {775797E2-8576-4050-8649-18AAD00D0A87}.Release|Any CPU.Build.0 = Release|Any CPU - {42D62996-F3FA-406F-AECD-BEACE557E0DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {42D62996-F3FA-406F-AECD-BEACE557E0DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {42D62996-F3FA-406F-AECD-BEACE557E0DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {42D62996-F3FA-406F-AECD-BEACE557E0DB}.Release|Any CPU.Build.0 = Release|Any CPU - {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B}.Release|Any CPU.Build.0 = Release|Any CPU - {639F5AB4-3648-4AFE-95E3-5909C054E39C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {639F5AB4-3648-4AFE-95E3-5909C054E39C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {639F5AB4-3648-4AFE-95E3-5909C054E39C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {639F5AB4-3648-4AFE-95E3-5909C054E39C}.Release|Any CPU.Build.0 = Release|Any CPU - {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD}.Release|Any CPU.Build.0 = Release|Any CPU - {701DF095-CF25-4311-9129-279A1834D8A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {701DF095-CF25-4311-9129-279A1834D8A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {701DF095-CF25-4311-9129-279A1834D8A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {701DF095-CF25-4311-9129-279A1834D8A3}.Release|Any CPU.Build.0 = Release|Any CPU - {E9B586D1-CCEF-450E-9E29-E102B141C32F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E9B586D1-CCEF-450E-9E29-E102B141C32F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E9B586D1-CCEF-450E-9E29-E102B141C32F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E9B586D1-CCEF-450E-9E29-E102B141C32F}.Release|Any CPU.Build.0 = Release|Any CPU - {A006D835-D5A1-440E-A55A-58BE27794515}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A006D835-D5A1-440E-A55A-58BE27794515}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A006D835-D5A1-440E-A55A-58BE27794515}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A006D835-D5A1-440E-A55A-58BE27794515}.Release|Any CPU.Build.0 = Release|Any CPU - {8EE885E8-7D15-4810-9E1B-871089319080}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8EE885E8-7D15-4810-9E1B-871089319080}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8EE885E8-7D15-4810-9E1B-871089319080}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8EE885E8-7D15-4810-9E1B-871089319080}.Release|Any CPU.Build.0 = Release|Any CPU - {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6}.Release|Any CPU.Build.0 = Release|Any CPU - {C4BF6451-134A-4113-8B13-5F8CE95E1B72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C4BF6451-134A-4113-8B13-5F8CE95E1B72}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C4BF6451-134A-4113-8B13-5F8CE95E1B72}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C4BF6451-134A-4113-8B13-5F8CE95E1B72}.Release|Any CPU.Build.0 = Release|Any CPU - {F9178604-E581-4C7B-B5F2-936231ED2CC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F9178604-E581-4C7B-B5F2-936231ED2CC1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F9178604-E581-4C7B-B5F2-936231ED2CC1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F9178604-E581-4C7B-B5F2-936231ED2CC1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {FBD326D3-E59C-433E-A88E-14E179E3093D} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {EA2668AF-28E3-42C5-9FA5-8C9FF377180E} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {022D6FF5-4B65-4213-9A97-C69E2B2F99E1} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {75050CBC-A0F2-408A-A582-54EF37450B29} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {509BDB5A-5D32-478F-BF27-F0470C18C7C9} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {8C39C640-0E8A-43A7-890C-9742B6B70AA4} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {593A3114-D1E0-47ED-BC37-58E08886175B} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {57AD498B-D9AF-4479-8C14-45507F6509F5} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {9CB643CA-AA09-46E7-8CB9-E1D55E84B32B} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {64FB8703-E922-45DE-9D01-3FE9EFE56727} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {884D1A0A-A24F-4ED9-BBFE-DCC4E47CF26D} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {F128E74B-CEC4-4915-AEE2-FF69E60D17F0} = {593A3114-D1E0-47ED-BC37-58E08886175B} - {9782B9B5-22D0-432A-9BC5-D830C9478D38} = {8C39C640-0E8A-43A7-890C-9742B6B70AA4} - {6175D1D5-8007-4951-BF12-0064B8201C35} = {509BDB5A-5D32-478F-BF27-F0470C18C7C9} - {EECA2E9C-36B4-4DCE-93F7-487955B6260E} = {FBD326D3-E59C-433E-A88E-14E179E3093D} - {4A2ECF39-8999-4C18-83D4-6587A1D9D9EE} = {FBD326D3-E59C-433E-A88E-14E179E3093D} - {B735824E-D918-4140-AE94-CA4172BF59EB} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} - {41F94385-3EAC-4617-8C2B-74D606B0A6A6} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} - {E86483C1-1479-453A-8ABC-35DAC95AC056} = {884D1A0A-A24F-4ED9-BBFE-DCC4E47CF26D} - {7B99E2A1-95AE-4C98-8C06-A5CE43969512} = {9CB643CA-AA09-46E7-8CB9-E1D55E84B32B} - {10CC5E31-EE6C-440B-A71F-9E3C8608410D} = {509BDB5A-5D32-478F-BF27-F0470C18C7C9} - {F48B8455-B7A2-402C-8F88-16733A825EAF} = {6ED365E6-4A1A-499F-85FB-F22E865CA4BA} - {1FCBC928-0BD4-4BBC-BDFD-3C5BEB85D9DB} = {6ED365E6-4A1A-499F-85FB-F22E865CA4BA} - {5692C8E2-7D58-4BB6-B20A-F6CD8C1A4217} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {5E3CAD7F-B036-4CA0-9473-4CCA4F5AC5A8} = {022D6FF5-4B65-4213-9A97-C69E2B2F99E1} - {4CC735F3-DB32-4D9D-863D-BB6E1BA362B9} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {D52E223F-F406-47A7-BF3E-924DC2D74981} = {4CC735F3-DB32-4D9D-863D-BB6E1BA362B9} - {F8681808-45F3-4C2D-8A37-D24C0A3414A5} = {6ED365E6-4A1A-499F-85FB-F22E865CA4BA} - {EA5B1CAD-2275-43F3-9A50-7CE1FD94ACDB} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} - {4B9BF713-E0BC-4CAB-9D8D-353C18EDC855} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} - {775797E2-8576-4050-8649-18AAD00D0A87} = {593A3114-D1E0-47ED-BC37-58E08886175B} - {42D62996-F3FA-406F-AECD-BEACE557E0DB} = {64FB8703-E922-45DE-9D01-3FE9EFE56727} - {7078E83D-778C-4CE0-829F-7F0AD969361E} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {CF05242F-1DBA-40E9-BBC4-7C4D6A69BE2B} = {7078E83D-778C-4CE0-829F-7F0AD969361E} - {639F5AB4-3648-4AFE-95E3-5909C054E39C} = {7078E83D-778C-4CE0-829F-7F0AD969361E} - {F77F36FE-82A1-4BEC-8AB2-55F298AAADCD} = {7078E83D-778C-4CE0-829F-7F0AD969361E} - {701DF095-CF25-4311-9129-279A1834D8A3} = {7078E83D-778C-4CE0-829F-7F0AD969361E} - {E9B586D1-CCEF-450E-9E29-E102B141C32F} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {A006D835-D5A1-440E-A55A-58BE27794515} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {8EE885E8-7D15-4810-9E1B-871089319080} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {BDBF100E-79F9-4B99-8D66-2CFCC790E9F6} = {5DFAF4A2-ECB5-46E4-904D-1EA5F48B2D48} - {C4BF6451-134A-4113-8B13-5F8CE95E1B72} = {593A3114-D1E0-47ED-BC37-58E08886175B} - {C79B289A-DCFA-4763-BF44-55ED03E7E5BA} = {77D17E30-CB7C-4DD7-8CF1-9D5350FF2304} - {F9178604-E581-4C7B-B5F2-936231ED2CC1} = {C79B289A-DCFA-4763-BF44-55ED03E7E5BA} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} - EndGlobalSection -EndGlobal diff --git a/src/BuildingBlocks/README.md b/src/BuildingBlocks/README.md deleted file mode 100644 index e2c362c1d..000000000 --- a/src/BuildingBlocks/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# - -[中](README.zh-CN.md) | EN - -# MASA.BuildingBlocks [Archived, please see [MASA.Framework](https://github.com/masastack/MASA.Framework)] -Building blocks of the MASA Stack, provides a unified interface standard for [MASA Contrib](https://github.com/masastack/MASA.Contrib/blob/main/README.md) implementation specifications and process connector. - - - -## Why choose MASA.BuildingBlocks? -* Supports monolithic architecture and distributed architecture -* Based on the .Net main push technology stack, no magic modification, low learning cost -* Provide a unified interface standard, with the best practices of MASA Contrib, but not limited to [MASA Contrib](https://github.com/masastack/MASA.Contrib/blob/main/README.md) , anyone can implement their own Contrib based on MASA BuildingBlocks, re-customize some features - - - -## Roadmap -* [Release notes](https://github.com/masastack/MASA.BuildingBlocks/releases) -* [Latest roadmap](https://github.com/masastack/MASA.BuildingBlocks/issues/39) - - - -## Features -* AutoComplete: make searching easier -* Configuration: Configuration Center -* CQRS -* DDD -* Dispatcher -* Isolation: Support physical isolation, logical isolation -* MinimalAPI: Supports API classification aggregation similar to Controller -* UoW: unit of work -* Storage: cloud storage - - - -## How to contribute - -1. Fork & Clone -2. Create Feature_xxx branch -3. Commit with commit message, like `feat(Isolation): Support physical isolation, logical isolation` -4. Create Pull Request - -If you wish to contribute, please [Pull Request](https://github.com/masastack/MASA.BuildingBlocks/pulls), or send us a [Report Bug](https://github.com/masastack/MASA.BuildingBlocks/issues/new) . - - - -## Contributors - -Thanks to all the friends who have contributed to this project. - - - - - - - -## code of conduct - -This project adopts the Code of Conduct as defined by the Contributors Covenant to clarify the expected behavior of our community. For more information see [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). - - - -## ☀️ License Statement - -[![MASA.BuildingBlocks](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) - -Copyright (c) 2021-present MASA Stack diff --git a/src/BuildingBlocks/README.zh-CN.md b/src/BuildingBlocks/README.zh-CN.md deleted file mode 100644 index 11e25a105..000000000 --- a/src/BuildingBlocks/README.zh-CN.md +++ /dev/null @@ -1,65 +0,0 @@ -中 | [EN](README.md) - -# MASA.BuildingBlocks [归档, 请看 [MASA.Framework](https://github.com/masastack/MASA.Framework)] -MASA Stack的构建块,提供统一的接口标准,用于[MASA Contrib](https://github.com/masastack/MASA.Contrib/blob/main/README.zh-CN.md)的实现规约和流程衔接。 - - - -## 为什么选择MASA.BuildingBlocks? -* 支持单体架构,也支持分布式架构 -* 基于.Net主推技术栈,不魔改,学习成本低 -* 提供统一的接口标准,有MASA Contrib的最佳实践,但不局限于[MASA Contrib](https://github.com/masastack/MASA.Contrib/blob/main/README.zh-CN.md),任何人都可以基于MASA BuildingBlocks实现自己的Contrib,重新定制某些特性 - - - -## 路线图 -* [发行说明](https://github.com/masastack/MASA.BuildingBlocks/releases) -* [最新路线图](https://github.com/masastack/MASA.BuildingBlocks/issues/39) - - - -## 特性 -* AutoComplete: 使搜索更简单 -* Configuration: 配置中心 -* CQRS -* DDD -* Dispatcher -* Isolation: 支持物理隔离、逻辑隔离 -* MinimalAPI: 支持类似Controller的API分类聚合 -* UoW: 工作单元 -* Storage: 云存储 - - - -## 如何贡献 - -1. Fork & Clone -2. Create Feature_xxx branch -3. Commit with commit message, like `feat(Isolation): Support physical isolation, logical isolation` -4. Create Pull Request - -如果你希望参与贡献,欢迎 [Pull Request](https://github.com/masastack/MASA.BuildingBlocks/pulls),或给我们 [报告 Bug](https://github.com/masastack/MASA.BuildingBlocks/issues/new) 。 - - - -## 贡献者 - -感谢所有为本项目做出过贡献的朋友。 - - - - - - - -## 行为准则 - -本项目采用了《贡献者公约》所定义的行为准则,以明确我们社区的预期行为。更多信息请见 [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). - - - -## ☀️ 许可声明 - -[![MASA.BuildingBlocks](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) - -Copyright (c) 2021-present MASA Stack diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs similarity index 100% rename from src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs rename to src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs similarity index 100% rename from src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs rename to src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs similarity index 100% rename from src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs rename to src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs diff --git a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj new file mode 100644 index 000000000..96f94c1fa --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs similarity index 100% rename from src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs rename to src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs similarity index 100% rename from src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs rename to src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs similarity index 100% rename from src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs rename to src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs rename to src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj b/src/BuildingBlocks/ReadWriteSpliting/EventSourcing/src/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj similarity index 100% rename from src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj rename to src/BuildingBlocks/ReadWriteSpliting/EventSourcing/src/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs diff --git a/src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs similarity index 100% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj b/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj similarity index 81% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj rename to src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj index 9ffa2ae34..6c18982af 100644 --- a/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj +++ b/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs similarity index 100% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs diff --git a/src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs similarity index 100% rename from src/BuildingBlocks/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs rename to src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/CallerBase.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/CallerBase.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICaller.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICaller.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs rename to src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/_Imports.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs b/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs rename to src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj b/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj rename to src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs b/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs rename to src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs b/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs rename to src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs b/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs rename to src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs b/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs rename to src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs diff --git a/src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj b/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj similarity index 100% rename from src/BuildingBlocks/src/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj rename to src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs rename to src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs rename to src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj rename to src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs rename to src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs rename to src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs rename to src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj similarity index 64% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj index 5f01c06c5..c2e00e18e 100644 --- a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj +++ b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs rename to src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs rename to src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs rename to src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs diff --git a/src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs rename to src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs diff --git a/src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs similarity index 100% rename from src/BuildingBlocks/src/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs rename to src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj b/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj deleted file mode 100644 index efd405435..000000000 --- a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj b/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj deleted file mode 100644 index cb28a2af4..000000000 --- a/src/BuildingBlocks/src/Ddd/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - diff --git a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj b/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj deleted file mode 100644 index c530b0d9f..000000000 --- a/src/BuildingBlocks/src/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj b/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj deleted file mode 100644 index 2438d134a..000000000 --- a/src/BuildingBlocks/src/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj new file mode 100644 index 000000000..1222132ec --- /dev/null +++ b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.md b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.md similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.md rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.md diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs rename to src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj new file mode 100644 index 000000000..419151d21 --- /dev/null +++ b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs rename to src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj similarity index 54% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj rename to src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj index b4441e7be..e9b51e426 100644 --- a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj +++ b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md rename to src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md rename to src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs rename to src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs rename to src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs rename to src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs rename to src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs rename to src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs similarity index 100% rename from src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs rename to src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ConfigurationOptions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ConfigurationOptions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultConfigurationApi.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultConfigurationApi.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj similarity index 68% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj index 2447115a0..c362d33f8 100644 --- a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj +++ b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationProvider.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationProvider.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationSource.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationSource.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaRelationOptions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaRelationOptions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.md b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.md similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.md rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.md diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.zh-CN.md diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration/_Imports.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/_Imports.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration/_Imports.cs rename to src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/_Imports.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj similarity index 75% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj index be5b9abb1..3c9bdfdf4 100644 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj +++ b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj similarity index 68% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj index a4416f595..fcbea1bf7 100644 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj +++ b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj similarity index 94% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj index a1ba1d7c7..c122ce383 100644 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj +++ b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj @@ -42,7 +42,7 @@ - + diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/_Imports.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/_Imports.cs rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/_Imports.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/appsettings.json b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/appsettings.json similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/appsettings.json rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/appsettings.json diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/customAppConfig.json b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/customAppConfig.json similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/customAppConfig.json rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/customAppConfig.json diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/rabbitMq.json b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/rabbitMq.json similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/rabbitMq.json rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/rabbitMq.json diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/redis.json b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/redis.json similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.Tests/redis.json rename to src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/redis.json diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj new file mode 100644 index 000000000..1d1abac56 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs similarity index 100% rename from src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs rename to src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj similarity index 75% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj index 30f97d39c..83af98cf2 100644 --- a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj +++ b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj @@ -33,9 +33,9 @@ - - - + + + diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json diff --git a/src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json similarity index 100% rename from src/Contrib/test/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json rename to src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj similarity index 58% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj index 3c56f3d53..66ef7b261 100644 --- a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj +++ b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/_Imports.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.Contracts.EF/_Imports.cs rename to src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/_Imports.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs b/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs rename to src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj b/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj similarity index 90% rename from src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj rename to src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj index a614fdd84..13756c016 100644 --- a/src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj +++ b/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs b/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs rename to src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs rename to src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs rename to src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs rename to src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs diff --git a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj new file mode 100644 index 000000000..5cba405b0 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md rename to src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs rename to src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs rename to src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs diff --git a/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs b/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs similarity index 100% rename from src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs rename to src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs diff --git a/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj b/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj similarity index 80% rename from src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj rename to src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj index b5abf503c..1f13d9782 100644 --- a/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj +++ b/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs b/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs rename to src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj similarity index 76% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj index 8e8fbcf60..5ad1dffca 100644 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj +++ b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj similarity index 76% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj index 15d85ee59..360b2e8a0 100644 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj +++ b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj similarity index 76% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj index 84f5b69de..1a14c8e67 100644 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj +++ b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj similarity index 77% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj index 7b7acbe4a..4b4fa2879 100644 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj +++ b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj similarity index 79% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj index 3f84ebda1..d9d594b3e 100644 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj +++ b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj new file mode 100644 index 000000000..c635f5796 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs diff --git a/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs b/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs similarity index 100% rename from src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs rename to src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs diff --git a/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj b/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj similarity index 100% rename from src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj rename to src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj diff --git a/src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs rename to src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj similarity index 50% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj index c0353a4c1..f89361a32 100644 --- a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj +++ b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj @@ -14,11 +14,11 @@ - - - - - + + + + + diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj similarity index 70% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj index 3bb6fe0aa..b876c07fa 100644 --- a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj +++ b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj @@ -18,10 +18,8 @@ - - - + + - diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs rename to src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj similarity index 73% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj rename to src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj index 1730198a6..fdc771a75 100644 --- a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj +++ b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs rename to src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md rename to src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md rename to src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs rename to src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs rename to src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj similarity index 73% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj rename to src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj index 1730198a6..fdc771a75 100644 --- a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md rename to src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md rename to src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs rename to src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs rename to src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs rename to src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj b/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj similarity index 100% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj rename to src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs similarity index 100% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs rename to src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs rename to src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs rename to src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj similarity index 80% rename from src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj rename to src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj index 673bb2d99..c37414772 100644 --- a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj +++ b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs rename to src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs rename to src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj similarity index 72% rename from src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj rename to src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj index 6c43d7f04..bdb200574 100644 --- a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj +++ b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj @@ -1,4 +1,4 @@ - + Exe @@ -15,8 +15,10 @@ - + + - + + diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs rename to src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs diff --git a/src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj new file mode 100644 index 000000000..8a2eac792 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj new file mode 100644 index 000000000..dcdabc675 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.md b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.md similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.md rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.md diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs similarity index 100% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs rename to src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs b/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs similarity index 100% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs rename to src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj b/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj similarity index 76% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj rename to src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj index 8d2a9951b..b0a1cf434 100644 --- a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj +++ b/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj similarity index 61% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj index e9ae0a831..a5ead0346 100644 --- a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj +++ b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.md similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.md diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs rename to src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj similarity index 70% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj index 573aa17dd..d951bf543 100644 --- a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj +++ b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj @@ -16,8 +16,8 @@ - - + + diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs diff --git a/src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs rename to src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Internal/Const.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Internal/Const.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Internal/Const.cs rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Internal/Const.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj similarity index 51% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj index 219771c5d..12be8ba78 100644 --- a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj +++ b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/README.md b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.md similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/README.md rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.md diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.zh-CN.md diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Transaction.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Transaction.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/Transaction.cs rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Transaction.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs diff --git a/src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/_Imports.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/_Imports.cs similarity index 100% rename from src/Contrib/src/Data/Masa.Contrib.Data.UoW.EF/_Imports.cs rename to src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/_Imports.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs rename to src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj similarity index 82% rename from src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj rename to src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj index a4c006863..8b69c1b7f 100644 --- a/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj +++ b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj @@ -37,9 +37,9 @@ - - - + + + diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs rename to src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs rename to src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs rename to src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs diff --git a/src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json similarity index 100% rename from src/Contrib/test/Data/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json rename to src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj similarity index 76% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj index f2979af49..c6cb4decf 100644 --- a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj +++ b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.md similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.md diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/DomainEventBus.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainEventBus.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/DomainEventBus.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainEventBus.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/DomainService.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainService.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/DomainService.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainService.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj similarity index 76% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj index fb708972f..98b48f536 100644 --- a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj +++ b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/README.md b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.md similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/README.md rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.md diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.zh-CN.md diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/_Imports.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/_Imports.cs similarity index 100% rename from src/Contrib/src/Ddd/Masa.Contrib.Ddd.Domain/_Imports.cs rename to src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/_Imports.cs diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs similarity index 100% rename from src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs rename to src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs similarity index 100% rename from src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs rename to src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs similarity index 100% rename from src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs rename to src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj similarity index 83% rename from src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj rename to src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj index 227f5d15f..9d6058b55 100644 --- a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj +++ b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj @@ -18,8 +18,8 @@ - - - + + + diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs similarity index 100% rename from src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs rename to src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs diff --git a/src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs rename to src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs diff --git a/src/Contrib/Directory.Build.props b/src/Contrib/Directory.Build.props deleted file mode 100644 index d57b293e4..000000000 --- a/src/Contrib/Directory.Build.props +++ /dev/null @@ -1,20 +0,0 @@ - - - 6.0.0 - 0.13.1 - 2.2.3 - 16.9.4 - 3.0.2 - 4.16.1 - 7.3.0 - 1.5.0 - 3.19.1 - 1.0.4 - 11.1.0 - 11.1.2 - - 1.3.0 - 1.0.0-beta2 - 1.0.0-rc9.3 - - diff --git a/src/Contrib/docs/LoadEvent.md b/src/Contrib/Dispatcher/Events/docs/LoadEvent.md similarity index 100% rename from src/Contrib/docs/LoadEvent.md rename to src/Contrib/Dispatcher/Events/docs/LoadEvent.md diff --git a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs rename to src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs diff --git a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs rename to src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs diff --git a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs rename to src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs diff --git a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs rename to src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs diff --git a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs rename to src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs diff --git a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs rename to src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs diff --git a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj similarity index 85% rename from src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj rename to src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj index 075382f3f..a3e75aa23 100644 --- a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj +++ b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs rename to src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs diff --git a/src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs similarity index 100% rename from src/Contrib/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs rename to src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBus.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBus.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj new file mode 100644 index 000000000..8b7d15700 --- /dev/null +++ b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj @@ -0,0 +1,23 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.md similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.md diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.zh-CN.md diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/_Imports.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs rename to src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj similarity index 68% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj index a6f4ae16e..cd88463e7 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj +++ b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj similarity index 67% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj index 1e592be80..21d79c49d 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj +++ b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj similarity index 67% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj index 1e592be80..21d79c49d 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj +++ b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj similarity index 67% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj index 1e592be80..21d79c49d 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj +++ b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj similarity index 67% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj index 1e592be80..21d79c49d 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj +++ b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj similarity index 67% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj index 1e592be80..21d79c49d 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj +++ b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj similarity index 67% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj index 1e592be80..21d79c49d 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj +++ b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj similarity index 95% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj index d84543741..cac228ab0 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj +++ b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj @@ -26,7 +26,7 @@ - + @@ -36,5 +36,4 @@ - diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj similarity index 70% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj index c892388ae..b1dda57bb 100644 --- a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj +++ b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj similarity index 50% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj index 40d037ca4..e7d2c0000 100644 --- a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj +++ b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj new file mode 100644 index 000000000..d6384daaf --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.md similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.md rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.md diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs similarity index 100% rename from src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj similarity index 89% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj index 2a3bc520e..a6d684bda 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj +++ b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj @@ -25,9 +25,8 @@ - + - diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj similarity index 78% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj index 961dbf481..51a37c31a 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj +++ b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj @@ -24,8 +24,8 @@ - - + + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj similarity index 88% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj index d3810a9c5..ba78a3dd4 100644 --- a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj +++ b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs diff --git a/src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj new file mode 100644 index 000000000..e063714c7 --- /dev/null +++ b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/README.md b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.md similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/README.md rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.md diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/_Imports.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/_Imports.cs similarity index 100% rename from src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/_Imports.cs rename to src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/_Imports.cs diff --git a/src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj b/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj similarity index 90% rename from src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj rename to src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj index 1914264ee..833f48940 100644 --- a/src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj +++ b/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs b/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs similarity index 100% rename from src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs rename to src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs diff --git a/src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs b/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Identity/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs rename to src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs rename to src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs rename to src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilder.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs rename to src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilder.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs rename to src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationDbContextProvider.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs rename to src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationDbContextProvider.cs diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj new file mode 100644 index 000000000..6cd1fbfdf --- /dev/null +++ b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs rename to src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/README.md b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.md similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation/README.md rename to src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.md diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/README.zh-CN.md b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation/README.zh-CN.md rename to src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.zh-CN.md diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/_Imports.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/_Imports.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation/_Imports.cs rename to src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/_Imports.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj similarity index 74% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj rename to src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj index ad5adeef8..38f9cf5fd 100644 --- a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj +++ b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj @@ -23,9 +23,9 @@ - - - + + + diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs rename to src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs rename to src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestIsolation.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestIsolation.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestIsolation.cs rename to src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestIsolation.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestParserProvider.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestParserProvider.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/TestParserProvider.cs rename to src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestParserProvider.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs rename to src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/_Imports.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.Tests/_Imports.cs rename to src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/_Imports.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs rename to src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs rename to src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs diff --git a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj new file mode 100644 index 000000000..c77cd51bc --- /dev/null +++ b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs rename to src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.md similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md rename to src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.md diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md rename to src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs rename to src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj b/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj similarity index 88% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj rename to src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj index b9caa698c..5b30f1403 100644 --- a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj +++ b/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs b/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs rename to src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs b/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs rename to src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs b/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs rename to src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs rename to src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs rename to src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj new file mode 100644 index 000000000..c77cd51bc --- /dev/null +++ b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs rename to src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs rename to src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.md similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md rename to src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.md diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md rename to src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs rename to src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/_Imports.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs rename to src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/_Imports.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj b/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj similarity index 89% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj rename to src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj index 5645c2a13..4746a18e7 100644 --- a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj +++ b/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs b/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs rename to src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs b/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs rename to src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs b/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs rename to src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs rename to src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs rename to src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs rename to src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj similarity index 67% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj rename to src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj index 5111e94f6..1a5395bf9 100644 --- a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj +++ b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.md similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md rename to src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.md diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md rename to src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/_Imports.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/_Imports.cs similarity index 100% rename from src/Contrib/src/Isolation/Masa.Contrib.Isolation.UoW.EF/_Imports.cs rename to src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/_Imports.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj similarity index 60% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj index 215382c3f..8f85213e6 100644 --- a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj +++ b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj @@ -29,12 +29,12 @@ - - - - - - + + + + + + diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj new file mode 100644 index 000000000..609447000 --- /dev/null +++ b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj @@ -0,0 +1,35 @@ + + + + net6.0 + enable + false + enable + + + + + + + + + + + + + Always + + + + + + + + + + + + + + + diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json similarity index 100% rename from src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json rename to src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json diff --git a/src/Contrib/README.md b/src/Contrib/README.md deleted file mode 100644 index 2ca4fdd4c..000000000 --- a/src/Contrib/README.md +++ /dev/null @@ -1,105 +0,0 @@ -[中](README.zh-CN.md) | EN - -[![codecov](https://codecov.io/gh/masastack/MASA.Contrib/branch/main/graph/badge.svg?token=87TPNHUHW2)](https://codecov.io/gh/masastack/MASA.Contrib) - -# MASA.Contrib - -The purpose of MASA.Contrib is based on [MASA.BuildingBlocks](https://github.com/masastack/MASA.BuildingBlocks) to provide open, community driven reusable components for building mesh applications. These components will be used by the [MASA Stack](https://github.com/masastack) and [MASA Labs](https://github.com/masalabs) projects. - - - -## Roadmap -* [Release Notes](https://github.com/masastack/MASA.Contrib/releases) -* [Latest Roadmap](https://github.com/masastack/MASA.Contrib/issues/42) - - - -## Features -* AutoComplete: make searching easier - * [ElasticSearch](./src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md) -* Configuration: Configuration Center - * [Configuration core, provide local configuration](./src/Configuration/Masa.Contrib.Configuration/README.md) - * ConfigurationAPI - * [Dcc](./src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md) -* [CQRS](./src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md) -* Data: - * [EntityFrameworkCore](./src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.md) - * [SqlServer](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md) - * [Pomelo.MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md): Recommend - * [MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md) - * [Sqlite](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md) - * [Cosmos](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md) - * [InMemory](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md) - * [Oracle](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md) - * [PostgreSql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md) - * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EF/): data protocol - * UoW: unit of work - * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EF/README.md) - * IdGenerator: Unique ID generator - * [NormalGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md): Normal Guid - * [SequentialGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md): Sequential Guid - * [Snowflake](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.md): Snowflake id - * [Snowflake.Distributed.Redis](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md): Distributed snowflake id - * Mapping: object mapping - * [Mapster](./src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md) -* [DDD](./src/Ddd/Masa.Contrib.Ddd.Domain/README.md) - * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md): Provide warehousing services -* Dispatcher - * [EventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md): In-process events - * [IntegrationEventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md): Cross-process events - * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md): Provides message management services for cross-process events -* Isolation: Support physical isolation, logical isolation - * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md) - * [MultiEnvironment](./src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md): MultiEnvironment - * [MultiTenant](./src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md): Multi-tenancy -* [MinimalAPI](./src/Service/Masa.Contrib.Service.MinimalAPIs/README.md): Support API classification aggregation similar to Controller -* Storage: cloud storage - * [Aliyun Storage](./src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md) -* Operational capacity - * [Auth](./src/StackSdks/Masa.Contrib.StackSdks.Auth/README.md): Authentication and Authorization - * [Dcc](./src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md): Distributed Configuration Center - * [PM](./src/StackSdks/Masa.Contrib.StackSdks.Pm/README.md): Project Management - * [Scheduler](./src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md): Distributed Scheduler - * [TSC](./src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md): Troubleshooting Console - - - -## How to clone -```` -git clone --recursive https://github.com/masastack/MASA.Contrib.git -```` - - - -## How to contribute - -1. Fork & Clone -2. Create Feature_xxx branch -3. Commit with commit message, like `feat(Isolation): Support physical isolation, logical isolation` -4. Create Pull Request - -If you wish to contribute, please [Pull Request](https://github.com/masastack/MASA.BuildingBlocks/pulls), or send us a [Report Bug](https://github.com/masastack/MASA.BuildingBlocks /issues/new) . - - - -## Contributors - -Thanks to all the friends who have contributed to this project. - - - - - - - -## Code of conduct - -This project adopts the Code of Conduct as defined by the Contributors Covenant to clarify the expected behavior of our community. For more information see [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). - - - -## ☀️ License Statement - -[![MASA.Contrib](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) - -Copyright (c) 2021-present MASA Stack \ No newline at end of file diff --git a/src/Contrib/README.zh-CN.md b/src/Contrib/README.zh-CN.md deleted file mode 100644 index a70304ddd..000000000 --- a/src/Contrib/README.zh-CN.md +++ /dev/null @@ -1,104 +0,0 @@ -中 | [EN](README.md) - -[![codecov](https://codecov.io/gh/masastack/MASA.Contrib/branch/main/graph/badge.svg?token=87TPNHUHW2)](https://codecov.io/gh/masastack/MASA.Contrib) - -# MASA.Contrib - -MASA.Contrib是基于[MASA.BuildingBlocks](https://github.com/masastack/MASA.BuildingBlocks)提供开放, 社区驱动的可重用组件,用于构建网格应用程序。这些组件将被[MASA Stack](https://github.com/masastack)和[MASA Labs](https://github.com/masalabs)等项目使用。 - - - -## 路线图 -* [发行说明](https://github.com/masastack/MASA.Contrib/releases) -* [最新路线图](https://github.com/masastack/MASA.Contrib/issues/42) - - - -## 特性 -* AutoComplete: 使搜索更简单 - * [ElasticSearch](./src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md) -* Configuration: 配置中心 - * [Configuration核心、提供本地配置](./src/Configuration/Masa.Contrib.Configuration/README.zh-CN.md) - * ConfigurationAPI - * [Dcc](./src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md) -* [CQRS](./src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md) -* Data: - * [EntityFrameworkCore](./src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md) - * [SqlServer](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md) - * [Pomelo.MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md): 推荐 - * [MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md) - * [Sqlite](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md) - * [Cosmos](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md) - * [InMemory](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md) - * [Oracle](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md) - * [PostgreSql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md) - * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EF/): 数据规约 - * UoW: 工作单元 - * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md) - * IdGenerator: 唯一ID生成器 - * [NormalGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md): 普通的Guid - * [SequentialGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md): 有序的Guid - * [Snowflake](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md): Single version snowflake id - * [Snowflake.Distributed.Redis](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md): 分布式雪花id - * Mapping: 对象映射 - * [Mapster](./src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md) -* [DDD](./src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md) - * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md): 提供仓储服务 -* Dispatcher - * [EventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md): 进程内事件 - * [IntegrationEventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md): 跨进程事件 - * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md): 为跨进程事件提供消息管理服务 -* Isolation: 支持物理隔离、逻辑隔离 - * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md) - * [MultiEnvironment](./src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md): 多环境 - * [MultiTenant](./src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md): 多租户 -* [MinimalAPI](./src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md): 支持类似Controller的API分类聚合 -* Storage: 云存储 - * [阿里云存储](./src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md) -* 业务能力 - * [Auth](./src/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md): 权限认证 - * [Dcc](./src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md): 分布式配置中心 - * [PM](./src/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md): 项目管理 - * [Scheduler](./src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md): 分布式调度中心 - * [TSC](./src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md): 故障排除平台 - - -## 如何克隆 -``` -git clone --recursive https://github.com/masastack/MASA.Contrib.git -``` - - - -## 如何贡献 - -1. Fork & Clone -2. Create Feature_xxx branch -3. Commit with commit message, like `feat(Isolation): Support physical isolation, logical isolation` -4. Create Pull Request - -如果你希望参与贡献,欢迎 [Pull Request](https://github.com/masastack/MASA.BuildingBlocks/pulls),或给我们 [报告 Bug](https://github.com/masastack/MASA.BuildingBlocks/issues/new) 。 - - - -## 贡献者 - -感谢所有为本项目做出过贡献的朋友。 - - - - - - - -## 行为准则 - -本项目采用了《贡献者公约》所定义的行为准则,以明确我们社区的预期行为。更多信息请见 [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). - - - -## ☀️ 许可声明 - -[![MASA.Contrib](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) - -Copyright (c) 2021-present MASA Stack \ No newline at end of file diff --git a/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs similarity index 100% rename from src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs rename to src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs diff --git a/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj similarity index 72% rename from src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj rename to src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj index 11ba1e3d6..939c33053 100644 --- a/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj +++ b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs similarity index 100% rename from src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs rename to src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs diff --git a/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md similarity index 100% rename from src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md rename to src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md diff --git a/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md similarity index 100% rename from src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md rename to src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md diff --git a/src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs similarity index 100% rename from src/Contrib/src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs rename to src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs diff --git a/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs similarity index 100% rename from src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs rename to src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs diff --git a/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs similarity index 100% rename from src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs rename to src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs diff --git a/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs similarity index 100% rename from src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs rename to src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs diff --git a/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj similarity index 80% rename from src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj rename to src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj index 2f7e1c2c5..a6a6331df 100644 --- a/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj +++ b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj @@ -23,8 +23,8 @@ - - + + diff --git a/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs similarity index 100% rename from src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs rename to src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs diff --git a/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs similarity index 100% rename from src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs rename to src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs diff --git a/src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs rename to src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs similarity index 100% rename from src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs rename to src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs similarity index 100% rename from src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs rename to src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj similarity index 56% rename from src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj rename to src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj index 662ab0a12..fe01e276d 100644 --- a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj +++ b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs similarity index 100% rename from src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs rename to src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs similarity index 100% rename from src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs rename to src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md similarity index 100% rename from src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md rename to src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md similarity index 100% rename from src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md rename to src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs rename to src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs similarity index 100% rename from src/Contrib/src/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs rename to src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs diff --git a/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs b/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs similarity index 100% rename from src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs rename to src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs diff --git a/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj b/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj similarity index 86% rename from src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj rename to src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj index aa4160f50..d696677c2 100644 --- a/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj +++ b/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs b/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs similarity index 100% rename from src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs rename to src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs diff --git a/src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs b/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/SearchEngine/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs rename to src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj similarity index 68% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj index f6c3fabfe..1cc584cf8 100644 --- a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj +++ b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.md similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.md diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj similarity index 69% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj index d04a188ec..438935c9b 100644 --- a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj +++ b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.md similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.md diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/JsonRequestMessage.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/JsonRequestMessage.cs diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj new file mode 100644 index 000000000..317040b15 --- /dev/null +++ b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/README.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.md similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/README.md rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.md diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.zh-CN.md diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/XmlRequestMessage.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/XmlRequestMessage.cs diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/_Imports.cs similarity index 100% rename from src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs rename to src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/_Imports.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj similarity index 69% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj index df28da5c6..bb7511a63 100644 --- a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj +++ b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj @@ -20,9 +20,9 @@ - - - + + + diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/CallerTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CallerTest.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/CallerTest.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CallerTest.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj similarity index 63% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj index e1171c174..3c585031f 100644 --- a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj +++ b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj @@ -16,9 +16,9 @@ - - - + + + diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs diff --git a/src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/_Imports.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Service/Caller/Masa.Contrib.Service.Caller.Tests/_Imports.cs rename to src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/_Imports.cs diff --git a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj new file mode 100644 index 000000000..17ff4dcd3 --- /dev/null +++ b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + + + + + + + + + + + + + diff --git a/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/README.md b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.md similarity index 100% rename from src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/README.md rename to src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.md diff --git a/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md rename to src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md diff --git a/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs similarity index 100% rename from src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs rename to src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs diff --git a/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs rename to src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/_Imports.cs similarity index 100% rename from src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs rename to src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/_Imports.cs diff --git a/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj b/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj similarity index 90% rename from src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj rename to src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj index 925fbecfc..ae5e2d409 100644 --- a/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj +++ b/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs b/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs similarity index 100% rename from src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs rename to src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs diff --git a/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs b/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs similarity index 100% rename from src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs rename to src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs diff --git a/src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs b/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Service/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs rename to src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/AuthClient.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/AuthClient.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/AuthClient.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/AuthClient.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Constants.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Constants.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Constants.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Constants.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj new file mode 100644 index 000000000..364163876 --- /dev/null +++ b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.md b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.md rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.zh-CN.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.zh-CN.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/UserService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/UserService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/_Imports.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs rename to src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/_Imports.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs rename to src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj similarity index 68% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj rename to src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj index 8c996881e..c0713f3b5 100644 --- a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj +++ b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj @@ -19,9 +19,9 @@ - - - + + + diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs rename to src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs rename to src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs rename to src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs rename to src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs rename to src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs rename to src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/DccClient.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/DccClient.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/DccClient.cs rename to src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/DccClient.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs rename to src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs diff --git a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj new file mode 100644 index 000000000..283f6feb1 --- /dev/null +++ b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj @@ -0,0 +1,16 @@ + + + + net6.0 + enable + enable + + + + + + + + + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md rename to src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md rename to src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs rename to src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs rename to src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/_Imports.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs rename to src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/_Imports.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs rename to src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs rename to src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj similarity index 80% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj rename to src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj index f53aaba79..17709f2ee 100644 --- a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj +++ b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj @@ -29,8 +29,8 @@ - - + + diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs rename to src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json rename to src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Constants.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Constants.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Constants.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Constants.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj new file mode 100644 index 000000000..74e5cd6f4 --- /dev/null +++ b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/McClient.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/McClient.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/McClient.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/McClient.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/_Imports.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs rename to src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/_Imports.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs rename to src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj similarity index 75% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj rename to src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj index 4deeadc85..a006ab3dd 100644 --- a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj +++ b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj @@ -17,8 +17,8 @@ - - + + diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs rename to src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs rename to src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs rename to src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs rename to src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs rename to src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs rename to src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Constants.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Constants.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Constants.cs rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Constants.cs diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj new file mode 100644 index 000000000..f6f9a3d68 --- /dev/null +++ b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/PmClient.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/PmClient.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/PmClient.cs rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/PmClient.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.md b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.md rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.zh-CN.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.zh-CN.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/AppService.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/AppService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/AppService.cs rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/AppService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/_Imports.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/_Imports.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/_Imports.cs rename to src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/_Imports.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs rename to src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs rename to src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs rename to src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj similarity index 75% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj rename to src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj index b2e37dc84..72c90d70a 100644 --- a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj +++ b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj @@ -17,8 +17,8 @@ - - + + diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs rename to src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs rename to src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs rename to src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Constants.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Constants.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Constants.cs rename to src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Constants.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs rename to src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj new file mode 100644 index 000000000..abc04194e --- /dev/null +++ b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md rename to src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md rename to src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs rename to src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs rename to src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs rename to src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs rename to src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/_Imports.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs rename to src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/_Imports.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj similarity index 74% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj rename to src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj index 61afc9440..c98a289a3 100644 --- a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj +++ b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs rename to src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs rename to src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs rename to src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs rename to src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj similarity index 76% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj index 0d6a90a42..0fef69f87 100644 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj +++ b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj @@ -20,9 +20,9 @@ - - - + + + diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/TscClient.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/TscClient.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/TscClient.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/TscClient.cs diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/_Imports.cs similarity index 100% rename from src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs rename to src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/_Imports.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs rename to src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj similarity index 72% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj rename to src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj index 23280069c..622f55c3c 100644 --- a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj +++ b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj @@ -15,8 +15,8 @@ - - + + diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs rename to src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs rename to src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs diff --git a/src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs similarity index 100% rename from src/Contrib/test/StackSdks/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs rename to src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj similarity index 76% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj index 5a3f577fe..0a20fdd88 100644 --- a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj +++ b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj @@ -21,8 +21,8 @@ - - + + diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs diff --git a/src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs similarity index 100% rename from src/Contrib/src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs rename to src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj similarity index 91% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj index 8738152a9..1bafe0ed3 100644 --- a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj +++ b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs diff --git a/src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json similarity index 100% rename from src/Contrib/test/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json rename to src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj deleted file mode 100644 index b27940889..000000000 --- a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj b/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj deleted file mode 100644 index 04fe17702..000000000 --- a/src/Contrib/src/Authentication/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj b/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj deleted file mode 100644 index d258bbb9c..000000000 --- a/src/Contrib/src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj deleted file mode 100644 index a91a396ac..000000000 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj b/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj deleted file mode 100644 index 67b5a06f8..000000000 --- a/src/Contrib/src/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj deleted file mode 100644 index 616fe923e..000000000 --- a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj b/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj deleted file mode 100644 index 36bedc9af..000000000 --- a/src/Contrib/src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj deleted file mode 100644 index 9febbc666..000000000 --- a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj b/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj deleted file mode 100644 index 8b4473928..000000000 --- a/src/Contrib/src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj b/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj deleted file mode 100644 index 13ffee9e9..000000000 --- a/src/Contrib/src/Identity/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj deleted file mode 100644 index 6f8c99ae5..000000000 --- a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj b/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj deleted file mode 100644 index 6f8c99ae5..000000000 --- a/src/Contrib/src/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj b/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj deleted file mode 100644 index 7b28bf928..000000000 --- a/src/Contrib/src/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj b/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj deleted file mode 100644 index 463513716..000000000 --- a/src/Contrib/src/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj b/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj deleted file mode 100644 index 9a23324a4..000000000 --- a/src/Contrib/src/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - - - - - - - - - - - - - diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj deleted file mode 100644 index a63cc32f9..000000000 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj deleted file mode 100644 index a0ccc4732..000000000 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj deleted file mode 100644 index 78a55f2c9..000000000 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj deleted file mode 100644 index 035c7a045..000000000 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj b/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj deleted file mode 100644 index bc1aaed01..000000000 --- a/src/Contrib/src/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - diff --git a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj b/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj deleted file mode 100644 index 77e67b3f1..000000000 --- a/src/Contrib/test/Isolation/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - - - - - - - - - Always - - - - - - - - - - - - - - - diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Core/_Imports.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/_Imports.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Core/_Imports.cs rename to src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/_Imports.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj similarity index 83% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj index df8b395e9..6a3dc888c 100644 --- a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj +++ b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj @@ -13,6 +13,7 @@ - + + diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClient.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClient.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClient.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClient.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Redis/_Imports.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/_Imports.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Redis/_Imports.cs rename to src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/_Imports.cs diff --git a/src/Utils/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs b/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs rename to src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs diff --git a/src/Utils/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj b/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj similarity index 85% rename from src/Utils/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj rename to src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj index d611420d0..6b68ea9e7 100644 --- a/src/Utils/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj +++ b/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/Utils/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs b/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs rename to src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj similarity index 83% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj index 9a852d2bd..f1af3e2fc 100644 --- a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj +++ b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/_Imports.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs rename to src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/_Imports.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj b/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj rename to src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs b/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/MemoryCache.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs rename to src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/MemoryCache.cs diff --git a/src/Utils/src/Caching/Masa.Utils.Caching.Memory/_Imports.cs b/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/_Imports.cs similarity index 100% rename from src/Utils/src/Caching/Masa.Utils.Caching.Memory/_Imports.cs rename to src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/_Imports.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/AbstractCallerProvider.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/AbstractCallerProvider.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/AddCallerExtensions.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/AddCallerExtensions.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerBase.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerBase.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerBase.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerBase.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerOptions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerOptions.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/CallerOptions.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerOptions.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultCallerFactory.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultCallerFactory.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestMessage.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestMessage.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultResponseMessage.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultResponseMessage.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerFactory.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerFactory.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerProvider.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerProvider.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestIdGenerator.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestIdGenerator.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestMessage.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestMessage.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/IResponseMessage.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/IResponseMessage.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/ITypeConvertProvider.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/ITypeConvertProvider.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerRelations.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerRelations.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Const.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Const.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Const.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Const.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/JsonRequestMessage.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/JsonRequestMessage.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj similarity index 84% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj index 9488b24bd..ca9b278bf 100644 --- a/src/Utils/src/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj +++ b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/README.md b/src/Utils/Caller/src/Masa.Utils.Caller.Core/README.md similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/README.md rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/README.md diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/README.zh-CN.md b/src/Utils/Caller/src/Masa.Utils.Caller.Core/README.zh-CN.md similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/README.zh-CN.md rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/README.zh-CN.md diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.Core/_Imports.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/_Imports.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.Core/_Imports.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.Core/_Imports.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj rename to src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.md b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.md similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.md rename to src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.md diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.zh-CN.md similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md rename to src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.zh-CN.md diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/_Imports.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/_Imports.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj rename to src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.md b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.md similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.md rename to src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.md diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.zh-CN.md similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md rename to src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.zh-CN.md diff --git a/src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/_Imports.cs similarity index 100% rename from src/Utils/src/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs rename to src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/_Imports.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/CallerTest.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/CallerTest.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/CallerTest.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj similarity index 68% rename from src/Utils/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj index bf39768db..127f43e13 100644 --- a/src/Utils/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj +++ b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj @@ -16,9 +16,9 @@ - - - + + + diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs diff --git a/src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/_Imports.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Caller.Tests/_Imports.cs rename to src/Utils/Caller/test/Masa.Utils.Caller.Tests/_Imports.cs diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj b/src/Utils/Configuration/src/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj similarity index 100% rename from src/Utils/src/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj rename to src/Utils/Configuration/src/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs b/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/AppSettings.cs similarity index 100% rename from src/Utils/src/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs rename to src/Utils/Configuration/src/Masa.Utils.Configuration.Json/AppSettings.cs diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs b/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonConfiguration.cs similarity index 100% rename from src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs rename to src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonConfiguration.cs diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs b/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonFileOptions.cs similarity index 100% rename from src/Utils/src/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs rename to src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonFileOptions.cs diff --git a/src/Utils/src/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj b/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj similarity index 100% rename from src/Utils/src/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj rename to src/Utils/Configuration/src/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj diff --git a/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs b/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs rename to src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs b/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs rename to src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj b/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj rename to src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj diff --git a/src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs b/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/_Imports.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs rename to src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/_Imports.cs diff --git a/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj b/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj similarity index 84% rename from src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj rename to src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj index e40017edf..59fc3e53d 100644 --- a/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj +++ b/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs b/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs rename to src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs diff --git a/src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs b/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs rename to src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Const.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Const.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Const.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Const.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.md b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.md similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.md rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.md diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.zh-CN.md similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.zh-CN.md diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/_Imports.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs rename to src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/_Imports.cs diff --git a/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs b/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs rename to src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs diff --git a/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj b/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj similarity index 85% rename from src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj rename to src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj index b009a030a..4cef9dacb 100644 --- a/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj +++ b/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs b/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs rename to src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs diff --git a/src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs b/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs rename to src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs diff --git a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj similarity index 65% rename from src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj index 5f01c06c5..c972af60c 100644 --- a/src/BuildingBlocks/src/Authentication/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj +++ b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.md b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.md similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.md rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.md diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.zh-CN.md similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.zh-CN.md diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/_Imports.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/_Imports.cs similarity index 100% rename from src/Utils/src/Data/Masa.Utils.Data.Prometheus/_Imports.cs rename to src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/_Imports.cs diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs rename to src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs rename to src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj similarity index 86% rename from src/Utils/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj rename to src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj index 61e38ea41..fe19dfc2d 100644 --- a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj +++ b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs rename to src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs rename to src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs diff --git a/src/Utils/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs rename to src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.md b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.md similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.md rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.md diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/CommandLineBuilder.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/CommandLineBuilder.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/CommandLineBuilder.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/CommandLineBuilder.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprExtensions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprExtensions.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprExtensions.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprExtensions.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprOptions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprOptions.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprOptions.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprOptions.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProcess.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProcess.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProcess.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProcess.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProvider.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/DaprProvider.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProvider.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProcess.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProcess.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProcess.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProcess.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProvider.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/IDaprProvider.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProvider.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/Const.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/Const.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/Const.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/Const.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/LogLevel.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/LogLevel.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/LogLevel.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/LogLevel.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcess.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcess.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcess.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcess.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/SystemProcess.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/SystemProcess.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Process/SystemProcess.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/SystemProcess.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/Protocol.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Protocol.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/Protocol.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Protocol.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/README.md b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.md similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/README.md rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.md diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/README.zh-CN.md b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.zh-CN.md similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/README.zh-CN.md rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.zh-CN.md diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs diff --git a/src/Utils/src/Development/Masa.Utils.Development.Dapr/_Imports.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/_Imports.cs similarity index 100% rename from src/Utils/src/Development/Masa.Utils.Development.Dapr/_Imports.cs rename to src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/_Imports.cs diff --git a/src/Utils/Directory.Build.props b/src/Utils/Directory.Build.props deleted file mode 100644 index 7b728acf8..000000000 --- a/src/Utils/Directory.Build.props +++ /dev/null @@ -1,18 +0,0 @@ - - - 6.0.0 - 3.19.1 - 2.2.4 - 2.2.3 - 16.9.4 - 3.0.2 - 4.16.1 - 7.17.4 - 6.0.1 - 2.40.0 - 1.5.0 - 6.15.0 - 11.1.0 - 11.1.2 - - diff --git a/src/Utils/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Internal/Constant.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/Constant.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Internal/Constant.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/Constant.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj similarity index 99% rename from src/Utils/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj index fe1b0f205..b73295abb 100644 --- a/src/Utils/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj +++ b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj @@ -5,7 +5,9 @@ enable enable + + \ No newline at end of file diff --git a/src/Utils/src/Masa.Utils.Exceptions/MasaException.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaException.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/MasaException.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaException.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/MasaExceptionContext.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaExceptionContext.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/MasaExceptionContext.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaExceptionContext.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/README.md b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.md similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/README.md rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.md diff --git a/src/Utils/src/Masa.Utils.Exceptions/README.zh-CN.md b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.zh-CN.md similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/README.zh-CN.md rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.zh-CN.md diff --git a/src/Utils/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/UserFriendlyException.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/UserFriendlyException.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/UserFriendlyException.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/UserFriendlyException.cs diff --git a/src/Utils/src/Masa.Utils.Exceptions/_Imports.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/_Imports.cs similarity index 100% rename from src/Utils/src/Masa.Utils.Exceptions/_Imports.cs rename to src/Utils/Exceptions/src/Masa.Utils.Exceptions/_Imports.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.md similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.md diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/_Imports.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs rename to src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/_Imports.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj similarity index 82% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj index bb8ea291c..d77d5f13c 100644 --- a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj +++ b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs rename to src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj b/src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj rename to src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs b/src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/TypeExtensions.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs rename to src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/TypeExtensions.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumExtensions.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs rename to src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumExtensions.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumUtil.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs rename to src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumUtil.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj rename to src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Model/EnumObject.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs rename to src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Model/EnumObject.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Enum.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs rename to src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Enum.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Imports.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs rename to src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Imports.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs b/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs rename to src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj b/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj rename to src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj diff --git a/src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs b/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/_Imports.cs similarity index 100% rename from src/Utils/src/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs rename to src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/_Imports.cs diff --git a/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs b/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs similarity index 100% rename from src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs rename to src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs diff --git a/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj b/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj similarity index 100% rename from src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj rename to src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj diff --git a/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs b/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs similarity index 100% rename from src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs rename to src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs diff --git a/src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs b/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs similarity index 100% rename from src/Utils/src/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs rename to src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapFactory.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapFactory.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapProvider.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapProvider.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapFactory.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapFactory.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapOptions.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapOptions.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapProvider.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapProvider.cs diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj diff --git a/src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/_Imports.cs similarity index 100% rename from src/Utils/src/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs rename to src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/_Imports.cs diff --git a/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs b/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs rename to src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs diff --git a/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj b/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj similarity index 90% rename from src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj rename to src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj index 797b5c685..52e14643e 100644 --- a/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj +++ b/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs b/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs rename to src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs diff --git a/src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json b/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json similarity index 100% rename from src/Utils/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json rename to src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json diff --git a/src/Utils/Masa.Utils.sln b/src/Utils/Masa.Utils.sln deleted file mode 100644 index 3b75c81a6..000000000 --- a/src/Utils/Masa.Utils.sln +++ /dev/null @@ -1,320 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.0.31606.5 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D956582F-4071-47E6-A8E7-4C5A83770045}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{2852693E-7C18-4031-AF92-DA423BD0B3D8}" - ProjectSection(SolutionItems) = preProject - .gitignore = .gitignore - README.md = README.md - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{AC4B880D-01C6-4D9C-AE55-21A1A0E5E3DB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching", "Caching", "{A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{9EA04A94-80C6-4352-8758-F4B65691AE4A}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{F844C2A1-C36D-400E-A0D8-7658EF9C3B93}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{4F908878-0EB8-43E4-96E4-8B1F32E9B635}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{72E67141-9CD8-48A9-B27B-F0C924FD4A12}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development", "{598A7DA7-898E-429B-992A-B0E586DADA35}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Core", "src\Caching\Masa.Utils.Caching.Core\Masa.Utils.Caching.Core.csproj", "{91A68564-07EA-439D-BED3-EFC068A159D0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.DistributedMemory", "src\Caching\Masa.Utils.Caching.DistributedMemory\Masa.Utils.Caching.DistributedMemory.csproj", "{9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Memory", "src\Caching\Masa.Utils.Caching.Memory\Masa.Utils.Caching.Memory.csproj", "{F75C5658-C7EB-4922-833F-9052D9723487}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis", "src\Caching\Masa.Utils.Caching.Redis\Masa.Utils.Caching.Redis.csproj", "{246AA228-57AC-40B4-9BE1-EC75B8C3FC10}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core", "src\Caller\Masa.Utils.Caller.Core\Masa.Utils.Caller.Core.csproj", "{AE2109F8-6772-41A8-88C3-8E603BA29144}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.DaprClient", "src\Caller\Masa.Utils.Caller.DaprClient\Masa.Utils.Caller.DaprClient.csproj", "{A489F659-7925-475E-A82E-EFEE846C24C8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.HttpClient", "src\Caller\Masa.Utils.Caller.HttpClient\Masa.Utils.Caller.HttpClient.csproj", "{ACE02BC6-04E9-48F5-BF1A-C5591366F72A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Dcc", "src\Configuration\Masa.Utils.Configuration.Dcc\Masa.Utils.Configuration.Dcc.csproj", "{31A832FC-2AC6-4540-A659-1DCFF7882102}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Json", "src\Configuration\Masa.Utils.Configuration.Json\Masa.Utils.Configuration.Json.csproj", "{4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations", "src\Data\Masa.Utils.Data.DataAnnotations\Masa.Utils.Data.DataAnnotations.csproj", "{AAC6E291-48D8-41AD-99C0-5B085EB88F81}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch", "src\Data\Masa.Utils.Data.Elasticsearch\Masa.Utils.Data.Elasticsearch.csproj", "{306184FE-65BE-4763-A86E-D84BBB8CFDDF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr", "src\Development\Masa.Utils.Development.Dapr\Masa.Utils.Development.Dapr.csproj", "{14FDF393-49F1-4D41-9EC0-FF493BDDE376}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr.AspNetCore", "src\Development\Masa.Utils.Development.Dapr.AspNetCore\Masa.Utils.Development.Dapr.AspNetCore.csproj", "{BA28042B-25C1-4361-A836-5710BF271EEF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Enums", "src\Extensions\Masa.Utils.Extensions.Enums\Masa.Utils.Extensions.Enums.csproj", "{56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Expressions", "src\Extensions\Masa.Utils.Extensions.Expressions\Masa.Utils.Extensions.Expressions.csproj", "{22FB9445-2337-43F7-AEFB-6E349619CBB1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection", "src\Extensions\Masa.Utils.Extensions.DependencyInjection\Masa.Utils.Extensions.DependencyInjection.csproj", "{6CC1E189-9249-44BB-B0C9-E13D173E85CE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DotNet", "src\Extensions\Masa.Utils.Extensions.DotNet\Masa.Utils.Extensions.DotNet.csproj", "{3244CF56-A19C-4A5B-B479-79DA704BDBB2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Exceptions", "src\Masa.Utils.Exceptions\Masa.Utils.Exceptions.csproj", "{8D573300-4173-41CA-A4C8-BAA49A89B4F8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Models.Config", "src\Models\Masa.Utils.Models.Config\Masa.Utils.Models.Config.csproj", "{333E1D7C-780F-4917-A823-8B369F1D278C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication", "src\Security\Masa.Utils.Security.Authentication\Masa.Utils.Security.Authentication.csproj", "{83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography", "src\Security\Masa.Utils.Security.Cryptography\Masa.Utils.Security.Cryptography.csproj", "{C9D66303-AE01-4D8C-A69E-82B620007EBD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Token", "src\Security\Masa.Utils.Security.Token\Masa.Utils.Security.Token.csproj", "{4A3B1928-5014-4D81-BB83-FDCD0652D067}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations.Tests", "test\Masa.Utils.Data.DataAnnotations.Tests\Masa.Utils.Data.DataAnnotations.Tests.csproj", "{52B3A8FE-A553-4D65-8660-447F120616AB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography.Tests", "test\Masa.Utils.Security.Cryptography.Tests\Masa.Utils.Security.Cryptography.Tests.csproj", "{1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core.Tests", "test\Masa.Utils.Caller.Core.Tests\Masa.Utils.Caller.Core.Tests.csproj", "{4B351F95-5919-46A9-A02F-F4409C9EA79A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.IntegratedTests", "test\Masa.Utils.Caller.IntegratedTests\Masa.Utils.Caller.IntegratedTests.csproj", "{D5E09920-081B-478C-B77B-EAB77931F47D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Tests", "test\Masa.Utils.Caller.Tests\Masa.Utils.Caller.Tests.csproj", "{276B4CDC-BD8F-4563-A82A-B46724C9F4B0}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ldap", "Ldap", "{59124A98-14AF-4201-87D7-6DC9C92D9849}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell", "src\Ldap\Masa.Utils.Ldap.Novell\Masa.Utils.Ldap.Novell.csproj", "{E62E5E11-7119-4782-BCF4-A5913F4048FE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell.Tests", "test\Masa.Utils.Ldap.Tests\Masa.Utils.Ldap.Novell.Tests\Masa.Utils.Ldap.Novell.Tests.csproj", "{F6242694-66A5-4E59-9ECD-510D3D81C8C6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch.Tests", "test\Masa.Utils.Data.Elasticsearch.Tests\Masa.Utils.Data.Elasticsearch.Tests.csproj", "{EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis.Tests", "test\Masa.Utils.Caching.Redis.Tests\Masa.Utils.Caching.Redis.Tests.csproj", "{B063C9CC-868A-4474-8DCD-1708A65D4F2A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Tests", "test\Masa.Utils.Extensions.DependencyInjection.Tests\Masa.Utils.Extensions.DependencyInjection.Tests.csproj", "{20960ED7-76FC-4DBD-8358-1A424D1E0DC1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Repository.Tests", "test\Masa.Utils.Extensions.DependencyInjection.Repository.Tests\Masa.Utils.Extensions.DependencyInjection.Repository.Tests.csproj", "{22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Validations", "Validations", "{533BCE80-61BC-443A-95D3-2C6328921ED8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Validations.FluentValidation", "src\Extensions\Validations\Masa.Utils.Extensions.Validations.FluentValidation\Masa.Utils.Extensions.Validations.FluentValidation.csproj", "{B0E3CA19-C101-4E30-9401-C017B7088F4E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication.OpenIdConnect", "src\Security\Masa.Utils.Security.Authentication.OpenIdConnect\Masa.Utils.Security.Authentication.OpenIdConnect.csproj", "{D17B5B36-5773-4827-9D5D-44390DF666CA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus", "src\Data\Masa.Utils.Data.Prometheus\Masa.Utils.Data.Prometheus.csproj", "{81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus.Test", "test\Masa.Utils.Data.Prometheus.Test\Masa.Utils.Data.Prometheus.Test.csproj", "{CAB4132B-82E4-4B37-AF05-7F446DE3AF04}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {91A68564-07EA-439D-BED3-EFC068A159D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91A68564-07EA-439D-BED3-EFC068A159D0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91A68564-07EA-439D-BED3-EFC068A159D0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91A68564-07EA-439D-BED3-EFC068A159D0}.Release|Any CPU.Build.0 = Release|Any CPU - {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56}.Release|Any CPU.Build.0 = Release|Any CPU - {F75C5658-C7EB-4922-833F-9052D9723487}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F75C5658-C7EB-4922-833F-9052D9723487}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F75C5658-C7EB-4922-833F-9052D9723487}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F75C5658-C7EB-4922-833F-9052D9723487}.Release|Any CPU.Build.0 = Release|Any CPU - {246AA228-57AC-40B4-9BE1-EC75B8C3FC10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {246AA228-57AC-40B4-9BE1-EC75B8C3FC10}.Debug|Any CPU.Build.0 = Debug|Any CPU - {246AA228-57AC-40B4-9BE1-EC75B8C3FC10}.Release|Any CPU.ActiveCfg = Release|Any CPU - {246AA228-57AC-40B4-9BE1-EC75B8C3FC10}.Release|Any CPU.Build.0 = Release|Any CPU - {AE2109F8-6772-41A8-88C3-8E603BA29144}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AE2109F8-6772-41A8-88C3-8E603BA29144}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AE2109F8-6772-41A8-88C3-8E603BA29144}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AE2109F8-6772-41A8-88C3-8E603BA29144}.Release|Any CPU.Build.0 = Release|Any CPU - {A489F659-7925-475E-A82E-EFEE846C24C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A489F659-7925-475E-A82E-EFEE846C24C8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A489F659-7925-475E-A82E-EFEE846C24C8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A489F659-7925-475E-A82E-EFEE846C24C8}.Release|Any CPU.Build.0 = Release|Any CPU - {ACE02BC6-04E9-48F5-BF1A-C5591366F72A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ACE02BC6-04E9-48F5-BF1A-C5591366F72A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ACE02BC6-04E9-48F5-BF1A-C5591366F72A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ACE02BC6-04E9-48F5-BF1A-C5591366F72A}.Release|Any CPU.Build.0 = Release|Any CPU - {31A832FC-2AC6-4540-A659-1DCFF7882102}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {31A832FC-2AC6-4540-A659-1DCFF7882102}.Debug|Any CPU.Build.0 = Debug|Any CPU - {31A832FC-2AC6-4540-A659-1DCFF7882102}.Release|Any CPU.ActiveCfg = Release|Any CPU - {31A832FC-2AC6-4540-A659-1DCFF7882102}.Release|Any CPU.Build.0 = Release|Any CPU - {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4}.Release|Any CPU.Build.0 = Release|Any CPU - {AAC6E291-48D8-41AD-99C0-5B085EB88F81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AAC6E291-48D8-41AD-99C0-5B085EB88F81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AAC6E291-48D8-41AD-99C0-5B085EB88F81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AAC6E291-48D8-41AD-99C0-5B085EB88F81}.Release|Any CPU.Build.0 = Release|Any CPU - {306184FE-65BE-4763-A86E-D84BBB8CFDDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {306184FE-65BE-4763-A86E-D84BBB8CFDDF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {306184FE-65BE-4763-A86E-D84BBB8CFDDF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {306184FE-65BE-4763-A86E-D84BBB8CFDDF}.Release|Any CPU.Build.0 = Release|Any CPU - {14FDF393-49F1-4D41-9EC0-FF493BDDE376}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {14FDF393-49F1-4D41-9EC0-FF493BDDE376}.Debug|Any CPU.Build.0 = Debug|Any CPU - {14FDF393-49F1-4D41-9EC0-FF493BDDE376}.Release|Any CPU.ActiveCfg = Release|Any CPU - {14FDF393-49F1-4D41-9EC0-FF493BDDE376}.Release|Any CPU.Build.0 = Release|Any CPU - {BA28042B-25C1-4361-A836-5710BF271EEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BA28042B-25C1-4361-A836-5710BF271EEF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BA28042B-25C1-4361-A836-5710BF271EEF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BA28042B-25C1-4361-A836-5710BF271EEF}.Release|Any CPU.Build.0 = Release|Any CPU - {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6}.Release|Any CPU.Build.0 = Release|Any CPU - {22FB9445-2337-43F7-AEFB-6E349619CBB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {22FB9445-2337-43F7-AEFB-6E349619CBB1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {22FB9445-2337-43F7-AEFB-6E349619CBB1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {22FB9445-2337-43F7-AEFB-6E349619CBB1}.Release|Any CPU.Build.0 = Release|Any CPU - {6CC1E189-9249-44BB-B0C9-E13D173E85CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6CC1E189-9249-44BB-B0C9-E13D173E85CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6CC1E189-9249-44BB-B0C9-E13D173E85CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6CC1E189-9249-44BB-B0C9-E13D173E85CE}.Release|Any CPU.Build.0 = Release|Any CPU - {3244CF56-A19C-4A5B-B479-79DA704BDBB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3244CF56-A19C-4A5B-B479-79DA704BDBB2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3244CF56-A19C-4A5B-B479-79DA704BDBB2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3244CF56-A19C-4A5B-B479-79DA704BDBB2}.Release|Any CPU.Build.0 = Release|Any CPU - {8D573300-4173-41CA-A4C8-BAA49A89B4F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D573300-4173-41CA-A4C8-BAA49A89B4F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D573300-4173-41CA-A4C8-BAA49A89B4F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D573300-4173-41CA-A4C8-BAA49A89B4F8}.Release|Any CPU.Build.0 = Release|Any CPU - {333E1D7C-780F-4917-A823-8B369F1D278C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {333E1D7C-780F-4917-A823-8B369F1D278C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {333E1D7C-780F-4917-A823-8B369F1D278C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {333E1D7C-780F-4917-A823-8B369F1D278C}.Release|Any CPU.Build.0 = Release|Any CPU - {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9}.Release|Any CPU.Build.0 = Release|Any CPU - {C9D66303-AE01-4D8C-A69E-82B620007EBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C9D66303-AE01-4D8C-A69E-82B620007EBD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C9D66303-AE01-4D8C-A69E-82B620007EBD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C9D66303-AE01-4D8C-A69E-82B620007EBD}.Release|Any CPU.Build.0 = Release|Any CPU - {4A3B1928-5014-4D81-BB83-FDCD0652D067}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4A3B1928-5014-4D81-BB83-FDCD0652D067}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4A3B1928-5014-4D81-BB83-FDCD0652D067}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4A3B1928-5014-4D81-BB83-FDCD0652D067}.Release|Any CPU.Build.0 = Release|Any CPU - {52B3A8FE-A553-4D65-8660-447F120616AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52B3A8FE-A553-4D65-8660-447F120616AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52B3A8FE-A553-4D65-8660-447F120616AB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52B3A8FE-A553-4D65-8660-447F120616AB}.Release|Any CPU.Build.0 = Release|Any CPU - {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E}.Release|Any CPU.Build.0 = Release|Any CPU - {4B351F95-5919-46A9-A02F-F4409C9EA79A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B351F95-5919-46A9-A02F-F4409C9EA79A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B351F95-5919-46A9-A02F-F4409C9EA79A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B351F95-5919-46A9-A02F-F4409C9EA79A}.Release|Any CPU.Build.0 = Release|Any CPU - {D5E09920-081B-478C-B77B-EAB77931F47D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5E09920-081B-478C-B77B-EAB77931F47D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5E09920-081B-478C-B77B-EAB77931F47D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5E09920-081B-478C-B77B-EAB77931F47D}.Release|Any CPU.Build.0 = Release|Any CPU - {276B4CDC-BD8F-4563-A82A-B46724C9F4B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {276B4CDC-BD8F-4563-A82A-B46724C9F4B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {276B4CDC-BD8F-4563-A82A-B46724C9F4B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {276B4CDC-BD8F-4563-A82A-B46724C9F4B0}.Release|Any CPU.Build.0 = Release|Any CPU - {E62E5E11-7119-4782-BCF4-A5913F4048FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E62E5E11-7119-4782-BCF4-A5913F4048FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E62E5E11-7119-4782-BCF4-A5913F4048FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E62E5E11-7119-4782-BCF4-A5913F4048FE}.Release|Any CPU.Build.0 = Release|Any CPU - {F6242694-66A5-4E59-9ECD-510D3D81C8C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6242694-66A5-4E59-9ECD-510D3D81C8C6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6242694-66A5-4E59-9ECD-510D3D81C8C6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6242694-66A5-4E59-9ECD-510D3D81C8C6}.Release|Any CPU.Build.0 = Release|Any CPU - {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB}.Release|Any CPU.Build.0 = Release|Any CPU - {B063C9CC-868A-4474-8DCD-1708A65D4F2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B063C9CC-868A-4474-8DCD-1708A65D4F2A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B063C9CC-868A-4474-8DCD-1708A65D4F2A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B063C9CC-868A-4474-8DCD-1708A65D4F2A}.Release|Any CPU.Build.0 = Release|Any CPU - {20960ED7-76FC-4DBD-8358-1A424D1E0DC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20960ED7-76FC-4DBD-8358-1A424D1E0DC1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20960ED7-76FC-4DBD-8358-1A424D1E0DC1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20960ED7-76FC-4DBD-8358-1A424D1E0DC1}.Release|Any CPU.Build.0 = Release|Any CPU - {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE}.Release|Any CPU.Build.0 = Release|Any CPU - {B0E3CA19-C101-4E30-9401-C017B7088F4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0E3CA19-C101-4E30-9401-C017B7088F4E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0E3CA19-C101-4E30-9401-C017B7088F4E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0E3CA19-C101-4E30-9401-C017B7088F4E}.Release|Any CPU.Build.0 = Release|Any CPU - {D17B5B36-5773-4827-9D5D-44390DF666CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D17B5B36-5773-4827-9D5D-44390DF666CA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D17B5B36-5773-4827-9D5D-44390DF666CA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D17B5B36-5773-4827-9D5D-44390DF666CA}.Release|Any CPU.Build.0 = Release|Any CPU - {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7}.Release|Any CPU.Build.0 = Release|Any CPU - {CAB4132B-82E4-4B37-AF05-7F446DE3AF04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CAB4132B-82E4-4B37-AF05-7F446DE3AF04}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CAB4132B-82E4-4B37-AF05-7F446DE3AF04}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CAB4132B-82E4-4B37-AF05-7F446DE3AF04}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {AC4B880D-01C6-4D9C-AE55-21A1A0E5E3DB} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {9EA04A94-80C6-4352-8758-F4B65691AE4A} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {F844C2A1-C36D-400E-A0D8-7658EF9C3B93} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {72E67141-9CD8-48A9-B27B-F0C924FD4A12} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {598A7DA7-898E-429B-992A-B0E586DADA35} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {91A68564-07EA-439D-BED3-EFC068A159D0} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} - {9E3EE563-9DB0-4DCE-A844-CEFC5C7D1D56} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} - {F75C5658-C7EB-4922-833F-9052D9723487} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} - {246AA228-57AC-40B4-9BE1-EC75B8C3FC10} = {A7C058C9-B4A3-472A-A82B-FC4A0A12AC9D} - {AE2109F8-6772-41A8-88C3-8E603BA29144} = {72E67141-9CD8-48A9-B27B-F0C924FD4A12} - {A489F659-7925-475E-A82E-EFEE846C24C8} = {72E67141-9CD8-48A9-B27B-F0C924FD4A12} - {ACE02BC6-04E9-48F5-BF1A-C5591366F72A} = {72E67141-9CD8-48A9-B27B-F0C924FD4A12} - {31A832FC-2AC6-4540-A659-1DCFF7882102} = {AC4B880D-01C6-4D9C-AE55-21A1A0E5E3DB} - {4C9A3FE2-7958-4DEE-A478-7DE5B99A77C4} = {AC4B880D-01C6-4D9C-AE55-21A1A0E5E3DB} - {AAC6E291-48D8-41AD-99C0-5B085EB88F81} = {F844C2A1-C36D-400E-A0D8-7658EF9C3B93} - {306184FE-65BE-4763-A86E-D84BBB8CFDDF} = {F844C2A1-C36D-400E-A0D8-7658EF9C3B93} - {14FDF393-49F1-4D41-9EC0-FF493BDDE376} = {598A7DA7-898E-429B-992A-B0E586DADA35} - {BA28042B-25C1-4361-A836-5710BF271EEF} = {598A7DA7-898E-429B-992A-B0E586DADA35} - {56E7A4C7-5AF3-4DD1-A6AA-E713CA1C19D6} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} - {22FB9445-2337-43F7-AEFB-6E349619CBB1} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} - {6CC1E189-9249-44BB-B0C9-E13D173E85CE} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} - {3244CF56-A19C-4A5B-B479-79DA704BDBB2} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} - {8D573300-4173-41CA-A4C8-BAA49A89B4F8} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {333E1D7C-780F-4917-A823-8B369F1D278C} = {9EA04A94-80C6-4352-8758-F4B65691AE4A} - {83F7EFDA-EF08-4931-82FA-A1A0EEE162A9} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} - {C9D66303-AE01-4D8C-A69E-82B620007EBD} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} - {4A3B1928-5014-4D81-BB83-FDCD0652D067} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} - {52B3A8FE-A553-4D65-8660-447F120616AB} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {1A8FBE3D-B004-4D25-8FE0-A3632A0FDE9E} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {4B351F95-5919-46A9-A02F-F4409C9EA79A} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {D5E09920-081B-478C-B77B-EAB77931F47D} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {276B4CDC-BD8F-4563-A82A-B46724C9F4B0} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {59124A98-14AF-4201-87D7-6DC9C92D9849} = {D956582F-4071-47E6-A8E7-4C5A83770045} - {E62E5E11-7119-4782-BCF4-A5913F4048FE} = {59124A98-14AF-4201-87D7-6DC9C92D9849} - {F6242694-66A5-4E59-9ECD-510D3D81C8C6} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {EF08AB1B-50DE-4D26-BCCF-48DDE2A8E2CB} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {B063C9CC-868A-4474-8DCD-1708A65D4F2A} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {20960ED7-76FC-4DBD-8358-1A424D1E0DC1} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {22643BF8-A5ED-48CA-BD1A-10BFEC075DBE} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - {533BCE80-61BC-443A-95D3-2C6328921ED8} = {B2DA607D-4A39-4F0C-A9B3-DD9A061B0B4E} - {B0E3CA19-C101-4E30-9401-C017B7088F4E} = {533BCE80-61BC-443A-95D3-2C6328921ED8} - {D17B5B36-5773-4827-9D5D-44390DF666CA} = {4FB3BD6D-D4C1-4BEF-AD62-8FD6EAEEB4DF} - {81E8A8F5-91EA-43F2-9B19-83B85EED7DB7} = {F844C2A1-C36D-400E-A0D8-7658EF9C3B93} - {CAB4132B-82E4-4B37-AF05-7F446DE3AF04} = {4F908878-0EB8-43E4-96E4-8B1F32E9B635} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D7DAA0E6-098F-4B18-8775-64FDA96F1FF0} - EndGlobalSection -EndGlobal diff --git a/src/Utils/src/Models/Masa.Utils.Models.Config/AppConfig.cs b/src/Utils/Models/Config/src/Masa.Utils.Models.Config/AppConfig.cs similarity index 100% rename from src/Utils/src/Models/Masa.Utils.Models.Config/AppConfig.cs rename to src/Utils/Models/Config/src/Masa.Utils.Models.Config/AppConfig.cs diff --git a/src/Utils/src/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj b/src/Utils/Models/Config/src/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj similarity index 100% rename from src/Utils/src/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj rename to src/Utils/Models/Config/src/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj diff --git a/src/Utils/README.md b/src/Utils/README.md deleted file mode 100644 index 898ac3388..000000000 --- a/src/Utils/README.md +++ /dev/null @@ -1,74 +0,0 @@ -[中](README.zh-CN.md) | EN - -# MASA.Utils - -MASA.Utils is a library of MASA tools used by projects such as [MASA Stack](https://github.com/masastack) and [MASA Labs](https://github.com/masalabs). - - - -## Roadmap -* [Release Notes](https://github.com/masastack/MASA.Utils/releases) -* [Latest Roadmap](https://github.com/masastack/MASA.Utils/issues/41) - - - -## Features -* Caching - * Memory: memory cache - * Redis - * DistributedMemory: Distributed memory cache -* Caller - * [HttpClient](./src/Caller/Masa.Utils.Caller.HttpClient/README.md) - * [DaprClient](./src/Caller/Masa.Utils.Caller.DaprClient/README.md) -* Data - * [Elasticsearch](./src/Data/Masa.Utils.Data.Elasticsearch/README.md) -* Development - * [Development.Dapr](./src/Development/Masa.Utils.Development.Dapr/README.md): Dapr Starter Core Library - * [Development.Dapr.AspNetCore](./src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.md): Dapr AspNetCore library -* Extensions - * [DependencyInjection](./src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md): inject extension - * DotNet: DotNet extension - * Enums: enum extension - * Expressions: Expression expansion -* Ldap - * Ldap.Novell: Novell-based LDAP client library -* [Exceptions](https://github.com/masastack/MASA.Utils/blob/main/src/Masa.Utils.Exceptions/README.md): Exception extension -* Security: security - * Authentication: Authentication - * Cryptography: Password extension, support AES encryption and decryption, DES encryption and decryption, Base64 encoding, MD5 encryption, SHA encryption, etc. - * Token: JWT token management - - - -## How to contribute - -1. Fork & Clone -2. Create Feature_xxx branch -3. Commit with commit message, like `feat(Elasticsearch): Support Index management, document management, alias management` -4. Create Pull Request - -If you wish to contribute, please [Pull Request](https://github.com/masastack/MASA.Utils/pulls), or send us a [Report Bug](https://github.com/masastack/MASA.Utils /issues/new) . - - - -## Contributors - -Thanks to all the friends who have contributed to this project. - - - - - - - -## Code of conduct - -This project adopts the Code of Conduct as defined by the Contributors Covenant to clarify the expected behavior of our community. For more information see [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). - - - -## ☀️ License Statement - -[![MASA.Utils](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) - -Copyright (c) 2021-present MASA Stack \ No newline at end of file diff --git a/src/Utils/README.zh-CN.md b/src/Utils/README.zh-CN.md deleted file mode 100644 index 40d1c307c..000000000 --- a/src/Utils/README.zh-CN.md +++ /dev/null @@ -1,74 +0,0 @@ -中 | [EN](README.md) - -# MASA.Utils - -MASA.Utils是MASA的工具库,这些工具被[MASA Stack](https://github.com/masastack)和[MASA Labs](https://github.com/masalabs)等项目使用。 - - - -## 路线图 -* [发行说明](https://github.com/masastack/MASA.Utils/releases) -* [最新路线图](https://github.com/masastack/MASA.Utils/issues/41) - - - -## 特性 -* Caching - * Memory: 内存缓存 - * Redis - * DistributedMemory: 分布式内存缓存 -* Caller - * [HttpClient](./src/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md) - * [DaprClient](./src/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md) -* Data - * [Elasticsearch](./src/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md) -* Development - * [Development.Dapr](./src/Development/Masa.Utils.Development.Dapr/README.zh-CN.md): Dapr Starter核心库 - * [Development.Dapr.AspNetCore](./src/Development/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md): Dapr AspNetCore库 -* Extensions - * [DependencyInjection](./src/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md): 注入扩展 - * DotNet: DotNet扩展 - * Enums: 枚举扩展 - * Expressions: 表达式扩展 -* Ldap - * Ldap.Novell: 基于Novell的LDAP客户端库 -* [Exceptions](https://github.com/masastack/MASA.Utils/blob/main/src/Masa.Utils.Exceptions/README.zh-CN.md): 异常扩展 -* Security: 安全 - * Authentication: 身份验证 - * Cryptography: 密码扩展,支持AES加解密、DES加解密、Base64编码、MD5加密、SHA加密等 - * Token: JWT令牌管理 - - - -## 如何贡献 - -1. Fork & Clone -2. Create Feature_xxx branch -3. Commit with commit message, like `feat(Elasticsearch): Support Index management, document management, alias management` -4. Create Pull Request - -如果你希望参与贡献,欢迎 [Pull Request](https://github.com/masastack/MASA.Utils/pulls),或给我们 [报告 Bug](https://github.com/masastack/MASA.Utils/issues/new) 。 - - - -## 贡献者 - -感谢所有为本项目做出过贡献的朋友。 - - - - - - - -## 行为准则 - -本项目采用了《贡献者公约》所定义的行为准则,以明确我们社区的预期行为。更多信息请见 [MASA Stack Community Code of Conduct](https://github.com/masastack/community/blob/main/CODE-OF-CONDUCT.md). - - - -## ☀️ 许可声明 - -[![MASA.Utils](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt) - -Copyright (c) 2021-present MASA Stack \ No newline at end of file diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs rename to src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs rename to src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs rename to src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs rename to src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj similarity index 73% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj rename to src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj index 918c9f174..0febb3378 100644 --- a/src/Utils/src/Security/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj +++ b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj @@ -14,8 +14,7 @@ - - + diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/MasaUser.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/MasaUser.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication/MasaUser.cs rename to src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/MasaUser.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs rename to src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication/_Imports.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/_Imports.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication/_Imports.cs rename to src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/_Imports.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj b/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj rename to src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs b/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs rename to src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs b/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs rename to src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/AesUtils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/AesUtils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/AesUtils.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/AesUtils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Base64Utils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Base64Utils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DESEncryType.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DESEncryType.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/DesUtils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DesUtils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/DesUtils.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DesUtils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptBase.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptBase.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptType.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptType.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/EncryptType.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptType.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/FillType.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/FillType.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/FillType.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/FillType.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/MD5Utils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/MD5Utils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA1Utils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA1Utils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA256Utils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA256Utils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA384Utils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA384Utils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA512Utils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA512Utils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Cryptography/_Imports.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/_Imports.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Cryptography/_Imports.cs rename to src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/_Imports.cs diff --git a/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs b/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs rename to src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs diff --git a/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs b/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs rename to src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs diff --git a/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj b/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj similarity index 85% rename from src/Utils/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj rename to src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj index e88eeb141..161d25c3a 100644 --- a/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj +++ b/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/Utils/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs b/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs similarity index 100% rename from src/Utils/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs rename to src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/DefaultJwtProvider.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs rename to src/Utils/Security/Token/src/Masa.Utils.Security.Token/DefaultJwtProvider.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/IJwtProvider.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/IJwtProvider.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Token/IJwtProvider.cs rename to src/Utils/Security/Token/src/Masa.Utils.Security.Token/IJwtProvider.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/JwtUtils.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/JwtUtils.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Token/JwtUtils.cs rename to src/Utils/Security/Token/src/Masa.Utils.Security.Token/JwtUtils.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj rename to src/Utils/Security/Token/src/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs rename to src/Utils/Security/Token/src/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs rename to src/Utils/Security/Token/src/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs diff --git a/src/Utils/src/Security/Masa.Utils.Security.Token/_Imports.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/_Imports.cs similarity index 100% rename from src/Utils/src/Security/Masa.Utils.Security.Token/_Imports.cs rename to src/Utils/Security/Token/src/Masa.Utils.Security.Token/_Imports.cs diff --git a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj b/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj deleted file mode 100644 index d3bd13a85..000000000 --- a/src/Utils/src/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj index f404733be..9b02fb8cf 100644 --- a/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj +++ b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj @@ -20,14 +20,14 @@ - - - - - - - - + + + + + + + + From c546eed30008c7421707a0b3f3ac1433ef513e30 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 17:10:30 +0800 Subject: [PATCH 11/29] refactor: Refactor repo structure --- Masa.Framework.sln | 3717 ++++++++--------- .../Caches/IApiResourceCache.cs | 19 - .../Caches/IApiScopeCache.cs | 19 - .../Caches/IClientCache.cs | 19 - .../Caches/IIdentityResourceCache.cs | 19 - ...ingBlocks.Authentication.Oidc.Cache.csproj | 14 - .../_Imports.cs | 5 - .../Constants/GrantTypeConsts.cs | 37 - .../Constants/GrantTypes.cs | 19 - .../Entities/Abstract/Property.cs | 11 - .../Entities/Abstract/Secret.cs | 15 - .../Entities/ApiResource.cs | 78 - .../Entities/ApiResourceClaim.cs | 21 - .../Entities/ApiResourceProperty.cs | 18 - .../Entities/ApiResourceScope.cs | 21 - .../Entities/ApiResourceSecret.cs | 12 - .../Entities/ApiScope.cs | 66 - .../Entities/ApiScopeClaim.cs | 20 - .../Entities/ApiScopeProperty.cs | 17 - .../Entities/Client.cs | 161 - .../Entities/ClientClaim.cs | 15 - .../Entities/ClientCorsOrigin.cs | 13 - .../Entities/ClientGrantType.cs | 19 - .../Entities/ClientIdPRestriction.cs | 13 - .../Entities/ClientPostLogoutRedirectUri.cs | 18 - .../Entities/ClientProperty.cs | 17 - .../Entities/ClientRedirectUri.cs | 19 - .../Entities/ClientScope.cs | 18 - .../Entities/ClientSecret.cs | 11 - .../Entities/DeviceFlowCodes.cs | 71 - .../Entities/IdentityResource.cs | 66 - .../Entities/IdentityResourceClaim.cs | 21 - .../Entities/IdentityResourceProperty.cs | 18 - .../Entities/PersistedGrant.cs | 25 - .../Entities/UserClaim.cs | 22 - .../Enums/ClientTypes.cs | 13 - .../Enums/TokenExpiration.cs | 20 - .../Enums/TokenUsage.cs | 20 - ...ngBlocks.Authentication.Oidc.Domain.csproj | 13 - .../Repositories/IApiResourceRepository.cs | 8 - .../Repositories/IApiScopeRepository.cs | 8 - .../Repositories/IClientRepository.cs | 8 - .../IIdentityResourceRepository.cs | 9 - .../Repositories/IRepositoryBase.cs | 24 - .../Repositories/IUserClaimRepository.cs | 9 - .../_Imports.cs | 11 - .../Constans/GrantType.cs | 19 - .../Constans/GrantTypes.cs | 37 - .../Constans/StandardIdentityResources.cs | 104 - .../Constans/StandardUserClaims.cs | 78 - .../Enums/AccessTokenType.cs | 13 - .../Enums/TokenExpiration.cs | 13 - .../Enums/TokenUsage.cs | 13 - ...ngBlocks.Authentication.Oidc.Models.csproj | 9 - .../Models/ApiResourceModel.cs | 50 - .../Models/ApiScopeModel.cs | 46 - .../Models/ClientClaimModel.cs | 59 - .../Models/ClientModel.cs | 227 - .../Models/DeviceCodeModel.cs | 113 - .../Models/GrantType.cs | 22 - .../Models/IdentityResourceModel.cs | 48 - .../Models/PersistedGrantFilter.cs | 44 - .../Models/PersistedGrantModel.cs | 114 - .../Models/ResourceModel.cs | 23 - .../Models/ResourcesModel.cs | 45 - .../Models/SecretModel.cs | 40 - .../_Imports.cs | 9 - ...gBlocks.Authentication.Oidc.Storage.csproj | 16 - .../Stores/IClientStore.cs | 14 - .../Stores/IDeviceFlowStore.cs | 45 - .../Stores/IPersistedGrantStore.cs | 45 - .../Stores/IResourceStore.cs | 42 - .../_Imports.cs | 4 - .../AbstractConfigurationRepository.cs | 42 - .../ConfigurationTypes.cs | 12 - .../IConfigurationApi.cs | 9 - .../IConfigurationApiClient.cs | 19 - .../IConfigurationApiManage.cs | 19 - .../IConfigurationRepository.cs | 15 - .../IMasaConfiguration.cs | 11 - .../IMasaConfigurationBuilder.cs | 15 - .../IRepositoryChangeListener.cs | 9 - .../Masa.BuildingBlocks.Configuration.csproj | 15 - .../Options/ConfigurationRelationOptions.cs | 18 - .../Options/IMasaConfigurationOptions.cs | 28 - .../Options/MasaConfigurationOptions.cs | 21 - .../Properties.cs | 73 - .../SectionTypes.cs | 10 - .../_Imports.cs | 9 - ....BuildingBlocks.Configuration.Tests.csproj | 21 - .../TestProperties.cs | 66 - .../_Imports.cs | 4 - .../DataFiltering/IDataFilter.cs | 13 - .../DataFiltering/ISoftDelete.cs | 9 - .../Masa.BuildingBlocks.Data.Contracts.csproj | 13 - .../Paginated/BasePaginatedList.cs | 14 - .../_Imports.cs | 5 - .../BaseDbConnectionStringProvider.cs | 13 - .../DefaultConcurrencyStampProvider.cs | 9 - .../Concurrency/IConcurrencyStampProvider.cs | 9 - .../Concurrency/IHasConcurrencyStamp.cs | 9 - .../ConnectionStringNameAttribute.cs | 24 - .../ConnectionStrings.cs | 29 - .../Enum/SequentialGuidType.cs | 26 - .../Enum/TimestampType.cs | 10 - .../IConnectionStringProvider.cs | 21 - .../IDbConnectionStringProvider.cs | 9 - .../IDistributedLock.cs | 11 - .../IMasaDbContext.cs | 8 - .../IdGenerator/IGuidGenerator.cs | 8 - .../IdGenerator/IIdGenerator.cs | 11 - .../IdGenerator/ISequentialGuidGenerator.cs | 9 - .../IdGenerator/ISnowflakeGenerator.cs | 8 - .../IdGenerator/IdGeneratorFactory.cs | 36 - .../Masa.BuildingBlocks.Data.csproj | 13 - .../Options/MasaDbConnectionOptions.cs | 21 - .../MasaDbContextConfigurationOptions.cs | 11 - .../System/SequentialGuid.cs | 9 - .../System/Snowflake.cs | 9 - .../src/Masa.BuildingBlocks.Data/_Imports.cs | 5 - .../IMapping.cs | 13 - .../Mapper.cs | 22 - .../Masa.BuildingBlocks.Data.Mapping.csproj | 13 - .../Options/Enum/MapMode.cs | 16 - .../Options/MapOptions.cs | 9 - .../_Imports.cs | 6 - ...ildingBlocks.Data.MappingExtensions.csproj | 13 - .../ObjectExtensions.cs | 19 - .../_Imports.cs | 5 - .../CommitState.cs | 16 - .../EntityState.cs | 10 - .../ITransaction.cs | 10 - .../IUnitOfWork.cs | 43 - .../IUnitOfWorkAccessor.cs | 12 - .../IUnitOfWorkManager.cs | 17 - .../Masa.BuildingBlocks.Data.UoW.csproj | 13 - .../Masa.BuildingBlocks.Data.UoW/_Imports.cs | 6 - .../Entities/AggregateRoot.cs | 80 - .../Entities/Auditing/AuditAggregateRoot.cs | 54 - .../Entities/Auditing/AuditEntity.cs | 54 - .../Entities/Auditing/IAuditAggregateRoot.cs | 14 - .../Entities/Auditing/IAuditEntity.cs | 19 - .../Entities/Entity.cs | 78 - .../Entities/Full/FullAggregateRoot.cs | 24 - .../Entities/Full/FullEntity.cs | 24 - .../Entities/Full/IFullAggregateRoot.cs | 14 - .../Entities/Full/IFullEntity.cs | 14 - .../Entities/IAggregateRoot.cs | 14 - .../Entities/IEntity.cs | 14 - .../Entities/IGenerateDomainEvents.cs | 11 - .../Events/DomainCommand.cs | 29 - .../Events/DomainEvent.cs | 29 - .../Events/DomainQuery.cs | 36 - .../Events/IDomainCommand.cs | 9 - .../Events/IDomainEvent.cs | 9 - .../Events/IDomainEventBus.cs | 14 - .../Events/IDomainQuery.cs | 10 - .../Events/IIntegrationDomainEvent.cs | 9 - .../Events/IntegrationDomainEvent.cs | 12 - .../Masa.BuildingBlocks.Ddd.Domain.csproj | 16 - .../Repositories/BaseRepository.cs | 163 - .../Repositories/IRepository.cs | 132 - .../Repositories/PaginatedList.cs | 9 - .../Repositories/PaginatedOptions.cs | 36 - .../SeedWork/Enumeration.cs | 72 - .../Services/IDomainService.cs | 9 - .../Specifications/BaseSpecification.cs | 30 - .../Specifications/ISpecification.cs | 20 - .../Values/ValueObject.cs | 38 - .../_Imports.cs | 16 - ...asa.BuildingBlocks.Ddd.Domain.Tests.csproj | 21 - .../TestEntity.cs | 64 - .../TestValueObject.cs | 52 - .../_Imports.cs | 5 - .../Event.cs | 26 - .../IDispatcherOptions.cs | 11 - .../IEvent.cs | 21 - .../IEventBus.cs | 14 - .../IEventBusBuilder.cs | 11 - .../IEventHandler.cs | 10 - .../IMiddleware.cs | 21 - .../ISagaEventHandler.cs | 10 - ...sa.BuildingBlocks.Dispatcher.Events.csproj | 13 - .../Middleware.cs | 11 - .../_Imports.cs | 5 - .../IDistributedDispatcherOptions.cs | 8 - .../IIntegrationEvent.cs | 8 - .../IIntegrationEventBus.cs | 9 - .../ITopic.cs | 9 - .../IntegrationEvent.cs | 32 - .../IntegrationEventStates.cs | 12 - .../Logs/IIntegrationEventLogService.cs | 33 - .../Logs/IntegrationEventLog.cs | 72 - ...Blocks.Dispatcher.IntegrationEvents.csproj | 14 - .../_Imports.cs | 9 - .../DefaultTypeConvertProvider.cs | 15 - .../Entities/IIdentityUser.cs | 13 - .../Entities/IdentityRole.cs | 11 - .../Entities/IdentityUser.cs | 13 - .../Isolation/IIsolatedIdentityUser.cs | 8 - .../IMultiEnvironmentIdentityUser.cs | 9 - .../Isolation/IMultiTenantIdentityUser.cs | 9 - .../Isolation/IsolatedIdentityUser.cs | 9 - .../Isolation/MultiEnvironmentIdentityUser.cs | 9 - .../Isolation/MultiTenantIdentityUser.cs | 9 - .../Enum/IdentityType.cs | 23 - .../IIsolatedUserContext.cs | 10 - .../IMultiEnvironmentUserContext.cs | 9 - .../IMultiTenantUserContext.cs | 11 - .../ITypeConvertProvider.cs | 9 - .../IUserContext.cs | 19 - .../IUserSetter.cs | 9 - .../Internal/DisposeAction.cs | 17 - ...ildingBlocks.Identity.IdentityModel.csproj | 9 - .../UserContext.cs | 56 - .../_Imports.cs | 5 - .../Environment/IEnvironmentContext.cs | 9 - .../Environment/IEnvironmentSetter.cs | 9 - .../Environment/IMultiEnvironment.cs | 12 - .../IConvertProvider.cs | 9 - .../IIsolation.cs | 13 - .../IIsolationBuilder.cs | 9 - .../IParserProvider.cs | 11 - .../Masa.BuildingBlocks.Isolation.csproj | 18 - .../Middleware/IIsolationMiddleware.cs | 9 - .../MultiTenant/IMultiTenant.cs | 16 - .../MultiTenant/ITenantContext.cs | 9 - .../MultiTenant/ITenantSetter.cs | 9 - .../MultiTenant/Tenant.cs | 21 - .../Options/IsolationDbConnectionOptions.cs | 9 - .../Options/IsolationOptions.cs | 20 - .../Parser/CookieParserProvider.cs | 25 - .../EnvironmentVariablesParserProvider.cs | 20 - .../Parser/FormParserProvider.cs | 27 - .../Parser/HeaderParserProvider.cs | 25 - .../Parser/HttpContextItemParserProvider.cs | 25 - .../Parser/QueryStringParserProvider.cs | 24 - .../Parser/RouteParserProvider.cs | 22 - .../Masa.BuildingBlocks.Isolation/_Imports.cs | 9 - .../Commands/Command.cs | 29 - .../Commands/ICommand.cs | 8 - .../Commands/ICommandHandler.cs | 9 - ...ildingBlocks.ReadWriteSpliting.Cqrs.csproj | 14 - .../Queries/IQuery.cs | 9 - .../Queries/IQueryHandler.cs | 9 - .../Queries/Query.cs | 29 - .../_Imports.cs | 6 - ...cks.ReadWriteSpliting.EventSourcing.csproj | 9 - .../AutoCompleteDocument.cs | 80 - .../BaseAutoCompleteClient.cs | 96 - .../IAutoCompleteClient.cs | 80 - .../IAutoCompleteFactory.cs | 11 - ...ingBlocks.SearchEngine.AutoComplete.csproj | 9 - .../Options/AutoCompleteOptions.cs | 47 - .../Options/SetOptions.cs | 14 - .../Response/DeleteMultiResponse.cs | 20 - .../Response/DeleteRangeResponseItems.cs | 20 - .../Response/DeleteResponse.cs | 11 - .../Response/GetResponse.cs | 25 - .../Response/ResponseBase.cs | 17 - .../Response/SetResponse.cs | 13 - .../Response/SetResponseItems.cs | 20 - .../SearchType.cs | 10 - .../_Imports.cs | 6 - .../CustomAutoCompleteClient.cs | 28 - ...cks.SearchEngine.AutoComplete.Tests.csproj | 21 - .../TestAutoCompleteClient.cs | 28 - .../_Imports.cs | 6 - .../AbstractCaller.cs | 391 -- .../AddCallerExtensions.cs | 15 - .../CallerBase.cs | 31 - .../ICaller.cs | 219 - .../ICallerFactory.cs | 11 - .../IRequestMessage.cs | 11 - .../IResponseMessage.cs | 11 - .../ITypeConvertor.cs | 24 - .../Masa.BuildingBlocks.Service.Caller.csproj | 14 - .../Masa.Utils.Caller.Core.csproj | 19 - .../Options/CallerFactoryOptions.cs | 13 - .../Options/CallerOptions.cs | 36 - .../Options/CallerRelationOptions.cs | 20 - .../_Imports.cs | 8 - .../IService.cs | 15 - ....BuildingBlocks.Service.MinimalAPIs.csproj | 14 - .../_Imports.cs | 5 - .../BaseMessage.cs | 14 - .../BaseRequest.cs | 8 - .../BaseResponse.cs | 30 - ...sa.BuildingBlocks.Service.Contracts.csproj | 9 - .../Enum/GenderTypes.cs | 10 - .../Enum/StaffTypes.cs | 10 - .../Enum/SubjectTypes.cs | 12 - .../Enum/TeamTypes.cs | 9 - ...dingBlocks.StackSdks.Auth.Contracts.csproj | 9 - .../Model/AddUserModel.cs | 38 - .../Model/AddressValueModel.cs | 33 - .../Model/AppModel.cs | 19 - .../Model/CollectMenuModel.cs | 11 - .../Model/DisableUserModel.cs | 14 - .../Model/MenuModel.cs | 19 - .../Model/NavModel.cs | 17 - .../Model/ProjectModel.cs | 15 - .../Model/RoleModel.cs | 11 - .../Model/StaffDetailModel.cs | 16 - .../Model/StaffModel.cs | 80 - .../Model/SubjectModel.cs | 45 - .../Model/TeamDetailModel.cs | 49 - .../Model/TeamModel.cs | 19 - .../Model/TeamPersonnelModel.cs | 20 - .../Model/UpdateUserBasicInfoModel.cs | 19 - .../Model/UpdateUserPasswordModel.cs | 13 - .../Model/UpsertUserModel.cs | 38 - .../Model/UserModel.cs | 73 - .../Model/UserPortraitModel.cs | 17 - .../Model/UserSimpleModel.cs | 20 - .../Model/UserVisitedModel.cs | 11 - .../_Imports.cs | 4 - .../IAuthClient.cs | 18 - .../IEnvironmentProvider.cs | 9 - .../Masa.BuildingBlocks.StackSdks.Auth.csproj | 13 - .../Service/IPermissionService.cs | 29 - .../Service/IProjectService.cs | 9 - .../Service/ISubjectService.cs | 10 - .../Service/ITeamService.cs | 14 - .../Service/IUserService.cs | 52 - .../_Imports.cs | 5 - .../IDccClient.cs | 9 - .../Masa.BuildingBlocks.StackSdks.Dcc.csproj | 9 - .../Model/LabelModel.cs | 20 - .../Service/ILabelService.cs | 9 - .../_Imports.cs | 5 - .../Enum/ChannelTypes.cs | 11 - .../Enum/MessageTaskReceiverTypes.cs | 13 - .../Enum/MessageTaskSelectReceiverTypes.cs | 10 - .../Enum/MessageTaskSources.cs | 10 - .../Enum/MessageTaskStatuses.cs | 14 - .../Enum/MessageTemplateAuditStatuses.cs | 11 - .../Enum/MessageTemplateStates.cs | 10 - .../Enum/MessageTypes.cs | 10 - .../Enum/ReceiverGroupItemTypes.cs | 12 - .../Enum/SendTargets.cs | 10 - .../Enum/WebsiteMessageFilterType.cs | 10 - .../IMcClient.cs | 17 - .../ExtraPropertyDictionary.cs | 18 - .../Masa.BuildingBlocks.StackSdks.Mc.csproj | 13 - .../Model/AuditEntityModel.cs | 15 - .../Model/ChannelModel.cs | 17 - .../Model/EntityModel.cs | 9 - .../Model/GetChannelModel.cs | 13 - .../Model/GetMessageTemplateModel.cs | 23 - .../Model/GetNoticeListModel.cs | 9 - .../Model/GetReceiverGroupModel.cs | 9 - .../Model/GetWebsiteMessageModel.cs | 15 - .../Model/MessageInfoModel.cs | 17 - .../Model/MessageInfoUpsertModel.cs | 17 - .../Model/MessageTaskModel.cs | 43 - .../Model/MessageTaskReceiverModel.cs | 21 - .../Model/MessageTemplateItemModel.cs | 15 - .../Model/MessageTemplateModel.cs | 50 - .../Model/PaginatedListModel.cs | 25 - .../Model/PaginatedOptionsModel.cs | 20 - .../Model/ReadAllWebsiteMessageModel.cs | 8 - .../Model/ReadWebsiteMessageModel.cs | 9 - .../Model/ReceiverGroupItemModel.cs | 21 - .../Model/ReceiverGroupModel.cs | 15 - .../Model/SendOrdinaryMessageModel.cs | 23 - .../Model/SendRuleModel.cs | 13 - .../Model/SendTemplateMessageModel.cs | 25 - .../Model/WebsiteMessageChannelModel.cs | 9 - .../Model/WebsiteMessageModel.cs | 31 - .../Service/IChannelService.cs | 11 - .../Service/IMessageTaskService.cs | 13 - .../Service/IMessageTemplateService.cs | 11 - .../Service/IReceiverGroupService.cs | 11 - .../Service/IWebsiteMessageService.cs | 27 - .../_Imports.cs | 8 - .../Enum/AppTypes.cs | 16 - .../Enum/ServiceTypes.cs | 13 - .../IPmClient.cs | 17 - .../Masa.BuildingBlocks.StackSdks.Pm.csproj | 9 - .../Model/AppDetailModel.cs | 27 - .../Model/AppModel.cs | 31 - .../Model/BaseModel.cs | 15 - .../Model/ClusterDetailModel.cs | 15 - .../Model/ClusterModel.cs | 13 - .../Model/EnvironmentClusterModel.cs | 23 - .../Model/EnvironmentDetailModel.cs | 17 - .../Model/EnvironmentModel.cs | 13 - .../Model/ProjectAppsModel.cs | 28 - .../Model/ProjectDetailModel.cs | 21 - .../Model/ProjectModel.cs | 23 - .../Model/ProjectTypeModel.cs | 11 - .../Service/IAppService.cs | 19 - .../Service/IClusterService.cs | 17 - .../Service/IEnvironmentService.cs | 13 - .../Service/IProjectService.cs | 21 - .../_Imports.cs | 7 - .../Enum/HttpMethods.cs | 13 - .../Enum/HttpVerifyTypes.cs | 12 - .../Enum/JobTypes.cs | 11 - .../Enum/RunTimeoutStrategyTypes.cs | 10 - .../Enum/ScheduleBlockStrategyTypes.cs | 12 - .../Enum/ScheduleExpiredStrategyTypes.cs | 11 - .../ISchedulerClient.cs | 11 - .../ISchedulerJob.cs | 13 - ....BuildingBlocks.StackSdks.Scheduler.csproj | 9 - .../Model/JobContext.cs | 19 - .../Model/SchedulerJobAppConfig.cs | 17 - ...SchedulerJobDaprServiceInvocationConfig.cs | 15 - .../Model/SchedulerJobHttpConfig.cs | 21 - .../Request/AddSchedulerJobRequest.cs | 48 - .../Request/BaseSchedulerJobRequest.cs | 11 - .../Request/BaseSchedulerTaskRequest.cs | 11 - .../Request/ChangeEnabledStatusRequest.cs | 9 - .../Request/StartSchedulerTaskRequest.cs | 9 - .../Service/ISchedulerJobService.cs | 17 - .../Service/ISchedulerTaskService.cs | 11 - .../_Imports.cs | 7 - .../Enums/AggregationTypes.cs | 11 - .../ITscClient.cs | 11 - .../Masa.BuildingBlocks.StackSdks.Tsc.csproj | 9 - .../Model/Log/FieldAggregationRequest.cs | 13 - .../Model/Log/LogAggregationRequest.cs | 15 - .../Model/Log/LogLatestRequest.cs | 15 - .../Model/Metric/LableValuesRequest.cs | 27 - .../Model/Metric/ValuesRequest.cs | 20 - .../Service/ILogService.cs | 13 - .../Service/IMetricService.cs | 13 - .../_Imports.cs | 7 - .../BucketNameAttribute.cs | 24 - .../BucketNames.cs | 26 - .../DefaultClientContainer.cs | 51 - .../DefaultClientFactory.cs | 19 - .../IBucketNameProvider.cs | 11 - .../IClient.cs | 54 - .../IClientContainer.cs | 53 - .../IClientFactory.cs | 9 - ...uildingBlocks.Storage.ObjectStorage.csproj | 13 - .../Response/TemporaryCredentialsResponse.cs | 23 - .../StorageOptions.cs | 19 - .../_Imports.cs | 6 - .../Caches/ApiResourceCache.cs | 78 - .../Caches/ApiScopeCache.cs | 78 - .../Caches/ClientCache.cs | 58 - .../Caches/IdentityResourceCache.cs | 78 - ...a.Contrib.Authentication.Oidc.Cache.csproj | 15 - .../Models/CacheKeyConstants.cs | 12 - .../Models/Mapper.cs | 106 - .../README.md | 49 - .../README.zh-CN.md | 49 - .../ServiceCollectionExtensions.cs | 18 - .../Utils/CollectionExtensions.cs | 52 - .../_Imports.cs | 14 - .../Caches/SyncCache.cs | 111 - .../DbContexts/OidcDbContext.cs | 19 - ...ApiResourceClaimEntityTypeConfiguration.cs | 12 - .../ApiResourceEntityTypeConfiguration.cs | 20 - ...ResourcePropertyEntityTypeConfiguration.cs | 13 - ...ApiResourceScopeEntityTypeConfiguration.cs | 12 - ...piResourceSecretEntityTypeConfiguration.cs | 14 - .../ApiScopeClaimEntityTypeConfiguration.cs | 12 - .../ApiScopeEntityTypeConfiguration.cs | 18 - ...ApiScopePropertyEntityTypeConfiguration.cs | 13 - .../ClientClaimEntityTypeConfiguration.cs | 13 - ...ClientCorsOriginEntityTypeConfiguration.cs | 12 - .../ClientEntityTypeConfiguration.cs | 35 - .../ClientGrantTypeEntityTypeConfiguration.cs | 12 - ...ntIdPRestrictionEntityTypeConfiguration.cs | 12 - ...ogoutRedirectUriEntityTypeConfiguration.cs | 12 - .../ClientPropertyEntityTypeConfiguration.cs | 13 - ...lientRedirectUriEntityTypeConfiguration.cs | 12 - .../ClientScopeEntityTypeConfiguration.cs | 12 - .../ClientSecretEntityTypeConfiguration.cs | 14 - .../DeviceFlowCodesEntityTypeConfiguration.cs | 27 - ...ityResourceClaimEntityTypeConfiguration.cs | 12 - ...IdentityResourceEntityTypeConfiguration.cs | 18 - ...ResourcePropertyEntityTypeConfiguration.cs | 13 - .../PersistedGrantEntityTypeConfiguration.cs | 27 - .../UserClaimEntityTypeConfiguration.cs | 14 - ...entication.Oidc.EntityFrameworkCore.csproj | 19 - .../Options/OidcDbContextOptions.cs | 41 - .../README.md | 39 - .../README.zh-CN.md | 39 - .../Repositories/ApiResourceRepository.cs | 91 - .../Repositories/ApiScopeRepository.cs | 89 - .../Repositories/ClientRepository.cs | 92 - .../IdentityResourceRepository.cs | 114 - .../Repositories/UserClaimRepository.cs | 97 - .../ServiceCollectionExtensions.cs | 36 - .../_Imports.cs | 16 - ...b.Authentication.Oidc.Cache.Storage.csproj | 17 - .../README.md | 47 - .../README.zh-CN.md | 47 - .../ServiceCollectionExtensions.cs | 18 - .../Stores/ClientStore.cs | 22 - .../Stores/DeviceFlowStore.cs | 32 - .../Stores/PersistedGrantStore.cs | 32 - .../Stores/ResourceStore.cs | 58 - .../_Imports.cs | 9 - .../ConfigurationOptions.cs | 20 - .../DefaultConfigurationApi.cs | 19 - .../DefaultMasaConfiguration.cs | 21 - .../DefaultMasaConfigurationSourceProvider.cs | 79 - .../IMasaConfigurationSourceProvider.cs | 12 - .../Internal/ConfigurationExtensions.cs | 31 - .../LocalMasaConfigurationOptions.cs | 16 - .../LocalMasaConfigurationRepository.cs | 61 - .../Masa.Contrib.Configuration.csproj | 17 - .../MasaConfigurationBuilder.cs | 39 - .../MasaConfigurationExtensions.cs | 47 - .../MasaConfigurationProvider.cs | 67 - .../MasaConfigurationSource.cs | 18 - .../MasaRelationOptions.cs | 54 - .../src/Masa.Contrib.Configuration/README.md | 125 - .../README.zh-CN.md | 131 - .../ServiceCollectionExtensions.cs | 120 - .../WebApplicationBuilderExtensions.cs | 60 - .../Masa.Contrib.Configuration/_Imports.cs | 24 - .../EsOptions.cs | 14 - ...AutoMap.NoArgumentConstructor.Tests.csproj | 15 - .../KafkaOptions.cs | 11 - ...Contrib.Configuration.AutoMap.Tests.csproj | 14 - .../Config/MountSectionRedisOptions.cs | 9 - .../Config/RabbitMqOptions.cs | 23 - .../Config/RedisOptions.cs | 13 - .../Config/SystemOptions.cs | 9 - .../ConfigurationTest.cs | 296 -- .../Masa.Contrib.Configuration.Tests.csproj | 50 - .../_Imports.cs | 13 - .../appsettings.json | 14 - .../customAppConfig.json | 7 - .../rabbitMq.json | 9 - .../redis.json | 7 - .../ConfigurationApiClient.cs | 212 - .../ConfigurationApiExtensions.cs | 18 - .../ConfigurationApiManage.cs | 45 - .../Internal/ConfigFormats.cs | 13 - .../Internal/ConfigurationApiBase.cs | 40 - .../Internal/Constants.cs | 15 - .../Internal/DccConfigurationRepository.cs | 95 - .../Internal/DccFactory.cs | 23 - .../Internal/Model/Property.cs | 11 - .../Internal/Model/PublishRelease.cs | 34 - .../Internal/Model/StaticConfig.cs | 11 - .../Internal/Options/DccOptions.cs | 20 - .../Parser/JsonConfigurationParser.cs | 104 - .../Parser/PropertyConfigurationParser.cs | 10 - .../Internal/Parser/XmlConfigurationParser.cs | 83 - ....Configuration.ConfigurationApi.Dcc.csproj | 24 - .../MasaConfigurationExtensions.cs | 217 - ...onfigurationApiMasaConfigurationOptions.cs | 29 - .../Options/DccConfigurationOptions.cs | 16 - .../Options/DccExpandSectionOptions.cs | 12 - .../Options/DccSectionOptions.cs | 27 - .../README.md | 174 - .../README.zh-CN.md | 165 - .../_Imports.cs | 31 - .../CustomMemoryCacheClientFactory.cs | 13 - .../DccClientTest.cs | 464 -- .../DccManageTest.cs | 219 - .../DccTest.cs | 842 ---- .../Internal/Common/SerializeCommon.cs | 10 - .../Internal/Config/Property.cs | 11 - .../Internal/Config/PublishRelease.cs | 13 - .../Internal/CustomConfigurationApiClient.cs | 25 - .../Internal/CustomTrigger.cs | 29 - .../Internal/Enum/ConfigFormats.cs | 13 - .../Internal/Model/Brands.cs | 17 - ...guration.ConfigurationApi.Dcc.Tests.csproj | 41 - .../_Imports.cs | 32 - .../appsettings.json | 23 - .../expandSections.json | 32 - .../DataFiltering/DataFilter.cs | 71 - .../SoftDeleteSaveChangesFilter.cs | 93 - .../Internal/DataFilterState.cs | 14 - .../Internal/DisposeAction.cs | 13 - .../Internal/InstanceBuilder.cs | 27 - .../Internal/NullDisposable.cs | 13 - .../Masa.Contrib.Data.Contracts.EF.csproj | 18 - .../MasaDbContextOptionsBuilderExtensions.cs | 68 - .../Options/FilterOptions.cs | 15 - .../_Imports.cs | 19 - .../DataFilterTest.cs | 47 - ...asa.Contrib.Data.Contracts.EF.Tests.csproj | 29 - .../_Imports.cs | 7 - .../DefaultLocalDistributedLock.cs | 39 - .../ArgumentNullOrWhiteSpaceException.cs | 15 - .../Internal/DisposeAction.cs | 19 - ....Contrib.Data.DistributedLock.Local.csproj | 15 - .../README.md | 28 - .../README.zh-CN.md | 28 - .../ServiceCollectionExtensions.cs | 16 - .../_Imports.cs | 8 - .../LocalDistributedLockTest.cs | 32 - ...ib.Data.DistributedLock.Local.Tests.csproj | 21 - .../_Imports.cs | 6 - ...ata.DistributedLock.Medallion.Azure.csproj | 17 - .../MedallionBuilderExtensions.cs | 28 - .../README.md | 31 - .../README.zh-CN.md | 32 - .../_Imports.cs | 7 - ...istributedLock.Medallion.FileSystem.csproj | 17 - .../MedallionBuilderExtensions.cs | 16 - .../README.md | 31 - .../README.zh-CN.md | 32 - .../_Imports.cs | 6 - ...ata.DistributedLock.Medallion.MySql.csproj | 18 - .../MedallionBuilderExtensions.cs | 35 - .../README.md | 31 - .../README.zh-CN.md | 32 - .../_Imports.cs | 8 - ...ta.DistributedLock.Medallion.Oracle.csproj | 18 - .../MedallionBuilderExtensions.cs | 35 - .../README.md | 31 - .../README.zh-CN.md | 32 - .../_Imports.cs | 8 - ...istributedLock.Medallion.PostgreSql.csproj | 18 - .../MedallionBuilderExtensions.cs | 35 - .../README.md | 31 - .../README.zh-CN.md | 32 - .../_Imports.cs | 8 - .../ConfigurationOptionsExtensions.cs | 31 - ...ata.DistributedLock.Medallion.Redis.csproj | 18 - .../MedallionBuilderExtensions.cs | 47 - .../README.md | 31 - .../README.zh-CN.md | 32 - .../_Imports.cs | 10 - ...DistributedLock.Medallion.SqlServer.csproj | 19 - .../MedallionBuilderExtensions.cs | 34 - .../README.md | 31 - .../README.zh-CN.md | 32 - .../_Imports.cs | 8 - ...stributedLock.Medallion.WaitHandles.csproj | 18 - .../MedallionBuilderExtensions.cs | 19 - .../README.md | 33 - .../README.zh-CN.md | 33 - .../_Imports.cs | 6 - ...DistributedLock.Medallion.ZooKeeper.csproj | 17 - .../MedallionBuilderExtensions.cs | 24 - .../README.md | 31 - .../README.zh-CN.md | 32 - .../_Imports.cs | 6 - .../DefaultMedallionDistributedLock.cs | 32 - .../ArgumentNullOrWhiteSpaceException.cs | 15 - .../Internal/DisposeAction.cs | 19 - ...trib.Data.DistributedLock.Medallion.csproj | 18 - .../MedallionBuilder.cs | 11 - .../README.md | 46 - .../README.zh-CN.md | 47 - .../ServiceCollectionExtensions.cs | 23 - .../_Imports.cs | 9 - .../DefaultMedallionDistributedLockTest.cs | 38 - ...ata.DistributedLock.Medallion.Tests.csproj | 21 - .../_Imports.cs | 6 - .../Internal/Parser.cs | 26 - ...rib.Data.EntityFrameworkCore.Cosmos.csproj | 17 - .../MasaDbContextBuilderExtensions.cs | 105 - .../MasaDbContextOptionsBuilderExtensions.cs | 28 - .../README.md | 34 - .../README.zh-CN.md | 34 - .../_Imports.cs | 9 - ...b.Data.EntityFrameworkCore.InMemory.csproj | 17 - .../MasaDbContextBuilderExtensions.cs | 59 - .../MasaDbContextOptionsBuilderExtensions.cs | 16 - .../README.md | 33 - .../README.zh-CN.md | 33 - .../_Imports.cs | 8 - ...trib.Data.EntityFrameworkCore.MySql.csproj | 17 - .../MasaDbContextBuilderExtensions.cs | 81 - .../MasaDbContextOptionsBuilderExtensions.cs | 25 - .../README.md | 33 - .../README.zh-CN.md | 33 - .../_Imports.cs | 9 - ...rib.Data.EntityFrameworkCore.Oracle.csproj | 17 - .../MasaDbContextBuilderExtensions.cs | 81 - .../MasaDbContextOptionsBuilderExtensions.cs | 25 - .../README.md | 33 - .../README.zh-CN.md | 33 - .../_Imports.cs | 9 - ...ta.EntityFrameworkCore.Pomelo.MySql.csproj | 17 - .../MasaDbContextBuilderExtensions.cs | 89 - .../MasaDbContextOptionsBuilderExtensions.cs | 27 - .../README.md | 33 - .../README.zh-CN.md | 33 - .../_Imports.cs | 9 - ...Data.EntityFrameworkCore.PostgreSql.csproj | 17 - .../MasaDbContextBuilderExtensions.cs | 81 - .../MasaDbContextOptionsBuilderExtensions.cs | 25 - .../README.md | 33 - .../README.zh-CN.md | 33 - .../_Imports.cs | 9 - ....Data.EntityFrameworkCore.SqlServer.csproj | 17 - .../MasaDbContextBuilderExtensions.cs | 81 - .../MasaDbContextOptionsBuilderExtensions.cs | 25 - .../README.md | 33 - .../README.zh-CN.md | 33 - .../_Imports.cs | 9 - ...rib.Data.EntityFrameworkCore.Sqlite.csproj | 17 - .../MasaDbContextBuilderExtensions.cs | 81 - .../MasaDbContextOptionsBuilderExtensions.cs | 25 - .../README.md | 33 - .../README.zh-CN.md | 33 - .../_Imports.cs | 9 - .../DbConnectionStringProvider.cs | 14 - .../DefaultConnectionStringProvider.cs | 21 - .../EntityTypeBuilderExtensions.cs | 28 - .../Filters/ISaveChangesFilter.cs | 9 - .../Filters/SaveChangeFilter.cs | 56 - .../IModelCreatingProvider.cs | 13 - ...sa.Contrib.Data.EntityFrameworkCore.csproj | 24 - .../MasaDbContext.cs | 251 -- .../MasaDbContextBuilder.cs | 28 - .../MasaDbContextOptions.cs | 24 - .../MasaDbContextOptionsBuilder.cs | 20 - .../MasaDbContextOptionsBuilder`.cs | 22 - .../MasaDbContextOptions`.cs | 71 - .../README.md | 47 - .../README.zh-CN.md | 48 - .../ServiceCollectionExtensions.cs | 123 - .../_Imports.cs | 24 - .../CustomDbContext.cs | 18 - .../DbContextTest.cs | 219 - .../DefaultConnectionStringProviderTest.cs | 44 - .../Internal/PaginatedOptions.cs | 11 - .../Internal/Repository.cs | 35 - ...trib.Data.EntityFrameworkCore.Tests.csproj | 25 - .../Models/Address.cs | 11 - .../Models/Hobby.cs | 18 - .../Models/Student.cs | 19 - .../TestBase.cs | 34 - .../_Imports.cs | 14 - ...Contrib.Data.IdGenerator.NormalGuid.csproj | 17 - .../NormalGuidGenerator.cs | 11 - .../README.md | 26 - .../README.zh-CN.md | 26 - .../ServiceCollectionExtensions.cs | 15 - .../_Imports.cs | 6 - ...rib.Data.IdGenerator.SequentialGuid.csproj | 17 - .../README.md | 26 - .../README.zh-CN.md | 26 - .../SequentialGuidGenerator.cs | 71 - .../ServiceCollectionExtensions.cs | 19 - .../_Imports.cs | 7 - ...ta.IdGenerator.SequentialGuid.Tests.csproj | 20 - .../SequentialGuidGeneratorTest.cs | 20 - .../_Imports.cs | 8 - .../Benchmarks.cs | 59 - ...ta.IdGenerator.Snowflake.Benchmarks.csproj | 22 - .../Program.cs | 16 - .../_Imports.cs | 11 - .../DistributedBenchmarks.cs | 45 - ...wflake.Distributed.Redis.Benchmarks.csproj | 24 - .../Program.cs | 16 - .../_Imports.cs | 13 - .../BaseRedis.cs | 43 - .../DistributedIdGeneratorOptions.cs | 31 - .../DistributedWorkerProvider.cs | 185 - .../IdGeneratorOptionsExtensions.cs | 44 - .../Internal/SnowflakeExtensions.cs | 21 - .../MachineClockIdGenerator.cs | 42 - ...nerator.Snowflake.Distributed.Redis.csproj | 14 - .../README.md | 38 - .../README.zh-CN.md | 37 - .../_Imports.cs | 14 - .../BaseIdGenerator.cs | 109 - .../DefaultWorkerProvider.cs | 20 - .../IWorkerProvider.cs | 24 - .../IdGeneratorOptions.cs | 66 - .../Internal/Const.cs | 26 - .../Internal/EnironmentExtensions.cs | 16 - .../Internal/SnowflakeExtensions.cs | 21 - .../Internal/SnowflakeIdGenerator.cs | 21 - .../Internal/WorkerIdBackgroundServices.cs | 74 - .../MachineClockIdGenerator.cs | 29 - ....Contrib.Data.IdGenerator.Snowflake.csproj | 19 - .../README.md | 113 - .../README.zh-CN.md | 115 - .../ServiceCollectionExtensions.cs | 75 - .../_Imports.cs | 10 - .../CustomDistributedWorkerProvider.cs | 20 - .../IdGeneratorTest.cs | 353 -- ...ib.Data.IdGenerator.Snowflake.Tests.csproj | 20 - .../_Imports.cs | 17 - .../DefaultMapper.cs | 34 - .../DefaultMappingConfigProvider.cs | 187 - .../IMappingConfigProvider.cs | 9 - .../Internal/InvokeBuilder.cs | 40 - .../Internal/Options/MapTypeOptions.cs | 19 - .../Internal/TypeAdapterSetterExpand.cs | 15 - .../Masa.Contrib.Data.Mapping.Mapster.csproj | 19 - .../README.md | 85 - .../README.zh-CN.md | 86 - .../ServiceCollectionExtensions.cs | 46 - .../_Imports.cs | 15 - .../BaseMappingTest.cs | 20 - .../Domain/Aggregates/Orders/Order.cs | 36 - .../Domain/Aggregates/Orders/OrderItem.cs | 25 - .../Domain/Aggregates/Users/User.cs | 41 - .../Domain/ValueObjects/AddressItem.cs | 25 - .../MappingExtensionsTest.cs | 198 - .../MappingFormTest.cs | 28 - .../MappingTest.cs | 191 - ....Contrib.Data.Mapping.Mapster.Tests.csproj | 23 - .../Requests/AddressItemRequest.cs | 13 - .../Requests/Orders/OrderItemRequest.cs | 13 - .../Requests/Orders/OrderMultiRequest.cs | 13 - .../Requests/Orders/OrderRequest.cs | 11 - .../Requests/Users/CreateFullUserRequest.cs | 15 - .../Requests/Users/CreateUserRequest.cs | 9 - .../_Imports.cs | 16 - .../DefaultConnectionStringProvider.cs | 37 - .../DispatcherOptionsExtensions.cs | 84 - .../Internal/Const.cs | 9 - .../Masa.Contrib.Data.UoW.EF.csproj | 20 - .../src/Masa.Contrib.Data.UoW.EF/README.md | 25 - .../Masa.Contrib.Data.UoW.EF/README.zh-CN.md | 25 - .../Masa.Contrib.Data.UoW.EF/Transaction.cs | 12 - .../Masa.Contrib.Data.UoW.EF/UnitOfWork.cs | 109 - .../UnitOfWorkAccessor.cs | 9 - .../UnitOfWorkManager.cs | 39 - .../src/Masa.Contrib.Data.UoW.EF/_Imports.cs | 18 - .../CustomDbContext.cs | 42 - .../Masa.Contrib.Data.UoW.EF.Tests.csproj | 45 - .../TestBase.cs | 21 - .../TestUnitOfWork.cs | 279 -- .../_Imports.cs | 19 - .../appsettings.json | 5 - .../DispatcherOptionsExtensions.cs | 31 - .../Internal/LinqExtensions.cs | 96 - .../ServiceCollectionRepositoryExtensions.cs | 73 - .../Internal/TypeExtensions.cs | 13 - ...sa.Contrib.Ddd.Domain.Repository.EF.csproj | 18 - .../README.md | 71 - .../README.zh-CN.md | 71 - .../Repository.cs | 227 - .../_Imports.cs | 17 - .../Masa.Contrib.Ddd.Domain/DomainEventBus.cs | 79 - .../Masa.Contrib.Ddd.Domain/DomainService.cs | 11 - .../Masa.Contrib.Ddd.Domain.csproj | 18 - .../Options/DispatcherOptions.cs | 40 - .../src/Masa.Contrib.Ddd.Domain/README.md | 125 - .../Masa.Contrib.Ddd.Domain/README.zh-CN.md | 125 - .../ServiceCollectionExtensions.cs | 64 - .../src/Masa.Contrib.Ddd.Domain/_Imports.cs | 17 - .../Domain/Entities/Address.cs | 26 - .../Domain/Entities/OrderItem.cs | 19 - .../Domain/Entities/Orders.cs | 38 - ...trib.Ddd.Domain.Repository.EF.Tests.csproj | 25 - .../RepositoryTest.cs | 232 - .../_Imports.cs | 16 - .../Dispatcher/Events/docs/LoadEvent.md | 10 - .../Benchmarks.cs | 64 - .../AddShoppingCartEventHandler.cs | 16 - .../Extensions/EventHandlers/CouponHandler.cs | 55 - .../Extensions/Events/AddShoppingCartEvent.cs | 11 - .../Extensions/Events/RegisterUserEvent.cs | 11 - .../Middleware/LoggingMiddleware.cs | 18 - ...ontrib.Dispatcher.Events.Benchmarks.csproj | 23 - .../Program.cs | 17 - .../_Imports.cs | 18 - .../DefaultExceptionStrategyProvider.cs | 28 - .../DispatcherOptionsExtensions.cs | 32 - .../Enums/FailureLevels.cs | 13 - .../EventBus.cs | 71 - .../EventBusBuilder.cs | 21 - .../EventHandlerAttribute.cs | 165 - .../IExceptionStrategyProvider.cs | 11 - .../IInitializeServiceProvider.cs | 25 - .../Dispatch/DispatchRelationNetwork.cs | 102 - .../Internal/Dispatch/Dispatcher.cs | 72 - .../Internal/Dispatch/DispatcherBase.cs | 127 - .../Internal/Dispatch/SagaDispatcher.cs | 112 - .../Internal/DispatcherExtensions.cs | 42 - .../Internal/Expressions/InvokeBuilder.cs | 59 - .../Internal/InitializeServiceProvider.cs | 26 - .../Middleware/TransactionMiddleware.cs | 46 - .../Masa.Contrib.Dispatcher.Events.csproj | 23 - .../Options/DispatchRelationOptions.cs | 24 - .../Options/DispatcherOptions.cs | 34 - .../Masa.Contrib.Dispatcher.Events/README.md | 218 - .../README.zh-CN.md | 217 - .../ServiceCollectionExtensions.cs | 76 - .../Strategies/ExecutionStrategy.cs | 70 - .../Strategies/IExecutionStrategy.cs | 10 - .../Strategies/StrategyOptions.cs | 22 - .../_Imports.cs | 22 - .../EventHandlers/AddGoodsHandler.cs | 13 - .../Events/AddGoodsEvent.cs | 15 - ....Events.CheckMethodsParameter.Tests.csproj | 14 - .../_Imports.cs | 5 - .../EventHandlers/DeleteGoodsHandler.cs | 13 - .../Events/DeleteGoodsEvent.cs | 11 - ....CheckMethodsParameterNotNull.Tests.csproj | 14 - .../_Imports.cs | 2 - .../EventHandlers/AddCatalogHandler.cs | 19 - .../Events/AddCatalogEvent.cs | 11 - ...nts.CheckMethodsParameterType.Tests.csproj | 14 - .../_Imports.cs | 4 - .../EventHandlers/AddBasketHandler.cs | 17 - .../Events/AddBasketEvent.cs | 11 - ...tcher.Events.CheckMethodsType.Tests.csproj | 14 - .../_Imports.cs | 6 - .../EventHandlers/Handler.cs | 51 - .../Events/CalculateEvent.cs | 15 - ...ispatcher.Events.HandlerOrder.Tests.csproj | 14 - .../_Imports.cs | 4 - .../EventHandlers/UserEventHandler.cs | 13 - .../Events/BindPhoneNumberEvent.cs | 13 - ...cher.Events.OnlyCancelHandler.Tests.csproj | 14 - .../_Imports.cs | 4 - .../EventHandlers/EditCategoryHandler.cs | 24 - .../Events/EditCategoryEvent.cs | 11 - ...tcher.Events.OrderEqualBySaga.Tests.csproj | 14 - .../_Imports.cs | 6 - .../AssemblyResolutionTests.cs | 108 - .../ChoreTest.cs | 105 - .../ChangePasswordEventHandler.cs | 42 - .../EventHandlers/MarketingEventHandler.cs | 27 - .../OrderPaymentSucceededEventHandler.cs | 26 - .../EventHandlers/RegisterUserEventHandler.cs | 14 - .../EventHandlers/ShipOrderEventHandler.cs | 58 - .../EventHandlers/ShoppingCardEventHandler.cs | 17 - .../EventHandlers/TransferEventHandler.cs | 83 - .../Events/AddShoppingCartEvent.cs | 11 - .../Events/AddUserEvent.cs | 18 - .../Events/ChangePasswordEvent.cs | 23 - .../Events/ComputeEvent.cs | 29 - .../Events/DeductionMoneyEvent.cs | 15 - .../Events/IncreaseMoneyEvent.cs | 15 - .../OrderPaymentFailedIntegrationEvent.cs | 33 - .../Events/OrderPaymentSucceededEvent.cs | 11 - .../Events/RegisterUserEvent.cs | 8 - .../Events/SendCouponEvent.cs | 9 - .../Events/ShipOrderEvent.cs | 13 - .../Events/TransferEvent.cs | 13 - .../FeaturesTest.cs | 380 -- ...asa.Contrib.Dispatcher.Events.Tests.csproj | 39 - .../Middleware/LoggingMiddleware.cs | 17 - .../SagaTest.cs | 98 - .../TestBase.cs | 47 - .../_Imports.cs | 21 - .../DispatcherOptionsExtensions.cs | 56 - ...b.Dispatcher.IntegrationEvents.Dapr.csproj | 20 - .../Options/DispatcherOptions.cs | 43 - .../Publisher.cs | 23 - .../README.md | 71 - .../README.zh-CN.md | 71 - .../ServiceCollectionExtensions.cs | 55 - .../_Imports.cs | 13 - .../DispatcherOptionsExtensions.cs | 38 - .../IntegrationEventLogContext.cs | 13 - ...egrationEventLogEntityTypeConfiguration.cs | 44 - ...ntegrationEventLogModelCreatingProvider.cs | 13 - .../IntegrationEventLogService.cs | 166 - ...cher.IntegrationEvents.EventLogs.EF.csproj | 20 - .../README.md | 24 - .../README.zh-CN.md | 24 - .../_Imports.cs | 18 - .../DispatcherOptionsExtensions.cs | 29 - .../IProcessingServer.cs | 9 - .../IProcessor.cs | 16 - .../IPublisher.cs | 9 - .../IntegrationEventBus.cs | 107 - .../IntegrationEventHostedService.cs | 25 - .../Internal/IntegrationEventLogItem.cs | 34 - .../Internal/LocalQueueProcessor.cs | 63 - ...ontrib.Dispatcher.IntegrationEvents.csproj | 19 - .../Options/DispatcherOptions.cs | 212 - .../DeleteLocalQueueExpiresProcessor.cs | 25 - .../DeletePublishedExpireEventProcessor.cs | 29 - .../Processor/InfiniteLoopProcessor.cs | 40 - .../Processor/ProcessorBase.cs | 46 - .../Processor/RetryByDataProcessor.cs | 72 - .../Processor/RetryByLocalQueueProcessor.cs | 71 - .../README.md | 119 - .../README.zh-CN.md | 119 - .../Servers/DefaultHostedService.cs | 26 - .../ServiceCollectionExtensions.cs | 90 - .../_Imports.cs | 20 - .../DispatcherOptionTest.cs | 55 - .../IntegrationEventBusTest.cs | 142 - ...atcher.IntegrationEvents.Dapr.Tests.csproj | 32 - .../ProcessorTest.cs | 128 - .../_Imports.cs | 18 - .../Domain/Entities/User.cs | 11 - .../Events/IntegrationEvent.cs | 32 - .../OrderPaymentSucceededIntegrationEvent.cs | 13 - .../Infrastructure/CustomDbContext.cs | 13 - .../IntegrationEventLogContextTest.cs | 61 - .../IntegrationEventLogServiceTest.cs | 296 -- ...ntegrationEvents.EventLogs.EF.Tests.csproj | 31 - .../TestBase.cs | 30 - .../_Imports.cs | 20 - .../BackgroundServiceTest.cs | 37 - .../DispatcherOptionTest.cs | 125 - .../Events/CreateUserEvent.cs | 32 - .../Events/PaySuccessedIntegrationEvent.cs | 16 - .../Events/RegisterUserIntegrationEvent.cs | 13 - .../CustomIntegrationEventHostedService.cs | 18 - .../CustomIntegrationEventLogService.cs | 40 - .../Infrastructure/CustomProcessor.cs | 21 - .../IntegrationEventBusTest.cs | 394 -- ....Dispatcher.IntegrationEvents.Tests.csproj | 29 - .../ProcessorTest.cs | 398 -- .../_Imports.cs | 23 - .../ClaimExtensions.cs | 10 - .../Const/ClaimType.cs | 19 - .../DefaultIsolatedUserContext.cs | 50 - .../DefaultMultiEnvironmentUserContext.cs | 38 - .../DefaultMultiTenantUserContext.cs | 47 - .../DefaultUserContext.cs | 56 - .../HttpContextCurrentPrincipalAccessor.cs | 14 - .../ICurrentPrincipalAccessor.cs | 9 - .../IdentityClaimOptions.cs | 26 - ...Masa.Contrib.Identity.IdentityModel.csproj | 18 - .../README.md | 49 - .../README.zh-CN.md | 49 - .../ServiceCollectionExtensions.cs | 100 - .../ThreadCurrentPrincipalAccessor.cs | 9 - .../_Imports.cs | 12 - ...ontrib.Identity.IdentityModel.Tests.csproj | 30 - .../TestIdentity.cs | 238 -- .../_Imports.cs | 10 - ...efaultIsolationConnectionStringProvider.cs | 96 - .../DispatcherOptionsExtensions.cs | 89 - .../IsolationBuilder.cs | 14 - .../IsolationBuilderExtensions.cs | 13 - .../IsolationDbContextProvider.cs | 23 - .../Masa.Contrib.Isolation.csproj | 18 - .../Middleware/IsolationMiddleware.cs | 44 - .../src/Masa.Contrib.Isolation/README.md | 5 - .../Masa.Contrib.Isolation/README.zh-CN.md | 5 - .../src/Masa.Contrib.Isolation/_Imports.cs | 21 - .../Masa.Contrib.Isolation.Tests.csproj | 31 - .../RequestCookieCollection.cs | 9 - ...TestDbIsolationConnectionStringProvider.cs | 533 --- .../TestIsolation.cs | 158 - .../TestParserProvider.cs | 377 -- .../UnitOfWorkAccessor.cs | 11 - .../Masa.Contrib.Isolation.Tests/_Imports.cs | 23 - .../EnvironmentContext.cs | 11 - .../IsolationBuilderExtensions.cs | 33 - ....Contrib.Isolation.MultiEnvironment.csproj | 14 - .../Middleware/MultiEnvironmentMiddleware.cs | 77 - .../README.md | 96 - .../README.zh-CN.md | 97 - .../_Imports.cs | 12 - ...ib.Isolation.MultiEnvironment.Tests.csproj | 29 - .../TestEnvironment.cs | 71 - .../TestMiddleware.cs | 147 - .../_Imports.cs | 12 - .../ConvertProvider.cs | 13 - .../IsolationBuilderExtensions.cs | 37 - .../Masa.Contrib.Isolation.MultiTenant.csproj | 14 - .../Middleware/MultiTenantMiddleware.cs | 77 - .../MultiTenantOptions.cs | 11 - .../README.md | 99 - .../README.zh-CN.md | 100 - .../TenantContext.cs | 11 - .../_Imports.cs | 13 - ...Contrib.Isolation.MultiTenant.Tests.csproj | 29 - .../TestMiddleware.cs | 359 -- .../TestTenant.cs | 56 - .../_Imports.cs | 12 - .../DispatcherOptionsExtensions.cs | 81 - .../Internal/TypeExtensions.cs | 13 - .../IsolationDbContext.cs | 80 - .../IsolationSaveChangesFilter.cs | 45 - .../Masa.Contrib.Isolation.UoW.EF.csproj | 19 - .../Masa.Contrib.Isolation.UoW.EF/README.md | 76 - .../README.zh-CN.md | 76 - .../Masa.Contrib.Isolation.UoW.EF/_Imports.cs | 18 - .../CustomDbContext.cs | 58 - ...Masa.Contrib.Isolation.UoW.EF.Tests.csproj | 40 - .../TestBase.cs | 21 - .../TestIsolation.cs | 371 -- .../_Imports.cs | 25 - .../appsettings.json | 18 - .../CustomDbContext.cs | 92 - .../EdgeDriverTest.cs | 66 - .../EventHandlers/AddRoleEventHandler.cs | 53 - .../EventHandlers/RegisterUserEventHandler.cs | 54 - .../Events/AddRoleEvent.cs | 8 - .../Events/RegisterUserEvent.cs | 8 - ....Contrib.Isolation.UoW.EF.Web.Tests.csproj | 35 - .../TestBase.cs | 21 - .../_Imports.cs | 25 - .../appsettings.json | 18 - .../Commands/CommandHandler.cs | 15 - ...Masa.Contrib.ReadWriteSpliting.Cqrs.csproj | 18 - .../Queries/QueryHandler.cs | 11 - .../README.md | 86 - .../README.zh-CN.md | 87 - .../_Imports.cs | 6 - .../Commands/CreateProductionCommand.cs | 13 - .../CqrsTest.cs | 54 - .../CreateProductionCommandHandler.cs | 27 - ...ontrib.ReadWriteSpliting.Cqrs.Tests.csproj | 30 - .../ProductionQueryHandler.cs | 21 - .../Queries/ProductionItemQuery.cs | 13 - .../_Imports.cs | 11 - .../AutoCompleteClient.cs | 196 - .../AutoCompleteFactory.cs | 42 - ...chEngine.AutoComplete.ElasticSearch.csproj | 19 - .../Options/AutoCompleteOptions.cs | 86 - .../Options/AutoCompleteRelationsOptions.cs | 57 - .../README.md | 186 - .../README.zh-CN.md | 186 - .../ServiceCollectionExtensions.cs | 201 - .../_Imports.cs | 19 - .../AutoCompleteTest.cs | 679 --- ...ne.AutoComplete.ElasticSearch.Tests.csproj | 29 - .../Model/Employee.cs | 17 - .../_Imports.cs | 10 - .../CallerOptionsExtensions.cs | 40 - .../DaprCaller.cs | 91 - .../DaprCallerBase.cs | 31 - .../DefaultDaprClientBuilder.cs | 17 - .../HttpMessageHandlerBuilder.cs | 14 - .../IDaprRequestMessage.cs | 9 - ...a.Contrib.Service.Caller.DaprClient.csproj | 17 - .../MasaDaprClientBuilder.cs | 70 - .../MasaDaprClientBuilderExtensions.cs | 48 - .../Options/CallerDaprClientOptions.cs | 9 - .../README.md | 102 - .../README.zh-CN.md | 102 - .../_Imports.cs | 10 - .../CallerOptionsExtensions.cs | 26 - .../HttpClientCaller.cs | 72 - .../HttpClientCallerBase.cs | 32 - ...a.Contrib.Service.Caller.HttpClient.csproj | 17 - .../MasaHttpClientBuilder.cs | 62 - .../README.md | 111 - .../README.zh-CN.md | 111 - .../_Imports.cs | 6 - .../DefaultCallerFactory.cs | 31 - .../DefaultRequestMessage.cs | 34 - .../DefaultResponseMessage.cs | 92 - .../DefaultTypeConvertor.cs | 98 - .../Internal/CallerDependExtensions.cs | 89 - .../Internal/ErrorMessages.cs | 9 - .../Internal/Options/PropertyInfoMember.cs | 31 - .../Internal/XmlUtils.cs | 26 - .../JsonRequestMessage.cs | 30 - .../Masa.Contrib.Service.Caller.csproj | 14 - .../src/Masa.Contrib.Service.Caller/README.md | 36 - .../README.zh-CN.md | 36 - .../ServiceCollectionExtensions.cs | 107 - .../XmlRequestMessage.cs | 27 - .../Masa.Contrib.Service.Caller/_Imports.cs | 22 - .../AutomaticCallerTest.cs | 47 - .../CallerTest.cs | 214 - .../Callers/DaprCaller.cs | 16 - .../Callers/GithubCaller.cs | 20 - .../Callers/RoleCaller.cs | 11 - .../Callers/UserCaller.cs | 11 - .../Callers/UserDaprCallerBase.cs | 20 - .../DefaultDaprRequestMessage.cs | 13 - ...ervice.Caller.AutomaticCaller.Tests.csproj | 28 - .../_Imports.cs | 14 - .../CallerTest.cs | 138 - .../CustomHttpClientCaller.cs | 14 - .../DefaultXmlResponseMessage.cs | 91 - .../HttpClientCallerTest.cs | 128 - .../Masa.Contrib.Service.Caller.Tests.csproj | 24 - .../Queries/UserDetailQuery.cs | 34 - .../Queries/UserListQuery.cs | 18 - .../Requesties/RegisterUser.cs | 22 - .../Response/BaseResponse.cs | 16 - .../TypeConvertTest.cs | 30 - .../Utils/XmlUtils.cs | 26 - .../_Imports.cs | 21 - .../Masa.Contrib.Service.MinimalAPIs.csproj | 18 - .../README.md | 53 - .../README.zh-CN.md | 53 - .../ServiceBase.cs | 122 - .../ServiceCollectionExtensions.cs | 45 - .../_Imports.cs | 12 - ...a.Contrib.Service.MinimalAPIs.Tests.csproj | 29 - .../MinimalAPITest.cs | 51 - .../Services/CustomService.cs | 16 - .../_Imports.cs | 7 - .../Masa.Contrib.StackSdks.Auth/AuthClient.cs | 29 - .../Masa.Contrib.StackSdks.Auth/Constants.cs | 12 - .../EnvironmentProvider.cs | 19 - .../HttpEnvironmentDelegatingHandler.cs | 27 - .../Masa.Contrib.StackSdks.Auth.csproj | 22 - .../src/Masa.Contrib.StackSdks.Auth/README.md | 46 - .../README.zh-CN.md | 45 - .../Service/PermissionService.cs | 75 - .../Service/ProjectService.cs | 26 - .../Service/SubjectService.cs | 21 - .../Service/TeamService.cs | 47 - .../Service/UserService.cs | 172 - .../ServiceCollectionExtensions.cs | 44 - .../Masa.Contrib.StackSdks.Auth/_Imports.cs | 15 - .../AuthClientTest.cs | 42 - .../Masa.Contrib.StackSdks.Auth.Tests.csproj | 27 - .../PermissionServiceTest.cs | 109 - .../ProjectServiceTest.cs | 30 - .../SubjectServiceTest.cs | 28 - .../TeamServiceTest.cs | 56 - .../UserServiceTest.cs | 446 -- .../_Imports.cs | 12 - .../Masa.Contrib.StackSdks.Dcc/DccClient.cs | 16 - .../Internal/Constants.cs | 10 - .../Masa.Contrib.StackSdks.Dcc.csproj | 16 - .../src/Masa.Contrib.StackSdks.Dcc/README.md | 54 - .../README.zh-CN.md | 54 - .../Service/LabelService.cs | 21 - .../ServiceCollectionExtensions.cs | 47 - .../Masa.Contrib.StackSdks.Dcc/_Imports.cs | 11 - .../DccClientTest.cs | 47 - .../LabelServiceTest.cs | 44 - .../Masa.Contrib.StackSdks.Dcc.Tests.csproj | 36 - .../_Imports.cs | 11 - .../appsettings.json | 14 - .../Masa.Contrib.StackSdks.Mc/Constants.cs | 10 - ...ttpClientAuthorizationDelegatingHandler.cs | 24 - .../Extensions/DictionaryExtensions.cs | 118 - .../Extensions/ExtraPropertiesExtensions.cs | 61 - .../Infrastructure/Helper/TypeHelper.cs | 170 - .../Masa.Contrib.StackSdks.Mc.csproj | 15 - .../src/Masa.Contrib.StackSdks.Mc/McClient.cs | 28 - .../Service/ChannelService.cs | 27 - .../Service/MessageTaskService.cs | 33 - .../Service/MessageTemplateService.cs | 27 - .../Service/ReceiverGroupService.cs | 27 - .../Service/WebsiteMessageService.cs | 72 - .../ServiceCollectionExtensions.cs | 45 - .../src/Masa.Contrib.StackSdks.Mc/_Imports.cs | 20 - .../ChannelServiceTest.cs | 38 - .../Masa.Contrib.StackSdks.Mc.Tests.csproj | 24 - .../McClientTest.cs | 32 - .../MessageTaskServiceTest.cs | 48 - .../MessageTemplateServiceTest.cs | 38 - .../ReceiverGroupServiceTest.cs | 38 - .../WebsiteMessageServiceTest.cs | 112 - .../_Imports.cs | 12 - .../Masa.Contrib.StackSdks.Pm/Constants.cs | 9 - .../Masa.Contrib.StackSdks.Pm.csproj | 18 - .../src/Masa.Contrib.StackSdks.Pm/PmClient.cs | 27 - .../src/Masa.Contrib.StackSdks.Pm/README.md | 38 - .../Masa.Contrib.StackSdks.Pm/README.zh-CN.md | 38 - .../Service/AppService.cs | 57 - .../Service/ClusterService.cs | 49 - .../Service/EnvironmentService.cs | 33 - .../Service/ProjectService.cs | 65 - .../ServiceCollectionExtensions.cs | 45 - .../src/Masa.Contrib.StackSdks.Pm/_Imports.cs | 9 - .../AppServiceTest.cs | 184 - .../ClusterServiceTest.cs | 151 - .../EnvironmentServiceTest.cs | 79 - .../Masa.Contrib.StackSdks.Pm.Tests.csproj | 24 - .../PmClientTest.cs | 74 - .../ProjectServiceTest.cs | 216 - .../_Imports.cs | 11 - .../Constants.cs | 10 - ...ttpClientAuthorizationDelegatingHandler.cs | 24 - .../Masa.Contrib.StackSdks.Scheduler.csproj | 20 - .../README.md | 41 - .../README.zh-CN.md | 41 - .../SchedulerClient.cs | 20 - .../ServiceCollectionExtensions.cs | 53 - .../Services/SchedulerJobService.cs | 127 - .../Services/SchedulerTaskService.cs | 58 - .../_Imports.cs | 13 - ...a.Contrib.StackSdks.Scheduler.Tests.csproj | 25 - .../SchedulerClientTest.cs | 54 - .../SchedulerJobServiceTest.cs | 307 -- .../SchedulerTaskServiceTest.cs | 51 - .../_Imports.cs | 12 - .../Extensions/CallerProviderExtensions.cs | 18 - .../Extensions/ServiceExtensions.cs | 36 - .../Extensions/StreamExtensions.cs | 48 - .../Logging/OpenTelemetryLoggingExtensions.cs | 21 - .../Masa.Contrib.StackSdks.Tsc.csproj | 28 - .../MasaObservableOptions.cs | 17 - .../Metrics/MasaServiceExtensions.cs | 21 - .../OpenTelemetryAttributeName.cs | 146 - .../OpenTemetry/ResourceBuilderExtenstions.cs | 26 - .../src/Masa.Contrib.StackSdks.Tsc/README.md | 56 - .../README.zh-CN.md | 56 - .../Service/LogService.cs | 32 - .../Service/MetricService.cs | 46 - .../Tracing/ActivityExtensions.cs | 101 - ...NetCoreInstrumentationOptionsExtensions.cs | 74 - .../Tracing/MasaServiceExtensions.cs | 37 - .../OpenTelemetryInstrumentationOptions.cs | 95 - .../Masa.Contrib.StackSdks.Tsc/TscClient.cs | 20 - .../Masa.Contrib.StackSdks.Tsc/_Imports.cs | 26 - .../CallerProviderExtensionsTests.cs | 21 - .../Masa.Contrib.StackSdks.Tsc.Tests.csproj | 22 - .../Service/LogServiceTests.cs | 100 - .../Service/MetricServiceTests.cs | 86 - .../_Imports.cs | 17 - .../BaseClient.cs | 33 - .../BucketNameProvider.cs | 18 - .../DefaultCredentialProvider.cs | 92 - .../DefaultOssClientFactory.cs | 16 - .../DefaultStorageClient.cs | 135 - .../IAliyunStorageOptionProvider.cs | 13 - .../ICredentialProvider.cs | 12 - .../IOssClientFactory.cs | 11 - .../Internal/Const.cs | 21 - .../DefaultAliyunStorageOptionProvider.cs | 70 - .../Internal/ObjectStorageExtensions.cs | 15 - .../Internal/Response/UploadObjectResponse.cs | 44 - ...ontrib.Storage.ObjectStorage.Aliyun.csproj | 28 - .../Options/AliyunOptions.cs | 11 - .../Options/AliyunStorageConfigureOptions.cs | 11 - .../Options/AliyunStorageOptions.cs | 138 - .../Options/AliyunStsOptions.cs | 62 - .../README.md | 147 - .../README.zh-CN.md | 149 - .../ServiceCollectionExtensions.cs | 146 - .../_Imports.cs | 23 - .../BaseTest.cs | 30 - .../CustomCredentialProvider.cs | 45 - .../CustomNullClient.cs | 27 - .../CustomizeClient.cs | 76 - ....Storage.ObjectStorage.Aliyun.Tests.csproj | 37 - .../StorageContainer.cs | 10 - .../TestALiYunStorageOptions.cs | 139 - .../TestClient.cs | 137 - .../TestCredentialProvider.cs | 124 - .../TestStorage.cs | 315 -- .../_Imports.cs | 18 - .../appsettings.json | 21 - .../DependencyInjection/CachingBuilder.cs | 24 - ...DistributedCacheClientBuilderExtensions.cs | 42 - .../DependencyInjection/ICachingBuilder.cs | 20 - .../DistributedCacheClientFactory.cs | 49 - ...DistributedCacheClientFactoryExtensions.cs | 25 - .../Helpers/SubscribeHelper.cs | 57 - .../Interfaces/ICacheClient.cs | 100 - .../Interfaces/ICacheClientFactory.cs | 19 - .../Interfaces/IDistributedCacheClient.cs | 85 - .../IDistributedCacheClientFactory.cs | 11 - .../Masa.Utils.Caching.Core.csproj | 15 - .../Models/CombinedCacheEntryOptions.cs | 55 - .../Models/SubscribeKeyTypes.cs | 16 - .../Models/SubscribeOperation.cs | 14 - .../Models/SubscribeOptions.cs | 25 - .../src/Masa.Utils.Caching.Core/_Imports.cs | 11 - ...lientFactoryServiceCollectionExtensions.cs | 111 - .../Extensions/JsonSerializerExtensions.cs | 558 --- .../Extensions/RedisExtensions.cs | 38 - .../Helpers/RedisHelper.cs | 122 - .../Internal/Enum/CompressMode.cs | 19 - .../Masa.Utils.Caching.Redis.csproj | 19 - .../Models/RedisConfigurationOptions.cs | 87 - .../Models/RedisServerOptions.cs | 73 - .../RedisCacheClient.cs | 576 --- .../RedisCacheClientFactory.cs | 44 - .../src/Masa.Utils.Caching.Redis/_Imports.cs | 24 - .../ConvertToValueTest.cs | 115 - .../Masa.Utils.Caching.Redis.Tests.csproj | 21 - .../_Imports.cs | 7 - .../MemoryCacheClientBuilderExtensions.cs | 33 - ...heClientFactoryCachingBuilderExtensions.cs | 56 - .../Interfaces/IMemoryCacheClient.cs | 26 - .../Interfaces/IMemoryCacheClientFactory.cs | 11 - ...asa.Utils.Caching.DistributedMemory.csproj | 19 - .../MemoryCacheClient.cs | 407 -- .../MemoryCacheClientFactory.cs | 63 - .../MemoryCacheClientFactoryExtensions.cs | 25 - .../Models/MasaMemoryCacheOptions.cs | 20 - .../_Imports.cs | 15 - .../Masa.Utils.Caching.Memory.csproj | 9 - .../Masa.Utils.Caching.Memory/MemoryCache.cs | 110 - .../src/Masa.Utils.Caching.Memory/_Imports.cs | 4 - .../AbstractCallerProvider.cs | 391 -- .../AddCallerExtensions.cs | 15 - .../src/Masa.Utils.Caller.Core/CallerBase.cs | 31 - .../Masa.Utils.Caller.Core/CallerOptions.cs | 36 - .../DefaultCallerFactory.cs | 31 - .../DefaultRequestIdGenerator.cs | 9 - .../DefaultRequestMessage.cs | 32 - .../DefaultResponseMessage.cs | 92 - .../DefaultTypeConvertProvider.cs | 98 - .../Masa.Utils.Caller.Core/ICallerFactory.cs | 11 - .../Masa.Utils.Caller.Core/ICallerProvider.cs | 219 - .../IRequestIdGenerator.cs | 9 - .../Masa.Utils.Caller.Core/IRequestMessage.cs | 11 - .../IResponseMessage.cs | 11 - .../ITypeConvertProvider.cs | 24 - .../Internal/CallerDependExtensions.cs | 89 - .../Internal/CallerRelations.cs | 20 - .../Masa.Utils.Caller.Core/Internal/Const.cs | 9 - .../Internal/Options/PropertyInfoMember.cs | 31 - .../JsonRequestMessage.cs | 29 - .../Masa.Utils.Caller.Core.csproj | 19 - .../src/Masa.Utils.Caller.Core/README.md | 36 - .../Masa.Utils.Caller.Core/README.zh-CN.md | 36 - .../ServiceCollectionExtensions.cs | 105 - .../src/Masa.Utils.Caller.Core/_Imports.cs | 19 - .../CallerOptionsExtensions.cs | 40 - .../DaprCallerBase.cs | 30 - .../DaprCallerProvider.cs | 46 - .../Masa.Utils.Caller.DaprClient.csproj | 17 - .../MasaDaprClientBuilder.cs | 70 - .../Masa.Utils.Caller.DaprClient/README.md | 101 - .../README.zh-CN.md | 101 - .../Masa.Utils.Caller.DaprClient/_Imports.cs | 6 - .../CallerOptionsExtensions.cs | 26 - .../HttpClientCallerBase.cs | 32 - .../HttpClientCallerProvider.cs | 72 - .../Masa.Utils.Caller.HttpClient.csproj | 19 - .../MasaHttpClientBuilder.cs | 62 - .../Masa.Utils.Caller.HttpClient/README.md | 110 - .../README.zh-CN.md | 110 - .../Masa.Utils.Caller.HttpClient/_Imports.cs | 5 - .../CustomHttpClientCallerProvider.cs | 14 - .../Application/Queries/UserDetailQury.cs | 34 - .../Application/Queries/UserListQury.cs | 18 - .../Application/Requesties/RegisterUser.cs | 22 - .../Application/Response/BaseResponse.cs | 16 - .../AutomaticCallerTest.cs | 47 - .../Masa.Utils.Caller.Tests/CallerTest.cs | 235 -- .../HttpClientCallerTest.cs | 128 - .../Infrastructure/Callers/DaprCaller.cs | 15 - .../Infrastructure/Callers/GithubCaller.cs | 19 - .../Infrastructure/Callers/RoleCaller.cs | 11 - .../Infrastructure/Callers/UserCaller.cs | 11 - .../Callers/UserDaprCallerBase.cs | 15 - .../DefaultXmlResponseMessage.cs | 93 - .../Infrastructure/Utils/XmlUtils.cs | 23 - .../Infrastructure/XmlRequestMessage.cs | 19 - .../Masa.Utils.Caller.Tests.csproj | 24 - .../TypeConvertTest.cs | 129 - .../test/Masa.Utils.Caller.Tests/_Imports.cs | 26 - .../Masa.Utils.Configuration.Dcc.csproj | 9 - .../AppSettings.cs | 102 - .../JsonConfiguration.cs | 118 - .../JsonFileOptions.cs | 23 - .../Masa.Utils.Configuration.Json.csproj | 14 - .../DataAnnotations/MinCountAttribute.cs | 57 - .../DataAnnotations/NonDefaultAttribute.cs | 32 - .../Masa.Utils.Data.DataAnnotations.csproj | 9 - .../_Imports.cs | 5 - ...sa.Utils.Data.DataAnnotations.Tests.csproj | 21 - .../MinCountAttributeTests.cs | 84 - .../NonDefaultAttributeTests.cs | 84 - .../TokenFilters/IPinYinTokenFilter.cs | 106 - .../PinYinTokenFilterDescriptor.cs | 125 - .../Masa.Utils.Data.Elasticsearch/Const.cs | 9 - .../DefaultElasticsearchFactory.cs | 84 - .../DefaultMasaElasticClient.cs | 391 -- .../ElasticsearchOptions.cs | 66 - .../ElasticsearchRelations.cs | 56 - .../IElasticsearchFactory.cs | 15 - .../IMasaElasticClient.cs | 153 - .../BulkOperation/BulkDeleteOperation.cs | 15 - .../Internal/DeleteMultiExtensions.cs | 30 - .../Masa.Utils.Data.Elasticsearch.csproj | 15 - .../MasaElasticsearchBuilder.cs | 20 - .../Options/Alias/BindAliasIndexOptions.cs | 27 - .../Options/Alias/UnBindAliasIndexOptions.cs | 27 - .../Options/ConnectionSettingsOptions.cs | 38 - .../Document/Count/CountDocumentRequest.cs | 11 - .../Create/CreateDocumentItemRequest.cs | 12 - .../Document/Create/CreateDocumentRequest.cs | 12 - .../Create/CreateMultiDocumentRequest.cs | 30 - .../Document/Delete/DeleteDocumentRequest.cs | 11 - .../Delete/DeleteMultiDocumentRequest.cs | 15 - .../Options/Document/DocumentOptions.cs | 17 - .../Document/Exist/ExistDocumentRequest.cs | 12 - .../Document/Get/GetDocumentRequest.cs | 11 - .../Document/Get/GetMultiDocumentRequest.cs | 15 - .../Document/Query/PaginatedOptions.cs | 44 - .../Document/Query/QueryBaseOptions.cs | 45 - .../Options/Document/Query/QueryOptions.cs | 19 - .../Set/SetDocumentItemBaseRequest.cs | 12 - .../Document/Set/SetDocumentRequest.cs | 30 - .../Document/SingleDocumentBaseRequest.cs | 17 - .../Update/UpdateDocumentBaseRequest.cs | 25 - .../Document/Update/UpdateDocumentRequest.cs | 15 - .../Update/UpdateMultiDocumentRequest.cs | 18 - .../Options/ElasticsearchRelationsOptions.cs | 20 - .../Options/Index/CreateIndexOptions.cs | 13 - .../Options/Index/DeleteIndexOptions.cs | 9 - .../Options/StaticConnectionPoolOptions.cs | 29 - .../Masa.Utils.Data.Elasticsearch/README.md | 89 - .../README.zh-CN.md | 89 - .../Response/Alias/BulkAliasResponse.cs | 11 - .../Response/Alias/GetAliasResponse.cs | 22 - .../Response/BulkResponse.cs | 14 - .../Response/BulkResponseItems.cs | 23 - .../Response/CreateMultiResponse.cs | 11 - .../Response/CreateResponse.cs | 11 - .../Response/DeleteMultiResponse.cs | 17 - .../Response/DeleteRangeResponseItems.cs | 20 - .../Response/DeleteResponse.cs | 11 - .../Document/ClearDocumentResponse.cs | 11 - .../Document/CountDocumentResponse.cs | 11 - .../Response/ExistsResponse.cs | 16 - .../Response/GetMultiResponse.cs | 15 - .../Response/GetMultiResponseItems.cs | 18 - .../Response/GetResponse.cs | 15 - .../Response/Index/CreateIndexResponse.cs | 11 - .../Response/Index/DeleteIndexResponse.cs | 19 - .../Response/Index/GetIndexByAliasResponse.cs | 14 - .../Response/Index/GetIndexResponse.cs | 14 - .../Response/ResponseBase.cs | 21 - .../Response/SearchPaginatedResponse.cs | 22 - .../Response/SearchResponse.cs | 15 - .../Response/SetResponse.cs | 11 - .../Response/UpdateMultiResponse.cs | 11 - .../Response/UpdateResponse.cs | 11 - .../ServiceCollectionExtensions.Extensions.cs | 30 - .../ServiceCollectionExtensions.cs | 75 - .../Masa.Utils.Data.Elasticsearch/_Imports.cs | 26 - .../DefaultMasaElasticClientTests.cs | 571 --- ...Masa.Utils.Data.Elasticsearch.Tests.csproj | 21 - .../Models/AutoCompleteDocument.cs | 30 - .../_Imports.cs | 19 - .../Enums/ResultStatuses.cs | 10 - .../Enums/ResultTypes.cs | 15 - .../Extensions/CallerProviderExtensions.cs | 15 - .../Extensions/ObjectExtensions.cs | 142 - .../Extensions/StringExtensions.cs | 20 - .../IMasaPrometheusClient.cs | 19 - .../Masa.Utils.Data.Prometheus.csproj | 13 - .../MasaPrometheusClient.cs | 127 - .../Reponse/Exemplar/ExemplarDataModel.cs | 13 - .../Model/Reponse/Exemplar/ExemplarModel.cs | 11 - .../Exemplar/ExemplarResultResponse.cs | 9 - .../Reponse/MetaData/LabelResultResponse.cs | 9 - .../Reponse/MetaData/SeriesResultResponse.cs | 9 - .../Query/QueryResultCommonResponse.cs | 9 - .../Reponse/Query/QueryResultDataResponse.cs | 11 - .../Query/QueryResultInstantVectorResponse.cs | 11 - .../Query/QueryResultMatrixRangeResponse.cs | 11 - .../Model/Reponse/ResultBaseResponse.cs | 15 - .../Model/Request/LableValueQueryRequest.cs | 9 - .../Model/Request/MetaDataQueryRequest.cs | 13 - .../Model/Request/QueryExemplarRequest.cs | 14 - .../Model/Request/QueryRangeRequest.cs | 17 - .../Model/Request/QueryRequest.cs | 13 - .../src/Masa.Utils.Data.Prometheus/README.md | 75 - .../README.zh-CN.md | 75 - .../ServiceCollectionExtensions.cs | 39 - .../Masa.Utils.Data.Prometheus/_Imports.cs | 15 - .../Extensions/ObjectExtensionsTests.cs | 171 - .../Extensions/StringExtensionsTests.cs | 30 - .../Masa.Utils.Data.Prometheus.Test.csproj | 22 - .../MasaPrometheusClientTests.cs | 154 - .../UserStruct.cs | 13 - .../_Imports.cs | 12 - .../DaprBackgroundService.cs | 66 - .../DefaultAppPortProvider.cs | 42 - .../IAppPortProvider.cs | 9 - ...a.Utils.Development.Dapr.AspNetCore.csproj | 14 - .../README.md | 59 - .../README.zh-CN.md | 59 - .../ServiceCollectionExtensions.cs | 76 - .../_Imports.cs | 11 - .../CommandLineBuilder.cs | 29 - .../Configurations/DaprRuntimeOptions.cs | 28 - .../DaprExtensions.cs | 43 - .../DaprOptions.cs | 283 -- .../DaprProcess.cs | 351 -- .../DaprProvider.cs | 56 - .../EnvironmentExtensions.cs | 17 - .../IDaprProcess.cs | 18 - .../IDaprProvider.cs | 11 - .../Internal/CommandArgumentBuilder.cs | 55 - .../Internal/Const.cs | 28 - .../Internal/DaprCoreOptions.cs | 145 - .../Internal/DaprProcessStatus.cs | 13 - .../Internal/NetworkUtils.cs | 18 - .../Internal/ProcessUtils.cs | 107 - .../Masa.Utils.Development.Dapr/LogLevel.cs | 14 - .../Masa.Utils.Development.Dapr.csproj | 17 - .../Process/IProcess.cs | 17 - .../Process/IProcessProvider.cs | 33 - .../Process/ProcessProvider.cs | 181 - .../Process/SystemProcess.cs | 39 - .../Masa.Utils.Development.Dapr/Protocol.cs | 10 - .../src/Masa.Utils.Development.Dapr/README.md | 95 - .../README.zh-CN.md | 95 - .../ServiceCollectionExtensions.cs | 44 - .../Masa.Utils.Development.Dapr/_Imports.cs | 18 - .../ApplicationBuilderExtensions.cs | 81 - .../Extensions/MvcBuilderExtensions.cs | 23 - .../Handlers/ExceptionHandlerMiddleware.cs | 80 - .../Handlers/ExceptionHandlingMiddleware.cs | 56 - .../Handlers/GlobalExceptionFilter.cs | 69 - .../IMasaExceptionHandler.cs | 9 - .../Internal/Constant.cs | 11 - .../Internal/ExceptionExtensions.cs | 18 - .../Internal/ExceptionHandlerExtensions.cs | 31 - .../Internal/HttpResponseExtensions.cs | 26 - .../Masa.Utils.Exceptions.csproj | 13 - .../Masa.Utils.Exceptions/MasaException.cs | 28 - .../MasaExceptionContext.cs | 47 - .../MasaHttpStatusCode.cs | 9 - .../Options/MasaExceptionHandlerOptions.cs | 18 - .../Options/MasaExceptionHandlingOptions.cs | 11 - .../MasaExceptionLogRelationOptions.cs | 23 - .../src/Masa.Utils.Exceptions/README.md | 130 - .../src/Masa.Utils.Exceptions/README.zh-CN.md | 130 - .../Results/DefaultExceptionResult.cs | 25 - .../InternalServerErrorObjectResult.cs | 13 - .../Results/UserFriendlyExceptionResult.cs | 19 - .../UserFriendlyException.cs | 12 - .../src/Masa.Utils.Exceptions/_Imports.cs | 16 - .../BaseTypeProvider.cs | 28 - .../DefaultServiceRegister.cs | 41 - .../DefaultTypeProvider.cs | 73 - .../DependencyAttribute.cs | 18 - .../IAutoFireDependency.cs | 12 - .../IScopedDependency.cs | 21 - .../IServiceRegister.cs | 9 - .../ISingletonDependency.cs | 8 - .../ITransientDependency.cs | 9 - .../ITypeProvider.cs | 17 - .../IgnoreInjectionAttribute.cs | 15 - ...tils.Extensions.DependencyInjection.csproj | 14 - .../Options/ServiceDescriptorOptions.cs | 23 - .../README.md | 117 - .../README.zh-CN.md | 117 - .../ServiceCollectionDescriptorExtensions.cs | 122 - .../ServiceCollectionExtensions.cs | 135 - .../_Imports.cs | 6 - .../DependencyInjectionTest.cs | 190 - .../Domain/Models/User.cs | 11 - .../Domain/Repositories/IRepository.cs | 17 - .../Services/ICalculateProviderService.cs | 9 - .../Domain/Services/IClientFactory.cs | 9 - .../Repositories/BaseRepository.cs | 22 - .../Infrastructure/Services/BaseService.cs | 19 - .../Services/CustomizeClientFactory.cs | 12 - .../Services/EmptyClientFactory.cs | 11 - .../Services/GoodsBaseService.cs | 12 - .../Infrastructure/Services/GoodsService.cs | 14 - .../Services/NullCalculateProviderService.cs | 11 - .../Services/OrderBaseService.cs | 12 - .../Infrastructure/Services/OrderService.cs | 8 - .../Services/UserBaseService.cs | 11 - .../Infrastructure/Services/UserService.cs | 14 - .../Infrastructure/UserDbContext.cs | 9 - ...xtensions.DependencyInjection.Tests.csproj | 21 - .../_Imports.cs | 11 - .../Masa.Utils.Extensions.DotNet.csproj | 9 - .../TypeExtensions.cs | 27 - .../EnumExtensions.cs | 36 - .../Masa.Utils.Extensions.Enums/EnumUtil.cs | 36 - .../Masa.Utils.Extensions.Enums.csproj | 9 - .../Model/EnumObject.cs | 11 - .../src/Masa.Utils.Extensions.Enums/_Enum.cs | 116 - .../Masa.Utils.Extensions.Enums/_Imports.cs | 5 - .../ExpressionExtensions.cs | 117 - .../Masa.Utils.Extensions.Expressions.csproj | 10 - .../_Imports.cs | 4 - .../FluentValidationExtensions.cs | 104 - ...nsions.Validations.FluentValidation.csproj | 13 - .../RegularHelper.cs | 21 - .../_Imports.cs | 4 - .../Entries/LdapAddress.cs | 19 - .../Entries/LdapUser.cs | 53 - .../Extensions/LdapAttributeSetExtensions.cs | 27 - .../Extensions/ServiceCollectionExtensions.cs | 27 - .../Masa.Utils.Ldap.Novell/ILdapFactory.cs | 9 - .../Masa.Utils.Ldap.Novell/ILdapProvider.cs | 25 - .../src/Masa.Utils.Ldap.Novell/LdapFactory.cs | 12 - .../src/Masa.Utils.Ldap.Novell/LdapOptions.cs | 49 - .../Masa.Utils.Ldap.Novell/LdapProvider.cs | 294 -- .../Masa.Utils.Ldap.Novell.csproj | 17 - .../src/Masa.Utils.Ldap.Novell/_Imports.cs | 10 - .../Masa.Utils.Ldap.Novell.Tests/LdapTest.cs | 85 - .../Masa.Utils.Ldap.Novell.Tests.csproj | 30 - .../Masa.Utils.Ldap.Novell.Tests/_Imports.cs | 10 - .../appsettings.json | 12 - .../src/Masa.Utils.Models.Config/AppConfig.cs | 9 - .../Masa.Utils.Models.Config.csproj | 9 - .../Attributes/MasaAuthorizeAttribute.cs | 15 - .../Constants/MasaClaimTypes.cs | 27 - .../Extensions/ClaimsIdentityExtensions.cs | 53 - .../ICurrentPrincipalAccessor.cs | 9 - .../Masa.Utils.Security.Authentication.csproj | 20 - .../MasaUser.cs | 47 - .../ThreadCurrentPrincipalAccessor.cs | 9 - .../_Imports.cs | 8 - ...curity.Authentication.OpenIdConnect.csproj | 15 - .../MasaOpenIdConnectOptions.cs | 15 - .../ServiceCollectionExtensions.cs | 96 - .../AesUtils.cs | 529 --- .../Base64Utils.cs | 34 - .../DESEncryType.cs | 17 - .../DesUtils.cs | 415 -- .../EncryptBase.cs | 43 - .../EncryptType.cs | 13 - .../FillType.cs | 17 - .../GlobalConfigurationUtils.cs | 21 - .../HashAlgorithmBase.cs | 48 - .../MD5Utils.cs | 117 - .../Masa.Utils.Security.Cryptography.csproj | 9 - .../SHA1Utils.cs | 20 - .../SHA256Utils.cs | 20 - .../SHA384Utils.cs | 20 - .../SHA512Utils.cs | 20 - .../_Imports.cs | 5 - .../AesTest.cs | 30 - .../DesTest.cs | 30 - ...a.Utils.Security.Cryptography.Tests.csproj | 22 - .../_Imports.cs | 4 - .../DefaultJwtProvider.cs | 85 - .../Masa.Utils.Security.Token/IJwtProvider.cs | 22 - .../src/Masa.Utils.Security.Token/JwtUtils.cs | 31 - .../Masa.Utils.Security.Token.csproj | 20 - .../Model/JwtConfigurationOptions.cs | 13 - .../ServiceCollectionExtensions.cs | 15 - .../src/Masa.Utils.Security.Token/_Imports.cs | 13 - .../Masa.EventBus.IntegrationTests.csproj | 16 +- 1716 files changed, 1857 insertions(+), 73219 deletions(-) delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs delete mode 100644 src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Properties.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/SectionTypes.cs delete mode 100644 src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/_Imports.cs delete mode 100644 src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj delete mode 100644 src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs delete mode 100644 src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs delete mode 100644 src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs delete mode 100644 src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs delete mode 100644 src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj delete mode 100644 src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs delete mode 100644 src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/_Imports.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStrings.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/TimestampType.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDistributedLock.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IMasaDbContext.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/SequentialGuid.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/Snowflake.cs delete mode 100644 src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/_Imports.cs delete mode 100644 src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/IMapping.cs delete mode 100644 src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Mapper.cs delete mode 100644 src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj delete mode 100644 src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs delete mode 100644 src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs delete mode 100644 src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/_Imports.cs delete mode 100644 src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj delete mode 100644 src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs delete mode 100644 src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs delete mode 100644 src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/CommitState.cs delete mode 100644 src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/EntityState.cs delete mode 100644 src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/ITransaction.cs delete mode 100644 src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs delete mode 100644 src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs delete mode 100644 src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs delete mode 100644 src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj delete mode 100644 src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/_Imports.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj delete mode 100644 src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs delete mode 100644 src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Event.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs delete mode 100644 src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj delete mode 100644 src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs delete mode 100644 src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IConvertProvider.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolation.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IParserProvider.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs delete mode 100644 src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/_Imports.cs delete mode 100644 src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs delete mode 100644 src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs delete mode 100644 src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs delete mode 100644 src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj delete mode 100644 src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs delete mode 100644 src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs delete mode 100644 src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs delete mode 100644 src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs delete mode 100644 src/BuildingBlocks/ReadWriteSpliting/EventSourcing/src/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs delete mode 100644 src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/CallerBase.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICaller.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs delete mode 100644 src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/_Imports.cs delete mode 100644 src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs delete mode 100644 src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj delete mode 100644 src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs delete mode 100644 src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs delete mode 100644 src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs delete mode 100644 src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs delete mode 100644 src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs delete mode 100644 src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs delete mode 100644 src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.md delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs delete mode 100644 src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs delete mode 100644 src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj delete mode 100644 src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md delete mode 100644 src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md delete mode 100644 src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs delete mode 100644 src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs delete mode 100644 src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs delete mode 100644 src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs delete mode 100644 src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ConfigurationOptions.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultConfigurationApi.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationProvider.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationSource.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaRelationOptions.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.md delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.zh-CN.md delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs delete mode 100644 src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/_Imports.cs delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/_Imports.cs delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/appsettings.json delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/customAppConfig.json delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/rabbitMq.json delete mode 100644 src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/redis.json delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md delete mode 100644 src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json delete mode 100644 src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs delete mode 100644 src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/_Imports.cs delete mode 100644 src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs delete mode 100644 src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj delete mode 100644 src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs delete mode 100644 src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs delete mode 100644 src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs delete mode 100644 src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs delete mode 100644 src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj delete mode 100644 src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs delete mode 100644 src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs delete mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj delete mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs delete mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md delete mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md delete mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs delete mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj delete mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md delete mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md delete mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs delete mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs delete mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj delete mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs delete mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.md delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj delete mode 100644 src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.md delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs delete mode 100644 src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Internal/Const.cs delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.md delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.zh-CN.md delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Transaction.cs delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs delete mode 100644 src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/_Imports.cs delete mode 100644 src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs delete mode 100644 src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj delete mode 100644 src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs delete mode 100644 src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs delete mode 100644 src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs delete mode 100644 src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.md delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainEventBus.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainService.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.md delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.zh-CN.md delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/_Imports.cs delete mode 100644 src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs delete mode 100644 src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs delete mode 100644 src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs delete mode 100644 src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj delete mode 100644 src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs delete mode 100644 src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/docs/LoadEvent.md delete mode 100644 src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs delete mode 100644 src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs delete mode 100644 src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj delete mode 100644 src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs delete mode 100644 src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBus.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.md delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.zh-CN.md delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs delete mode 100644 src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs delete mode 100644 src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.md delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs delete mode 100644 src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.md delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs delete mode 100644 src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/_Imports.cs delete mode 100644 src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj delete mode 100644 src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs delete mode 100644 src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilder.cs delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationDbContextProvider.cs delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.md delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.zh-CN.md delete mode 100644 src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/_Imports.cs delete mode 100644 src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj delete mode 100644 src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs delete mode 100644 src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs delete mode 100644 src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestIsolation.cs delete mode 100644 src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestParserProvider.cs delete mode 100644 src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs delete mode 100644 src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/_Imports.cs delete mode 100644 src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs delete mode 100644 src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs delete mode 100644 src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj delete mode 100644 src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs delete mode 100644 src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.md delete mode 100644 src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md delete mode 100644 src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs delete mode 100644 src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj delete mode 100644 src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs delete mode 100644 src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs delete mode 100644 src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs delete mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs delete mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs delete mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj delete mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs delete mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs delete mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.md delete mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md delete mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs delete mode 100644 src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/_Imports.cs delete mode 100644 src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj delete mode 100644 src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs delete mode 100644 src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs delete mode 100644 src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs delete mode 100644 src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs delete mode 100644 src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs delete mode 100644 src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs delete mode 100644 src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs delete mode 100644 src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj delete mode 100644 src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.md delete mode 100644 src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md delete mode 100644 src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/_Imports.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs delete mode 100644 src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs delete mode 100644 src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs delete mode 100644 src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs delete mode 100644 src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs delete mode 100644 src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj delete mode 100644 src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs delete mode 100644 src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs delete mode 100644 src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md delete mode 100644 src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md delete mode 100644 src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs delete mode 100644 src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs delete mode 100644 src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj delete mode 100644 src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs delete mode 100644 src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.md delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.md delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/JsonRequestMessage.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.md delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.zh-CN.md delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/XmlRequestMessage.cs delete mode 100644 src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/_Imports.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CallerTest.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs delete mode 100644 src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/_Imports.cs delete mode 100644 src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj delete mode 100644 src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.md delete mode 100644 src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md delete mode 100644 src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs delete mode 100644 src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/_Imports.cs delete mode 100644 src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj delete mode 100644 src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs delete mode 100644 src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs delete mode 100644 src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/AuthClient.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Constants.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.md delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.zh-CN.md delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/UserService.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs delete mode 100644 src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj delete mode 100644 src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/DccClient.cs delete mode 100644 src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs delete mode 100644 src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj delete mode 100644 src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.md delete mode 100644 src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md delete mode 100644 src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs delete mode 100644 src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs delete mode 100644 src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj delete mode 100644 src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Constants.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/McClient.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj delete mode 100644 src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs delete mode 100644 src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Constants.cs delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/PmClient.cs delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.md delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.zh-CN.md delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/AppService.cs delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj delete mode 100644 src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs delete mode 100644 src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Constants.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.md delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj delete mode 100644 src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs delete mode 100644 src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.md delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/TscClient.cs delete mode 100644 src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/_Imports.cs delete mode 100644 src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs delete mode 100644 src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj delete mode 100644 src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs delete mode 100644 src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs delete mode 100644 src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs delete mode 100644 src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs delete mode 100644 src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/_Imports.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClient.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs delete mode 100644 src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/_Imports.cs delete mode 100644 src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs delete mode 100644 src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj delete mode 100644 src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs delete mode 100644 src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/_Imports.cs delete mode 100644 src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj delete mode 100644 src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/MemoryCache.cs delete mode 100644 src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/_Imports.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/AbstractCallerProvider.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/AddCallerExtensions.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerBase.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerOptions.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultCallerFactory.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestMessage.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultResponseMessage.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerFactory.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerProvider.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestIdGenerator.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestMessage.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/IResponseMessage.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/ITypeConvertProvider.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerRelations.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Const.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/JsonRequestMessage.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/README.md delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/README.zh-CN.md delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.Core/_Imports.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.md delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.zh-CN.md delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/_Imports.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.md delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.zh-CN.md delete mode 100644 src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/_Imports.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/CallerTest.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs delete mode 100644 src/Utils/Caller/test/Masa.Utils.Caller.Tests/_Imports.cs delete mode 100644 src/Utils/Configuration/src/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj delete mode 100644 src/Utils/Configuration/src/Masa.Utils.Configuration.Json/AppSettings.cs delete mode 100644 src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonConfiguration.cs delete mode 100644 src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonFileOptions.cs delete mode 100644 src/Utils/Configuration/src/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj delete mode 100644 src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs delete mode 100644 src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs delete mode 100644 src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj delete mode 100644 src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/_Imports.cs delete mode 100644 src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj delete mode 100644 src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs delete mode 100644 src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Const.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.md delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.zh-CN.md delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs delete mode 100644 src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/_Imports.cs delete mode 100644 src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs delete mode 100644 src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj delete mode 100644 src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs delete mode 100644 src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.md delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.zh-CN.md delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs delete mode 100644 src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/_Imports.cs delete mode 100644 src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs delete mode 100644 src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs delete mode 100644 src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj delete mode 100644 src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs delete mode 100644 src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs delete mode 100644 src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.md delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/CommandLineBuilder.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprExtensions.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprOptions.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProcess.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProvider.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProcess.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProvider.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/Const.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/LogLevel.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcess.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/SystemProcess.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Protocol.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.md delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.zh-CN.md delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs delete mode 100644 src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/_Imports.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/Constant.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaException.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaExceptionContext.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.md delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.zh-CN.md delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/UserFriendlyException.cs delete mode 100644 src/Utils/Exceptions/src/Masa.Utils.Exceptions/_Imports.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.md delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/_Imports.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj delete mode 100644 src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs delete mode 100644 src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj delete mode 100644 src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/TypeExtensions.cs delete mode 100644 src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumExtensions.cs delete mode 100644 src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumUtil.cs delete mode 100644 src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj delete mode 100644 src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Model/EnumObject.cs delete mode 100644 src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Enum.cs delete mode 100644 src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Imports.cs delete mode 100644 src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs delete mode 100644 src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj delete mode 100644 src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/_Imports.cs delete mode 100644 src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs delete mode 100644 src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj delete mode 100644 src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs delete mode 100644 src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapFactory.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapProvider.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapFactory.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapOptions.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapProvider.cs delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj delete mode 100644 src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/_Imports.cs delete mode 100644 src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs delete mode 100644 src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj delete mode 100644 src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs delete mode 100644 src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json delete mode 100644 src/Utils/Models/Config/src/Masa.Utils.Models.Config/AppConfig.cs delete mode 100644 src/Utils/Models/Config/src/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj delete mode 100644 src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs delete mode 100644 src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs delete mode 100644 src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs delete mode 100644 src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs delete mode 100644 src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj delete mode 100644 src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/MasaUser.cs delete mode 100644 src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs delete mode 100644 src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/_Imports.cs delete mode 100644 src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj delete mode 100644 src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs delete mode 100644 src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/AesUtils.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Base64Utils.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DESEncryType.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DesUtils.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptBase.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptType.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/FillType.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/MD5Utils.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA1Utils.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA256Utils.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA384Utils.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA512Utils.cs delete mode 100644 src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/_Imports.cs delete mode 100644 src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs delete mode 100644 src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs delete mode 100644 src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj delete mode 100644 src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs delete mode 100644 src/Utils/Security/Token/src/Masa.Utils.Security.Token/DefaultJwtProvider.cs delete mode 100644 src/Utils/Security/Token/src/Masa.Utils.Security.Token/IJwtProvider.cs delete mode 100644 src/Utils/Security/Token/src/Masa.Utils.Security.Token/JwtUtils.cs delete mode 100644 src/Utils/Security/Token/src/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj delete mode 100644 src/Utils/Security/Token/src/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs delete mode 100644 src/Utils/Security/Token/src/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs delete mode 100644 src/Utils/Security/Token/src/Masa.Utils.Security.Token/_Imports.cs diff --git a/Masa.Framework.sln b/Masa.Framework.sln index aab2eeefd..9af354ef3 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -5,551 +5,533 @@ VisualStudioVersion = 17.0.31521.260 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BuildingBlocks", "BuildingBlocks", "{DC578D74-98F0-4F19-A230-CFA8DAEE0AF1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{0D34A7F0-DC77-4789-A136-93089CBD15C3}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{5944A182-13B8-4DA6-AEE2-0A01E64A9648}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{08649D7D-EF5A-4626-9959-935CA85DF770}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{8663AD83-4E2C-47EF-BF28-1427E82F1A36}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{FE0F37B3-7727-4A08-AEA1-437F53982658}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{4B812744-1CB5-4760-9719-2220EACC566C}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{232840A6-183C-4D3A-A086-582FD449D300}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{7064C470-7D0B-4CE2-A80C-BEE376DDC956}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B9256C4D-86F4-4E67-8774-C3EF971EC811}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E8CE3469-6E0F-495C-937E-D9820DE3DA89}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contrib", "Contrib", "{950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{46C33E74-835B-4CB4-861D-42A781A2502C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{2DC587FC-4D6D-400D-9504-69D9664A4124}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + .gitignore = .gitignore + .gitmodules = .gitmodules + Directory.Build.props = Directory.Build.props + LICENSE.txt = LICENSE.txt + NuGet.Config = NuGet.Config + README.md = README.md + README.zh-CN.md = README.zh-CN.md + EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching", "Caching", "{02B35A90-23DF-4341-89CF-E911ED210FBE}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E747043D-81E2-4A89-8B5B-1258ED45F941}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.EventBus.IntegrationTests", "test\Masa.EventBus.IntegrationTests\Masa.EventBus.IntegrationTests.csproj", "{BDA1DB4F-C408-445D-9391-EC9765CF7349}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{BCDB0439-8542-4DE7-A8C2-9BB582AE8C42}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{585B9627-45AA-42C3-965D-03359F25786C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development", "{F262689D-5BE8-45E9-B090-0CFF81315FB9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenIdConnect", "OpenIdConnect", "{CFC8DE12-A06F-46E2-890A-6EC9400F17DA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{87BBAEC2-1A18-4E5D-BDB3-91BF1CF3231B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ldap", "Ldap", "{8A795434-6928-41F6-B8B1-3F6DAC62D1A0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{D2DF986D-5EA6-40ED-93F3-2CF3A035F26B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{611ECFDA-B435-4106-BDB8-DD8C39FEBF08}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{C68543E6-83F0-4385-A223-EA6862800F9B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Validations", "Validations", "{B1984322-509A-4E96-BFB0-A0D5DEDFB92D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{8A17DE9A-258E-49E1-9EB2-B8B3F374A470}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{7A8F1593-C00F-4D90-9029-11BF75B3C926}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{2D179841-A866-4ED4-8B42-97CCE4D6496D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{1677DDFE-BBCF-4BA3-B5A7-9168BB27838E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{FB0F5EB7-AA72-4D54-BD8D-43B173E54E19}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B9256C4D-86F4-4E67-8774-C3EF971EC811}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{1EE02441-263C-458E-A774-9D522BFFBB3F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contrib", "Contrib", "{950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{76F1DBC4-1826-4EC6-92BA-FF7843D993CD}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{53543535-E81D-4B28-8EB0-89E9A8FDD496}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{8A9DBB76-6618-4982-87D7-6CBD8375EB15}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{E38DF0DC-C0C9-4BB9-983C-F435A73334CF}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{0DC9DE6E-E6D8-466A-8325-93822428CB87}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{45B8C34E-A62D-4809-BA0F-6046AFAB2851}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Mapping", "src\BuildingBlocks\Data\Mapping\Masa.BuildingBlocks.Data.Mapping\Masa.BuildingBlocks.Data.Mapping.csproj", "{523EB315-1A01-4F13-9EDE-266FE8111AB6}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{7B9CD814-DD10-4C63-B442-2168A0E0B6DE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.MappingExtensions", "src\BuildingBlocks\Data\Mapping\Masa.BuildingBlocks.Data.MappingExtensions\Masa.BuildingBlocks.Data.MappingExtensions.csproj", "{0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{0C5262F4-DC7E-493F-AB87-A72063ABCA00}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data", "src\BuildingBlocks\Data\Masa.BuildingBlocks.Data\Masa.BuildingBlocks.Data.csproj", "{8A60B832-8B1F-44A9-9999-C0C898ED6D82}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cqrs", "Cqrs", "{FE906D46-B113-4600-AC2C-7523937B96AB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Contracts", "src\BuildingBlocks\Data\Masa.BuildingBlocks.Data.Contracts\Masa.BuildingBlocks.Data.Contracts.csproj", "{CE286A13-1FFC-417B-8CC0-FE4991F3687B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{920E6762-32FE-4BEC-AD0C-6F28119C6804}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.UoW", "src\BuildingBlocks\Data\Masa.BuildingBlocks.Data.UoW\Masa.BuildingBlocks.Data.UoW.csproj", "{D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{45629BCA-1B57-4342-A74A-00B874B600AA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain", "src\BuildingBlocks\Ddd\Domain\Masa.BuildingBlocks.Ddd.Domain\Masa.BuildingBlocks.Ddd.Domain.csproj", "{5FC55EB3-2F84-45C4-9310-33A998F4DA70}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DistributedLock", "DistributedLock", "{8910E0AA-9BFB-4E69-A821-A411FEDBAFD4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "src\BuildingBlocks\Ddd\Domain\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{B403856A-6BF8-43C3-AD17-D3DF96F26D77}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdGenerator", "IdGenerator", "{A9D8D7E4-591D-479B-B0A5-07F30F831199}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Caller", "src\BuildingBlocks\Service\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{D83169F2-E05E-49E0-82BF-164D3F3C3174}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{14D3C601-C29B-48D2-8312-556319D04619}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Contracts", "src\BuildingBlocks\Service\Masa.BuildingBlocks.Service.Contracts\Masa.BuildingBlocks.Service.Contracts.csproj", "{28BB497F-5DC8-4D00-AC6B-2F7BECDD1797}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{542D8266-668F-49FA-BFE1-814AB96720DD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.MinimalAPIs", "src\BuildingBlocks\Service\Masa.BuildingBlocks.Service.MinimalAPIs\Masa.BuildingBlocks.Service.MinimalAPIs.csproj", "{58CF33D3-290B-4B68-865C-B776A7B5AC43}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{83AA938C-9182-4E65-A42A-79CAE68888E9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{F08A8192-F159-42B5-90CB-44BCB7AF7816}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{BA74E50F-C553-40D6-8578-BCB4A3F5E585}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Storage.ObjectStorage", "src\BuildingBlocks\Storage\Masa.BuildingBlocks.Storage.ObjectStorage\Masa.BuildingBlocks.Storage.ObjectStorage.csproj", "{5C22CA57-94F1-47C7-B27F-7F91DFD480DA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{32BC64A9-9BC9-44F3-8978-96D30CBC7A34}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete", "src\BuildingBlocks\SearchEngine\Masa.BuildingBlocks.SearchEngine.AutoComplete\Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj", "{435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{DC9F9523-A2F9-47AA-B6D9-40AC14797548}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1987405B-2304-4FB0-8D20-F2101617D614}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{985B71A9-DF28-4B70-9DA5-1D60B82E8551}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\SearchEngine\Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{412A5797-7D42-4F7C-96AB-4F784872ED08}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution items", "solution items", "{2DC587FC-4D6D-400D-9504-69D9664A4124}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - .gitignore = .gitignore - .gitmodules = .gitmodules - Directory.Build.props = Directory.Build.props - LICENSE.txt = LICENSE.txt - NuGet.Config = NuGet.Config - README.md = README.md - README.zh-CN.md = README.zh-CN.md - EndProjectSection +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Cache", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Cache\Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj", "{2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E747043D-81E2-4A89-8B5B-1258ED45F941}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{E50AD1BC-69B0-4E51-94CB-72AB10761710}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Snowflake", "Snowflake", "{5BD3D50F-5CB6-4554-9497-0F1680152D95}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{36BEA079-EDCD-44F7-8BD5-C06671DF4875}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SequentialGuid", "SequentialGuid", "{516A316F-BE2B-4931-88DD-4C08DECE8E56}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{0D395B3E-D603-49C3-AD80-B53979EDF9E1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Local", "Local", "{2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\Authentication\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{249E8BD4-C358-4358-93FA-78320D335014}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Medallion", "Medallion", "{81DF5E8A-2AFE-47FC-BE66-40BC557A03AB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration", "src\BuildingBlocks\Configuration\Masa.BuildingBlocks.Configuration\Masa.BuildingBlocks.Configuration.csproj", "{BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration.Tests", "src\BuildingBlocks\Configuration\Masa.BuildingBlocks.Configuration.Tests\Masa.BuildingBlocks.Configuration.Tests.csproj", "{F12ADBBE-092F-4938-8ED7-F49B61F0F957}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dcc", "Dcc", "{F7DEBE88-8324-47F9-B240-4F19F706B50B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.Events", "src\BuildingBlocks\Dispatcher\Masa.BuildingBlocks.Dispatcher.Events\Masa.BuildingBlocks.Dispatcher.Events.csproj", "{04D3C12F-7221-4AE8-852D-4C616B6769E9}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mc", "Mc", "{DFCA5F96-FFC3-44D7-85D8-1749F0D3845E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.IntegrationEvents", "src\BuildingBlocks\Dispatcher\Masa.BuildingBlocks.Dispatcher.IntegrationEvents\Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj", "{D2009F94-EA9C-44F0-B210-C373F9FE3641}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pm", "Pm", "{EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolation", "src\BuildingBlocks\Isolation\Masa.BuildingBlocks.Isolation\Masa.BuildingBlocks.Isolation.csproj", "{6586614A-39D8-412E-814C-3314F8A7909A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scheduler", "Scheduler", "{A7C74F80-E9E4-401F-93F4-560EC1BAC88E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.Cqrs", "src\BuildingBlocks\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj", "{400854AA-AE3F-40EC-B5BF-C9F1257490AA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tsc", "Tsc", "{4FB42611-1B54-4ABF-988A-714EE9E8C492}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing", "src\BuildingBlocks\ReadWriteSpliting\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj", "{0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataAnnotations", "DataAnnotations", "{F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{8A89304F-709C-4A3A-9FA6-D88761B8231B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Elasticsearch", "Elasticsearch", "{08FED323-7D60-4B8B-AD36-C55B40C96D1C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth", "src\BuildingBlocks\StackSdks\Auth\Masa.BuildingBlocks.StackSdks.Auth\Masa.BuildingBlocks.StackSdks.Auth.csproj", "{C37FB18D-FBA1-49DF-96CD-24D6F65B66E1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Prometheus", "Prometheus", "{2879EB9A-D18B-4C57-B041-365F7DAEEBC4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth.Contracts", "src\BuildingBlocks\StackSdks\Auth\Masa.BuildingBlocks.StackSdks.Auth.Contracts\Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj", "{C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependencyInjection", "DependencyInjection", "{33D4C640-954B-4468-95A4-2322DAB0B184}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Tsc", "src\BuildingBlocks\StackSdks\Masa.BuildingBlocks.StackSdk.Tsc\Masa.BuildingBlocks.StackSdks.Tsc.csproj", "{89D032A8-14FB-4C2F-A112-CB7FAFCA2B62}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConfigurationApi", "ConfigurationApi", "{CD7414D5-4DE9-4339-B833-29EF41B3AC76}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Dcc", "src\BuildingBlocks\StackSdks\Masa.BuildingBlocks.StackSdks.Dcc\Masa.BuildingBlocks.StackSdks.Dcc.csproj", "{EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IntegrationEvents", "IntegrationEvents", "{EAF8FB96-6D0E-4FCD-B991-C845903ECA8B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Mc", "src\BuildingBlocks\StackSdks\Masa.BuildingBlocks.StackSdks.Mc\Masa.BuildingBlocks.StackSdks.Mc.csproj", "{1F263FE5-649F-441D-AA55-B6012439E27F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dapr", "Dapr", "{FF832650-37C7-48FF-B078-77CACF37966E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Pm", "src\BuildingBlocks\StackSdks\Masa.BuildingBlocks.StackSdks.Pm\Masa.BuildingBlocks.StackSdks.Pm.csproj", "{F0A72797-A0E3-48BF-9E2E-34FD5ADD3441}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EventLogs", "EventLogs", "{46DE49C1-D700-4C46-849A-7F485D87A518}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Scheduler", "src\BuildingBlocks\StackSdks\Masa.BuildingBlocks.StackSdks.Scheduler\Masa.BuildingBlocks.StackSdks.Scheduler.csproj", "{D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Events", "Events", "{6B1042A4-A6D5-4307-B163-803164E4A742}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching", "Caching", "{AF921AB1-64D1-4478-AB49-192F3EE416FC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.EventBus.IntegrationTests", "test\Masa.EventBus.IntegrationTests\Masa.EventBus.IntegrationTests.csproj", "{BDA1DB4F-C408-445D-9391-EC9765CF7349}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{63461DA4-0EAF-48BD-8986-6767142DEF01}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{56917740-626B-42D5-8BB8-6895F79FB7D2}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{70449866-CC6B-438B-B8DC-CBAB436EFD00}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{706DA866-6226-430F-AB4D-98FEE7B0DDB0}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{EE77C779-1031-4494-9850-3F2D85D8FA10}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Development", "Development", "{03BD3624-3A54-4F72-AEF7-98B69DDF4B0C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oidc", "Oidc", "{BB0DFD22-33FF-465F-8788-D583BE39BC6D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions", "Extensions", "{69A6DFD9-F5A2-4714-94BA-36E85CDA3EF4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data", "src\BuildingBlocks\Data\Data\src\Masa.BuildingBlocks.Data\Masa.BuildingBlocks.Data.csproj", "{A91E96C6-9437-4335-A629-D4B3E921F9E8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ldap", "Ldap", "{0BC7A7F2-F8E0-4A6A-90E2-A0ACD997EBB1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Mapping", "src\BuildingBlocks\Data\Mapping\src\Masa.BuildingBlocks.Data.Mapping\Masa.BuildingBlocks.Data.Mapping.csproj", "{78D31C12-2E54-4C66-9849-B9664B9A5897}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{9CABAF1C-E5E1-4CB8-AAD4-D47387EED6AA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.MappingExtensions", "src\BuildingBlocks\Data\Mapping\src\Masa.BuildingBlocks.Data.MappingExtensions\Masa.BuildingBlocks.Data.MappingExtensions.csproj", "{03C37CB5-A325-4CB0-965A-A5FD67D14091}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Security", "Security", "{2D07F9AD-9951-475D-B7C7-980B23FDE9BB}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{4E20DC14-D9E4-484D-B99A-C4A759D1612E}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{534346EF-1D11-48DB-9909-700CEC99FF08}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.UoW", "src\BuildingBlocks\Data\UoW\src\Masa.BuildingBlocks.Data.UoW\Masa.BuildingBlocks.Data.UoW.csproj", "{BDA33777-F759-4050-85F5-68EB4996ADD7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Core", "src\Utils\Caching\Masa.Utils.Caching.Core\Masa.Utils.Caching.Core.csproj", "{BD0D6CEF-6732-4E68-BB73-3215443D5243}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Data.Contracts", "src\BuildingBlocks\Data\Contracts\src\Masa.BuildingBlocks.Data.Contracts\Masa.BuildingBlocks.Data.Contracts.csproj", "{A71C1D90-5513-4255-84A0-32384474E82C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Memory", "src\Utils\Caching\Masa.Utils.Caching.Memory\Masa.Utils.Caching.Memory.csproj", "{015C4181-A8D9-4FA5-89B9-38A37FA9D31D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Storage.ObjectStorage", "src\BuildingBlocks\Storage\ObjectStorage\src\Masa.BuildingBlocks.Storage.ObjectStorage\Masa.BuildingBlocks.Storage.ObjectStorage.csproj", "{AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.DistributedMemory", "src\Utils\Caching\Masa.Utils.Caching.DistributedMemory\Masa.Utils.Caching.DistributedMemory.csproj", "{F5466774-9B47-478A-BA9C-7BED9E0D923D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.MinimalAPIs", "src\BuildingBlocks\Service\MinimalAPIs\src\Masa.BuildingBlocks.Service.MinimalAPIs\Masa.BuildingBlocks.Service.MinimalAPIs.csproj", "{AC537AD9-9CC3-420F-A17C-D77C4069A576}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Distributed", "Distributed", "{E20DB2FB-DED9-49FA-8A72-A1740DB6330F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Caller", "src\BuildingBlocks\Service\Caller\src\Masa.BuildingBlocks.Service.Caller\Masa.BuildingBlocks.Service.Caller.csproj", "{617653DE-4377-4428-954B-E5FB4690E875}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis", "src\Utils\Caching\Distributed\Masa.Utils.Caching.Redis\Masa.Utils.Caching.Redis.csproj", "{FBFCAB1B-27D9-4479-B551-01D7FF7510C2}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{CD0CAD92-5784-471A-BC57-2DC888FA0A00}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{77B0C5D2-445D-4081-8DB8-6D72D27F70C3}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MinimalAPIs", "MinimalAPIs", "{5D6E1CE0-D783-4F5C-9962-9AE073A62F30}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis.Tests", "src\Utils\Caching\Distributed\Tests\Masa.Utils.Caching.Redis.Tests\Masa.Utils.Caching.Redis.Tests.csproj", "{AC180C70-85EE-418D-8290-CA019F6FA643}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Service.Contracts", "src\BuildingBlocks\Service\Service\src\Masa.BuildingBlocks.Service.Contracts\Masa.BuildingBlocks.Service.Contracts.csproj", "{741E75F7-9286-4C01-8C67-AA8515670DF7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core", "src\Utils\Caller\Masa.Utils.Caller.Core\Masa.Utils.Caller.Core.csproj", "{D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AutoComplete", "AutoComplete", "{D98F5757-375F-46D1-9903-5D8D57A6748F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.DaprClient", "src\Utils\Caller\Masa.Utils.Caller.DaprClient\Masa.Utils.Caller.DaprClient.csproj", "{82B691D6-564A-4F4A-B07D-552EB63DCBE7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete", "src\BuildingBlocks\SearchEngine\AutoComplete\src\Masa.BuildingBlocks.SearchEngine.AutoComplete\Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj", "{404CD919-D15D-49D6-8D26-E96486E62700}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.HttpClient", "src\Utils\Caller\Masa.Utils.Caller.HttpClient\Masa.Utils.Caller.HttpClient.csproj", "{0F58FA8E-CA9F-47EB-885D-F422955F9983}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\SearchEngine\AutoComplete\test\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{47597D41-C795-43FE-8B76-069D9E1C364C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Tests", "src\Utils\Caller\Masa.Utils.Caller.Tests\Masa.Utils.Caller.Tests.csproj", "{8D4550FA-878A-4554-B856-614B4ABF8721}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.Events", "src\BuildingBlocks\Dispatcher\Events\src\Masa.BuildingBlocks.Dispatcher.Events\Masa.BuildingBlocks.Dispatcher.Events.csproj", "{3E9E2661-DDD6-4D33-BCA7-EA07784F6723}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Exceptions", "src\Utils\Masa.Utils.Exceptions\Masa.Utils.Exceptions.csproj", "{7B0EDB07-D3AE-4077-9A23-35CA6556E791}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Dispatcher.IntegrationEvents", "src\BuildingBlocks\Dispatcher\IntegrationEvents\src\Masa.BuildingBlocks.Dispatcher.IntegrationEvents\Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj", "{3FCB8575-6211-4E91-BCF8-1D2D380843B9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Dcc", "src\Utils\Configuration\Masa.Utils.Configuration.Dcc\Masa.Utils.Configuration.Dcc.csproj", "{E376F15A-3C13-4DBF-B972-E03D2350D7C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain", "src\BuildingBlocks\Ddd\Domain\src\Masa.BuildingBlocks.Ddd.Domain\Masa.BuildingBlocks.Ddd.Domain.csproj", "{3016EDC5-4BE6-4CE2-8B18-6EE226920393}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Json", "src\Utils\Configuration\Masa.Utils.Configuration.Json\Masa.Utils.Configuration.Json.csproj", "{8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.Cqrs", "src\BuildingBlocks\ReadWriteSpliting\Cqrs\src\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs\Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj", "{2809DB8A-95FA-4330-97C7-4A4936CD0EA9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations", "src\Utils\Data\Masa.Utils.Data.DataAnnotations\Masa.Utils.Data.DataAnnotations.csproj", "{766E3633-7B82-49CC-B012-CAE6264D4628}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing", "src\BuildingBlocks\ReadWriteSpliting\EventSourcing\src\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing\Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj", "{54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch", "src\Utils\Data\Masa.Utils.Data.Elasticsearch\Masa.Utils.Data.Elasticsearch.csproj", "{B7003322-212E-4568-9B61-95DB67CABC3F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Ddd.Domain.Tests", "src\BuildingBlocks\Ddd\Domain\test\Masa.BuildingBlocks.Ddd.Domain.Tests\Masa.BuildingBlocks.Ddd.Domain.Tests.csproj", "{45BAE42F-4801-4758-9CDA-0D900C734369}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus", "src\Utils\Data\Masa.Utils.Data.Prometheus\Masa.Utils.Data.Prometheus.csproj", "{301961E7-03E9-4955-95E6-F6EFF2E284AD}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdentityModel", "IdentityModel", "{0329A13A-436E-4E00-A1C7-243F9DD4B7D2}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{531B1751-A26F-4CFE-8A41-A4F851207066}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\Identity\IdentityModel\src\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{9DE85526-8B33-4291-B285-4BECF431D6FA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations.Tests", "src\Utils\Data\Tests\Masa.Utils.Data.DataAnnotations.Tests\Masa.Utils.Data.DataAnnotations.Tests.csproj", "{6D54B0C4-CB92-4C86-856D-F02EDC574B49}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Isolation", "src\BuildingBlocks\Isolation\src\Masa.BuildingBlocks.Isolation\Masa.BuildingBlocks.Isolation.csproj", "{DCA283C7-2492-4461-BD34-AB00191C46F7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch.Tests", "src\Utils\Data\Tests\Masa.Utils.Data.Elasticsearch.Tests\Masa.Utils.Data.Elasticsearch.Tests.csproj", "{7323D590-BE85-4320-BBC6-5DB44CF0D6BE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration", "src\BuildingBlocks\Configuration\src\Masa.BuildingBlocks.Configuration\Masa.BuildingBlocks.Configuration.csproj", "{1EF25877-2E8F-4FF1-A530-F3DEB512E238}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus.Test", "src\Utils\Data\Tests\Masa.Utils.Data.Prometheus.Test\Masa.Utils.Data.Prometheus.Test.csproj", "{B2EEE403-4F65-4344-8728-57A5F47F745D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration.Tests", "src\BuildingBlocks\Configuration\test\Masa.BuildingBlocks.Configuration.Tests\Masa.BuildingBlocks.Configuration.Tests.csproj", "{1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr", "src\Utils\Development\Dapr\Masa.Utils.Development.Dapr\Masa.Utils.Development.Dapr.csproj", "{D4795F8B-48FC-4CB4-8144-A5679B37D398}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth", "src\BuildingBlocks\StackSdks\Auth\src\Masa.BuildingBlocks.StackSdks.Auth\Masa.BuildingBlocks.StackSdks.Auth.csproj", "{06918731-F657-417E-A74D-E2D7E77351B1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr.AspNetCore", "src\Utils\Development\Dapr\Masa.Utils.Development.Dapr.AspNetCore\Masa.Utils.Development.Dapr.AspNetCore.csproj", "{6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Auth.Contracts", "src\BuildingBlocks\StackSdks\Auth\src\Masa.BuildingBlocks.StackSdks.Auth.Contracts\Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj", "{1818788E-7C68-4280-93A8-63D01168C6B6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection", "src\Utils\Extensions\Masa.Utils.Extensions.DependencyInjection\Masa.Utils.Extensions.DependencyInjection.csproj", "{8AD935E1-2676-4C60-9D1A-F3422AC04DA9}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Auth", "Auth", "{DC292168-27F4-4469-8CDA-92FB4212EF53}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DotNet", "src\Utils\Extensions\Masa.Utils.Extensions.DotNet\Masa.Utils.Extensions.DotNet.csproj", "{B43AD1DB-552A-445F-81C2-193876F434C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Dcc", "src\BuildingBlocks\StackSdks\Dcc\src\Masa.BuildingBlocks.StackSdks.Dcc\Masa.BuildingBlocks.StackSdks.Dcc.csproj", "{872994E4-7D87-483A-B6DD-E68DE4526497}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Enums", "src\Utils\Extensions\Masa.Utils.Extensions.Enums\Masa.Utils.Extensions.Enums.csproj", "{F1D5483E-8BED-4B4D-A2C7-573B0527E298}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dcc", "Dcc", "{BEC84962-7BBD-4C11-8FD1-D175AC54FE83}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Expressions", "src\Utils\Extensions\Masa.Utils.Extensions.Expressions\Masa.Utils.Extensions.Expressions.csproj", "{83A159C7-8917-4A3F-92F4-0609368D3267}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Pm", "Pm", "{40EC04A2-9862-43E5-A1B8-69CED1BE646C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Validations", "Validations", "{B1B09684-A842-44FA-9D35-68BE66838A5C}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mc", "Mc", "{6092474F-2AF3-4C24-A121-74F7A0C87E09}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Validations.FluentValidation", "src\Utils\Extensions\Validations\Masa.Utils.Extensions.Validations.FluentValidation\Masa.Utils.Extensions.Validations.FluentValidation.csproj", "{F5C03CF8-E7F0-40C9-8F14-3171956A57A5}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scheduler", "Scheduler", "{EB4B7EA5-274B-4AF0-8F4B-BB474BB63D6D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C2FAC276-9D6E-498A-BBA2-F3F14ADF4D0D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tsc", "Tsc", "{D4A6B54C-70DE-4CE0-B115-30694548E253}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Tests", "src\Utils\Extensions\Tests\Masa.Utils.Extensions.DependencyInjection.Tests\Masa.Utils.Extensions.DependencyInjection.Tests.csproj", "{3D8FA0B9-D669-418C-8111-F2B772BA47A6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Mc", "src\BuildingBlocks\StackSdks\Mc\src\Masa.BuildingBlocks.StackSdks.Mc\Masa.BuildingBlocks.StackSdks.Mc.csproj", "{A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell", "src\Utils\Ldap\Masa.Utils.Ldap.Novell\Masa.Utils.Ldap.Novell.csproj", "{AE7980F2-6F94-4A93-9551-F47AD43FC545}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Pm", "src\BuildingBlocks\StackSdks\Pm\src\Masa.BuildingBlocks.StackSdks.Pm\Masa.BuildingBlocks.StackSdks.Pm.csproj", "{C7A93ED9-5D0B-4F32-AA8A-69A515C32342}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B477B68A-16F3-4005-BDAD-09905A3267A5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Scheduler", "src\BuildingBlocks\StackSdks\Scheduler\src\Masa.BuildingBlocks.StackSdks.Scheduler\Masa.BuildingBlocks.StackSdks.Scheduler.csproj", "{8B0D2243-5E00-472E-82EC-572905A373AF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell.Tests", "src\Utils\Ldap\Tests\Masa.Utils.Ldap.Novell.Tests\Masa.Utils.Ldap.Novell.Tests.csproj", "{023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.StackSdks.Tsc", "src\BuildingBlocks\StackSdks\Tsc\src\Masa.BuildingBlocks.StackSdk.Tsc\Masa.BuildingBlocks.StackSdks.Tsc.csproj", "{94F98C15-6E92-466A-A93D-EB37CC877F99}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Models.Config", "src\Utils\Models\Masa.Utils.Models.Config\Masa.Utils.Models.Config.csproj", "{41675E4A-0B1A-436B-910A-A296D35661DC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.csproj", "{6920A090-9B17-4C6B-B86D-7807C7D32BA0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography", "src\Utils\Security\Masa.Utils.Security.Cryptography\Masa.Utils.Security.Cryptography.csproj", "{F43B5288-30F0-429E-A10F-9560E8CE318D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Cosmos", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.Cosmos\Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj", "{DA7F5603-FEC0-4090-9561-77B317D9EFA4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Token", "src\Utils\Security\Masa.Utils.Security.Token\Masa.Utils.Security.Token.csproj", "{42A17DC6-7F8D-487A-98F0-1DAF6FF81A63}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.InMemory", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.InMemory\Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj", "{E48D5AFE-8392-46D4-92C5-E3C6332035AB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication", "src\Utils\Security\Authentication\Masa.Utils.Security.Authentication\Masa.Utils.Security.Authentication.csproj", "{E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.MySql", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.MySql\Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj", "{84B7A048-5B99-429A-8322-0DE98560C2D0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication.OpenIdConnect", "src\Utils\Security\Authentication\Masa.Utils.Security.Authentication.OpenIdConnect\Masa.Utils.Security.Authentication.OpenIdConnect.csproj", "{386F0326-D591-4BED-A01A-91C0E9814467}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Oracle", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.Oracle\Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj", "{7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{9823F0D1-B5F2-49B2-9C05-A41BB4178FD5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj", "{074FE1B1-CC4A-4E2F-88FB-BD0131C88306}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography.Tests", "src\Utils\Security\Tests\Masa.Utils.Security.Cryptography.Tests\Masa.Utils.Security.Cryptography.Tests.csproj", "{9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.PostgreSql", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj", "{C9FF6E3A-B173-4070-8DA8-84EDE6F77298}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{3198630F-C09B-40AE-B9A1-E79249296E48}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Sqlite", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.Sqlite\Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj", "{C598E4D8-634C-40B2-BD77-ED69AD4BF211}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{191588CC-BDCB-4C23-AD8E-76391F8BD7B9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.SqlServer", "src\Contrib\Data\EntityFrameworkCore\src\Masa.Contrib.Data.EntityFrameworkCore.SqlServer\Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj", "{5238486B-2E9E-44CE-84BC-1BF55AB59EE5}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{BE980C6D-3277-44C4-8203-959239F81F67}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Tests", "src\Contrib\Data\EntityFrameworkCore\test\Masa.Contrib.Data.EntityFrameworkCore.Tests\Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj", "{9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Ddd", "Ddd", "{62D61C4E-B78B-429A-A5F4-345E3A290EAE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.NormalGuid", "src\Contrib\Data\IdGenerator\NormalGuid\src\Masa.Contrib.Data.IdGenerator.NormalGuid\Masa.Contrib.Data.IdGenerator.NormalGuid.csproj", "{29071256-A255-4881-8BF7-63EA598313F8}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dispatcher", "Dispatcher", "{5BE84027-D1B4-4264-A7EC-E84658350CA7}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NormalGuid", "NormalGuid", "{EDCE6A71-453E-4FB4-B01B-D8DBE16F1C49}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{0DA3779A-E0E9-46A3-BA6F-BCD5819DB6F9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid", "src\Contrib\Data\IdGenerator\SequentialGuid\src\Masa.Contrib.Data.IdGenerator.SequentialGuid\Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj", "{4CE43CE6-A150-44B9-9896-EB5D28B994B0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ReadWriteSpliting", "ReadWriteSpliting", "{FD6300FB-5601-4516-BF1C-936690ECE026}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake", "src\Contrib\Data\IdGenerator\Snowflake\src\Masa.Contrib.Data.IdGenerator.Snowflake\Masa.Contrib.Data.IdGenerator.Snowflake.csproj", "{747A2EBA-BF28-4153-BF03-3300DA570061}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SearchEngine", "SearchEngine", "{830DDDD7-74A5-431B-92E4-C9641D0A10E4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis", "src\Contrib\Data\IdGenerator\Snowflake\src\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj", "{13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Service", "Service", "{B7709311-A885-49E1-9078-B6CC8406B916}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests", "src\Contrib\Data\IdGenerator\Snowflake\test\Masa.Contrib.Data.IdGenerator.Snowflake.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj", "{6521511B-CE2E-485D-B72C-C22D89A191A2}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "StackSdks", "StackSdks", "{383995FF-B661-4E15-A830-640FC5BA8A1F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj", "{F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{62E888C1-9FCD-413D-91CB-1F2DD3D356E3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\perf\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{6A44C395-D619-496E-A5A8-8F8FFA51177A}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenIdConnect", "OpenIdConnect", "{41769FBF-91A8-48D1-B3BB-CAE4C814E7CD}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Exceptions", "Exceptions", "{F4CC0091-D652-4445-A9FD-9D2CE13A2286}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.Oidc.Cache\Masa.Contrib.Authentication.Oidc.Cache.csproj", "{B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Exceptions", "src\Utils\Exceptions\src\Masa.Utils.Exceptions\Masa.Utils.Exceptions.csproj", "{93510E80-4378-4504-A220-C71D0A61ADD6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache.Storage", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.Oidc.Cache.Storage\Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj", "{4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dapr", "Dapr", "{B5A410AD-C1F1-4D48-B78D-85D10ACA7881}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.EntityFrameworkCore", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj", "{3532E374-C922-4B79-93CA-2B0E4CC14FB9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr", "src\Utils\Development\Dapr\src\Masa.Utils.Development.Dapr\Masa.Utils.Development.Dapr.csproj", "{1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel", "src\Contrib\Authentication\Masa.Contrib.Identity.IdentityModel\Masa.Contrib.Identity.IdentityModel.csproj", "{DF784809-63B1-44EF-802E-CCCB1FFAA557}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Development.Dapr.AspNetCore", "src\Utils\Development\Dapr\src\Masa.Utils.Development.Dapr.AspNetCore\Masa.Utils.Development.Dapr.AspNetCore.csproj", "{D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{94D15C26-7204-4299-BC23-B89F5A0B0BF9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations", "src\Utils\Data\DataAnnotations\src\Masa.Utils.Data.DataAnnotations\Masa.Utils.Data.DataAnnotations.csproj", "{D66370B6-8E54-4E95-92CD-81236916A4D1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel.Tests", "src\Contrib\Authentication\Tests\Masa.Contrib.Identity.IdentityModel.Tests\Masa.Contrib.Identity.IdentityModel.Tests.csproj", "{06381F61-2C55-4322-9417-EA14F5F0E467}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.DataAnnotations.Tests", "src\Utils\Data\DataAnnotations\test\Masa.Utils.Data.DataAnnotations.Tests\Masa.Utils.Data.DataAnnotations.Tests.csproj", "{47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration", "src\Contrib\Configuration\Masa.Contrib.Configuration\Masa.Contrib.Configuration.csproj", "{A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch", "src\Utils\Data\Elasticsearch\src\Masa.Utils.Data.Elasticsearch\Masa.Utils.Data.Elasticsearch.csproj", "{D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8C5FBB10-CFAE-482C-93E8-7E03303D7825}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Elasticsearch.Tests", "src\Utils\Data\Elasticsearch\test\Masa.Utils.Data.Elasticsearch.Tests\Masa.Utils.Data.Elasticsearch.Tests.csproj", "{A2707F9F-80CC-41F9-9ED6-B45E5732CC56}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests", "src\Contrib\Configuration\Tests\Masa.Contrib.Configuration.Tests\Masa.Contrib.Configuration.Tests.csproj", "{0B6512C6-64F0-4403-B074-67F3B95341D7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus", "src\Utils\Data\Prometheus\src\Masa.Utils.Data.Prometheus\Masa.Utils.Data.Prometheus.csproj", "{7961AAE6-FDC0-43C3-A546-4DBFE340660D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{258E4702-B414-4629-BD37-CAEE20BE052B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Data.Prometheus.Test", "src\Utils\Data\Prometheus\test\Masa.Utils.Data.Prometheus.Test\Masa.Utils.Data.Prometheus.Test.csproj", "{6BB1FCDF-1E26-4837-984D-DA74D558A49B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests", "src\Contrib\Configuration\Tests\Scenes\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj", "{D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection", "src\Utils\Extensions\DependencyInjection\src\Masa.Utils.Extensions.DependencyInjection\Masa.Utils.Extensions.DependencyInjection.csproj", "{35F1DB8E-6479-4619-82BB-946BC7EC959E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.Tests", "src\Contrib\Configuration\Tests\Scenes\Masa.Contrib.Configuration.AutoMap.Tests\Masa.Contrib.Configuration.AutoMap.Tests.csproj", "{A3637D23-8548-4665-B61B-A8F5B94837E0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DependencyInjection.Tests", "src\Utils\Extensions\DependencyInjection\test\Masa.Utils.Extensions.DependencyInjection.Tests\Masa.Utils.Extensions.DependencyInjection.Tests.csproj", "{0F4E4A62-04C7-4635-8543-D595B45D2D76}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConfigurationApi", "ConfigurationApi", "{7A4D9DEE-7024-47E5-8A55-154F4987CF80}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Validations.FluentValidation", "src\Utils\Extensions\Validations\src\Masa.Utils.Extensions.Validations.FluentValidation\Masa.Utils.Extensions.Validations.FluentValidation.csproj", "{564A2C45-D42B-4A6C-A539-B10863D8E67C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc", "src\Contrib\Configuration\ConfigurationApi\Masa.Contrib.Configuration.ConfigurationApi.Dcc\Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj", "{EF05D9C2-2F71-40C6-B90B-41E093979803}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.DotNet", "src\Utils\Extensions\DotNet\src\Masa.Utils.Extensions.DotNet\Masa.Utils.Extensions.DotNet.csproj", "{C31555B0-FCAA-44F9-8284-96FBDD7FAD37}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{0D285BE6-F9A6-45AC-B76E-787D35FCB495}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Enums", "src\Utils\Extensions\Enums\src\Masa.Utils.Extensions.Enums\Masa.Utils.Extensions.Enums.csproj", "{965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests", "src\Contrib\Configuration\ConfigurationApi\Tests\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj", "{C5D05037-EE7F-4FEA-A5E9-40252398A615}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Extensions.Expressions", "src\Utils\Extensions\Expressions\src\Masa.Utils.Extensions.Expressions\Masa.Utils.Extensions.Expressions.csproj", "{267429BB-FCFF-491B-B618-174DC3152EF7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contracts", "Contracts", "{C6AE282C-70B6-483D-A17A-FD7F8BC56D61}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell", "src\Utils\Ldap\Novell\src\Masa.Utils.Ldap.Novell\Masa.Utils.Ldap.Novell.csproj", "{9F6F4116-8029-4788-9561-A0791EDFB720}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DistributedLock", "DistributedLock", "{806DC3FC-6C27-4FEC-B007-0DDD17C7D9E1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Ldap.Novell.Tests", "src\Utils\Ldap\Novell\test\Masa.Utils.Ldap.Tests\Masa.Utils.Ldap.Novell.Tests\Masa.Utils.Ldap.Novell.Tests.csproj", "{C89383DE-0284-4E0F-94E2-ED2F7B4B5656}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdGenerator", "IdGenerator", "{2803E4E2-723B-477B-9E08-A94D8780439C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Models.Config", "src\Utils\Models\Config\src\Masa.Utils.Models.Config\Masa.Utils.Models.Config.csproj", "{823B06D1-85E5-400B-885D-2B3CFD01487D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mapping", "Mapping", "{46FAD690-6764-41EA-B4C4-D9D5020C23CF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Core", "src\Utils\Caller\src\Masa.Utils.Caller.Core\Masa.Utils.Caller.Core.csproj", "{CC0C0477-2C69-4BB2-A433-15A0C25E782C}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Orm", "Orm", "{343A61CC-45B5-488F-A88D-BB3411FB9E88}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.DaprClient", "src\Utils\Caller\src\Masa.Utils.Caller.DaprClient\Masa.Utils.Caller.DaprClient.csproj", "{74A8DA40-CB46-4B95-96DF-46A18090D987}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{E8B3FB42-C450-4B12-9C2C-7B9A02B616BB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.HttpClient", "src\Utils\Caller\src\Masa.Utils.Caller.HttpClient\Masa.Utils.Caller.HttpClient.csproj", "{53562602-1F63-4B2C-8921-B5BB826984F8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF", "src\Contrib\Data\Contracts\Masa.Contrib.Data.Contracts.EF\Masa.Contrib.Data.Contracts.EF.csproj", "{8353A1CE-B6F0-42A2-B7F1-BC87707719AD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caller.Tests", "src\Utils\Caller\test\Masa.Utils.Caller.Tests\Masa.Utils.Caller.Tests.csproj", "{651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{83E5A183-56D6-4CAC-95A6-FB280AA7AE3D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Core", "src\Utils\Caching\Caching\src\Masa.Utils.Caching.Core\Masa.Utils.Caching.Core.csproj", "{EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF.Tests", "src\Contrib\Data\Contracts\Tests\Masa.Contrib.Data.Contracts.EF.Tests\Masa.Contrib.Data.Contracts.EF.Tests.csproj", "{905DB539-092C-4365-ACA1-531D3F2A6665}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis", "src\Utils\Caching\Distributed\src\Masa.Utils.Caching.Redis\Masa.Utils.Caching.Redis.csproj", "{EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local", "src\Contrib\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Local\Masa.Contrib.Data.DistributedLock.Local.csproj", "{51A22652-A76D-4BB6-92B3-269E7628F4AA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.DistributedMemory", "src\Utils\Caching\DistributedMemory\src\Masa.Utils.Caching.DistributedMemory\Masa.Utils.Caching.DistributedMemory.csproj", "{B2465420-C899-4077-B6D3-B62405D5BFE2}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{74CFB66E-1984-4DE7-8970-BB5EF0755C92}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Memory", "src\Utils\Caching\Memory\src\Masa.Utils.Caching.Memory\Masa.Utils.Caching.Memory.csproj", "{5243EAA7-17B4-4810-ACDD-FCB28E1C477D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local.Tests", "src\Contrib\Data\DistributedLock\Tests\Masa.Contrib.Data.DistributedLock.Local.Tests\Masa.Contrib.Data.DistributedLock.Local.Tests.csproj", "{2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Caching.Redis.Tests", "src\Utils\Caching\Distributed\test\Masa.Utils.Caching.Redis.Tests\Masa.Utils.Caching.Redis.Tests.csproj", "{36BA4778-011A-4B0F-8C6A-C169E012AE66}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Medallion", "Medallion", "{60598D32-8EC0-4A4D-93AB-056CF262F8C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Dcc", "src\Utils\Configuration\src\Masa.Utils.Configuration.Dcc\Masa.Utils.Configuration.Dcc.csproj", "{E624718C-38CD-41AA-BBA0-415008BE86BF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion\Masa.Contrib.Data.DistributedLock.Medallion.csproj", "{FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Configuration.Json", "src\Utils\Configuration\src\Masa.Utils.Configuration.Json\Masa.Utils.Configuration.Json.csproj", "{3F2A0172-118E-439E-BD4A-5E0F95361838}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Azure", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.Azure\Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj", "{FB5B1BFD-7540-430C-810D-A32A42B8509C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local", "src\Contrib\Data\DistributedLock\Local\src\Masa.Contrib.Data.DistributedLock.Local\Masa.Contrib.Data.DistributedLock.Local.csproj", "{9D295FC2-32A9-487A-BAE3-348F6360729D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.FileSystem", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj", "{B68AC832-60C4-41B4-85F9-0883A954852E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local.Tests", "src\Contrib\Data\DistributedLock\Local\test\Masa.Contrib.Data.DistributedLock.Local.Tests\Masa.Contrib.Data.DistributedLock.Local.Tests.csproj", "{D215BD91-4D7B-437E-BC2A-14D9B81649E5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.MySql", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.MySql\Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj", "{8F816310-F5F3-4D09-BC16-FDD65FE0BDB5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion\Masa.Contrib.Data.DistributedLock.Medallion.csproj", "{FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Oracle", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.Oracle\Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj", "{1DD1C862-D01A-48E4-908A-A5C5F2F197FD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Azure", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.Azure\Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj", "{89B90362-4C48-4FBD-A0B7-47E34D3326F0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj", "{41214881-80AE-4F6A-A83D-A0A43C28756C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.FileSystem", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem\Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj", "{5C84C069-DB54-409A-BC0F-CBC066860CBA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Redis", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.Redis\Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj", "{847D0E8E-1B12-410C-985D-0714C8103610}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.MySql", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.MySql\Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj", "{A02A0101-3C0E-4971-AB0C-CC762C0E3955}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.SqlServer", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj", "{0B862D4E-87C2-4042-A3CD-B8E1C4498268}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Oracle", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.Oracle\Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj", "{B469E3EE-637F-4A0A-852D-6A33F896B906}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj", "{D574FB86-CA7B-4587-A5F3-B66C520E54BD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql\Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj", "{2B288DAC-2E49-4980-B234-6E114FB1B2F1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj", "{5F130015-615A-4C61-ADBF-CDDA00B30EC1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Redis", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.Redis\Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj", "{5DAFE25B-EA24-429E-A3D2-7CD28565E444}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.Tests", "src\Contrib\Data\DistributedLock\Medallion\Masa.Contrib.Data.DistributedLock.Medallion.Tests\Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj", "{49F28BD5-D7ED-4809-8D4D-E6F5E964BB07}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.SqlServer", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer\Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj", "{EAF59CBD-2310-4BF0-AE28-580D451F9C86}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NormalGuid", "NormalGuid", "{4515CCA0-E8FC-4FCF-93E1-B812F5949371}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles\Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj", "{DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SequentialGuid", "SequentialGuid", "{E676BB35-7888-4FCD-9AFA-E46848639074}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper", "src\Contrib\Data\DistributedLock\Medallion\src\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper\Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj", "{EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Snowflake", "Snowflake", "{FFEF958B-DA21-4552-86B6-87D9592A3668}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Contracts", "Contracts", "{AF7F4D54-CE14-4BE1-8E9E-2D56C6809508}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.NormalGuid", "src\Contrib\Data\IdGenerator\NormalGuid\Masa.Contrib.Data.IdGenerator.NormalGuid\Masa.Contrib.Data.IdGenerator.NormalGuid.csproj", "{E44D5116-EEEF-4664-8E47-3667AB8D6448}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF", "src\Contrib\Data\Contracts\src\Masa.Contrib.Data.Contracts.EF\Masa.Contrib.Data.Contracts.EF.csproj", "{ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid", "src\Contrib\Data\IdGenerator\SequentialGuid\Masa.Contrib.Data.IdGenerator.SequentialGuid\Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj", "{11B1DF36-97DC-4928-BED2-A51BDDFE0AEF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF.Tests", "src\Contrib\Data\Contracts\test\Masa.Contrib.Data.Contracts.EF.Tests\Masa.Contrib.Data.Contracts.EF.Tests.csproj", "{9C25DDE5-65D9-492D-9C04-F3D64EE706A1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests", "src\Contrib\Data\IdGenerator\SequentialGuid\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests\Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj", "{D77D8E17-6D1C-4E44-AF18-D572F12745BA}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{8FE4210C-9D74-4E8B-84CD-4E96751A50DD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake", "src\Contrib\Data\IdGenerator\Snowflake\Masa.Contrib.Data.IdGenerator.Snowflake\Masa.Contrib.Data.IdGenerator.Snowflake.csproj", "{3167F949-F6F4-4440-97CD-2EC7B785D9E8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF", "src\Contrib\Data\UoW\src\Masa.Contrib.Data.UoW.EF\Masa.Contrib.Data.UoW.EF.csproj", "{A2EDB5D7-9675-403A-9FC2-FDAA49555097}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis", "src\Contrib\Data\IdGenerator\Snowflake\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj", "{A00D752B-65C8-404A-8397-82DB5613884E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF.Tests", "src\Contrib\Data\UoW\test\Masa.Contrib.Data.UoW.EF.Tests\Masa.Contrib.Data.UoW.EF.Tests.csproj", "{D7D46284-47DF-488A-8D04-421CBAAF6943}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{17B751BF-DB79-46B0-A61E-BB8A52919AC9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration", "src\Contrib\Configuration\Configuration\src\Masa.Contrib.Configuration\Masa.Contrib.Configuration.csproj", "{DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj", "{0457B5A1-02D7-44FF-8FE6-468A456E2909}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests", "src\Contrib\Configuration\Configuration\test\Masa.Contrib.Configuration.Tests\Masa.Contrib.Configuration.Tests.csproj", "{848EC46B-2C09-4E4E-9D09-D876862B52CD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{55DCA34D-48CE-4D32-8515-B6583FA548AE}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Configuration", "Configuration", "{CDE13B76-107F-4282-BEAE-26843BD46140}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj", "{5957E2B1-A517-4225-8517-71D3B0B29B90}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests", "src\Contrib\Configuration\Configuration\test\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj", "{1226DCD2-D128-4976-8806-2A369F87058B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster", "src\Contrib\Data\Mapping\Masa.Contrib.Data.Mapping.Mapster\Masa.Contrib.Data.Mapping.Mapster.csproj", "{11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.Tests", "src\Contrib\Configuration\Configuration\test\Masa.Contrib.Configuration.AutoMap.Tests\Masa.Contrib.Configuration.AutoMap.Tests.csproj", "{80F6E78A-4ADB-4E51-9570-A9200048F48F}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{874CD160-F058-41A2-B99F-D3A0FEC78312}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc", "src\Contrib\Configuration\ConfigurationApi\src\Masa.Contrib.Configuration.ConfigurationApi.Dcc\Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj", "{97708A6F-A6F9-4E7A-9069-65ABBBA12D06}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster.Tests", "src\Contrib\Data\Mapping\Tests\Masa.Contrib.Data.Mapping.Mapster.Tests\Masa.Contrib.Data.Mapping.Mapster.Tests.csproj", "{8E33F77D-E636-4965-87E4-00FC3823F44B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests", "src\Contrib\Configuration\ConfigurationApi\test\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests\Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj", "{85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{48853497-9C2D-4ADA-AED3-61280AF1418D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain", "src\Contrib\Ddd\Domain\src\Masa.Contrib.Ddd.Domain\Masa.Contrib.Ddd.Domain.csproj", "{6E74144B-0816-4161-AACC-8C696E0E9C34}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.csproj", "{12B05214-0AF0-45DB-B222-0AD07BC1246B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF", "src\Contrib\Ddd\Domain\src\Masa.Contrib.Ddd.Domain.Repository.EF\Masa.Contrib.Ddd.Domain.Repository.EF.csproj", "{C903135B-E0CE-4DB0-B8BF-FF59816C24D8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Cosmos", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Cosmos\Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj", "{3755B3E7-2230-4E99-B2AC-16631ACA504A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.InMemory", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.InMemory\Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj", "{C91168D6-6508-42DC-BE02-94518B6FD4FA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\Ddd\Domain\test\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{D3C16432-EAD0-4DE5-9544-16D36A67C2C2}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.MySql", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.MySql\Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj", "{1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events", "src\Contrib\Dispatcher\Events\src\Masa.Contrib.Dispatcher.Events\Masa.Contrib.Dispatcher.Events.csproj", "{F0353FB0-27F0-4957-8D69-4AEE40A09801}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Oracle", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Oracle\Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj", "{8109B615-5328-44C1-BCA2-75C65CDD714B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.Tests\Masa.Contrib.Dispatcher.Events.Tests.csproj", "{3735BFA1-F935-42EF-A316-BEEF0A138781}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj", "{A1D1F4AA-C896-481B-84F1-413A9C75AD30}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj", "{A3DE164B-54D1-440F-A9E9-19A5C667E073}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.PostgreSql", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj", "{3C360F76-87BE-46DC-BFC8-5D4E312BA854}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj", "{175CDD95-C2C2-4665-8CC3-5D1D6BC94098}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Sqlite", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Sqlite\Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj", "{17DEB82C-64B8-440E-9156-52638005FE3E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj", "{D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.SqlServer", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.SqlServer\Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj", "{4E49D00C-B324-44DF-B40D-61BF751EB199}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj", "{1BC59353-A6FF-4C0C-9B47-37884621E228}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Tests", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Tests\Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj", "{4DA0502D-7408-48D4-A94B-0A295ECDEF9A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj", "{19902ADB-7C37-4E38-ABC0-28BCDE2D164D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF", "src\Contrib\Data\UoW\Masa.Contrib.Data.UoW.EF\Masa.Contrib.Data.UoW.EF.csproj", "{95986BED-2D99-42C9-A1E1-EC5551864426}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj", "{F92CC9A7-BE67-48F3-8DAE-D59821F031FD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{627DAA58-5882-4C65-B7A1-AE16AA91E1DE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests", "src\Contrib\Dispatcher\Events\test\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj", "{CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF.Tests", "src\Contrib\Data\UoW\Tests\Masa.Contrib.Data.UoW.EF.Tests\Masa.Contrib.Data.UoW.EF.Tests.csproj", "{D40C8B63-A637-43C4-82DA-DF993597A91C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Benchmarks", "src\Contrib\Dispatcher\Events\perf\Masa.Contrib.Dispatcher.Events.Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks.csproj", "{5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain", "src\Contrib\Ddd\Domain\Masa.Contrib.Ddd.Domain\Masa.Contrib.Ddd.Domain.csproj", "{A7938858-B979-4B79-8505-FC9998832198}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents", "src\Contrib\Dispatcher\IntegrationEvents\src\Masa.Contrib.Dispatcher.IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.csproj", "{885CDA4A-9831-4159-A0A7-9062CF93180A}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Tests", "src\Contrib\Dispatcher\IntegrationEvents\test\Masa.Contrib.Dispatcher.IntegrationEvents.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj", "{60A51206-8F7F-4F43-B473-006F0DB380CB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF", "src\Contrib\Ddd\Domain\Masa.Contrib.Ddd.Domain.Repository.EF\Masa.Contrib.Ddd.Domain.Repository.EF.csproj", "{88B7B81E-1F86-4CB2-AB48-A301D2A67A40}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr", "src\Contrib\Dispatcher\IntegrationEvents\src\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj", "{51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F83E3E53-2DFE-4B1F-B988-204CA4A42572}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF", "src\Contrib\Dispatcher\IntegrationEvents\src\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj", "{B98309A2-D2D0-41BB-A7C6-8BA24B29D105}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\Ddd\Domain\Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{6DB001ED-4652-41C7-8C4A-07FF1C03266B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests", "src\Contrib\Dispatcher\IntegrationEvents\test\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj", "{682FAD0B-5989-436C-9B7D-F15F10CB90FF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events", "src\Contrib\Dispatcher\Masa.Contrib.Dispatcher.Events\Masa.Contrib.Dispatcher.Events.csproj", "{7E0946DF-53F5-45A9-97BE-779A42E34DB6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests", "src\Contrib\Dispatcher\IntegrationEvents\test\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj", "{8219C9CC-1260-4175-94E5-C36A336C8ADE}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{DAF45769-BCA5-43D6-8F04-DE7B2B98DB25}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel", "src\Contrib\Identity\IdentityModel\src\Masa.Contrib.Identity.IdentityModel\Masa.Contrib.Identity.IdentityModel.csproj", "{9A15A065-8559-49E2-8818-9E8A9186A105}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests", "src\Contrib\Dispatcher\Tests\Masa.Contrib.Dispatcher.Events.Tests\Masa.Contrib.Dispatcher.Events.Tests.csproj", "{CEA786A1-676C-42C3-9664-A73EF58256F2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel.Tests", "src\Contrib\Identity\IdentityModel\test\Masa.Contrib.Identity.IdentityModel.Tests\Masa.Contrib.Identity.IdentityModel.Tests.csproj", "{FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj", "{95FE678E-2530-4785-B553-817B80743322}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Isolation", "Isolation", "{C80C7EEF-1862-4607-8260-9FF0890DC573}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{08B138B5-2599-4F42-9584-6AE736673882}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation", "src\Contrib\Isolation\Isolation\src\Masa.Contrib.Isolation\Masa.Contrib.Isolation.csproj", "{2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj", "{C7861897-8205-43F9-B1D0-5697FB3B070E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.Tests", "src\Contrib\Isolation\Isolation\test\Masa.Contrib.Isolation.Tests\Masa.Contrib.Isolation.Tests.csproj", "{D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj", "{60C4C8A7-2F80-42B2-8797-B9984B2DB23B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MultiEnvironment", "MultiEnvironment", "{A4573B93-FE93-47A4-B700-B6B45516E7AA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj", "{531528B9-4EC2-4637-AC35-E7C4092E8779}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment", "src\Contrib\Isolation\MultiEnvironment\src\Masa.Contrib.Isolation.MultiEnvironment\Masa.Contrib.Isolation.MultiEnvironment.csproj", "{1EF70F79-B605-4729-99E7-E85386AAC649}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj", "{AC869382-6C88-4099-84EC-6D9639CA3682}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment.Tests", "src\Contrib\Isolation\MultiEnvironment\test\Masa.Contrib.Isolation.MultiEnvironment.Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj", "{2CA6351B-DEA7-4343-91C1-8C20507343EE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj", "{6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MultiTenant", "MultiTenant", "{3440FA45-ADEA-4202-AF43-62E6F5904893}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj", "{45A38571-F3B7-4F82-AD83-1BD9D74D27C2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant", "src\Contrib\Isolation\MultiTenant\src\Masa.Contrib.Isolation.MultiTenant\Masa.Contrib.Isolation.MultiTenant.csproj", "{6C1A8E47-8391-416B-9407-2A1F97A62776}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Benchmarks", "src\Contrib\Dispatcher\Tests\Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks.csproj", "{32767187-B7F0-4A67-909D-C1FB6F940FCC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant.Tests", "src\Contrib\Isolation\MultiTenant\test\Masa.Contrib.Isolation.MultiTenant.Tests\Masa.Contrib.Isolation.MultiTenant.Tests.csproj", "{E7A282E3-CC87-48C9-A80B-664A5390C715}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{08FC046F-D74F-43A6-8755-25BFC443DA96}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{26CFEFAA-EA53-4163-A2B9-4B5318AF27DD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.csproj", "{232D7F31-D44B-4333-AD95-3E48ECECF9ED}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF", "src\Contrib\Isolation\UoW\src\Masa.Contrib.Isolation.UoW.EF\Masa.Contrib.Isolation.UoW.EF.csproj", "{D3B70875-76B0-4F48-9798-4A700E4902E5}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IntegrationEvents", "IntegrationEvents", "{7526E587-5886-4681-A80A-9E34AC4312CD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Tests", "src\Contrib\Isolation\UoW\test\Masa.Contrib.Isolation.UoW.EF.Tests\Masa.Contrib.Isolation.UoW.EF.Tests.csproj", "{0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj", "{4A0491D9-F548-4367-8B96-B046A6783743}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Web.Tests", "src\Contrib\Isolation\UoW\test\Masa.Contrib.Isolation.UoW.EF.Web.Tests\Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj", "{0665C217-CDF0-4153-93DA-886230CB19CF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj", "{F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs", "src\Contrib\ReadWriteSpliting\Cqrs\src\Masa.Contrib.ReadWriteSpliting.Cqrs\Masa.Contrib.ReadWriteSpliting.Cqrs.csproj", "{88A46A64-0877-44BB-87FB-C3A046104A17}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{11B7C7BA-AF7E-4695-B244-19C8B1C23E1C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs.Tests", "src\Contrib\ReadWriteSpliting\Cqrs\test\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj", "{3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj", "{16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch", "src\Contrib\SearchEngine\AutoComplete\src\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj", "{8E8F56D5-E686-4F4A-A9AD-B81D9243B446}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj", "{1FC195D0-E126-4740-8720-09144C61EDD6}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests", "src\Contrib\SearchEngine\AutoComplete\test\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj", "{0D4A2924-A7B1-4141-9871-FF1E8B46A752}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj", "{5F1F2A46-5C4C-4D0A-8C89-73785EE41340}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs", "src\Contrib\Service\MinimalAPIs\src\Masa.Contrib.Service.MinimalAPIs\Masa.Contrib.Service.MinimalAPIs.csproj", "{0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation", "src\Contrib\Isolation\Masa.Contrib.Isolation\Masa.Contrib.Isolation.csproj", "{DE0B16D8-0EC9-4749-9E11-15CC9FA60B67}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs.Tests", "src\Contrib\Service\MinimalAPIs\test\Masa.Contrib.Service.MinimalAPIs.Tests\Masa.Contrib.Service.MinimalAPIs.Tests.csproj", "{F49D6ED6-9FD3-4C19-A30B-2C4198437D59}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment", "src\Contrib\Isolation\Masa.Contrib.Isolation.MultiEnvironment\Masa.Contrib.Isolation.MultiEnvironment.csproj", "{F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller", "src\Contrib\Service\Caller\src\Masa.Contrib.Service.Caller\Masa.Contrib.Service.Caller.csproj", "{63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant", "src\Contrib\Isolation\Masa.Contrib.Isolation.MultiTenant\Masa.Contrib.Isolation.MultiTenant.csproj", "{4870055F-F750-4EB3-BFE6-5192D17A2EAD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.DaprClient", "src\Contrib\Service\Caller\src\Masa.Contrib.Service.Caller.DaprClient\Masa.Contrib.Service.Caller.DaprClient.csproj", "{43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{174693E7-0B98-4F46-9E17-D40300C87E5F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.HttpClient", "src\Contrib\Service\Caller\src\Masa.Contrib.Service.Caller.HttpClient\Masa.Contrib.Service.Caller.HttpClient.csproj", "{7BD12A3E-CB73-4B28-9509-26BEB096ABEB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{60C0BD3E-3A4B-4C06-9AC4-07C909FCDC2D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.AutomaticCaller.Tests", "src\Contrib\Service\Caller\test\Masa.Contrib.Service.Caller.AutomaticCaller.Tests\Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj", "{BB05402F-7BE8-4965-9518-BE869ACE5EFC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF", "src\Contrib\Isolation\UoW\Masa.Contrib.Isolation.UoW.EF\Masa.Contrib.Isolation.UoW.EF.csproj", "{F7801358-1D38-4697-A185-FF9DF52F3F83}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.Tests", "src\Contrib\Service\Caller\test\Masa.Contrib.Service.Caller.Tests\Masa.Contrib.Service.Caller.Tests.csproj", "{E85AB70D-DF15-4A99-AFDA-530A5A9363FD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{BB77344E-0EE7-40BC-8EB8-47C1E41C9250}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth", "src\Contrib\StackSdks\Auth\src\Masa.Contrib.StackSdks.Auth\Masa.Contrib.StackSdks.Auth.csproj", "{5E77B9D1-80A7-4761-9431-3D9C7E25324B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EF.Tests\Masa.Contrib.Isolation.UoW.EF.Tests.csproj", "{60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth.Tests", "src\Contrib\StackSdks\Auth\test\Masa.Contrib.StackSdks.Auth.Tests\Masa.Contrib.StackSdks.Auth.Tests.csproj", "{B69BDE42-349F-4E9C-B2ED-280B907BE1AE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Web.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EF.Web.Tests\Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj", "{F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc", "src\Contrib\StackSdks\Dcc\src\Masa.Contrib.StackSdks.Dcc\Masa.Contrib.StackSdks.Dcc.csproj", "{DC60715E-80FD-4911-8A65-DC14A7A66FA9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment.Tests", "src\Contrib\Isolation\Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj", "{405EDD78-48E8-490B-AE2A-713AB89AA73E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc.Tests", "src\Contrib\StackSdks\Dcc\test\Masa.Contrib.StackSdks.Dcc.Tests\Masa.Contrib.StackSdks.Dcc.Tests.csproj", "{4BEEE39F-0760-434F-9389-6194037781DE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiTenant.Tests", "src\Contrib\Isolation\Tests\Masa.Contrib.Isolation.MultiTenant.Tests\Masa.Contrib.Isolation.MultiTenant.Tests.csproj", "{90883A71-DEF8-4B1B-98EE-5A73AA25184B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc", "src\Contrib\StackSdks\Mc\src\Masa.Contrib.StackSdks.Mc\Masa.Contrib.StackSdks.Mc.csproj", "{F201EB09-2EE2-4203-A829-044C7EC2D112}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.Tests", "src\Contrib\Isolation\Tests\Masa.Contrib.Isolation.Tests\Masa.Contrib.Isolation.Tests.csproj", "{1C11B49B-4547-4035-A9F4-7D9AB9A07431}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc.Tests", "src\Contrib\StackSdks\Mc\test\Masa.Contrib.StackSdks.Mc.Tests\Masa.Contrib.StackSdks.Mc.Tests.csproj", "{77466E5C-4DF7-4C7C-B251-689052D51B38}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs", "src\Contrib\ReadWriteSpliting\Masa.Contrib.ReadWriteSpliting.Cqrs\Masa.Contrib.ReadWriteSpliting.Cqrs.csproj", "{AF82713E-4B6C-4712-9865-06C13FF636FC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm", "src\Contrib\StackSdks\Pm\src\Masa.Contrib.StackSdks.Pm\Masa.Contrib.StackSdks.Pm.csproj", "{C650E615-4FAD-4CA9-B81C-3CF461805005}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{A1AB81FB-0FAA-4BCA-8903-F1268EEEB986}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm.Tests", "src\Contrib\StackSdks\Pm\test\Masa.Contrib.StackSdks.Pm.Tests\Masa.Contrib.StackSdks.Pm.Tests.csproj", "{0420C60C-6075-4BED-A0F0-9540A0D2CD8F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.ReadWriteSpliting.Cqrs.Tests", "src\Contrib\ReadWriteSpliting\Tests\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests\Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj", "{AE5E710D-705C-49F4-90D6-6C3C0D2C62A8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler", "src\Contrib\StackSdks\Scheduler\src\Masa.Contrib.StackSdks.Scheduler\Masa.Contrib.StackSdks.Scheduler.csproj", "{8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch", "src\Contrib\SearchEngine\AutoComplete\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj", "{984CFF2A-C321-43D5-A06C-5D053C0F97A9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler.Tests", "src\Contrib\StackSdks\Scheduler\test\Masa.Contrib.StackSdks.Scheduler.Tests\Masa.Contrib.StackSdks.Scheduler.Tests.csproj", "{254521CF-58A2-4FFB-BCA3-78B187E985DB}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AutoComplete", "AutoComplete", "{03A049F5-EC33-4BC8-8ABF-0F9185C44B3C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc", "src\Contrib\StackSdks\Tsc\src\Masa.Contrib.StackSdks.Tsc\Masa.Contrib.StackSdks.Tsc.csproj", "{3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F1FCFE10-E803-448A-AC6B-AE885EBCA363}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc.Tests", "src\Contrib\StackSdks\Tsc\test\Masa.Contrib.StackSdks.Tsc.Test\Masa.Contrib.StackSdks.Tsc.Tests.csproj", "{76251F5E-89BD-4E56-81CA-AD111361CAD4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests", "src\Contrib\SearchEngine\AutoComplete\Tests\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests\Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj", "{06087014-47B1-4FEF-BCC0-229D8FDB52FA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun", "src\Contrib\Storage\ObjectStorage\src\Masa.Contrib.Storage.ObjectStorage.Aliyun\Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj", "{F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs", "src\Contrib\Service\Masa.Contrib.Service.MinimalAPIs\Masa.Contrib.Service.MinimalAPIs.csproj", "{574693E9-B201-4392-AA03-93901A8210C3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests", "src\Contrib\Storage\ObjectStorage\test\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj", "{3211BD54-4209-428E-9F11-D2F8181A890D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{038CDBDF-3FA0-42E9-A43B-9444701BD432}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster", "src\Contrib\Data\Mapping\Mapster\src\Masa.Contrib.Data.Mapping.Mapster\Masa.Contrib.Data.Mapping.Mapster.csproj", "{9815A23B-6101-4C13-89CA-A07B85623E0E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.MinimalAPIs.Tests", "src\Contrib\Service\Tests\Masa.Contrib.Service.MinimalAPIs.Tests\Masa.Contrib.Service.MinimalAPIs.Tests.csproj", "{D3DF1F38-4108-460B-8517-40855445ADBF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster.Tests", "src\Contrib\Data\Mapping\Mapster\test\Masa.Contrib.Data.Mapping.Mapster.Tests\Masa.Contrib.Data.Mapping.Mapster.Tests.csproj", "{88C1C77A-0F9F-436B-98FB-E696F35EB62E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller", "src\Contrib\Service\Caller\Masa.Contrib.Service.Caller\Masa.Contrib.Service.Caller.csproj", "{E2BA1D48-CC32-4FB3-A1C1-200291604881}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Oidc", "Oidc", "{A88DBDC2-DB29-4F80-82BB-B8D511E4A495}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caller", "Caller", "{68491FED-7441-4B58-989D-DF6F198FC91A}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Authentication", "Authentication", "{77EE6274-B332-4DA0-8AF1-73EE3561AA47}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.DaprClient", "src\Contrib\Service\Caller\Masa.Contrib.Service.Caller.DaprClient\Masa.Contrib.Service.Caller.DaprClient.csproj", "{0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication", "src\Utils\Security\Authentication\Authentication\src\Masa.Utils.Security.Authentication\Masa.Utils.Security.Authentication.csproj", "{B111B6B8-DC60-4D9D-896C-EE52B834A3DB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.HttpClient", "src\Contrib\Service\Caller\Masa.Contrib.Service.Caller.HttpClient\Masa.Contrib.Service.Caller.HttpClient.csproj", "{22BE7D35-34C4-49FA-B20E-B69289C10B5E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Authentication.OpenIdConnect", "src\Utils\Security\Authentication\OpenIdConnect\src\Masa.Utils.Security.Authentication.OpenIdConnect\Masa.Utils.Security.Authentication.OpenIdConnect.csproj", "{7836A5A0-798F-4167-818C-EA770135D1B0}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{2959DC55-E0E6-42D7-9DD1-9DE14841EF63}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenIdConnect", "OpenIdConnect", "{2449469D-7B4C-4A4E-936B-E6653E08EDC6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.Tests", "src\Contrib\Service\Caller\Tests\Masa.Contrib.Service.Caller.Tests\Masa.Contrib.Service.Caller.Tests.csproj", "{694CACC8-59E8-49F6-832E-A30833E139DF}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cryptography", "Cryptography", "{64F32D02-05E0-43D3-BCD5-578D4D5620DD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Service.Caller.AutomaticCaller.Tests", "src\Contrib\Service\Caller\Tests\Scenes\Masa.Contrib.Service.Caller.AutomaticCaller.Tests\Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj", "{246399F8-F0A6-4B23-8995-88574FA5CA05}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Token", "Token", "{DE8CDE2C-F7D3-4515-9231-28FD787118DD}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{E8681596-D4BF-484A-A428-06D749FD4C5D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography", "src\Utils\Security\Cryptography\src\Masa.Utils.Security.Cryptography\Masa.Utils.Security.Cryptography.csproj", "{358C26DC-44F6-4177-9035-9574A87DD422}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth", "src\Contrib\StackSdks\Masa.Contrib.StackSdks.Auth\Masa.Contrib.StackSdks.Auth.csproj", "{F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Cryptography.Tests", "src\Utils\Security\Cryptography\test\Masa.Utils.Security.Cryptography.Tests\Masa.Utils.Security.Cryptography.Tests.csproj", "{A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc", "src\Contrib\StackSdks\Masa.Contrib.StackSdks.Dcc\Masa.Contrib.StackSdks.Dcc.csproj", "{A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Utils.Security.Token", "src\Utils\Security\Token\src\Masa.Utils.Security.Token\Masa.Utils.Security.Token.csproj", "{94667017-2F5A-49DF-850B-238EB0C7E17D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc", "src\Contrib\StackSdks\Masa.Contrib.StackSdks.Mc\Masa.Contrib.StackSdks.Mc.csproj", "{9BD06CA5-0169-418B-A8C8-60584EEDCEFE}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cache", "Cache", "{2E7704B8-3E6A-4F0B-ABA8-D28732C9A88A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm", "src\Contrib\StackSdks\Masa.Contrib.StackSdks.Pm\Masa.Contrib.StackSdks.Pm.csproj", "{22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{21E669BD-CF41-41F0-BACF-E03629F1C0AA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler", "src\Contrib\StackSdks\Masa.Contrib.StackSdks.Scheduler\Masa.Contrib.StackSdks.Scheduler.csproj", "{8E7F9812-2DF1-483C-93AB-F8BBC18D9761}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Models", "Models", "{503812F4-2C93-4C8C-85C0-6CDF8FADE897}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc", "src\Contrib\StackSdks\Masa.Contrib.StackSdks.Tsc\Masa.Contrib.StackSdks.Tsc.csproj", "{D4D2DA65-D16D-4236-ABD0-492681944D00}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{3801D850-9F29-451E-84FD-A85192195CD7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{EC7A08E9-3355-486B-BA30-41A1F8CAC5F5}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Cache", "src\BuildingBlocks\Authentication\Oidc\Cache\src\Masa.BuildingBlocks.Authentication.Oidc.Cache\Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj", "{B795CBE6-3AAA-481E-85F6-C406C15AA586}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Auth.Tests", "src\Contrib\StackSdks\Tests\Masa.Contrib.StackSdks.Auth.Tests\Masa.Contrib.StackSdks.Auth.Tests.csproj", "{5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\BuildingBlocks\Authentication\Oidc\Domain\src\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{6C7C865D-F813-4CCB-9256-81F8FB511888}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Dcc.Tests", "src\Contrib\StackSdks\Tests\Masa.Contrib.StackSdks.Dcc.Tests\Masa.Contrib.StackSdks.Dcc.Tests.csproj", "{74149D50-9DED-45D7-9C52-5F74BEE6B80D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\BuildingBlocks\Authentication\Oidc\Models\src\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{53574F47-0E4E-4317-8E14-D8BCD2EDFD57}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Mc.Tests", "src\Contrib\StackSdks\Tests\Masa.Contrib.StackSdks.Mc.Tests\Masa.Contrib.StackSdks.Mc.Tests.csproj", "{975AAE87-E410-4FFF-8A9E-6FD7E020A3C9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\BuildingBlocks\Authentication\Oidc\Storage\src\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{46AB3663-0FE2-4E44-A9FD-67AFA69611C6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Pm.Tests", "src\Contrib\StackSdks\Tests\Masa.Contrib.StackSdks.Pm.Tests\Masa.Contrib.StackSdks.Pm.Tests.csproj", "{373F9664-5B59-4068-B1E2-61CDD3B2F760}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{85316CEE-D995-44FF-A10D-4B23E983910C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Scheduler.Tests", "src\Contrib\StackSdks\Tests\Masa.Contrib.StackSdks.Scheduler.Tests\Masa.Contrib.StackSdks.Scheduler.Tests.csproj", "{950FE681-764C-4B75-BB95-938A9F17B2D9}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cache", "Cache", "{2B38DDA0-4007-4BA3-93B4-017071E68E19}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.StackSdks.Tsc.Tests", "src\Contrib\StackSdks\Tests\Masa.Contrib.StackSdks.Tsc.Test\Masa.Contrib.StackSdks.Tsc.Tests.csproj", "{F110D91A-F1A9-4627-85C8-501F814FED26}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{2E319AE8-ACC3-49AD-A9F4-E0FAFBECAFF4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun", "src\Contrib\Storage\ObjectStorage\Masa.Contrib.Storage.ObjectStorage.Aliyun\Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj", "{16B18299-3640-4FA8-A4E6-74B1EB741301}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache", "src\Contrib\Authentication\Oidc\Cache\src\Masa.Contrib.Authentication.Oidc.Cache\Masa.Contrib.Authentication.Oidc.Cache.csproj", "{6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ObjectStorage", "ObjectStorage", "{1B2FF31A-187A-4D36-AD81-1ABD9BCF9044}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.EntityFrameworkCore", "src\Contrib\Authentication\Oidc\EntityFrameworkCore\src\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj", "{15698F80-DFB5-485A-9B76-074ACA1A7D8D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4231AB12-3FB7-408E-B7C2-9CC0FFB710B1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache.Storage", "src\Contrib\Authentication\Oidc\Storage\src\Masa.Contrib.Authentication.Oidc.Cache.Storage\Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj", "{12D7F445-1A22-4695-B174-6FC44C806377}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests", "src\Contrib\Storage\ObjectStorage\Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj", "{C65638DC-2418-4453-917F-9FA8D068594E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -567,1597 +549,1596 @@ Global {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|Any CPU.Build.0 = Release|Any CPU {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|x64.ActiveCfg = Release|Any CPU {BDA1DB4F-C408-445D-9391-EC9765CF7349}.Release|x64.Build.0 = Release|Any CPU - {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Debug|x64.ActiveCfg = Debug|Any CPU - {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Debug|x64.Build.0 = Debug|Any CPU - {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Release|Any CPU.Build.0 = Release|Any CPU - {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Release|x64.ActiveCfg = Release|Any CPU - {A91E96C6-9437-4335-A629-D4B3E921F9E8}.Release|x64.Build.0 = Release|Any CPU - {78D31C12-2E54-4C66-9849-B9664B9A5897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78D31C12-2E54-4C66-9849-B9664B9A5897}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78D31C12-2E54-4C66-9849-B9664B9A5897}.Debug|x64.ActiveCfg = Debug|Any CPU - {78D31C12-2E54-4C66-9849-B9664B9A5897}.Debug|x64.Build.0 = Debug|Any CPU - {78D31C12-2E54-4C66-9849-B9664B9A5897}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78D31C12-2E54-4C66-9849-B9664B9A5897}.Release|Any CPU.Build.0 = Release|Any CPU - {78D31C12-2E54-4C66-9849-B9664B9A5897}.Release|x64.ActiveCfg = Release|Any CPU - {78D31C12-2E54-4C66-9849-B9664B9A5897}.Release|x64.Build.0 = Release|Any CPU - {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Debug|Any CPU.Build.0 = Debug|Any CPU - {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Debug|x64.ActiveCfg = Debug|Any CPU - {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Debug|x64.Build.0 = Debug|Any CPU - {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Release|Any CPU.ActiveCfg = Release|Any CPU - {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Release|Any CPU.Build.0 = Release|Any CPU - {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Release|x64.ActiveCfg = Release|Any CPU - {03C37CB5-A325-4CB0-965A-A5FD67D14091}.Release|x64.Build.0 = Release|Any CPU - {BDA33777-F759-4050-85F5-68EB4996ADD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDA33777-F759-4050-85F5-68EB4996ADD7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDA33777-F759-4050-85F5-68EB4996ADD7}.Debug|x64.ActiveCfg = Debug|Any CPU - {BDA33777-F759-4050-85F5-68EB4996ADD7}.Debug|x64.Build.0 = Debug|Any CPU - {BDA33777-F759-4050-85F5-68EB4996ADD7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDA33777-F759-4050-85F5-68EB4996ADD7}.Release|Any CPU.Build.0 = Release|Any CPU - {BDA33777-F759-4050-85F5-68EB4996ADD7}.Release|x64.ActiveCfg = Release|Any CPU - {BDA33777-F759-4050-85F5-68EB4996ADD7}.Release|x64.Build.0 = Release|Any CPU - {A71C1D90-5513-4255-84A0-32384474E82C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A71C1D90-5513-4255-84A0-32384474E82C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A71C1D90-5513-4255-84A0-32384474E82C}.Debug|x64.ActiveCfg = Debug|Any CPU - {A71C1D90-5513-4255-84A0-32384474E82C}.Debug|x64.Build.0 = Debug|Any CPU - {A71C1D90-5513-4255-84A0-32384474E82C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A71C1D90-5513-4255-84A0-32384474E82C}.Release|Any CPU.Build.0 = Release|Any CPU - {A71C1D90-5513-4255-84A0-32384474E82C}.Release|x64.ActiveCfg = Release|Any CPU - {A71C1D90-5513-4255-84A0-32384474E82C}.Release|x64.Build.0 = Release|Any CPU - {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Debug|x64.ActiveCfg = Debug|Any CPU - {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Debug|x64.Build.0 = Debug|Any CPU - {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Release|Any CPU.Build.0 = Release|Any CPU - {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Release|x64.ActiveCfg = Release|Any CPU - {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43}.Release|x64.Build.0 = Release|Any CPU - {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Debug|x64.Build.0 = Debug|Any CPU - {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Release|Any CPU.Build.0 = Release|Any CPU - {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Release|x64.ActiveCfg = Release|Any CPU - {AC537AD9-9CC3-420F-A17C-D77C4069A576}.Release|x64.Build.0 = Release|Any CPU - {617653DE-4377-4428-954B-E5FB4690E875}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {617653DE-4377-4428-954B-E5FB4690E875}.Debug|Any CPU.Build.0 = Debug|Any CPU - {617653DE-4377-4428-954B-E5FB4690E875}.Debug|x64.ActiveCfg = Debug|Any CPU - {617653DE-4377-4428-954B-E5FB4690E875}.Debug|x64.Build.0 = Debug|Any CPU - {617653DE-4377-4428-954B-E5FB4690E875}.Release|Any CPU.ActiveCfg = Release|Any CPU - {617653DE-4377-4428-954B-E5FB4690E875}.Release|Any CPU.Build.0 = Release|Any CPU - {617653DE-4377-4428-954B-E5FB4690E875}.Release|x64.ActiveCfg = Release|Any CPU - {617653DE-4377-4428-954B-E5FB4690E875}.Release|x64.Build.0 = Release|Any CPU - {741E75F7-9286-4C01-8C67-AA8515670DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {741E75F7-9286-4C01-8C67-AA8515670DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {741E75F7-9286-4C01-8C67-AA8515670DF7}.Debug|x64.ActiveCfg = Debug|Any CPU - {741E75F7-9286-4C01-8C67-AA8515670DF7}.Debug|x64.Build.0 = Debug|Any CPU - {741E75F7-9286-4C01-8C67-AA8515670DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {741E75F7-9286-4C01-8C67-AA8515670DF7}.Release|Any CPU.Build.0 = Release|Any CPU - {741E75F7-9286-4C01-8C67-AA8515670DF7}.Release|x64.ActiveCfg = Release|Any CPU - {741E75F7-9286-4C01-8C67-AA8515670DF7}.Release|x64.Build.0 = Release|Any CPU - {404CD919-D15D-49D6-8D26-E96486E62700}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {404CD919-D15D-49D6-8D26-E96486E62700}.Debug|Any CPU.Build.0 = Debug|Any CPU - {404CD919-D15D-49D6-8D26-E96486E62700}.Debug|x64.ActiveCfg = Debug|Any CPU - {404CD919-D15D-49D6-8D26-E96486E62700}.Debug|x64.Build.0 = Debug|Any CPU - {404CD919-D15D-49D6-8D26-E96486E62700}.Release|Any CPU.ActiveCfg = Release|Any CPU - {404CD919-D15D-49D6-8D26-E96486E62700}.Release|Any CPU.Build.0 = Release|Any CPU - {404CD919-D15D-49D6-8D26-E96486E62700}.Release|x64.ActiveCfg = Release|Any CPU - {404CD919-D15D-49D6-8D26-E96486E62700}.Release|x64.Build.0 = Release|Any CPU - {47597D41-C795-43FE-8B76-069D9E1C364C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47597D41-C795-43FE-8B76-069D9E1C364C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47597D41-C795-43FE-8B76-069D9E1C364C}.Debug|x64.ActiveCfg = Debug|Any CPU - {47597D41-C795-43FE-8B76-069D9E1C364C}.Debug|x64.Build.0 = Debug|Any CPU - {47597D41-C795-43FE-8B76-069D9E1C364C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47597D41-C795-43FE-8B76-069D9E1C364C}.Release|Any CPU.Build.0 = Release|Any CPU - {47597D41-C795-43FE-8B76-069D9E1C364C}.Release|x64.ActiveCfg = Release|Any CPU - {47597D41-C795-43FE-8B76-069D9E1C364C}.Release|x64.Build.0 = Release|Any CPU - {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Debug|x64.ActiveCfg = Debug|Any CPU - {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Debug|x64.Build.0 = Debug|Any CPU - {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Release|Any CPU.Build.0 = Release|Any CPU - {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Release|x64.ActiveCfg = Release|Any CPU - {3E9E2661-DDD6-4D33-BCA7-EA07784F6723}.Release|x64.Build.0 = Release|Any CPU - {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Debug|x64.ActiveCfg = Debug|Any CPU - {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Debug|x64.Build.0 = Debug|Any CPU - {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Release|Any CPU.Build.0 = Release|Any CPU - {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Release|x64.ActiveCfg = Release|Any CPU - {3FCB8575-6211-4E91-BCF8-1D2D380843B9}.Release|x64.Build.0 = Release|Any CPU - {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Debug|x64.ActiveCfg = Debug|Any CPU - {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Debug|x64.Build.0 = Debug|Any CPU - {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Release|Any CPU.Build.0 = Release|Any CPU - {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Release|x64.ActiveCfg = Release|Any CPU - {3016EDC5-4BE6-4CE2-8B18-6EE226920393}.Release|x64.Build.0 = Release|Any CPU - {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Debug|x64.ActiveCfg = Debug|Any CPU - {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Debug|x64.Build.0 = Debug|Any CPU - {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Release|Any CPU.Build.0 = Release|Any CPU - {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Release|x64.ActiveCfg = Release|Any CPU - {2809DB8A-95FA-4330-97C7-4A4936CD0EA9}.Release|x64.Build.0 = Release|Any CPU - {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Debug|x64.ActiveCfg = Debug|Any CPU - {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Debug|x64.Build.0 = Debug|Any CPU - {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Release|Any CPU.Build.0 = Release|Any CPU - {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Release|x64.ActiveCfg = Release|Any CPU - {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B}.Release|x64.Build.0 = Release|Any CPU - {45BAE42F-4801-4758-9CDA-0D900C734369}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {45BAE42F-4801-4758-9CDA-0D900C734369}.Debug|Any CPU.Build.0 = Debug|Any CPU - {45BAE42F-4801-4758-9CDA-0D900C734369}.Debug|x64.ActiveCfg = Debug|Any CPU - {45BAE42F-4801-4758-9CDA-0D900C734369}.Debug|x64.Build.0 = Debug|Any CPU - {45BAE42F-4801-4758-9CDA-0D900C734369}.Release|Any CPU.ActiveCfg = Release|Any CPU - {45BAE42F-4801-4758-9CDA-0D900C734369}.Release|Any CPU.Build.0 = Release|Any CPU - {45BAE42F-4801-4758-9CDA-0D900C734369}.Release|x64.ActiveCfg = Release|Any CPU - {45BAE42F-4801-4758-9CDA-0D900C734369}.Release|x64.Build.0 = Release|Any CPU - {9DE85526-8B33-4291-B285-4BECF431D6FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9DE85526-8B33-4291-B285-4BECF431D6FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9DE85526-8B33-4291-B285-4BECF431D6FA}.Debug|x64.ActiveCfg = Debug|Any CPU - {9DE85526-8B33-4291-B285-4BECF431D6FA}.Debug|x64.Build.0 = Debug|Any CPU - {9DE85526-8B33-4291-B285-4BECF431D6FA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9DE85526-8B33-4291-B285-4BECF431D6FA}.Release|Any CPU.Build.0 = Release|Any CPU - {9DE85526-8B33-4291-B285-4BECF431D6FA}.Release|x64.ActiveCfg = Release|Any CPU - {9DE85526-8B33-4291-B285-4BECF431D6FA}.Release|x64.Build.0 = Release|Any CPU - {DCA283C7-2492-4461-BD34-AB00191C46F7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCA283C7-2492-4461-BD34-AB00191C46F7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCA283C7-2492-4461-BD34-AB00191C46F7}.Debug|x64.ActiveCfg = Debug|Any CPU - {DCA283C7-2492-4461-BD34-AB00191C46F7}.Debug|x64.Build.0 = Debug|Any CPU - {DCA283C7-2492-4461-BD34-AB00191C46F7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCA283C7-2492-4461-BD34-AB00191C46F7}.Release|Any CPU.Build.0 = Release|Any CPU - {DCA283C7-2492-4461-BD34-AB00191C46F7}.Release|x64.ActiveCfg = Release|Any CPU - {DCA283C7-2492-4461-BD34-AB00191C46F7}.Release|x64.Build.0 = Release|Any CPU - {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Debug|x64.ActiveCfg = Debug|Any CPU - {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Debug|x64.Build.0 = Debug|Any CPU - {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Release|Any CPU.Build.0 = Release|Any CPU - {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Release|x64.ActiveCfg = Release|Any CPU - {1EF25877-2E8F-4FF1-A530-F3DEB512E238}.Release|x64.Build.0 = Release|Any CPU - {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Debug|x64.ActiveCfg = Debug|Any CPU - {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Debug|x64.Build.0 = Debug|Any CPU - {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Release|Any CPU.Build.0 = Release|Any CPU - {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Release|x64.ActiveCfg = Release|Any CPU - {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26}.Release|x64.Build.0 = Release|Any CPU - {06918731-F657-417E-A74D-E2D7E77351B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {06918731-F657-417E-A74D-E2D7E77351B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {06918731-F657-417E-A74D-E2D7E77351B1}.Debug|x64.ActiveCfg = Debug|Any CPU - {06918731-F657-417E-A74D-E2D7E77351B1}.Debug|x64.Build.0 = Debug|Any CPU - {06918731-F657-417E-A74D-E2D7E77351B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {06918731-F657-417E-A74D-E2D7E77351B1}.Release|Any CPU.Build.0 = Release|Any CPU - {06918731-F657-417E-A74D-E2D7E77351B1}.Release|x64.ActiveCfg = Release|Any CPU - {06918731-F657-417E-A74D-E2D7E77351B1}.Release|x64.Build.0 = Release|Any CPU - {1818788E-7C68-4280-93A8-63D01168C6B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1818788E-7C68-4280-93A8-63D01168C6B6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1818788E-7C68-4280-93A8-63D01168C6B6}.Debug|x64.ActiveCfg = Debug|Any CPU - {1818788E-7C68-4280-93A8-63D01168C6B6}.Debug|x64.Build.0 = Debug|Any CPU - {1818788E-7C68-4280-93A8-63D01168C6B6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1818788E-7C68-4280-93A8-63D01168C6B6}.Release|Any CPU.Build.0 = Release|Any CPU - {1818788E-7C68-4280-93A8-63D01168C6B6}.Release|x64.ActiveCfg = Release|Any CPU - {1818788E-7C68-4280-93A8-63D01168C6B6}.Release|x64.Build.0 = Release|Any CPU - {872994E4-7D87-483A-B6DD-E68DE4526497}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {872994E4-7D87-483A-B6DD-E68DE4526497}.Debug|Any CPU.Build.0 = Debug|Any CPU - {872994E4-7D87-483A-B6DD-E68DE4526497}.Debug|x64.ActiveCfg = Debug|Any CPU - {872994E4-7D87-483A-B6DD-E68DE4526497}.Debug|x64.Build.0 = Debug|Any CPU - {872994E4-7D87-483A-B6DD-E68DE4526497}.Release|Any CPU.ActiveCfg = Release|Any CPU - {872994E4-7D87-483A-B6DD-E68DE4526497}.Release|Any CPU.Build.0 = Release|Any CPU - {872994E4-7D87-483A-B6DD-E68DE4526497}.Release|x64.ActiveCfg = Release|Any CPU - {872994E4-7D87-483A-B6DD-E68DE4526497}.Release|x64.Build.0 = Release|Any CPU - {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Debug|x64.ActiveCfg = Debug|Any CPU - {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Debug|x64.Build.0 = Debug|Any CPU - {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Release|Any CPU.Build.0 = Release|Any CPU - {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Release|x64.ActiveCfg = Release|Any CPU - {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED}.Release|x64.Build.0 = Release|Any CPU - {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Debug|x64.ActiveCfg = Debug|Any CPU - {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Debug|x64.Build.0 = Debug|Any CPU - {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Release|Any CPU.Build.0 = Release|Any CPU - {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Release|x64.ActiveCfg = Release|Any CPU - {C7A93ED9-5D0B-4F32-AA8A-69A515C32342}.Release|x64.Build.0 = Release|Any CPU - {8B0D2243-5E00-472E-82EC-572905A373AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8B0D2243-5E00-472E-82EC-572905A373AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8B0D2243-5E00-472E-82EC-572905A373AF}.Debug|x64.ActiveCfg = Debug|Any CPU - {8B0D2243-5E00-472E-82EC-572905A373AF}.Debug|x64.Build.0 = Debug|Any CPU - {8B0D2243-5E00-472E-82EC-572905A373AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8B0D2243-5E00-472E-82EC-572905A373AF}.Release|Any CPU.Build.0 = Release|Any CPU - {8B0D2243-5E00-472E-82EC-572905A373AF}.Release|x64.ActiveCfg = Release|Any CPU - {8B0D2243-5E00-472E-82EC-572905A373AF}.Release|x64.Build.0 = Release|Any CPU - {94F98C15-6E92-466A-A93D-EB37CC877F99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94F98C15-6E92-466A-A93D-EB37CC877F99}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94F98C15-6E92-466A-A93D-EB37CC877F99}.Debug|x64.ActiveCfg = Debug|Any CPU - {94F98C15-6E92-466A-A93D-EB37CC877F99}.Debug|x64.Build.0 = Debug|Any CPU - {94F98C15-6E92-466A-A93D-EB37CC877F99}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94F98C15-6E92-466A-A93D-EB37CC877F99}.Release|Any CPU.Build.0 = Release|Any CPU - {94F98C15-6E92-466A-A93D-EB37CC877F99}.Release|x64.ActiveCfg = Release|Any CPU - {94F98C15-6E92-466A-A93D-EB37CC877F99}.Release|x64.Build.0 = Release|Any CPU - {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Debug|x64.ActiveCfg = Debug|Any CPU - {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Debug|x64.Build.0 = Debug|Any CPU - {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Release|Any CPU.Build.0 = Release|Any CPU - {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Release|x64.ActiveCfg = Release|Any CPU - {6920A090-9B17-4C6B-B86D-7807C7D32BA0}.Release|x64.Build.0 = Release|Any CPU - {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Debug|x64.ActiveCfg = Debug|Any CPU - {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Debug|x64.Build.0 = Debug|Any CPU - {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Release|Any CPU.Build.0 = Release|Any CPU - {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Release|x64.ActiveCfg = Release|Any CPU - {DA7F5603-FEC0-4090-9561-77B317D9EFA4}.Release|x64.Build.0 = Release|Any CPU - {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Debug|x64.ActiveCfg = Debug|Any CPU - {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Debug|x64.Build.0 = Debug|Any CPU - {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Release|Any CPU.Build.0 = Release|Any CPU - {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Release|x64.ActiveCfg = Release|Any CPU - {E48D5AFE-8392-46D4-92C5-E3C6332035AB}.Release|x64.Build.0 = Release|Any CPU - {84B7A048-5B99-429A-8322-0DE98560C2D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84B7A048-5B99-429A-8322-0DE98560C2D0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84B7A048-5B99-429A-8322-0DE98560C2D0}.Debug|x64.ActiveCfg = Debug|Any CPU - {84B7A048-5B99-429A-8322-0DE98560C2D0}.Debug|x64.Build.0 = Debug|Any CPU - {84B7A048-5B99-429A-8322-0DE98560C2D0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84B7A048-5B99-429A-8322-0DE98560C2D0}.Release|Any CPU.Build.0 = Release|Any CPU - {84B7A048-5B99-429A-8322-0DE98560C2D0}.Release|x64.ActiveCfg = Release|Any CPU - {84B7A048-5B99-429A-8322-0DE98560C2D0}.Release|x64.Build.0 = Release|Any CPU - {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Debug|x64.ActiveCfg = Debug|Any CPU - {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Debug|x64.Build.0 = Debug|Any CPU - {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Release|Any CPU.Build.0 = Release|Any CPU - {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Release|x64.ActiveCfg = Release|Any CPU - {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791}.Release|x64.Build.0 = Release|Any CPU - {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Debug|Any CPU.Build.0 = Debug|Any CPU - {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Debug|x64.ActiveCfg = Debug|Any CPU - {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Debug|x64.Build.0 = Debug|Any CPU - {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Release|Any CPU.ActiveCfg = Release|Any CPU - {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Release|Any CPU.Build.0 = Release|Any CPU - {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Release|x64.ActiveCfg = Release|Any CPU - {074FE1B1-CC4A-4E2F-88FB-BD0131C88306}.Release|x64.Build.0 = Release|Any CPU - {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Debug|x64.ActiveCfg = Debug|Any CPU - {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Debug|x64.Build.0 = Debug|Any CPU - {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Release|Any CPU.Build.0 = Release|Any CPU - {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Release|x64.ActiveCfg = Release|Any CPU - {C9FF6E3A-B173-4070-8DA8-84EDE6F77298}.Release|x64.Build.0 = Release|Any CPU - {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Debug|x64.ActiveCfg = Debug|Any CPU - {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Debug|x64.Build.0 = Debug|Any CPU - {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Release|Any CPU.Build.0 = Release|Any CPU - {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Release|x64.ActiveCfg = Release|Any CPU - {C598E4D8-634C-40B2-BD77-ED69AD4BF211}.Release|x64.Build.0 = Release|Any CPU - {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Debug|x64.ActiveCfg = Debug|Any CPU - {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Debug|x64.Build.0 = Debug|Any CPU - {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Release|Any CPU.Build.0 = Release|Any CPU - {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Release|x64.ActiveCfg = Release|Any CPU - {5238486B-2E9E-44CE-84BC-1BF55AB59EE5}.Release|x64.Build.0 = Release|Any CPU - {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Debug|x64.ActiveCfg = Debug|Any CPU - {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Debug|x64.Build.0 = Debug|Any CPU - {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Release|Any CPU.Build.0 = Release|Any CPU - {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Release|x64.ActiveCfg = Release|Any CPU - {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8}.Release|x64.Build.0 = Release|Any CPU - {29071256-A255-4881-8BF7-63EA598313F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {29071256-A255-4881-8BF7-63EA598313F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {29071256-A255-4881-8BF7-63EA598313F8}.Debug|x64.ActiveCfg = Debug|Any CPU - {29071256-A255-4881-8BF7-63EA598313F8}.Debug|x64.Build.0 = Debug|Any CPU - {29071256-A255-4881-8BF7-63EA598313F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {29071256-A255-4881-8BF7-63EA598313F8}.Release|Any CPU.Build.0 = Release|Any CPU - {29071256-A255-4881-8BF7-63EA598313F8}.Release|x64.ActiveCfg = Release|Any CPU - {29071256-A255-4881-8BF7-63EA598313F8}.Release|x64.Build.0 = Release|Any CPU - {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Debug|x64.ActiveCfg = Debug|Any CPU - {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Debug|x64.Build.0 = Debug|Any CPU - {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Release|Any CPU.Build.0 = Release|Any CPU - {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Release|x64.ActiveCfg = Release|Any CPU - {4CE43CE6-A150-44B9-9896-EB5D28B994B0}.Release|x64.Build.0 = Release|Any CPU - {747A2EBA-BF28-4153-BF03-3300DA570061}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {747A2EBA-BF28-4153-BF03-3300DA570061}.Debug|Any CPU.Build.0 = Debug|Any CPU - {747A2EBA-BF28-4153-BF03-3300DA570061}.Debug|x64.ActiveCfg = Debug|Any CPU - {747A2EBA-BF28-4153-BF03-3300DA570061}.Debug|x64.Build.0 = Debug|Any CPU - {747A2EBA-BF28-4153-BF03-3300DA570061}.Release|Any CPU.ActiveCfg = Release|Any CPU - {747A2EBA-BF28-4153-BF03-3300DA570061}.Release|Any CPU.Build.0 = Release|Any CPU - {747A2EBA-BF28-4153-BF03-3300DA570061}.Release|x64.ActiveCfg = Release|Any CPU - {747A2EBA-BF28-4153-BF03-3300DA570061}.Release|x64.Build.0 = Release|Any CPU - {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Debug|x64.ActiveCfg = Debug|Any CPU - {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Debug|x64.Build.0 = Debug|Any CPU - {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Release|Any CPU.Build.0 = Release|Any CPU - {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Release|x64.ActiveCfg = Release|Any CPU - {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5}.Release|x64.Build.0 = Release|Any CPU - {6521511B-CE2E-485D-B72C-C22D89A191A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6521511B-CE2E-485D-B72C-C22D89A191A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6521511B-CE2E-485D-B72C-C22D89A191A2}.Debug|x64.ActiveCfg = Debug|Any CPU - {6521511B-CE2E-485D-B72C-C22D89A191A2}.Debug|x64.Build.0 = Debug|Any CPU - {6521511B-CE2E-485D-B72C-C22D89A191A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6521511B-CE2E-485D-B72C-C22D89A191A2}.Release|Any CPU.Build.0 = Release|Any CPU - {6521511B-CE2E-485D-B72C-C22D89A191A2}.Release|x64.ActiveCfg = Release|Any CPU - {6521511B-CE2E-485D-B72C-C22D89A191A2}.Release|x64.Build.0 = Release|Any CPU - {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Debug|x64.ActiveCfg = Debug|Any CPU - {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Debug|x64.Build.0 = Debug|Any CPU - {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Release|Any CPU.Build.0 = Release|Any CPU - {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Release|x64.ActiveCfg = Release|Any CPU - {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA}.Release|x64.Build.0 = Release|Any CPU - {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Debug|x64.ActiveCfg = Debug|Any CPU - {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Debug|x64.Build.0 = Debug|Any CPU - {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Release|Any CPU.Build.0 = Release|Any CPU - {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Release|x64.ActiveCfg = Release|Any CPU - {6A44C395-D619-496E-A5A8-8F8FFA51177A}.Release|x64.Build.0 = Release|Any CPU - {93510E80-4378-4504-A220-C71D0A61ADD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {93510E80-4378-4504-A220-C71D0A61ADD6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {93510E80-4378-4504-A220-C71D0A61ADD6}.Debug|x64.ActiveCfg = Debug|Any CPU - {93510E80-4378-4504-A220-C71D0A61ADD6}.Debug|x64.Build.0 = Debug|Any CPU - {93510E80-4378-4504-A220-C71D0A61ADD6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {93510E80-4378-4504-A220-C71D0A61ADD6}.Release|Any CPU.Build.0 = Release|Any CPU - {93510E80-4378-4504-A220-C71D0A61ADD6}.Release|x64.ActiveCfg = Release|Any CPU - {93510E80-4378-4504-A220-C71D0A61ADD6}.Release|x64.Build.0 = Release|Any CPU - {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Debug|x64.ActiveCfg = Debug|Any CPU - {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Debug|x64.Build.0 = Debug|Any CPU - {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Release|Any CPU.Build.0 = Release|Any CPU - {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Release|x64.ActiveCfg = Release|Any CPU - {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6}.Release|x64.Build.0 = Release|Any CPU - {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Debug|x64.ActiveCfg = Debug|Any CPU - {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Debug|x64.Build.0 = Debug|Any CPU - {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Release|Any CPU.Build.0 = Release|Any CPU - {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Release|x64.ActiveCfg = Release|Any CPU - {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0}.Release|x64.Build.0 = Release|Any CPU - {D66370B6-8E54-4E95-92CD-81236916A4D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D66370B6-8E54-4E95-92CD-81236916A4D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D66370B6-8E54-4E95-92CD-81236916A4D1}.Debug|x64.ActiveCfg = Debug|Any CPU - {D66370B6-8E54-4E95-92CD-81236916A4D1}.Debug|x64.Build.0 = Debug|Any CPU - {D66370B6-8E54-4E95-92CD-81236916A4D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D66370B6-8E54-4E95-92CD-81236916A4D1}.Release|Any CPU.Build.0 = Release|Any CPU - {D66370B6-8E54-4E95-92CD-81236916A4D1}.Release|x64.ActiveCfg = Release|Any CPU - {D66370B6-8E54-4E95-92CD-81236916A4D1}.Release|x64.Build.0 = Release|Any CPU - {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Debug|x64.ActiveCfg = Debug|Any CPU - {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Debug|x64.Build.0 = Debug|Any CPU - {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Release|Any CPU.Build.0 = Release|Any CPU - {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Release|x64.ActiveCfg = Release|Any CPU - {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0}.Release|x64.Build.0 = Release|Any CPU - {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Debug|x64.ActiveCfg = Debug|Any CPU - {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Debug|x64.Build.0 = Debug|Any CPU - {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Release|Any CPU.Build.0 = Release|Any CPU - {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Release|x64.ActiveCfg = Release|Any CPU - {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923}.Release|x64.Build.0 = Release|Any CPU - {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Debug|x64.ActiveCfg = Debug|Any CPU - {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Debug|x64.Build.0 = Debug|Any CPU - {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Release|Any CPU.Build.0 = Release|Any CPU - {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Release|x64.ActiveCfg = Release|Any CPU - {A2707F9F-80CC-41F9-9ED6-B45E5732CC56}.Release|x64.Build.0 = Release|Any CPU - {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Debug|x64.ActiveCfg = Debug|Any CPU - {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Debug|x64.Build.0 = Debug|Any CPU - {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Release|Any CPU.Build.0 = Release|Any CPU - {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Release|x64.ActiveCfg = Release|Any CPU - {7961AAE6-FDC0-43C3-A546-4DBFE340660D}.Release|x64.Build.0 = Release|Any CPU - {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Debug|x64.ActiveCfg = Debug|Any CPU - {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Debug|x64.Build.0 = Debug|Any CPU - {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Release|Any CPU.Build.0 = Release|Any CPU - {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Release|x64.ActiveCfg = Release|Any CPU - {6BB1FCDF-1E26-4837-984D-DA74D558A49B}.Release|x64.Build.0 = Release|Any CPU - {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Debug|x64.ActiveCfg = Debug|Any CPU - {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Debug|x64.Build.0 = Debug|Any CPU - {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Release|Any CPU.Build.0 = Release|Any CPU - {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Release|x64.ActiveCfg = Release|Any CPU - {35F1DB8E-6479-4619-82BB-946BC7EC959E}.Release|x64.Build.0 = Release|Any CPU - {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Debug|x64.ActiveCfg = Debug|Any CPU - {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Debug|x64.Build.0 = Debug|Any CPU - {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Release|Any CPU.Build.0 = Release|Any CPU - {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Release|x64.ActiveCfg = Release|Any CPU - {0F4E4A62-04C7-4635-8543-D595B45D2D76}.Release|x64.Build.0 = Release|Any CPU - {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Debug|x64.ActiveCfg = Debug|Any CPU - {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Debug|x64.Build.0 = Debug|Any CPU - {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Release|Any CPU.Build.0 = Release|Any CPU - {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Release|x64.ActiveCfg = Release|Any CPU - {564A2C45-D42B-4A6C-A539-B10863D8E67C}.Release|x64.Build.0 = Release|Any CPU - {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Debug|x64.ActiveCfg = Debug|Any CPU - {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Debug|x64.Build.0 = Debug|Any CPU - {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Release|Any CPU.Build.0 = Release|Any CPU - {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Release|x64.ActiveCfg = Release|Any CPU - {C31555B0-FCAA-44F9-8284-96FBDD7FAD37}.Release|x64.Build.0 = Release|Any CPU - {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Debug|x64.ActiveCfg = Debug|Any CPU - {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Debug|x64.Build.0 = Debug|Any CPU - {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Release|Any CPU.Build.0 = Release|Any CPU - {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Release|x64.ActiveCfg = Release|Any CPU - {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE}.Release|x64.Build.0 = Release|Any CPU - {267429BB-FCFF-491B-B618-174DC3152EF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {267429BB-FCFF-491B-B618-174DC3152EF7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {267429BB-FCFF-491B-B618-174DC3152EF7}.Debug|x64.ActiveCfg = Debug|Any CPU - {267429BB-FCFF-491B-B618-174DC3152EF7}.Debug|x64.Build.0 = Debug|Any CPU - {267429BB-FCFF-491B-B618-174DC3152EF7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {267429BB-FCFF-491B-B618-174DC3152EF7}.Release|Any CPU.Build.0 = Release|Any CPU - {267429BB-FCFF-491B-B618-174DC3152EF7}.Release|x64.ActiveCfg = Release|Any CPU - {267429BB-FCFF-491B-B618-174DC3152EF7}.Release|x64.Build.0 = Release|Any CPU - {9F6F4116-8029-4788-9561-A0791EDFB720}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9F6F4116-8029-4788-9561-A0791EDFB720}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9F6F4116-8029-4788-9561-A0791EDFB720}.Debug|x64.ActiveCfg = Debug|Any CPU - {9F6F4116-8029-4788-9561-A0791EDFB720}.Debug|x64.Build.0 = Debug|Any CPU - {9F6F4116-8029-4788-9561-A0791EDFB720}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9F6F4116-8029-4788-9561-A0791EDFB720}.Release|Any CPU.Build.0 = Release|Any CPU - {9F6F4116-8029-4788-9561-A0791EDFB720}.Release|x64.ActiveCfg = Release|Any CPU - {9F6F4116-8029-4788-9561-A0791EDFB720}.Release|x64.Build.0 = Release|Any CPU - {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Debug|x64.ActiveCfg = Debug|Any CPU - {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Debug|x64.Build.0 = Debug|Any CPU - {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Release|Any CPU.Build.0 = Release|Any CPU - {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Release|x64.ActiveCfg = Release|Any CPU - {C89383DE-0284-4E0F-94E2-ED2F7B4B5656}.Release|x64.Build.0 = Release|Any CPU - {823B06D1-85E5-400B-885D-2B3CFD01487D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {823B06D1-85E5-400B-885D-2B3CFD01487D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {823B06D1-85E5-400B-885D-2B3CFD01487D}.Debug|x64.ActiveCfg = Debug|Any CPU - {823B06D1-85E5-400B-885D-2B3CFD01487D}.Debug|x64.Build.0 = Debug|Any CPU - {823B06D1-85E5-400B-885D-2B3CFD01487D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {823B06D1-85E5-400B-885D-2B3CFD01487D}.Release|Any CPU.Build.0 = Release|Any CPU - {823B06D1-85E5-400B-885D-2B3CFD01487D}.Release|x64.ActiveCfg = Release|Any CPU - {823B06D1-85E5-400B-885D-2B3CFD01487D}.Release|x64.Build.0 = Release|Any CPU - {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Debug|x64.ActiveCfg = Debug|Any CPU - {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Debug|x64.Build.0 = Debug|Any CPU - {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Release|Any CPU.Build.0 = Release|Any CPU - {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Release|x64.ActiveCfg = Release|Any CPU - {CC0C0477-2C69-4BB2-A433-15A0C25E782C}.Release|x64.Build.0 = Release|Any CPU - {74A8DA40-CB46-4B95-96DF-46A18090D987}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74A8DA40-CB46-4B95-96DF-46A18090D987}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74A8DA40-CB46-4B95-96DF-46A18090D987}.Debug|x64.ActiveCfg = Debug|Any CPU - {74A8DA40-CB46-4B95-96DF-46A18090D987}.Debug|x64.Build.0 = Debug|Any CPU - {74A8DA40-CB46-4B95-96DF-46A18090D987}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74A8DA40-CB46-4B95-96DF-46A18090D987}.Release|Any CPU.Build.0 = Release|Any CPU - {74A8DA40-CB46-4B95-96DF-46A18090D987}.Release|x64.ActiveCfg = Release|Any CPU - {74A8DA40-CB46-4B95-96DF-46A18090D987}.Release|x64.Build.0 = Release|Any CPU - {53562602-1F63-4B2C-8921-B5BB826984F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {53562602-1F63-4B2C-8921-B5BB826984F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53562602-1F63-4B2C-8921-B5BB826984F8}.Debug|x64.ActiveCfg = Debug|Any CPU - {53562602-1F63-4B2C-8921-B5BB826984F8}.Debug|x64.Build.0 = Debug|Any CPU - {53562602-1F63-4B2C-8921-B5BB826984F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53562602-1F63-4B2C-8921-B5BB826984F8}.Release|Any CPU.Build.0 = Release|Any CPU - {53562602-1F63-4B2C-8921-B5BB826984F8}.Release|x64.ActiveCfg = Release|Any CPU - {53562602-1F63-4B2C-8921-B5BB826984F8}.Release|x64.Build.0 = Release|Any CPU - {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Debug|Any CPU.Build.0 = Debug|Any CPU - {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Debug|x64.ActiveCfg = Debug|Any CPU - {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Debug|x64.Build.0 = Debug|Any CPU - {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Release|Any CPU.ActiveCfg = Release|Any CPU - {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Release|Any CPU.Build.0 = Release|Any CPU - {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Release|x64.ActiveCfg = Release|Any CPU - {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19}.Release|x64.Build.0 = Release|Any CPU - {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Debug|x64.ActiveCfg = Debug|Any CPU - {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Debug|x64.Build.0 = Debug|Any CPU - {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Release|Any CPU.Build.0 = Release|Any CPU - {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Release|x64.ActiveCfg = Release|Any CPU - {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717}.Release|x64.Build.0 = Release|Any CPU - {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Debug|x64.ActiveCfg = Debug|Any CPU - {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Debug|x64.Build.0 = Debug|Any CPU - {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Release|Any CPU.Build.0 = Release|Any CPU - {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Release|x64.ActiveCfg = Release|Any CPU - {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2}.Release|x64.Build.0 = Release|Any CPU - {B2465420-C899-4077-B6D3-B62405D5BFE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B2465420-C899-4077-B6D3-B62405D5BFE2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B2465420-C899-4077-B6D3-B62405D5BFE2}.Debug|x64.ActiveCfg = Debug|Any CPU - {B2465420-C899-4077-B6D3-B62405D5BFE2}.Debug|x64.Build.0 = Debug|Any CPU - {B2465420-C899-4077-B6D3-B62405D5BFE2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B2465420-C899-4077-B6D3-B62405D5BFE2}.Release|Any CPU.Build.0 = Release|Any CPU - {B2465420-C899-4077-B6D3-B62405D5BFE2}.Release|x64.ActiveCfg = Release|Any CPU - {B2465420-C899-4077-B6D3-B62405D5BFE2}.Release|x64.Build.0 = Release|Any CPU - {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Debug|x64.ActiveCfg = Debug|Any CPU - {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Debug|x64.Build.0 = Debug|Any CPU - {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Release|Any CPU.Build.0 = Release|Any CPU - {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Release|x64.ActiveCfg = Release|Any CPU - {5243EAA7-17B4-4810-ACDD-FCB28E1C477D}.Release|x64.Build.0 = Release|Any CPU - {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Debug|x64.ActiveCfg = Debug|Any CPU - {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Debug|x64.Build.0 = Debug|Any CPU - {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Release|Any CPU.Build.0 = Release|Any CPU - {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Release|x64.ActiveCfg = Release|Any CPU - {36BA4778-011A-4B0F-8C6A-C169E012AE66}.Release|x64.Build.0 = Release|Any CPU - {E624718C-38CD-41AA-BBA0-415008BE86BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E624718C-38CD-41AA-BBA0-415008BE86BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E624718C-38CD-41AA-BBA0-415008BE86BF}.Debug|x64.ActiveCfg = Debug|Any CPU - {E624718C-38CD-41AA-BBA0-415008BE86BF}.Debug|x64.Build.0 = Debug|Any CPU - {E624718C-38CD-41AA-BBA0-415008BE86BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E624718C-38CD-41AA-BBA0-415008BE86BF}.Release|Any CPU.Build.0 = Release|Any CPU - {E624718C-38CD-41AA-BBA0-415008BE86BF}.Release|x64.ActiveCfg = Release|Any CPU - {E624718C-38CD-41AA-BBA0-415008BE86BF}.Release|x64.Build.0 = Release|Any CPU - {3F2A0172-118E-439E-BD4A-5E0F95361838}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F2A0172-118E-439E-BD4A-5E0F95361838}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F2A0172-118E-439E-BD4A-5E0F95361838}.Debug|x64.ActiveCfg = Debug|Any CPU - {3F2A0172-118E-439E-BD4A-5E0F95361838}.Debug|x64.Build.0 = Debug|Any CPU - {3F2A0172-118E-439E-BD4A-5E0F95361838}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F2A0172-118E-439E-BD4A-5E0F95361838}.Release|Any CPU.Build.0 = Release|Any CPU - {3F2A0172-118E-439E-BD4A-5E0F95361838}.Release|x64.ActiveCfg = Release|Any CPU - {3F2A0172-118E-439E-BD4A-5E0F95361838}.Release|x64.Build.0 = Release|Any CPU - {9D295FC2-32A9-487A-BAE3-348F6360729D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D295FC2-32A9-487A-BAE3-348F6360729D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D295FC2-32A9-487A-BAE3-348F6360729D}.Debug|x64.ActiveCfg = Debug|Any CPU - {9D295FC2-32A9-487A-BAE3-348F6360729D}.Debug|x64.Build.0 = Debug|Any CPU - {9D295FC2-32A9-487A-BAE3-348F6360729D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D295FC2-32A9-487A-BAE3-348F6360729D}.Release|Any CPU.Build.0 = Release|Any CPU - {9D295FC2-32A9-487A-BAE3-348F6360729D}.Release|x64.ActiveCfg = Release|Any CPU - {9D295FC2-32A9-487A-BAE3-348F6360729D}.Release|x64.Build.0 = Release|Any CPU - {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Debug|x64.ActiveCfg = Debug|Any CPU - {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Debug|x64.Build.0 = Debug|Any CPU - {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Release|Any CPU.Build.0 = Release|Any CPU - {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Release|x64.ActiveCfg = Release|Any CPU - {D215BD91-4D7B-437E-BC2A-14D9B81649E5}.Release|x64.Build.0 = Release|Any CPU - {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Debug|x64.ActiveCfg = Debug|Any CPU - {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Debug|x64.Build.0 = Debug|Any CPU - {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Release|Any CPU.Build.0 = Release|Any CPU - {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Release|x64.ActiveCfg = Release|Any CPU - {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6}.Release|x64.Build.0 = Release|Any CPU - {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Debug|x64.ActiveCfg = Debug|Any CPU - {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Debug|x64.Build.0 = Debug|Any CPU - {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Release|Any CPU.Build.0 = Release|Any CPU - {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Release|x64.ActiveCfg = Release|Any CPU - {89B90362-4C48-4FBD-A0B7-47E34D3326F0}.Release|x64.Build.0 = Release|Any CPU - {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Debug|x64.ActiveCfg = Debug|Any CPU - {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Debug|x64.Build.0 = Debug|Any CPU - {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Release|Any CPU.Build.0 = Release|Any CPU - {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Release|x64.ActiveCfg = Release|Any CPU - {5C84C069-DB54-409A-BC0F-CBC066860CBA}.Release|x64.Build.0 = Release|Any CPU - {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Debug|x64.ActiveCfg = Debug|Any CPU - {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Debug|x64.Build.0 = Debug|Any CPU - {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Release|Any CPU.Build.0 = Release|Any CPU - {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Release|x64.ActiveCfg = Release|Any CPU - {A02A0101-3C0E-4971-AB0C-CC762C0E3955}.Release|x64.Build.0 = Release|Any CPU - {B469E3EE-637F-4A0A-852D-6A33F896B906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B469E3EE-637F-4A0A-852D-6A33F896B906}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B469E3EE-637F-4A0A-852D-6A33F896B906}.Debug|x64.ActiveCfg = Debug|Any CPU - {B469E3EE-637F-4A0A-852D-6A33F896B906}.Debug|x64.Build.0 = Debug|Any CPU - {B469E3EE-637F-4A0A-852D-6A33F896B906}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B469E3EE-637F-4A0A-852D-6A33F896B906}.Release|Any CPU.Build.0 = Release|Any CPU - {B469E3EE-637F-4A0A-852D-6A33F896B906}.Release|x64.ActiveCfg = Release|Any CPU - {B469E3EE-637F-4A0A-852D-6A33F896B906}.Release|x64.Build.0 = Release|Any CPU - {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Debug|x64.ActiveCfg = Debug|Any CPU - {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Debug|x64.Build.0 = Debug|Any CPU - {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Release|Any CPU.Build.0 = Release|Any CPU - {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Release|x64.ActiveCfg = Release|Any CPU - {2B288DAC-2E49-4980-B234-6E114FB1B2F1}.Release|x64.Build.0 = Release|Any CPU - {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Debug|x64.ActiveCfg = Debug|Any CPU - {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Debug|x64.Build.0 = Debug|Any CPU - {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Release|Any CPU.Build.0 = Release|Any CPU - {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Release|x64.ActiveCfg = Release|Any CPU - {5DAFE25B-EA24-429E-A3D2-7CD28565E444}.Release|x64.Build.0 = Release|Any CPU - {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Debug|x64.ActiveCfg = Debug|Any CPU - {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Debug|x64.Build.0 = Debug|Any CPU - {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Release|Any CPU.Build.0 = Release|Any CPU - {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Release|x64.ActiveCfg = Release|Any CPU - {EAF59CBD-2310-4BF0-AE28-580D451F9C86}.Release|x64.Build.0 = Release|Any CPU - {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Debug|x64.ActiveCfg = Debug|Any CPU - {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Debug|x64.Build.0 = Debug|Any CPU - {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Release|Any CPU.Build.0 = Release|Any CPU - {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Release|x64.ActiveCfg = Release|Any CPU - {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF}.Release|x64.Build.0 = Release|Any CPU - {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Debug|x64.ActiveCfg = Debug|Any CPU - {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Debug|x64.Build.0 = Debug|Any CPU - {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Release|Any CPU.Build.0 = Release|Any CPU - {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Release|x64.ActiveCfg = Release|Any CPU - {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22}.Release|x64.Build.0 = Release|Any CPU - {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Debug|x64.ActiveCfg = Debug|Any CPU - {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Debug|x64.Build.0 = Debug|Any CPU - {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Release|Any CPU.Build.0 = Release|Any CPU - {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Release|x64.ActiveCfg = Release|Any CPU - {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1}.Release|x64.Build.0 = Release|Any CPU - {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Debug|x64.ActiveCfg = Debug|Any CPU - {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Debug|x64.Build.0 = Debug|Any CPU - {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Release|Any CPU.Build.0 = Release|Any CPU - {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Release|x64.ActiveCfg = Release|Any CPU - {9C25DDE5-65D9-492D-9C04-F3D64EE706A1}.Release|x64.Build.0 = Release|Any CPU - {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Debug|x64.ActiveCfg = Debug|Any CPU - {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Debug|x64.Build.0 = Debug|Any CPU - {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Release|Any CPU.Build.0 = Release|Any CPU - {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Release|x64.ActiveCfg = Release|Any CPU - {A2EDB5D7-9675-403A-9FC2-FDAA49555097}.Release|x64.Build.0 = Release|Any CPU - {D7D46284-47DF-488A-8D04-421CBAAF6943}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D7D46284-47DF-488A-8D04-421CBAAF6943}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D7D46284-47DF-488A-8D04-421CBAAF6943}.Debug|x64.ActiveCfg = Debug|Any CPU - {D7D46284-47DF-488A-8D04-421CBAAF6943}.Debug|x64.Build.0 = Debug|Any CPU - {D7D46284-47DF-488A-8D04-421CBAAF6943}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D7D46284-47DF-488A-8D04-421CBAAF6943}.Release|Any CPU.Build.0 = Release|Any CPU - {D7D46284-47DF-488A-8D04-421CBAAF6943}.Release|x64.ActiveCfg = Release|Any CPU - {D7D46284-47DF-488A-8D04-421CBAAF6943}.Release|x64.Build.0 = Release|Any CPU - {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Debug|x64.ActiveCfg = Debug|Any CPU - {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Debug|x64.Build.0 = Debug|Any CPU - {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Release|Any CPU.Build.0 = Release|Any CPU - {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Release|x64.ActiveCfg = Release|Any CPU - {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005}.Release|x64.Build.0 = Release|Any CPU - {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Debug|x64.ActiveCfg = Debug|Any CPU - {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Debug|x64.Build.0 = Debug|Any CPU - {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Release|Any CPU.Build.0 = Release|Any CPU - {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Release|x64.ActiveCfg = Release|Any CPU - {848EC46B-2C09-4E4E-9D09-D876862B52CD}.Release|x64.Build.0 = Release|Any CPU - {1226DCD2-D128-4976-8806-2A369F87058B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1226DCD2-D128-4976-8806-2A369F87058B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1226DCD2-D128-4976-8806-2A369F87058B}.Debug|x64.ActiveCfg = Debug|Any CPU - {1226DCD2-D128-4976-8806-2A369F87058B}.Debug|x64.Build.0 = Debug|Any CPU - {1226DCD2-D128-4976-8806-2A369F87058B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1226DCD2-D128-4976-8806-2A369F87058B}.Release|Any CPU.Build.0 = Release|Any CPU - {1226DCD2-D128-4976-8806-2A369F87058B}.Release|x64.ActiveCfg = Release|Any CPU - {1226DCD2-D128-4976-8806-2A369F87058B}.Release|x64.Build.0 = Release|Any CPU - {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Debug|x64.ActiveCfg = Debug|Any CPU - {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Debug|x64.Build.0 = Debug|Any CPU - {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Release|Any CPU.Build.0 = Release|Any CPU - {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Release|x64.ActiveCfg = Release|Any CPU - {80F6E78A-4ADB-4E51-9570-A9200048F48F}.Release|x64.Build.0 = Release|Any CPU - {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Debug|x64.ActiveCfg = Debug|Any CPU - {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Debug|x64.Build.0 = Debug|Any CPU - {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Release|Any CPU.Build.0 = Release|Any CPU - {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Release|x64.ActiveCfg = Release|Any CPU - {97708A6F-A6F9-4E7A-9069-65ABBBA12D06}.Release|x64.Build.0 = Release|Any CPU - {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Debug|x64.ActiveCfg = Debug|Any CPU - {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Debug|x64.Build.0 = Debug|Any CPU - {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Release|Any CPU.Build.0 = Release|Any CPU - {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Release|x64.ActiveCfg = Release|Any CPU - {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3}.Release|x64.Build.0 = Release|Any CPU - {6E74144B-0816-4161-AACC-8C696E0E9C34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E74144B-0816-4161-AACC-8C696E0E9C34}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E74144B-0816-4161-AACC-8C696E0E9C34}.Debug|x64.ActiveCfg = Debug|Any CPU - {6E74144B-0816-4161-AACC-8C696E0E9C34}.Debug|x64.Build.0 = Debug|Any CPU - {6E74144B-0816-4161-AACC-8C696E0E9C34}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E74144B-0816-4161-AACC-8C696E0E9C34}.Release|Any CPU.Build.0 = Release|Any CPU - {6E74144B-0816-4161-AACC-8C696E0E9C34}.Release|x64.ActiveCfg = Release|Any CPU - {6E74144B-0816-4161-AACC-8C696E0E9C34}.Release|x64.Build.0 = Release|Any CPU - {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Debug|x64.ActiveCfg = Debug|Any CPU - {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Debug|x64.Build.0 = Debug|Any CPU - {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Release|Any CPU.Build.0 = Release|Any CPU - {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Release|x64.ActiveCfg = Release|Any CPU - {C903135B-E0CE-4DB0-B8BF-FF59816C24D8}.Release|x64.Build.0 = Release|Any CPU - {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Debug|x64.ActiveCfg = Debug|Any CPU - {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Debug|x64.Build.0 = Debug|Any CPU - {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Release|Any CPU.Build.0 = Release|Any CPU - {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Release|x64.ActiveCfg = Release|Any CPU - {D3C16432-EAD0-4DE5-9544-16D36A67C2C2}.Release|x64.Build.0 = Release|Any CPU - {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Debug|x64.ActiveCfg = Debug|Any CPU - {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Debug|x64.Build.0 = Debug|Any CPU - {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Release|Any CPU.Build.0 = Release|Any CPU - {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Release|x64.ActiveCfg = Release|Any CPU - {F0353FB0-27F0-4957-8D69-4AEE40A09801}.Release|x64.Build.0 = Release|Any CPU - {3735BFA1-F935-42EF-A316-BEEF0A138781}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3735BFA1-F935-42EF-A316-BEEF0A138781}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3735BFA1-F935-42EF-A316-BEEF0A138781}.Debug|x64.ActiveCfg = Debug|Any CPU - {3735BFA1-F935-42EF-A316-BEEF0A138781}.Debug|x64.Build.0 = Debug|Any CPU - {3735BFA1-F935-42EF-A316-BEEF0A138781}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3735BFA1-F935-42EF-A316-BEEF0A138781}.Release|Any CPU.Build.0 = Release|Any CPU - {3735BFA1-F935-42EF-A316-BEEF0A138781}.Release|x64.ActiveCfg = Release|Any CPU - {3735BFA1-F935-42EF-A316-BEEF0A138781}.Release|x64.Build.0 = Release|Any CPU - {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Debug|x64.ActiveCfg = Debug|Any CPU - {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Debug|x64.Build.0 = Debug|Any CPU - {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Release|Any CPU.Build.0 = Release|Any CPU - {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Release|x64.ActiveCfg = Release|Any CPU - {A3DE164B-54D1-440F-A9E9-19A5C667E073}.Release|x64.Build.0 = Release|Any CPU - {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Debug|Any CPU.Build.0 = Debug|Any CPU - {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Debug|x64.ActiveCfg = Debug|Any CPU - {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Debug|x64.Build.0 = Debug|Any CPU - {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Release|Any CPU.ActiveCfg = Release|Any CPU - {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Release|Any CPU.Build.0 = Release|Any CPU - {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Release|x64.ActiveCfg = Release|Any CPU - {175CDD95-C2C2-4665-8CC3-5D1D6BC94098}.Release|x64.Build.0 = Release|Any CPU - {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Debug|x64.ActiveCfg = Debug|Any CPU - {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Debug|x64.Build.0 = Debug|Any CPU - {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Release|Any CPU.Build.0 = Release|Any CPU - {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Release|x64.ActiveCfg = Release|Any CPU - {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF}.Release|x64.Build.0 = Release|Any CPU - {1BC59353-A6FF-4C0C-9B47-37884621E228}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1BC59353-A6FF-4C0C-9B47-37884621E228}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1BC59353-A6FF-4C0C-9B47-37884621E228}.Debug|x64.ActiveCfg = Debug|Any CPU - {1BC59353-A6FF-4C0C-9B47-37884621E228}.Debug|x64.Build.0 = Debug|Any CPU - {1BC59353-A6FF-4C0C-9B47-37884621E228}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1BC59353-A6FF-4C0C-9B47-37884621E228}.Release|Any CPU.Build.0 = Release|Any CPU - {1BC59353-A6FF-4C0C-9B47-37884621E228}.Release|x64.ActiveCfg = Release|Any CPU - {1BC59353-A6FF-4C0C-9B47-37884621E228}.Release|x64.Build.0 = Release|Any CPU - {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Debug|x64.ActiveCfg = Debug|Any CPU - {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Debug|x64.Build.0 = Debug|Any CPU - {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Release|Any CPU.Build.0 = Release|Any CPU - {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Release|x64.ActiveCfg = Release|Any CPU - {19902ADB-7C37-4E38-ABC0-28BCDE2D164D}.Release|x64.Build.0 = Release|Any CPU - {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Debug|x64.ActiveCfg = Debug|Any CPU - {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Debug|x64.Build.0 = Debug|Any CPU - {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Release|Any CPU.Build.0 = Release|Any CPU - {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Release|x64.ActiveCfg = Release|Any CPU - {F92CC9A7-BE67-48F3-8DAE-D59821F031FD}.Release|x64.Build.0 = Release|Any CPU - {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Debug|x64.ActiveCfg = Debug|Any CPU - {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Debug|x64.Build.0 = Debug|Any CPU - {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Release|Any CPU.Build.0 = Release|Any CPU - {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Release|x64.ActiveCfg = Release|Any CPU - {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F}.Release|x64.Build.0 = Release|Any CPU - {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Debug|x64.ActiveCfg = Debug|Any CPU - {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Debug|x64.Build.0 = Debug|Any CPU - {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Release|Any CPU.Build.0 = Release|Any CPU - {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Release|x64.ActiveCfg = Release|Any CPU - {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7}.Release|x64.Build.0 = Release|Any CPU - {885CDA4A-9831-4159-A0A7-9062CF93180A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {885CDA4A-9831-4159-A0A7-9062CF93180A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {885CDA4A-9831-4159-A0A7-9062CF93180A}.Debug|x64.ActiveCfg = Debug|Any CPU - {885CDA4A-9831-4159-A0A7-9062CF93180A}.Debug|x64.Build.0 = Debug|Any CPU - {885CDA4A-9831-4159-A0A7-9062CF93180A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {885CDA4A-9831-4159-A0A7-9062CF93180A}.Release|Any CPU.Build.0 = Release|Any CPU - {885CDA4A-9831-4159-A0A7-9062CF93180A}.Release|x64.ActiveCfg = Release|Any CPU - {885CDA4A-9831-4159-A0A7-9062CF93180A}.Release|x64.Build.0 = Release|Any CPU - {60A51206-8F7F-4F43-B473-006F0DB380CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {60A51206-8F7F-4F43-B473-006F0DB380CB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {60A51206-8F7F-4F43-B473-006F0DB380CB}.Debug|x64.ActiveCfg = Debug|Any CPU - {60A51206-8F7F-4F43-B473-006F0DB380CB}.Debug|x64.Build.0 = Debug|Any CPU - {60A51206-8F7F-4F43-B473-006F0DB380CB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {60A51206-8F7F-4F43-B473-006F0DB380CB}.Release|Any CPU.Build.0 = Release|Any CPU - {60A51206-8F7F-4F43-B473-006F0DB380CB}.Release|x64.ActiveCfg = Release|Any CPU - {60A51206-8F7F-4F43-B473-006F0DB380CB}.Release|x64.Build.0 = Release|Any CPU - {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Debug|x64.ActiveCfg = Debug|Any CPU - {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Debug|x64.Build.0 = Debug|Any CPU - {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Release|Any CPU.Build.0 = Release|Any CPU - {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Release|x64.ActiveCfg = Release|Any CPU - {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0}.Release|x64.Build.0 = Release|Any CPU - {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Debug|x64.ActiveCfg = Debug|Any CPU - {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Debug|x64.Build.0 = Debug|Any CPU - {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Release|Any CPU.Build.0 = Release|Any CPU - {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Release|x64.ActiveCfg = Release|Any CPU - {B98309A2-D2D0-41BB-A7C6-8BA24B29D105}.Release|x64.Build.0 = Release|Any CPU - {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Debug|x64.ActiveCfg = Debug|Any CPU - {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Debug|x64.Build.0 = Debug|Any CPU - {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Release|Any CPU.Build.0 = Release|Any CPU - {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Release|x64.ActiveCfg = Release|Any CPU - {682FAD0B-5989-436C-9B7D-F15F10CB90FF}.Release|x64.Build.0 = Release|Any CPU - {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Debug|x64.ActiveCfg = Debug|Any CPU - {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Debug|x64.Build.0 = Debug|Any CPU - {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Release|Any CPU.Build.0 = Release|Any CPU - {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Release|x64.ActiveCfg = Release|Any CPU - {8219C9CC-1260-4175-94E5-C36A336C8ADE}.Release|x64.Build.0 = Release|Any CPU - {9A15A065-8559-49E2-8818-9E8A9186A105}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9A15A065-8559-49E2-8818-9E8A9186A105}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A15A065-8559-49E2-8818-9E8A9186A105}.Debug|x64.ActiveCfg = Debug|Any CPU - {9A15A065-8559-49E2-8818-9E8A9186A105}.Debug|x64.Build.0 = Debug|Any CPU - {9A15A065-8559-49E2-8818-9E8A9186A105}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A15A065-8559-49E2-8818-9E8A9186A105}.Release|Any CPU.Build.0 = Release|Any CPU - {9A15A065-8559-49E2-8818-9E8A9186A105}.Release|x64.ActiveCfg = Release|Any CPU - {9A15A065-8559-49E2-8818-9E8A9186A105}.Release|x64.Build.0 = Release|Any CPU - {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Debug|x64.ActiveCfg = Debug|Any CPU - {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Debug|x64.Build.0 = Debug|Any CPU - {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Release|Any CPU.Build.0 = Release|Any CPU - {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Release|x64.ActiveCfg = Release|Any CPU - {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A}.Release|x64.Build.0 = Release|Any CPU - {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Debug|x64.ActiveCfg = Debug|Any CPU - {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Debug|x64.Build.0 = Debug|Any CPU - {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Release|Any CPU.Build.0 = Release|Any CPU - {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Release|x64.ActiveCfg = Release|Any CPU - {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB}.Release|x64.Build.0 = Release|Any CPU - {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Debug|x64.ActiveCfg = Debug|Any CPU - {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Debug|x64.Build.0 = Debug|Any CPU - {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Release|Any CPU.Build.0 = Release|Any CPU - {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Release|x64.ActiveCfg = Release|Any CPU - {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1}.Release|x64.Build.0 = Release|Any CPU - {1EF70F79-B605-4729-99E7-E85386AAC649}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EF70F79-B605-4729-99E7-E85386AAC649}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EF70F79-B605-4729-99E7-E85386AAC649}.Debug|x64.ActiveCfg = Debug|Any CPU - {1EF70F79-B605-4729-99E7-E85386AAC649}.Debug|x64.Build.0 = Debug|Any CPU - {1EF70F79-B605-4729-99E7-E85386AAC649}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EF70F79-B605-4729-99E7-E85386AAC649}.Release|Any CPU.Build.0 = Release|Any CPU - {1EF70F79-B605-4729-99E7-E85386AAC649}.Release|x64.ActiveCfg = Release|Any CPU - {1EF70F79-B605-4729-99E7-E85386AAC649}.Release|x64.Build.0 = Release|Any CPU - {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Debug|x64.ActiveCfg = Debug|Any CPU - {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Debug|x64.Build.0 = Debug|Any CPU - {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Release|Any CPU.Build.0 = Release|Any CPU - {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Release|x64.ActiveCfg = Release|Any CPU - {2CA6351B-DEA7-4343-91C1-8C20507343EE}.Release|x64.Build.0 = Release|Any CPU - {6C1A8E47-8391-416B-9407-2A1F97A62776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C1A8E47-8391-416B-9407-2A1F97A62776}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C1A8E47-8391-416B-9407-2A1F97A62776}.Debug|x64.ActiveCfg = Debug|Any CPU - {6C1A8E47-8391-416B-9407-2A1F97A62776}.Debug|x64.Build.0 = Debug|Any CPU - {6C1A8E47-8391-416B-9407-2A1F97A62776}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C1A8E47-8391-416B-9407-2A1F97A62776}.Release|Any CPU.Build.0 = Release|Any CPU - {6C1A8E47-8391-416B-9407-2A1F97A62776}.Release|x64.ActiveCfg = Release|Any CPU - {6C1A8E47-8391-416B-9407-2A1F97A62776}.Release|x64.Build.0 = Release|Any CPU - {E7A282E3-CC87-48C9-A80B-664A5390C715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E7A282E3-CC87-48C9-A80B-664A5390C715}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E7A282E3-CC87-48C9-A80B-664A5390C715}.Debug|x64.ActiveCfg = Debug|Any CPU - {E7A282E3-CC87-48C9-A80B-664A5390C715}.Debug|x64.Build.0 = Debug|Any CPU - {E7A282E3-CC87-48C9-A80B-664A5390C715}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E7A282E3-CC87-48C9-A80B-664A5390C715}.Release|Any CPU.Build.0 = Release|Any CPU - {E7A282E3-CC87-48C9-A80B-664A5390C715}.Release|x64.ActiveCfg = Release|Any CPU - {E7A282E3-CC87-48C9-A80B-664A5390C715}.Release|x64.Build.0 = Release|Any CPU - {D3B70875-76B0-4F48-9798-4A700E4902E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3B70875-76B0-4F48-9798-4A700E4902E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3B70875-76B0-4F48-9798-4A700E4902E5}.Debug|x64.ActiveCfg = Debug|Any CPU - {D3B70875-76B0-4F48-9798-4A700E4902E5}.Debug|x64.Build.0 = Debug|Any CPU - {D3B70875-76B0-4F48-9798-4A700E4902E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3B70875-76B0-4F48-9798-4A700E4902E5}.Release|Any CPU.Build.0 = Release|Any CPU - {D3B70875-76B0-4F48-9798-4A700E4902E5}.Release|x64.ActiveCfg = Release|Any CPU - {D3B70875-76B0-4F48-9798-4A700E4902E5}.Release|x64.Build.0 = Release|Any CPU - {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Debug|x64.ActiveCfg = Debug|Any CPU - {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Debug|x64.Build.0 = Debug|Any CPU - {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Release|Any CPU.Build.0 = Release|Any CPU - {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Release|x64.ActiveCfg = Release|Any CPU - {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3}.Release|x64.Build.0 = Release|Any CPU - {0665C217-CDF0-4153-93DA-886230CB19CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0665C217-CDF0-4153-93DA-886230CB19CF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0665C217-CDF0-4153-93DA-886230CB19CF}.Debug|x64.ActiveCfg = Debug|Any CPU - {0665C217-CDF0-4153-93DA-886230CB19CF}.Debug|x64.Build.0 = Debug|Any CPU - {0665C217-CDF0-4153-93DA-886230CB19CF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0665C217-CDF0-4153-93DA-886230CB19CF}.Release|Any CPU.Build.0 = Release|Any CPU - {0665C217-CDF0-4153-93DA-886230CB19CF}.Release|x64.ActiveCfg = Release|Any CPU - {0665C217-CDF0-4153-93DA-886230CB19CF}.Release|x64.Build.0 = Release|Any CPU - {88A46A64-0877-44BB-87FB-C3A046104A17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88A46A64-0877-44BB-87FB-C3A046104A17}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88A46A64-0877-44BB-87FB-C3A046104A17}.Debug|x64.ActiveCfg = Debug|Any CPU - {88A46A64-0877-44BB-87FB-C3A046104A17}.Debug|x64.Build.0 = Debug|Any CPU - {88A46A64-0877-44BB-87FB-C3A046104A17}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88A46A64-0877-44BB-87FB-C3A046104A17}.Release|Any CPU.Build.0 = Release|Any CPU - {88A46A64-0877-44BB-87FB-C3A046104A17}.Release|x64.ActiveCfg = Release|Any CPU - {88A46A64-0877-44BB-87FB-C3A046104A17}.Release|x64.Build.0 = Release|Any CPU - {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Debug|x64.ActiveCfg = Debug|Any CPU - {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Debug|x64.Build.0 = Debug|Any CPU - {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Release|Any CPU.Build.0 = Release|Any CPU - {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Release|x64.ActiveCfg = Release|Any CPU - {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B}.Release|x64.Build.0 = Release|Any CPU - {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Debug|x64.ActiveCfg = Debug|Any CPU - {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Debug|x64.Build.0 = Debug|Any CPU - {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Release|Any CPU.Build.0 = Release|Any CPU - {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Release|x64.ActiveCfg = Release|Any CPU - {8E8F56D5-E686-4F4A-A9AD-B81D9243B446}.Release|x64.Build.0 = Release|Any CPU - {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Debug|x64.ActiveCfg = Debug|Any CPU - {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Debug|x64.Build.0 = Debug|Any CPU - {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Release|Any CPU.Build.0 = Release|Any CPU - {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Release|x64.ActiveCfg = Release|Any CPU - {0D4A2924-A7B1-4141-9871-FF1E8B46A752}.Release|x64.Build.0 = Release|Any CPU - {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Debug|x64.ActiveCfg = Debug|Any CPU - {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Debug|x64.Build.0 = Debug|Any CPU - {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Release|Any CPU.Build.0 = Release|Any CPU - {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Release|x64.ActiveCfg = Release|Any CPU - {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03}.Release|x64.Build.0 = Release|Any CPU - {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Debug|x64.ActiveCfg = Debug|Any CPU - {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Debug|x64.Build.0 = Debug|Any CPU - {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Release|Any CPU.Build.0 = Release|Any CPU - {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Release|x64.ActiveCfg = Release|Any CPU - {F49D6ED6-9FD3-4C19-A30B-2C4198437D59}.Release|x64.Build.0 = Release|Any CPU - {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Debug|Any CPU.Build.0 = Debug|Any CPU - {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Debug|x64.ActiveCfg = Debug|Any CPU - {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Debug|x64.Build.0 = Debug|Any CPU - {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Release|Any CPU.ActiveCfg = Release|Any CPU - {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Release|Any CPU.Build.0 = Release|Any CPU - {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Release|x64.ActiveCfg = Release|Any CPU - {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646}.Release|x64.Build.0 = Release|Any CPU - {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Debug|x64.ActiveCfg = Debug|Any CPU - {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Debug|x64.Build.0 = Debug|Any CPU - {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Release|Any CPU.Build.0 = Release|Any CPU - {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Release|x64.ActiveCfg = Release|Any CPU - {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB}.Release|x64.Build.0 = Release|Any CPU - {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Debug|x64.ActiveCfg = Debug|Any CPU - {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Debug|x64.Build.0 = Debug|Any CPU - {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Release|Any CPU.Build.0 = Release|Any CPU - {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Release|x64.ActiveCfg = Release|Any CPU - {7BD12A3E-CB73-4B28-9509-26BEB096ABEB}.Release|x64.Build.0 = Release|Any CPU - {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Debug|x64.ActiveCfg = Debug|Any CPU - {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Debug|x64.Build.0 = Debug|Any CPU - {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Release|Any CPU.Build.0 = Release|Any CPU - {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Release|x64.ActiveCfg = Release|Any CPU - {BB05402F-7BE8-4965-9518-BE869ACE5EFC}.Release|x64.Build.0 = Release|Any CPU - {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Debug|x64.ActiveCfg = Debug|Any CPU - {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Debug|x64.Build.0 = Debug|Any CPU - {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Release|Any CPU.Build.0 = Release|Any CPU - {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Release|x64.ActiveCfg = Release|Any CPU - {E85AB70D-DF15-4A99-AFDA-530A5A9363FD}.Release|x64.Build.0 = Release|Any CPU - {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Debug|x64.ActiveCfg = Debug|Any CPU - {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Debug|x64.Build.0 = Debug|Any CPU - {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Release|Any CPU.Build.0 = Release|Any CPU - {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Release|x64.ActiveCfg = Release|Any CPU - {5E77B9D1-80A7-4761-9431-3D9C7E25324B}.Release|x64.Build.0 = Release|Any CPU - {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Debug|x64.ActiveCfg = Debug|Any CPU - {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Debug|x64.Build.0 = Debug|Any CPU - {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Release|Any CPU.Build.0 = Release|Any CPU - {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Release|x64.ActiveCfg = Release|Any CPU - {B69BDE42-349F-4E9C-B2ED-280B907BE1AE}.Release|x64.Build.0 = Release|Any CPU - {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Debug|x64.ActiveCfg = Debug|Any CPU - {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Debug|x64.Build.0 = Debug|Any CPU - {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Release|Any CPU.Build.0 = Release|Any CPU - {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Release|x64.ActiveCfg = Release|Any CPU - {DC60715E-80FD-4911-8A65-DC14A7A66FA9}.Release|x64.Build.0 = Release|Any CPU - {4BEEE39F-0760-434F-9389-6194037781DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4BEEE39F-0760-434F-9389-6194037781DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4BEEE39F-0760-434F-9389-6194037781DE}.Debug|x64.ActiveCfg = Debug|Any CPU - {4BEEE39F-0760-434F-9389-6194037781DE}.Debug|x64.Build.0 = Debug|Any CPU - {4BEEE39F-0760-434F-9389-6194037781DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4BEEE39F-0760-434F-9389-6194037781DE}.Release|Any CPU.Build.0 = Release|Any CPU - {4BEEE39F-0760-434F-9389-6194037781DE}.Release|x64.ActiveCfg = Release|Any CPU - {4BEEE39F-0760-434F-9389-6194037781DE}.Release|x64.Build.0 = Release|Any CPU - {F201EB09-2EE2-4203-A829-044C7EC2D112}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F201EB09-2EE2-4203-A829-044C7EC2D112}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F201EB09-2EE2-4203-A829-044C7EC2D112}.Debug|x64.ActiveCfg = Debug|Any CPU - {F201EB09-2EE2-4203-A829-044C7EC2D112}.Debug|x64.Build.0 = Debug|Any CPU - {F201EB09-2EE2-4203-A829-044C7EC2D112}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F201EB09-2EE2-4203-A829-044C7EC2D112}.Release|Any CPU.Build.0 = Release|Any CPU - {F201EB09-2EE2-4203-A829-044C7EC2D112}.Release|x64.ActiveCfg = Release|Any CPU - {F201EB09-2EE2-4203-A829-044C7EC2D112}.Release|x64.Build.0 = Release|Any CPU - {77466E5C-4DF7-4C7C-B251-689052D51B38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77466E5C-4DF7-4C7C-B251-689052D51B38}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77466E5C-4DF7-4C7C-B251-689052D51B38}.Debug|x64.ActiveCfg = Debug|Any CPU - {77466E5C-4DF7-4C7C-B251-689052D51B38}.Debug|x64.Build.0 = Debug|Any CPU - {77466E5C-4DF7-4C7C-B251-689052D51B38}.Release|Any CPU.ActiveCfg = Release|Any CPU - {77466E5C-4DF7-4C7C-B251-689052D51B38}.Release|Any CPU.Build.0 = Release|Any CPU - {77466E5C-4DF7-4C7C-B251-689052D51B38}.Release|x64.ActiveCfg = Release|Any CPU - {77466E5C-4DF7-4C7C-B251-689052D51B38}.Release|x64.Build.0 = Release|Any CPU - {C650E615-4FAD-4CA9-B81C-3CF461805005}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C650E615-4FAD-4CA9-B81C-3CF461805005}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C650E615-4FAD-4CA9-B81C-3CF461805005}.Debug|x64.ActiveCfg = Debug|Any CPU - {C650E615-4FAD-4CA9-B81C-3CF461805005}.Debug|x64.Build.0 = Debug|Any CPU - {C650E615-4FAD-4CA9-B81C-3CF461805005}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C650E615-4FAD-4CA9-B81C-3CF461805005}.Release|Any CPU.Build.0 = Release|Any CPU - {C650E615-4FAD-4CA9-B81C-3CF461805005}.Release|x64.ActiveCfg = Release|Any CPU - {C650E615-4FAD-4CA9-B81C-3CF461805005}.Release|x64.Build.0 = Release|Any CPU - {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Debug|x64.ActiveCfg = Debug|Any CPU - {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Debug|x64.Build.0 = Debug|Any CPU - {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Release|Any CPU.Build.0 = Release|Any CPU - {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Release|x64.ActiveCfg = Release|Any CPU - {0420C60C-6075-4BED-A0F0-9540A0D2CD8F}.Release|x64.Build.0 = Release|Any CPU - {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Debug|x64.ActiveCfg = Debug|Any CPU - {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Debug|x64.Build.0 = Debug|Any CPU - {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Release|Any CPU.Build.0 = Release|Any CPU - {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Release|x64.ActiveCfg = Release|Any CPU - {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC}.Release|x64.Build.0 = Release|Any CPU - {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Debug|x64.ActiveCfg = Debug|Any CPU - {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Debug|x64.Build.0 = Debug|Any CPU - {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Release|Any CPU.Build.0 = Release|Any CPU - {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Release|x64.ActiveCfg = Release|Any CPU - {254521CF-58A2-4FFB-BCA3-78B187E985DB}.Release|x64.Build.0 = Release|Any CPU - {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Debug|x64.ActiveCfg = Debug|Any CPU - {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Debug|x64.Build.0 = Debug|Any CPU - {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Release|Any CPU.Build.0 = Release|Any CPU - {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Release|x64.ActiveCfg = Release|Any CPU - {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A}.Release|x64.Build.0 = Release|Any CPU - {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Debug|x64.ActiveCfg = Debug|Any CPU - {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Debug|x64.Build.0 = Debug|Any CPU - {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Release|Any CPU.Build.0 = Release|Any CPU - {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Release|x64.ActiveCfg = Release|Any CPU - {76251F5E-89BD-4E56-81CA-AD111361CAD4}.Release|x64.Build.0 = Release|Any CPU - {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Debug|x64.ActiveCfg = Debug|Any CPU - {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Debug|x64.Build.0 = Debug|Any CPU - {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Release|Any CPU.Build.0 = Release|Any CPU - {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Release|x64.ActiveCfg = Release|Any CPU - {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09}.Release|x64.Build.0 = Release|Any CPU - {3211BD54-4209-428E-9F11-D2F8181A890D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3211BD54-4209-428E-9F11-D2F8181A890D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3211BD54-4209-428E-9F11-D2F8181A890D}.Debug|x64.ActiveCfg = Debug|Any CPU - {3211BD54-4209-428E-9F11-D2F8181A890D}.Debug|x64.Build.0 = Debug|Any CPU - {3211BD54-4209-428E-9F11-D2F8181A890D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3211BD54-4209-428E-9F11-D2F8181A890D}.Release|Any CPU.Build.0 = Release|Any CPU - {3211BD54-4209-428E-9F11-D2F8181A890D}.Release|x64.ActiveCfg = Release|Any CPU - {3211BD54-4209-428E-9F11-D2F8181A890D}.Release|x64.Build.0 = Release|Any CPU - {9815A23B-6101-4C13-89CA-A07B85623E0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9815A23B-6101-4C13-89CA-A07B85623E0E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9815A23B-6101-4C13-89CA-A07B85623E0E}.Debug|x64.ActiveCfg = Debug|Any CPU - {9815A23B-6101-4C13-89CA-A07B85623E0E}.Debug|x64.Build.0 = Debug|Any CPU - {9815A23B-6101-4C13-89CA-A07B85623E0E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9815A23B-6101-4C13-89CA-A07B85623E0E}.Release|Any CPU.Build.0 = Release|Any CPU - {9815A23B-6101-4C13-89CA-A07B85623E0E}.Release|x64.ActiveCfg = Release|Any CPU - {9815A23B-6101-4C13-89CA-A07B85623E0E}.Release|x64.Build.0 = Release|Any CPU - {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Debug|x64.ActiveCfg = Debug|Any CPU - {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Debug|x64.Build.0 = Debug|Any CPU - {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Release|Any CPU.Build.0 = Release|Any CPU - {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Release|x64.ActiveCfg = Release|Any CPU - {88C1C77A-0F9F-436B-98FB-E696F35EB62E}.Release|x64.Build.0 = Release|Any CPU - {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Debug|x64.ActiveCfg = Debug|Any CPU - {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Debug|x64.Build.0 = Debug|Any CPU - {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Release|Any CPU.Build.0 = Release|Any CPU - {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Release|x64.ActiveCfg = Release|Any CPU - {B111B6B8-DC60-4D9D-896C-EE52B834A3DB}.Release|x64.Build.0 = Release|Any CPU - {7836A5A0-798F-4167-818C-EA770135D1B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7836A5A0-798F-4167-818C-EA770135D1B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7836A5A0-798F-4167-818C-EA770135D1B0}.Debug|x64.ActiveCfg = Debug|Any CPU - {7836A5A0-798F-4167-818C-EA770135D1B0}.Debug|x64.Build.0 = Debug|Any CPU - {7836A5A0-798F-4167-818C-EA770135D1B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7836A5A0-798F-4167-818C-EA770135D1B0}.Release|Any CPU.Build.0 = Release|Any CPU - {7836A5A0-798F-4167-818C-EA770135D1B0}.Release|x64.ActiveCfg = Release|Any CPU - {7836A5A0-798F-4167-818C-EA770135D1B0}.Release|x64.Build.0 = Release|Any CPU - {358C26DC-44F6-4177-9035-9574A87DD422}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {358C26DC-44F6-4177-9035-9574A87DD422}.Debug|Any CPU.Build.0 = Debug|Any CPU - {358C26DC-44F6-4177-9035-9574A87DD422}.Debug|x64.ActiveCfg = Debug|Any CPU - {358C26DC-44F6-4177-9035-9574A87DD422}.Debug|x64.Build.0 = Debug|Any CPU - {358C26DC-44F6-4177-9035-9574A87DD422}.Release|Any CPU.ActiveCfg = Release|Any CPU - {358C26DC-44F6-4177-9035-9574A87DD422}.Release|Any CPU.Build.0 = Release|Any CPU - {358C26DC-44F6-4177-9035-9574A87DD422}.Release|x64.ActiveCfg = Release|Any CPU - {358C26DC-44F6-4177-9035-9574A87DD422}.Release|x64.Build.0 = Release|Any CPU - {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Debug|x64.ActiveCfg = Debug|Any CPU - {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Debug|x64.Build.0 = Debug|Any CPU - {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Release|Any CPU.Build.0 = Release|Any CPU - {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Release|x64.ActiveCfg = Release|Any CPU - {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB}.Release|x64.Build.0 = Release|Any CPU - {94667017-2F5A-49DF-850B-238EB0C7E17D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94667017-2F5A-49DF-850B-238EB0C7E17D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94667017-2F5A-49DF-850B-238EB0C7E17D}.Debug|x64.ActiveCfg = Debug|Any CPU - {94667017-2F5A-49DF-850B-238EB0C7E17D}.Debug|x64.Build.0 = Debug|Any CPU - {94667017-2F5A-49DF-850B-238EB0C7E17D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94667017-2F5A-49DF-850B-238EB0C7E17D}.Release|Any CPU.Build.0 = Release|Any CPU - {94667017-2F5A-49DF-850B-238EB0C7E17D}.Release|x64.ActiveCfg = Release|Any CPU - {94667017-2F5A-49DF-850B-238EB0C7E17D}.Release|x64.Build.0 = Release|Any CPU - {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Debug|x64.ActiveCfg = Debug|Any CPU - {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Debug|x64.Build.0 = Debug|Any CPU - {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Release|Any CPU.Build.0 = Release|Any CPU - {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Release|x64.ActiveCfg = Release|Any CPU - {B795CBE6-3AAA-481E-85F6-C406C15AA586}.Release|x64.Build.0 = Release|Any CPU - {6C7C865D-F813-4CCB-9256-81F8FB511888}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C7C865D-F813-4CCB-9256-81F8FB511888}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C7C865D-F813-4CCB-9256-81F8FB511888}.Debug|x64.ActiveCfg = Debug|Any CPU - {6C7C865D-F813-4CCB-9256-81F8FB511888}.Debug|x64.Build.0 = Debug|Any CPU - {6C7C865D-F813-4CCB-9256-81F8FB511888}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C7C865D-F813-4CCB-9256-81F8FB511888}.Release|Any CPU.Build.0 = Release|Any CPU - {6C7C865D-F813-4CCB-9256-81F8FB511888}.Release|x64.ActiveCfg = Release|Any CPU - {6C7C865D-F813-4CCB-9256-81F8FB511888}.Release|x64.Build.0 = Release|Any CPU - {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Debug|x64.ActiveCfg = Debug|Any CPU - {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Debug|x64.Build.0 = Debug|Any CPU - {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Release|Any CPU.Build.0 = Release|Any CPU - {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Release|x64.ActiveCfg = Release|Any CPU - {53574F47-0E4E-4317-8E14-D8BCD2EDFD57}.Release|x64.Build.0 = Release|Any CPU - {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Debug|x64.ActiveCfg = Debug|Any CPU - {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Debug|x64.Build.0 = Debug|Any CPU - {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Release|Any CPU.Build.0 = Release|Any CPU - {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Release|x64.ActiveCfg = Release|Any CPU - {46AB3663-0FE2-4E44-A9FD-67AFA69611C6}.Release|x64.Build.0 = Release|Any CPU - {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Debug|x64.ActiveCfg = Debug|Any CPU - {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Debug|x64.Build.0 = Debug|Any CPU - {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Release|Any CPU.Build.0 = Release|Any CPU - {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Release|x64.ActiveCfg = Release|Any CPU - {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731}.Release|x64.Build.0 = Release|Any CPU - {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Debug|x64.ActiveCfg = Debug|Any CPU - {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Debug|x64.Build.0 = Debug|Any CPU - {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Release|Any CPU.Build.0 = Release|Any CPU - {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Release|x64.ActiveCfg = Release|Any CPU - {15698F80-DFB5-485A-9B76-074ACA1A7D8D}.Release|x64.Build.0 = Release|Any CPU - {12D7F445-1A22-4695-B174-6FC44C806377}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {12D7F445-1A22-4695-B174-6FC44C806377}.Debug|Any CPU.Build.0 = Debug|Any CPU - {12D7F445-1A22-4695-B174-6FC44C806377}.Debug|x64.ActiveCfg = Debug|Any CPU - {12D7F445-1A22-4695-B174-6FC44C806377}.Debug|x64.Build.0 = Debug|Any CPU - {12D7F445-1A22-4695-B174-6FC44C806377}.Release|Any CPU.ActiveCfg = Release|Any CPU - {12D7F445-1A22-4695-B174-6FC44C806377}.Release|Any CPU.Build.0 = Release|Any CPU - {12D7F445-1A22-4695-B174-6FC44C806377}.Release|x64.ActiveCfg = Release|Any CPU - {12D7F445-1A22-4695-B174-6FC44C806377}.Release|x64.Build.0 = Release|Any CPU + {523EB315-1A01-4F13-9EDE-266FE8111AB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {523EB315-1A01-4F13-9EDE-266FE8111AB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {523EB315-1A01-4F13-9EDE-266FE8111AB6}.Debug|x64.ActiveCfg = Debug|Any CPU + {523EB315-1A01-4F13-9EDE-266FE8111AB6}.Debug|x64.Build.0 = Debug|Any CPU + {523EB315-1A01-4F13-9EDE-266FE8111AB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {523EB315-1A01-4F13-9EDE-266FE8111AB6}.Release|Any CPU.Build.0 = Release|Any CPU + {523EB315-1A01-4F13-9EDE-266FE8111AB6}.Release|x64.ActiveCfg = Release|Any CPU + {523EB315-1A01-4F13-9EDE-266FE8111AB6}.Release|x64.Build.0 = Release|Any CPU + {0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5}.Debug|x64.ActiveCfg = Debug|Any CPU + {0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5}.Debug|x64.Build.0 = Debug|Any CPU + {0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5}.Release|Any CPU.Build.0 = Release|Any CPU + {0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5}.Release|x64.ActiveCfg = Release|Any CPU + {0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5}.Release|x64.Build.0 = Release|Any CPU + {8A60B832-8B1F-44A9-9999-C0C898ED6D82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8A60B832-8B1F-44A9-9999-C0C898ED6D82}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8A60B832-8B1F-44A9-9999-C0C898ED6D82}.Debug|x64.ActiveCfg = Debug|Any CPU + {8A60B832-8B1F-44A9-9999-C0C898ED6D82}.Debug|x64.Build.0 = Debug|Any CPU + {8A60B832-8B1F-44A9-9999-C0C898ED6D82}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8A60B832-8B1F-44A9-9999-C0C898ED6D82}.Release|Any CPU.Build.0 = Release|Any CPU + {8A60B832-8B1F-44A9-9999-C0C898ED6D82}.Release|x64.ActiveCfg = Release|Any CPU + {8A60B832-8B1F-44A9-9999-C0C898ED6D82}.Release|x64.Build.0 = Release|Any CPU + {CE286A13-1FFC-417B-8CC0-FE4991F3687B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CE286A13-1FFC-417B-8CC0-FE4991F3687B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CE286A13-1FFC-417B-8CC0-FE4991F3687B}.Debug|x64.ActiveCfg = Debug|Any CPU + {CE286A13-1FFC-417B-8CC0-FE4991F3687B}.Debug|x64.Build.0 = Debug|Any CPU + {CE286A13-1FFC-417B-8CC0-FE4991F3687B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CE286A13-1FFC-417B-8CC0-FE4991F3687B}.Release|Any CPU.Build.0 = Release|Any CPU + {CE286A13-1FFC-417B-8CC0-FE4991F3687B}.Release|x64.ActiveCfg = Release|Any CPU + {CE286A13-1FFC-417B-8CC0-FE4991F3687B}.Release|x64.Build.0 = Release|Any CPU + {D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2}.Debug|x64.ActiveCfg = Debug|Any CPU + {D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2}.Debug|x64.Build.0 = Debug|Any CPU + {D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2}.Release|Any CPU.Build.0 = Release|Any CPU + {D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2}.Release|x64.ActiveCfg = Release|Any CPU + {D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2}.Release|x64.Build.0 = Release|Any CPU + {5FC55EB3-2F84-45C4-9310-33A998F4DA70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5FC55EB3-2F84-45C4-9310-33A998F4DA70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5FC55EB3-2F84-45C4-9310-33A998F4DA70}.Debug|x64.ActiveCfg = Debug|Any CPU + {5FC55EB3-2F84-45C4-9310-33A998F4DA70}.Debug|x64.Build.0 = Debug|Any CPU + {5FC55EB3-2F84-45C4-9310-33A998F4DA70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5FC55EB3-2F84-45C4-9310-33A998F4DA70}.Release|Any CPU.Build.0 = Release|Any CPU + {5FC55EB3-2F84-45C4-9310-33A998F4DA70}.Release|x64.ActiveCfg = Release|Any CPU + {5FC55EB3-2F84-45C4-9310-33A998F4DA70}.Release|x64.Build.0 = Release|Any CPU + {B403856A-6BF8-43C3-AD17-D3DF96F26D77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B403856A-6BF8-43C3-AD17-D3DF96F26D77}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B403856A-6BF8-43C3-AD17-D3DF96F26D77}.Debug|x64.ActiveCfg = Debug|Any CPU + {B403856A-6BF8-43C3-AD17-D3DF96F26D77}.Debug|x64.Build.0 = Debug|Any CPU + {B403856A-6BF8-43C3-AD17-D3DF96F26D77}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B403856A-6BF8-43C3-AD17-D3DF96F26D77}.Release|Any CPU.Build.0 = Release|Any CPU + {B403856A-6BF8-43C3-AD17-D3DF96F26D77}.Release|x64.ActiveCfg = Release|Any CPU + {B403856A-6BF8-43C3-AD17-D3DF96F26D77}.Release|x64.Build.0 = Release|Any CPU + {D83169F2-E05E-49E0-82BF-164D3F3C3174}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D83169F2-E05E-49E0-82BF-164D3F3C3174}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D83169F2-E05E-49E0-82BF-164D3F3C3174}.Debug|x64.ActiveCfg = Debug|Any CPU + {D83169F2-E05E-49E0-82BF-164D3F3C3174}.Debug|x64.Build.0 = Debug|Any CPU + {D83169F2-E05E-49E0-82BF-164D3F3C3174}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D83169F2-E05E-49E0-82BF-164D3F3C3174}.Release|Any CPU.Build.0 = Release|Any CPU + {D83169F2-E05E-49E0-82BF-164D3F3C3174}.Release|x64.ActiveCfg = Release|Any CPU + {D83169F2-E05E-49E0-82BF-164D3F3C3174}.Release|x64.Build.0 = Release|Any CPU + {28BB497F-5DC8-4D00-AC6B-2F7BECDD1797}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28BB497F-5DC8-4D00-AC6B-2F7BECDD1797}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28BB497F-5DC8-4D00-AC6B-2F7BECDD1797}.Debug|x64.ActiveCfg = Debug|Any CPU + {28BB497F-5DC8-4D00-AC6B-2F7BECDD1797}.Debug|x64.Build.0 = Debug|Any CPU + {28BB497F-5DC8-4D00-AC6B-2F7BECDD1797}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28BB497F-5DC8-4D00-AC6B-2F7BECDD1797}.Release|Any CPU.Build.0 = Release|Any CPU + {28BB497F-5DC8-4D00-AC6B-2F7BECDD1797}.Release|x64.ActiveCfg = Release|Any CPU + {28BB497F-5DC8-4D00-AC6B-2F7BECDD1797}.Release|x64.Build.0 = Release|Any CPU + {58CF33D3-290B-4B68-865C-B776A7B5AC43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {58CF33D3-290B-4B68-865C-B776A7B5AC43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {58CF33D3-290B-4B68-865C-B776A7B5AC43}.Debug|x64.ActiveCfg = Debug|Any CPU + {58CF33D3-290B-4B68-865C-B776A7B5AC43}.Debug|x64.Build.0 = Debug|Any CPU + {58CF33D3-290B-4B68-865C-B776A7B5AC43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {58CF33D3-290B-4B68-865C-B776A7B5AC43}.Release|Any CPU.Build.0 = Release|Any CPU + {58CF33D3-290B-4B68-865C-B776A7B5AC43}.Release|x64.ActiveCfg = Release|Any CPU + {58CF33D3-290B-4B68-865C-B776A7B5AC43}.Release|x64.Build.0 = Release|Any CPU + {5C22CA57-94F1-47C7-B27F-7F91DFD480DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5C22CA57-94F1-47C7-B27F-7F91DFD480DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5C22CA57-94F1-47C7-B27F-7F91DFD480DA}.Debug|x64.ActiveCfg = Debug|Any CPU + {5C22CA57-94F1-47C7-B27F-7F91DFD480DA}.Debug|x64.Build.0 = Debug|Any CPU + {5C22CA57-94F1-47C7-B27F-7F91DFD480DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5C22CA57-94F1-47C7-B27F-7F91DFD480DA}.Release|Any CPU.Build.0 = Release|Any CPU + {5C22CA57-94F1-47C7-B27F-7F91DFD480DA}.Release|x64.ActiveCfg = Release|Any CPU + {5C22CA57-94F1-47C7-B27F-7F91DFD480DA}.Release|x64.Build.0 = Release|Any CPU + {435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB}.Debug|x64.ActiveCfg = Debug|Any CPU + {435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB}.Debug|x64.Build.0 = Debug|Any CPU + {435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB}.Release|Any CPU.Build.0 = Release|Any CPU + {435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB}.Release|x64.ActiveCfg = Release|Any CPU + {435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB}.Release|x64.Build.0 = Release|Any CPU + {412A5797-7D42-4F7C-96AB-4F784872ED08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {412A5797-7D42-4F7C-96AB-4F784872ED08}.Debug|Any CPU.Build.0 = Debug|Any CPU + {412A5797-7D42-4F7C-96AB-4F784872ED08}.Debug|x64.ActiveCfg = Debug|Any CPU + {412A5797-7D42-4F7C-96AB-4F784872ED08}.Debug|x64.Build.0 = Debug|Any CPU + {412A5797-7D42-4F7C-96AB-4F784872ED08}.Release|Any CPU.ActiveCfg = Release|Any CPU + {412A5797-7D42-4F7C-96AB-4F784872ED08}.Release|Any CPU.Build.0 = Release|Any CPU + {412A5797-7D42-4F7C-96AB-4F784872ED08}.Release|x64.ActiveCfg = Release|Any CPU + {412A5797-7D42-4F7C-96AB-4F784872ED08}.Release|x64.Build.0 = Release|Any CPU + {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}.Debug|x64.ActiveCfg = Debug|Any CPU + {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}.Debug|x64.Build.0 = Debug|Any CPU + {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}.Release|Any CPU.Build.0 = Release|Any CPU + {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}.Release|x64.ActiveCfg = Release|Any CPU + {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}.Release|x64.Build.0 = Release|Any CPU + {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Debug|x64.ActiveCfg = Debug|Any CPU + {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Debug|x64.Build.0 = Debug|Any CPU + {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Release|Any CPU.Build.0 = Release|Any CPU + {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Release|x64.ActiveCfg = Release|Any CPU + {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Release|x64.Build.0 = Release|Any CPU + {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Debug|x64.ActiveCfg = Debug|Any CPU + {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Debug|x64.Build.0 = Debug|Any CPU + {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Release|Any CPU.Build.0 = Release|Any CPU + {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Release|x64.ActiveCfg = Release|Any CPU + {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Release|x64.Build.0 = Release|Any CPU + {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Debug|x64.ActiveCfg = Debug|Any CPU + {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Debug|x64.Build.0 = Debug|Any CPU + {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Release|Any CPU.Build.0 = Release|Any CPU + {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Release|x64.ActiveCfg = Release|Any CPU + {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Release|x64.Build.0 = Release|Any CPU + {249E8BD4-C358-4358-93FA-78320D335014}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {249E8BD4-C358-4358-93FA-78320D335014}.Debug|Any CPU.Build.0 = Debug|Any CPU + {249E8BD4-C358-4358-93FA-78320D335014}.Debug|x64.ActiveCfg = Debug|Any CPU + {249E8BD4-C358-4358-93FA-78320D335014}.Debug|x64.Build.0 = Debug|Any CPU + {249E8BD4-C358-4358-93FA-78320D335014}.Release|Any CPU.ActiveCfg = Release|Any CPU + {249E8BD4-C358-4358-93FA-78320D335014}.Release|Any CPU.Build.0 = Release|Any CPU + {249E8BD4-C358-4358-93FA-78320D335014}.Release|x64.ActiveCfg = Release|Any CPU + {249E8BD4-C358-4358-93FA-78320D335014}.Release|x64.Build.0 = Release|Any CPU + {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}.Debug|x64.ActiveCfg = Debug|Any CPU + {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}.Debug|x64.Build.0 = Debug|Any CPU + {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}.Release|Any CPU.Build.0 = Release|Any CPU + {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}.Release|x64.ActiveCfg = Release|Any CPU + {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}.Release|x64.Build.0 = Release|Any CPU + {F12ADBBE-092F-4938-8ED7-F49B61F0F957}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F12ADBBE-092F-4938-8ED7-F49B61F0F957}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F12ADBBE-092F-4938-8ED7-F49B61F0F957}.Debug|x64.ActiveCfg = Debug|Any CPU + {F12ADBBE-092F-4938-8ED7-F49B61F0F957}.Debug|x64.Build.0 = Debug|Any CPU + {F12ADBBE-092F-4938-8ED7-F49B61F0F957}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F12ADBBE-092F-4938-8ED7-F49B61F0F957}.Release|Any CPU.Build.0 = Release|Any CPU + {F12ADBBE-092F-4938-8ED7-F49B61F0F957}.Release|x64.ActiveCfg = Release|Any CPU + {F12ADBBE-092F-4938-8ED7-F49B61F0F957}.Release|x64.Build.0 = Release|Any CPU + {04D3C12F-7221-4AE8-852D-4C616B6769E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {04D3C12F-7221-4AE8-852D-4C616B6769E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {04D3C12F-7221-4AE8-852D-4C616B6769E9}.Debug|x64.ActiveCfg = Debug|Any CPU + {04D3C12F-7221-4AE8-852D-4C616B6769E9}.Debug|x64.Build.0 = Debug|Any CPU + {04D3C12F-7221-4AE8-852D-4C616B6769E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {04D3C12F-7221-4AE8-852D-4C616B6769E9}.Release|Any CPU.Build.0 = Release|Any CPU + {04D3C12F-7221-4AE8-852D-4C616B6769E9}.Release|x64.ActiveCfg = Release|Any CPU + {04D3C12F-7221-4AE8-852D-4C616B6769E9}.Release|x64.Build.0 = Release|Any CPU + {D2009F94-EA9C-44F0-B210-C373F9FE3641}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D2009F94-EA9C-44F0-B210-C373F9FE3641}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D2009F94-EA9C-44F0-B210-C373F9FE3641}.Debug|x64.ActiveCfg = Debug|Any CPU + {D2009F94-EA9C-44F0-B210-C373F9FE3641}.Debug|x64.Build.0 = Debug|Any CPU + {D2009F94-EA9C-44F0-B210-C373F9FE3641}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D2009F94-EA9C-44F0-B210-C373F9FE3641}.Release|Any CPU.Build.0 = Release|Any CPU + {D2009F94-EA9C-44F0-B210-C373F9FE3641}.Release|x64.ActiveCfg = Release|Any CPU + {D2009F94-EA9C-44F0-B210-C373F9FE3641}.Release|x64.Build.0 = Release|Any CPU + {6586614A-39D8-412E-814C-3314F8A7909A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6586614A-39D8-412E-814C-3314F8A7909A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6586614A-39D8-412E-814C-3314F8A7909A}.Debug|x64.ActiveCfg = Debug|Any CPU + {6586614A-39D8-412E-814C-3314F8A7909A}.Debug|x64.Build.0 = Debug|Any CPU + {6586614A-39D8-412E-814C-3314F8A7909A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6586614A-39D8-412E-814C-3314F8A7909A}.Release|Any CPU.Build.0 = Release|Any CPU + {6586614A-39D8-412E-814C-3314F8A7909A}.Release|x64.ActiveCfg = Release|Any CPU + {6586614A-39D8-412E-814C-3314F8A7909A}.Release|x64.Build.0 = Release|Any CPU + {400854AA-AE3F-40EC-B5BF-C9F1257490AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {400854AA-AE3F-40EC-B5BF-C9F1257490AA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {400854AA-AE3F-40EC-B5BF-C9F1257490AA}.Debug|x64.ActiveCfg = Debug|Any CPU + {400854AA-AE3F-40EC-B5BF-C9F1257490AA}.Debug|x64.Build.0 = Debug|Any CPU + {400854AA-AE3F-40EC-B5BF-C9F1257490AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {400854AA-AE3F-40EC-B5BF-C9F1257490AA}.Release|Any CPU.Build.0 = Release|Any CPU + {400854AA-AE3F-40EC-B5BF-C9F1257490AA}.Release|x64.ActiveCfg = Release|Any CPU + {400854AA-AE3F-40EC-B5BF-C9F1257490AA}.Release|x64.Build.0 = Release|Any CPU + {0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E}.Debug|x64.ActiveCfg = Debug|Any CPU + {0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E}.Debug|x64.Build.0 = Debug|Any CPU + {0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E}.Release|Any CPU.Build.0 = Release|Any CPU + {0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E}.Release|x64.ActiveCfg = Release|Any CPU + {0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E}.Release|x64.Build.0 = Release|Any CPU + {C37FB18D-FBA1-49DF-96CD-24D6F65B66E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C37FB18D-FBA1-49DF-96CD-24D6F65B66E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C37FB18D-FBA1-49DF-96CD-24D6F65B66E1}.Debug|x64.ActiveCfg = Debug|Any CPU + {C37FB18D-FBA1-49DF-96CD-24D6F65B66E1}.Debug|x64.Build.0 = Debug|Any CPU + {C37FB18D-FBA1-49DF-96CD-24D6F65B66E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C37FB18D-FBA1-49DF-96CD-24D6F65B66E1}.Release|Any CPU.Build.0 = Release|Any CPU + {C37FB18D-FBA1-49DF-96CD-24D6F65B66E1}.Release|x64.ActiveCfg = Release|Any CPU + {C37FB18D-FBA1-49DF-96CD-24D6F65B66E1}.Release|x64.Build.0 = Release|Any CPU + {C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0}.Debug|x64.ActiveCfg = Debug|Any CPU + {C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0}.Debug|x64.Build.0 = Debug|Any CPU + {C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0}.Release|Any CPU.Build.0 = Release|Any CPU + {C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0}.Release|x64.ActiveCfg = Release|Any CPU + {C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0}.Release|x64.Build.0 = Release|Any CPU + {89D032A8-14FB-4C2F-A112-CB7FAFCA2B62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {89D032A8-14FB-4C2F-A112-CB7FAFCA2B62}.Debug|Any CPU.Build.0 = Debug|Any CPU + {89D032A8-14FB-4C2F-A112-CB7FAFCA2B62}.Debug|x64.ActiveCfg = Debug|Any CPU + {89D032A8-14FB-4C2F-A112-CB7FAFCA2B62}.Debug|x64.Build.0 = Debug|Any CPU + {89D032A8-14FB-4C2F-A112-CB7FAFCA2B62}.Release|Any CPU.ActiveCfg = Release|Any CPU + {89D032A8-14FB-4C2F-A112-CB7FAFCA2B62}.Release|Any CPU.Build.0 = Release|Any CPU + {89D032A8-14FB-4C2F-A112-CB7FAFCA2B62}.Release|x64.ActiveCfg = Release|Any CPU + {89D032A8-14FB-4C2F-A112-CB7FAFCA2B62}.Release|x64.Build.0 = Release|Any CPU + {EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7}.Debug|x64.ActiveCfg = Debug|Any CPU + {EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7}.Debug|x64.Build.0 = Debug|Any CPU + {EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7}.Release|Any CPU.Build.0 = Release|Any CPU + {EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7}.Release|x64.ActiveCfg = Release|Any CPU + {EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7}.Release|x64.Build.0 = Release|Any CPU + {1F263FE5-649F-441D-AA55-B6012439E27F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F263FE5-649F-441D-AA55-B6012439E27F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F263FE5-649F-441D-AA55-B6012439E27F}.Debug|x64.ActiveCfg = Debug|Any CPU + {1F263FE5-649F-441D-AA55-B6012439E27F}.Debug|x64.Build.0 = Debug|Any CPU + {1F263FE5-649F-441D-AA55-B6012439E27F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F263FE5-649F-441D-AA55-B6012439E27F}.Release|Any CPU.Build.0 = Release|Any CPU + {1F263FE5-649F-441D-AA55-B6012439E27F}.Release|x64.ActiveCfg = Release|Any CPU + {1F263FE5-649F-441D-AA55-B6012439E27F}.Release|x64.Build.0 = Release|Any CPU + {F0A72797-A0E3-48BF-9E2E-34FD5ADD3441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0A72797-A0E3-48BF-9E2E-34FD5ADD3441}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0A72797-A0E3-48BF-9E2E-34FD5ADD3441}.Debug|x64.ActiveCfg = Debug|Any CPU + {F0A72797-A0E3-48BF-9E2E-34FD5ADD3441}.Debug|x64.Build.0 = Debug|Any CPU + {F0A72797-A0E3-48BF-9E2E-34FD5ADD3441}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0A72797-A0E3-48BF-9E2E-34FD5ADD3441}.Release|Any CPU.Build.0 = Release|Any CPU + {F0A72797-A0E3-48BF-9E2E-34FD5ADD3441}.Release|x64.ActiveCfg = Release|Any CPU + {F0A72797-A0E3-48BF-9E2E-34FD5ADD3441}.Release|x64.Build.0 = Release|Any CPU + {D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F}.Debug|x64.ActiveCfg = Debug|Any CPU + {D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F}.Debug|x64.Build.0 = Debug|Any CPU + {D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F}.Release|Any CPU.Build.0 = Release|Any CPU + {D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F}.Release|x64.ActiveCfg = Release|Any CPU + {D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F}.Release|x64.Build.0 = Release|Any CPU + {BD0D6CEF-6732-4E68-BB73-3215443D5243}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD0D6CEF-6732-4E68-BB73-3215443D5243}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD0D6CEF-6732-4E68-BB73-3215443D5243}.Debug|x64.ActiveCfg = Debug|Any CPU + {BD0D6CEF-6732-4E68-BB73-3215443D5243}.Debug|x64.Build.0 = Debug|Any CPU + {BD0D6CEF-6732-4E68-BB73-3215443D5243}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD0D6CEF-6732-4E68-BB73-3215443D5243}.Release|Any CPU.Build.0 = Release|Any CPU + {BD0D6CEF-6732-4E68-BB73-3215443D5243}.Release|x64.ActiveCfg = Release|Any CPU + {BD0D6CEF-6732-4E68-BB73-3215443D5243}.Release|x64.Build.0 = Release|Any CPU + {015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Debug|x64.ActiveCfg = Debug|Any CPU + {015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Debug|x64.Build.0 = Debug|Any CPU + {015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Release|Any CPU.Build.0 = Release|Any CPU + {015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Release|x64.ActiveCfg = Release|Any CPU + {015C4181-A8D9-4FA5-89B9-38A37FA9D31D}.Release|x64.Build.0 = Release|Any CPU + {F5466774-9B47-478A-BA9C-7BED9E0D923D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5466774-9B47-478A-BA9C-7BED9E0D923D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5466774-9B47-478A-BA9C-7BED9E0D923D}.Debug|x64.ActiveCfg = Debug|Any CPU + {F5466774-9B47-478A-BA9C-7BED9E0D923D}.Debug|x64.Build.0 = Debug|Any CPU + {F5466774-9B47-478A-BA9C-7BED9E0D923D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5466774-9B47-478A-BA9C-7BED9E0D923D}.Release|Any CPU.Build.0 = Release|Any CPU + {F5466774-9B47-478A-BA9C-7BED9E0D923D}.Release|x64.ActiveCfg = Release|Any CPU + {F5466774-9B47-478A-BA9C-7BED9E0D923D}.Release|x64.Build.0 = Release|Any CPU + {FBFCAB1B-27D9-4479-B551-01D7FF7510C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FBFCAB1B-27D9-4479-B551-01D7FF7510C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FBFCAB1B-27D9-4479-B551-01D7FF7510C2}.Debug|x64.ActiveCfg = Debug|Any CPU + {FBFCAB1B-27D9-4479-B551-01D7FF7510C2}.Debug|x64.Build.0 = Debug|Any CPU + {FBFCAB1B-27D9-4479-B551-01D7FF7510C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FBFCAB1B-27D9-4479-B551-01D7FF7510C2}.Release|Any CPU.Build.0 = Release|Any CPU + {FBFCAB1B-27D9-4479-B551-01D7FF7510C2}.Release|x64.ActiveCfg = Release|Any CPU + {FBFCAB1B-27D9-4479-B551-01D7FF7510C2}.Release|x64.Build.0 = Release|Any CPU + {AC180C70-85EE-418D-8290-CA019F6FA643}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC180C70-85EE-418D-8290-CA019F6FA643}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC180C70-85EE-418D-8290-CA019F6FA643}.Debug|x64.ActiveCfg = Debug|Any CPU + {AC180C70-85EE-418D-8290-CA019F6FA643}.Debug|x64.Build.0 = Debug|Any CPU + {AC180C70-85EE-418D-8290-CA019F6FA643}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC180C70-85EE-418D-8290-CA019F6FA643}.Release|Any CPU.Build.0 = Release|Any CPU + {AC180C70-85EE-418D-8290-CA019F6FA643}.Release|x64.ActiveCfg = Release|Any CPU + {AC180C70-85EE-418D-8290-CA019F6FA643}.Release|x64.Build.0 = Release|Any CPU + {D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE}.Debug|x64.ActiveCfg = Debug|Any CPU + {D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE}.Debug|x64.Build.0 = Debug|Any CPU + {D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE}.Release|Any CPU.Build.0 = Release|Any CPU + {D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE}.Release|x64.ActiveCfg = Release|Any CPU + {D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE}.Release|x64.Build.0 = Release|Any CPU + {82B691D6-564A-4F4A-B07D-552EB63DCBE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {82B691D6-564A-4F4A-B07D-552EB63DCBE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {82B691D6-564A-4F4A-B07D-552EB63DCBE7}.Debug|x64.ActiveCfg = Debug|Any CPU + {82B691D6-564A-4F4A-B07D-552EB63DCBE7}.Debug|x64.Build.0 = Debug|Any CPU + {82B691D6-564A-4F4A-B07D-552EB63DCBE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {82B691D6-564A-4F4A-B07D-552EB63DCBE7}.Release|Any CPU.Build.0 = Release|Any CPU + {82B691D6-564A-4F4A-B07D-552EB63DCBE7}.Release|x64.ActiveCfg = Release|Any CPU + {82B691D6-564A-4F4A-B07D-552EB63DCBE7}.Release|x64.Build.0 = Release|Any CPU + {0F58FA8E-CA9F-47EB-885D-F422955F9983}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F58FA8E-CA9F-47EB-885D-F422955F9983}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F58FA8E-CA9F-47EB-885D-F422955F9983}.Debug|x64.ActiveCfg = Debug|Any CPU + {0F58FA8E-CA9F-47EB-885D-F422955F9983}.Debug|x64.Build.0 = Debug|Any CPU + {0F58FA8E-CA9F-47EB-885D-F422955F9983}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F58FA8E-CA9F-47EB-885D-F422955F9983}.Release|Any CPU.Build.0 = Release|Any CPU + {0F58FA8E-CA9F-47EB-885D-F422955F9983}.Release|x64.ActiveCfg = Release|Any CPU + {0F58FA8E-CA9F-47EB-885D-F422955F9983}.Release|x64.Build.0 = Release|Any CPU + {8D4550FA-878A-4554-B856-614B4ABF8721}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D4550FA-878A-4554-B856-614B4ABF8721}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D4550FA-878A-4554-B856-614B4ABF8721}.Debug|x64.ActiveCfg = Debug|Any CPU + {8D4550FA-878A-4554-B856-614B4ABF8721}.Debug|x64.Build.0 = Debug|Any CPU + {8D4550FA-878A-4554-B856-614B4ABF8721}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D4550FA-878A-4554-B856-614B4ABF8721}.Release|Any CPU.Build.0 = Release|Any CPU + {8D4550FA-878A-4554-B856-614B4ABF8721}.Release|x64.ActiveCfg = Release|Any CPU + {8D4550FA-878A-4554-B856-614B4ABF8721}.Release|x64.Build.0 = Release|Any CPU + {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Debug|x64.ActiveCfg = Debug|Any CPU + {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Debug|x64.Build.0 = Debug|Any CPU + {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Release|Any CPU.Build.0 = Release|Any CPU + {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Release|x64.ActiveCfg = Release|Any CPU + {7B0EDB07-D3AE-4077-9A23-35CA6556E791}.Release|x64.Build.0 = Release|Any CPU + {E376F15A-3C13-4DBF-B972-E03D2350D7C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E376F15A-3C13-4DBF-B972-E03D2350D7C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E376F15A-3C13-4DBF-B972-E03D2350D7C4}.Debug|x64.ActiveCfg = Debug|Any CPU + {E376F15A-3C13-4DBF-B972-E03D2350D7C4}.Debug|x64.Build.0 = Debug|Any CPU + {E376F15A-3C13-4DBF-B972-E03D2350D7C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E376F15A-3C13-4DBF-B972-E03D2350D7C4}.Release|Any CPU.Build.0 = Release|Any CPU + {E376F15A-3C13-4DBF-B972-E03D2350D7C4}.Release|x64.ActiveCfg = Release|Any CPU + {E376F15A-3C13-4DBF-B972-E03D2350D7C4}.Release|x64.Build.0 = Release|Any CPU + {8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Debug|x64.ActiveCfg = Debug|Any CPU + {8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Debug|x64.Build.0 = Debug|Any CPU + {8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Release|Any CPU.Build.0 = Release|Any CPU + {8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Release|x64.ActiveCfg = Release|Any CPU + {8AB652AF-3957-42F9-8F3E-FAFE56A44BE1}.Release|x64.Build.0 = Release|Any CPU + {766E3633-7B82-49CC-B012-CAE6264D4628}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {766E3633-7B82-49CC-B012-CAE6264D4628}.Debug|Any CPU.Build.0 = Debug|Any CPU + {766E3633-7B82-49CC-B012-CAE6264D4628}.Debug|x64.ActiveCfg = Debug|Any CPU + {766E3633-7B82-49CC-B012-CAE6264D4628}.Debug|x64.Build.0 = Debug|Any CPU + {766E3633-7B82-49CC-B012-CAE6264D4628}.Release|Any CPU.ActiveCfg = Release|Any CPU + {766E3633-7B82-49CC-B012-CAE6264D4628}.Release|Any CPU.Build.0 = Release|Any CPU + {766E3633-7B82-49CC-B012-CAE6264D4628}.Release|x64.ActiveCfg = Release|Any CPU + {766E3633-7B82-49CC-B012-CAE6264D4628}.Release|x64.Build.0 = Release|Any CPU + {B7003322-212E-4568-9B61-95DB67CABC3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B7003322-212E-4568-9B61-95DB67CABC3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7003322-212E-4568-9B61-95DB67CABC3F}.Debug|x64.ActiveCfg = Debug|Any CPU + {B7003322-212E-4568-9B61-95DB67CABC3F}.Debug|x64.Build.0 = Debug|Any CPU + {B7003322-212E-4568-9B61-95DB67CABC3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B7003322-212E-4568-9B61-95DB67CABC3F}.Release|Any CPU.Build.0 = Release|Any CPU + {B7003322-212E-4568-9B61-95DB67CABC3F}.Release|x64.ActiveCfg = Release|Any CPU + {B7003322-212E-4568-9B61-95DB67CABC3F}.Release|x64.Build.0 = Release|Any CPU + {301961E7-03E9-4955-95E6-F6EFF2E284AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {301961E7-03E9-4955-95E6-F6EFF2E284AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {301961E7-03E9-4955-95E6-F6EFF2E284AD}.Debug|x64.ActiveCfg = Debug|Any CPU + {301961E7-03E9-4955-95E6-F6EFF2E284AD}.Debug|x64.Build.0 = Debug|Any CPU + {301961E7-03E9-4955-95E6-F6EFF2E284AD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {301961E7-03E9-4955-95E6-F6EFF2E284AD}.Release|Any CPU.Build.0 = Release|Any CPU + {301961E7-03E9-4955-95E6-F6EFF2E284AD}.Release|x64.ActiveCfg = Release|Any CPU + {301961E7-03E9-4955-95E6-F6EFF2E284AD}.Release|x64.Build.0 = Release|Any CPU + {6D54B0C4-CB92-4C86-856D-F02EDC574B49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D54B0C4-CB92-4C86-856D-F02EDC574B49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D54B0C4-CB92-4C86-856D-F02EDC574B49}.Debug|x64.ActiveCfg = Debug|Any CPU + {6D54B0C4-CB92-4C86-856D-F02EDC574B49}.Debug|x64.Build.0 = Debug|Any CPU + {6D54B0C4-CB92-4C86-856D-F02EDC574B49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D54B0C4-CB92-4C86-856D-F02EDC574B49}.Release|Any CPU.Build.0 = Release|Any CPU + {6D54B0C4-CB92-4C86-856D-F02EDC574B49}.Release|x64.ActiveCfg = Release|Any CPU + {6D54B0C4-CB92-4C86-856D-F02EDC574B49}.Release|x64.Build.0 = Release|Any CPU + {7323D590-BE85-4320-BBC6-5DB44CF0D6BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7323D590-BE85-4320-BBC6-5DB44CF0D6BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7323D590-BE85-4320-BBC6-5DB44CF0D6BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {7323D590-BE85-4320-BBC6-5DB44CF0D6BE}.Debug|x64.Build.0 = Debug|Any CPU + {7323D590-BE85-4320-BBC6-5DB44CF0D6BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7323D590-BE85-4320-BBC6-5DB44CF0D6BE}.Release|Any CPU.Build.0 = Release|Any CPU + {7323D590-BE85-4320-BBC6-5DB44CF0D6BE}.Release|x64.ActiveCfg = Release|Any CPU + {7323D590-BE85-4320-BBC6-5DB44CF0D6BE}.Release|x64.Build.0 = Release|Any CPU + {B2EEE403-4F65-4344-8728-57A5F47F745D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B2EEE403-4F65-4344-8728-57A5F47F745D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B2EEE403-4F65-4344-8728-57A5F47F745D}.Debug|x64.ActiveCfg = Debug|Any CPU + {B2EEE403-4F65-4344-8728-57A5F47F745D}.Debug|x64.Build.0 = Debug|Any CPU + {B2EEE403-4F65-4344-8728-57A5F47F745D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B2EEE403-4F65-4344-8728-57A5F47F745D}.Release|Any CPU.Build.0 = Release|Any CPU + {B2EEE403-4F65-4344-8728-57A5F47F745D}.Release|x64.ActiveCfg = Release|Any CPU + {B2EEE403-4F65-4344-8728-57A5F47F745D}.Release|x64.Build.0 = Release|Any CPU + {D4795F8B-48FC-4CB4-8144-A5679B37D398}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4795F8B-48FC-4CB4-8144-A5679B37D398}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4795F8B-48FC-4CB4-8144-A5679B37D398}.Debug|x64.ActiveCfg = Debug|Any CPU + {D4795F8B-48FC-4CB4-8144-A5679B37D398}.Debug|x64.Build.0 = Debug|Any CPU + {D4795F8B-48FC-4CB4-8144-A5679B37D398}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4795F8B-48FC-4CB4-8144-A5679B37D398}.Release|Any CPU.Build.0 = Release|Any CPU + {D4795F8B-48FC-4CB4-8144-A5679B37D398}.Release|x64.ActiveCfg = Release|Any CPU + {D4795F8B-48FC-4CB4-8144-A5679B37D398}.Release|x64.Build.0 = Release|Any CPU + {6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7}.Debug|x64.ActiveCfg = Debug|Any CPU + {6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7}.Debug|x64.Build.0 = Debug|Any CPU + {6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7}.Release|Any CPU.Build.0 = Release|Any CPU + {6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7}.Release|x64.ActiveCfg = Release|Any CPU + {6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7}.Release|x64.Build.0 = Release|Any CPU + {8AD935E1-2676-4C60-9D1A-F3422AC04DA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8AD935E1-2676-4C60-9D1A-F3422AC04DA9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8AD935E1-2676-4C60-9D1A-F3422AC04DA9}.Debug|x64.ActiveCfg = Debug|Any CPU + {8AD935E1-2676-4C60-9D1A-F3422AC04DA9}.Debug|x64.Build.0 = Debug|Any CPU + {8AD935E1-2676-4C60-9D1A-F3422AC04DA9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8AD935E1-2676-4C60-9D1A-F3422AC04DA9}.Release|Any CPU.Build.0 = Release|Any CPU + {8AD935E1-2676-4C60-9D1A-F3422AC04DA9}.Release|x64.ActiveCfg = Release|Any CPU + {8AD935E1-2676-4C60-9D1A-F3422AC04DA9}.Release|x64.Build.0 = Release|Any CPU + {B43AD1DB-552A-445F-81C2-193876F434C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B43AD1DB-552A-445F-81C2-193876F434C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B43AD1DB-552A-445F-81C2-193876F434C4}.Debug|x64.ActiveCfg = Debug|Any CPU + {B43AD1DB-552A-445F-81C2-193876F434C4}.Debug|x64.Build.0 = Debug|Any CPU + {B43AD1DB-552A-445F-81C2-193876F434C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B43AD1DB-552A-445F-81C2-193876F434C4}.Release|Any CPU.Build.0 = Release|Any CPU + {B43AD1DB-552A-445F-81C2-193876F434C4}.Release|x64.ActiveCfg = Release|Any CPU + {B43AD1DB-552A-445F-81C2-193876F434C4}.Release|x64.Build.0 = Release|Any CPU + {F1D5483E-8BED-4B4D-A2C7-573B0527E298}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1D5483E-8BED-4B4D-A2C7-573B0527E298}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1D5483E-8BED-4B4D-A2C7-573B0527E298}.Debug|x64.ActiveCfg = Debug|Any CPU + {F1D5483E-8BED-4B4D-A2C7-573B0527E298}.Debug|x64.Build.0 = Debug|Any CPU + {F1D5483E-8BED-4B4D-A2C7-573B0527E298}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1D5483E-8BED-4B4D-A2C7-573B0527E298}.Release|Any CPU.Build.0 = Release|Any CPU + {F1D5483E-8BED-4B4D-A2C7-573B0527E298}.Release|x64.ActiveCfg = Release|Any CPU + {F1D5483E-8BED-4B4D-A2C7-573B0527E298}.Release|x64.Build.0 = Release|Any CPU + {83A159C7-8917-4A3F-92F4-0609368D3267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {83A159C7-8917-4A3F-92F4-0609368D3267}.Debug|Any CPU.Build.0 = Debug|Any CPU + {83A159C7-8917-4A3F-92F4-0609368D3267}.Debug|x64.ActiveCfg = Debug|Any CPU + {83A159C7-8917-4A3F-92F4-0609368D3267}.Debug|x64.Build.0 = Debug|Any CPU + {83A159C7-8917-4A3F-92F4-0609368D3267}.Release|Any CPU.ActiveCfg = Release|Any CPU + {83A159C7-8917-4A3F-92F4-0609368D3267}.Release|Any CPU.Build.0 = Release|Any CPU + {83A159C7-8917-4A3F-92F4-0609368D3267}.Release|x64.ActiveCfg = Release|Any CPU + {83A159C7-8917-4A3F-92F4-0609368D3267}.Release|x64.Build.0 = Release|Any CPU + {F5C03CF8-E7F0-40C9-8F14-3171956A57A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5C03CF8-E7F0-40C9-8F14-3171956A57A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5C03CF8-E7F0-40C9-8F14-3171956A57A5}.Debug|x64.ActiveCfg = Debug|Any CPU + {F5C03CF8-E7F0-40C9-8F14-3171956A57A5}.Debug|x64.Build.0 = Debug|Any CPU + {F5C03CF8-E7F0-40C9-8F14-3171956A57A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5C03CF8-E7F0-40C9-8F14-3171956A57A5}.Release|Any CPU.Build.0 = Release|Any CPU + {F5C03CF8-E7F0-40C9-8F14-3171956A57A5}.Release|x64.ActiveCfg = Release|Any CPU + {F5C03CF8-E7F0-40C9-8F14-3171956A57A5}.Release|x64.Build.0 = Release|Any CPU + {3D8FA0B9-D669-418C-8111-F2B772BA47A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3D8FA0B9-D669-418C-8111-F2B772BA47A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3D8FA0B9-D669-418C-8111-F2B772BA47A6}.Debug|x64.ActiveCfg = Debug|Any CPU + {3D8FA0B9-D669-418C-8111-F2B772BA47A6}.Debug|x64.Build.0 = Debug|Any CPU + {3D8FA0B9-D669-418C-8111-F2B772BA47A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3D8FA0B9-D669-418C-8111-F2B772BA47A6}.Release|Any CPU.Build.0 = Release|Any CPU + {3D8FA0B9-D669-418C-8111-F2B772BA47A6}.Release|x64.ActiveCfg = Release|Any CPU + {3D8FA0B9-D669-418C-8111-F2B772BA47A6}.Release|x64.Build.0 = Release|Any CPU + {AE7980F2-6F94-4A93-9551-F47AD43FC545}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AE7980F2-6F94-4A93-9551-F47AD43FC545}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AE7980F2-6F94-4A93-9551-F47AD43FC545}.Debug|x64.ActiveCfg = Debug|Any CPU + {AE7980F2-6F94-4A93-9551-F47AD43FC545}.Debug|x64.Build.0 = Debug|Any CPU + {AE7980F2-6F94-4A93-9551-F47AD43FC545}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AE7980F2-6F94-4A93-9551-F47AD43FC545}.Release|Any CPU.Build.0 = Release|Any CPU + {AE7980F2-6F94-4A93-9551-F47AD43FC545}.Release|x64.ActiveCfg = Release|Any CPU + {AE7980F2-6F94-4A93-9551-F47AD43FC545}.Release|x64.Build.0 = Release|Any CPU + {023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C}.Debug|x64.ActiveCfg = Debug|Any CPU + {023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C}.Debug|x64.Build.0 = Debug|Any CPU + {023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C}.Release|Any CPU.Build.0 = Release|Any CPU + {023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C}.Release|x64.ActiveCfg = Release|Any CPU + {023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C}.Release|x64.Build.0 = Release|Any CPU + {41675E4A-0B1A-436B-910A-A296D35661DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {41675E4A-0B1A-436B-910A-A296D35661DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41675E4A-0B1A-436B-910A-A296D35661DC}.Debug|x64.ActiveCfg = Debug|Any CPU + {41675E4A-0B1A-436B-910A-A296D35661DC}.Debug|x64.Build.0 = Debug|Any CPU + {41675E4A-0B1A-436B-910A-A296D35661DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {41675E4A-0B1A-436B-910A-A296D35661DC}.Release|Any CPU.Build.0 = Release|Any CPU + {41675E4A-0B1A-436B-910A-A296D35661DC}.Release|x64.ActiveCfg = Release|Any CPU + {41675E4A-0B1A-436B-910A-A296D35661DC}.Release|x64.Build.0 = Release|Any CPU + {F43B5288-30F0-429E-A10F-9560E8CE318D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F43B5288-30F0-429E-A10F-9560E8CE318D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F43B5288-30F0-429E-A10F-9560E8CE318D}.Debug|x64.ActiveCfg = Debug|Any CPU + {F43B5288-30F0-429E-A10F-9560E8CE318D}.Debug|x64.Build.0 = Debug|Any CPU + {F43B5288-30F0-429E-A10F-9560E8CE318D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F43B5288-30F0-429E-A10F-9560E8CE318D}.Release|Any CPU.Build.0 = Release|Any CPU + {F43B5288-30F0-429E-A10F-9560E8CE318D}.Release|x64.ActiveCfg = Release|Any CPU + {F43B5288-30F0-429E-A10F-9560E8CE318D}.Release|x64.Build.0 = Release|Any CPU + {42A17DC6-7F8D-487A-98F0-1DAF6FF81A63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {42A17DC6-7F8D-487A-98F0-1DAF6FF81A63}.Debug|Any CPU.Build.0 = Debug|Any CPU + {42A17DC6-7F8D-487A-98F0-1DAF6FF81A63}.Debug|x64.ActiveCfg = Debug|Any CPU + {42A17DC6-7F8D-487A-98F0-1DAF6FF81A63}.Debug|x64.Build.0 = Debug|Any CPU + {42A17DC6-7F8D-487A-98F0-1DAF6FF81A63}.Release|Any CPU.ActiveCfg = Release|Any CPU + {42A17DC6-7F8D-487A-98F0-1DAF6FF81A63}.Release|Any CPU.Build.0 = Release|Any CPU + {42A17DC6-7F8D-487A-98F0-1DAF6FF81A63}.Release|x64.ActiveCfg = Release|Any CPU + {42A17DC6-7F8D-487A-98F0-1DAF6FF81A63}.Release|x64.Build.0 = Release|Any CPU + {E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F}.Debug|x64.ActiveCfg = Debug|Any CPU + {E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F}.Debug|x64.Build.0 = Debug|Any CPU + {E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F}.Release|Any CPU.Build.0 = Release|Any CPU + {E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F}.Release|x64.ActiveCfg = Release|Any CPU + {E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F}.Release|x64.Build.0 = Release|Any CPU + {386F0326-D591-4BED-A01A-91C0E9814467}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {386F0326-D591-4BED-A01A-91C0E9814467}.Debug|Any CPU.Build.0 = Debug|Any CPU + {386F0326-D591-4BED-A01A-91C0E9814467}.Debug|x64.ActiveCfg = Debug|Any CPU + {386F0326-D591-4BED-A01A-91C0E9814467}.Debug|x64.Build.0 = Debug|Any CPU + {386F0326-D591-4BED-A01A-91C0E9814467}.Release|Any CPU.ActiveCfg = Release|Any CPU + {386F0326-D591-4BED-A01A-91C0E9814467}.Release|Any CPU.Build.0 = Release|Any CPU + {386F0326-D591-4BED-A01A-91C0E9814467}.Release|x64.ActiveCfg = Release|Any CPU + {386F0326-D591-4BED-A01A-91C0E9814467}.Release|x64.Build.0 = Release|Any CPU + {9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4}.Debug|x64.ActiveCfg = Debug|Any CPU + {9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4}.Debug|x64.Build.0 = Debug|Any CPU + {9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4}.Release|Any CPU.Build.0 = Release|Any CPU + {9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4}.Release|x64.ActiveCfg = Release|Any CPU + {9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4}.Release|x64.Build.0 = Release|Any CPU + {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Debug|x64.ActiveCfg = Debug|Any CPU + {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Debug|x64.Build.0 = Debug|Any CPU + {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Release|Any CPU.Build.0 = Release|Any CPU + {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Release|x64.ActiveCfg = Release|Any CPU + {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Release|x64.Build.0 = Release|Any CPU + {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Debug|x64.ActiveCfg = Debug|Any CPU + {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Debug|x64.Build.0 = Debug|Any CPU + {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Release|Any CPU.Build.0 = Release|Any CPU + {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Release|x64.ActiveCfg = Release|Any CPU + {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Release|x64.Build.0 = Release|Any CPU + {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Debug|x64.ActiveCfg = Debug|Any CPU + {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Debug|x64.Build.0 = Debug|Any CPU + {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Release|Any CPU.Build.0 = Release|Any CPU + {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Release|x64.ActiveCfg = Release|Any CPU + {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Release|x64.Build.0 = Release|Any CPU + {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Debug|x64.ActiveCfg = Debug|Any CPU + {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Debug|x64.Build.0 = Debug|Any CPU + {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Release|Any CPU.Build.0 = Release|Any CPU + {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Release|x64.ActiveCfg = Release|Any CPU + {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Release|x64.Build.0 = Release|Any CPU + {06381F61-2C55-4322-9417-EA14F5F0E467}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06381F61-2C55-4322-9417-EA14F5F0E467}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06381F61-2C55-4322-9417-EA14F5F0E467}.Debug|x64.ActiveCfg = Debug|Any CPU + {06381F61-2C55-4322-9417-EA14F5F0E467}.Debug|x64.Build.0 = Debug|Any CPU + {06381F61-2C55-4322-9417-EA14F5F0E467}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06381F61-2C55-4322-9417-EA14F5F0E467}.Release|Any CPU.Build.0 = Release|Any CPU + {06381F61-2C55-4322-9417-EA14F5F0E467}.Release|x64.ActiveCfg = Release|Any CPU + {06381F61-2C55-4322-9417-EA14F5F0E467}.Release|x64.Build.0 = Release|Any CPU + {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Debug|x64.ActiveCfg = Debug|Any CPU + {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Debug|x64.Build.0 = Debug|Any CPU + {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Release|Any CPU.Build.0 = Release|Any CPU + {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Release|x64.ActiveCfg = Release|Any CPU + {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Release|x64.Build.0 = Release|Any CPU + {0B6512C6-64F0-4403-B074-67F3B95341D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B6512C6-64F0-4403-B074-67F3B95341D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B6512C6-64F0-4403-B074-67F3B95341D7}.Debug|x64.ActiveCfg = Debug|Any CPU + {0B6512C6-64F0-4403-B074-67F3B95341D7}.Debug|x64.Build.0 = Debug|Any CPU + {0B6512C6-64F0-4403-B074-67F3B95341D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B6512C6-64F0-4403-B074-67F3B95341D7}.Release|Any CPU.Build.0 = Release|Any CPU + {0B6512C6-64F0-4403-B074-67F3B95341D7}.Release|x64.ActiveCfg = Release|Any CPU + {0B6512C6-64F0-4403-B074-67F3B95341D7}.Release|x64.Build.0 = Release|Any CPU + {D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}.Debug|x64.ActiveCfg = Debug|Any CPU + {D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}.Debug|x64.Build.0 = Debug|Any CPU + {D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}.Release|Any CPU.Build.0 = Release|Any CPU + {D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}.Release|x64.ActiveCfg = Release|Any CPU + {D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}.Release|x64.Build.0 = Release|Any CPU + {A3637D23-8548-4665-B61B-A8F5B94837E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A3637D23-8548-4665-B61B-A8F5B94837E0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A3637D23-8548-4665-B61B-A8F5B94837E0}.Debug|x64.ActiveCfg = Debug|Any CPU + {A3637D23-8548-4665-B61B-A8F5B94837E0}.Debug|x64.Build.0 = Debug|Any CPU + {A3637D23-8548-4665-B61B-A8F5B94837E0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A3637D23-8548-4665-B61B-A8F5B94837E0}.Release|Any CPU.Build.0 = Release|Any CPU + {A3637D23-8548-4665-B61B-A8F5B94837E0}.Release|x64.ActiveCfg = Release|Any CPU + {A3637D23-8548-4665-B61B-A8F5B94837E0}.Release|x64.Build.0 = Release|Any CPU + {EF05D9C2-2F71-40C6-B90B-41E093979803}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF05D9C2-2F71-40C6-B90B-41E093979803}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF05D9C2-2F71-40C6-B90B-41E093979803}.Debug|x64.ActiveCfg = Debug|Any CPU + {EF05D9C2-2F71-40C6-B90B-41E093979803}.Debug|x64.Build.0 = Debug|Any CPU + {EF05D9C2-2F71-40C6-B90B-41E093979803}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF05D9C2-2F71-40C6-B90B-41E093979803}.Release|Any CPU.Build.0 = Release|Any CPU + {EF05D9C2-2F71-40C6-B90B-41E093979803}.Release|x64.ActiveCfg = Release|Any CPU + {EF05D9C2-2F71-40C6-B90B-41E093979803}.Release|x64.Build.0 = Release|Any CPU + {C5D05037-EE7F-4FEA-A5E9-40252398A615}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5D05037-EE7F-4FEA-A5E9-40252398A615}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5D05037-EE7F-4FEA-A5E9-40252398A615}.Debug|x64.ActiveCfg = Debug|Any CPU + {C5D05037-EE7F-4FEA-A5E9-40252398A615}.Debug|x64.Build.0 = Debug|Any CPU + {C5D05037-EE7F-4FEA-A5E9-40252398A615}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5D05037-EE7F-4FEA-A5E9-40252398A615}.Release|Any CPU.Build.0 = Release|Any CPU + {C5D05037-EE7F-4FEA-A5E9-40252398A615}.Release|x64.ActiveCfg = Release|Any CPU + {C5D05037-EE7F-4FEA-A5E9-40252398A615}.Release|x64.Build.0 = Release|Any CPU + {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Debug|x64.ActiveCfg = Debug|Any CPU + {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Debug|x64.Build.0 = Debug|Any CPU + {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Release|Any CPU.Build.0 = Release|Any CPU + {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Release|x64.ActiveCfg = Release|Any CPU + {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Release|x64.Build.0 = Release|Any CPU + {905DB539-092C-4365-ACA1-531D3F2A6665}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {905DB539-092C-4365-ACA1-531D3F2A6665}.Debug|Any CPU.Build.0 = Debug|Any CPU + {905DB539-092C-4365-ACA1-531D3F2A6665}.Debug|x64.ActiveCfg = Debug|Any CPU + {905DB539-092C-4365-ACA1-531D3F2A6665}.Debug|x64.Build.0 = Debug|Any CPU + {905DB539-092C-4365-ACA1-531D3F2A6665}.Release|Any CPU.ActiveCfg = Release|Any CPU + {905DB539-092C-4365-ACA1-531D3F2A6665}.Release|Any CPU.Build.0 = Release|Any CPU + {905DB539-092C-4365-ACA1-531D3F2A6665}.Release|x64.ActiveCfg = Release|Any CPU + {905DB539-092C-4365-ACA1-531D3F2A6665}.Release|x64.Build.0 = Release|Any CPU + {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Debug|x64.ActiveCfg = Debug|Any CPU + {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Debug|x64.Build.0 = Debug|Any CPU + {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Release|Any CPU.Build.0 = Release|Any CPU + {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Release|x64.ActiveCfg = Release|Any CPU + {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Release|x64.Build.0 = Release|Any CPU + {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6}.Debug|x64.ActiveCfg = Debug|Any CPU + {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6}.Debug|x64.Build.0 = Debug|Any CPU + {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6}.Release|Any CPU.Build.0 = Release|Any CPU + {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6}.Release|x64.ActiveCfg = Release|Any CPU + {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6}.Release|x64.Build.0 = Release|Any CPU + {FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28}.Debug|x64.ActiveCfg = Debug|Any CPU + {FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28}.Debug|x64.Build.0 = Debug|Any CPU + {FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28}.Release|Any CPU.Build.0 = Release|Any CPU + {FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28}.Release|x64.ActiveCfg = Release|Any CPU + {FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28}.Release|x64.Build.0 = Release|Any CPU + {FB5B1BFD-7540-430C-810D-A32A42B8509C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FB5B1BFD-7540-430C-810D-A32A42B8509C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FB5B1BFD-7540-430C-810D-A32A42B8509C}.Debug|x64.ActiveCfg = Debug|Any CPU + {FB5B1BFD-7540-430C-810D-A32A42B8509C}.Debug|x64.Build.0 = Debug|Any CPU + {FB5B1BFD-7540-430C-810D-A32A42B8509C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FB5B1BFD-7540-430C-810D-A32A42B8509C}.Release|Any CPU.Build.0 = Release|Any CPU + {FB5B1BFD-7540-430C-810D-A32A42B8509C}.Release|x64.ActiveCfg = Release|Any CPU + {FB5B1BFD-7540-430C-810D-A32A42B8509C}.Release|x64.Build.0 = Release|Any CPU + {B68AC832-60C4-41B4-85F9-0883A954852E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B68AC832-60C4-41B4-85F9-0883A954852E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B68AC832-60C4-41B4-85F9-0883A954852E}.Debug|x64.ActiveCfg = Debug|Any CPU + {B68AC832-60C4-41B4-85F9-0883A954852E}.Debug|x64.Build.0 = Debug|Any CPU + {B68AC832-60C4-41B4-85F9-0883A954852E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B68AC832-60C4-41B4-85F9-0883A954852E}.Release|Any CPU.Build.0 = Release|Any CPU + {B68AC832-60C4-41B4-85F9-0883A954852E}.Release|x64.ActiveCfg = Release|Any CPU + {B68AC832-60C4-41B4-85F9-0883A954852E}.Release|x64.Build.0 = Release|Any CPU + {8F816310-F5F3-4D09-BC16-FDD65FE0BDB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F816310-F5F3-4D09-BC16-FDD65FE0BDB5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F816310-F5F3-4D09-BC16-FDD65FE0BDB5}.Debug|x64.ActiveCfg = Debug|Any CPU + {8F816310-F5F3-4D09-BC16-FDD65FE0BDB5}.Debug|x64.Build.0 = Debug|Any CPU + {8F816310-F5F3-4D09-BC16-FDD65FE0BDB5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F816310-F5F3-4D09-BC16-FDD65FE0BDB5}.Release|Any CPU.Build.0 = Release|Any CPU + {8F816310-F5F3-4D09-BC16-FDD65FE0BDB5}.Release|x64.ActiveCfg = Release|Any CPU + {8F816310-F5F3-4D09-BC16-FDD65FE0BDB5}.Release|x64.Build.0 = Release|Any CPU + {1DD1C862-D01A-48E4-908A-A5C5F2F197FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1DD1C862-D01A-48E4-908A-A5C5F2F197FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1DD1C862-D01A-48E4-908A-A5C5F2F197FD}.Debug|x64.ActiveCfg = Debug|Any CPU + {1DD1C862-D01A-48E4-908A-A5C5F2F197FD}.Debug|x64.Build.0 = Debug|Any CPU + {1DD1C862-D01A-48E4-908A-A5C5F2F197FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DD1C862-D01A-48E4-908A-A5C5F2F197FD}.Release|Any CPU.Build.0 = Release|Any CPU + {1DD1C862-D01A-48E4-908A-A5C5F2F197FD}.Release|x64.ActiveCfg = Release|Any CPU + {1DD1C862-D01A-48E4-908A-A5C5F2F197FD}.Release|x64.Build.0 = Release|Any CPU + {41214881-80AE-4F6A-A83D-A0A43C28756C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {41214881-80AE-4F6A-A83D-A0A43C28756C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41214881-80AE-4F6A-A83D-A0A43C28756C}.Debug|x64.ActiveCfg = Debug|Any CPU + {41214881-80AE-4F6A-A83D-A0A43C28756C}.Debug|x64.Build.0 = Debug|Any CPU + {41214881-80AE-4F6A-A83D-A0A43C28756C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {41214881-80AE-4F6A-A83D-A0A43C28756C}.Release|Any CPU.Build.0 = Release|Any CPU + {41214881-80AE-4F6A-A83D-A0A43C28756C}.Release|x64.ActiveCfg = Release|Any CPU + {41214881-80AE-4F6A-A83D-A0A43C28756C}.Release|x64.Build.0 = Release|Any CPU + {847D0E8E-1B12-410C-985D-0714C8103610}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {847D0E8E-1B12-410C-985D-0714C8103610}.Debug|Any CPU.Build.0 = Debug|Any CPU + {847D0E8E-1B12-410C-985D-0714C8103610}.Debug|x64.ActiveCfg = Debug|Any CPU + {847D0E8E-1B12-410C-985D-0714C8103610}.Debug|x64.Build.0 = Debug|Any CPU + {847D0E8E-1B12-410C-985D-0714C8103610}.Release|Any CPU.ActiveCfg = Release|Any CPU + {847D0E8E-1B12-410C-985D-0714C8103610}.Release|Any CPU.Build.0 = Release|Any CPU + {847D0E8E-1B12-410C-985D-0714C8103610}.Release|x64.ActiveCfg = Release|Any CPU + {847D0E8E-1B12-410C-985D-0714C8103610}.Release|x64.Build.0 = Release|Any CPU + {0B862D4E-87C2-4042-A3CD-B8E1C4498268}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B862D4E-87C2-4042-A3CD-B8E1C4498268}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B862D4E-87C2-4042-A3CD-B8E1C4498268}.Debug|x64.ActiveCfg = Debug|Any CPU + {0B862D4E-87C2-4042-A3CD-B8E1C4498268}.Debug|x64.Build.0 = Debug|Any CPU + {0B862D4E-87C2-4042-A3CD-B8E1C4498268}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B862D4E-87C2-4042-A3CD-B8E1C4498268}.Release|Any CPU.Build.0 = Release|Any CPU + {0B862D4E-87C2-4042-A3CD-B8E1C4498268}.Release|x64.ActiveCfg = Release|Any CPU + {0B862D4E-87C2-4042-A3CD-B8E1C4498268}.Release|x64.Build.0 = Release|Any CPU + {D574FB86-CA7B-4587-A5F3-B66C520E54BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D574FB86-CA7B-4587-A5F3-B66C520E54BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D574FB86-CA7B-4587-A5F3-B66C520E54BD}.Debug|x64.ActiveCfg = Debug|Any CPU + {D574FB86-CA7B-4587-A5F3-B66C520E54BD}.Debug|x64.Build.0 = Debug|Any CPU + {D574FB86-CA7B-4587-A5F3-B66C520E54BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D574FB86-CA7B-4587-A5F3-B66C520E54BD}.Release|Any CPU.Build.0 = Release|Any CPU + {D574FB86-CA7B-4587-A5F3-B66C520E54BD}.Release|x64.ActiveCfg = Release|Any CPU + {D574FB86-CA7B-4587-A5F3-B66C520E54BD}.Release|x64.Build.0 = Release|Any CPU + {5F130015-615A-4C61-ADBF-CDDA00B30EC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5F130015-615A-4C61-ADBF-CDDA00B30EC1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F130015-615A-4C61-ADBF-CDDA00B30EC1}.Debug|x64.ActiveCfg = Debug|Any CPU + {5F130015-615A-4C61-ADBF-CDDA00B30EC1}.Debug|x64.Build.0 = Debug|Any CPU + {5F130015-615A-4C61-ADBF-CDDA00B30EC1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5F130015-615A-4C61-ADBF-CDDA00B30EC1}.Release|Any CPU.Build.0 = Release|Any CPU + {5F130015-615A-4C61-ADBF-CDDA00B30EC1}.Release|x64.ActiveCfg = Release|Any CPU + {5F130015-615A-4C61-ADBF-CDDA00B30EC1}.Release|x64.Build.0 = Release|Any CPU + {49F28BD5-D7ED-4809-8D4D-E6F5E964BB07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {49F28BD5-D7ED-4809-8D4D-E6F5E964BB07}.Debug|Any CPU.Build.0 = Debug|Any CPU + {49F28BD5-D7ED-4809-8D4D-E6F5E964BB07}.Debug|x64.ActiveCfg = Debug|Any CPU + {49F28BD5-D7ED-4809-8D4D-E6F5E964BB07}.Debug|x64.Build.0 = Debug|Any CPU + {49F28BD5-D7ED-4809-8D4D-E6F5E964BB07}.Release|Any CPU.ActiveCfg = Release|Any CPU + {49F28BD5-D7ED-4809-8D4D-E6F5E964BB07}.Release|Any CPU.Build.0 = Release|Any CPU + {49F28BD5-D7ED-4809-8D4D-E6F5E964BB07}.Release|x64.ActiveCfg = Release|Any CPU + {49F28BD5-D7ED-4809-8D4D-E6F5E964BB07}.Release|x64.Build.0 = Release|Any CPU + {E44D5116-EEEF-4664-8E47-3667AB8D6448}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E44D5116-EEEF-4664-8E47-3667AB8D6448}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E44D5116-EEEF-4664-8E47-3667AB8D6448}.Debug|x64.ActiveCfg = Debug|Any CPU + {E44D5116-EEEF-4664-8E47-3667AB8D6448}.Debug|x64.Build.0 = Debug|Any CPU + {E44D5116-EEEF-4664-8E47-3667AB8D6448}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E44D5116-EEEF-4664-8E47-3667AB8D6448}.Release|Any CPU.Build.0 = Release|Any CPU + {E44D5116-EEEF-4664-8E47-3667AB8D6448}.Release|x64.ActiveCfg = Release|Any CPU + {E44D5116-EEEF-4664-8E47-3667AB8D6448}.Release|x64.Build.0 = Release|Any CPU + {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF}.Debug|x64.ActiveCfg = Debug|Any CPU + {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF}.Debug|x64.Build.0 = Debug|Any CPU + {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF}.Release|Any CPU.Build.0 = Release|Any CPU + {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF}.Release|x64.ActiveCfg = Release|Any CPU + {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF}.Release|x64.Build.0 = Release|Any CPU + {D77D8E17-6D1C-4E44-AF18-D572F12745BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D77D8E17-6D1C-4E44-AF18-D572F12745BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D77D8E17-6D1C-4E44-AF18-D572F12745BA}.Debug|x64.ActiveCfg = Debug|Any CPU + {D77D8E17-6D1C-4E44-AF18-D572F12745BA}.Debug|x64.Build.0 = Debug|Any CPU + {D77D8E17-6D1C-4E44-AF18-D572F12745BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D77D8E17-6D1C-4E44-AF18-D572F12745BA}.Release|Any CPU.Build.0 = Release|Any CPU + {D77D8E17-6D1C-4E44-AF18-D572F12745BA}.Release|x64.ActiveCfg = Release|Any CPU + {D77D8E17-6D1C-4E44-AF18-D572F12745BA}.Release|x64.Build.0 = Release|Any CPU + {3167F949-F6F4-4440-97CD-2EC7B785D9E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3167F949-F6F4-4440-97CD-2EC7B785D9E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3167F949-F6F4-4440-97CD-2EC7B785D9E8}.Debug|x64.ActiveCfg = Debug|Any CPU + {3167F949-F6F4-4440-97CD-2EC7B785D9E8}.Debug|x64.Build.0 = Debug|Any CPU + {3167F949-F6F4-4440-97CD-2EC7B785D9E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3167F949-F6F4-4440-97CD-2EC7B785D9E8}.Release|Any CPU.Build.0 = Release|Any CPU + {3167F949-F6F4-4440-97CD-2EC7B785D9E8}.Release|x64.ActiveCfg = Release|Any CPU + {3167F949-F6F4-4440-97CD-2EC7B785D9E8}.Release|x64.Build.0 = Release|Any CPU + {A00D752B-65C8-404A-8397-82DB5613884E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A00D752B-65C8-404A-8397-82DB5613884E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A00D752B-65C8-404A-8397-82DB5613884E}.Debug|x64.ActiveCfg = Debug|Any CPU + {A00D752B-65C8-404A-8397-82DB5613884E}.Debug|x64.Build.0 = Debug|Any CPU + {A00D752B-65C8-404A-8397-82DB5613884E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A00D752B-65C8-404A-8397-82DB5613884E}.Release|Any CPU.Build.0 = Release|Any CPU + {A00D752B-65C8-404A-8397-82DB5613884E}.Release|x64.ActiveCfg = Release|Any CPU + {A00D752B-65C8-404A-8397-82DB5613884E}.Release|x64.Build.0 = Release|Any CPU + {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Debug|x64.ActiveCfg = Debug|Any CPU + {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Debug|x64.Build.0 = Debug|Any CPU + {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Release|Any CPU.Build.0 = Release|Any CPU + {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Release|x64.ActiveCfg = Release|Any CPU + {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Release|x64.Build.0 = Release|Any CPU + {5957E2B1-A517-4225-8517-71D3B0B29B90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5957E2B1-A517-4225-8517-71D3B0B29B90}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5957E2B1-A517-4225-8517-71D3B0B29B90}.Debug|x64.ActiveCfg = Debug|Any CPU + {5957E2B1-A517-4225-8517-71D3B0B29B90}.Debug|x64.Build.0 = Debug|Any CPU + {5957E2B1-A517-4225-8517-71D3B0B29B90}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5957E2B1-A517-4225-8517-71D3B0B29B90}.Release|Any CPU.Build.0 = Release|Any CPU + {5957E2B1-A517-4225-8517-71D3B0B29B90}.Release|x64.ActiveCfg = Release|Any CPU + {5957E2B1-A517-4225-8517-71D3B0B29B90}.Release|x64.Build.0 = Release|Any CPU + {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Debug|x64.ActiveCfg = Debug|Any CPU + {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Debug|x64.Build.0 = Debug|Any CPU + {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Release|Any CPU.ActiveCfg = Release|Any CPU + {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Release|Any CPU.Build.0 = Release|Any CPU + {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Release|x64.ActiveCfg = Release|Any CPU + {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Release|x64.Build.0 = Release|Any CPU + {8E33F77D-E636-4965-87E4-00FC3823F44B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E33F77D-E636-4965-87E4-00FC3823F44B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E33F77D-E636-4965-87E4-00FC3823F44B}.Debug|x64.ActiveCfg = Debug|Any CPU + {8E33F77D-E636-4965-87E4-00FC3823F44B}.Debug|x64.Build.0 = Debug|Any CPU + {8E33F77D-E636-4965-87E4-00FC3823F44B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E33F77D-E636-4965-87E4-00FC3823F44B}.Release|Any CPU.Build.0 = Release|Any CPU + {8E33F77D-E636-4965-87E4-00FC3823F44B}.Release|x64.ActiveCfg = Release|Any CPU + {8E33F77D-E636-4965-87E4-00FC3823F44B}.Release|x64.Build.0 = Release|Any CPU + {12B05214-0AF0-45DB-B222-0AD07BC1246B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12B05214-0AF0-45DB-B222-0AD07BC1246B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12B05214-0AF0-45DB-B222-0AD07BC1246B}.Debug|x64.ActiveCfg = Debug|Any CPU + {12B05214-0AF0-45DB-B222-0AD07BC1246B}.Debug|x64.Build.0 = Debug|Any CPU + {12B05214-0AF0-45DB-B222-0AD07BC1246B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12B05214-0AF0-45DB-B222-0AD07BC1246B}.Release|Any CPU.Build.0 = Release|Any CPU + {12B05214-0AF0-45DB-B222-0AD07BC1246B}.Release|x64.ActiveCfg = Release|Any CPU + {12B05214-0AF0-45DB-B222-0AD07BC1246B}.Release|x64.Build.0 = Release|Any CPU + {3755B3E7-2230-4E99-B2AC-16631ACA504A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3755B3E7-2230-4E99-B2AC-16631ACA504A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3755B3E7-2230-4E99-B2AC-16631ACA504A}.Debug|x64.ActiveCfg = Debug|Any CPU + {3755B3E7-2230-4E99-B2AC-16631ACA504A}.Debug|x64.Build.0 = Debug|Any CPU + {3755B3E7-2230-4E99-B2AC-16631ACA504A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3755B3E7-2230-4E99-B2AC-16631ACA504A}.Release|Any CPU.Build.0 = Release|Any CPU + {3755B3E7-2230-4E99-B2AC-16631ACA504A}.Release|x64.ActiveCfg = Release|Any CPU + {3755B3E7-2230-4E99-B2AC-16631ACA504A}.Release|x64.Build.0 = Release|Any CPU + {C91168D6-6508-42DC-BE02-94518B6FD4FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C91168D6-6508-42DC-BE02-94518B6FD4FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C91168D6-6508-42DC-BE02-94518B6FD4FA}.Debug|x64.ActiveCfg = Debug|Any CPU + {C91168D6-6508-42DC-BE02-94518B6FD4FA}.Debug|x64.Build.0 = Debug|Any CPU + {C91168D6-6508-42DC-BE02-94518B6FD4FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C91168D6-6508-42DC-BE02-94518B6FD4FA}.Release|Any CPU.Build.0 = Release|Any CPU + {C91168D6-6508-42DC-BE02-94518B6FD4FA}.Release|x64.ActiveCfg = Release|Any CPU + {C91168D6-6508-42DC-BE02-94518B6FD4FA}.Release|x64.Build.0 = Release|Any CPU + {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}.Debug|x64.ActiveCfg = Debug|Any CPU + {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}.Debug|x64.Build.0 = Debug|Any CPU + {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}.Release|Any CPU.Build.0 = Release|Any CPU + {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}.Release|x64.ActiveCfg = Release|Any CPU + {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}.Release|x64.Build.0 = Release|Any CPU + {8109B615-5328-44C1-BCA2-75C65CDD714B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8109B615-5328-44C1-BCA2-75C65CDD714B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8109B615-5328-44C1-BCA2-75C65CDD714B}.Debug|x64.ActiveCfg = Debug|Any CPU + {8109B615-5328-44C1-BCA2-75C65CDD714B}.Debug|x64.Build.0 = Debug|Any CPU + {8109B615-5328-44C1-BCA2-75C65CDD714B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8109B615-5328-44C1-BCA2-75C65CDD714B}.Release|Any CPU.Build.0 = Release|Any CPU + {8109B615-5328-44C1-BCA2-75C65CDD714B}.Release|x64.ActiveCfg = Release|Any CPU + {8109B615-5328-44C1-BCA2-75C65CDD714B}.Release|x64.Build.0 = Release|Any CPU + {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Debug|x64.ActiveCfg = Debug|Any CPU + {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Debug|x64.Build.0 = Debug|Any CPU + {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Release|Any CPU.Build.0 = Release|Any CPU + {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Release|x64.ActiveCfg = Release|Any CPU + {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Release|x64.Build.0 = Release|Any CPU + {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Debug|x64.ActiveCfg = Debug|Any CPU + {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Debug|x64.Build.0 = Debug|Any CPU + {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Release|Any CPU.Build.0 = Release|Any CPU + {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Release|x64.ActiveCfg = Release|Any CPU + {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Release|x64.Build.0 = Release|Any CPU + {17DEB82C-64B8-440E-9156-52638005FE3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17DEB82C-64B8-440E-9156-52638005FE3E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17DEB82C-64B8-440E-9156-52638005FE3E}.Debug|x64.ActiveCfg = Debug|Any CPU + {17DEB82C-64B8-440E-9156-52638005FE3E}.Debug|x64.Build.0 = Debug|Any CPU + {17DEB82C-64B8-440E-9156-52638005FE3E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17DEB82C-64B8-440E-9156-52638005FE3E}.Release|Any CPU.Build.0 = Release|Any CPU + {17DEB82C-64B8-440E-9156-52638005FE3E}.Release|x64.ActiveCfg = Release|Any CPU + {17DEB82C-64B8-440E-9156-52638005FE3E}.Release|x64.Build.0 = Release|Any CPU + {4E49D00C-B324-44DF-B40D-61BF751EB199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E49D00C-B324-44DF-B40D-61BF751EB199}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E49D00C-B324-44DF-B40D-61BF751EB199}.Debug|x64.ActiveCfg = Debug|Any CPU + {4E49D00C-B324-44DF-B40D-61BF751EB199}.Debug|x64.Build.0 = Debug|Any CPU + {4E49D00C-B324-44DF-B40D-61BF751EB199}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E49D00C-B324-44DF-B40D-61BF751EB199}.Release|Any CPU.Build.0 = Release|Any CPU + {4E49D00C-B324-44DF-B40D-61BF751EB199}.Release|x64.ActiveCfg = Release|Any CPU + {4E49D00C-B324-44DF-B40D-61BF751EB199}.Release|x64.Build.0 = Release|Any CPU + {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Debug|x64.ActiveCfg = Debug|Any CPU + {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Debug|x64.Build.0 = Debug|Any CPU + {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Release|Any CPU.Build.0 = Release|Any CPU + {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Release|x64.ActiveCfg = Release|Any CPU + {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Release|x64.Build.0 = Release|Any CPU + {95986BED-2D99-42C9-A1E1-EC5551864426}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {95986BED-2D99-42C9-A1E1-EC5551864426}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95986BED-2D99-42C9-A1E1-EC5551864426}.Debug|x64.ActiveCfg = Debug|Any CPU + {95986BED-2D99-42C9-A1E1-EC5551864426}.Debug|x64.Build.0 = Debug|Any CPU + {95986BED-2D99-42C9-A1E1-EC5551864426}.Release|Any CPU.ActiveCfg = Release|Any CPU + {95986BED-2D99-42C9-A1E1-EC5551864426}.Release|Any CPU.Build.0 = Release|Any CPU + {95986BED-2D99-42C9-A1E1-EC5551864426}.Release|x64.ActiveCfg = Release|Any CPU + {95986BED-2D99-42C9-A1E1-EC5551864426}.Release|x64.Build.0 = Release|Any CPU + {D40C8B63-A637-43C4-82DA-DF993597A91C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D40C8B63-A637-43C4-82DA-DF993597A91C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D40C8B63-A637-43C4-82DA-DF993597A91C}.Debug|x64.ActiveCfg = Debug|Any CPU + {D40C8B63-A637-43C4-82DA-DF993597A91C}.Debug|x64.Build.0 = Debug|Any CPU + {D40C8B63-A637-43C4-82DA-DF993597A91C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D40C8B63-A637-43C4-82DA-DF993597A91C}.Release|Any CPU.Build.0 = Release|Any CPU + {D40C8B63-A637-43C4-82DA-DF993597A91C}.Release|x64.ActiveCfg = Release|Any CPU + {D40C8B63-A637-43C4-82DA-DF993597A91C}.Release|x64.Build.0 = Release|Any CPU + {A7938858-B979-4B79-8505-FC9998832198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A7938858-B979-4B79-8505-FC9998832198}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A7938858-B979-4B79-8505-FC9998832198}.Debug|x64.ActiveCfg = Debug|Any CPU + {A7938858-B979-4B79-8505-FC9998832198}.Debug|x64.Build.0 = Debug|Any CPU + {A7938858-B979-4B79-8505-FC9998832198}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A7938858-B979-4B79-8505-FC9998832198}.Release|Any CPU.Build.0 = Release|Any CPU + {A7938858-B979-4B79-8505-FC9998832198}.Release|x64.ActiveCfg = Release|Any CPU + {A7938858-B979-4B79-8505-FC9998832198}.Release|x64.Build.0 = Release|Any CPU + {88B7B81E-1F86-4CB2-AB48-A301D2A67A40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88B7B81E-1F86-4CB2-AB48-A301D2A67A40}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88B7B81E-1F86-4CB2-AB48-A301D2A67A40}.Debug|x64.ActiveCfg = Debug|Any CPU + {88B7B81E-1F86-4CB2-AB48-A301D2A67A40}.Debug|x64.Build.0 = Debug|Any CPU + {88B7B81E-1F86-4CB2-AB48-A301D2A67A40}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88B7B81E-1F86-4CB2-AB48-A301D2A67A40}.Release|Any CPU.Build.0 = Release|Any CPU + {88B7B81E-1F86-4CB2-AB48-A301D2A67A40}.Release|x64.ActiveCfg = Release|Any CPU + {88B7B81E-1F86-4CB2-AB48-A301D2A67A40}.Release|x64.Build.0 = Release|Any CPU + {6DB001ED-4652-41C7-8C4A-07FF1C03266B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6DB001ED-4652-41C7-8C4A-07FF1C03266B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6DB001ED-4652-41C7-8C4A-07FF1C03266B}.Debug|x64.ActiveCfg = Debug|Any CPU + {6DB001ED-4652-41C7-8C4A-07FF1C03266B}.Debug|x64.Build.0 = Debug|Any CPU + {6DB001ED-4652-41C7-8C4A-07FF1C03266B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6DB001ED-4652-41C7-8C4A-07FF1C03266B}.Release|Any CPU.Build.0 = Release|Any CPU + {6DB001ED-4652-41C7-8C4A-07FF1C03266B}.Release|x64.ActiveCfg = Release|Any CPU + {6DB001ED-4652-41C7-8C4A-07FF1C03266B}.Release|x64.Build.0 = Release|Any CPU + {7E0946DF-53F5-45A9-97BE-779A42E34DB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E0946DF-53F5-45A9-97BE-779A42E34DB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E0946DF-53F5-45A9-97BE-779A42E34DB6}.Debug|x64.ActiveCfg = Debug|Any CPU + {7E0946DF-53F5-45A9-97BE-779A42E34DB6}.Debug|x64.Build.0 = Debug|Any CPU + {7E0946DF-53F5-45A9-97BE-779A42E34DB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E0946DF-53F5-45A9-97BE-779A42E34DB6}.Release|Any CPU.Build.0 = Release|Any CPU + {7E0946DF-53F5-45A9-97BE-779A42E34DB6}.Release|x64.ActiveCfg = Release|Any CPU + {7E0946DF-53F5-45A9-97BE-779A42E34DB6}.Release|x64.Build.0 = Release|Any CPU + {CEA786A1-676C-42C3-9664-A73EF58256F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CEA786A1-676C-42C3-9664-A73EF58256F2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CEA786A1-676C-42C3-9664-A73EF58256F2}.Debug|x64.ActiveCfg = Debug|Any CPU + {CEA786A1-676C-42C3-9664-A73EF58256F2}.Debug|x64.Build.0 = Debug|Any CPU + {CEA786A1-676C-42C3-9664-A73EF58256F2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CEA786A1-676C-42C3-9664-A73EF58256F2}.Release|Any CPU.Build.0 = Release|Any CPU + {CEA786A1-676C-42C3-9664-A73EF58256F2}.Release|x64.ActiveCfg = Release|Any CPU + {CEA786A1-676C-42C3-9664-A73EF58256F2}.Release|x64.Build.0 = Release|Any CPU + {95FE678E-2530-4785-B553-817B80743322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {95FE678E-2530-4785-B553-817B80743322}.Debug|Any CPU.Build.0 = Debug|Any CPU + {95FE678E-2530-4785-B553-817B80743322}.Debug|x64.ActiveCfg = Debug|Any CPU + {95FE678E-2530-4785-B553-817B80743322}.Debug|x64.Build.0 = Debug|Any CPU + {95FE678E-2530-4785-B553-817B80743322}.Release|Any CPU.ActiveCfg = Release|Any CPU + {95FE678E-2530-4785-B553-817B80743322}.Release|Any CPU.Build.0 = Release|Any CPU + {95FE678E-2530-4785-B553-817B80743322}.Release|x64.ActiveCfg = Release|Any CPU + {95FE678E-2530-4785-B553-817B80743322}.Release|x64.Build.0 = Release|Any CPU + {C7861897-8205-43F9-B1D0-5697FB3B070E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7861897-8205-43F9-B1D0-5697FB3B070E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7861897-8205-43F9-B1D0-5697FB3B070E}.Debug|x64.ActiveCfg = Debug|Any CPU + {C7861897-8205-43F9-B1D0-5697FB3B070E}.Debug|x64.Build.0 = Debug|Any CPU + {C7861897-8205-43F9-B1D0-5697FB3B070E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7861897-8205-43F9-B1D0-5697FB3B070E}.Release|Any CPU.Build.0 = Release|Any CPU + {C7861897-8205-43F9-B1D0-5697FB3B070E}.Release|x64.ActiveCfg = Release|Any CPU + {C7861897-8205-43F9-B1D0-5697FB3B070E}.Release|x64.Build.0 = Release|Any CPU + {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Debug|x64.ActiveCfg = Debug|Any CPU + {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Debug|x64.Build.0 = Debug|Any CPU + {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Release|Any CPU.Build.0 = Release|Any CPU + {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Release|x64.ActiveCfg = Release|Any CPU + {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Release|x64.Build.0 = Release|Any CPU + {531528B9-4EC2-4637-AC35-E7C4092E8779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {531528B9-4EC2-4637-AC35-E7C4092E8779}.Debug|Any CPU.Build.0 = Debug|Any CPU + {531528B9-4EC2-4637-AC35-E7C4092E8779}.Debug|x64.ActiveCfg = Debug|Any CPU + {531528B9-4EC2-4637-AC35-E7C4092E8779}.Debug|x64.Build.0 = Debug|Any CPU + {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|Any CPU.ActiveCfg = Release|Any CPU + {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|Any CPU.Build.0 = Release|Any CPU + {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|x64.ActiveCfg = Release|Any CPU + {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|x64.Build.0 = Release|Any CPU + {AC869382-6C88-4099-84EC-6D9639CA3682}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC869382-6C88-4099-84EC-6D9639CA3682}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC869382-6C88-4099-84EC-6D9639CA3682}.Debug|x64.ActiveCfg = Debug|Any CPU + {AC869382-6C88-4099-84EC-6D9639CA3682}.Debug|x64.Build.0 = Debug|Any CPU + {AC869382-6C88-4099-84EC-6D9639CA3682}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC869382-6C88-4099-84EC-6D9639CA3682}.Release|Any CPU.Build.0 = Release|Any CPU + {AC869382-6C88-4099-84EC-6D9639CA3682}.Release|x64.ActiveCfg = Release|Any CPU + {AC869382-6C88-4099-84EC-6D9639CA3682}.Release|x64.Build.0 = Release|Any CPU + {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Debug|x64.ActiveCfg = Debug|Any CPU + {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Debug|x64.Build.0 = Debug|Any CPU + {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Release|Any CPU.Build.0 = Release|Any CPU + {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Release|x64.ActiveCfg = Release|Any CPU + {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Release|x64.Build.0 = Release|Any CPU + {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|x64.ActiveCfg = Debug|Any CPU + {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|x64.Build.0 = Debug|Any CPU + {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|Any CPU.Build.0 = Release|Any CPU + {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|x64.ActiveCfg = Release|Any CPU + {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|x64.Build.0 = Release|Any CPU + {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Debug|x64.ActiveCfg = Debug|Any CPU + {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Debug|x64.Build.0 = Debug|Any CPU + {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Release|Any CPU.Build.0 = Release|Any CPU + {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Release|x64.ActiveCfg = Release|Any CPU + {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Release|x64.Build.0 = Release|Any CPU + {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|x64.ActiveCfg = Debug|Any CPU + {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|x64.Build.0 = Debug|Any CPU + {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Release|Any CPU.Build.0 = Release|Any CPU + {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Release|x64.ActiveCfg = Release|Any CPU + {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Release|x64.Build.0 = Release|Any CPU + {4A0491D9-F548-4367-8B96-B046A6783743}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A0491D9-F548-4367-8B96-B046A6783743}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A0491D9-F548-4367-8B96-B046A6783743}.Debug|x64.ActiveCfg = Debug|Any CPU + {4A0491D9-F548-4367-8B96-B046A6783743}.Debug|x64.Build.0 = Debug|Any CPU + {4A0491D9-F548-4367-8B96-B046A6783743}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A0491D9-F548-4367-8B96-B046A6783743}.Release|Any CPU.Build.0 = Release|Any CPU + {4A0491D9-F548-4367-8B96-B046A6783743}.Release|x64.ActiveCfg = Release|Any CPU + {4A0491D9-F548-4367-8B96-B046A6783743}.Release|x64.Build.0 = Release|Any CPU + {F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}.Debug|x64.ActiveCfg = Debug|Any CPU + {F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}.Debug|x64.Build.0 = Debug|Any CPU + {F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}.Release|Any CPU.Build.0 = Release|Any CPU + {F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}.Release|x64.ActiveCfg = Release|Any CPU + {F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}.Release|x64.Build.0 = Release|Any CPU + {16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}.Debug|x64.ActiveCfg = Debug|Any CPU + {16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}.Debug|x64.Build.0 = Debug|Any CPU + {16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}.Release|Any CPU.Build.0 = Release|Any CPU + {16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}.Release|x64.ActiveCfg = Release|Any CPU + {16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}.Release|x64.Build.0 = Release|Any CPU + {1FC195D0-E126-4740-8720-09144C61EDD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1FC195D0-E126-4740-8720-09144C61EDD6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1FC195D0-E126-4740-8720-09144C61EDD6}.Debug|x64.ActiveCfg = Debug|Any CPU + {1FC195D0-E126-4740-8720-09144C61EDD6}.Debug|x64.Build.0 = Debug|Any CPU + {1FC195D0-E126-4740-8720-09144C61EDD6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1FC195D0-E126-4740-8720-09144C61EDD6}.Release|Any CPU.Build.0 = Release|Any CPU + {1FC195D0-E126-4740-8720-09144C61EDD6}.Release|x64.ActiveCfg = Release|Any CPU + {1FC195D0-E126-4740-8720-09144C61EDD6}.Release|x64.Build.0 = Release|Any CPU + {5F1F2A46-5C4C-4D0A-8C89-73785EE41340}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5F1F2A46-5C4C-4D0A-8C89-73785EE41340}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F1F2A46-5C4C-4D0A-8C89-73785EE41340}.Debug|x64.ActiveCfg = Debug|Any CPU + {5F1F2A46-5C4C-4D0A-8C89-73785EE41340}.Debug|x64.Build.0 = Debug|Any CPU + {5F1F2A46-5C4C-4D0A-8C89-73785EE41340}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5F1F2A46-5C4C-4D0A-8C89-73785EE41340}.Release|Any CPU.Build.0 = Release|Any CPU + {5F1F2A46-5C4C-4D0A-8C89-73785EE41340}.Release|x64.ActiveCfg = Release|Any CPU + {5F1F2A46-5C4C-4D0A-8C89-73785EE41340}.Release|x64.Build.0 = Release|Any CPU + {DE0B16D8-0EC9-4749-9E11-15CC9FA60B67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DE0B16D8-0EC9-4749-9E11-15CC9FA60B67}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DE0B16D8-0EC9-4749-9E11-15CC9FA60B67}.Debug|x64.ActiveCfg = Debug|Any CPU + {DE0B16D8-0EC9-4749-9E11-15CC9FA60B67}.Debug|x64.Build.0 = Debug|Any CPU + {DE0B16D8-0EC9-4749-9E11-15CC9FA60B67}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DE0B16D8-0EC9-4749-9E11-15CC9FA60B67}.Release|Any CPU.Build.0 = Release|Any CPU + {DE0B16D8-0EC9-4749-9E11-15CC9FA60B67}.Release|x64.ActiveCfg = Release|Any CPU + {DE0B16D8-0EC9-4749-9E11-15CC9FA60B67}.Release|x64.Build.0 = Release|Any CPU + {F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC}.Debug|x64.ActiveCfg = Debug|Any CPU + {F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC}.Debug|x64.Build.0 = Debug|Any CPU + {F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC}.Release|Any CPU.Build.0 = Release|Any CPU + {F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC}.Release|x64.ActiveCfg = Release|Any CPU + {F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC}.Release|x64.Build.0 = Release|Any CPU + {4870055F-F750-4EB3-BFE6-5192D17A2EAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4870055F-F750-4EB3-BFE6-5192D17A2EAD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4870055F-F750-4EB3-BFE6-5192D17A2EAD}.Debug|x64.ActiveCfg = Debug|Any CPU + {4870055F-F750-4EB3-BFE6-5192D17A2EAD}.Debug|x64.Build.0 = Debug|Any CPU + {4870055F-F750-4EB3-BFE6-5192D17A2EAD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4870055F-F750-4EB3-BFE6-5192D17A2EAD}.Release|Any CPU.Build.0 = Release|Any CPU + {4870055F-F750-4EB3-BFE6-5192D17A2EAD}.Release|x64.ActiveCfg = Release|Any CPU + {4870055F-F750-4EB3-BFE6-5192D17A2EAD}.Release|x64.Build.0 = Release|Any CPU + {F7801358-1D38-4697-A185-FF9DF52F3F83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F7801358-1D38-4697-A185-FF9DF52F3F83}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F7801358-1D38-4697-A185-FF9DF52F3F83}.Debug|x64.ActiveCfg = Debug|Any CPU + {F7801358-1D38-4697-A185-FF9DF52F3F83}.Debug|x64.Build.0 = Debug|Any CPU + {F7801358-1D38-4697-A185-FF9DF52F3F83}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F7801358-1D38-4697-A185-FF9DF52F3F83}.Release|Any CPU.Build.0 = Release|Any CPU + {F7801358-1D38-4697-A185-FF9DF52F3F83}.Release|x64.ActiveCfg = Release|Any CPU + {F7801358-1D38-4697-A185-FF9DF52F3F83}.Release|x64.Build.0 = Release|Any CPU + {60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}.Debug|x64.ActiveCfg = Debug|Any CPU + {60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}.Debug|x64.Build.0 = Debug|Any CPU + {60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}.Release|Any CPU.Build.0 = Release|Any CPU + {60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}.Release|x64.ActiveCfg = Release|Any CPU + {60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}.Release|x64.Build.0 = Release|Any CPU + {F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}.Debug|x64.ActiveCfg = Debug|Any CPU + {F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}.Debug|x64.Build.0 = Debug|Any CPU + {F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}.Release|Any CPU.Build.0 = Release|Any CPU + {F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}.Release|x64.ActiveCfg = Release|Any CPU + {F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}.Release|x64.Build.0 = Release|Any CPU + {405EDD78-48E8-490B-AE2A-713AB89AA73E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {405EDD78-48E8-490B-AE2A-713AB89AA73E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {405EDD78-48E8-490B-AE2A-713AB89AA73E}.Debug|x64.ActiveCfg = Debug|Any CPU + {405EDD78-48E8-490B-AE2A-713AB89AA73E}.Debug|x64.Build.0 = Debug|Any CPU + {405EDD78-48E8-490B-AE2A-713AB89AA73E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {405EDD78-48E8-490B-AE2A-713AB89AA73E}.Release|Any CPU.Build.0 = Release|Any CPU + {405EDD78-48E8-490B-AE2A-713AB89AA73E}.Release|x64.ActiveCfg = Release|Any CPU + {405EDD78-48E8-490B-AE2A-713AB89AA73E}.Release|x64.Build.0 = Release|Any CPU + {90883A71-DEF8-4B1B-98EE-5A73AA25184B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90883A71-DEF8-4B1B-98EE-5A73AA25184B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90883A71-DEF8-4B1B-98EE-5A73AA25184B}.Debug|x64.ActiveCfg = Debug|Any CPU + {90883A71-DEF8-4B1B-98EE-5A73AA25184B}.Debug|x64.Build.0 = Debug|Any CPU + {90883A71-DEF8-4B1B-98EE-5A73AA25184B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90883A71-DEF8-4B1B-98EE-5A73AA25184B}.Release|Any CPU.Build.0 = Release|Any CPU + {90883A71-DEF8-4B1B-98EE-5A73AA25184B}.Release|x64.ActiveCfg = Release|Any CPU + {90883A71-DEF8-4B1B-98EE-5A73AA25184B}.Release|x64.Build.0 = Release|Any CPU + {1C11B49B-4547-4035-A9F4-7D9AB9A07431}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1C11B49B-4547-4035-A9F4-7D9AB9A07431}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1C11B49B-4547-4035-A9F4-7D9AB9A07431}.Debug|x64.ActiveCfg = Debug|Any CPU + {1C11B49B-4547-4035-A9F4-7D9AB9A07431}.Debug|x64.Build.0 = Debug|Any CPU + {1C11B49B-4547-4035-A9F4-7D9AB9A07431}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1C11B49B-4547-4035-A9F4-7D9AB9A07431}.Release|Any CPU.Build.0 = Release|Any CPU + {1C11B49B-4547-4035-A9F4-7D9AB9A07431}.Release|x64.ActiveCfg = Release|Any CPU + {1C11B49B-4547-4035-A9F4-7D9AB9A07431}.Release|x64.Build.0 = Release|Any CPU + {AF82713E-4B6C-4712-9865-06C13FF636FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF82713E-4B6C-4712-9865-06C13FF636FC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF82713E-4B6C-4712-9865-06C13FF636FC}.Debug|x64.ActiveCfg = Debug|Any CPU + {AF82713E-4B6C-4712-9865-06C13FF636FC}.Debug|x64.Build.0 = Debug|Any CPU + {AF82713E-4B6C-4712-9865-06C13FF636FC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF82713E-4B6C-4712-9865-06C13FF636FC}.Release|Any CPU.Build.0 = Release|Any CPU + {AF82713E-4B6C-4712-9865-06C13FF636FC}.Release|x64.ActiveCfg = Release|Any CPU + {AF82713E-4B6C-4712-9865-06C13FF636FC}.Release|x64.Build.0 = Release|Any CPU + {AE5E710D-705C-49F4-90D6-6C3C0D2C62A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AE5E710D-705C-49F4-90D6-6C3C0D2C62A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AE5E710D-705C-49F4-90D6-6C3C0D2C62A8}.Debug|x64.ActiveCfg = Debug|Any CPU + {AE5E710D-705C-49F4-90D6-6C3C0D2C62A8}.Debug|x64.Build.0 = Debug|Any CPU + {AE5E710D-705C-49F4-90D6-6C3C0D2C62A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AE5E710D-705C-49F4-90D6-6C3C0D2C62A8}.Release|Any CPU.Build.0 = Release|Any CPU + {AE5E710D-705C-49F4-90D6-6C3C0D2C62A8}.Release|x64.ActiveCfg = Release|Any CPU + {AE5E710D-705C-49F4-90D6-6C3C0D2C62A8}.Release|x64.Build.0 = Release|Any CPU + {984CFF2A-C321-43D5-A06C-5D053C0F97A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {984CFF2A-C321-43D5-A06C-5D053C0F97A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {984CFF2A-C321-43D5-A06C-5D053C0F97A9}.Debug|x64.ActiveCfg = Debug|Any CPU + {984CFF2A-C321-43D5-A06C-5D053C0F97A9}.Debug|x64.Build.0 = Debug|Any CPU + {984CFF2A-C321-43D5-A06C-5D053C0F97A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {984CFF2A-C321-43D5-A06C-5D053C0F97A9}.Release|Any CPU.Build.0 = Release|Any CPU + {984CFF2A-C321-43D5-A06C-5D053C0F97A9}.Release|x64.ActiveCfg = Release|Any CPU + {984CFF2A-C321-43D5-A06C-5D053C0F97A9}.Release|x64.Build.0 = Release|Any CPU + {06087014-47B1-4FEF-BCC0-229D8FDB52FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06087014-47B1-4FEF-BCC0-229D8FDB52FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06087014-47B1-4FEF-BCC0-229D8FDB52FA}.Debug|x64.ActiveCfg = Debug|Any CPU + {06087014-47B1-4FEF-BCC0-229D8FDB52FA}.Debug|x64.Build.0 = Debug|Any CPU + {06087014-47B1-4FEF-BCC0-229D8FDB52FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06087014-47B1-4FEF-BCC0-229D8FDB52FA}.Release|Any CPU.Build.0 = Release|Any CPU + {06087014-47B1-4FEF-BCC0-229D8FDB52FA}.Release|x64.ActiveCfg = Release|Any CPU + {06087014-47B1-4FEF-BCC0-229D8FDB52FA}.Release|x64.Build.0 = Release|Any CPU + {574693E9-B201-4392-AA03-93901A8210C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {574693E9-B201-4392-AA03-93901A8210C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {574693E9-B201-4392-AA03-93901A8210C3}.Debug|x64.ActiveCfg = Debug|Any CPU + {574693E9-B201-4392-AA03-93901A8210C3}.Debug|x64.Build.0 = Debug|Any CPU + {574693E9-B201-4392-AA03-93901A8210C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {574693E9-B201-4392-AA03-93901A8210C3}.Release|Any CPU.Build.0 = Release|Any CPU + {574693E9-B201-4392-AA03-93901A8210C3}.Release|x64.ActiveCfg = Release|Any CPU + {574693E9-B201-4392-AA03-93901A8210C3}.Release|x64.Build.0 = Release|Any CPU + {D3DF1F38-4108-460B-8517-40855445ADBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3DF1F38-4108-460B-8517-40855445ADBF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3DF1F38-4108-460B-8517-40855445ADBF}.Debug|x64.ActiveCfg = Debug|Any CPU + {D3DF1F38-4108-460B-8517-40855445ADBF}.Debug|x64.Build.0 = Debug|Any CPU + {D3DF1F38-4108-460B-8517-40855445ADBF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3DF1F38-4108-460B-8517-40855445ADBF}.Release|Any CPU.Build.0 = Release|Any CPU + {D3DF1F38-4108-460B-8517-40855445ADBF}.Release|x64.ActiveCfg = Release|Any CPU + {D3DF1F38-4108-460B-8517-40855445ADBF}.Release|x64.Build.0 = Release|Any CPU + {E2BA1D48-CC32-4FB3-A1C1-200291604881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E2BA1D48-CC32-4FB3-A1C1-200291604881}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E2BA1D48-CC32-4FB3-A1C1-200291604881}.Debug|x64.ActiveCfg = Debug|Any CPU + {E2BA1D48-CC32-4FB3-A1C1-200291604881}.Debug|x64.Build.0 = Debug|Any CPU + {E2BA1D48-CC32-4FB3-A1C1-200291604881}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E2BA1D48-CC32-4FB3-A1C1-200291604881}.Release|Any CPU.Build.0 = Release|Any CPU + {E2BA1D48-CC32-4FB3-A1C1-200291604881}.Release|x64.ActiveCfg = Release|Any CPU + {E2BA1D48-CC32-4FB3-A1C1-200291604881}.Release|x64.Build.0 = Release|Any CPU + {0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7}.Debug|x64.ActiveCfg = Debug|Any CPU + {0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7}.Debug|x64.Build.0 = Debug|Any CPU + {0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7}.Release|Any CPU.Build.0 = Release|Any CPU + {0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7}.Release|x64.ActiveCfg = Release|Any CPU + {0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7}.Release|x64.Build.0 = Release|Any CPU + {22BE7D35-34C4-49FA-B20E-B69289C10B5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22BE7D35-34C4-49FA-B20E-B69289C10B5E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22BE7D35-34C4-49FA-B20E-B69289C10B5E}.Debug|x64.ActiveCfg = Debug|Any CPU + {22BE7D35-34C4-49FA-B20E-B69289C10B5E}.Debug|x64.Build.0 = Debug|Any CPU + {22BE7D35-34C4-49FA-B20E-B69289C10B5E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22BE7D35-34C4-49FA-B20E-B69289C10B5E}.Release|Any CPU.Build.0 = Release|Any CPU + {22BE7D35-34C4-49FA-B20E-B69289C10B5E}.Release|x64.ActiveCfg = Release|Any CPU + {22BE7D35-34C4-49FA-B20E-B69289C10B5E}.Release|x64.Build.0 = Release|Any CPU + {694CACC8-59E8-49F6-832E-A30833E139DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {694CACC8-59E8-49F6-832E-A30833E139DF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {694CACC8-59E8-49F6-832E-A30833E139DF}.Debug|x64.ActiveCfg = Debug|Any CPU + {694CACC8-59E8-49F6-832E-A30833E139DF}.Debug|x64.Build.0 = Debug|Any CPU + {694CACC8-59E8-49F6-832E-A30833E139DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {694CACC8-59E8-49F6-832E-A30833E139DF}.Release|Any CPU.Build.0 = Release|Any CPU + {694CACC8-59E8-49F6-832E-A30833E139DF}.Release|x64.ActiveCfg = Release|Any CPU + {694CACC8-59E8-49F6-832E-A30833E139DF}.Release|x64.Build.0 = Release|Any CPU + {246399F8-F0A6-4B23-8995-88574FA5CA05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {246399F8-F0A6-4B23-8995-88574FA5CA05}.Debug|Any CPU.Build.0 = Debug|Any CPU + {246399F8-F0A6-4B23-8995-88574FA5CA05}.Debug|x64.ActiveCfg = Debug|Any CPU + {246399F8-F0A6-4B23-8995-88574FA5CA05}.Debug|x64.Build.0 = Debug|Any CPU + {246399F8-F0A6-4B23-8995-88574FA5CA05}.Release|Any CPU.ActiveCfg = Release|Any CPU + {246399F8-F0A6-4B23-8995-88574FA5CA05}.Release|Any CPU.Build.0 = Release|Any CPU + {246399F8-F0A6-4B23-8995-88574FA5CA05}.Release|x64.ActiveCfg = Release|Any CPU + {246399F8-F0A6-4B23-8995-88574FA5CA05}.Release|x64.Build.0 = Release|Any CPU + {F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B}.Debug|x64.ActiveCfg = Debug|Any CPU + {F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B}.Debug|x64.Build.0 = Debug|Any CPU + {F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B}.Release|Any CPU.Build.0 = Release|Any CPU + {F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B}.Release|x64.ActiveCfg = Release|Any CPU + {F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B}.Release|x64.Build.0 = Release|Any CPU + {A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F}.Debug|x64.ActiveCfg = Debug|Any CPU + {A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F}.Debug|x64.Build.0 = Debug|Any CPU + {A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F}.Release|Any CPU.Build.0 = Release|Any CPU + {A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F}.Release|x64.ActiveCfg = Release|Any CPU + {A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F}.Release|x64.Build.0 = Release|Any CPU + {9BD06CA5-0169-418B-A8C8-60584EEDCEFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9BD06CA5-0169-418B-A8C8-60584EEDCEFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9BD06CA5-0169-418B-A8C8-60584EEDCEFE}.Debug|x64.ActiveCfg = Debug|Any CPU + {9BD06CA5-0169-418B-A8C8-60584EEDCEFE}.Debug|x64.Build.0 = Debug|Any CPU + {9BD06CA5-0169-418B-A8C8-60584EEDCEFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9BD06CA5-0169-418B-A8C8-60584EEDCEFE}.Release|Any CPU.Build.0 = Release|Any CPU + {9BD06CA5-0169-418B-A8C8-60584EEDCEFE}.Release|x64.ActiveCfg = Release|Any CPU + {9BD06CA5-0169-418B-A8C8-60584EEDCEFE}.Release|x64.Build.0 = Release|Any CPU + {22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F}.Debug|x64.ActiveCfg = Debug|Any CPU + {22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F}.Debug|x64.Build.0 = Debug|Any CPU + {22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F}.Release|Any CPU.Build.0 = Release|Any CPU + {22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F}.Release|x64.ActiveCfg = Release|Any CPU + {22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F}.Release|x64.Build.0 = Release|Any CPU + {8E7F9812-2DF1-483C-93AB-F8BBC18D9761}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E7F9812-2DF1-483C-93AB-F8BBC18D9761}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E7F9812-2DF1-483C-93AB-F8BBC18D9761}.Debug|x64.ActiveCfg = Debug|Any CPU + {8E7F9812-2DF1-483C-93AB-F8BBC18D9761}.Debug|x64.Build.0 = Debug|Any CPU + {8E7F9812-2DF1-483C-93AB-F8BBC18D9761}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E7F9812-2DF1-483C-93AB-F8BBC18D9761}.Release|Any CPU.Build.0 = Release|Any CPU + {8E7F9812-2DF1-483C-93AB-F8BBC18D9761}.Release|x64.ActiveCfg = Release|Any CPU + {8E7F9812-2DF1-483C-93AB-F8BBC18D9761}.Release|x64.Build.0 = Release|Any CPU + {D4D2DA65-D16D-4236-ABD0-492681944D00}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4D2DA65-D16D-4236-ABD0-492681944D00}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4D2DA65-D16D-4236-ABD0-492681944D00}.Debug|x64.ActiveCfg = Debug|Any CPU + {D4D2DA65-D16D-4236-ABD0-492681944D00}.Debug|x64.Build.0 = Debug|Any CPU + {D4D2DA65-D16D-4236-ABD0-492681944D00}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4D2DA65-D16D-4236-ABD0-492681944D00}.Release|Any CPU.Build.0 = Release|Any CPU + {D4D2DA65-D16D-4236-ABD0-492681944D00}.Release|x64.ActiveCfg = Release|Any CPU + {D4D2DA65-D16D-4236-ABD0-492681944D00}.Release|x64.Build.0 = Release|Any CPU + {5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C}.Debug|x64.ActiveCfg = Debug|Any CPU + {5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C}.Debug|x64.Build.0 = Debug|Any CPU + {5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C}.Release|Any CPU.Build.0 = Release|Any CPU + {5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C}.Release|x64.ActiveCfg = Release|Any CPU + {5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C}.Release|x64.Build.0 = Release|Any CPU + {74149D50-9DED-45D7-9C52-5F74BEE6B80D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {74149D50-9DED-45D7-9C52-5F74BEE6B80D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {74149D50-9DED-45D7-9C52-5F74BEE6B80D}.Debug|x64.ActiveCfg = Debug|Any CPU + {74149D50-9DED-45D7-9C52-5F74BEE6B80D}.Debug|x64.Build.0 = Debug|Any CPU + {74149D50-9DED-45D7-9C52-5F74BEE6B80D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {74149D50-9DED-45D7-9C52-5F74BEE6B80D}.Release|Any CPU.Build.0 = Release|Any CPU + {74149D50-9DED-45D7-9C52-5F74BEE6B80D}.Release|x64.ActiveCfg = Release|Any CPU + {74149D50-9DED-45D7-9C52-5F74BEE6B80D}.Release|x64.Build.0 = Release|Any CPU + {975AAE87-E410-4FFF-8A9E-6FD7E020A3C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {975AAE87-E410-4FFF-8A9E-6FD7E020A3C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {975AAE87-E410-4FFF-8A9E-6FD7E020A3C9}.Debug|x64.ActiveCfg = Debug|Any CPU + {975AAE87-E410-4FFF-8A9E-6FD7E020A3C9}.Debug|x64.Build.0 = Debug|Any CPU + {975AAE87-E410-4FFF-8A9E-6FD7E020A3C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {975AAE87-E410-4FFF-8A9E-6FD7E020A3C9}.Release|Any CPU.Build.0 = Release|Any CPU + {975AAE87-E410-4FFF-8A9E-6FD7E020A3C9}.Release|x64.ActiveCfg = Release|Any CPU + {975AAE87-E410-4FFF-8A9E-6FD7E020A3C9}.Release|x64.Build.0 = Release|Any CPU + {373F9664-5B59-4068-B1E2-61CDD3B2F760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {373F9664-5B59-4068-B1E2-61CDD3B2F760}.Debug|Any CPU.Build.0 = Debug|Any CPU + {373F9664-5B59-4068-B1E2-61CDD3B2F760}.Debug|x64.ActiveCfg = Debug|Any CPU + {373F9664-5B59-4068-B1E2-61CDD3B2F760}.Debug|x64.Build.0 = Debug|Any CPU + {373F9664-5B59-4068-B1E2-61CDD3B2F760}.Release|Any CPU.ActiveCfg = Release|Any CPU + {373F9664-5B59-4068-B1E2-61CDD3B2F760}.Release|Any CPU.Build.0 = Release|Any CPU + {373F9664-5B59-4068-B1E2-61CDD3B2F760}.Release|x64.ActiveCfg = Release|Any CPU + {373F9664-5B59-4068-B1E2-61CDD3B2F760}.Release|x64.Build.0 = Release|Any CPU + {950FE681-764C-4B75-BB95-938A9F17B2D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {950FE681-764C-4B75-BB95-938A9F17B2D9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {950FE681-764C-4B75-BB95-938A9F17B2D9}.Debug|x64.ActiveCfg = Debug|Any CPU + {950FE681-764C-4B75-BB95-938A9F17B2D9}.Debug|x64.Build.0 = Debug|Any CPU + {950FE681-764C-4B75-BB95-938A9F17B2D9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {950FE681-764C-4B75-BB95-938A9F17B2D9}.Release|Any CPU.Build.0 = Release|Any CPU + {950FE681-764C-4B75-BB95-938A9F17B2D9}.Release|x64.ActiveCfg = Release|Any CPU + {950FE681-764C-4B75-BB95-938A9F17B2D9}.Release|x64.Build.0 = Release|Any CPU + {F110D91A-F1A9-4627-85C8-501F814FED26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F110D91A-F1A9-4627-85C8-501F814FED26}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F110D91A-F1A9-4627-85C8-501F814FED26}.Debug|x64.ActiveCfg = Debug|Any CPU + {F110D91A-F1A9-4627-85C8-501F814FED26}.Debug|x64.Build.0 = Debug|Any CPU + {F110D91A-F1A9-4627-85C8-501F814FED26}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F110D91A-F1A9-4627-85C8-501F814FED26}.Release|Any CPU.Build.0 = Release|Any CPU + {F110D91A-F1A9-4627-85C8-501F814FED26}.Release|x64.ActiveCfg = Release|Any CPU + {F110D91A-F1A9-4627-85C8-501F814FED26}.Release|x64.Build.0 = Release|Any CPU + {16B18299-3640-4FA8-A4E6-74B1EB741301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16B18299-3640-4FA8-A4E6-74B1EB741301}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16B18299-3640-4FA8-A4E6-74B1EB741301}.Debug|x64.ActiveCfg = Debug|Any CPU + {16B18299-3640-4FA8-A4E6-74B1EB741301}.Debug|x64.Build.0 = Debug|Any CPU + {16B18299-3640-4FA8-A4E6-74B1EB741301}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16B18299-3640-4FA8-A4E6-74B1EB741301}.Release|Any CPU.Build.0 = Release|Any CPU + {16B18299-3640-4FA8-A4E6-74B1EB741301}.Release|x64.ActiveCfg = Release|Any CPU + {16B18299-3640-4FA8-A4E6-74B1EB741301}.Release|x64.Build.0 = Release|Any CPU + {C65638DC-2418-4453-917F-9FA8D068594E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C65638DC-2418-4453-917F-9FA8D068594E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C65638DC-2418-4453-917F-9FA8D068594E}.Debug|x64.ActiveCfg = Debug|Any CPU + {C65638DC-2418-4453-917F-9FA8D068594E}.Debug|x64.Build.0 = Debug|Any CPU + {C65638DC-2418-4453-917F-9FA8D068594E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C65638DC-2418-4453-917F-9FA8D068594E}.Release|Any CPU.Build.0 = Release|Any CPU + {C65638DC-2418-4453-917F-9FA8D068594E}.Release|x64.ActiveCfg = Release|Any CPU + {C65638DC-2418-4453-917F-9FA8D068594E}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} - {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {0D34A7F0-DC77-4789-A136-93089CBD15C3} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} {5944A182-13B8-4DA6-AEE2-0A01E64A9648} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} - {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {08649D7D-EF5A-4626-9959-935CA85DF770} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {8663AD83-4E2C-47EF-BF28-1427E82F1A36} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {FE0F37B3-7727-4A08-AEA1-437F53982658} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {4B812744-1CB5-4760-9719-2220EACC566C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {232840A6-183C-4D3A-A086-582FD449D300} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {7064C470-7D0B-4CE2-A80C-BEE376DDC956} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {E8CE3469-6E0F-495C-937E-D9820DE3DA89} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {46C33E74-835B-4CB4-861D-42A781A2502C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} - {02B35A90-23DF-4341-89CF-E911ED210FBE} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {F262689D-5BE8-45E9-B090-0CFF81315FB9} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {7A8F1593-C00F-4D90-9029-11BF75B3C926} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} = {B9256C4D-86F4-4E67-8774-C3EF971EC811} - {53543535-E81D-4B28-8EB0-89E9A8FDD496} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {45B8C34E-A62D-4809-BA0F-6046AFAB2851} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} - {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {0C5262F4-DC7E-493F-AB87-A72063ABCA00} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {FE906D46-B113-4600-AC2C-7523937B96AB} = {0C5262F4-DC7E-493F-AB87-A72063ABCA00} - {920E6762-32FE-4BEC-AD0C-6F28119C6804} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {A9D8D7E4-591D-479B-B0A5-07F30F831199} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {14D3C601-C29B-48D2-8312-556319D04619} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {542D8266-668F-49FA-BFE1-814AB96720DD} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {83AA938C-9182-4E65-A42A-79CAE68888E9} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {BA74E50F-C553-40D6-8578-BCB4A3F5E585} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {DC9F9523-A2F9-47AA-B6D9-40AC14797548} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {985B71A9-DF28-4B70-9DA5-1D60B82E8551} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} - {5BD3D50F-5CB6-4554-9497-0F1680152D95} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {516A316F-BE2B-4931-88DD-4C08DECE8E56} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} = {8910E0AA-9BFB-4E69-A821-A411FEDBAFD4} - {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {F7DEBE88-8324-47F9-B240-4F19F706B50B} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {4FB42611-1B54-4ABF-988A-714EE9E8C492} = {985B71A9-DF28-4B70-9DA5-1D60B82E8551} - {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} - {08FED323-7D60-4B8B-AD36-C55B40C96D1C} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} - {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} = {BCDB0439-8542-4DE7-A8C2-9BB582AE8C42} - {33D4C640-954B-4468-95A4-2322DAB0B184} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {CD7414D5-4DE9-4339-B833-29EF41B3AC76} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} - {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} = {83AA938C-9182-4E65-A42A-79CAE68888E9} - {FF832650-37C7-48FF-B078-77CACF37966E} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} - {46DE49C1-D700-4C46-849A-7F485D87A518} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} - {6B1042A4-A6D5-4307-B163-803164E4A742} = {83AA938C-9182-4E65-A42A-79CAE68888E9} {BDA1DB4F-C408-445D-9391-EC9765CF7349} = {E747043D-81E2-4A89-8B5B-1258ED45F941} - {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {70449866-CC6B-438B-B8DC-CBAB436EFD00} = {CDE13B76-107F-4282-BEAE-26843BD46140} - {EE77C779-1031-4494-9850-3F2D85D8FA10} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {BB0DFD22-33FF-465F-8788-D583BE39BC6D} = {B7F5651E-C4CB-413E-AF6E-420D1AFB7EA6} - {A91E96C6-9437-4335-A629-D4B3E921F9E8} = {08649D7D-EF5A-4626-9959-935CA85DF770} - {78D31C12-2E54-4C66-9849-B9664B9A5897} = {4E20DC14-D9E4-484D-B99A-C4A759D1612E} - {03C37CB5-A325-4CB0-965A-A5FD67D14091} = {4E20DC14-D9E4-484D-B99A-C4A759D1612E} - {4E20DC14-D9E4-484D-B99A-C4A759D1612E} = {08649D7D-EF5A-4626-9959-935CA85DF770} - {BDA33777-F759-4050-85F5-68EB4996ADD7} = {08649D7D-EF5A-4626-9959-935CA85DF770} - {A71C1D90-5513-4255-84A0-32384474E82C} = {08649D7D-EF5A-4626-9959-935CA85DF770} - {AF2B9EB2-ECF9-4B0B-A270-B8A5FCE17D43} = {46C33E74-835B-4CB4-861D-42A781A2502C} - {AC537AD9-9CC3-420F-A17C-D77C4069A576} = {5D6E1CE0-D783-4F5C-9962-9AE073A62F30} - {617653DE-4377-4428-954B-E5FB4690E875} = {CD0CAD92-5784-471A-BC57-2DC888FA0A00} - {CD0CAD92-5784-471A-BC57-2DC888FA0A00} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} - {5D6E1CE0-D783-4F5C-9962-9AE073A62F30} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} - {741E75F7-9286-4C01-8C67-AA8515670DF7} = {E8CE3469-6E0F-495C-937E-D9820DE3DA89} - {D98F5757-375F-46D1-9903-5D8D57A6748F} = {232840A6-183C-4D3A-A086-582FD449D300} - {404CD919-D15D-49D6-8D26-E96486E62700} = {D98F5757-375F-46D1-9903-5D8D57A6748F} - {47597D41-C795-43FE-8B76-069D9E1C364C} = {D98F5757-375F-46D1-9903-5D8D57A6748F} - {3E9E2661-DDD6-4D33-BCA7-EA07784F6723} = {FE0F37B3-7727-4A08-AEA1-437F53982658} - {3FCB8575-6211-4E91-BCF8-1D2D380843B9} = {FE0F37B3-7727-4A08-AEA1-437F53982658} - {3016EDC5-4BE6-4CE2-8B18-6EE226920393} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} - {2809DB8A-95FA-4330-97C7-4A4936CD0EA9} = {4B812744-1CB5-4760-9719-2220EACC566C} - {54A880BA-DEFE-476C-A990-D0B8AEE3CF2B} = {4B812744-1CB5-4760-9719-2220EACC566C} - {45BAE42F-4801-4758-9CDA-0D900C734369} = {8663AD83-4E2C-47EF-BF28-1427E82F1A36} - {0329A13A-436E-4E00-A1C7-243F9DD4B7D2} = {7064C470-7D0B-4CE2-A80C-BEE376DDC956} - {9DE85526-8B33-4291-B285-4BECF431D6FA} = {0329A13A-436E-4E00-A1C7-243F9DD4B7D2} - {DCA283C7-2492-4461-BD34-AB00191C46F7} = {456EE78A-EEB2-4DDF-BF10-EBEB97BF72B8} - {1EF25877-2E8F-4FF1-A530-F3DEB512E238} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} - {1494DAAD-3921-4A69-B2F5-E2C3FB8C8C26} = {1D9A40C6-DA1D-4A5F-A7DF-369A52D0FECD} - {06918731-F657-417E-A74D-E2D7E77351B1} = {DC292168-27F4-4469-8CDA-92FB4212EF53} - {1818788E-7C68-4280-93A8-63D01168C6B6} = {DC292168-27F4-4469-8CDA-92FB4212EF53} - {DC292168-27F4-4469-8CDA-92FB4212EF53} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {872994E4-7D87-483A-B6DD-E68DE4526497} = {BEC84962-7BBD-4C11-8FD1-D175AC54FE83} - {BEC84962-7BBD-4C11-8FD1-D175AC54FE83} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {40EC04A2-9862-43E5-A1B8-69CED1BE646C} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {6092474F-2AF3-4C24-A121-74F7A0C87E09} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {EB4B7EA5-274B-4AF0-8F4B-BB474BB63D6D} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {D4A6B54C-70DE-4CE0-B115-30694548E253} = {0D34A7F0-DC77-4789-A136-93089CBD15C3} - {A27F0E7A-E3BC-4157-8239-AFA2B3EEA7ED} = {6092474F-2AF3-4C24-A121-74F7A0C87E09} - {C7A93ED9-5D0B-4F32-AA8A-69A515C32342} = {40EC04A2-9862-43E5-A1B8-69CED1BE646C} - {8B0D2243-5E00-472E-82EC-572905A373AF} = {EB4B7EA5-274B-4AF0-8F4B-BB474BB63D6D} - {94F98C15-6E92-466A-A93D-EB37CC877F99} = {D4A6B54C-70DE-4CE0-B115-30694548E253} - {6920A090-9B17-4C6B-B86D-7807C7D32BA0} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {DA7F5603-FEC0-4090-9561-77B317D9EFA4} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {E48D5AFE-8392-46D4-92C5-E3C6332035AB} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {84B7A048-5B99-429A-8322-0DE98560C2D0} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {7BFC7723-8BCB-407D-A4BE-C9BBF12A9791} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {074FE1B1-CC4A-4E2F-88FB-BD0131C88306} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {C9FF6E3A-B173-4070-8DA8-84EDE6F77298} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {C598E4D8-634C-40B2-BD77-ED69AD4BF211} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {5238486B-2E9E-44CE-84BC-1BF55AB59EE5} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {9364C7FC-3765-49EF-8F2F-D8D64B60DCE8} = {7456E6C3-1E1C-48ED-8CCA-B2D92F4046EC} - {29071256-A255-4881-8BF7-63EA598313F8} = {EDCE6A71-453E-4FB4-B01B-D8DBE16F1C49} - {EDCE6A71-453E-4FB4-B01B-D8DBE16F1C49} = {A9D8D7E4-591D-479B-B0A5-07F30F831199} - {4CE43CE6-A150-44B9-9896-EB5D28B994B0} = {516A316F-BE2B-4931-88DD-4C08DECE8E56} - {747A2EBA-BF28-4153-BF03-3300DA570061} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {13E878FC-68C1-4ACC-BFBB-1B49241C2AA5} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {6521511B-CE2E-485D-B72C-C22D89A191A2} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {F97C1C9C-B1AC-49F0-AA7D-4E9D279909EA} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {6A44C395-D619-496E-A5A8-8F8FFA51177A} = {5BD3D50F-5CB6-4554-9497-0F1680152D95} - {F4CC0091-D652-4445-A9FD-9D2CE13A2286} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} - {93510E80-4378-4504-A220-C71D0A61ADD6} = {F4CC0091-D652-4445-A9FD-9D2CE13A2286} - {B5A410AD-C1F1-4D48-B78D-85D10ACA7881} = {F262689D-5BE8-45E9-B090-0CFF81315FB9} - {1A71899F-3F01-4768-BC3D-3CBB23A1C0F6} = {B5A410AD-C1F1-4D48-B78D-85D10ACA7881} - {D9BD95B5-152C-4681-AC0B-0CE7FDB3C8B0} = {B5A410AD-C1F1-4D48-B78D-85D10ACA7881} - {D66370B6-8E54-4E95-92CD-81236916A4D1} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} - {47EA8C27-AC2A-40D2-96C9-5A0C304B5CE0} = {F4D31085-3A90-4E56-BB60-3FDEF5D7B4C4} - {D3D15AE9-8C47-4B97-9ABC-F2B83CB1C923} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} - {A2707F9F-80CC-41F9-9ED6-B45E5732CC56} = {08FED323-7D60-4B8B-AD36-C55B40C96D1C} - {7961AAE6-FDC0-43C3-A546-4DBFE340660D} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} - {6BB1FCDF-1E26-4837-984D-DA74D558A49B} = {2879EB9A-D18B-4C57-B041-365F7DAEEBC4} - {35F1DB8E-6479-4619-82BB-946BC7EC959E} = {33D4C640-954B-4468-95A4-2322DAB0B184} - {0F4E4A62-04C7-4635-8543-D595B45D2D76} = {33D4C640-954B-4468-95A4-2322DAB0B184} - {564A2C45-D42B-4A6C-A539-B10863D8E67C} = {B1984322-509A-4E96-BFB0-A0D5DEDFB92D} - {C31555B0-FCAA-44F9-8284-96FBDD7FAD37} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {965FC5E7-BBFD-4A31-88B6-539F85FFF5BE} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {267429BB-FCFF-491B-B618-174DC3152EF7} = {035FC2E1-56E5-4CDE-AEE6-B6AB05D06E54} - {9F6F4116-8029-4788-9561-A0791EDFB720} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} - {C89383DE-0284-4E0F-94E2-ED2F7B4B5656} = {8A795434-6928-41F6-B8B1-3F6DAC62D1A0} - {823B06D1-85E5-400B-885D-2B3CFD01487D} = {1677DDFE-BBCF-4BA3-B5A7-9168BB27838E} - {CC0C0477-2C69-4BB2-A433-15A0C25E782C} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} - {74A8DA40-CB46-4B95-96DF-46A18090D987} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} - {53562602-1F63-4B2C-8921-B5BB826984F8} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} - {651D2DBC-C8FE-4513-A8DB-5D7AD62C2E19} = {7A8F1593-C00F-4D90-9029-11BF75B3C926} - {EDC19F46-D2C7-47AA-9E8A-5CC8CF7AB717} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {EC5CD27A-63A8-4C9F-9BAB-425F2F6F62E2} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {B2465420-C899-4077-B6D3-B62405D5BFE2} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {5243EAA7-17B4-4810-ACDD-FCB28E1C477D} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {36BA4778-011A-4B0F-8C6A-C169E012AE66} = {02B35A90-23DF-4341-89CF-E911ED210FBE} - {E624718C-38CD-41AA-BBA0-415008BE86BF} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} - {3F2A0172-118E-439E-BD4A-5E0F95361838} = {A7FED2D5-EE34-462E-9A38-D9FF2B8DB5CE} - {9D295FC2-32A9-487A-BAE3-348F6360729D} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} - {D215BD91-4D7B-437E-BC2A-14D9B81649E5} = {2F4D44EC-EFFD-4387-BCB4-48C0F87CFC8A} - {FA416B46-7FEC-47DD-B4CA-29F5CE2ECBC6} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {89B90362-4C48-4FBD-A0B7-47E34D3326F0} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {5C84C069-DB54-409A-BC0F-CBC066860CBA} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {A02A0101-3C0E-4971-AB0C-CC762C0E3955} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {B469E3EE-637F-4A0A-852D-6A33F896B906} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {2B288DAC-2E49-4980-B234-6E114FB1B2F1} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {5DAFE25B-EA24-429E-A3D2-7CD28565E444} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {EAF59CBD-2310-4BF0-AE28-580D451F9C86} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {DA3EE309-9FDA-468B-B7C8-5D9DD2CBF6DF} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {EF6CD89A-A7A9-47C6-8AA5-79C0C3031E22} = {81DF5E8A-2AFE-47FC-BE66-40BC557A03AB} - {AF7F4D54-CE14-4BE1-8E9E-2D56C6809508} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {ADD79DAE-8E77-4A62-BB34-790DFCFE8AB1} = {AF7F4D54-CE14-4BE1-8E9E-2D56C6809508} - {9C25DDE5-65D9-492D-9C04-F3D64EE706A1} = {AF7F4D54-CE14-4BE1-8E9E-2D56C6809508} - {8FE4210C-9D74-4E8B-84CD-4E96751A50DD} = {6C8ACA8E-D7BA-4279-BE2D-1223EF0C74D2} - {A2EDB5D7-9675-403A-9FC2-FDAA49555097} = {8FE4210C-9D74-4E8B-84CD-4E96751A50DD} - {D7D46284-47DF-488A-8D04-421CBAAF6943} = {8FE4210C-9D74-4E8B-84CD-4E96751A50DD} - {DB6FCE0E-6E7E-401D-8A1B-2FD0C8A02005} = {CDE13B76-107F-4282-BEAE-26843BD46140} - {848EC46B-2C09-4E4E-9D09-D876862B52CD} = {CDE13B76-107F-4282-BEAE-26843BD46140} - {CDE13B76-107F-4282-BEAE-26843BD46140} = {DC9F9523-A2F9-47AA-B6D9-40AC14797548} - {1226DCD2-D128-4976-8806-2A369F87058B} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} - {80F6E78A-4ADB-4E51-9570-A9200048F48F} = {70449866-CC6B-438B-B8DC-CBAB436EFD00} - {97708A6F-A6F9-4E7A-9069-65ABBBA12D06} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} - {85462F88-DDEB-4FEC-B9EA-2FACBCE776D3} = {CD7414D5-4DE9-4339-B833-29EF41B3AC76} - {6E74144B-0816-4161-AACC-8C696E0E9C34} = {C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA} - {C903135B-E0CE-4DB0-B8BF-FF59816C24D8} = {C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA} - {C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA} = {BA74E50F-C553-40D6-8578-BCB4A3F5E585} - {D3C16432-EAD0-4DE5-9544-16D36A67C2C2} = {C6AA8EB8-A3AC-430E-B1F0-10AE385EC2BA} - {F0353FB0-27F0-4957-8D69-4AEE40A09801} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {3735BFA1-F935-42EF-A316-BEEF0A138781} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {A3DE164B-54D1-440F-A9E9-19A5C667E073} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {175CDD95-C2C2-4665-8CC3-5D1D6BC94098} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {D884F81B-5ECC-4AB8-B8B8-F5C2F3F35CAF} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {1BC59353-A6FF-4C0C-9B47-37884621E228} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {19902ADB-7C37-4E38-ABC0-28BCDE2D164D} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {F92CC9A7-BE67-48F3-8DAE-D59821F031FD} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {CC64FFAF-0833-4322-AFB1-9F92EB2DF03F} = {FCDB79C4-9CA6-49A0-93EF-8F3DA15E897E} - {5EB432C4-7BD2-434B-B3C4-B8BA9AAD2BB7} = {6B1042A4-A6D5-4307-B163-803164E4A742} - {885CDA4A-9831-4159-A0A7-9062CF93180A} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} - {60A51206-8F7F-4F43-B473-006F0DB380CB} = {EAF8FB96-6D0E-4FCD-B991-C845903ECA8B} - {51E1D14A-ACC7-4E93-8F2B-85C9040A86A0} = {FF832650-37C7-48FF-B078-77CACF37966E} - {B98309A2-D2D0-41BB-A7C6-8BA24B29D105} = {46DE49C1-D700-4C46-849A-7F485D87A518} - {682FAD0B-5989-436C-9B7D-F15F10CB90FF} = {FF832650-37C7-48FF-B078-77CACF37966E} - {8219C9CC-1260-4175-94E5-C36A336C8ADE} = {46DE49C1-D700-4C46-849A-7F485D87A518} - {9A15A065-8559-49E2-8818-9E8A9186A105} = {542D8266-668F-49FA-BFE1-814AB96720DD} - {FF6A685B-DD46-4A5E-8F9D-F1E17E0E1F3A} = {542D8266-668F-49FA-BFE1-814AB96720DD} - {C80C7EEF-1862-4607-8260-9FF0890DC573} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {2B56ACFD-7977-4E4B-BA6D-FC30675A1DFB} = {C80C7EEF-1862-4607-8260-9FF0890DC573} - {D1296E1E-6DAA-4883-9BE2-1D4C71FC09C1} = {C80C7EEF-1862-4607-8260-9FF0890DC573} - {A4573B93-FE93-47A4-B700-B6B45516E7AA} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {1EF70F79-B605-4729-99E7-E85386AAC649} = {A4573B93-FE93-47A4-B700-B6B45516E7AA} - {2CA6351B-DEA7-4343-91C1-8C20507343EE} = {A4573B93-FE93-47A4-B700-B6B45516E7AA} - {3440FA45-ADEA-4202-AF43-62E6F5904893} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {6C1A8E47-8391-416B-9407-2A1F97A62776} = {3440FA45-ADEA-4202-AF43-62E6F5904893} - {E7A282E3-CC87-48C9-A80B-664A5390C715} = {3440FA45-ADEA-4202-AF43-62E6F5904893} - {26CFEFAA-EA53-4163-A2B9-4B5318AF27DD} = {920E6762-32FE-4BEC-AD0C-6F28119C6804} - {D3B70875-76B0-4F48-9798-4A700E4902E5} = {26CFEFAA-EA53-4163-A2B9-4B5318AF27DD} - {0E1F3865-8D77-4B65-9942-0CEA53F5ACF3} = {26CFEFAA-EA53-4163-A2B9-4B5318AF27DD} - {0665C217-CDF0-4153-93DA-886230CB19CF} = {26CFEFAA-EA53-4163-A2B9-4B5318AF27DD} - {88A46A64-0877-44BB-87FB-C3A046104A17} = {FE906D46-B113-4600-AC2C-7523937B96AB} - {3A0F8876-3C30-4ED2-B2F5-67BBD371AB1B} = {FE906D46-B113-4600-AC2C-7523937B96AB} - {8E8F56D5-E686-4F4A-A9AD-B81D9243B446} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} - {0D4A2924-A7B1-4141-9871-FF1E8B46A752} = {7B9CD814-DD10-4C63-B442-2168A0E0B6DE} - {0024BD61-1DA3-49F3-BF6E-A6E7EE5EFE03} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} - {F49D6ED6-9FD3-4C19-A30B-2C4198437D59} = {E38DF0DC-C0C9-4BB9-983C-F435A73334CF} - {63F1B2B6-C1DD-4399-8D0C-98B44FB6E646} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {43FCCFD1-D0B4-4227-98AC-2BD3E810C6AB} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {7BD12A3E-CB73-4B28-9509-26BEB096ABEB} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {BB05402F-7BE8-4965-9518-BE869ACE5EFC} = {EE77C779-1031-4494-9850-3F2D85D8FA10} - {E85AB70D-DF15-4A99-AFDA-530A5A9363FD} = {45B8C34E-A62D-4809-BA0F-6046AFAB2851} - {5E77B9D1-80A7-4761-9431-3D9C7E25324B} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} - {B69BDE42-349F-4E9C-B2ED-280B907BE1AE} = {C2D6A1E7-5EE5-4820-A988-815A8EBC2AAB} - {DC60715E-80FD-4911-8A65-DC14A7A66FA9} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} - {4BEEE39F-0760-434F-9389-6194037781DE} = {F7DEBE88-8324-47F9-B240-4F19F706B50B} - {F201EB09-2EE2-4203-A829-044C7EC2D112} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} - {77466E5C-4DF7-4C7C-B251-689052D51B38} = {DFCA5F96-FFC3-44D7-85D8-1749F0D3845E} - {C650E615-4FAD-4CA9-B81C-3CF461805005} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} - {0420C60C-6075-4BED-A0F0-9540A0D2CD8F} = {EFDFFD66-DC6E-4074-B97F-8F0CD79BEDE0} - {8AAC726B-A54E-4F0C-BA63-CDE0EB7826BC} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} - {254521CF-58A2-4FFB-BCA3-78B187E985DB} = {A7C74F80-E9E4-401F-93F4-560EC1BAC88E} - {3D7B2585-93A2-4D8B-AF0A-E68F3A46377A} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} - {76251F5E-89BD-4E56-81CA-AD111361CAD4} = {4FB42611-1B54-4ABF-988A-714EE9E8C492} - {F34B5B5C-EE53-4F42-B3BE-55C2E9E4AA09} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} - {3211BD54-4209-428E-9F11-D2F8181A890D} = {53543535-E81D-4B28-8EB0-89E9A8FDD496} - {9815A23B-6101-4C13-89CA-A07B85623E0E} = {14D3C601-C29B-48D2-8312-556319D04619} - {88C1C77A-0F9F-436B-98FB-E696F35EB62E} = {14D3C601-C29B-48D2-8312-556319D04619} - {A88DBDC2-DB29-4F80-82BB-B8D511E4A495} = {32BC64A9-9BC9-44F3-8978-96D30CBC7A34} - {77EE6274-B332-4DA0-8AF1-73EE3561AA47} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} - {B111B6B8-DC60-4D9D-896C-EE52B834A3DB} = {77EE6274-B332-4DA0-8AF1-73EE3561AA47} - {7836A5A0-798F-4167-818C-EA770135D1B0} = {2449469D-7B4C-4A4E-936B-E6653E08EDC6} - {2449469D-7B4C-4A4E-936B-E6653E08EDC6} = {77EE6274-B332-4DA0-8AF1-73EE3561AA47} - {64F32D02-05E0-43D3-BCD5-578D4D5620DD} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} - {DE8CDE2C-F7D3-4515-9231-28FD787118DD} = {611ECFDA-B435-4106-BDB8-DD8C39FEBF08} - {358C26DC-44F6-4177-9035-9574A87DD422} = {64F32D02-05E0-43D3-BCD5-578D4D5620DD} - {A7FF9529-F5CB-4DE5-8BBB-1A5B1756ADEB} = {64F32D02-05E0-43D3-BCD5-578D4D5620DD} - {94667017-2F5A-49DF-850B-238EB0C7E17D} = {DE8CDE2C-F7D3-4515-9231-28FD787118DD} - {2E7704B8-3E6A-4F0B-ABA8-D28732C9A88A} = {BB0DFD22-33FF-465F-8788-D583BE39BC6D} - {21E669BD-CF41-41F0-BACF-E03629F1C0AA} = {BB0DFD22-33FF-465F-8788-D583BE39BC6D} - {503812F4-2C93-4C8C-85C0-6CDF8FADE897} = {BB0DFD22-33FF-465F-8788-D583BE39BC6D} - {3801D850-9F29-451E-84FD-A85192195CD7} = {BB0DFD22-33FF-465F-8788-D583BE39BC6D} - {B795CBE6-3AAA-481E-85F6-C406C15AA586} = {2E7704B8-3E6A-4F0B-ABA8-D28732C9A88A} - {6C7C865D-F813-4CCB-9256-81F8FB511888} = {21E669BD-CF41-41F0-BACF-E03629F1C0AA} - {53574F47-0E4E-4317-8E14-D8BCD2EDFD57} = {503812F4-2C93-4C8C-85C0-6CDF8FADE897} - {46AB3663-0FE2-4E44-A9FD-67AFA69611C6} = {3801D850-9F29-451E-84FD-A85192195CD7} - {85316CEE-D995-44FF-A10D-4B23E983910C} = {A88DBDC2-DB29-4F80-82BB-B8D511E4A495} - {2B38DDA0-4007-4BA3-93B4-017071E68E19} = {A88DBDC2-DB29-4F80-82BB-B8D511E4A495} - {2E319AE8-ACC3-49AD-A9F4-E0FAFBECAFF4} = {A88DBDC2-DB29-4F80-82BB-B8D511E4A495} - {6E39A9FB-7A65-4C26-88B6-AE79EFFCB731} = {2B38DDA0-4007-4BA3-93B4-017071E68E19} - {15698F80-DFB5-485A-9B76-074ACA1A7D8D} = {85316CEE-D995-44FF-A10D-4B23E983910C} - {12D7F445-1A22-4695-B174-6FC44C806377} = {2E319AE8-ACC3-49AD-A9F4-E0FAFBECAFF4} + {585B9627-45AA-42C3-965D-03359F25786C} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} = {585B9627-45AA-42C3-965D-03359F25786C} + {87BBAEC2-1A18-4E5D-BDB3-91BF1CF3231B} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {D2DF986D-5EA6-40ED-93F3-2CF3A035F26B} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {C68543E6-83F0-4385-A223-EA6862800F9B} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {8A17DE9A-258E-49E1-9EB2-B8B3F374A470} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {2D179841-A866-4ED4-8B42-97CCE4D6496D} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {FB0F5EB7-AA72-4D54-BD8D-43B173E54E19} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {1EE02441-263C-458E-A774-9D522BFFBB3F} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {76F1DBC4-1826-4EC6-92BA-FF7843D993CD} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {8A9DBB76-6618-4982-87D7-6CBD8375EB15} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {0DC9DE6E-E6D8-466A-8325-93822428CB87} = {D2DF986D-5EA6-40ED-93F3-2CF3A035F26B} + {523EB315-1A01-4F13-9EDE-266FE8111AB6} = {0DC9DE6E-E6D8-466A-8325-93822428CB87} + {0E72ABDD-C7CF-40EF-8E78-ED4B8B85E4C5} = {0DC9DE6E-E6D8-466A-8325-93822428CB87} + {8A60B832-8B1F-44A9-9999-C0C898ED6D82} = {D2DF986D-5EA6-40ED-93F3-2CF3A035F26B} + {CE286A13-1FFC-417B-8CC0-FE4991F3687B} = {D2DF986D-5EA6-40ED-93F3-2CF3A035F26B} + {D6164EE8-500A-4E95-AC31-BDBF9B7E8AE2} = {D2DF986D-5EA6-40ED-93F3-2CF3A035F26B} + {45629BCA-1B57-4342-A74A-00B874B600AA} = {C68543E6-83F0-4385-A223-EA6862800F9B} + {5FC55EB3-2F84-45C4-9310-33A998F4DA70} = {45629BCA-1B57-4342-A74A-00B874B600AA} + {B403856A-6BF8-43C3-AD17-D3DF96F26D77} = {45629BCA-1B57-4342-A74A-00B874B600AA} + {D83169F2-E05E-49E0-82BF-164D3F3C3174} = {76F1DBC4-1826-4EC6-92BA-FF7843D993CD} + {28BB497F-5DC8-4D00-AC6B-2F7BECDD1797} = {76F1DBC4-1826-4EC6-92BA-FF7843D993CD} + {58CF33D3-290B-4B68-865C-B776A7B5AC43} = {76F1DBC4-1826-4EC6-92BA-FF7843D993CD} + {F08A8192-F159-42B5-90CB-44BCB7AF7816} = {DC578D74-98F0-4F19-A230-CFA8DAEE0AF1} + {5C22CA57-94F1-47C7-B27F-7F91DFD480DA} = {F08A8192-F159-42B5-90CB-44BCB7AF7816} + {435A29DB-D3D6-47A0-8BD3-3ABEFD69A9DB} = {1EE02441-263C-458E-A774-9D522BFFBB3F} + {1987405B-2304-4FB0-8D20-F2101617D614} = {1EE02441-263C-458E-A774-9D522BFFBB3F} + {412A5797-7D42-4F7C-96AB-4F784872ED08} = {1987405B-2304-4FB0-8D20-F2101617D614} + {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} + {E50AD1BC-69B0-4E51-94CB-72AB10761710} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} + {36BEA079-EDCD-44F7-8BD5-C06671DF4875} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} + {0D395B3E-D603-49C3-AD80-B53979EDF9E1} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} + {249E8BD4-C358-4358-93FA-78320D335014} = {585B9627-45AA-42C3-965D-03359F25786C} + {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC} = {87BBAEC2-1A18-4E5D-BDB3-91BF1CF3231B} + {F12ADBBE-092F-4938-8ED7-F49B61F0F957} = {87BBAEC2-1A18-4E5D-BDB3-91BF1CF3231B} + {04D3C12F-7221-4AE8-852D-4C616B6769E9} = {8A17DE9A-258E-49E1-9EB2-B8B3F374A470} + {D2009F94-EA9C-44F0-B210-C373F9FE3641} = {8A17DE9A-258E-49E1-9EB2-B8B3F374A470} + {6586614A-39D8-412E-814C-3314F8A7909A} = {2D179841-A866-4ED4-8B42-97CCE4D6496D} + {400854AA-AE3F-40EC-B5BF-C9F1257490AA} = {FB0F5EB7-AA72-4D54-BD8D-43B173E54E19} + {0EDBF814-BBF1-48EB-8AFE-F70D75E7DC1E} = {FB0F5EB7-AA72-4D54-BD8D-43B173E54E19} + {8A89304F-709C-4A3A-9FA6-D88761B8231B} = {8A9DBB76-6618-4982-87D7-6CBD8375EB15} + {C37FB18D-FBA1-49DF-96CD-24D6F65B66E1} = {8A89304F-709C-4A3A-9FA6-D88761B8231B} + {C6006F72-B9F9-4E57-B2A9-63B2D0EA5EF0} = {8A89304F-709C-4A3A-9FA6-D88761B8231B} + {89D032A8-14FB-4C2F-A112-CB7FAFCA2B62} = {8A9DBB76-6618-4982-87D7-6CBD8375EB15} + {EC49F4BA-6DAB-44D5-83E3-62ECD85DABA7} = {8A9DBB76-6618-4982-87D7-6CBD8375EB15} + {1F263FE5-649F-441D-AA55-B6012439E27F} = {8A9DBB76-6618-4982-87D7-6CBD8375EB15} + {F0A72797-A0E3-48BF-9E2E-34FD5ADD3441} = {8A9DBB76-6618-4982-87D7-6CBD8375EB15} + {D2D5E0AD-AEE6-495F-96EA-5B9B1F17CE8F} = {8A9DBB76-6618-4982-87D7-6CBD8375EB15} + {AF921AB1-64D1-4478-AB49-192F3EE416FC} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {63461DA4-0EAF-48BD-8986-6767142DEF01} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {56917740-626B-42D5-8BB8-6895F79FB7D2} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {706DA866-6226-430F-AB4D-98FEE7B0DDB0} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {03BD3624-3A54-4F72-AEF7-98B69DDF4B0C} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {69A6DFD9-F5A2-4714-94BA-36E85CDA3EF4} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {0BC7A7F2-F8E0-4A6A-90E2-A0ACD997EBB1} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {9CABAF1C-E5E1-4CB8-AAD4-D47387EED6AA} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {2D07F9AD-9951-475D-B7C7-980B23FDE9BB} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {534346EF-1D11-48DB-9909-700CEC99FF08} = {2D07F9AD-9951-475D-B7C7-980B23FDE9BB} + {BD0D6CEF-6732-4E68-BB73-3215443D5243} = {AF921AB1-64D1-4478-AB49-192F3EE416FC} + {015C4181-A8D9-4FA5-89B9-38A37FA9D31D} = {AF921AB1-64D1-4478-AB49-192F3EE416FC} + {F5466774-9B47-478A-BA9C-7BED9E0D923D} = {AF921AB1-64D1-4478-AB49-192F3EE416FC} + {E20DB2FB-DED9-49FA-8A72-A1740DB6330F} = {AF921AB1-64D1-4478-AB49-192F3EE416FC} + {FBFCAB1B-27D9-4479-B551-01D7FF7510C2} = {E20DB2FB-DED9-49FA-8A72-A1740DB6330F} + {77B0C5D2-445D-4081-8DB8-6D72D27F70C3} = {E20DB2FB-DED9-49FA-8A72-A1740DB6330F} + {AC180C70-85EE-418D-8290-CA019F6FA643} = {77B0C5D2-445D-4081-8DB8-6D72D27F70C3} + {D41BF5FA-092B-44A1-A7F7-1EF7DDD8B1FE} = {63461DA4-0EAF-48BD-8986-6767142DEF01} + {82B691D6-564A-4F4A-B07D-552EB63DCBE7} = {63461DA4-0EAF-48BD-8986-6767142DEF01} + {0F58FA8E-CA9F-47EB-885D-F422955F9983} = {63461DA4-0EAF-48BD-8986-6767142DEF01} + {8D4550FA-878A-4554-B856-614B4ABF8721} = {63461DA4-0EAF-48BD-8986-6767142DEF01} + {7B0EDB07-D3AE-4077-9A23-35CA6556E791} = {5944A182-13B8-4DA6-AEE2-0A01E64A9648} + {E376F15A-3C13-4DBF-B972-E03D2350D7C4} = {56917740-626B-42D5-8BB8-6895F79FB7D2} + {8AB652AF-3957-42F9-8F3E-FAFE56A44BE1} = {56917740-626B-42D5-8BB8-6895F79FB7D2} + {766E3633-7B82-49CC-B012-CAE6264D4628} = {706DA866-6226-430F-AB4D-98FEE7B0DDB0} + {B7003322-212E-4568-9B61-95DB67CABC3F} = {706DA866-6226-430F-AB4D-98FEE7B0DDB0} + {301961E7-03E9-4955-95E6-F6EFF2E284AD} = {706DA866-6226-430F-AB4D-98FEE7B0DDB0} + {531B1751-A26F-4CFE-8A41-A4F851207066} = {706DA866-6226-430F-AB4D-98FEE7B0DDB0} + {6D54B0C4-CB92-4C86-856D-F02EDC574B49} = {531B1751-A26F-4CFE-8A41-A4F851207066} + {7323D590-BE85-4320-BBC6-5DB44CF0D6BE} = {531B1751-A26F-4CFE-8A41-A4F851207066} + {B2EEE403-4F65-4344-8728-57A5F47F745D} = {531B1751-A26F-4CFE-8A41-A4F851207066} + {D4795F8B-48FC-4CB4-8144-A5679B37D398} = {03BD3624-3A54-4F72-AEF7-98B69DDF4B0C} + {6BEAE0C1-460B-43A0-A5F6-F7848A8CB2B7} = {03BD3624-3A54-4F72-AEF7-98B69DDF4B0C} + {8AD935E1-2676-4C60-9D1A-F3422AC04DA9} = {69A6DFD9-F5A2-4714-94BA-36E85CDA3EF4} + {B43AD1DB-552A-445F-81C2-193876F434C4} = {69A6DFD9-F5A2-4714-94BA-36E85CDA3EF4} + {F1D5483E-8BED-4B4D-A2C7-573B0527E298} = {69A6DFD9-F5A2-4714-94BA-36E85CDA3EF4} + {83A159C7-8917-4A3F-92F4-0609368D3267} = {69A6DFD9-F5A2-4714-94BA-36E85CDA3EF4} + {B1B09684-A842-44FA-9D35-68BE66838A5C} = {69A6DFD9-F5A2-4714-94BA-36E85CDA3EF4} + {F5C03CF8-E7F0-40C9-8F14-3171956A57A5} = {B1B09684-A842-44FA-9D35-68BE66838A5C} + {C2FAC276-9D6E-498A-BBA2-F3F14ADF4D0D} = {69A6DFD9-F5A2-4714-94BA-36E85CDA3EF4} + {3D8FA0B9-D669-418C-8111-F2B772BA47A6} = {C2FAC276-9D6E-498A-BBA2-F3F14ADF4D0D} + {AE7980F2-6F94-4A93-9551-F47AD43FC545} = {0BC7A7F2-F8E0-4A6A-90E2-A0ACD997EBB1} + {B477B68A-16F3-4005-BDAD-09905A3267A5} = {0BC7A7F2-F8E0-4A6A-90E2-A0ACD997EBB1} + {023DE7BB-49B6-4C14-9DAC-F7B4E3E2D12C} = {B477B68A-16F3-4005-BDAD-09905A3267A5} + {41675E4A-0B1A-436B-910A-A296D35661DC} = {9CABAF1C-E5E1-4CB8-AAD4-D47387EED6AA} + {F43B5288-30F0-429E-A10F-9560E8CE318D} = {2D07F9AD-9951-475D-B7C7-980B23FDE9BB} + {42A17DC6-7F8D-487A-98F0-1DAF6FF81A63} = {2D07F9AD-9951-475D-B7C7-980B23FDE9BB} + {E8265B62-E1A1-4144-BC18-0DF4CEAD6F3F} = {534346EF-1D11-48DB-9909-700CEC99FF08} + {386F0326-D591-4BED-A01A-91C0E9814467} = {534346EF-1D11-48DB-9909-700CEC99FF08} + {9823F0D1-B5F2-49B2-9C05-A41BB4178FD5} = {2D07F9AD-9951-475D-B7C7-980B23FDE9BB} + {9AC95FC3-EB2A-4D5C-AA57-FC27C5EFB6F4} = {9823F0D1-B5F2-49B2-9C05-A41BB4178FD5} + {3198630F-C09B-40AE-B9A1-E79249296E48} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {191588CC-BDCB-4C23-AD8E-76391F8BD7B9} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {BE980C6D-3277-44C4-8203-959239F81F67} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {62D61C4E-B78B-429A-A5F4-345E3A290EAE} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {5BE84027-D1B4-4264-A7EC-E84658350CA7} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {0DA3779A-E0E9-46A3-BA6F-BCD5819DB6F9} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {FD6300FB-5601-4516-BF1C-936690ECE026} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {830DDDD7-74A5-431B-92E4-C9641D0A10E4} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {B7709311-A885-49E1-9078-B6CC8406B916} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {383995FF-B661-4E15-A830-640FC5BA8A1F} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {62E888C1-9FCD-413D-91CB-1F2DD3D356E3} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} + {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} = {3198630F-C09B-40AE-B9A1-E79249296E48} + {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} + {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} + {3532E374-C922-4B79-93CA-2B0E4CC14FB9} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} + {DF784809-63B1-44EF-802E-CCCB1FFAA557} = {3198630F-C09B-40AE-B9A1-E79249296E48} + {94D15C26-7204-4299-BC23-B89F5A0B0BF9} = {3198630F-C09B-40AE-B9A1-E79249296E48} + {06381F61-2C55-4322-9417-EA14F5F0E467} = {94D15C26-7204-4299-BC23-B89F5A0B0BF9} + {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79} = {191588CC-BDCB-4C23-AD8E-76391F8BD7B9} + {8C5FBB10-CFAE-482C-93E8-7E03303D7825} = {191588CC-BDCB-4C23-AD8E-76391F8BD7B9} + {0B6512C6-64F0-4403-B074-67F3B95341D7} = {8C5FBB10-CFAE-482C-93E8-7E03303D7825} + {258E4702-B414-4629-BD37-CAEE20BE052B} = {8C5FBB10-CFAE-482C-93E8-7E03303D7825} + {D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7} = {258E4702-B414-4629-BD37-CAEE20BE052B} + {A3637D23-8548-4665-B61B-A8F5B94837E0} = {258E4702-B414-4629-BD37-CAEE20BE052B} + {7A4D9DEE-7024-47E5-8A55-154F4987CF80} = {191588CC-BDCB-4C23-AD8E-76391F8BD7B9} + {EF05D9C2-2F71-40C6-B90B-41E093979803} = {7A4D9DEE-7024-47E5-8A55-154F4987CF80} + {0D285BE6-F9A6-45AC-B76E-787D35FCB495} = {7A4D9DEE-7024-47E5-8A55-154F4987CF80} + {C5D05037-EE7F-4FEA-A5E9-40252398A615} = {0D285BE6-F9A6-45AC-B76E-787D35FCB495} + {C6AE282C-70B6-483D-A17A-FD7F8BC56D61} = {BE980C6D-3277-44C4-8203-959239F81F67} + {806DC3FC-6C27-4FEC-B007-0DDD17C7D9E1} = {BE980C6D-3277-44C4-8203-959239F81F67} + {2803E4E2-723B-477B-9E08-A94D8780439C} = {BE980C6D-3277-44C4-8203-959239F81F67} + {46FAD690-6764-41EA-B4C4-D9D5020C23CF} = {BE980C6D-3277-44C4-8203-959239F81F67} + {343A61CC-45B5-488F-A88D-BB3411FB9E88} = {BE980C6D-3277-44C4-8203-959239F81F67} + {E8B3FB42-C450-4B12-9C2C-7B9A02B616BB} = {BE980C6D-3277-44C4-8203-959239F81F67} + {8353A1CE-B6F0-42A2-B7F1-BC87707719AD} = {C6AE282C-70B6-483D-A17A-FD7F8BC56D61} + {83E5A183-56D6-4CAC-95A6-FB280AA7AE3D} = {C6AE282C-70B6-483D-A17A-FD7F8BC56D61} + {905DB539-092C-4365-ACA1-531D3F2A6665} = {83E5A183-56D6-4CAC-95A6-FB280AA7AE3D} + {51A22652-A76D-4BB6-92B3-269E7628F4AA} = {806DC3FC-6C27-4FEC-B007-0DDD17C7D9E1} + {74CFB66E-1984-4DE7-8970-BB5EF0755C92} = {806DC3FC-6C27-4FEC-B007-0DDD17C7D9E1} + {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6} = {74CFB66E-1984-4DE7-8970-BB5EF0755C92} + {60598D32-8EC0-4A4D-93AB-056CF262F8C4} = {806DC3FC-6C27-4FEC-B007-0DDD17C7D9E1} + {FF44AEBE-DDE5-4F42-AFB1-7075DF65BF28} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {FB5B1BFD-7540-430C-810D-A32A42B8509C} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {B68AC832-60C4-41B4-85F9-0883A954852E} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {8F816310-F5F3-4D09-BC16-FDD65FE0BDB5} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {1DD1C862-D01A-48E4-908A-A5C5F2F197FD} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {41214881-80AE-4F6A-A83D-A0A43C28756C} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {847D0E8E-1B12-410C-985D-0714C8103610} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {0B862D4E-87C2-4042-A3CD-B8E1C4498268} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {D574FB86-CA7B-4587-A5F3-B66C520E54BD} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {5F130015-615A-4C61-ADBF-CDDA00B30EC1} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {49F28BD5-D7ED-4809-8D4D-E6F5E964BB07} = {60598D32-8EC0-4A4D-93AB-056CF262F8C4} + {4515CCA0-E8FC-4FCF-93E1-B812F5949371} = {2803E4E2-723B-477B-9E08-A94D8780439C} + {E676BB35-7888-4FCD-9AFA-E46848639074} = {2803E4E2-723B-477B-9E08-A94D8780439C} + {FFEF958B-DA21-4552-86B6-87D9592A3668} = {2803E4E2-723B-477B-9E08-A94D8780439C} + {E44D5116-EEEF-4664-8E47-3667AB8D6448} = {4515CCA0-E8FC-4FCF-93E1-B812F5949371} + {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF} = {E676BB35-7888-4FCD-9AFA-E46848639074} + {D77D8E17-6D1C-4E44-AF18-D572F12745BA} = {E676BB35-7888-4FCD-9AFA-E46848639074} + {3167F949-F6F4-4440-97CD-2EC7B785D9E8} = {FFEF958B-DA21-4552-86B6-87D9592A3668} + {A00D752B-65C8-404A-8397-82DB5613884E} = {FFEF958B-DA21-4552-86B6-87D9592A3668} + {17B751BF-DB79-46B0-A61E-BB8A52919AC9} = {FFEF958B-DA21-4552-86B6-87D9592A3668} + {0457B5A1-02D7-44FF-8FE6-468A456E2909} = {17B751BF-DB79-46B0-A61E-BB8A52919AC9} + {55DCA34D-48CE-4D32-8515-B6583FA548AE} = {17B751BF-DB79-46B0-A61E-BB8A52919AC9} + {5957E2B1-A517-4225-8517-71D3B0B29B90} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} + {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96} = {46FAD690-6764-41EA-B4C4-D9D5020C23CF} + {874CD160-F058-41A2-B99F-D3A0FEC78312} = {46FAD690-6764-41EA-B4C4-D9D5020C23CF} + {8E33F77D-E636-4965-87E4-00FC3823F44B} = {874CD160-F058-41A2-B99F-D3A0FEC78312} + {48853497-9C2D-4ADA-AED3-61280AF1418D} = {343A61CC-45B5-488F-A88D-BB3411FB9E88} + {12B05214-0AF0-45DB-B222-0AD07BC1246B} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {3755B3E7-2230-4E99-B2AC-16631ACA504A} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {C91168D6-6508-42DC-BE02-94518B6FD4FA} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {8109B615-5328-44C1-BCA2-75C65CDD714B} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {A1D1F4AA-C896-481B-84F1-413A9C75AD30} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {3C360F76-87BE-46DC-BFC8-5D4E312BA854} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {17DEB82C-64B8-440E-9156-52638005FE3E} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {4E49D00C-B324-44DF-B40D-61BF751EB199} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {4DA0502D-7408-48D4-A94B-0A295ECDEF9A} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {95986BED-2D99-42C9-A1E1-EC5551864426} = {E8B3FB42-C450-4B12-9C2C-7B9A02B616BB} + {627DAA58-5882-4C65-B7A1-AE16AA91E1DE} = {E8B3FB42-C450-4B12-9C2C-7B9A02B616BB} + {D40C8B63-A637-43C4-82DA-DF993597A91C} = {627DAA58-5882-4C65-B7A1-AE16AA91E1DE} + {A7938858-B979-4B79-8505-FC9998832198} = {B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD} + {B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD} = {62D61C4E-B78B-429A-A5F4-345E3A290EAE} + {88B7B81E-1F86-4CB2-AB48-A301D2A67A40} = {B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD} + {F83E3E53-2DFE-4B1F-B988-204CA4A42572} = {B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD} + {6DB001ED-4652-41C7-8C4A-07FF1C03266B} = {F83E3E53-2DFE-4B1F-B988-204CA4A42572} + {7E0946DF-53F5-45A9-97BE-779A42E34DB6} = {5BE84027-D1B4-4264-A7EC-E84658350CA7} + {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} = {5BE84027-D1B4-4264-A7EC-E84658350CA7} + {CEA786A1-676C-42C3-9664-A73EF58256F2} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} + {95FE678E-2530-4785-B553-817B80743322} = {08B138B5-2599-4F42-9584-6AE736673882} + {08B138B5-2599-4F42-9584-6AE736673882} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} + {C7861897-8205-43F9-B1D0-5697FB3B070E} = {08B138B5-2599-4F42-9584-6AE736673882} + {60C4C8A7-2F80-42B2-8797-B9984B2DB23B} = {08B138B5-2599-4F42-9584-6AE736673882} + {531528B9-4EC2-4637-AC35-E7C4092E8779} = {08B138B5-2599-4F42-9584-6AE736673882} + {AC869382-6C88-4099-84EC-6D9639CA3682} = {08B138B5-2599-4F42-9584-6AE736673882} + {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A} = {08B138B5-2599-4F42-9584-6AE736673882} + {45A38571-F3B7-4F82-AD83-1BD9D74D27C2} = {08B138B5-2599-4F42-9584-6AE736673882} + {32767187-B7F0-4A67-909D-C1FB6F940FCC} = {08FC046F-D74F-43A6-8755-25BFC443DA96} + {08FC046F-D74F-43A6-8755-25BFC443DA96} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} + {232D7F31-D44B-4333-AD95-3E48ECECF9ED} = {7526E587-5886-4681-A80A-9E34AC4312CD} + {7526E587-5886-4681-A80A-9E34AC4312CD} = {5BE84027-D1B4-4264-A7EC-E84658350CA7} + {4A0491D9-F548-4367-8B96-B046A6783743} = {7526E587-5886-4681-A80A-9E34AC4312CD} + {F9E3D84A-C5C4-4797-A5E6-B7FE4F288225} = {7526E587-5886-4681-A80A-9E34AC4312CD} + {11B7C7BA-AF7E-4695-B244-19C8B1C23E1C} = {7526E587-5886-4681-A80A-9E34AC4312CD} + {16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9} = {11B7C7BA-AF7E-4695-B244-19C8B1C23E1C} + {1FC195D0-E126-4740-8720-09144C61EDD6} = {11B7C7BA-AF7E-4695-B244-19C8B1C23E1C} + {5F1F2A46-5C4C-4D0A-8C89-73785EE41340} = {11B7C7BA-AF7E-4695-B244-19C8B1C23E1C} + {DE0B16D8-0EC9-4749-9E11-15CC9FA60B67} = {0DA3779A-E0E9-46A3-BA6F-BCD5819DB6F9} + {F655C0B7-0171-41BF-BEB1-3E9BBB3CBECC} = {0DA3779A-E0E9-46A3-BA6F-BCD5819DB6F9} + {4870055F-F750-4EB3-BFE6-5192D17A2EAD} = {0DA3779A-E0E9-46A3-BA6F-BCD5819DB6F9} + {174693E7-0B98-4F46-9E17-D40300C87E5F} = {0DA3779A-E0E9-46A3-BA6F-BCD5819DB6F9} + {60C0BD3E-3A4B-4C06-9AC4-07C909FCDC2D} = {0DA3779A-E0E9-46A3-BA6F-BCD5819DB6F9} + {F7801358-1D38-4697-A185-FF9DF52F3F83} = {174693E7-0B98-4F46-9E17-D40300C87E5F} + {BB77344E-0EE7-40BC-8EB8-47C1E41C9250} = {174693E7-0B98-4F46-9E17-D40300C87E5F} + {60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B} = {BB77344E-0EE7-40BC-8EB8-47C1E41C9250} + {F928EBF3-2527-4B9A-816B-3D6CFA35A9CA} = {BB77344E-0EE7-40BC-8EB8-47C1E41C9250} + {405EDD78-48E8-490B-AE2A-713AB89AA73E} = {60C0BD3E-3A4B-4C06-9AC4-07C909FCDC2D} + {90883A71-DEF8-4B1B-98EE-5A73AA25184B} = {60C0BD3E-3A4B-4C06-9AC4-07C909FCDC2D} + {1C11B49B-4547-4035-A9F4-7D9AB9A07431} = {60C0BD3E-3A4B-4C06-9AC4-07C909FCDC2D} + {AF82713E-4B6C-4712-9865-06C13FF636FC} = {FD6300FB-5601-4516-BF1C-936690ECE026} + {A1AB81FB-0FAA-4BCA-8903-F1268EEEB986} = {FD6300FB-5601-4516-BF1C-936690ECE026} + {AE5E710D-705C-49F4-90D6-6C3C0D2C62A8} = {A1AB81FB-0FAA-4BCA-8903-F1268EEEB986} + {984CFF2A-C321-43D5-A06C-5D053C0F97A9} = {03A049F5-EC33-4BC8-8ABF-0F9185C44B3C} + {03A049F5-EC33-4BC8-8ABF-0F9185C44B3C} = {830DDDD7-74A5-431B-92E4-C9641D0A10E4} + {F1FCFE10-E803-448A-AC6B-AE885EBCA363} = {03A049F5-EC33-4BC8-8ABF-0F9185C44B3C} + {06087014-47B1-4FEF-BCC0-229D8FDB52FA} = {F1FCFE10-E803-448A-AC6B-AE885EBCA363} + {574693E9-B201-4392-AA03-93901A8210C3} = {B7709311-A885-49E1-9078-B6CC8406B916} + {038CDBDF-3FA0-42E9-A43B-9444701BD432} = {B7709311-A885-49E1-9078-B6CC8406B916} + {D3DF1F38-4108-460B-8517-40855445ADBF} = {038CDBDF-3FA0-42E9-A43B-9444701BD432} + {E2BA1D48-CC32-4FB3-A1C1-200291604881} = {68491FED-7441-4B58-989D-DF6F198FC91A} + {68491FED-7441-4B58-989D-DF6F198FC91A} = {B7709311-A885-49E1-9078-B6CC8406B916} + {0EC9E1B3-9C84-42EB-A9D3-8A4EC61A1CC7} = {68491FED-7441-4B58-989D-DF6F198FC91A} + {22BE7D35-34C4-49FA-B20E-B69289C10B5E} = {68491FED-7441-4B58-989D-DF6F198FC91A} + {2959DC55-E0E6-42D7-9DD1-9DE14841EF63} = {68491FED-7441-4B58-989D-DF6F198FC91A} + {694CACC8-59E8-49F6-832E-A30833E139DF} = {2959DC55-E0E6-42D7-9DD1-9DE14841EF63} + {246399F8-F0A6-4B23-8995-88574FA5CA05} = {E8681596-D4BF-484A-A428-06D749FD4C5D} + {E8681596-D4BF-484A-A428-06D749FD4C5D} = {2959DC55-E0E6-42D7-9DD1-9DE14841EF63} + {F0D73CEC-6CB7-4BF1-B6DD-29D785BF9A5B} = {383995FF-B661-4E15-A830-640FC5BA8A1F} + {A4D8F3F8-F0ED-49F9-8C50-3F3311A98B2F} = {383995FF-B661-4E15-A830-640FC5BA8A1F} + {9BD06CA5-0169-418B-A8C8-60584EEDCEFE} = {383995FF-B661-4E15-A830-640FC5BA8A1F} + {22EC5EB8-52C1-4BC2-BDD3-09D5DC6BFA3F} = {383995FF-B661-4E15-A830-640FC5BA8A1F} + {8E7F9812-2DF1-483C-93AB-F8BBC18D9761} = {383995FF-B661-4E15-A830-640FC5BA8A1F} + {D4D2DA65-D16D-4236-ABD0-492681944D00} = {383995FF-B661-4E15-A830-640FC5BA8A1F} + {EC7A08E9-3355-486B-BA30-41A1F8CAC5F5} = {383995FF-B661-4E15-A830-640FC5BA8A1F} + {5DD4C255-EF06-4ECE-A0C3-1CF0EDB5193C} = {EC7A08E9-3355-486B-BA30-41A1F8CAC5F5} + {74149D50-9DED-45D7-9C52-5F74BEE6B80D} = {EC7A08E9-3355-486B-BA30-41A1F8CAC5F5} + {975AAE87-E410-4FFF-8A9E-6FD7E020A3C9} = {EC7A08E9-3355-486B-BA30-41A1F8CAC5F5} + {373F9664-5B59-4068-B1E2-61CDD3B2F760} = {EC7A08E9-3355-486B-BA30-41A1F8CAC5F5} + {950FE681-764C-4B75-BB95-938A9F17B2D9} = {EC7A08E9-3355-486B-BA30-41A1F8CAC5F5} + {F110D91A-F1A9-4627-85C8-501F814FED26} = {EC7A08E9-3355-486B-BA30-41A1F8CAC5F5} + {16B18299-3640-4FA8-A4E6-74B1EB741301} = {1B2FF31A-187A-4D36-AD81-1ABD9BCF9044} + {1B2FF31A-187A-4D36-AD81-1ABD9BCF9044} = {62E888C1-9FCD-413D-91CB-1F2DD3D356E3} + {4231AB12-3FB7-408E-B7C2-9CC0FFB710B1} = {1B2FF31A-187A-4D36-AD81-1ABD9BCF9044} + {C65638DC-2418-4453-917F-9FA8D068594E} = {4231AB12-3FB7-408E-B7C2-9CC0FFB710B1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs deleted file mode 100644 index 92c5a5390..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; - -public interface IApiResourceCache -{ - Task> GetListAsync(IEnumerable names); - - Task> GetListAsync(); - - Task SetAsync(ApiResource apiResource); - - Task SetRangeAsync(IEnumerable apiResources); - - Task RemoveAsync(ApiResource apiResource); - - Task ResetAsync(IEnumerable identityResources); -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs deleted file mode 100644 index 07002b1ac..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; - -public interface IApiScopeCache -{ - Task> GetListAsync(IEnumerable names); - - Task> GetListAsync(); - - Task SetAsync(ApiScope apiScope); - - Task SetRangeAsync(IEnumerable apiScopes); - - Task RemoveAsync(ApiScope apiScope); - - Task ResetAsync(IEnumerable identityResources); -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs deleted file mode 100644 index f0e2ac840..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; - -public interface IClientCache -{ - Task GetAsync(string clientId); - - Task> GetListAsync(IEnumerable clientIds); - - Task SetAsync(Client client); - - Task SetRangeAsync(IEnumerable clients); - - Task RemoveAsync(Client client); - - Task ResetAsync(IEnumerable clients); -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs deleted file mode 100644 index 7c0ef59c1..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; - -public interface IIdentityResourceCache -{ - Task> GetListAsync(IEnumerable names); - - Task> GetListAsync(); - - Task SetAsync(IdentityResource identityResource); - - Task SetRangeAsync(IEnumerable identityResources); - - Task RemoveAsync(IdentityResource identityResource); - - Task ResetAsync(IEnumerable identityResources); -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj deleted file mode 100644 index 60c4173a3..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs b/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs deleted file mode 100644 index f9859df48..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Cache/src/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs deleted file mode 100644 index 962779103..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; - -public class GrantTypeConsts -{ - public static ICollection Implicit => - new[] { GrantTypes.IMPLICIT }; - - public static ICollection ImplicitAndClientCredentials => - new[] { GrantTypes.IMPLICIT, GrantTypes.CLIENT_CREDENTIALS }; - - public static ICollection Code => - new[] { GrantTypes.AUTHORIZATION_CODE }; - - public static ICollection CodeAndClientCredentials => - new[] { GrantTypes.AUTHORIZATION_CODE, GrantTypes.CLIENT_CREDENTIALS }; - - public static ICollection Hybrid => - new[] { GrantTypes.HYBRID }; - - public static ICollection HybridAndClientCredentials => - new[] { GrantTypes.HYBRID, GrantTypes.CLIENT_CREDENTIALS }; - - public static ICollection ClientCredentials => - new[] { GrantTypes.CLIENT_CREDENTIALS }; - - public static ICollection ResourceOwnerPassword => - new[] { GrantTypes.RESOURCE_OWNER_PASSWORD }; - - public static ICollection ResourceOwnerPasswordAndClientCredentials => - new[] { GrantTypes.RESOURCE_OWNER_PASSWORD, GrantTypes.CLIENT_CREDENTIALS }; - - public static ICollection DeviceFlow => - new[] { GrantTypes.DEVICE_FLOW }; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs deleted file mode 100644 index d6e49be2d..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; - -public static class GrantTypes -{ - public const string IMPLICIT = "implicit"; - - public const string HYBRID = "hybrid"; - - public const string AUTHORIZATION_CODE = "authorization_code"; - - public const string CLIENT_CREDENTIALS = "client_credentials"; - - public const string RESOURCE_OWNER_PASSWORD = "password"; - - public const string DEVICE_FLOW = "urn:ietf:params:oauth:grant-type:device_code"; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs deleted file mode 100644 index a76ab6f88..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; - -public abstract class Property : Entity -{ - public string Key { get; protected set; } = ""; - - public string Value { get; protected set; } = ""; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs deleted file mode 100644 index d317f503b..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; - -public abstract class Secret : FullEntity -{ - public string Description { get; protected set; } = string.Empty; - - public string Value { get; protected set; } = string.Empty; - - public DateTime? Expiration { get; protected set; } - - public string Type { get; protected set; } = "SharedSecret"; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs deleted file mode 100644 index c953e82d5..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ApiResource : FullAggregateRoot -{ - private List _secrets = new(); - private List _apiScopes = new(); - private List _userClaims = new(); - private List _properties = new(); - - public bool Enabled { get; private set; } - - public string Name { get; private set; } = ""; - - public string DisplayName { get; private set; } = ""; - - public string Description { get; private set; } = ""; - - public string AllowedAccessTokenSigningAlgorithms { get; private set; } = ""; - - public bool ShowInDiscoveryDocument { get; private set; } = true; - - public DateTime? LastAccessed { get; private set; } - - public bool NonEditable { get; private set; } - - public IReadOnlyCollection Secrets => _secrets; - - public IReadOnlyCollection ApiScopes => _apiScopes; - - public IReadOnlyCollection UserClaims => _userClaims; - - public IReadOnlyCollection Properties => _properties; - - public ApiResource(string name, string displayName, string description, string allowedAccessTokenSigningAlgorithms, bool showInDiscoveryDocument, DateTime? lastAccessed, bool nonEditable, bool enabled) - { - Enabled = enabled; - Name = name; - DisplayName = displayName; - Description = description; - AllowedAccessTokenSigningAlgorithms = allowedAccessTokenSigningAlgorithms; - ShowInDiscoveryDocument = showInDiscoveryDocument; - LastAccessed = lastAccessed; - NonEditable = nonEditable; - } - - public void Update(string displayName, string description, string allowedAccessTokenSigningAlgorithms, bool showInDiscoveryDocument, DateTime? lastAccessed, bool nonEditable, bool enabled) - { - Enabled = enabled; - DisplayName = displayName; - Description = description; - AllowedAccessTokenSigningAlgorithms = allowedAccessTokenSigningAlgorithms; - ShowInDiscoveryDocument = showInDiscoveryDocument; - LastAccessed = lastAccessed; - NonEditable = nonEditable; - } - - public void BindUserClaims(List userClaims) - { - _userClaims.Clear(); - _userClaims.AddRange(userClaims.Select(id => new ApiResourceClaim(id))); - } - - public void BindProperties(Dictionary properties) - { - _properties.Clear(); - _properties.AddRange(properties.Select(property => new ApiResourceProperty(property.Key, property.Value))); - } - - public void BindApiScopes(List apiScopes) - { - _apiScopes.Clear(); - _apiScopes.AddRange(apiScopes.Select(id => new ApiResourceScope(id))); - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs deleted file mode 100644 index 0188babe4..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ApiResourceClaim : FullEntity -{ - public int UserClaimId { get; private set; } - - public UserClaim UserClaim { get; private set; } = null!; - - public int ApiResourceId { get; private set; } - - public ApiResource ApiResource { get; private set; } = null!; - - public ApiResourceClaim(int userClaimId) - { - UserClaimId = userClaimId; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs deleted file mode 100644 index 8dde202ac..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ApiResourceProperty : Property -{ - public int ApiResourceId { get; private set; } - - public ApiResource ApiResource { get; private set; } = null!; - - public ApiResourceProperty(string key, string value) - { - Key = key; - Value = value; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs deleted file mode 100644 index 745deb01a..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ApiResourceScope : FullEntity -{ - public int ApiScopeId { get; private set; } - - public ApiScope ApiScope { get; private set; } = null!; - - public int ApiResourceId { get; private set; } - - public ApiResource ApiResource { get; private set; } = null!; - - public ApiResourceScope(int apiScopeId) - { - ApiScopeId = apiScopeId; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs deleted file mode 100644 index aef627684..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ApiResourceSecret : Secret -{ - public int ApiResourceId { get; private set; } - - public ApiResource ApiResource { get; private set; } = null!; -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs deleted file mode 100644 index b2d6c400f..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ApiScope : FullAggregateRoot -{ - private List _userClaims = new(); - private List _properties = new(); - - public bool Enabled { get; private set; } - - public string Name { get; private set; } = ""; - - public string DisplayName { get; private set; } = ""; - - public string Description { get; private set; } = ""; - - public bool Required { get; private set; } - - public bool Emphasize { get; private set; } - - public bool ShowInDiscoveryDocument { get; private set; } - - public IReadOnlyCollection UserClaims => _userClaims; - - public IReadOnlyCollection Properties => _properties; - - public ApiScope(string name) : this(name, name, "", true, true, true, true) - { - - } - - public ApiScope(string name, string displayName, string description, bool required, bool emphasize, bool showInDiscoveryDocument, bool enabled) - { - Enabled = enabled; - Name = name; - DisplayName = displayName; - Description = description; - Required = required; - Emphasize = emphasize; - ShowInDiscoveryDocument = showInDiscoveryDocument; - } - - public void Update(string displayName, string description, bool required, bool emphasize, bool showInDiscoveryDocument, bool enabled) - { - Enabled = enabled; - DisplayName = displayName; - Description = description; - Required = required; - Emphasize = emphasize; - ShowInDiscoveryDocument = showInDiscoveryDocument; - } - - public void BindUserClaims(List userClaims) - { - _userClaims.Clear(); - _userClaims.AddRange(userClaims.Select(id => new ApiScopeClaim(id))); - } - - public void BindProperties(Dictionary properties) - { - _properties.Clear(); - _properties.AddRange(properties.Select(property => new ApiScopeProperty(property.Key, property.Value))); - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs deleted file mode 100644 index 613e08be7..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ApiScopeClaim : FullEntity -{ - public int UserClaimId { get; private set; } - - public UserClaim UserClaim { get; private set; } = null!; - - public int ApiScopeId { get; private set; } - - public ApiScope ApiScope { get; private set; } = null!; - - public ApiScopeClaim(int userClaimId) - { - UserClaimId = userClaimId; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs deleted file mode 100644 index 9b49e1e00..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ApiScopeProperty : Property -{ - public int ScopeId { get; private set; } - - public ApiScope Scope { get; private set; } = null!; - - public ApiScopeProperty(string key, string value) - { - Key = key; - Value = value; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs deleted file mode 100644 index 535e3a8ee..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class Client : FullAggregateRoot -{ - public ClientTypes ClientType { get; private set; } - - public bool Enabled { get; private set; } = true; - - public string ClientId { get; private set; } = string.Empty; - - public string ProtocolType { get; private set; } = "oidc"; - - public List ClientSecrets { get; private set; } = new(); - - public bool RequireClientSecret { get; private set; } = true; - - public string ClientName { get; private set; } = string.Empty; - - public string Description { get; private set; } = string.Empty; - - public string ClientUri { get; private set; } = string.Empty; - - public string LogoUri { get; private set; } = string.Empty; - - public bool RequireConsent { get; private set; } = false; - - public bool AllowRememberConsent { get; private set; } = true; - - public bool AlwaysIncludeUserClaimsInIdToken { get; private set; } - - public List AllowedGrantTypes { get; private set; } = new(); - - public bool RequirePkce { get; private set; } = true; - - public bool AllowPlainTextPkce { get; private set; } - - public bool RequireRequestObject { get; private set; } - - public bool AllowAccessTokensViaBrowser { get; private set; } - - public List RedirectUris { get; private set; } = new(); - - public List PostLogoutRedirectUris { get; private set; } = new(); - - public string FrontChannelLogoutUri { get; private set; } = string.Empty; - - public bool FrontChannelLogoutSessionRequired { get; private set; } = true; - - public string BackChannelLogoutUri { get; private set; } = string.Empty; - - public bool BackChannelLogoutSessionRequired { get; private set; } = true; - - public bool AllowOfflineAccess { get; private set; } - - public List AllowedScopes { get; private set; } = new(); - - public int IdentityTokenLifetime { get; private set; } = 300; - - public string AllowedIdentityTokenSigningAlgorithms { get; private set; } = string.Empty; - - public int AccessTokenLifetime { get; private set; } = 3600; - - public int AuthorizationCodeLifetime { get; private set; } = 300; - - public int? ConsentLifetime { get; private set; } = null; - - public int AbsoluteRefreshTokenLifetime { get; private set; } = 2592000; - - public int SlidingRefreshTokenLifetime { get; private set; } = 1296000; - - public int RefreshTokenUsage { get; private set; } = (int)TokenUsage.OneTimeOnly; - - public bool UpdateAccessTokenClaimsOnRefresh { get; private set; } - - public int RefreshTokenExpiration { get; private set; } = (int)TokenExpiration.Absolute; - - public int AccessTokenType { get; private set; } = 0; // AccessTokenType.Jwt; - - public bool EnableLocalLogin { get; private set; } = true; - - public List IdentityProviderRestrictions { get; private set; } = new(); - - public bool IncludeJwtId { get; private set; } - - public List Claims { get; private set; } = new(); - - public bool AlwaysSendClientClaims { get; private set; } - - public string ClientClaimsPrefix { get; private set; } = "client_"; - - public string PairWiseSubjectSalt { get; private set; } = string.Empty; - - public List AllowedCorsOrigins { get; private set; } = new(); - - public List Properties { get; private set; } = new(); - - public DateTime? LastAccessed { get; private set; } - - public int? UserSsoLifetime { get; private set; } - - public string UserCodeType { get; private set; } = string.Empty; - - public int DeviceCodeLifetime { get; private set; } = 300; - - public bool NonEditable { get; private set; } - - private Client() - { - } - - public Client(ClientTypes clientType, string clientId, string clientName) - { - SetClientType(clientType); - ClientId = clientId; - ClientName = clientName; - } - - public void SetClientType(ClientTypes clientType) - { - ClientType = clientType; - switch (clientType) - { - case ClientTypes.Web: - case ClientTypes.Spa: - case ClientTypes.Native: - AllowedGrantTypes = GrantTypeConsts.Code.Select(x => new ClientGrantType(x)).ToList(); - RequirePkce = true; - RequireClientSecret = false; - break; - case ClientTypes.Machine: - AllowedGrantTypes = GrantTypeConsts.ClientCredentials.Select(x => new ClientGrantType(x)).ToList(); - RequireClientSecret = true; - break; - case ClientTypes.Device: - AllowedGrantTypes = GrantTypeConsts.DeviceFlow.Select(x => new ClientGrantType(x)).ToList(); - RequireClientSecret = false; - break; - default: - throw new ArgumentOutOfRangeException(); - } - } - - public void SetRedirectUris(List redirectUris) - { - RedirectUris = redirectUris.Select(x => new ClientRedirectUri(x)).ToList(); - } - - public void SetPostLogoutRedirectUris(List postLogoutRedirectUris) - { - PostLogoutRedirectUris = postLogoutRedirectUris.Select(x => new ClientPostLogoutRedirectUri(x)).ToList(); - } - - public void SetAllowedScopes(List allowedScopes) - { - AllowedScopes = allowedScopes.Select(x => new ClientScope(x)).ToList(); - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs deleted file mode 100644 index a95e140f4..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ClientClaim : Entity -{ - public string Type { get; private set; } = string.Empty; - - public string Value { get; private set; } = string.Empty; - - public int ClientId { get; private set; } - - public Client Client { get; private set; } = null!; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs deleted file mode 100644 index 942460995..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ClientCorsOrigin : Entity -{ - public string Origin { get; private set; } = string.Empty; - - public int ClientId { get; private set; } - - public Client Client { get; private set; } = null!; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs deleted file mode 100644 index aa6124fc9..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ClientGrantType : Entity -{ - public string GrantType { get; private set; } = string.Empty; - - public int ClientId { get; private set; } - - public Client Client { get; private set; } = null!; - - public ClientGrantType(string grantType) - { - GrantType = grantType; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs deleted file mode 100644 index 61ed181a8..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ClientIdPRestriction : Entity -{ - public string Provider { get; private set; } = string.Empty; - - public int ClientId { get; private set; } - - public Client Client { get; private set; } = null!; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs deleted file mode 100644 index b50256c26..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ClientPostLogoutRedirectUri : Entity -{ - public string PostLogoutRedirectUri { get; private set; } = string.Empty; - - public int ClientId { get; private set; } - - public Client Client { get; private set; } = null!; - - public ClientPostLogoutRedirectUri(string postLogoutRedirectUri) - { - PostLogoutRedirectUri = postLogoutRedirectUri; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs deleted file mode 100644 index 8d78e460b..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ClientProperty : Property -{ - public int ClientId { get; private set; } - - public Client Client { get; private set; } = null!; - - public ClientProperty(string key, string value) - { - Key = key; - Value = value; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs deleted file mode 100644 index 7d0016b87..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ClientRedirectUri : Entity -{ - public string RedirectUri { get; private set; } = string.Empty; - - public int ClientId { get; private set; } - - public Client Client { get; private set; } = null!; - - public ClientRedirectUri(string redirectUri) - { - RedirectUri = redirectUri; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs deleted file mode 100644 index 051e242b1..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ClientScope : Entity -{ - public string Scope { get; private set; } = string.Empty; - - public int ClientId { get; private set; } - - public Client Client { get; private set; } = null!; - - public ClientScope(string scope) - { - Scope = scope; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs deleted file mode 100644 index 415646d32..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class ClientSecret : Secret -{ - public int ClientId { get; private set; } - - public Client Client { get; private set; } = null!; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs deleted file mode 100644 index 5607d7399..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class DeviceFlowCodes : FullAggregateRoot -{ - /// - /// Gets or sets the device code. - /// - /// - /// The device code. - /// - public string DeviceCode { get; private set; } = string.Empty; - - /// - /// Gets or sets the user code. - /// - /// - /// The user code. - /// - public string UserCode { get; private set; } = string.Empty; - - /// - /// Gets or sets the subject identifier. - /// - /// - /// The subject identifier. - /// - public string SubjectId { get; private set; } = string.Empty; - - /// - /// Gets or sets the session identifier. - /// - /// - /// The session identifier. - /// - public string SessionId { get; private set; } = string.Empty; - - /// - /// Gets or sets the client identifier. - /// - /// - /// The client identifier. - /// - public string ClientId { get; private set; } = string.Empty; - - /// - /// Gets the description the user assigned to the device being authorized. - /// - /// - /// The description. - /// - public string Description { get; private set; } = string.Empty; - - /// - /// Gets or sets the expiration. - /// - /// - /// The expiration. - /// - public DateTime? Expiration { get; private set; } - - /// - /// Gets or sets the data. - /// - /// - /// The data. - /// - public string Data { get; private set; } = string.Empty; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs deleted file mode 100644 index e947153b2..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class IdentityResource : FullAggregateRoot -{ - private List _userClaims = new(); - private List _properties = new(); - - public string Name { get; private set; } = string.Empty; - - public string DisplayName { get; private set; } = string.Empty; - - public string Description { get; private set; } = string.Empty; - - public bool Enabled { get; private set; } = true; - - public bool Required { get; private set; } - - public bool Emphasize { get; private set; } - - public bool ShowInDiscoveryDocument { get; private set; } = true; - - public IReadOnlyCollection UserClaims => _userClaims; - - public IReadOnlyCollection Properties => _properties; - - public bool NonEditable { get; private set; } - - public IdentityResource(string name, string displayName, string description, bool enabled, bool required, bool emphasize, bool showInDiscoveryDocument, bool nonEditable) - { - Name = name; - DisplayName = displayName; - Description = description; - Enabled = enabled; - Required = required; - Emphasize = emphasize; - ShowInDiscoveryDocument = showInDiscoveryDocument; - NonEditable = nonEditable; - } - - public void BindUserClaims(IEnumerable userClaims) - { - _userClaims.Clear(); - _userClaims.AddRange(userClaims.Select(id => new IdentityResourceClaim(id))); - } - - public void BindProperties(Dictionary properties) - { - _properties.Clear(); - _properties.AddRange(properties.Select(property => new IdentityResourceProperty(property.Key, property.Value))); - } - - public void Update(string displayName, string description, bool enabled, bool required, bool emphasize, bool showInDiscoveryDocument, bool nonEditable) - { - DisplayName = displayName; - Description = description; - Enabled = enabled; - Required = required; - Emphasize = emphasize; - ShowInDiscoveryDocument = showInDiscoveryDocument; - NonEditable = nonEditable; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs deleted file mode 100644 index d8f4fa9f6..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class IdentityResourceClaim : FullEntity -{ - public int UserClaimId { get; private set; } - - public UserClaim UserClaim { get; private set; } = null!; - - public int IdentityResourceId { get; private set; } - - public IdentityResource IdentityResource { get; private set; } = null!; - - public IdentityResourceClaim(int userClaimId) - { - UserClaimId = userClaimId; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs deleted file mode 100644 index 88b21d15c..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities -{ - public class IdentityResourceProperty : Property - { - public int IdentityResourceId { get; private set; } - - public IdentityResource IdentityResource { get; private set; } = null!; - - public IdentityResourceProperty(string key, string value) - { - Key = key; - Value = value; - } - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs deleted file mode 100644 index 2ceeced09..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class PersistedGrant : FullAggregateRoot -{ - public string Key { get; private set; } = null!; - - public string Type { get; private set; } = string.Empty; - - public string SubjectId { get; private set; } = string.Empty; - - public string SessionId { get; private set; } = string.Empty; - - public string ClientId { get; private set; } = string.Empty; - - public string Description { get; private set; } = string.Empty; - - public DateTime? Expiration { get; private set; } - - public DateTime? ConsumedTime { get; private set; } - - public string Data { get; private set; } = string.Empty; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs deleted file mode 100644 index 669417c56..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; - -public class UserClaim : FullAggregateRoot -{ - public string Name { get; private set; } - - public string Description { get; private set; } - - public UserClaim(string name, string description) - { - Name = name; - Description = description; - } - - public void Update(string description) - { - Description = description; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs deleted file mode 100644 index d4882f57d..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; - -public enum ClientTypes -{ - Web = 1, - Spa = 2, - Native = 3, - Machine = 4, - Device = 5 -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs deleted file mode 100644 index 410ac838f..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; - -/// -/// Token expiration types. -/// -public enum TokenExpiration -{ - /// - /// Sliding token expiration - /// - Sliding = 0, - - /// - /// Absolute token expiration - /// - Absolute = 1 -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs deleted file mode 100644 index 67eaa8040..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; - -/// -/// Token usage types. -/// -public enum TokenUsage -{ - /// - /// Re-use the refresh token handle - /// - Reuse = 0, - - /// - /// Issue a new refresh token handle every time - /// - OneTimeOnly = 1 -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj deleted file mode 100644 index d8fac4d15..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs deleted file mode 100644 index c7118c570..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; - -public interface IApiResourceRepository : IRepositoryBase -{ -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs deleted file mode 100644 index 6d5822e83..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; - -public interface IApiScopeRepository : IRepositoryBase -{ -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs deleted file mode 100644 index 31c686ff4..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; - -public interface IClientRepository : IRepositoryBase -{ -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs deleted file mode 100644 index f70b7ab4d..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; - -public interface IIdentityResourceRepository : IRepositoryBase -{ - Task AddStandardIdentityResourcesAsync(); -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs deleted file mode 100644 index a15fceae5..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; - -public interface IRepositoryBase where TEntity : class, IEntity -{ - Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null); - - Task GetDetailAsync(int id); - - Task> GetListAsync(); - - Task FindAsync(Expression> predicate); - - Task GetCountAsync(Expression> predicate); - - ValueTask AddAsync(TEntity entity); - - Task UpdateAsync(TEntity entity); - - Task RemoveAsync(TEntity entity); -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs deleted file mode 100644 index 2a884f1fb..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; - -public interface IUserClaimRepository : IRepositoryBase -{ - Task AddStandardUserClaimsAsync(); -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs b/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs deleted file mode 100644 index 623152bd2..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Domain/src/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Entities.Full; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using System.Linq.Expressions; diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs deleted file mode 100644 index 900f0e698..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; - -public static class GrantType -{ - public const string IMPLICIT = "implicit"; - - public const string HYBRID = "hybrid"; - - public const string AUTHORIZATION_CODE = "authorization_code"; - - public const string CLIENT_CREDENTIALS = "client_credentials"; - - public const string RESOURCE_OWNER_PASSWORD = "password"; - - public const string DEVICE_FLOW = "urn:ietf:params:oauth:grant-type:device_code"; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs deleted file mode 100644 index dbcd5e530..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; - -public class GrantTypes -{ - public static ICollection Implicit => - new[] { GrantType.IMPLICIT }; - - public static ICollection ImplicitAndClientCredentials => - new[] { GrantType.IMPLICIT, GrantType.CLIENT_CREDENTIALS }; - - public static ICollection Code => - new[] { GrantType.AUTHORIZATION_CODE }; - - public static ICollection CodeAndClientCredentials => - new[] { GrantType.AUTHORIZATION_CODE, GrantType.CLIENT_CREDENTIALS }; - - public static ICollection Hybrid => - new[] { GrantType.HYBRID }; - - public static ICollection HybridAndClientCredentials => - new[] { GrantType.HYBRID, GrantType.CLIENT_CREDENTIALS }; - - public static ICollection ClientCredentials => - new[] { GrantType.CLIENT_CREDENTIALS }; - - public static ICollection ResourceOwnerPassword => - new[] { GrantType.RESOURCE_OWNER_PASSWORD }; - - public static ICollection ResourceOwnerPasswordAndClientCredentials => - new[] { GrantType.RESOURCE_OWNER_PASSWORD, GrantType.CLIENT_CREDENTIALS }; - - public static ICollection DeviceFlow => - new[] { GrantType.DEVICE_FLOW }; -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs deleted file mode 100644 index b1dc32a84..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; - -public class StandardIdentityResources -{ - [Description("Your user identifier")] - public static IdentityResourceModel OpenId = new() - { - Name = "openid", - DisplayName = "Your user identifier", - Description = "Your user identifier", - Required = true, - UserClaims = new List() - { - StandardUserClaims.Subject - } - }; - - [Description("Your address")] - public static IdentityResourceModel Address = new() - { - Name = "address", - DisplayName = "Your address", - Description = "Your address", - Emphasize = true, - UserClaims = new List() - { - StandardUserClaims.Address - } - }; - - [Description("Your email address")] - public static IdentityResourceModel Email = new() - { - Name = "email", - DisplayName = "Your email address", - Description = "Your email address", - Emphasize = true, - UserClaims = new List() - { - StandardUserClaims.Email, - StandardUserClaims.EmailVerified, - } - }; - - [Description("Your phone number")] - public static IdentityResourceModel Phone = new() - { - Name = "phone", - DisplayName = "Your phone number", - Description = "Your phone number", - Emphasize = true, - UserClaims = new List() - { - StandardUserClaims.PhoneNumber, - StandardUserClaims.PhoneNumberVerified - } - }; - - [Description("User profile")] - public static IdentityResourceModel Profile = new() - { - Name = "profile", - DisplayName = "User profile", - Description = "Your user profile information (first name, last name, etc.)", - Emphasize = true, - UserClaims = new List() - { - StandardUserClaims.Name, - StandardUserClaims.FamilyName, - StandardUserClaims.GivenName, - StandardUserClaims.MiddleName, - StandardUserClaims.NickName, - StandardUserClaims.PreferredUserName, - StandardUserClaims.Profile, - StandardUserClaims.Picture, - StandardUserClaims.WebSite, - StandardUserClaims.Gender, - StandardUserClaims.BirthDate, - StandardUserClaims.ZoneInfo, - StandardUserClaims.Locale, - StandardUserClaims.UpdatedAt - } - }; - - static List? _identityResources; - - public static List IdentityResources => _identityResources ??= GetIdentityResources(); - - static List GetIdentityResources() - { - var identityResources = new List(); - var fields = typeof(StandardIdentityResources).GetFields(BindingFlags.Static | BindingFlags.Public); - foreach (var field in fields) - { - var idrs = (IdentityResourceModel)(field.GetValue(null) ?? throw new Exception("Error standard identity resources data")); - identityResources.Add(idrs); - } - - return identityResources; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs deleted file mode 100644 index f6b2d8ed9..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; - -public static class StandardUserClaims -{ - [Description("subject 的缩写,唯一标识,一般为用户 ID")] - public static readonly string Subject = "sub"; - [Description("姓名")] - public static readonly string Name = "name"; - [Description("名字")] - public static readonly string GivenName = "given_name"; - [Description("姓")] - public static readonly string FamilyName = "family_name"; - [Description("中间名")] - public static readonly string MiddleName = "middle_name"; - [Description("昵称")] - public static readonly string NickName = "nickname"; - [Description("希望被称呼的名字")] - public static readonly string PreferredUserName = "preferred_username"; - [Description("基础资料")] - public static readonly string Profile = "profile"; - [Description("头像")] - public static readonly string Picture = "picture"; - [Description("网站链接")] - public static readonly string WebSite = "website"; - [Description("电子邮箱")] - public static readonly string Email = "email"; - [Description("邮箱是否被认证")] - public static readonly string EmailVerified = "email_verified"; - [Description("性别")] - public static readonly string Gender = "gender"; - [Description("生日")] - public static readonly string BirthDate = "birthdate"; - [Description("时区")] - public static readonly string ZoneInfo = "zoneinfo"; - [Description("区域")] - public static readonly string Locale = "locale"; - [Description("手机号")] - public static readonly string PhoneNumber = "phone_number"; - [Description("认证手机号")] - public static readonly string PhoneNumberVerified = "phone_number_verified"; - [Description("地址")] - public static readonly string Address = "address"; - [Description("详细地址")] - public static readonly string Formatted = "formatted"; - [Description("街道地址")] - public static readonly string StreetAddress = "street_address"; - [Description("城市")] - public static readonly string Locality = "locality"; - [Description("省")] - public static readonly string Region = "region"; - [Description("邮编")] - public static readonly string PostalCode = "postal_code"; - [Description("国家")] - public static readonly string Country = "country"; - [Description("信息更新时间")] - public static readonly string UpdatedAt = "updated_at"; - - static Dictionary? _claims; - - public static Dictionary Claims => _claims ??= GetClaims(); - - static Dictionary GetClaims() - { - var claims = new Dictionary(); - var fileds = typeof(StandardUserClaims).GetFields(BindingFlags.Static | BindingFlags.Public); - foreach (var filed in fileds) - { - var value = filed.GetValue(null)?.ToString() ?? ""; - var description = filed.GetCustomAttribute()?.Description ?? ""; - claims.Add(value, description); - } - - return claims; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs deleted file mode 100644 index f49e96f2b..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; - -public enum AccessTokenType -{ - [Description("Self-contained Json Web Token")] - Jwt, - [Description("Reference token")] - Reference -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs deleted file mode 100644 index 8a3e0dd6f..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; - -public enum TokenExpiration -{ - [Description("Sliding token expiration")] - Sliding, - [Description("Absolute token expiration")] - Absolute -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs deleted file mode 100644 index 52ffd7eff..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; - -public enum TokenUsage -{ - [Description("Re-use the refresh token handle")] - Reuse, - [Description("Issue a new refresh token handle every time")] - OneTimeOnly -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs deleted file mode 100644 index 7e27dd894..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -public class ApiResourceModel : ResourceModel -{ - public ICollection? Scopes { get; set; } - - public ICollection? ApiSecrets { get; set; } - - public ICollection? AllowedAccessTokenSigningAlgorithms { get; set; } - - public ApiResourceModel() - { - - } - - public ApiResourceModel( - string name, - string? displayName = null, - ICollection? userClaims = null) - { - Name = name; - DisplayName = displayName ?? name; - if (userClaims is not null) UserClaims = userClaims; - } - - public ApiResourceModel( - string name, - string displayName, - string? description, - bool enabled, - bool showInDiscoveryDocument, - ICollection? userClaims, - ICollection? scopes, - IDictionary properties, - ICollection? apiSecrets, - ICollection? allowedAccessTokenSigningAlgorithms) : this(name, displayName, userClaims) - { - Description = description; - Enabled = enabled; - ShowInDiscoveryDocument = showInDiscoveryDocument; - Scopes = scopes; - Properties = properties; - ApiSecrets = apiSecrets; - AllowedAccessTokenSigningAlgorithms = allowedAccessTokenSigningAlgorithms; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs deleted file mode 100644 index 584292172..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -public class ApiScopeModel : ResourceModel -{ - public bool Required { get; set; } - - public bool Emphasize { get; set; } - - public ApiScopeModel() - { - - } - - public ApiScopeModel( - string name, - string? displayName = null, - ICollection? userClaims = null) - { - Name = name; - DisplayName = displayName ?? name; - if (userClaims is not null) UserClaims = userClaims; - } - - public ApiScopeModel( - string name, - string displayName, - string? description, - bool enabled, - bool showInDiscoveryDocument, - bool required, - bool emphasize, - ICollection? userClaims, - Dictionary properties) : this(name, displayName, userClaims) - { - Description = description; - Enabled = enabled; - ShowInDiscoveryDocument = showInDiscoveryDocument; - Required = required; - Emphasize = emphasize; - Properties = properties; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs deleted file mode 100644 index 7b37e0dba..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -public class ClientClaimModel -{ - /// - /// The claim type - /// - public string Type { get; set; } - - /// - /// The claim value - /// - public string Value { get; set; } - - /// - /// The claim value type - /// - public string ValueType { get; set; } = ClaimValueTypes.String; - - /// - /// ctor - /// - public ClientClaimModel(string type, string value, string? valueType = null) - { - Type = type; - Value = value; - if (valueType is not null) ValueType = valueType; - } - - public override int GetHashCode() - { - unchecked - { - int hash = 17; - - hash = hash * 23 + Value.GetHashCode(); - hash = hash * 23 + Type.GetHashCode(); - hash = hash * 23 + ValueType.GetHashCode(); - return hash; - } - } - - public override bool Equals(object? obj) - { - if (obj is null) return false; - if (obj is ClientClaimModel c) - { - return string.Equals(Type, c.Type, StringComparison.Ordinal) && - string.Equals(Value, c.Value, StringComparison.Ordinal) && - string.Equals(ValueType, c.ValueType, StringComparison.Ordinal); - } - - return false; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs deleted file mode 100644 index d9522b574..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -public class ClientModel -{ - private IEnumerable? _allowedGrantTypes; - private IEnumerable? _apiScopes; - - public string ClientId { get; set; } - - public string ClientName { get; set; } - - public string Description { get; set; } - - public string ClientUri { get; set; } - - public string LogoUri { get; set; } - - public IEnumerable ClientSecrets { get; set; } - - public IEnumerable RedirectUris { get; set; } - - public IEnumerable PostLogoutRedirectUris { get; set; } - - public IEnumerable AllowedGrantTypes - { - get - { - if (_allowedGrantTypes is null) throw new Exception("Please set Client.GrantTypes"); - ValidateGrantTypes(_allowedGrantTypes); - return _allowedGrantTypes.Distinct(); - } - set - { - ValidateGrantTypes(value); - _allowedGrantTypes = value; - } - } - - public IEnumerable AllowedScopes - { - get => _apiScopes?.Distinct() ?? throw new Exception("Please set Client.AllowedScopes"); - set => _apiScopes = value; - } - - /// - /// Signing algorithm for identity token. If empty, will use the server default signing - /// - public IEnumerable? AllowedIdentityTokenSigningAlgorithms { get; set; } - - /// - /// Allows settings claims for the client (will be included in the access token) - /// - public ICollection? Claims { get; set; } - - /// - /// Gets or sets the allowed CORS origins for JavaScript clients. - /// - public ICollection? AllowedCorsOrigins { get; set; } - - /// - /// Gets or sets the custom properties for the client. - /// - public IDictionary Properties { get; set; } = new Dictionary(); - - /// - /// Specifies which external IdPs can be used with this client (if list is empty - /// all IdPs are allowed). Defaults to empty. - /// - public ICollection IdentityProviderRestrictions { get; set; } = new HashSet(); - - public bool RequireConsent { get; set; } - - public bool RequireClientSecret { get; set; } = true; - - public bool Enabled { get; set; } = true; - - public bool AllowRememberConsent { get; set; } = true; - - public bool RequirePkce { get; set; } = true; - - public bool AllowPlainTextPkce { get; set; } - - public bool RequireRequestObject { get; set; } - - public bool AllowAccessTokensViaBrowser { get; set; } - - public bool AllowOfflineAccess { get; set; } - - public bool AlwaysIncludeUserClaimsInIdToken { get; set; } - - public bool BackChannelLogoutSessionRequired { get; set; } = true; - - /// - /// Gets or sets a value indicating whether JWT access tokens should include an identifier. - /// - public bool IncludeJwtId { get; set; } = true; - - /// - /// Gets or sets a value indicating whether client claims should be always included - /// in the access tokens - or only for client credentials flow. Defaults to false - /// - public bool AlwaysSendClientClaims { get; set; } - - /// - /// Gets or sets a value indicating whether the local login is allowed for this client.Defaults to true. - /// - public bool EnableLocalLogin { get; set; } = true; - - /// - /// Gets or sets a value indicating whether the access token (and its claims) should - /// be updated on a refresh token request. Defaults to false. - /// - public bool UpdateAccessTokenClaimsOnRefresh { get; set; } - - /// - /// Lifetime of identity token in seconds (defaults to 300 seconds / 5 minutes) - /// - public int IdentityTokenLifetime { get; set; } = 300; - - /// - /// Lifetime of access token in seconds (defaults to 3600 seconds / 1 hour) - /// - public int AccessTokenLifetime { get; set; } = 3600; - - /// - /// Lifetime of authorization code in seconds (defaults to 300 seconds / 5 minutes) - /// - public int AuthorizationCodeLifetime { get; set; } = 300; - - /// - /// Maximum lifetime of a refresh token in seconds (defaults to 2592000 seconds / 30 days) - /// - public int AbsoluteRefreshTokenLifetime { get; set; } = 2592000; - - /// - /// Sliding lifetime of a refresh token in seconds (defaults to 1296000 seconds / 15 days) - /// - public int SlidingRefreshTokenLifetime { get; set; } = 1296000; - - /// - /// Lifetime of a user consent in seconds. Defaults to null (no expiration) - /// - public int? ConsentLifetime { get; set; } - - /// - /// The maximum duration (in seconds) since the last time the user authenticated. - /// - public int? UserSsoLifetime { get; set; } - - /// - /// Gets or sets the device code lifetime. - /// - public int DeviceCodeLifetime { get; set; } = 300; - - /// - /// Absolute: the refresh token will expire on a fixed point in time (specified by - /// the AbsoluteRefreshTokenLifetime) Sliding: when refreshing the token, the lifetime - /// of the refresh token will be renewed(by the amount specified in SlidingRefreshTokenLifetime). - /// he lifetime will not exceed AbsoluteRefreshTokenLifetime. - /// - public TokenExpiration RefreshTokenExpiration { get; set; } = TokenExpiration.Absolute; - - /// - /// ReUse:the refresh token handle will stay the same when refreshing tokens - /// OneTimeOnly:the refresh token handle will be updated when refreshing tokens - /// Default value OneTimeOnly - /// - public TokenUsage RefreshTokenUsage { get; set; } = TokenUsage.OneTimeOnly; - - public AccessTokenType AccessTokenType { get; set; } - - public string ProtocolType { get; set; } = "oidc"; - - public string? FrontChannelLogoutUri { get; set; } - - public bool FrontChannelLogoutSessionRequired { get; set; } = true; - - public string? BackChannelLogoutUri { get; set; } - - /// - /// Gets or sets a value to prefix it on client claim types. Defaults to client_. - /// - public string ClientClaimsPrefix { get; set; } = "client_"; - - /// - /// Gets or sets a salt value used in pair-wise subjectId generation for users of - /// this client. - /// - public string? PairWiseSubjectSalt { get; set; } - - /// - /// Gets or sets the type of the device flow user code. - /// - public string? UserCodeType { get; set; } - - public ClientModel(string clientId, string clientName, string description, string clientUri, string logoUri, IEnumerable redirectUris, IEnumerable postLogoutRedirectUris, IEnumerable allowedGrantTypes, IEnumerable allowedScopes) - { - ClientId = clientId; - ClientName = clientName; - Description = description; - ClientUri = clientUri; - LogoUri = logoUri; - RedirectUris = redirectUris; - PostLogoutRedirectUris = postLogoutRedirectUris; - AllowedGrantTypes = allowedGrantTypes; - AllowedScopes = allowedScopes; - } - - private static void ValidateGrantTypes(IEnumerable grantTypes) - { - if (grantTypes.Any(grantType => grantType.Contains(' '))) - throw new InvalidOperationException("Grant types cannot contain spaces"); - - if (grantTypes.Count() != 1) - { - foreach (var (value1, value2) in GrantType.DisallowGrantTypeCombinations) - { - if (grantTypes.Contains(value1, StringComparer.Ordinal) && grantTypes.Contains(value2, StringComparer.Ordinal)) - throw new InvalidOperationException($"Grant types list cannot contain both {value1} and {value2}"); - } - } - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs deleted file mode 100644 index a8762ad57..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -/// -/// Represents data needed for device flow. -/// -public class DeviceCodeModel -{ - /// - /// Gets or sets the creation time. - /// - /// - /// The creation time. - /// - public DateTime CreationTime { get; set; } - - /// - /// Gets or sets the lifetime. - /// - /// - /// The lifetime. - /// - public int Lifetime { get; set; } - - /// - /// Gets or sets the client identifier. - /// - /// - /// The client identifier. - /// - public string ClientId { get; set; } - - /// - /// Gets the description the user assigned to the device being authorized. - /// - /// - /// The description. - /// - public string Description { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is open identifier. - /// - /// - /// true if this instance is open identifier; otherwise, false. - /// - public bool IsOpenId { get; set; } - - /// - /// Gets or sets a value indicating whether this instance is authorized. - /// - /// - /// true if this instance is authorized; otherwise, false. - /// - public bool IsAuthorized { get; set; } - - /// - /// Gets or sets the requested scopes. - /// - /// - /// The authorized scopes. - /// - public IEnumerable RequestedScopes { get; set; } - - /// - /// Gets or sets the authorized scopes. - /// - /// - /// The authorized scopes. - /// - public IEnumerable AuthorizedScopes { get; set; } - - /// - /// Gets or sets the subject. - /// - /// - /// The subject. - /// - public ClaimsPrincipal Subject { get; set; } - - /// - /// Gets or sets the session identifier. - /// - /// - /// The session identifier. - /// - public string SessionId { get; set; } - - public DeviceCodeModel( - DateTime creationTime, - int lifetime, - string clientId, - string description, - bool isOpenId, - bool isAuthorized, - IEnumerable requestedScopes, - IEnumerable authorizedScopes, - ClaimsPrincipal subject, string sessionId) - { - CreationTime = creationTime; - Lifetime = lifetime; - ClientId = clientId; - Description = description; - IsOpenId = isOpenId; - IsAuthorized = isAuthorized; - RequestedScopes = requestedScopes; - AuthorizedScopes = authorizedScopes; - Subject = subject; - SessionId = sessionId; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs deleted file mode 100644 index 5e74f68c7..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -public class GrantType -{ - public const string Implicit = "implicit"; - public const string Hybrid = "hybrid"; - public const string AuthorizationCode = "authorization_code"; - public const string ClientCredentials = "client_credentials"; - public const string ResourceOwnerPassword = "password"; - public const string DeviceFlow = "urn:ietf:params:oauth:grant-type:device_code"; - - public static List<(string, string)> DisallowGrantTypeCombinations = new() - { - (Implicit, AuthorizationCode), - (Implicit, Hybrid), - (AuthorizationCode, Hybrid), - }; -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs deleted file mode 100644 index 523a33b30..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -public class IdentityResourceModel : ResourceModel -{ - public bool Required { get; set; } - - public bool Emphasize { get; set; } - - public override ICollection UserClaims { get; set; } - - public IdentityResourceModel() - { - } - - public IdentityResourceModel(string name, string displayName, ICollection userClaims) - { - Name = name; - DisplayName = displayName; - UserClaims = userClaims; - } - - public IdentityResourceModel(string name, ICollection userClaims) : this(name, name, userClaims) - { - } - - public IdentityResourceModel( - string name, - string displayName, - string? description, - bool enabled, - bool showInDiscoveryDocument, - bool required, - bool emphasize, - ICollection userClaims, - IDictionary properties) : this(name, displayName, userClaims) - { - Description = description; - Enabled = enabled; - ShowInDiscoveryDocument = showInDiscoveryDocument; - Required = required; - Emphasize = emphasize; - Properties = properties; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs deleted file mode 100644 index b59ec207f..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -/// -/// Represents a filter used when accessing the persisted grants store. -/// Setting multiple properties is interpreted as a logical 'AND' to further filter the query. -/// At least one value must be supplied. -/// -public class PersistedGrantFilter -{ - /// - /// Subject id of the user. - /// - public string SubjectId { get; set; } - - /// - /// Session id used for the grant. - /// - public string SessionId { get; set; } - - /// - /// Client id the grant was issued to. - /// - public string ClientId { get; set; } - - /// - /// The type of grant. - /// - public string Type { get; set; } - - public PersistedGrantFilter( - string subjectId, - string sessionId, - string clientId, - string type) - { - SubjectId = subjectId; - SessionId = sessionId; - ClientId = clientId; - Type = type; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs deleted file mode 100644 index 8616114a4..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -/// -/// A model for a persisted grant -/// -public class PersistedGrantModel -{ - /// - /// Gets or sets the key. - /// - /// - /// The key. - /// - public string Key { get; set; } - - /// - /// Gets the type. - /// - /// - /// The type. - /// - public string Type { get; set; } - - /// - /// Gets the subject identifier. - /// - /// - /// The subject identifier. - /// - public string SubjectId { get; set; } - - /// - /// Gets the session identifier. - /// - /// - /// The session identifier. - /// - public string SessionId { get; set; } - - /// - /// Gets the client identifier. - /// - /// - /// The client identifier. - /// - public string ClientId { get; set; } - - /// - /// Gets the description the user assigned to the device being authorized. - /// - /// - /// The description. - /// - public string Description { get; set; } - - /// - /// Gets or sets the creation time. - /// - /// - /// The creation time. - /// - public DateTime CreationTime { get; set; } - - /// - /// Gets or sets the expiration. - /// - /// - /// The expiration. - /// - public DateTime? Expiration { get; set; } - - /// - /// Gets or sets the consumed time. - /// - /// - /// The consumed time. - /// - public DateTime? ConsumedTime { get; set; } - - /// - /// Gets or sets the data. - /// - /// - /// The data. - /// - public string Data { get; set; } - - public PersistedGrantModel( - string key, - string type, - string subjectId, - string sessionId, - string clientId, - string description, - DateTime creationTime, - DateTime? expiration, - DateTime? consumedTime, - string data) - { - Key = key; - Type = type; - SubjectId = subjectId; - SessionId = sessionId; - ClientId = clientId; - Description = description; - CreationTime = creationTime; - Expiration = expiration; - ConsumedTime = consumedTime; - Data = data; - } -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs deleted file mode 100644 index a9da1fd8d..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -public abstract class ResourceModel -{ - public bool Enabled { get; set; } = true; - - public string Name { get; set; } = ""; - - public string DisplayName { get; set; } = ""; - - public string? Description { get; set; } - - public bool ShowInDiscoveryDocument { get; set; } = true; - - [DisallowNull] - public virtual ICollection UserClaims { get; set; } = new HashSet(); - - public IDictionary Properties { get; set; } = new Dictionary(); -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs deleted file mode 100644 index 44df9f5bf..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -public class ResourcesModel -{ - /// - /// Gets or sets a value indicating whether [offline access]. - /// - public bool OfflineAccess { get; set; } - - public IEnumerable IdentityResources { get; set; } = new HashSet(); - - public IEnumerable ApiResources { get; set; } = new HashSet(); - - public IEnumerable ApiScopes { get; set; } = new HashSet(); - - public ResourcesModel() - { - } - - public ResourcesModel(ResourcesModel other) - : this(other.IdentityResources, other.ApiResources, other.ApiScopes) - { - OfflineAccess = other.OfflineAccess; - } - - public ResourcesModel(IEnumerable identityResources, IEnumerable apiResources, IEnumerable apiScopes) - { - if (identityResources?.Any() == true) - { - IdentityResources = new HashSet(identityResources.ToArray()); - } - if (apiResources?.Any() == true) - { - ApiResources = new HashSet(apiResources.ToArray()); - } - if (apiScopes?.Any() == true) - { - ApiScopes = new HashSet(apiScopes.ToArray()); - } - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs deleted file mode 100644 index 77406b319..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; - -public class SecretModel -{ - public string? Value { get; set; } - - public string? Description { get; set; } - - public DateTime? Expiration { get; set; } - - public string Type { get; set; } = "SharedSecret"; - - public SecretModel(string? value = null, string? description = null, DateTime? expiration = null) - { - Value = value; - Description = description; - Expiration = expiration; - } - - public override int GetHashCode() - { - return (17 * 23 + (Value?.GetHashCode() ?? 0)) * 23 + Type.GetHashCode(); - } - - public override bool Equals(object? obj) - { - if (obj is null) return false; - if (obj is SecretModel secret) - { - if (secret == this) return true; - return string.Equals(secret.Type, Type, StringComparison.Ordinal) && string.Equals(secret.Value, Value, StringComparison.Ordinal); - } - - return false; - } -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs b/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs deleted file mode 100644 index e5b433234..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Models/src/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; -global using System.ComponentModel; -global using System.Diagnostics.CodeAnalysis; -global using System.Reflection; -global using System.Security.Claims; diff --git a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj deleted file mode 100644 index fc833a901..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - net6.0 - enable - enable - - $(WarningsAsErrors);CS8600;CS8601;CS8602;CS8603;CS8604;CS8609;CS8610;CS8614;CS8616;CS8618;CS8619;CS8620;CS8622;CS8625 - - - - - - - - diff --git a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs deleted file mode 100644 index 976845a60..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; - -public interface IClientStore -{ - /// - /// Finds a client by id - /// - /// The client id - /// The client - Task FindClientByIdAsync(string clientId); -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs deleted file mode 100644 index 4875f3ea4..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; - -/// -/// Interface for the device flow store -/// -public interface IDeviceFlowStore -{ - /// - /// Stores the device authorization request. - /// - /// The device code. - /// The user code. - /// The data. - /// - Task StoreDeviceAuthorizationAsync(string deviceCode, string userCode, DeviceCodeModel data); - - /// - /// Finds device authorization by user code. - /// - /// The user code. - /// - Task FindByUserCodeAsync(string userCode); - - /// - /// Finds device authorization by device code. - /// - /// The device code. - Task FindByDeviceCodeAsync(string deviceCode); - - /// - /// Updates device authorization, searching by user code. - /// - /// The user code. - /// The data. - Task UpdateByUserCodeAsync(string userCode, DeviceCodeModel data); - - /// - /// Removes the device authorization, searching by device code. - /// - /// The device code. - Task RemoveByDeviceCodeAsync(string deviceCode); -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs deleted file mode 100644 index b08e71f14..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; - -/// -/// Interface for persisting any type of grant. -/// -public interface IPersistedGrantStore -{ - /// - /// Stores the grant. - /// - /// The grant. - /// - Task StoreAsync(PersistedGrantModel grant); - - /// - /// Gets the grant. - /// - /// The key. - /// - Task GetAsync(string key); - - /// - /// Gets all grants based on the filter. - /// - /// The filter. - /// - Task> GetAllAsync(PersistedGrantFilter filter); - - /// - /// Removes the grant by key. - /// - /// The key. - /// - Task RemoveAsync(string key); - - /// - /// Removes all grants based on the filter. - /// - /// The filter. - /// - Task RemoveAllAsync(PersistedGrantFilter filter); -} diff --git a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs deleted file mode 100644 index 45aebca13..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; - -public interface IResourceStore -{ - /// - /// Gets identity resources by scope name. - /// - /// - /// - Task> FindIdentityResourcesByScopeNameAsync(IEnumerable scopeNames); - - /// - /// Gets API scopes by scope name. - /// - /// - /// - Task> FindApiScopesByNameAsync(IEnumerable scopeNames); - - /// - /// Gets API resources by scope name. - /// - /// - /// - Task> FindApiResourcesByScopeNameAsync(IEnumerable scopeNames); - - /// - /// Gets API resources by API resource name. - /// - /// - /// - Task> FindApiResourcesByNameAsync(IEnumerable apiResourceNames); - - /// - /// Gets all resources. - /// - /// - Task GetAllResourcesAsync(); -} - diff --git a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs b/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs deleted file mode 100644 index c045e84b7..000000000 --- a/src/BuildingBlocks/Authentication/Oidc/Storage/src/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs deleted file mode 100644 index d6101ffdf..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public abstract class AbstractConfigurationRepository : IConfigurationRepository -{ - private readonly ILogger? _logger; - - private readonly List _listeners = new(); - - public abstract SectionTypes SectionType { get; } - - public AbstractConfigurationRepository(ILoggerFactory? loggerFactory = null) - => _logger = loggerFactory?.CreateLogger(); - - public abstract Properties Load(); - - public void AddChangeListener(IRepositoryChangeListener listener) - { - if (!_listeners.Contains(listener)) - _listeners.Add(listener); - } - - public void RemoveChangeListener(IRepositoryChangeListener listener) - => _listeners.Remove(listener); - - public void FireRepositoryChange(SectionTypes sectionType, Properties newProperties) - { - foreach (var listener in _listeners) - { - try - { - listener.OnRepositoryChange(sectionType, newProperties); - } - catch (Exception ex) - { - _logger?.LogError($"Failed to invoke repository change listener {listener.GetType()}", ex); - } - } - } -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs deleted file mode 100644 index 7860859ce..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; -public enum ConfigurationTypes -{ - Properties = 1, - Text, - Json, - Yaml, - Xml -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs deleted file mode 100644 index 7ef0d1bb8..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public interface IConfigurationApi -{ - public IConfiguration Get(string appId); -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs deleted file mode 100644 index 349e61ab2..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; -public interface IConfigurationApiClient -{ - Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string configObject, Action? valueChanged = null); - - Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged = null); - - Task GetAsync(string configObject, Action? valueChanged = null); - - Task GetAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged = null); - - Task GetDynamicAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged = null); - - Task GetDynamicAsync(string key); -} - diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs deleted file mode 100644 index 9fa71028c..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public interface IConfigurationApiManage -{ - /// - /// Initialize config object - /// - /// Environment name - /// Cluster name - /// App id - /// Config objects,Key:config object name,Value:config object content - /// - Task InitializeAsync(string environment, string cluster, string appId, Dictionary configObjects); - - Task UpdateAsync(string environment, string cluster, string appId, string configObject, object value); -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs deleted file mode 100644 index ae74f6a32..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public interface IConfigurationRepository -{ - SectionTypes SectionType { get; } - - Properties Load(); - - void AddChangeListener(IRepositoryChangeListener listener); - - void RemoveChangeListener(IRepositoryChangeListener listener); -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs deleted file mode 100644 index 3e96f0f72..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public interface IMasaConfiguration -{ - public IConfiguration Local { get; } - - public IConfigurationApi ConfigurationApi { get; } -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs deleted file mode 100644 index 7a7f8ac50..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public interface IMasaConfigurationBuilder : IConfigurationBuilder -{ - IServiceCollection Services { get; } - - IConfiguration Configuration { get; } - - void AddRepository(IConfigurationRepository configurationRepository); - - void AddRelations(params ConfigurationRelationOptions[] relationOptions); -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs deleted file mode 100644 index ded04a54a..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public interface IRepositoryChangeListener -{ - void OnRepositoryChange(SectionTypes sectionType, Properties newProperties); -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj deleted file mode 100644 index e70c41401..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs deleted file mode 100644 index d43243275..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration.Options; - -public class ConfigurationRelationOptions -{ - public SectionTypes SectionType { get; set; } - - public string? ParentSection { get; set; } - - public string? Section { get; set; } = default!; - - /// - /// Object type of mapping node relationship - /// - public Type ObjectType { get; set; } = default!; -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs deleted file mode 100644 index 9f7f641e6..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration.Options; - -/// -/// Automatic mapping relationship specification. -/// When ParentSection is Null or an empty string, the configuration will be mounted to the root node. -/// When Section is Null, the configuration will be mounted under the ParentSection node, and its node name is class name. -/// If Section is an empty string, it will be directly mounted under the ParentSection node -/// -public interface IMasaConfigurationOptions -{ - /// - /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType - /// - [JsonIgnore] - string? ParentSection { get; } - - /// - /// The section null means same as the class name, else load from the specify section - /// - [JsonIgnore] - string? Section { get; } - - [JsonIgnore] - SectionTypes SectionType { get; } -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs deleted file mode 100644 index 598f95251..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration.Options; -public abstract class MasaConfigurationOptions : IMasaConfigurationOptions -{ - /// - /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType - /// - [JsonIgnore] - public virtual string? ParentSection => null; - - /// - /// The section null means same as the class name, else load from the specify section - /// - [JsonIgnore] - public virtual string? Section => null; - - [JsonIgnore] - public abstract SectionTypes SectionType { get; } -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Properties.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Properties.cs deleted file mode 100644 index 088729dd1..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/Properties.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public class Properties : IEquatable, IEquatable -{ - private readonly Dictionary _dict; - - public Properties() => _dict = new Dictionary(StringComparer.OrdinalIgnoreCase); - - public Properties(IDictionary? dictionary) => - _dict = dictionary == null - ? new Dictionary(StringComparer.OrdinalIgnoreCase) - : new Dictionary(dictionary, StringComparer.OrdinalIgnoreCase); - - public Properties(Properties source) => _dict = source._dict; - - public bool TryGetProperty(string key, [NotNullWhen(true)] out string? value) => _dict.TryGetValue(key, out value); - - public string? GetProperty(string key) - { - _dict.TryGetValue(key, out var result); - - return result; - } - - public ISet GetPropertyNames() => new HashSet(_dict.Keys); - - public override bool Equals(object? obj) - { - if (this is null ^ obj is null) return false; - - if (obj is Properties other) - { - return Equals(other); - } - else - { - return false; - } - } - - public bool Equals(Properties? newProperties) - { - if (newProperties == null) return false; - - return GetHashCode() == newProperties.GetHashCode(); - } - - public static bool operator ==(Properties? x, Properties? y) - { - if (x is null ^ y is null) return false; - - if (x is null) return true; - - return x.Equals(y); - } - - public static bool operator !=(Properties? x, Properties? y) - { - if (x is null ^ y is null) return false; - - if (x is null) return false; - - return !x.Equals(y); - } - - public override int GetHashCode() - { - return _dict.Select(key => key.Key + key.Value).Aggregate(0, (hashCode, next) => HashCode.Combine(hashCode, next)); - } -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/SectionTypes.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/SectionTypes.cs deleted file mode 100644 index 2a3086cf2..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/SectionTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public enum SectionTypes -{ - Local = 1, - ConfigurationApi -} diff --git a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/_Imports.cs b/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/_Imports.cs deleted file mode 100644 index e06845834..000000000 --- a/src/BuildingBlocks/Configuration/src/Masa.BuildingBlocks.Configuration/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Configuration.Options; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; -global using System.Diagnostics.CodeAnalysis; -global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj b/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj deleted file mode 100644 index c22e10cd7..000000000 --- a/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs b/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs deleted file mode 100644 index 633b5b235..000000000 --- a/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration.Tests; - -[TestClass] -public class TestProperties -{ - [TestMethod] - public void TestEquals() - { - var id = Guid.NewGuid().ToString(); - var x = new Properties(new Dictionary() - { - {"id", id}, - }); - var y = new Properties(new Dictionary() - { - {"id", id}, - }); - var z = new Properties(new Dictionary() - { - {"id2", Guid.NewGuid().ToString()}, - {"id", id} - }); - Assert.IsTrue(x.Equals(y)); - Assert.IsTrue(!x.Equals(null)); - Assert.IsTrue(!x!.Equals(z)); - Assert.IsTrue(!z.Equals(x)); - - var w = new Properties(new Dictionary() - { - {"id", Guid.NewGuid().ToString()}, - }); - - Assert.IsFalse(x!.Equals(w)); - } - - [TestMethod] - public void TestGetHashCode() - { - var id = Guid.NewGuid().ToString(); - Properties x = new(new Dictionary() { { "Id", id } }); - Properties y = new(new Dictionary() { { "Id", id } }); - - Assert.AreEqual(x.GetHashCode(), y.GetHashCode()); - } - - [TestMethod] - public void TestOperator() - { - var id = Guid.NewGuid().ToString(); - Properties x = new(new Dictionary() { { "Id", id } }); - Properties y = new(new Dictionary() { { "Id", id } }); - Properties z = new(new Dictionary() { { "Id", Guid.NewGuid().ToString() } }); - - Assert.IsTrue(x == y); - Assert.IsTrue(x != z); - - Properties? m = null; - Assert.IsTrue(m == null); - Assert.IsTrue(null == m); - Assert.IsFalse(null != m); - Assert.IsFalse(m != null); - } -} diff --git a/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs b/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs deleted file mode 100644 index 1109a8e81..000000000 --- a/src/BuildingBlocks/Configuration/test/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs deleted file mode 100644 index 2e1a2aeba..000000000 --- a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.Contracts.DataFiltering; - -public interface IDataFilter -{ - IDisposable Enable() where TFilter : class; - - IDisposable Disable() where TFilter : class; - - bool IsEnabled() where TFilter : class; -} diff --git a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs deleted file mode 100644 index b503daf17..000000000 --- a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.Contracts.DataFiltering; - -public interface ISoftDelete -{ - bool IsDeleted { get; } -} diff --git a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj deleted file mode 100644 index 5a26be858..000000000 --- a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs deleted file mode 100644 index 8c25e5522..000000000 --- a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.Contracts.Paginated; - -public class BasePaginatedList - where TEntity : class -{ - public long Total { get; set; } - - public int TotalPages { get; set; } - - public List Result { get; set; } = default!; -} diff --git a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/_Imports.cs b/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/_Imports.cs deleted file mode 100644 index b6f0781ac..000000000 --- a/src/BuildingBlocks/Data/Contracts/src/Masa.BuildingBlocks.Data.Contracts/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Microsoft.Extensions.DependencyInjection; -global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs deleted file mode 100644 index b50c3b680..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public abstract class BaseDbConnectionStringProvider : IDbConnectionStringProvider -{ - private readonly List? _dbContextOptionsList = null; - - public virtual List DbContextOptionsList => _dbContextOptionsList ?? GetDbContextOptionsList(); - - protected abstract List GetDbContextOptionsList(); -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs deleted file mode 100644 index a34bdd2f3..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public class DefaultConcurrencyStampProvider : IConcurrencyStampProvider -{ - public string GetRowVersion() => Guid.NewGuid().ToString(); -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs deleted file mode 100644 index 37968eaff..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface IConcurrencyStampProvider -{ - string GetRowVersion(); -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs deleted file mode 100644 index 9d5647341..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface IHasConcurrencyStamp -{ - string RowVersion { get; } -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs deleted file mode 100644 index 7d78706b7..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -[AttributeUsage(AttributeTargets.Class)] -public class ConnectionStringNameAttribute : Attribute -{ - public string Name { get; set; } - - public ConnectionStringNameAttribute(string name) => Name = name; - - public static string GetConnStringName() => GetConnStringName(typeof(T)); - - public static string GetConnStringName(Type type) - { - var nameAttribute = type.GetTypeInfo().GetCustomAttribute(); - - if (nameAttribute == null) - return ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME; - - return !string.IsNullOrEmpty(nameAttribute.Name) ? nameAttribute.Name : type.FullName!; - } -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStrings.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStrings.cs deleted file mode 100644 index 835b485c5..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/ConnectionStrings.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public class ConnectionStrings : Dictionary -{ - public const string DEFAULT_SECTION = "ConnectionStrings"; - - public const string DEFAULT_CONNECTION_STRING_NAME = "DefaultConnection"; - - public string DefaultConnection - { - get => GetConnectionString(DEFAULT_CONNECTION_STRING_NAME); - set => this[DEFAULT_CONNECTION_STRING_NAME] = value; - } - - public ConnectionStrings() { } - - public ConnectionStrings(IEnumerable> connectionStrings) : base(connectionStrings) { } - - public string GetConnectionString(string name) - { - if (base.TryGetValue(name, out var connectionString)) - return connectionString; - - return string.Empty; - } -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs deleted file mode 100644 index 40a1554fa..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public enum SequentialGuidType -{ - /// - /// The GUID should be sequential when formatted using the - /// Used by MySql and PostgreSql. - /// - SequentialAsString, - - /// - /// The GUID should be sequential when formatted using the - /// Used by Oracle. - /// - SequentialAsBinary, - - /// - /// The sequential portion of the GUID should be located at the end - /// of the Data4 block. - /// Used by SqlServer. - /// - SequentialAtEnd -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/TimestampType.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/TimestampType.cs deleted file mode 100644 index e22189617..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Enum/TimestampType.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public enum TimestampType -{ - Milliseconds = 1, - Seconds -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs deleted file mode 100644 index 2b55934d4..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface IConnectionStringProvider -{ - /// - /// Get Database Connection Strings based on ConnectionName - /// - /// - /// - Task GetConnectionStringAsync(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME); - - /// - /// Get Database Connection Strings based on ConnectionName - /// - /// - /// - string GetConnectionString(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME); -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs deleted file mode 100644 index 23e8e483a..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface IDbConnectionStringProvider -{ - List DbContextOptionsList { get; } -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDistributedLock.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDistributedLock.cs deleted file mode 100644 index 64a1ed9d1..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IDistributedLock.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface IDistributedLock -{ - IDisposable? TryGet(string key, TimeSpan timeout = default); - - Task TryGetAsync(string key, TimeSpan timeout = default, CancellationToken cancellationToken = default); -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IMasaDbContext.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IMasaDbContext.cs deleted file mode 100644 index c3cac5b22..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IMasaDbContext.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface IMasaDbContext : IDisposable, IAsyncDisposable -{ -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs deleted file mode 100644 index 0e6180fbf..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface IGuidGenerator : IIdGenerator -{ -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs deleted file mode 100644 index 59e657e16..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface IIdGenerator - where T : notnull - where TOut : notnull -{ - public TOut NewId(); -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs deleted file mode 100644 index cb0c52148..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface ISequentialGuidGenerator : IIdGenerator -{ - Guid Create(SequentialGuidType guidType); -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs deleted file mode 100644 index 3b04cb7b4..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public interface ISnowflakeGenerator : IIdGenerator -{ -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs deleted file mode 100644 index ac34d991b..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public class IdGeneratorFactory -{ - private static IGuidGenerator? _guidGenerator; - public static IGuidGenerator GuidGenerator => _guidGenerator ?? throw new Exception($"Unsupported {nameof(GuidGenerator)}"); - - private static ISequentialGuidGenerator? _sequentialGuidGenerator; - public static ISequentialGuidGenerator SequentialGuidGenerator - => _sequentialGuidGenerator ?? throw new Exception($"Unsupported {nameof(SequentialGuidGenerator)}"); - - private static ISnowflakeGenerator? _snowflakeGenerator; - public static ISnowflakeGenerator SnowflakeGenerator - => _snowflakeGenerator ?? throw new Exception($"Unsupported {nameof(SnowflakeGenerator)}"); - - public static void SetGuidGenerator(IGuidGenerator guidGenerator) - { - ArgumentNullException.ThrowIfNull(guidGenerator, nameof(guidGenerator)); - _guidGenerator = guidGenerator; - } - - public static void SetSequentialGuidGenerator(ISequentialGuidGenerator sequentialGuidGenerator) - { - ArgumentNullException.ThrowIfNull(sequentialGuidGenerator, nameof(sequentialGuidGenerator)); - _sequentialGuidGenerator = sequentialGuidGenerator; - } - - public static void SetSnowflakeGenerator(ISnowflakeGenerator snowflakeGenerator) - { - ArgumentNullException.ThrowIfNull(snowflakeGenerator, nameof(snowflakeGenerator)); - _snowflakeGenerator = snowflakeGenerator; - } -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj deleted file mode 100644 index d54911de3..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs deleted file mode 100644 index 2bced1bca..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data; - -public class MasaDbConnectionOptions -{ - private static readonly List> _connectionStrings = new(); - public ConnectionStrings ConnectionStrings { get; set; } - - public MasaDbConnectionOptions() - { - ConnectionStrings = new ConnectionStrings(_connectionStrings); - } - - public void TryAddConnectionString(string name, string connectionString) - { - if (_connectionStrings.All(item => item.Key != name)) - _connectionStrings.Add(new KeyValuePair(name, connectionString)); - } -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs deleted file mode 100644 index 3e32d3e29..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.Options; - -public class MasaDbContextConfigurationOptions -{ - public string ConnectionString { get; } - - public MasaDbContextConfigurationOptions(string connectionString) => ConnectionString = connectionString; -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/SequentialGuid.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/SequentialGuid.cs deleted file mode 100644 index b0eb7ed86..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/SequentialGuid.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public readonly struct SequentialGuid -{ - -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/Snowflake.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/Snowflake.cs deleted file mode 100644 index 1e8ff2d9b..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/System/Snowflake.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public readonly struct Snowflake -{ - -} diff --git a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/_Imports.cs b/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/_Imports.cs deleted file mode 100644 index 5096951d3..000000000 --- a/src/BuildingBlocks/Data/Data/src/Masa.BuildingBlocks.Data/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.Options; -global using System.Reflection; diff --git a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/IMapping.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/IMapping.cs deleted file mode 100644 index 709f99c16..000000000 --- a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/IMapping.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.Mapping; - -public interface IMapper -{ - TDestination Map(TSource source, MapOptions? options = null); - - TDestination Map(object source, MapOptions? options = null); - - TDestination Map(TSource source, TDestination destination, MapOptions? options = null); -} diff --git a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Mapper.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Mapper.cs deleted file mode 100644 index 567292ca2..000000000 --- a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Mapper.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.Mapping; - -public sealed class Mapper -{ - public static Mapper? Instance { get; set; } - - private readonly IMapper _mapper; - - public Mapper(IServiceCollection services) => _mapper = services.BuildServiceProvider().GetRequiredService(); - - public TDestination Map(TSource source, MapOptions? options = null) - => _mapper.Map(source, options); - - public TDestination Map(object source, MapOptions? options = null) - => _mapper.Map(source, options); - - public TDestination Map(TSource source, TDestination destination, MapOptions? options = null) - => _mapper.Map(source, destination, options); -} diff --git a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj deleted file mode 100644 index a4d5434e8..000000000 --- a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs deleted file mode 100644 index d51a933dd..000000000 --- a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.Mapping.Options.Enum; - -/// -/// Mapping mode -/// Currently only shared mapping modes are supported -/// -public enum MapMode -{ - /// - /// Use global settings and update global settings (update nested mappings) - /// - Shared = 1, -} diff --git a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs deleted file mode 100644 index 958c9b8ad..000000000 --- a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.Mapping.Options; - -public class MapOptions -{ - public MapMode Mode { get; set; } -} diff --git a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/_Imports.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/_Imports.cs deleted file mode 100644 index f9edf00cf..000000000 --- a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.Mapping/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.Mapping.Options; -global using Masa.BuildingBlocks.Data.Mapping.Options.Enum; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj deleted file mode 100644 index 12c5adf20..000000000 --- a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs deleted file mode 100644 index 1a6e92ff3..000000000 --- a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public static class ObjectExtensions -{ - private static Mapper? _mapper; - private static Mapper GetMapper() => _mapper ??= Mapper.Instance ?? throw new Exception("Please use MapperFactory to initialize Mapper"); - - public static TDestination Map(this TSource source, MapOptions? options = null) - => GetMapper().Map(source, options); - - public static TDestination Map(this object obj, MapOptions? options = null) - => GetMapper().Map(obj, options); - - public static TDestination Map(this TSource source, TDestination destination, MapOptions? options = null) - => GetMapper().Map(source, destination, options); -} diff --git a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs b/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs deleted file mode 100644 index e7ac38dcf..000000000 --- a/src/BuildingBlocks/Data/Mapping/src/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.Mapping; -global using Masa.BuildingBlocks.Data.Mapping.Options; diff --git a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/CommitState.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/CommitState.cs deleted file mode 100644 index dd3593f96..000000000 --- a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/CommitState.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.UoW; - -public enum CommitState -{ - /// - /// A transaction is opened and the data has changed - /// - UnCommited, - /// - /// The transaction is not opened or the data has not changed - /// - Commited -} diff --git a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/EntityState.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/EntityState.cs deleted file mode 100644 index cc77bf386..000000000 --- a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/EntityState.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.UoW; - -public enum EntityState -{ - UnChanged, - Changed -} diff --git a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/ITransaction.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/ITransaction.cs deleted file mode 100644 index 36ca7d1e8..000000000 --- a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/ITransaction.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.UoW; - -public interface ITransaction -{ - [JsonIgnore] - IUnitOfWork? UnitOfWork { get; set; } -} diff --git a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs deleted file mode 100644 index e8f37cd4d..000000000 --- a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.UoW; - -public interface IUnitOfWork : IDisposable, IAsyncDisposable -{ - IServiceProvider ServiceProvider { get; } - - DbTransaction Transaction { get; } - - /// - /// Whether the transaction has been opened - /// - bool TransactionHasBegun { get; } - - /// - /// Whether to use transaction - /// - bool UseTransaction { get; set; } - - /// - /// Disable transaction rollback after failure - /// - bool DisableRollbackOnFailure { get; set; } - - EntityState EntityState { get; set; } - - CommitState CommitState { get; set; } - - Task SaveChangesAsync(CancellationToken cancellationToken = default); - - Task CommitAsync(CancellationToken cancellationToken = default); - - Task RollbackAsync(CancellationToken cancellationToken = default); - - /// - /// Provides support for enqueuing aggregate root realm events - /// - /// - /// - Task AddDomainEventAsync(TDomainEvent @event) where TDomainEvent : class; -} diff --git a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs deleted file mode 100644 index fe830ba5a..000000000 --- a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.UoW; - -public interface IUnitOfWorkAccessor -{ - /// - /// Only exists after the DbContext is confirmed to be created - /// - MasaDbContextConfigurationOptions? CurrentDbContextOptions { get; set; } -} diff --git a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs deleted file mode 100644 index 79a3d2e25..000000000 --- a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Data.UoW; - -public interface IUnitOfWorkManager -{ - /// - /// Create new DbContext - /// We create DbContext with lazy loading enabled by default - /// - /// Deferred creation of DbContext, easy to specify tenant or environment by yourself, which is very effective for physical isolation - /// - IUnitOfWork CreateDbContext(bool lazyLoading = true); - - IUnitOfWork CreateDbContext(MasaDbContextConfigurationOptions dbContextOptions); -} diff --git a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj deleted file mode 100644 index c4592d734..000000000 --- a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/_Imports.cs b/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/_Imports.cs deleted file mode 100644 index a376a67ba..000000000 --- a/src/BuildingBlocks/Data/UoW/src/Masa.BuildingBlocks.Data.UoW/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.Options; -global using System.Data.Common; -global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs deleted file mode 100644 index 48b1f709f..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities; - -public abstract class AggregateRoot : Entity, IAggregateRoot, IGenerateDomainEvents -{ - private readonly List _domainEvents = new(); - - public virtual void AddDomainEvent(IDomainEvent domainEvent) - { - _domainEvents.Add(domainEvent); - } - - public virtual void RemoveDomainEvent(IDomainEvent domainEvent) - { - _domainEvents.Remove(domainEvent); - } - - public virtual IEnumerable GetDomainEvents() - { - return _domainEvents; - } - - public void ClearDomainEvents() - { - _domainEvents.Clear(); - } - - public async Task PublishDomainEventsAsync(IDomainEventBus eventBus) - { - while (_domainEvents.Any()) - { - await eventBus.PublishAsync(_domainEvents.First()); - _domainEvents.RemoveAt(0); - } - } -} - -public abstract class AggregateRoot : Entity, IAggregateRoot, IGenerateDomainEvents -{ - private readonly List _domainEvents = new(); - - public AggregateRoot() : base() - { - } - - public AggregateRoot(TKey id) : base(id) - { - } - - public virtual void AddDomainEvent(IDomainEvent domainEvent) - { - _domainEvents.Add(domainEvent); - } - - public virtual void RemoveDomainEvent(IDomainEvent domainEvent) - { - _domainEvents.Remove(domainEvent); - } - - public virtual IEnumerable GetDomainEvents() - { - return _domainEvents; - } - - public void ClearDomainEvents() - { - _domainEvents.Clear(); - } - - public async Task PublishDomainEventsAsync(IDomainEventBus eventBus) - { - while (_domainEvents.Any()) - { - await eventBus.PublishAsync(_domainEvents.First()); - _domainEvents.RemoveAt(0); - } - } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs deleted file mode 100644 index 7730550e4..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; - -public abstract class AuditAggregateRoot : AggregateRoot, IAuditAggregateRoot -{ - public TUserId Creator { get; protected set; } = default!; - - public DateTime CreationTime { get; protected set; } - - public TUserId Modifier { get; protected set; } = default!; - - public DateTime ModificationTime { get; set; } - - public AuditAggregateRoot() => Initialize(); - - public void Initialize() - { - this.CreationTime = this.GetCurrentTime(); - this.ModificationTime = this.GetCurrentTime(); - } - - public virtual DateTime GetCurrentTime() => DateTime.UtcNow; -} - -public abstract class AuditAggregateRoot : AggregateRoot, IAuditAggregateRoot -{ - public TUserId Creator { get; protected set; } = default!; - - public DateTime CreationTime { get; protected set; } - - public TUserId Modifier { get; protected set; } = default!; - - public DateTime ModificationTime { get; protected set; } - - public AuditAggregateRoot() : base() - { - Initialize(); - } - - public AuditAggregateRoot(TKey id) : base(id) - { - Initialize(); - } - - public void Initialize() - { - this.CreationTime = this.GetCurrentTime(); - this.ModificationTime = this.GetCurrentTime(); - } - - public virtual DateTime GetCurrentTime() => DateTime.UtcNow; -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs deleted file mode 100644 index cee548d09..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; - -public abstract class AuditEntity : Entity, IAuditEntity -{ - public TUserId Creator { get; protected set; } = default!; - - public DateTime CreationTime { get; protected set; } - - public TUserId Modifier { get; protected set; } = default!; - - public DateTime ModificationTime { get; set; } - - public AuditEntity() => Initialize(); - - public void Initialize() - { - this.CreationTime = this.GetCurrentTime(); - this.ModificationTime = this.GetCurrentTime(); - } - - public virtual DateTime GetCurrentTime() => DateTime.UtcNow; -} - -public abstract class AuditEntity : Entity, IAuditEntity -{ - public TUserId Creator { get; protected set; } = default!; - - public DateTime CreationTime { get; protected set; } - - public TUserId Modifier { get; protected set; } = default!; - - public DateTime ModificationTime { get; protected set; } - - public AuditEntity() : base() - { - Initialize(); - } - - public AuditEntity(TKey id) : base(id) - { - Initialize(); - } - - public void Initialize() - { - this.CreationTime = this.GetCurrentTime(); - this.ModificationTime = this.GetCurrentTime(); - } - - public virtual DateTime GetCurrentTime() => DateTime.UtcNow; -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs deleted file mode 100644 index 653f21d20..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; - -public interface IAuditAggregateRoot : IAuditEntity, IAggregateRoot -{ - -} - -public interface IAuditAggregateRoot : IAuditEntity, IAggregateRoot -{ - -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs deleted file mode 100644 index af78ad9b6..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; - -public interface IAuditEntity : IEntity -{ - TUserId Creator { get; } - - DateTime CreationTime { get; } - - TUserId Modifier { get; } - - DateTime ModificationTime { get; } -} - -public interface IAuditEntity : IAuditEntity, IEntity -{ -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs deleted file mode 100644 index 125e7a35d..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities; - -public abstract class Entity : IEntity, IEquatable, IEquatable -{ - public abstract IEnumerable<(string Name, object Value)> GetKeys(); - - /// - public override string ToString() - { - var keys = GetKeys().ToArray(); - string connector = keys.Length > 1 ? Environment.NewLine : string.Empty; - - return $"{GetType().Name}:{connector}{string.Join(Environment.NewLine, keys.Select(key => $"{key.Name}={key.Value}"))}"; - } - - public override bool Equals(object? obj) - { - if (this is null ^ obj is null) return false; - - if (obj is Entity other) - { - return other.GetKeys().Select(key => key.Value).SequenceEqual(GetKeys().Select(key => key.Value)); - } - else - { - return false; - } - } - - public bool Equals(Entity? other) - { - if (this is null ^ other is null) return false; - - return other!.GetKeys().Select(key => key.Value).SequenceEqual(GetKeys().Select(key => key.Value)); - } - - public override int GetHashCode() - { - return GetKeys().Select(key => key.Value).Aggregate(0, (hashCode, next) => HashCode.Combine(hashCode, next)); - } - - public static bool operator ==(Entity? x, Entity? y) - { - if (x is null ^ y is null) return false; - - if (x is null) return true; - - return x.Equals(y); - } - - public static bool operator !=(Entity? x, Entity? y) - { - if (x is null ^ y is null) return true; - - if (x is null) return false; - - return !x.Equals(y); - } -} - -public abstract class Entity : Entity, IEntity -{ - public TKey Id { get; protected set; } = default!; - - protected Entity() - { - } - - protected Entity(TKey id) : this() => Id = id; - - public override IEnumerable<(string Name, object Value)> GetKeys() - { - yield return ("Id", Id!); - } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs deleted file mode 100644 index 79b0b08bb..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; - -public abstract class FullAggregateRoot - : AuditAggregateRoot, IFullAggregateRoot -{ - public bool IsDeleted { get; protected set; } -} - -public abstract class FullAggregateRoot - : AuditAggregateRoot, IFullAggregateRoot -{ - public bool IsDeleted { get; protected set; } - - public FullAggregateRoot() : base() - { - } - - public FullAggregateRoot(TKey id) : base(id) - { - } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs deleted file mode 100644 index 86e51d88b..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; - -public abstract class FullEntity - : AuditEntity, IFullEntity -{ - public bool IsDeleted { get; protected set; } -} - -public abstract class FullEntity - : AuditEntity, IFullEntity -{ - public bool IsDeleted { get; protected set; } - - public FullEntity() : base() - { - } - - public FullEntity(TKey id) : base(id) - { - } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs deleted file mode 100644 index 2e2be7c5c..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; - -public interface IFullAggregateRoot : IFullEntity, IAuditAggregateRoot -{ - -} - -public interface IFullAggregateRoot : IFullEntity, IAuditAggregateRoot -{ - -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs deleted file mode 100644 index fdcfa99bb..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; - -public interface IFullEntity : IAuditEntity, ISoftDelete -{ - -} - -public interface IFullEntity : IAuditEntity, ISoftDelete -{ - -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs deleted file mode 100644 index bcb3af683..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities; - -public interface IAggregateRoot : IEntity -{ - -} - -public interface IAggregateRoot : IEntity, IAggregateRoot -{ - -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs deleted file mode 100644 index 2d497da0c..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities; - -public interface IEntity -{ - IEnumerable<(string Name, object Value)> GetKeys(); -} - -public interface IEntity : IEntity -{ - TKey Id { get; } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs deleted file mode 100644 index d9cb031b2..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Entities; - -public interface IGenerateDomainEvents -{ - IEnumerable GetDomainEvents(); - - void ClearDomainEvents(); -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs deleted file mode 100644 index 4379070f7..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Events; - -public abstract record DomainCommand : IDomainCommand -{ - private Guid _eventId; - private DateTime _creationTime; - - [JsonIgnore] - public IUnitOfWork? UnitOfWork { get; set; } - - public DomainCommand() : this(Guid.NewGuid(), DateTime.UtcNow) { } - - public DomainCommand(Guid eventId, DateTime creationTime) - { - _eventId = eventId; - _creationTime = creationTime; - } - - public Guid GetEventId() => _eventId; - - public void SetEventId(Guid eventId) => _eventId = eventId; - - public DateTime GetCreationTime() => _creationTime; - - public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs deleted file mode 100644 index 403b43267..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Events; - -public abstract record DomainEvent : IDomainEvent -{ - private Guid _eventId; - private DateTime _creationTime; - - [JsonIgnore] - public IUnitOfWork? UnitOfWork { get; set; } - - public DomainEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } - - public DomainEvent(Guid eventId, DateTime creationTime) - { - _eventId = eventId; - _creationTime = creationTime; - } - - public Guid GetEventId() => _eventId; - - public void SetEventId(Guid eventId) => _eventId = eventId; - - public DateTime GetCreationTime() => _creationTime; - - public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs deleted file mode 100644 index 577dc6a0b..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Events; - -public abstract record DomainQuery : IDomainQuery - where TResult : notnull -{ - private Guid _eventId; - private DateTime _creationTime; - - [JsonIgnore] - public IUnitOfWork? UnitOfWork - { - get => null; - set => throw new NotSupportedException(nameof(UnitOfWork)); - } - - public abstract TResult Result { get; set; } - - public DomainQuery() : this(Guid.NewGuid(), DateTime.UtcNow) { } - - public DomainQuery(Guid eventId, DateTime creationTime) - { - _eventId = eventId; - _creationTime = creationTime; - } - - public Guid GetEventId() => _eventId; - - public void SetEventId(Guid eventId) => _eventId = eventId; - - public DateTime GetCreationTime() => _creationTime; - - public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs deleted file mode 100644 index 30fb5801b..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Events; - -public interface IDomainCommand : ICommand, IDomainEvent -{ - -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs deleted file mode 100644 index ef591fa07..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Events; - -public interface IDomainEvent : IEvent, ITransaction -{ - -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs deleted file mode 100644 index f34878152..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Events; - -public interface IDomainEventBus : IEventBus -{ - Task Enqueue(TDomainEvent @event) - where TDomainEvent : IDomainEvent; - - Task PublishQueueAsync(); - - Task AnyQueueAsync(); -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs deleted file mode 100644 index b265889fd..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Events; - -public interface IDomainQuery : IDomainEvent, IQuery - where TResult : notnull -{ - -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs deleted file mode 100644 index 3e5864c70..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Events; - -public interface IIntegrationDomainEvent : IDomainEvent, IIntegrationEvent -{ - -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs deleted file mode 100644 index 5222a9c10..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Events; - -public abstract record IntegrationDomainEvent(Guid Id, DateTime CreationTime) : DomainEvent(Id, CreationTime), IIntegrationDomainEvent -{ - [JsonIgnore] - public abstract string Topic { get; set; } - - public IntegrationDomainEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj deleted file mode 100644 index 5a09c7f7a..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs deleted file mode 100644 index 549704fc3..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; - -public abstract class BaseRepository : - IRepository - where TEntity : class, IEntity -{ - public IServiceProvider ServiceProvider { get; } - - public virtual EntityState EntityState - { - get => UnitOfWork.EntityState; - set => UnitOfWork.EntityState = value; - } - - public virtual CommitState CommitState - { - get => UnitOfWork.CommitState; - protected set => UnitOfWork.CommitState = value; - } - - protected BaseRepository(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; - - public abstract IUnitOfWork UnitOfWork { get; } - - #region IRepository - - public abstract ValueTask AddAsync(TEntity entity, CancellationToken cancellationToken = default); - - public virtual async Task AddRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) - { - foreach (var entity in entities) - { - await AddAsync(entity, cancellationToken); - } - } - - public abstract Task FindAsync(IEnumerable> keyValues, CancellationToken cancellationToken = default); - - public abstract Task FindAsync(Expression> predicate, CancellationToken cancellationToken = default); - - public abstract Task RemoveAsync(TEntity entity, CancellationToken cancellationToken = default); - - public abstract Task RemoveAsync(Expression> predicate, CancellationToken cancellationToken = default); - - public virtual async Task RemoveRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) - { - foreach (var entity in entities) - { - await RemoveAsync(entity, cancellationToken); - } - } - - public abstract Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default); - - public virtual async Task UpdateRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) - { - foreach (var entity in entities) - { - await UpdateAsync(entity, cancellationToken); - } - } - - public abstract Task> GetListAsync(CancellationToken cancellationToken = default); - - public abstract Task> GetListAsync(string sortField, bool isDescending = true, CancellationToken cancellationToken = default); - - public abstract Task> GetListAsync(Expression> predicate, CancellationToken cancellationToken = default); - - public abstract Task> GetListAsync(Expression> predicate, string sortField, bool isDescending = true, CancellationToken cancellationToken = default); - - public abstract Task GetCountAsync(CancellationToken cancellationToken = default); - - public abstract Task GetCountAsync(Expression> predicate, CancellationToken cancellationToken = default); - - /// - /// Get a paginated list after sorting according to skip and take - /// - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Sort field name - /// true descending order, false ascending order, default: true - /// - /// - public abstract Task> GetPaginatedListAsync(int skip, int take, string sortField, bool isDescending, CancellationToken cancellationToken = default); - - /// - /// Get a paginated list after sorting according to skip and take - /// - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Key: sort field name, Value: true descending order, false ascending order - /// - /// - public abstract Task> GetPaginatedListAsync(int skip, int take, Dictionary? sorting = null, CancellationToken cancellationToken = default); - - /// - /// Get a paginated list after sorting by condition - /// - /// A function to test each element for a condition - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Sort field name - /// true descending order, false ascending order, default: true - /// - /// - public abstract Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, string sortField, - bool isDescending = true, CancellationToken cancellationToken = default); - - /// - /// Get a paginated list after sorting by condition - /// - /// A function to test each element for a condition - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Key: sort field name, Value: true descending order, false ascending order - /// - /// - public abstract Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, Dictionary? sorting = null, CancellationToken cancellationToken = default); - - public virtual async Task> GetPaginatedListAsync(PaginatedOptions options, CancellationToken cancellationToken = default) - { - var result = await GetPaginatedListAsync( - (options.Page - 1) * options.PageSize, - options.PageSize <= 0 ? int.MaxValue : options.PageSize, - options.Sorting, - cancellationToken - ); - - var total = await GetCountAsync(cancellationToken); - - return new PaginatedList() - { - Total = total, - Result = result, - TotalPages = (int)Math.Ceiling(total / (decimal)options.PageSize) - }; - } - - public async Task> GetPaginatedListAsync(Expression> predicate, PaginatedOptions options, CancellationToken cancellationToken = default) - { - var result = await GetPaginatedListAsync( - predicate, - (options.Page - 1) * options.PageSize, - options.PageSize <= 0 ? int.MaxValue : options.PageSize, - options.Sorting, - cancellationToken - ); - - var total = await GetCountAsync(predicate, cancellationToken); - - return new PaginatedList() - { - Total = total, - Result = result, - TotalPages = (int)Math.Ceiling(total / (decimal)options.PageSize) - }; - } - - #endregion -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs deleted file mode 100644 index 6867b9443..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; - -public interface IRepository - where TEntity : class, IEntity -{ - IUnitOfWork UnitOfWork { get; } - - #region Add - - ValueTask AddAsync(TEntity entity, CancellationToken cancellationToken = default); - - Task AddRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default); - - #endregion - - #region Update - - Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default); - - Task UpdateRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default); - - #endregion - - #region Remove - - Task RemoveAsync(TEntity entity, CancellationToken cancellationToken = default); - - Task RemoveRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default); - - Task RemoveAsync(Expression> predicate, CancellationToken cancellationToken = default); - - #endregion - - #region Find - - Task FindAsync(IEnumerable> keyValues, CancellationToken cancellationToken = default); - - Task FindAsync(Expression> predicate, CancellationToken cancellationToken = default); - - #endregion - - #region Get - - Task> GetListAsync(CancellationToken cancellationToken = default); - - Task> GetListAsync(string sortField, bool isDescending = true, CancellationToken cancellationToken = default); - - Task> GetListAsync(Expression> predicate, CancellationToken cancellationToken = default); - - Task> GetListAsync(Expression> predicate, string sortField, bool isDescending = true, CancellationToken cancellationToken = default); - - Task GetCountAsync(CancellationToken cancellationToken = default); - - Task GetCountAsync(Expression> predicate, CancellationToken cancellationToken = default); - - /// - /// Get a paginated list after sorting according to skip and take - /// - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Sort field name - /// true descending order, false ascending order, default: true - /// - /// - Task> GetPaginatedListAsync(int skip, int take, string sortField, bool isDescending = true, - CancellationToken cancellationToken = default); - - /// - /// Get a paginated list after sorting according to skip and take - /// - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Key: sort field name, Value: true descending order, false ascending order - /// - /// - Task> GetPaginatedListAsync(int skip, int take, Dictionary? sorting = null, - CancellationToken cancellationToken = default); - - /// - /// Get a paginated list after sorting by condition - /// - /// A function to test each element for a condition - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Sort field name - /// true descending order, false ascending order, default: true - /// - /// - Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, string sortField, - bool isDescending = true, CancellationToken cancellationToken = default); - - /// - /// Get a paginated list after sorting by condition - /// - /// A function to test each element for a condition - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Key: sort field name, Value: true descending order, false ascending order - /// - /// - Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, - Dictionary? sorting = null, CancellationToken cancellationToken = default); - - Task> GetPaginatedListAsync(PaginatedOptions options, CancellationToken cancellationToken = default); - - Task> GetPaginatedListAsync(Expression> predicate, PaginatedOptions options, - CancellationToken cancellationToken = default); - - #endregion -} - -public interface IRepository : IRepository - where TEntity : class, IEntity - where TKey : IComparable -{ - #region Find - - Task FindAsync(TKey id, CancellationToken cancellationToken = default); - - #endregion - - #region Remove - - Task RemoveAsync(TKey id, CancellationToken cancellationToken = default); - - Task RemoveRangeAsync(IEnumerable ids, CancellationToken cancellationToken = default); - - #endregion -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs deleted file mode 100644 index df089f229..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; - -public class PaginatedList : BasePaginatedList - where TEntity : class, IEntity -{ -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs deleted file mode 100644 index 90d921394..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; - -public class PaginatedOptions -{ - public int Page { get; set; } - - public int PageSize { get; set; } - - public Dictionary? Sorting { get; set; } - - public PaginatedOptions() - { - } - - public PaginatedOptions(int page, int pageSize, Dictionary? sorting = null) - { - Page = page; - PageSize = pageSize; - Sorting = sorting; - } - - /// - /// Initialize a new instance of PaginatedOptions. - /// - /// page number - /// returns per page - /// sort field name - /// true descending order, false ascending order, default: true - public PaginatedOptions(int page, int pageSize, string sortField, bool isDescending = true) - : this(page, pageSize, new Dictionary(new List> { new(sortField, isDescending) })) - { - } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs deleted file mode 100644 index 3fa9753c9..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.SeedWork; - -/// -/// Reference from https://docs.microsoft.com/zh-cn/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types -/// -public abstract class Enumeration : IComparable -{ - public string Name { get; private set; } - - public int Id { get; private set; } - - protected Enumeration(int id, string name) => (Id, Name) = (id, name); - - public override string ToString() => Name; - - public static IEnumerable GetAll() - where T : Enumeration - { - return typeof(T).GetFields(BindingFlags.Public | - BindingFlags.Static | - BindingFlags.DeclaredOnly) - .Select(f => f.GetValue(null)) - .Cast(); - } - - public override bool Equals(object? obj) - { - if (obj is not Enumeration otherValue) - { - return false; - } - - if (this is null ^ obj is null) return false; - - var typeMatches = GetType().Equals(obj!.GetType()); - var valueMatches = Id.Equals(otherValue.Id); - - return typeMatches && valueMatches; - } - - public override int GetHashCode() => Id.GetHashCode(); - - public static int AbsoluteDifference(Enumeration firstValue, Enumeration secondValue) - { - return Math.Abs(firstValue.Id - secondValue.Id); - } - - public static T FromValue(int value) where T : Enumeration - { - return Parse(value, "value", item => item.Id == value); - } - - public static T FromDisplayName(string displayName) where T : Enumeration - { - return Parse(displayName, "display name", item => item.Name == displayName); - } - - private static T Parse(K value, string description, Func predicate) where T : Enumeration - { - var matchingItem = GetAll().FirstOrDefault(predicate); - - if (matchingItem == null) - throw new InvalidOperationException($"'{value}' is not a valid {description} in {typeof(T)}"); - - return matchingItem; - } - - public int CompareTo(object? other) => Id.CompareTo(((Enumeration?)other)?.Id); -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs deleted file mode 100644 index cbb9b30e9..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Services; - -public interface IDomainService -{ - IDomainEventBus EventBus { get; } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs deleted file mode 100644 index c494285c8..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Specifications; - -public abstract class BaseSpecification : ISpecification -{ - public BaseSpecification(Expression> whereExpression) - { - WhereExpression = whereExpression; - } - public Expression> WhereExpression { get; } - - public List>> Includes { get; } = - new List>>(); - - public List IncludeStrings { get; } = new List(); - - public abstract bool IsSatisfiedBy(T obj); - - protected virtual void AddInclude(Expression> includeExpression) - { - Includes.Add(includeExpression); - } - - protected virtual void AddInclude(string includeString) - { - IncludeStrings.Add(includeString); - } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs deleted file mode 100644 index 34b14a8dd..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Specifications; - -/// -/// Reference from -/// https://docs.microsoft.com/zh-cn/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/infrastructure-persistence-layer-implementation-entity-framework-core -/// https://martinfowler.com/apsupp/spec.pdf -/// -public interface ISpecification -{ - bool IsSatisfiedBy(T obj); - - Expression> WhereExpression { get; } - - List>> Includes { get; } - - List IncludeStrings { get; } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs deleted file mode 100644 index 35bd261a2..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Values; - -public abstract class ValueObject -{ - protected abstract IEnumerable GetEqualityValues(); - - public override bool Equals(object? obj) - { - if (this is null ^ obj is null) return false; - - if (obj is ValueObject entity) - { - return entity.GetEqualityValues().SequenceEqual(GetEqualityValues()); - } - else - { - return false; - } - } - - public override int GetHashCode() - { - return GetEqualityValues().Aggregate(0, (hashCode, next) => HashCode.Combine(hashCode, next)); - } - - public static bool operator ==(ValueObject x, ValueObject y) - { - return x.Equals(y); - } - - public static bool operator !=(ValueObject x, ValueObject y) - { - return !x.Equals(y); - } -} diff --git a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs b/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs deleted file mode 100644 index dac97ea04..000000000 --- a/src/BuildingBlocks/Ddd/Domain/src/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; -global using Masa.BuildingBlocks.Data.Contracts.Paginated; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; -global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; -global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; -global using System.Linq.Expressions; -global using System.Reflection; -global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj b/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj deleted file mode 100644 index 7fda59921..000000000 --- a/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs b/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs deleted file mode 100644 index e6a21820d..000000000 --- a/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Tests; - -[TestClass] -public class TestEntity -{ - [TestMethod] - public void TestToString() - { - MasaEntity entity = new(Guid.Empty); - Assert.AreEqual("MasaEntity:Id=00000000-0000-0000-0000-000000000000", entity.ToString()); - } - - [TestMethod] - public void TestEquals() - { - var id = Guid.NewGuid(); - MasaEntity x = new(id); - MasaEntity y = new(id); - - Assert.IsTrue(x.Equals(y)); - Assert.IsTrue(x.Equals((object)y)); - } - - [TestMethod] - public void TestGetHashCode() - { - var id = Guid.NewGuid(); - MasaEntity x = new(id); - MasaEntity y = new(id); - - Assert.AreEqual(x.GetHashCode(), y.GetHashCode()); - } - - [TestMethod] - public void TestOperator() - { - var id = Guid.NewGuid(); - MasaEntity x = new(id); - MasaEntity y = new(id); - MasaEntity z = new(Guid.NewGuid()); - - Assert.IsTrue(x == y); - Assert.IsTrue(x != z); - - MasaEntity? m = null; - Assert.IsTrue(m == null); - Assert.IsTrue(null == m); - Assert.IsFalse(null != m); - Assert.IsFalse(m != null); - Assert.IsTrue(x != null); - Assert.IsTrue(null != x); - } - - public class MasaEntity : Entity - { - public MasaEntity(Guid id) - { - Id = id; - } - } -} diff --git a/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs b/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs deleted file mode 100644 index d2679ea25..000000000 --- a/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Masa.BuildingBlocks.Ddd.Domain.Values; - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Ddd.Domain.Tests; - -[TestClass] -public class TestValueObject -{ - [TestMethod] - public void TestEquals() - { - var id = Guid.NewGuid(); - MasaValueObject x = new() { Id = id }; - MasaValueObject y = new() { Id = id }; - - Assert.IsTrue(x.Equals(y)); - } - - [TestMethod] - public void TestGetHashCode() - { - var id = Guid.NewGuid(); - MasaValueObject x = new() { Id = id }; - MasaValueObject y = new() { Id = id }; - - Assert.AreEqual(x.GetHashCode(), y.GetHashCode()); - } - - [TestMethod] - public void TestOperator() - { - var id = Guid.NewGuid(); - MasaValueObject x = new() { Id = id }; - MasaValueObject y = new() { Id = id }; - MasaValueObject z = new() { Id = Guid.NewGuid() }; - - Assert.IsTrue(x == y); - Assert.IsTrue(x != z); - } - - public class MasaValueObject : ValueObject - { - public Guid Id { get; set; } - - protected override IEnumerable GetEqualityValues() - { - yield return Id; - } - } -} diff --git a/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs b/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs deleted file mode 100644 index fdacb3726..000000000 --- a/src/BuildingBlocks/Ddd/Domain/test/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Event.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Event.cs deleted file mode 100644 index d559be44d..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Event.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.Events; - -public abstract record Event : IEvent -{ - private Guid _eventId; - private DateTime _creationTime; - - public Event() : this(Guid.NewGuid(), DateTime.UtcNow) { } - - public Event(Guid eventId, DateTime creationTime) - { - _eventId = eventId; - _creationTime = creationTime; - } - - public Guid GetEventId() => _eventId; - - public void SetEventId(Guid eventId) => _eventId = eventId; - - public DateTime GetCreationTime() => _creationTime; - - public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; -} diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs deleted file mode 100644 index 964e9c59e..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.Events; - -public interface IDispatcherOptions -{ - IServiceCollection Services { get; } - - Assembly[] Assemblies { get; } -} diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs deleted file mode 100644 index f3893912d..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.Events; - -public interface IEvent -{ - Guid GetEventId(); - - void SetEventId(Guid eventId); - - DateTime GetCreationTime(); - - void SetCreationTime(DateTime creationTime); -} - -public interface IEvent : IEvent - where TResult : notnull -{ - TResult Result { get; set; } -} diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs deleted file mode 100644 index da39dd140..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.Events; - -public interface IEventBus -{ - Task PublishAsync(TEvent @event) - where TEvent : IEvent; - - IEnumerable GetAllEventTypes(); - - Task CommitAsync(CancellationToken cancellationToken = default); -} diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs deleted file mode 100644 index 820cb2504..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.Events; - -public interface IEventBusBuilder -{ - public IServiceCollection Services { get; } - - IEventBusBuilder UseMiddleware(Type middleware, ServiceLifetime middlewareLifetime = ServiceLifetime.Transient); -} diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs deleted file mode 100644 index 0039bc86e..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.Events; - -public interface IEventHandler - where TEvent : IEvent -{ - Task HandleAsync(TEvent @event); -} diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs deleted file mode 100644 index 5e9eae264..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.Events; - -public delegate Task EventHandlerDelegate(); - -/// -/// Middleware is assembled into an event pipeline to handle invoke event and result -/// -public interface IMiddleware - where TEvent : IEvent -{ - Task HandleAsync(TEvent @event, EventHandlerDelegate next); - - /// - /// If Recursive is not supported, the current Middleware only executes once - /// If Recursive is supported, Middleware will be executed everytime when EventBus is nested - /// - bool SupportRecursive { get; } -} diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs deleted file mode 100644 index be470b149..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.Events; - -public interface ISagaEventHandler : IEventHandler - where TEvent : IEvent -{ - Task CancelAsync(TEvent @event); -} diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj deleted file mode 100644 index 5a26be858..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs deleted file mode 100644 index db37200da..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.Events; - -public abstract class Middleware : IMiddleware where TEvent : IEvent -{ - public virtual bool SupportRecursive => true; - - public abstract Task HandleAsync(TEvent @event, EventHandlerDelegate next); -} diff --git a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs b/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs deleted file mode 100644 index 67285f175..000000000 --- a/src/BuildingBlocks/Dispatcher/Events/src/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Microsoft.Extensions.DependencyInjection; -global using System.Reflection; diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs deleted file mode 100644 index 468933d79..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; - -public interface IDistributedDispatcherOptions : IDispatcherOptions -{ -} diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs deleted file mode 100644 index a31cf0f41..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; - -public interface IIntegrationEvent : IEvent, ITopic, ITransaction -{ -} diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs deleted file mode 100644 index 639364f3e..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; - -public interface IIntegrationEventBus : IEventBus -{ - -} diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs deleted file mode 100644 index c5792c4f8..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; - -public interface ITopic -{ - string Topic { get; set; } -} diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs deleted file mode 100644 index 297fcba1c..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; - -public abstract record IntegrationEvent : IIntegrationEvent -{ - private Guid _eventId; - private DateTime _creationTime; - - [JsonIgnore] - public IUnitOfWork? UnitOfWork { get; set; } - - [JsonIgnore] - public abstract string Topic { get; set; } - - public IntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } - - protected IntegrationEvent(Guid eventId, DateTime creationTime) - { - _eventId = eventId; - _creationTime = creationTime; - } - - public Guid GetEventId() => _eventId; - - public void SetEventId(Guid eventId) => _eventId = eventId; - - public DateTime GetCreationTime() => _creationTime; - - public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; -} diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs deleted file mode 100644 index 43f539830..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; - -public enum IntegrationEventStates -{ - NotPublished = 0, - InProgress = 1, - Published = 2, - PublishedFailed = 3 -} diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs deleted file mode 100644 index b07efc722..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; - -public interface IIntegrationEventLogService -{ - /// - /// Get messages to retry - /// - /// The size of a single event to be retried - /// - /// default: 60s - /// - Task> RetrieveEventLogsFailedToPublishAsync(int retryBatchSize = 200, int maxRetryTimes = 10, int minimumRetryInterval = 60); - - Task SaveEventAsync(IIntegrationEvent @event, DbTransaction transaction); - - Task MarkEventAsPublishedAsync(Guid eventId); - - Task MarkEventAsInProgressAsync(Guid eventId); - - Task MarkEventAsFailedAsync(Guid eventId); - - /// - /// Delete successfully published and expired data - /// - /// - /// - /// - /// - Task DeleteExpiresAsync(DateTime expiresAt, int batchCount = 1000, CancellationToken token = default); -} diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs deleted file mode 100644 index 104851c9f..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; - -public class IntegrationEventLog : IHasConcurrencyStamp -{ - public Guid Id { get; private set; } - - public Guid EventId { get; private set; } - - public string EventTypeName { get; private set; } = null!; - - [NotMapped] - public string EventTypeShortName => EventTypeName.Split('.').Last(); - - [NotMapped] - public IIntegrationEvent Event { get; private set; } = null!; - - public IntegrationEventStates State { get; set; } = IntegrationEventStates.NotPublished; - - public int TimesSent { get; set; } = 0; - - public DateTime CreationTime { get; private set; } - - public DateTime ModificationTime { get; set; } - - public string Content { get; private set; } = null!; - - public Guid TransactionId { get; private set; } = Guid.Empty; - - public string RowVersion { get; private set; } - - private IntegrationEventLog() - { - Id = Guid.NewGuid(); - Initialize(); - } - - public IntegrationEventLog(IIntegrationEvent @event, Guid transactionId) : this() - { - EventId = @event.GetEventId(); - CreationTime = @event.GetCreationTime(); - ModificationTime = @event.GetCreationTime(); - EventTypeName = @event.GetType().FullName!; - Content = System.Text.Json.JsonSerializer.Serialize((object)@event); - TransactionId = transactionId; - } - - public void Initialize() - { - this.CreationTime = this.GetCurrentTime(); - } - - public virtual DateTime GetCurrentTime() => DateTime.UtcNow; - - public IntegrationEventLog DeserializeJsonContent(Type type) - { - Event = (System.Text.Json.JsonSerializer.Deserialize(Content, type) as IIntegrationEvent)!; - Event?.SetEventId(this.EventId); - Event?.SetCreationTime(this.CreationTime); - return this; - } - - public void SetRowVersion(string rowVersion) - { - if (string.IsNullOrEmpty(rowVersion)) - throw new ArgumentNullException(nameof(rowVersion)); - - RowVersion = rowVersion; - } -} diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj deleted file mode 100644 index ea60cc945..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs b/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs deleted file mode 100644 index e33e8f784..000000000 --- a/src/BuildingBlocks/Dispatcher/IntegrationEvents/src/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using System.ComponentModel.DataAnnotations.Schema; -global using System.Data.Common; -global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs deleted file mode 100644 index 087259862..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public class DefaultTypeConvertProvider : ITypeConvertProvider -{ - public T ConvertTo(string value) - { - if (typeof(T) == typeof(Guid)) - return (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(value)!; - - return (T)Convert.ChangeType(value, typeof(T)); - } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs deleted file mode 100644 index b116f32bb..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface IIdentityUser -{ - string Id { get; set; } - - string? UserName { get; set; } - - IEnumerable> Roles { get; set; } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs deleted file mode 100644 index 2ecacfe4a..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public class IdentityRole -{ - public T Id { get; set; } - - public string Name { get; set; } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs deleted file mode 100644 index 31213d8d5..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public class IdentityUser : IIdentityUser -{ - public string Id { get; set; } - - public string? UserName { get; set; } - - public IEnumerable> Roles { get; set; } = new List>(); -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs deleted file mode 100644 index 656188c3f..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface IIsolatedIdentityUser : IMultiTenantIdentityUser, IMultiEnvironmentIdentityUser -{ -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs deleted file mode 100644 index 72d89fdf0..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface IMultiEnvironmentIdentityUser : IIdentityUser -{ - string? Environment { get; set; } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs deleted file mode 100644 index d57e54ee9..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface IMultiTenantIdentityUser : IIdentityUser -{ - string? TenantId { get; set; } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs deleted file mode 100644 index 1121b1b03..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public class IsolatedIdentityUser : MultiTenantIdentityUser -{ - public string? Environment { get; set; } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs deleted file mode 100644 index fc3e54447..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public class MultiEnvironmentIdentityUser : IdentityUser -{ - public string? Environment { get; set; } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs deleted file mode 100644 index da9be1540..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public class MultiTenantIdentityUser : IdentityUser, IMultiTenantIdentityUser -{ - public string? TenantId { get; set; } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs deleted file mode 100644 index bce77db68..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -[Flags] -public enum IdentityType -{ - /// - /// Only use user information - /// - Basic = 0x01, - - /// - /// Multi-tenant - /// - MultiTenant = 0x02, - - /// - /// Multi-Environment - /// - MultiEnvironment = 0x04, -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs deleted file mode 100644 index a5c9b3505..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface IIsolatedUserContext : IMultiTenantUserContext, - IMultiEnvironmentUserContext -{ - -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs deleted file mode 100644 index 62c3f97e8..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface IMultiEnvironmentUserContext : IUserContext -{ - string? Environment { get; } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs deleted file mode 100644 index a4b517917..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface IMultiTenantUserContext : IUserContext -{ - string? TenantId { get; } - - TTenantId? GetTenantId(); -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs deleted file mode 100644 index 2862d2bae..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface ITypeConvertProvider -{ - T ConvertTo(string value); -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs deleted file mode 100644 index 32a7302ea..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface IUserContext -{ - bool IsAuthenticated { get; } - - string? UserId { get; } - - string? UserName { get; } - - TUserId? GetUserId(); - - TIdentityUser? GetUser() where TIdentityUser : IIdentityUser; - - IEnumerable> GetUserRoles(); -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs deleted file mode 100644 index 5ac2d328e..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public interface IUserSetter -{ - IDisposable Change(TIdentityUser identityUser) where TIdentityUser : IIdentityUser; -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs deleted file mode 100644 index 2a2408616..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel.Internal; - -internal class DisposeAction : IDisposable -{ - private readonly Action _action; - - public DisposeAction(Action action) - { - ArgumentNullException.ThrowIfNull(action, nameof(action)); - _action = action; - } - - public void Dispose() => _action(); -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs deleted file mode 100644 index 004c5e44a..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Identity.IdentityModel; - -public abstract class UserContext : IUserSetter, IUserContext -{ - private readonly AsyncLocal _currentUser = new(); - - public bool IsAuthenticated => GetUserSimple() != null; - - public string? UserId => GetUserSimple()?.Id; - - public string? UserName => GetUserSimple()?.UserName; - - protected ITypeConvertProvider TypeConvertProvider { get; } - - public UserContext(ITypeConvertProvider typeConvertProvider) => TypeConvertProvider = typeConvertProvider; - - protected abstract object? GetUser(); - - protected abstract IdentityUser? GetUserBasicInfo(); - - public TUserId? GetUserId() - { - var userId = UserId; - if (userId == null) - return default; - - return TypeConvertProvider.ConvertTo(userId); - } - - public TIdentityUser? GetUser() where TIdentityUser : IIdentityUser - { - var user = _currentUser.Value ?? GetUser(); - return user == null ? default : (TIdentityUser)user; - } - - public IIdentityUser? GetUserSimple() => GetUser(); - - public IDisposable Change(TIdentityUser identityUser) where TIdentityUser : IIdentityUser - { - var user = GetUser(); - _currentUser.Value = identityUser; - return new DisposeAction(() => _currentUser.Value = user); - } - - public IEnumerable> GetUserRoles() - { - return GetUserSimple()?.Roles.Select(r => new IdentityRole - { - Id = TypeConvertProvider.ConvertTo(r.Id), - Name = r.Name - }) ?? new List>(); - } -} diff --git a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs b/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs deleted file mode 100644 index 15e5b13bc..000000000 --- a/src/BuildingBlocks/Identity/IdentityModel/src/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Identity.IdentityModel.Internal; -global using System.ComponentModel; diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs deleted file mode 100644 index 920f7451a..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Environment; - -public interface IEnvironmentContext -{ - string CurrentEnvironment { get; } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs deleted file mode 100644 index db701075f..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Environment; - -public interface IEnvironmentSetter -{ - void SetEnvironment(string environment); -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs deleted file mode 100644 index e86cceb23..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Environment; - -public interface IMultiEnvironment -{ - /// - /// The framework is responsible for the assignment operation, no manual assignment is required - /// - public string Environment { get; set; } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IConvertProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IConvertProvider.cs deleted file mode 100644 index f9aed3942..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IConvertProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation; - -public interface IConvertProvider -{ - object ChangeType(string value, Type conversionType); -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolation.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolation.cs deleted file mode 100644 index 8e2c89760..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolation.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation; - -public interface IIsolation : IMultiTenant, IMultiEnvironment - where TKey : IComparable -{ -} - -public interface IIsolation : IIsolation -{ -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs deleted file mode 100644 index 918e3b41e..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation; - -public interface IIsolationBuilder -{ - IServiceCollection Services { get; } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IParserProvider.cs deleted file mode 100644 index de646ff37..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/IParserProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation; - -public interface IParserProvider -{ - string Name { get; } - - Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action); -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj deleted file mode 100644 index a4f2b3006..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs deleted file mode 100644 index e14fea629..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Middleware; - -public interface IIsolationMiddleware -{ - Task HandleAsync(); -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs deleted file mode 100644 index 638f693fb..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.MultiTenant; - -public interface IMultiTenant : IMultiTenant -{ -} - -public interface IMultiTenant where TKey : IComparable -{ - /// - /// The framework is responsible for the assignment operation, no manual assignment is required - /// - public TKey TenantId { get; set; } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs deleted file mode 100644 index 6d5eddb8a..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.MultiTenant; - -public interface ITenantContext -{ - Tenant? CurrentTenant { get; } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs deleted file mode 100644 index f8cca629f..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.MultiTenant; - -public interface ITenantSetter -{ - void SetTenant(Tenant? tenant); -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs deleted file mode 100644 index 6fdbde873..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.MultiTenant; - -public class Tenant -{ - public string Id { get; set; } - - public Tenant(object id) : this(id?.ToString() ?? throw new ArgumentNullException(nameof(id))) - { - } - - public Tenant(string id) - { - if (string.IsNullOrEmpty(id)) - throw new ArgumentNullException(nameof(id)); - - Id = id; - } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs deleted file mode 100644 index 91cfdff63..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Options; - -public class IsolationDbConnectionOptions : MasaDbConnectionOptions -{ - public List IsolationConnectionStrings { get; set; } = new(); -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs deleted file mode 100644 index b9d7078dc..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Options; - -public class IsolationOptions -{ - public string TenantId { get; set; } - - public string Environment { get; set; } - - public string Name { get; set; } = string.Empty; - - public string ConnectionString { get; set; } - - /// - /// Used to control the configuration with the highest score when multiple configurations are satisfied. The default score is 100 - /// - public int Score { get; set; } = 100; -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs deleted file mode 100644 index e27f005e4..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Parser; - -public class CookieParserProvider : IParserProvider -{ - public string Name => "Cookie"; - - public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) - { - var httpContext = serviceProvider.GetRequiredService().HttpContext; - if (httpContext?.Request.Cookies.ContainsKey(key) ?? false) - { - var value = httpContext.Request.Cookies[key]; - if (!string.IsNullOrEmpty(value)) - { - action.Invoke(value); - return Task.FromResult(true); - } - } - - return Task.FromResult(false); - } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs deleted file mode 100644 index 7e50d1da0..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Parser; - -public class EnvironmentVariablesParserProvider : IParserProvider -{ - public string Name { get; } = "EnvironmentVariables"; - - public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) - { - string? value = System.Environment.GetEnvironmentVariable(key); - if (!string.IsNullOrEmpty(value)) - { - action.Invoke(value); - return Task.FromResult(true); - } - return Task.FromResult(false); - } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs deleted file mode 100644 index c471328c9..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Parser; - -public class FormParserProvider : IParserProvider -{ - public string Name => "Form"; - - public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) - { - var httpContext = serviceProvider.GetRequiredService().HttpContext; - if (!(httpContext?.Request.HasFormContentType ?? false)) - return Task.FromResult(false); - - if (httpContext?.Request.Form.ContainsKey(key) ?? false) - { - var value = httpContext.Request.Form[key].ToString(); - if (!string.IsNullOrEmpty(value)) - { - action.Invoke(value); - return Task.FromResult(true); - } - } - return Task.FromResult(false); - } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs deleted file mode 100644 index 4149c3165..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Parser; - -public class HeaderParserProvider : IParserProvider -{ - public string Name => "Header"; - - public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) - { - var httpContext = serviceProvider.GetRequiredService().HttpContext; - if (httpContext?.Request.Headers.ContainsKey(key) ?? false) - { - var value = httpContext.Request.Headers[key].ToString(); - if (!string.IsNullOrEmpty(value)) - { - action.Invoke(value); - return Task.FromResult(true); - } - } - - return Task.FromResult(false); - } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs deleted file mode 100644 index 76dbbfd9a..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Parser; - -public class HttpContextItemParserProvider : IParserProvider -{ - public string Name => "Items"; - - public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) - { - var httpContext = serviceProvider.GetRequiredService().HttpContext; - if (httpContext?.Items.ContainsKey(key) ?? false) - { - var value = httpContext.Items[key]?.ToString() ?? string.Empty; - if (!string.IsNullOrEmpty(value)) - { - action.Invoke(value); - return Task.FromResult(true); - } - } - - return Task.FromResult(false); - } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs deleted file mode 100644 index c76c2b904..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Parser; - -public class QueryStringParserProvider : IParserProvider -{ - public string Name => "QueryString"; - - public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) - { - var httpContext = serviceProvider.GetRequiredService().HttpContext; - if (httpContext?.Request.Query.ContainsKey(key) ?? false) - { - var value = httpContext.Request.Query[key].ToString(); - if (!string.IsNullOrEmpty(value)) - { - action.Invoke(value); - return Task.FromResult(true); - } - } - return Task.FromResult(false); - } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs deleted file mode 100644 index 34b637282..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Isolation.Parser; - -public class RouteParserProvider : IParserProvider -{ - public string Name => "Route"; - - public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) - { - var httpContext = serviceProvider.GetRequiredService().HttpContext; - var value = httpContext?.GetRouteValue(key)?.ToString() ?? string.Empty; - if (!string.IsNullOrEmpty(value)) - { - action.Invoke(value); - return Task.FromResult(true); - } - - return Task.FromResult(false); - } -} diff --git a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/_Imports.cs b/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/_Imports.cs deleted file mode 100644 index c998d2ac1..000000000 --- a/src/BuildingBlocks/Isolation/src/Masa.BuildingBlocks.Isolation/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.BuildingBlocks.Isolation.MultiTenant; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Routing; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs deleted file mode 100644 index 5408d26b6..000000000 --- a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; - -public abstract record Command : ICommand -{ - private Guid _eventId; - private DateTime _creationTime; - - [JsonIgnore] - public IUnitOfWork? UnitOfWork { get; set; } - - public Command() : this(Guid.NewGuid(), DateTime.UtcNow) { } - - public Command(Guid eventId, DateTime creationTime) - { - _eventId = eventId; - _creationTime = creationTime; - } - - public Guid GetEventId() => _eventId; - - public void SetEventId(Guid eventId) => _eventId = eventId; - - public DateTime GetCreationTime() => _creationTime; - - public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; -} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs deleted file mode 100644 index b16f0ad3e..000000000 --- a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; - -public interface ICommand : IEvent, ITransaction -{ -} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs deleted file mode 100644 index 59d6070e5..000000000 --- a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; - -public interface ICommandHandler : IEventHandler - where TCommand : ICommand -{ -} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj deleted file mode 100644 index 96f94c1fa..000000000 --- a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs deleted file mode 100644 index c32c90b5b..000000000 --- a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; - -public interface IQuery : IEvent - where TResult : notnull -{ -} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs deleted file mode 100644 index 2bcdb7e68..000000000 --- a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; - -public interface IQueryHandler : IEventHandler - where TCommand : IQuery where TResult : notnull -{ -} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs deleted file mode 100644 index 5f71f1b84..000000000 --- a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; - -public abstract record Query : IQuery - where TResult : notnull -{ - private Guid _eventId; - private DateTime _creationTime; - - public abstract TResult Result { get; set; } - - public Query() : this(Guid.NewGuid(), DateTime.UtcNow) { } - - public Query(Guid eventId, DateTime creationTime) - { - _eventId = eventId; - _creationTime = creationTime; - } - - public Guid GetEventId() => _eventId; - - public void SetEventId(Guid eventId) => _eventId = eventId; - - public DateTime GetCreationTime() => _creationTime; - - public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; -} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs b/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs deleted file mode 100644 index 212b5d65b..000000000 --- a/src/BuildingBlocks/ReadWriteSpliting/Cqrs/src/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/ReadWriteSpliting/EventSourcing/src/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj b/src/BuildingBlocks/ReadWriteSpliting/EventSourcing/src/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/BuildingBlocks/ReadWriteSpliting/EventSourcing/src/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs deleted file mode 100644 index 8175cc184..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; - -public class AutoCompleteDocument -{ - private string? _documentId; - - private string? _text; - - public string Text - { - get - { - return _text ??= GetText(); - } - init - { - if (value != null!) - _text = value; - } - } - - public AutoCompleteDocument() - { - } - - public AutoCompleteDocument(string text) : this() - { - Text = text; - } - - public virtual string GetDocumentId() => _documentId ??= Guid.NewGuid().ToString(); - - protected virtual string GetText() => string.Empty; -} - -public class AutoCompleteDocument : AutoCompleteDocument where TValue : notnull -{ - private string _id; - - public string Id - { - get - { - if (string.IsNullOrEmpty(_id)) - return Value?.ToString() ?? throw new ArgumentException("{Id} cannot be empty", nameof(Id)); - - return _id; - } - init - { - if (string.IsNullOrEmpty(value)) - throw new ArgumentException("{Id} cannot be empty", nameof(Id)); - - _id = value; - } - } - - public TValue Value { get; set; } - - public AutoCompleteDocument() - { - } - - public AutoCompleteDocument(string text, TValue value) - : this(value?.ToString() ?? throw new ArgumentException($"{value} cannot be empty", nameof(value)), text, value) - { - } - - public AutoCompleteDocument(string id, string text, TValue value) : this() - { - Id = id; - Text = text; - Value = value; - } - - public override string GetDocumentId() => Id; -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs deleted file mode 100644 index 7b7aafe35..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; - -public abstract class BaseAutoCompleteClient : IAutoCompleteClient -{ - public virtual Task>> GetAsync( - string keyword, - AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default) - => GetAsync(keyword, options, cancellationToken); - - public virtual Task>> GetAsync( - string keyword, - AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default) where TValue : notnull - => GetAsync, TValue>(keyword, options, cancellationToken); - - public virtual Task> GetAsync( - string keyword, - AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument - => GetBySpecifyDocumentAsync(keyword, options, cancellationToken); - - public abstract Task> GetBySpecifyDocumentAsync( - string keyword, - AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; - - public virtual Task SetAsync( - AutoCompleteDocument document, - SetOptions? options = null, - CancellationToken cancellationToken = default) - => SetAsync, Guid>(document, options, cancellationToken); - - public virtual Task SetAsync( - IEnumerable> documents, - SetOptions? options = null, - CancellationToken cancellationToken = default) - => SetAsync, Guid>(documents, options, cancellationToken); - - public virtual Task SetAsync( - AutoCompleteDocument document, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TValue : notnull - => SetAsync, TValue>(document, options, cancellationToken); - - public virtual Task SetAsync( - IEnumerable> documents, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TValue : notnull - => SetAsync, TValue>(documents, options, cancellationToken); - - public virtual Task SetAsync( - TAudoCompleteDocument document, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument - => SetAsync(new List { document }, options, cancellationToken); - - public virtual Task SetAsync( - IEnumerable documents, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument - => SetBySpecifyDocumentAsync(documents, options, cancellationToken); - - public virtual Task SetBySpecifyDocumentAsync( - TAudoCompleteDocument document, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument - => SetBySpecifyDocumentAsync(new List { document }, options, cancellationToken); - - public abstract Task SetBySpecifyDocumentAsync( - IEnumerable documents, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; - - - public abstract Task DeleteAsync(string id, CancellationToken cancellationToken = default); - - public virtual Task DeleteAsync(T id, CancellationToken cancellationToken = default) where T : IComparable - => DeleteAsync(id.ToString() ?? throw new ArgumentNullException($"{id} is not null", nameof(id)), cancellationToken); - - public abstract Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default); - - public virtual Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) - where T : IComparable - { - var type = typeof(T); - if (!type.IsPrimitive && type != typeof(Guid) && type != typeof(string)) - throw new NotSupportedException("Unsupported types, id only supports simple types or guid, string"); - - return DeleteAsync(ids.Select(id => id.ToString() ?? throw new ArgumentNullException($"{id} is not null", nameof(id))), - cancellationToken); - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs deleted file mode 100644 index ba29aed29..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; - -public interface IAutoCompleteClient -{ - Task>> GetAsync( - string keyword, - AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default); - - Task>> GetAsync( - string keyword, - AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default) where TValue : notnull; - - [Obsolete($"{nameof(GetAsync)} expired, please use {nameof(GetBySpecifyDocumentAsync)}")] - Task> GetAsync( - string keyword, - AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default) - where TAudoCompleteDocument : AutoCompleteDocument; - - Task> GetBySpecifyDocumentAsync( - string keyword, - AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default) - where TAudoCompleteDocument : AutoCompleteDocument; - - Task SetAsync( - AutoCompleteDocument document, - SetOptions? options = null, - CancellationToken cancellationToken = default); - - Task SetAsync( - IEnumerable> documents, - SetOptions? options = null, - CancellationToken cancellationToken = default); - - Task SetAsync( - AutoCompleteDocument document, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TValue : notnull; - - Task SetAsync( - IEnumerable> documents, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TValue : notnull; - - [Obsolete($"{nameof(SetAsync)} expired, please use {nameof(SetBySpecifyDocumentAsync)}")] - Task SetAsync( - TAudoCompleteDocument document, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; - - [Obsolete($"{nameof(SetAsync)} expired, please use {nameof(SetBySpecifyDocumentAsync)}")] - Task SetAsync( - IEnumerable documents, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; - - Task SetBySpecifyDocumentAsync( - TAudoCompleteDocument document, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; - - Task SetBySpecifyDocumentAsync( - IEnumerable documents, - SetOptions? options = null, - CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; - - Task DeleteAsync(string id, CancellationToken cancellationToken = default); - - Task DeleteAsync(T id, CancellationToken cancellationToken = default) where T : IComparable; - - Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default); - - Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) where T : IComparable; -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs deleted file mode 100644 index 77f5ed483..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; - -public interface IAutoCompleteFactory -{ - IAutoCompleteClient CreateClient(); - - IAutoCompleteClient CreateClient(string name); -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj deleted file mode 100644 index ca62071d4..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs deleted file mode 100644 index 98e26886c..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; - -public class AutoCompleteOptions -{ - public string Field { get; set; } - - private int _page; - - public int Page - { - get => _page; - set - { - if (value <= 0) - throw new ArgumentException($"{nameof(Page)} must be greater than 0", nameof(Page)); - - _page = value; - } - } - - private int _pageSize; - - public int PageSize - { - get => _pageSize; - set - { - if (value <= 0) - throw new ArgumentException($"{nameof(PageSize)} must be greater than 0", nameof(PageSize)); - - _pageSize = value; - } - } - - public SearchType? SearchType { get; } - - public AutoCompleteOptions(SearchType? searchType = null) - { - this.Field = "text"; - this.Page = 1; - this.PageSize = 10; - this.SearchType = searchType; - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs deleted file mode 100644 index f74dd5010..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; - -public class SetOptions -{ - public bool IsOverride { get; set; } - - public SetOptions(bool isOverride = true) - { - IsOverride = isOverride; - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs deleted file mode 100644 index 9e6c2fcfb..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; - -public class DeleteMultiResponse : ResponseBase -{ - public List Data { get; set; } - - public DeleteMultiResponse(bool isValid, string message) : base(isValid, message) - { - } - - public DeleteMultiResponse(bool isValid, string message, IEnumerable? data) : this(isValid, message) - { - ArgumentNullException.ThrowIfNull(data, nameof(data)); - - Data = data.ToList(); - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs deleted file mode 100644 index fb3ad8895..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; - -public class DeleteRangeResponseItems -{ - public string Id { get; } - - public bool IsValid { get; } - - public string Message { get; } - - public DeleteRangeResponseItems(string id, bool isValid, string message) - { - this.Id = id; - this.IsValid = isValid; - this.Message = message; - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs deleted file mode 100644 index 65df88c4e..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; - -public class DeleteResponse : ResponseBase -{ - public DeleteResponse(bool isValid, string message) : base(isValid, message) - { - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs deleted file mode 100644 index a02a7f7a4..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; - -public class GetResponse : ResponseBase - where TDropdownBox : AutoCompleteDocument -{ - public long Total { get; set; } - - public long TotalPages { get; set; } - - public List Data { get; set; } - - public GetResponse(bool isValid, string message) : base(isValid, message) - { - } - - public GetResponse(bool isValid, string message, IEnumerable data) : this(isValid, message) - { - ArgumentNullException.ThrowIfNull(data, nameof(data)); - - Data = data.ToList(); - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs deleted file mode 100644 index 6e3022ed0..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; - -public class ResponseBase -{ - public bool IsValid { get; } - - public string Message { get; } - - public ResponseBase(bool isValid, string message) - { - IsValid = isValid; - Message = message; - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs deleted file mode 100644 index 53785a71e..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; - -public class SetResponse : ResponseBase -{ - public List Items { get; set; } - - public SetResponse(bool isValid, string message) : base(isValid, message) - { - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs deleted file mode 100644 index bd03efdca..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; - -public class SetResponseItems -{ - public string Id { get; } - - public bool IsValid { get; } - - public string Message { get; } - - public SetResponseItems(string id, bool isValid, string message) - { - Id = id; - IsValid = isValid; - Message = message; - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs deleted file mode 100644 index f481c2404..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; - -public enum SearchType -{ - Precise = 1, - Fuzzy = 2 -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs deleted file mode 100644 index ec81698cc..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/src/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; -global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; - diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs deleted file mode 100644 index a06a134da..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests; - -public class CustomAutoCompleteClient : BaseAutoCompleteClient -{ - - public override Task> GetBySpecifyDocumentAsync(string keyword, AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override Task SetBySpecifyDocumentAsync(IEnumerable documents, SetOptions? options = null, - CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override Task DeleteAsync(string id, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) - => Task.FromResult(new DeleteMultiResponse(true, "")); -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj b/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj deleted file mode 100644 index 6c18982af..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs deleted file mode 100644 index f98407229..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests; - -[TestClass] -public class TestAutoCompleteClient -{ - [TestMethod] - public async Task TestDeleteMultiAsyncReturnSuccess() - { - var client = new CustomAutoCompleteClient(); - var response = await client.DeleteAsync(new[] { 1, 2 }); - Assert.IsTrue(response.IsValid); - - response = await client.DeleteAsync(new[] { "1", "2" }); - Assert.IsTrue(response.IsValid); - - response = await client.DeleteAsync(new[] { 1d, 2d }); - Assert.IsTrue(response.IsValid); - - response = await client.DeleteAsync(new[] { 1L, 2L }); - Assert.IsTrue(response.IsValid); - - response = await client.DeleteAsync(new[] { Guid.NewGuid(), Guid.NewGuid() }); - Assert.IsTrue(response.IsValid); - } -} diff --git a/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs b/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs deleted file mode 100644 index b8cdf88c8..000000000 --- a/src/BuildingBlocks/SearchEngine/AutoComplete/test/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; -global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs deleted file mode 100644 index a3963e6a7..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller; - -public abstract class AbstractCaller : ICaller -{ - private readonly ITypeConvertor _typeConvertor; - public readonly IServiceProvider ServiceProvider; - - private IRequestMessage? _requestMessage; - private IResponseMessage? _responseMessage; - protected IRequestMessage RequestMessage => _requestMessage ??= ServiceProvider.GetRequiredService(); - protected IResponseMessage ResponseMessage => _responseMessage ??= ServiceProvider.GetRequiredService(); - - public AbstractCaller(IServiceProvider serviceProvider) - { - _typeConvertor = serviceProvider.GetRequiredService(); - ServiceProvider = serviceProvider; - } - - public virtual async Task SendAsync( - HttpRequestMessage request, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var response = await SendAsync(request, cancellationToken); - if (autoThrowUserFriendlyException) - await ResponseMessage.ProcessResponseAsync(response, cancellationToken); - - return response; - } - - public abstract Task SendAsync( - HttpRequestMessage request, - CancellationToken cancellationToken = default); - - public abstract Task CreateRequestAsync( - HttpMethod method, - string? methodName); - - public abstract Task CreateRequestAsync( - HttpMethod method, - string? methodName, - TRequest data); - - public abstract Task SendAsync( - HttpRequestMessage request, - CancellationToken cancellationToken = default); - - public virtual async Task SendAsync( - HttpMethod method, - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(method, methodName); - request.Content = content; - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task SendAsync( - HttpMethod method, - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task SendAsync( - HttpMethod method, - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public abstract Task SendGrpcAsync( - string methodName, - CancellationToken cancellationToken = default); - - public abstract Task SendGrpcAsync( - string methodName, - CancellationToken cancellationToken = default) - where TResponse : IMessage, new(); - - public abstract Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - where TRequest : IMessage; - - public abstract Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - where TRequest : IMessage - where TResponse : IMessage, new(); - - public virtual async Task GetStringAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); - HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - return await content.Content.ReadAsStringAsync(cancellationToken); - } - - public virtual Task GetStringAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class - => GetStringAsync( - GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data)), - autoThrowUserFriendlyException, - cancellationToken); - - public virtual Task GetStringAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => GetStringAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task GetByteArrayAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); - HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - return await content.Content.ReadAsByteArrayAsync(cancellationToken); - } - - public virtual Task GetByteArrayAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class - => GetByteArrayAsync( - GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data)), - autoThrowUserFriendlyException, - cancellationToken); - - public virtual Task GetByteArrayAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => GetByteArrayAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task GetStreamAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); - HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - return await content.Content.ReadAsStreamAsync(cancellationToken); - } - - public virtual Task GetStreamAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class - => GetStreamAsync( - GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data)), - autoThrowUserFriendlyException, - cancellationToken); - - public virtual Task GetStreamAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => GetStreamAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); - - public virtual Task GetAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Get, methodName, null, autoThrowUserFriendlyException, cancellationToken); - - public virtual Task GetAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => GetAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task GetAsync( - string? methodName, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task GetAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) where TRequest : class - { - HttpRequestMessage request = - await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data))); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task GetAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = - await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data))); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task GetAsync( - string? methodName, - Dictionary data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, data)); - return await SendAsync(request, cancellationToken); - } - - protected virtual string GetUrl(string? url, IEnumerable> properties) - { - url ??= string.Empty; - foreach (var property in properties) - { - string value = property.Value; - - url = !url.Contains("?") ? - $"{url}?{property.Key}={value}" : - $"{url}&{property.Key}={value}"; - } - - return url; - } - - public virtual Task PostAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Post, methodName, content, autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task PostAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task PostAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task PostAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual Task PatchAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Patch, methodName, content, autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task PatchAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Patch, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task PatchAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task PatchAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual Task PutAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Put, methodName, content, autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task PutAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task PutAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task PutAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual Task DeleteAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Delete, methodName, content, autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task DeleteAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task DeleteAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task DeleteAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); - return await SendAsync(request, cancellationToken); - } -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs deleted file mode 100644 index 6deb557ef..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller; - -public static class AddCallerExtensions -{ - public static void AddCaller(CallerOptions callerOptions, string name, bool isDefault, Func func) - { - if (callerOptions.Callers.Any(c => c.Name == name)) - throw new ArgumentException($"The caller name already exists, please change the name, the repeat name is {name}"); - - callerOptions.Callers.Add(new CallerRelationOptions(name, isDefault, func)); - } -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/CallerBase.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/CallerBase.cs deleted file mode 100644 index e345d8d46..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/CallerBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller; - -public abstract class CallerBase -{ - public virtual string Name { get; set; } = string.Empty; - - protected CallerOptions CallerOptions { get; private set; } = default!; - - private ICaller? _caller; - - protected ICaller Caller => _caller ??= ServiceProvider.GetRequiredService().Create(Name); - - [Obsolete("CallerProvider has expired, please use Caller")] - protected ICaller CallerProvider => Caller; - - private IServiceProvider ServiceProvider { get; } - - protected CallerBase(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; - - public abstract void UseCallerExtension(); - - public void SetCallerOptions(CallerOptions options, string name) - { - CallerOptions = options; - if (string.IsNullOrEmpty(Name)) - Name = name; - } -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICaller.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICaller.cs deleted file mode 100644 index c69510e3a..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICaller.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller; - -public interface ICaller -{ - Task SendAsync( - HttpRequestMessage request, - CancellationToken cancellationToken = default); - - Task SendAsync( - HttpRequestMessage request, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task SendAsync( - HttpMethod method, - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task SendAsync( - HttpMethod method, - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task SendAsync( - HttpMethod method, - string? methodName, - TRequest data, - CancellationToken cancellationToken = default); - - Task SendGrpcAsync( - string methodName, - CancellationToken cancellationToken = default); - - Task SendGrpcAsync( - string methodName, - CancellationToken cancellationToken = default) - where TResponse : IMessage, new(); - - Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - where TRequest : IMessage; - - Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - where TRequest : IMessage - where TResponse : IMessage, new(); - - Task GetStringAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetStringAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class; - - Task GetStringAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetByteArrayAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetByteArrayAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class; - - Task GetByteArrayAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetStreamAsync(string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetStreamAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class; - - Task GetStreamAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetAsync( - string? methodName, - CancellationToken cancellationToken = default); - - Task GetAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - where TRequest : class; - - Task GetAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default); - - Task GetAsync(string? methodName, Dictionary data, - CancellationToken cancellationToken = default); - - Task PostAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PostAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PostAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default); - - Task PostAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default); - - Task PatchAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PatchAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PatchAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default); - - Task PatchAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default); - - Task PutAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PutAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PutAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default); - - Task PutAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default); - - Task DeleteAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task DeleteAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task DeleteAsync(string? methodName, TRequest data, CancellationToken cancellationToken = default); - - Task DeleteAsync(string? methodName, object data, CancellationToken cancellationToken = default); -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs deleted file mode 100644 index cd2a0b49c..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller; - -public interface ICallerFactory -{ - ICaller Create(); - - ICaller Create(string name); -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs deleted file mode 100644 index bcf6f4059..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller; - -public interface IRequestMessage -{ - Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage); - - Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data); -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs deleted file mode 100644 index ffc42c0a6..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller; - -public interface IResponseMessage -{ - Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); - - Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs deleted file mode 100644 index 2b2e670d8..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller; - -public interface ITypeConvertor -{ - /// - /// Convert custom object to dictionary - /// - /// - /// Support classes, anonymous objects - /// - [Obsolete("Use ConvertToKeyValuePairs instead")] - Dictionary ConvertToDictionary(TRequest request) where TRequest : class; - - /// - /// Convert custom object to dictionary - /// - /// - /// Support classes, anonymous objects - /// - IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class; -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj deleted file mode 100644 index 2e0c7dfd8..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj deleted file mode 100644 index 9488b24bd..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Masa.Utils.Caller.Core.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs deleted file mode 100644 index 010163cb6..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller.Options; - -public class CallerFactoryOptions -{ - public readonly List Callers = new(); - - public JsonSerializerOptions? JsonSerializerOptions { get; set; } - - public string? RequestIdKey { get; set; } -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs deleted file mode 100644 index 63acc4048..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller.Options; - -public class CallerOptions -{ - public readonly List Callers = new(); - - public IServiceCollection Services { get; } - - private Assembly[] _assemblies = AppDomain.CurrentDomain.GetAssemblies(); - - public Assembly[] Assemblies - { - get => _assemblies; - set - { - ArgumentNullException.ThrowIfNull(value, nameof(Assemblies)); - - _assemblies = value; - } - } - - public ServiceLifetime CallerLifetime { get; set; } - - public JsonSerializerOptions? JsonSerializerOptions { get; set; } - - public string? RequestIdKey { get; set; } - - public CallerOptions(IServiceCollection services) - { - Services = services; - CallerLifetime = ServiceLifetime.Scoped; - } -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs deleted file mode 100644 index 9a5b101fa..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Caller.Options; - -public class CallerRelationOptions -{ - public string Name { get; } = default!; - - public bool IsDefault { get; } - - public Func Func { get; } = default!; - - public CallerRelationOptions(string name, bool isDefault, Func func) - { - Name = name; - IsDefault = isDefault; - Func = func; - } -} diff --git a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/_Imports.cs b/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/_Imports.cs deleted file mode 100644 index 7d22b6607..000000000 --- a/src/BuildingBlocks/Service/Caller/src/Masa.BuildingBlocks.Service.Caller/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Google.Protobuf; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Microsoft.Extensions.DependencyInjection; -global using System.Reflection; -global using System.Text.Json; diff --git a/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs b/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs deleted file mode 100644 index 7a159cc54..000000000 --- a/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.MinimalAPIs; - -public interface IService -{ - WebApplication App { get; } - - IServiceCollection Services { get; } - - TService? GetService(); - - TService GetRequiredService() where TService : notnull; -} diff --git a/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj b/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj deleted file mode 100644 index 1e1618a72..000000000 --- a/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs b/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs deleted file mode 100644 index aefd78f01..000000000 --- a/src/BuildingBlocks/Service/MinimalAPIs/src/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs b/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs deleted file mode 100644 index f9407964d..000000000 --- a/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Contracts; - -public class BaseMessage -{ - /// - /// Unique Identifier - /// - protected Guid _correlationId = Guid.NewGuid(); - - public Guid CorrelationId() => _correlationId; -} diff --git a/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs b/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs deleted file mode 100644 index d13057fe6..000000000 --- a/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Contracts; - -public abstract class BaseRequest : BaseMessage -{ -} diff --git a/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs b/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs deleted file mode 100644 index d901a1082..000000000 --- a/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Service.Contracts; - -public abstract class BaseResponse : BaseMessage -{ - public BaseResponse(Guid correlationId) : base() - { - base._correlationId = correlationId; - } - - public BaseResponse() - { - } -} - -public abstract class BaseResponse : BaseResponse -{ - public T? Data { get; set; } - - public BaseResponse(Guid correlationId) - : base(correlationId) - { - } - - public BaseResponse() - { - } -} diff --git a/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj b/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/BuildingBlocks/Service/Service/src/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs deleted file mode 100644 index 09dc7e961..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum GenderTypes -{ - Male = 1, - Female, -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs deleted file mode 100644 index 5662a2328..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum StaffTypes -{ - InternalStaff = 1, - ExternalStaff -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs deleted file mode 100644 index 9a51a0fda..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum SubjectTypes -{ - User = 1, - Department, - Role, - Team, -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs deleted file mode 100644 index dc6cc09df..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; - -public enum TeamTypes -{ - Normal = 1 -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs deleted file mode 100644 index 03b2b2516..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class AddUserModel -{ - public string Account { get; set; } - - public string Name { get; set; } - - public string? DisplayName { get; set; } - - public string? IdCard { get; set; } - - public string? CompanyName { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } - - public string? Password { get; set; } - - public GenderTypes Gender { get; set; } - - public AddUserModel() - { - Account = ""; - Name = ""; - } - - public AddUserModel(string account, string name) - { - Account = account; - Name = name; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs deleted file mode 100644 index 1b94a7c70..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class AddressValueModel -{ - public string Address { get; set; } - - public string? ProvinceCode { get; set; } - - public string? CityCode { get; set; } - - public string? DistrictCode { get; set; } - - public AddressValueModel() - { - Address = ""; - } - - public AddressValueModel(string address, string? provinceCode, string? cityCode, string? districtCode) - { - Address = address; - ProvinceCode = provinceCode; - CityCode = cityCode; - DistrictCode = districtCode; - } - - public override string ToString() - { - return Address; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs deleted file mode 100644 index 6d15c2b6a..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class AppModel -{ - public int Id { get; set; } - - public string Name { get; set; } = string.Empty; - - public string Identity { get; set; } = string.Empty; - - public string Tag { get; set; } = string.Empty; - - public int ProjectId { get; set; } - - public List Navs { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs deleted file mode 100644 index 486dcac30..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class CollectMenuModel -{ - public Guid Value { get; set; } - - public string Text { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs deleted file mode 100644 index 188ab7033..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class DisableUserModel -{ - public string Account { get; set; } - - public DisableUserModel(string account) - { - Account = account; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs deleted file mode 100644 index 5c6975e30..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class MenuModel -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - public string Code { get; set; } - - public string Icon { get; set; } - - public string Url { get; set; } - - public List Children { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs deleted file mode 100644 index 911fca3c1..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class NavModel -{ - public string Code { get; set; } = string.Empty; - - public string Name { get; set; } = string.Empty; - - public string Icon { get; set; } = string.Empty; - - public string Url { get; set; } = string.Empty; - - public List Children { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs deleted file mode 100644 index 08dda6f4f..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class ProjectModel -{ - public int Id { get; set; } - - public string Name { get; set; } = string.Empty; - - public string Identity { get; set; } = string.Empty; - - public List Apps { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs deleted file mode 100644 index 8b35cee28..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class RoleModel -{ - public Guid Id { get; set; } - - public string Name { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs deleted file mode 100644 index 84203a467..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class StaffDetailModel: StaffModel -{ - public List Roles { get; set; } - - public List Teams { get; set; } - - public DateTime CreationTime { get; set; } - - public DateTime ModificationTime { get; set; } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs deleted file mode 100644 index f55e215ae..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class StaffModel -{ - public Guid Id { get; set; } - - public Guid UserId { get; set; } - - public string Department { get; set; } = ""; - - public string Position { get; set; } = ""; - - public string JobNumber { get; set; } = ""; - - public StaffTypes StaffType { get; set; } - - public string Name { get; set; } = ""; - - public string DisplayName { get; set; } = ""; - - public string Avatar { get; set; } = ""; - - public string IdCard { get; set; } = ""; - - public string Account { get; set; } = ""; - - public string CompanyName { get; set; } = ""; - - public string PhoneNumber { get; set; } = ""; - - public string Email { get; set; } = ""; - - public AddressValueModel Address { get; set; } = new(); - - public GenderTypes Gender { get; set; } - - public StaffModel() - { - } - - public StaffModel( - Guid id, - Guid userId, - string department, - string position, - string jobNumber, - StaffTypes staffType, - string name, - string displayName, - string avatar, - string idCard, - string account, - string companyName, - string phoneNumber, - string email, - AddressValueModel address, - GenderTypes gender) - { - Id = id; - UserId = userId; - Department = department; - Position = position; - JobNumber = jobNumber; - StaffType = staffType; - Name = name; - DisplayName = displayName; - Avatar = avatar; - IdCard = idCard; - Account = account; - CompanyName = companyName; - PhoneNumber = phoneNumber; - Email = email; - Address = address; - Gender = gender; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs deleted file mode 100644 index a21a3c131..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class SubjectModel -{ - public Guid SubjectId { get; set; } - - public string Name { get; set; } - - public string? DisplayName { get; set; } - - public string? Avatar { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } - - public SubjectTypes SubjectType { get; set; } - - public SubjectModel() - { - Name = ""; - } - - public SubjectModel( - Guid subjectId, - string name, - string? displayName, - string? avatar, - string? phoneNumber, - string? email, - SubjectTypes subjectType) - { - SubjectId = subjectId; - Name = name; - DisplayName = displayName; - Avatar = avatar; - PhoneNumber = phoneNumber; - Email = email; - SubjectType = subjectType; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs deleted file mode 100644 index a4ba3acdc..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class TeamDetailModel -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - public string Avatar { get; set; } - - public string Description { get; set; } - - public TeamTypes TeamType { get; set; } - - public List Admins { get; set; } - - public List Members { get; set; } - - public TeamDetailModel() - { - Name = ""; - Avatar = ""; - Description = ""; - Admins = new(); - Members = new(); - } - - public TeamDetailModel( - Guid id, - string name, - string avatar, - string description, - TeamTypes teamType, - List admins, - List members) - { - Id = id; - Name = name; - Avatar = avatar; - Description = description; - TeamType = teamType; - Admins = admins; - Members = members; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs deleted file mode 100644 index 2c5832153..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class TeamModel -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - public string Avatar { get; set; } - - public string Description { get; set; } - - public string Role { get; set; } - - public int MemberCount { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs deleted file mode 100644 index c955b46a6..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class TeamPersonnelModel -{ - public string Name { get; set; } - - public string? DisplayName { get; set; } - - public string Avatar { get; set; } - - public string Account { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs deleted file mode 100644 index d84c75367..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateUserBasicInfoModel -{ - public Guid Id { get; set; } - - public string DisplayName { get; set; } = ""; - - public string Avatar { get; set; } = ""; - - public string PhoneNumber { get; set; } = ""; - - public string Email { get; set; } = ""; - - public GenderTypes Gender { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs deleted file mode 100644 index c5e164269..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpdateUserPasswordModel -{ - public Guid Id { get; set; } - - public string OldPassword { get; set; } = ""; - - public string NewPassword { get; set; } = ""; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs deleted file mode 100644 index 52bbad87e..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UpsertUserModel -{ - public Guid Id { get; set; } - - public string Account { get; set; } - - public string Name { get; set; } - - public string? DisplayName { get; set; } - - public string? IdCard { get; set; } - - public string? CompanyName { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } - - public GenderTypes Gender { get; set; } - - public UpsertUserModel() - { - Account = ""; - Name = ""; - } - - public UpsertUserModel(string account, string name) - { - Account = account; - Name = name; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs deleted file mode 100644 index c6da02b56..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserModel -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - public string? DisplayName { get; set; } - - public string Account { get; set; } - - public GenderTypes Gender { get; set; } - - public string Avatar { get; set; } - - public string? IdCard { get; set; } - - public string? PhoneNumber { get; set; } - - public string? Email { get; set; } - - public string? CompanyName { get; set; } - - public string? Department { get; set; } - - public string? Position { get; set; } - - public AddressValueModel Address { get; set; } = new(); - - public List Roles { get; set; } = new(); - - public UserModel() - { - Name = ""; - Avatar = ""; - Account = ""; - } - - public UserModel( - Guid id, - string name, - string? displayName, - string account, - GenderTypes gender, - string avatar, - string? idCard, - string? phoneNumber, - string? email, - string? companyName, - string? department, - string? position, - AddressValueModel address) - { - Id = id; - Name = name; - DisplayName = displayName; - Account = account; - Gender = gender; - Avatar = avatar; - IdCard = idCard; - PhoneNumber = phoneNumber; - Email = email; - CompanyName = companyName; - Department = department; - Position = position; - Address = address; - } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs deleted file mode 100644 index df76bc966..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserPortraitModel -{ - public Guid Id { get; set; } - - public string Account { get; set; } - - public string Name { get; set; } - - public string DisplayName { get; set; } - - public string Avatar { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs deleted file mode 100644 index 14cbe1c49..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserSimpleModel -{ - public Guid Id { get; set; } - - public string Account { get; set; } - - public string? DisplayName { get; set; } - - public UserSimpleModel(Guid id, string account, string? displayName) - { - Id = id; - Account = account; - DisplayName = displayName; - } -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs deleted file mode 100644 index 6e3e02a8f..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; - -public class UserVisitedModel -{ - public string Name { get; set; } = string.Empty; - - public string Url { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs deleted file mode 100644 index 069e32609..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs deleted file mode 100644 index 656dddcd4..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth; - -public interface IAuthClient -{ - IUserService UserService { get; } - - ISubjectService SubjectService { get; } - - ITeamService TeamService { get; } - - IPermissionService PermissionService { get; } - - IProjectService ProjectService { get; } -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs deleted file mode 100644 index 6c6f22319..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth; - -public interface IEnvironmentProvider -{ - string GetEnvironment(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj deleted file mode 100644 index 7ae248f00..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs deleted file mode 100644 index 8ccb4d687..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface IPermissionService -{ - /// - /// Get menus for the appid with current user - /// - /// - /// - Task> GetMenusAsync(string appId); - - /// - /// Get element permissions for the appid with current user - /// - /// - /// - Task> GetElementPermissionsAsync(string appId); - - Task AuthorizedAsync(string appId, string code); - - Task AddFavoriteMenuAsync(Guid menuId); - - Task RemoveFavoriteMenuAsync(Guid menuId); - - Task> GetFavoriteMenuListAsync(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs deleted file mode 100644 index 3b1157237..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface IProjectService -{ - Task> GetGlobalNavigations(); -} diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs deleted file mode 100644 index 3eb636495..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface ISubjectService -{ - Task> GetListAsync(string filter); -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs deleted file mode 100644 index a8c0b74d5..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface ITeamService -{ - Task GetDetailAsync(Guid id); - - Task> GetAllAsync(); - - Task> GetUserTeamsAsync(); -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs deleted file mode 100644 index 2d8074789..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Auth.Service; - -public interface IUserService -{ - Task> GetListByTeamAsync(Guid teamId); - - Task> GetListByRoleAsync(Guid roleId); - - Task> GetListByDepartmentAsync(Guid departmentId); - - Task GetTotalByDepartmentAsync(Guid departmentId); - - Task GetTotalByRoleAsync(Guid roleId); - - Task GetTotalByTeamAsync(Guid teamId); - - Task AddAsync(AddUserModel user); - - Task UpsertAsync(UpsertUserModel user); - - Task ValidateCredentialsByAccountAsync(string account, string password, bool isLdap = false); - - Task FindByAccountAsync(string account); - - Task FindByPhoneNumberAsync(string phoneNumber); - - Task FindByEmailAsync(string email); - - Task GetCurrentUserAsync(); - - Task GetCurrentStaffAsync(); - - Task VisitedAsync(string url); - - Task> GetVisitedListAsync(); - - Task UpdatePasswordAsync(UpdateUserPasswordModel user); - - Task UpdateBasicInfoAsync(UpdateUserBasicInfoModel user); - - Task> GetUserPortraitsAsync(params Guid[] userIds); - - Task SaveUserSystemDataAsync(string systemId, T data); - - Task GetUserSystemDataAsync(string systemId); - - Task DisableUserAsync(DisableUserModel user); -} - diff --git a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs b/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs deleted file mode 100644 index a3ed35b1a..000000000 --- a/src/BuildingBlocks/StackSdks/Auth/src/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; -global using Masa.BuildingBlocks.StackSdks.Auth.Service; diff --git a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs deleted file mode 100644 index e1d7971f0..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Dcc; - -public interface IDccClient -{ - public ILabelService LabelService { get; } -} diff --git a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs deleted file mode 100644 index 1be05ebc4..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Dcc.Model -{ - public class LabelModel - { - public int Id { get; set; } - - public string Code { get; set; } = ""; - - public string Name { get; set; } = ""; - - public string TypeCode { get; set; } = ""; - - public string TypeName { get; set; } = ""; - - public string Description { get; set; } = ""; - } -} diff --git a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs deleted file mode 100644 index 0d4c1417a..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Dcc.Service; - -public interface ILabelService -{ - Task> GetListByTypeCodeAsync(string typeCode); -} diff --git a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs b/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs deleted file mode 100644 index 328df80c1..000000000 --- a/src/BuildingBlocks/StackSdks/Dcc/src/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Dcc.Model; -global using Masa.BuildingBlocks.StackSdks.Dcc.Service; diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs deleted file mode 100644 index 7be436d31..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum ChannelTypes -{ - Sms = 1, - Email, - WebsiteMessage -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs deleted file mode 100644 index babf49792..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTaskReceiverTypes -{ - User = 1, - Organization, - Role, - Team, - Group -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs deleted file mode 100644 index e8c70f610..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTaskSelectReceiverTypes -{ - ManualSelection = 1, - BatchUpload -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs deleted file mode 100644 index 3133a88eb..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTaskSources -{ - Management = 1, - Sdk, -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs deleted file mode 100644 index a02130d88..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTaskStatuses -{ - NotPublished = 1, - InProgress, - Cancel, - Published, - PublishedFailed, - PartialFailed -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs deleted file mode 100644 index 66b7abbd2..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTemplateAuditStatuses -{ - Waited = 1, - Approved, - Failed, -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs deleted file mode 100644 index 412def79e..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTemplateStates -{ - Normal = 1, - Invalid -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs deleted file mode 100644 index 4d49430d7..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum MessageTypes -{ - Ordinary = 1, - Template -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs deleted file mode 100644 index da0924f5a..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum ReceiverGroupItemTypes -{ - User = 1, - Organization, - Role, - Team -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs deleted file mode 100644 index bb3015eba..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum SendTargets -{ - Assign = 1, - Broadcast -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs deleted file mode 100644 index a50c75583..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; - -public enum WebsiteMessageFilterType -{ - Title = 1, - Content, -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs deleted file mode 100644 index 935e624f5..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc; - -public interface IMcClient -{ - IChannelService ChannelService { get; } - - IMessageTaskService MessageTaskService { get; } - - IMessageTemplateService MessageTemplateService { get; } - - IReceiverGroupService ReceiverGroupService { get; } - - IWebsiteMessageService WebsiteMessageService { get; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs deleted file mode 100644 index b8ff3d9be..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System.Collections.Concurrent; - -[Serializable] -public class ExtraPropertyDictionary : ConcurrentDictionary -{ - public ExtraPropertyDictionary() - { - - } - - public ExtraPropertyDictionary(IDictionary dictionary) - : base(dictionary) - { - } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj deleted file mode 100644 index c2e00e18e..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs deleted file mode 100644 index 9b4217c7a..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class AuditEntityModel : EntityModel -{ - public TUserId Creator { get; set; } = default!; - - public DateTime CreationTime { get; set; } - - public TUserId Modifier { get; set; } = default!; - - public DateTime ModificationTime { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs deleted file mode 100644 index f1ba0051e..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ChannelModel : AuditEntityModel -{ - public string DisplayName { get; set; } = string.Empty; - - public string Code { get; set; } = string.Empty; - - public ChannelTypes Type { get; set; } - - public string Description { get; set; } = string.Empty; - - public string Color { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs deleted file mode 100644 index ebb8df3e6..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class EntityModel -{ - public TKey Id { get; set; } = default!; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs deleted file mode 100644 index cf32ef960..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetChannelModel : PaginatedOptions -{ - public string Filter { get; set; } = string.Empty; - - public ChannelTypes? Type { get; set; } - - public string DisplayName { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs deleted file mode 100644 index d783dcc1d..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetMessageTemplateModel : PaginatedOptions -{ - public string Filter { get; set; } = string.Empty; - - public MessageTemplateStates? Status { get; set; } - - public MessageTemplateAuditStatuses? AuditStatus { get; set; } - - public ChannelTypes? ChannelType { get; set; } - - public Guid? ChannelId { get; set; } - - public DateTime? StartTime { get; set; } - - public DateTime? EndTime { get; set; } - - public int TemplateType { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs deleted file mode 100644 index bfed7b35f..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetNoticeListModel -{ - public int PageSize { get; set; } = 5; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs deleted file mode 100644 index 06af3f7c0..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetReceiverGroupModel : PaginatedOptions -{ - public string Filter { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs deleted file mode 100644 index 1175ddb2e..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class GetWebsiteMessageModel : PaginatedOptionsModel -{ - public string Filter { get; set; } = string.Empty; - - public WebsiteMessageFilterType? FilterType { get; set; } - - public Guid? ChannelId { get; set; } - - public bool? IsRead { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs deleted file mode 100644 index f56dcd142..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageInfoModel -{ - public string Title { get; set; } = string.Empty; - - public string Content { get; set; } = string.Empty; - - public string Markdown { get; set; } = string.Empty; - - public bool IsJump { get; set; } - - public string JumpUrl { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs deleted file mode 100644 index 6fc0daec8..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageInfoUpsertModel -{ - public string Title { get; set; } = string.Empty; - - public string Content { get; set; } = string.Empty; - - public string Markdown { get; set; } = string.Empty; - - public bool IsJump { get; set; } - - public string JumpUrl { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs deleted file mode 100644 index 61f43e012..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageTaskModel : AuditEntityModel -{ - public string DisplayName { get; set; } = string.Empty; - - public Guid ChannelId { get; set; } - - public ChannelModel Channel { get; set; } = new(); - - public MessageTypes EntityType { get; set; } - - public Guid EntityId { get; set; } - - public bool IsDraft { get; set; } - - public bool IsEnabled { get; set; } - - public SendTargets ReceiverType { get; set; } - - public MessageTaskSelectReceiverTypes SelectReceiverType { get; set; } - - public DateTimeOffset? SendTime { get; set; } - - public string Sign { get; set; } = string.Empty; - - public MessageInfoModel MessageInfo { get; set; } = new(); - - public List Receivers { get; set; } = new(); - - public SendRuleModel SendRules { get; set; } = new(); - - public ExtraPropertyDictionary Variables { get; set; } = new(); - - public string Content { get; set; } = string.Empty; - - public MessageTaskStatuses Status { get; set; } - - public MessageTaskSources Source { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs deleted file mode 100644 index 587696efd..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageTaskReceiverModel -{ - public Guid SubjectId { get; set; } - - public string DisplayName { get; set; } = string.Empty; - - public string Avatar { get; set; } = string.Empty; - - public string PhoneNumber { get; set; } = string.Empty; - - public string Email { get; set; } = string.Empty; - - public MessageTaskReceiverTypes Type { get; set; } - - public ExtraPropertyDictionary Variables { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs deleted file mode 100644 index acec18d51..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageTemplateItemModel -{ - public string Code { get; set; } = string.Empty; - - public string MappingCode { get; set; } = string.Empty; - - public string DisplayText { get; set; } = string.Empty; - - public string Description { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs deleted file mode 100644 index a724c8ca7..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class MessageTemplateModel : AuditEntityModel -{ - public Guid ChannelId { get; set; } - - public string DisplayName { get; set; } = string.Empty; - - public string Title { get; set; } = string.Empty; - - public string Content { get; set; } = string.Empty; - - public string Markdown { get; set; } = string.Empty; - - public string TemplateId { get; set; } = string.Empty; - - public bool IsJump { get; set; } - - public string JumpUrl { get; set; } = string.Empty; - - public string Sign { get; set; } = string.Empty; - - public MessageTemplateStates Status { get; set; } - - public MessageTemplateAuditStatuses AuditStatus { get; set; } - - public DateTimeOffset? AuditTime { get; set; } - - public DateTimeOffset? InvalidTime { get; set; } - - public string AuditReason { get; set; } = string.Empty; - - public int TemplateType { get; set; } - - public string TemplateTypeDisplayName { get; set; } - - public long PerDayLimit { get; set; } - - public bool IsStatic { get; set; } - - public List Items { get; set; } - - public MessageTemplateModel() - { - this.Items = new List(); - } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs deleted file mode 100644 index 8793915f2..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class PaginatedListModel -{ - public long Total { get; set; } - - public int TotalPages { get; set; } - - public List Result { get; set; } = default!; - - public PaginatedListModel() - { - Result = new List(); - } - - public PaginatedListModel(long total, int totalPages, List result) - { - Total = total; - TotalPages = totalPages; - Result = result; - } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs deleted file mode 100644 index 1846fc3d8..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class PaginatedOptionsModel -{ - public int Page { get; set; } = 1; - - public int PageSize { get; set; } = 10; - - public string Sorting { get; set; } - - public PaginatedOptionsModel(string sorting = "", int page = 1, int pageSize = 10) - { - Sorting = sorting; - Page = page; - PageSize = pageSize; - } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs deleted file mode 100644 index bbd431360..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ReadAllWebsiteMessageModel : GetWebsiteMessageModel -{ -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs deleted file mode 100644 index 69aaa8191..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ReadWebsiteMessageModel -{ - public Guid Id { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs deleted file mode 100644 index ab3a27b65..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ReceiverGroupItemModel -{ - public Guid GroupId { get; set; } - - public ReceiverGroupItemTypes Type { get; set; } - - public Guid SubjectId { get; set; } - - public string DisplayName { get; set; } = string.Empty; - - public string Avatar { get; set; } = string.Empty; - - public string PhoneNumber { get; set; } = string.Empty; - - public string Email { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs deleted file mode 100644 index 9af8a9f07..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class ReceiverGroupModel : AuditEntityModel -{ - public string DisplayName { get; set; } = string.Empty; - - public string Description { get; set; } = string.Empty; - - public List Items { get; set; } = new(); - - public string ModifierName { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs deleted file mode 100644 index 2fbdb54e3..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class SendOrdinaryMessageModel -{ - public string ChannelCode { get; set; } = string.Empty; - - public ChannelTypes? ChannelType { get; set; } - - public SendTargets ReceiverType { get; set; } - - public List Receivers { get; set; } = new(); - - public SendRuleModel SendRules { get; set; } = new(); - - public MessageInfoUpsertModel MessageInfo { get; set; } = new(); - - public ExtraPropertyDictionary Variables { get; set; } = new(); - - public Guid OperatorId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs deleted file mode 100644 index 6a02b1a0c..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class SendRuleModel -{ - public bool IsCustom { get; set; } - - public string CronExpression { get; set; } = string.Empty; - - public long SendingCount { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs deleted file mode 100644 index 08cb07f3b..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class SendTemplateMessageModel -{ - public string ChannelCode { get; set; } = string.Empty; - - public ChannelTypes? ChannelType { get; set; } - - public string TemplateCode { get; set; } = string.Empty; - - public SendTargets ReceiverType { get; set; } - - public string Sign { get; set; } = string.Empty; - - public List Receivers { get; set; } = new(); - - public SendRuleModel SendRules { get; set; } = new(); - - public ExtraPropertyDictionary Variables { get; set; } = new(); - - public Guid OperatorId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs deleted file mode 100644 index 4d7cf3711..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class WebsiteMessageChannelModel : WebsiteMessageModel -{ - public long NoReading { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs deleted file mode 100644 index efeceb5c0..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Model; - -public class WebsiteMessageModel : AuditEntityModel -{ - public Guid ChannelId { get; set; } - - public ChannelModel Channel { get; set; } = default!; - - public Guid UserId { get; set; } - - public string Title { get; set; } = string.Empty; - - public string Content { get; set; } = string.Empty; - - public string LinkUrl { get; set; } = string.Empty; - - public DateTimeOffset SendTime { get; set; } - - public bool IsRead { get; set; } - - public DateTimeOffset? ReadTime { get; set; } - - public string Abstract { get; set; } = string.Empty; - - public Guid PrevId { get; set; } - - public Guid NextId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs deleted file mode 100644 index f13b62319..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IChannelService -{ - Task GetAsync(Guid id); - - Task> GetListAsync(GetChannelModel options); -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs deleted file mode 100644 index e19aded92..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IMessageTaskService -{ - Task GetAsync(Guid id); - - Task SendTemplateMessageAsync(SendTemplateMessageModel options); - - Task SendOrdinaryMessageAsync(SendOrdinaryMessageModel options); -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs deleted file mode 100644 index a72efd7ee..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IMessageTemplateService -{ - Task GetAsync(Guid id); - - Task> GetListAsync(GetMessageTemplateModel options); -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs deleted file mode 100644 index 784e10b8d..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IReceiverGroupService -{ - Task GetAsync(Guid id); - - Task> GetListAsync(GetReceiverGroupModel inputDto); -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs deleted file mode 100644 index d7030a6fc..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Mc.Service; - -public interface IWebsiteMessageService -{ - Task> GetListAsync(GetWebsiteMessageModel options); - - Task GetAsync(Guid id); - - Task> GetChannelListAsync(); - - Task SetAllReadAsync(ReadAllWebsiteMessageModel options); - - Task DeleteAsync(Guid id); - - Task ReadAsync(ReadWebsiteMessageModel options); - - Task CheckAsync(); - - Task> GetNoticeListAsync(GetNoticeListModel options); - - Task SendCheckNotificationAsync(); - - Task SendGetNotificationAsync(List userIds); -} diff --git a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs b/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs deleted file mode 100644 index e2152a3c0..000000000 --- a/src/BuildingBlocks/StackSdks/Mc/src/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Mc.Enum; -global using Masa.BuildingBlocks.StackSdks.Mc.Model; -global using Masa.BuildingBlocks.StackSdks.Mc.Service; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs deleted file mode 100644 index 61c8a96b2..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Enum; - -public enum AppTypes -{ - [Description("Service")] - Service = 1, - - [Description("UI")] - UI, - - [Description("Job")] - Job -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs deleted file mode 100644 index 6d38f766f..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Enum; - -public enum ServiceTypes -{ - [Description("Dapr")] - Dapr = 1, - - [Description("Web Api")] - WebApi -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs deleted file mode 100644 index 76d8c48a9..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Service; - -namespace Masa.BuildingBlocks.StackSdks.Pm; - -public interface IPmClient -{ - public IEnvironmentService EnvironmentService { get; init; } - - public IClusterService ClusterService { get; init; } - - public IProjectService ProjectService { get; init; } - - public IAppService AppService { get; init; } -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs deleted file mode 100644 index 5aa26698c..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class AppDetailModel : BaseModel -{ - public int ProjectId { get; set; } - - public int Id { get; set; } - - public string Name { get; set; } = ""; - - public string Identity { get; set; } = ""; - - public string Description { get; set; } = ""; - - public AppTypes Type { get; set; } - - public ServiceTypes ServiceType { get; set; } - - public string Url { get; set; } = ""; - - public string SwaggerUrl { get; set; } = ""; - - public List EnvironmentClusters { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs deleted file mode 100644 index b364aaa64..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Enum; - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class AppModel -{ - public int Id { get; set; } - - public string Name { get; set; } - - public string Identity { get; set; } - - public int ProjectId { get; set; } - - public AppTypes Type { get; set; } - - public AppModel() - { - } - - public AppModel(int id, string name, string identity, int projectId) - { - Id = id; - Name = name; - Identity = identity; - ProjectId = projectId; - } -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs deleted file mode 100644 index 07ad7a895..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class BaseModel -{ - public Guid Creator { get; set; } - - public DateTime CreationTime { get; set; } - - public Guid Modifier { get; set; } - - public DateTime ModificationTime { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs deleted file mode 100644 index 41fc6b4e4..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ClusterDetailModel : BaseModel -{ - public int Id { get; set; } - - public string Name { get; set; } = default!; - - public string Description { get; set; } = ""; - - public List EnvironmentIds { get; set; } = new(); -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs deleted file mode 100644 index 6a1b19dbe..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ClusterModel -{ - public int Id { get; set; } - - public string Name { get; set; } = default!; - - public int EnvironmentClusterId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs deleted file mode 100644 index ee1916645..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class EnvironmentClusterModel -{ - public int Id { get; set; } - - public string EnvironmentName { get; set; } = ""; - - public string EnvironmentColor { get; set; } = ""; - - public string ClusterName { get; set; } = ""; - - public string EnvironmentClusterName - { - get - { - return $"{EnvironmentName}/{ClusterName}"; - } - } -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs deleted file mode 100644 index 32c517967..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class EnvironmentDetailModel : BaseModel -{ - public int Id { get; set; } - - public string Name { get; set; } = default!; - - public string Description { get; set; } = ""; - - public string Color { get; set; } = ""; - - public List ClusterIds { get; set; } = default!; -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs deleted file mode 100644 index c939ab264..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class EnvironmentModel -{ - public int Id { get; set; } - - public string Name { get; set; } = ""; - - public string Color { get; set; } = ""; -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs deleted file mode 100644 index 0ce6b7eb6..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ProjectAppsModel -{ - public int Id { get; set; } - - public string Identity { get; set; } - - public string Name { get; set; } - - public string LabelCode { get; set; } - - public Guid TeamId { get; set; } - - public List Apps { get; set; } = new(); - - public ProjectAppsModel(int id, string identity, string name, string labelCode, Guid teamId) - { - Id = id; - Identity = identity; - Name = name; - LabelCode = labelCode; - TeamId = teamId; - } -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs deleted file mode 100644 index 50a80f1de..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ProjectDetailModel : BaseModel -{ - public int Id { get; set; } - - public string Identity { get; set; } = ""; - - public string LabelCode { get; set; } - - public string Name { get; set; } = ""; - - public string Description { get; set; } = ""; - - public Guid TeamId { get; set; } - - public List EnvironmentClusterIds { get; set; } = new List(); -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs deleted file mode 100644 index 49368da25..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ProjectModel -{ - public int Id { get; set; } - - public string Identity { get; set; } = ""; - - public string Name { get; set; } = ""; - - public string Description { get; set; } = ""; - - public string LabelCode { get; set; } = ""; - - public string LabelName { get; set; } = ""; - - public Guid Modifier { get; set; } - - public DateTime ModificationTime { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs deleted file mode 100644 index b8751e6b8..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Pm.Model; - -public class ProjectTypeModel -{ - public int Id { get; set; } - - public string Name { get; set; } = ""; -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs deleted file mode 100644 index 122c00bc2..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; - -namespace Masa.BuildingBlocks.StackSdks.Pm.Service; - -public interface IAppService -{ - Task> GetListAsync(); - - Task> GetListByProjectIdsAsync(List projectIds); - - Task GetWithEnvironmentClusterAsync(int Id); - - Task GetAsync(int Id); - - Task GetByIdentityAsync(string identity); -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs deleted file mode 100644 index 01bc8cbe1..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; - -namespace Masa.BuildingBlocks.StackSdks.Pm.Service; - -public interface IClusterService -{ - Task> GetListAsync(); - - Task> GetListByEnvIdAsync(int envId); - - Task GetAsync(int Id); - - Task> GetEnvironmentClustersAsync(); -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs deleted file mode 100644 index c6ed3a684..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; - -namespace Masa.BuildingBlocks.StackSdks.Pm.Service; - -public interface IEnvironmentService -{ - Task> GetListAsync(); - - Task GetAsync(int Id); -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs deleted file mode 100644 index 464a7ca6b..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; - -namespace Masa.BuildingBlocks.StackSdks.Pm.Service; - -public interface IProjectService -{ - Task> GetProjectAppsAsync(string envName); - - Task> GetListByEnvironmentClusterIdAsync(int envClusterId); - - Task> GetListByTeamIdsAsync(List teamIds); - - Task GetAsync(int id); - - Task GetByIdentityAsync(string identity); - - Task> GetProjectTypesAsync(); -} diff --git a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs b/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs deleted file mode 100644 index 4b1a5eaaa..000000000 --- a/src/BuildingBlocks/StackSdks/Pm/src/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Pm.Enum; -global using Masa.BuildingBlocks.StackSdks.Pm.Model; -global using Masa.BuildingBlocks.StackSdks.Pm.Service; -global using System.ComponentModel; diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs deleted file mode 100644 index 7263de700..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum HttpMethods -{ - GET = 1, - POST, - HEAD, - PUT, - DELETE -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs deleted file mode 100644 index c7213212b..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum HttpVerifyTypes -{ - StatusCode200 = 1, - CustomStatusCode, - ContentContains, - ContentUnContains, -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs deleted file mode 100644 index e0a928ea7..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum JobTypes -{ - JobApp = 1, - Http, - DaprServiceInvocation -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs deleted file mode 100644 index 8df0a446a..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum RunTimeoutStrategyTypes -{ - RunFailedStrategy = 1, - IgnoreTimeout -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs deleted file mode 100644 index d9bd4f523..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum ScheduleBlockStrategyTypes -{ - Serial = 1, - Parallel, - Discard, - Cover -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs deleted file mode 100644 index a406828e8..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; - -public enum ScheduleExpiredStrategyTypes -{ - ExecuteImmediately = 1, - AutoCompensation, - Ignore -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs deleted file mode 100644 index 744e46613..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler; - -public interface ISchedulerClient -{ - ISchedulerJobService SchedulerJobService { get; } - - ISchedulerTaskService SchedulerTaskService { get; } -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs deleted file mode 100644 index 4e9bafa62..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler; - -public interface ISchedulerJob -{ - Task BeforeExcuteAsync(JobContext context); - - Task ExcuteAsync(JobContext context); - - Task AfterExcuteAsync(JobContext context); -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs deleted file mode 100644 index 89d51ab50..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; - -public class JobContext -{ - public Guid JobId { get; set; } - - public Guid TaskId { get; set; } - - public DateTimeOffset ExecutionTime { get; set; } - - public string ExcuteClassName { get; set; } = string.Empty; - - public List ExcuteParameters { get; set; } = new(); - - public object? ExcuteResult { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs deleted file mode 100644 index 890aa16d8..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; - -public class SchedulerJobAppConfig -{ - public string JobAppIdentity { get; set; } = string.Empty; - - public string JobEntryAssembly { get; set; } = string.Empty; - - public string JobEntryClassName { get; set; } = string.Empty; - - public string JobParams { get; set; } = string.Empty; - - public string Version { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs deleted file mode 100644 index ab5feef95..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; - -public class SchedulerJobDaprServiceInvocationConfig -{ - public string MethodName { get; set; } = string.Empty; - - public HttpMethods HttpMethod { get; set; } - - public string Data { get; set; } = string.Empty; - - public string DaprServiceIdentity { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs deleted file mode 100644 index bebb18f00..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; - -public class SchedulerJobHttpConfig -{ - public HttpMethods HttpMethod { get; set; } - - public string RequestUrl { get; set; } = string.Empty; - - public List> HttpParameters { get; set; } = new(); - - public List> HttpHeaders { get; set; } = new(); - - public string HttpBody { get; set; } = string.Empty; - - public HttpVerifyTypes HttpVerifyType { get; set; } - - public string VerifyContent { get; set; } = string.Empty; -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs deleted file mode 100644 index 1ba5c2afd..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class AddSchedulerJobRequest -{ - public string ProjectIdentity { get; set; } = string.Empty; - - public string Name { get; set; } = string.Empty; - - public bool IsAlertException { get; set; } - - public JobTypes JobType { get; set; } - - public Guid OperatorId { get; set; } - - public string CronExpression { get; set; } = string.Empty; - - public string Description { get; set; } = string.Empty; - - /// - /// Default Ignore - /// - public ScheduleExpiredStrategyTypes ScheduleExpiredStrategy { get; set; } = ScheduleExpiredStrategyTypes.Ignore; - - /// - /// Default Parallel - /// - public ScheduleBlockStrategyTypes ScheduleBlockStrategy { get; set; } = ScheduleBlockStrategyTypes.Serial; - - /// - /// Default IgnoreTimeout - /// - public RunTimeoutStrategyTypes RunTimeoutStrategy { get; set; } = RunTimeoutStrategyTypes.IgnoreTimeout; - - public int RunTimeoutSecond { get; set; } - - public int FailedRetryInterval { get; set; } - - public int FailedRetryCount { get; set; } - - public SchedulerJobAppConfig? JobAppConfig { get; set; } - - public SchedulerJobHttpConfig? HttpConfig { get; set; } - - public SchedulerJobDaprServiceInvocationConfig? DaprServiceInvocationConfig { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs deleted file mode 100644 index 9a7997211..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class BaseSchedulerJobRequest -{ - public Guid JobId { get; set; } - - public Guid OperatorId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs deleted file mode 100644 index 16e1a1287..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class BaseSchedulerTaskRequest -{ - public Guid TaskId { get; set; } - - public Guid OperatorId { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs deleted file mode 100644 index 550257661..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class ChangeEnabledStatusRequest : BaseSchedulerJobRequest -{ - public bool Enabled { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs deleted file mode 100644 index 9699187ab..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; - -public class StartSchedulerTaskRequest : BaseSchedulerTaskRequest -{ - public bool IsManual { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs deleted file mode 100644 index fd7d7bc3f..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Service; - -public interface ISchedulerJobService -{ - Task AddAsync(AddSchedulerJobRequest job); - - Task StartAsync(BaseSchedulerJobRequest request); - - Task RemoveAsync(BaseSchedulerJobRequest request); - - Task EnableAsync(BaseSchedulerJobRequest request); - - Task DisableAsync(BaseSchedulerJobRequest request); -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs deleted file mode 100644 index 524d0b4da..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Scheduler.Service; - -public interface ISchedulerTaskService -{ - Task StopAsync(BaseSchedulerTaskRequest request); - - Task StartAsync(BaseSchedulerTaskRequest request); -} diff --git a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs b/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs deleted file mode 100644 index 54eafd273..000000000 --- a/src/BuildingBlocks/StackSdks/Scheduler/src/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; -global using Masa.BuildingBlocks.StackSdks.Scheduler.Model; -global using Masa.BuildingBlocks.StackSdks.Scheduler.Request; -global using Masa.BuildingBlocks.StackSdks.Scheduler.Service; diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs deleted file mode 100644 index f4eaa89d3..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Enums; - -public enum AggregationTypes -{ - Count = 1, - Sum, - Avg -} diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs deleted file mode 100644 index 20c08dd9a..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc; - -public interface ITscClient -{ - public ILogService LogService { get; } - - public IMetricService MetricService { get; } -} diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs deleted file mode 100644 index b74a374dc..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; - -public class FieldAggregationRequest -{ - public string Name { get; set; } - - public string Alias { get; set; } - - public AggregationTypes AggregationType { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs deleted file mode 100644 index 5fe6fae08..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; - -public class LogAggregationRequest -{ - public IEnumerable FieldMaps { get; set; } - - public string Query { get; set; } - - public DateTime Start { get; set; } - - public DateTime End { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs deleted file mode 100644 index 0e2020489..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; - -public class LogLatestRequest -{ - public string Query { get; set; } - - public DateTime Start { get; set; } - - public DateTime End { get; set; } - - public bool IsDesc { get; set; } = true; -} diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs deleted file mode 100644 index 6ecf1f444..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; - -public class LableValuesRequest -{ - private string[] _match = new string[1]; - - /// - /// it for the parameter `match` whitch is IEnumerable - /// and in this case only support single mode,for example: - /// Match="up", last `Matches` result is (IEnumerable){"up"} - /// - [JsonIgnore] - public string Match { get { return _match[0]; } set { _match[0] = value; } } - - /// - /// for parameter transform - /// - [JsonPropertyName("match")] - public IEnumerable Matches { get { return _match; } } - - public DateTime Start { get; set; } - - public DateTime End { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs deleted file mode 100644 index ab79dc846..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; - -public class ValuesRequest -{ - public string Match { get; set; } - - /// - /// for parameter `match` child, for example - /// Match = "up", Lables=new string[]{ "instance=\"k8s-hz-001\"" }, last result is 'up{instance="k8s-hz-001"} for `Match`' - /// - [JsonIgnore] - public IEnumerable? Lables { get; set; } - - public DateTime Start { get; set; } - - public DateTime End { get; set; } -} diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs deleted file mode 100644 index 97086caec..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Service; - -public interface ILogService -{ - Task> GetFieldsAsync(); - - Task>> GetAggregationAsync(LogAggregationRequest query); - - Task GetLatestAsync(LogLatestRequest query); -} diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs deleted file mode 100644 index cbd2b3bcf..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.StackSdks.Tsc.Service; - -public interface IMetricService -{ - Task> GetNamesAsync(IEnumerable? match); - - Task>> GetLabelValuesAsync(LableValuesRequest query); - - Task GetValuesAsync(ValuesRequest query); -} diff --git a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs b/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs deleted file mode 100644 index 9549f7961..000000000 --- a/src/BuildingBlocks/StackSdks/Tsc/src/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Tsc.Enums; -global using Masa.BuildingBlocks.StackSdks.Tsc.Model; -global using Masa.BuildingBlocks.StackSdks.Tsc.Service; -global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs deleted file mode 100644 index 2692fc072..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage; - -[AttributeUsage(AttributeTargets.Class)] -public class BucketNameAttribute : Attribute -{ - public string? Name { get; set; } - - public BucketNameAttribute(string? name = null) => Name = name; - - public static string GetName() => GetName(typeof(T)); - - public static string GetName(Type type) - { - var nameAttribute = type.GetTypeInfo().GetCustomAttribute(); - - if (nameAttribute == null) - return BucketNames.DEFAULT_BUCKET_NAME; - - return !string.IsNullOrWhiteSpace(nameAttribute.Name) ? nameAttribute.Name : type.FullName!; - } -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs deleted file mode 100644 index ca61c53f5..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage; - -public class BucketNames : Dictionary -{ - public const string DEFAULT_BUCKET_NAME = "DefaultBucketName"; - - public string DefaultBucketName - { - get => GetBucketName(DEFAULT_BUCKET_NAME); - set => this[DEFAULT_BUCKET_NAME] = value; - } - - public BucketNames() { } - public BucketNames(IEnumerable> names) : base(names) { } - - public string GetBucketName(string name) - { - if (base.TryGetValue(name, out var bucketName)) - return bucketName; - - return string.Empty; - } -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs deleted file mode 100644 index 34bb6026b..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage; - -public class DefaultClientContainer - : DefaultClientContainer, IClientContainer where TContainer : class -{ - public DefaultClientContainer(IClient client, IBucketNameProvider bucketNameProvider) - : base(client, bucketNameProvider.GetBucketName()) - { - } -} - -public class DefaultClientContainer : IClientContainer -{ - private readonly IClient _client; - private readonly string _bucketName; - - public DefaultClientContainer(IClient client, string bucketName) - { - _client = client; - _bucketName = bucketName; - } - - public TemporaryCredentialsResponse GetSecurityToken() => _client.GetSecurityToken(); - - public string GetToken() => _client.GetToken(); - - public Task GetObjectAsync(string objectName, Action callback, CancellationToken cancellationToken = default) - => _client.GetObjectAsync(_bucketName, objectName, callback, cancellationToken); - - public Task GetObjectAsync(string objectName, - long offset, - long length, - Action callback, - CancellationToken cancellationToken = default) - => _client.GetObjectAsync(_bucketName, objectName, offset, length, callback, cancellationToken); - - public Task PutObjectAsync(string objectName, Stream data, CancellationToken cancellationToken = default) - => _client.PutObjectAsync(_bucketName, objectName, data, cancellationToken); - - public Task ObjectExistsAsync(string objectName, CancellationToken cancellationToken = default) - => _client.ObjectExistsAsync(_bucketName, objectName, cancellationToken); - - public Task DeleteObjectAsync(string objectName, CancellationToken cancellationToken = default) - => _client.DeleteObjectAsync(_bucketName, objectName, cancellationToken); - - public Task DeleteObjectAsync(IEnumerable objectNames, CancellationToken cancellationToken = default) - => _client.DeleteObjectAsync(_bucketName, objectNames, cancellationToken); -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs deleted file mode 100644 index def32b589..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage; - -public class DefaultClientFactory : IClientFactory -{ - private readonly IClient _client; - - public DefaultClientFactory(IClient client) => _client = client; - - public IClientContainer Create(string bucketName) - { - if (string.IsNullOrWhiteSpace(bucketName)) - throw new AggregateException($"{nameof(bucketName)} cannot be empty"); - - return new DefaultClientContainer(_client, bucketName); - } -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs deleted file mode 100644 index 756d16bbc..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage; - -public interface IBucketNameProvider -{ - string GetBucketName(); - - string GetBucketName() where TContainer : class; -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs deleted file mode 100644 index 378cbded2..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage; - -public interface IClient -{ - /// - /// Obtain temporary authorization credentials through STS service - /// - /// - TemporaryCredentialsResponse GetSecurityToken(); - - /// - /// Obtain temporary request token through authorization service - /// - /// - string GetToken(); - - Task GetObjectAsync( - string bucketName, - string objectName, - Action callback, - CancellationToken cancellationToken = default(CancellationToken)); - - Task GetObjectAsync( - string bucketName, - string objectName, - long offset, - long length, - Action callback, - CancellationToken cancellationToken = default(CancellationToken)); - - Task PutObjectAsync( - string bucketName, - string objectName, - Stream data, - CancellationToken cancellationToken = default(CancellationToken)); - - Task ObjectExistsAsync( - string bucketName, - string objectName, - CancellationToken cancellationToken = default(CancellationToken)); - - Task DeleteObjectAsync( - string bucketName, - string objectName, - CancellationToken cancellationToken = default(CancellationToken)); - - Task DeleteObjectAsync( - string bucketName, - IEnumerable objectNames, - CancellationToken cancellationToken = default(CancellationToken)); -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs deleted file mode 100644 index cd3b0f020..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage; - -public interface IClientContainer : IClientContainer where TContainer : class -{ - -} - -public interface IClientContainer -{ - /// - /// Obtain temporary authorization credentials through STS service - /// - /// - TemporaryCredentialsResponse GetSecurityToken(); - - /// - /// Obtain temporary request token through authorization service - /// - /// - string GetToken(); - - Task GetObjectAsync( - string objectName, - Action callback, - CancellationToken cancellationToken = default); - - Task GetObjectAsync( - string objectName, - long offset, - long length, - Action callback, - CancellationToken cancellationToken = default); - - Task PutObjectAsync( - string objectName, - Stream data, - CancellationToken cancellationToken = default); - - Task ObjectExistsAsync( - string objectName, - CancellationToken cancellationToken = default); - - Task DeleteObjectAsync( - string objectName, - CancellationToken cancellationToken = default); - - Task DeleteObjectAsync( - IEnumerable objectNames, - CancellationToken cancellationToken = default); -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs deleted file mode 100644 index e133ce1c7..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage; - -public interface IClientFactory -{ - IClientContainer Create(string bucketName); -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj deleted file mode 100644 index 17a5a8795..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs deleted file mode 100644 index c626350f0..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage.Response; - -public class TemporaryCredentialsResponse -{ - public string AccessKeyId { get; } - - public string AccessKeySecret { get; } - - public string SessionToken { get; } - - public DateTime? Expiration { get; } - - public TemporaryCredentialsResponse(string accessKeyId, string accessKeySecret, string sessionToken, DateTime? expiration) - { - AccessKeyId = accessKeyId; - AccessKeySecret = accessKeySecret; - SessionToken = sessionToken; - Expiration = expiration; - } -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs deleted file mode 100644 index 02c338f62..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Storage.ObjectStorage; - -public class StorageOptions -{ - private static readonly List> _bucketNames = new(); - - public BucketNames BucketNames { get; set; } - - public StorageOptions() => BucketNames = new BucketNames(_bucketNames); - - public void TryAddBucketName(string name, string bucketName) - { - if (_bucketNames.All(item => item.Key != name)) - _bucketNames.Add(new KeyValuePair(name, bucketName)); - } -} diff --git a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs b/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs deleted file mode 100644 index 16a47c504..000000000 --- a/src/BuildingBlocks/Storage/ObjectStorage/src/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Storage.ObjectStorage.Response; -global using Microsoft.Extensions.Options; -global using System.Reflection; diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs deleted file mode 100644 index 1a5afadc8..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; - -public class ApiResourceCache : IApiResourceCache -{ - IMemoryCacheClient _memoryCacheClient; - - public ApiResourceCache(IMemoryCacheClient memoryCacheClient) - { - _memoryCacheClient = memoryCacheClient; - } - - public async Task> GetListAsync(IEnumerable names) - { - var keys = names.Select(name => FormatKey(name)); - var apiResources = await _memoryCacheClient.GetListAsync(keys.ToArray()); - return apiResources.Where(apiResource => apiResource is not null).ToList()!; - } - - public async Task> GetListAsync() - { - var apiResources = await _memoryCacheClient.GetAsync>(CacheKeyConstants.API_RESOURCE_KEY) ?? new(); - return apiResources; - } - - public async Task SetAsync(ApiResource apiResource) - { - var model = apiResource.ToModel(); - await _memoryCacheClient.SetAsync(FormatKey(apiResource), model); - // update list cache - var list = await GetListAsync(); - list.Set(model, item => item.Name); - await UpdateListAsync(list); - } - - public async Task SetRangeAsync(IEnumerable apiResources) - { - var map = apiResources.ToDictionary(apiResource => FormatKey(apiResource), apiResource => apiResource.ToModel()); - await _memoryCacheClient.SetListAsync(map); - // update list cache - var list = await GetListAsync(); - list.SetRange(map.Values, item => item.Name); - await UpdateListAsync(list); - } - - public async Task RemoveAsync(ApiResource apiResource) - { - await _memoryCacheClient.RemoveAsync(FormatKey(apiResource)); - // update list cache - var list = await GetListAsync(); - list.Remove(item => item.Name == apiResource.Name); - await UpdateListAsync(list); - } - - public async Task ResetAsync(IEnumerable apiResources) - { - var map = apiResources.ToDictionary(apiResource => FormatKey(apiResource), apiResource => apiResource.ToModel()); - await _memoryCacheClient.SetListAsync(map); - await UpdateListAsync(map.Values); - } - - private async Task UpdateListAsync(IEnumerable models) - { - await _memoryCacheClient.SetAsync(CacheKeyConstants.API_RESOURCE_KEY, models); - } - - private string FormatKey(ApiResource apiResources) - { - return FormatKey(apiResources.Name); - } - - private string FormatKey(string name) - { - return $"{CacheKeyConstants.API_RESOURCE_KEY}_{name}"; - } -} diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs deleted file mode 100644 index 7ffdab3f5..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; - -public class ApiScopeCache : IApiScopeCache -{ - IMemoryCacheClient _memoryCacheClient; - - public ApiScopeCache(IMemoryCacheClient memoryCacheClient) - { - _memoryCacheClient = memoryCacheClient; - } - - public async Task> GetListAsync(IEnumerable names) - { - var keys = names.Select(name => FormatKey(name)).ToArray(); - var apiScopes = await _memoryCacheClient.GetListAsync(keys); - return apiScopes.Where(apiScope => apiScope is not null).ToList()!; - } - - public async Task> GetListAsync() - { - var apiScopes = await _memoryCacheClient.GetAsync>(CacheKeyConstants.API_SCOPE_KEY) ?? new(); - return apiScopes; - } - - public async Task SetAsync(ApiScope apiScope) - { - var model = apiScope.ToModel(); - await _memoryCacheClient.SetAsync(FormatKey(apiScope), model); - // update list cache - var list = await GetListAsync(); - list.Set(model, item => item.Name); - await UpdateListAsync(list); - } - - public async Task SetRangeAsync(IEnumerable apiScopes) - { - var map = apiScopes.ToDictionary(apiScope => FormatKey(apiScope), apiScope => apiScope.ToModel()); - await _memoryCacheClient.SetListAsync(map); - // update list cache - var list = await GetListAsync(); - list.SetRange(map.Values, item => item.Name); - await UpdateListAsync(list); - } - - public async Task RemoveAsync(ApiScope apiScope) - { - await _memoryCacheClient.RemoveAsync(FormatKey(apiScope)); - // update list cache - var list = await GetListAsync(); - list.Remove(item => item.Name == apiScope.Name); - await UpdateListAsync(list); - } - - public async Task ResetAsync(IEnumerable apiScopes) - { - var map = apiScopes.ToDictionary(apiScope => FormatKey(apiScope), apiScope => apiScope.ToModel()); - await _memoryCacheClient.SetListAsync(map); - await UpdateListAsync(map.Values); - } - - private async Task UpdateListAsync(IEnumerable models) - { - await _memoryCacheClient.SetAsync(CacheKeyConstants.API_SCOPE_KEY, models); - } - - private string FormatKey(ApiScope apiScopes) - { - return FormatKey(apiScopes.Name); - } - - private string FormatKey(string name) - { - return $"{CacheKeyConstants.API_SCOPE_KEY}_{name}"; - } -} diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs deleted file mode 100644 index 3cb9e950a..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; - -public class ClientCache : IClientCache -{ - IMemoryCacheClient _memoryCacheClient; - - public ClientCache(IMemoryCacheClient memoryCacheClient) - { - _memoryCacheClient = memoryCacheClient; - } - - public async Task GetAsync(string clientId) - { - return await _memoryCacheClient.GetAsync(FormatKey(clientId)); - } - - public async Task> GetListAsync(IEnumerable clientIds) - { - var keys = clientIds.Select(clientId => FormatKey(clientId)).ToArray(); - var clients = await _memoryCacheClient.GetListAsync(keys); - return clients.Where(client => client is not null).ToList()!; - } - - public async Task SetAsync(Client client) - { - await _memoryCacheClient.SetAsync(FormatKey(client), client.ToModel()); - } - - public async Task RemoveAsync(Client client) - { - await _memoryCacheClient.RemoveAsync(FormatKey(client)); - } - - public async Task SetRangeAsync(IEnumerable clients) - { - var data = clients.ToDictionary(client => FormatKey(client), client => client.ToModel()); - await _memoryCacheClient.SetListAsync(data); - } - - public async Task ResetAsync(IEnumerable clients) - { - var data = clients.ToDictionary(client => FormatKey(client), client => client.ToModel()); - await _memoryCacheClient.SetListAsync(data); - } - - private string FormatKey(Client client) - { - return FormatKey(client.ClientId); - } - - private string FormatKey(string clientId) - { - return $"{CacheKeyConstants.CLIENT_KEY}_{clientId}"; - } -} diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs deleted file mode 100644 index ad250936c..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; - -public class IdentityResourceCache : IIdentityResourceCache -{ - IMemoryCacheClient _memoryCacheClient; - - public IdentityResourceCache(IMemoryCacheClient memoryCacheClient) - { - _memoryCacheClient = memoryCacheClient; - } - - public async Task> GetListAsync(IEnumerable names) - { - var keys = names.Select(name => FormatKey(name)).ToArray(); - var identityResources = await _memoryCacheClient.GetListAsync(keys); - return identityResources.Where(identityResource => identityResource is not null).ToList()!; - } - - public async Task> GetListAsync() - { - var identityResources = await _memoryCacheClient.GetAsync>(CacheKeyConstants.IDENTITY_RESOURCE_KEY) ?? new(); - return identityResources; - } - - public async Task SetAsync(IdentityResource identityResource) - { - var model = identityResource.ToModel(); - await _memoryCacheClient.SetAsync(FormatKey(identityResource), model); - // update list cache - var list = await GetListAsync(); - list.Set(model, item => item.Name); - await UpdateListAsync(list); - } - - public async Task SetRangeAsync(IEnumerable identityResources) - { - var map = identityResources.ToDictionary(identityResource => FormatKey(identityResource), identityResource => identityResource.ToModel()); - await _memoryCacheClient.SetListAsync(map); - // update list cache - var list = await GetListAsync(); - list.SetRange(map.Values, item => item.Name); - await UpdateListAsync(list); - } - - public async Task RemoveAsync(IdentityResource identityResource) - { - await _memoryCacheClient.RemoveAsync(FormatKey(identityResource)); - // update list cache - var list = await GetListAsync(); - list.Remove(item => item.Name == identityResource.Name); - await UpdateListAsync(list); - } - - public async Task ResetAsync(IEnumerable identityResources) - { - var map = identityResources.ToDictionary(identityResource => FormatKey(identityResource), identityResource => identityResource.ToModel()); - await _memoryCacheClient.SetListAsync(map); - await UpdateListAsync(map.Values); - } - - private async Task UpdateListAsync(IEnumerable models) - { - await _memoryCacheClient.SetAsync(CacheKeyConstants.IDENTITY_RESOURCE_KEY, models); - } - - private string FormatKey(IdentityResource identityResources) - { - return FormatKey(identityResources.Name); - } - - private string FormatKey(string name) - { - return $"{CacheKeyConstants.IDENTITY_RESOURCE_KEY}_{name}"; - } -} diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj deleted file mode 100644 index 1222132ec..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs deleted file mode 100644 index c5d9e6a1e..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Models; - -public static class CacheKeyConstants -{ - public const string CLIENT_KEY = "oidc_client"; - public const string API_RESOURCE_KEY = "oidc_apiResource"; - public const string API_SCOPE_KEY = "oidc_apiScope"; - public const string IDENTITY_RESOURCE_KEY = "oidc_identityResource"; -} diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs deleted file mode 100644 index 7945f9ab1..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Models; - -public static class Mapper -{ - public static ApiScopeModel ToModel(this ApiScope apiScope) - { - return new ApiScopeModel(apiScope.Name, apiScope.DisplayName, apiScope.UserClaims.Select(uc => uc.UserClaim.Name).ToList()) - { - Required = apiScope.Required, - Emphasize = apiScope.Emphasize, - Enabled = apiScope.Enabled, - Description = apiScope.Description, - Properties = apiScope.Properties.ToDictionary(p => p.Key, p => p.Value), - ShowInDiscoveryDocument = apiScope.ShowInDiscoveryDocument, - }; - } - - public static IdentityResourceModel ToModel(this IdentityResource identityResource) - { - return new IdentityResourceModel(identityResource.Name, identityResource.DisplayName, identityResource.UserClaims.Select(uc => uc.UserClaim.Name).ToList()) - { - Required = identityResource.Required, - Emphasize = identityResource.Emphasize, - Enabled = identityResource.Enabled, - Description = identityResource.Description, - Properties = identityResource.Properties.ToDictionary(p => p.Key, p => p.Value), - ShowInDiscoveryDocument = identityResource.ShowInDiscoveryDocument, - }; - } - - public static ApiResourceModel ToModel(this ApiResource apiResource) - { - return new ApiResourceModel(apiResource.Name, apiResource.DisplayName, apiResource.UserClaims.Select(uc => uc.UserClaim.Name).ToList()) - { - Scopes = apiResource.ApiScopes.Select(a => a.ApiScope.Name).ToList(), - ApiSecrets = apiResource.Secrets.Select(s => new SecretModel(s.Value, s.Description, s.Expiration)).ToList(), - AllowedAccessTokenSigningAlgorithms = Convert(apiResource.AllowedAccessTokenSigningAlgorithms), - Enabled = apiResource.Enabled, - Description = apiResource.Description, - ShowInDiscoveryDocument = apiResource.ShowInDiscoveryDocument, - }; - - ICollection Convert(string sourceMember) - { - var list = new HashSet(); - if (!string.IsNullOrWhiteSpace(sourceMember)) - { - sourceMember = sourceMember.Trim(); - foreach (var item in sourceMember.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Distinct()) - { - list.Add(item); - } - } - return list; - } - } - - public static ClientModel ToModel(this Client client) - { - return new ClientModel(client.ClientId.ToString(), client.ClientName, client.Description, client.ClientUri, client.LogoUri, client.RedirectUris.Select(r => r.RedirectUri), client.PostLogoutRedirectUris.Select(p => p.PostLogoutRedirectUri), client.AllowedGrantTypes.Select(a => a.GrantType), client.AllowedScopes.Select(a => a.Scope)) - { - Enabled = client.Enabled, - ProtocolType = client.ProtocolType, - RequireConsent = client.RequireConsent, - AllowRememberConsent = client.AllowRememberConsent, - RequireClientSecret = client.RequireClientSecret, - AlwaysIncludeUserClaimsInIdToken = client.AlwaysIncludeUserClaimsInIdToken, - AllowPlainTextPkce = client.AllowPlainTextPkce, - RequireRequestObject = client.RequireRequestObject, - RequirePkce = client.RequirePkce, - FrontChannelLogoutUri = client.FrontChannelLogoutUri, - FrontChannelLogoutSessionRequired = client.FrontChannelLogoutSessionRequired, - BackChannelLogoutUri = client.BackChannelLogoutUri, - BackChannelLogoutSessionRequired = client.BackChannelLogoutSessionRequired, - AllowOfflineAccess = client.AllowOfflineAccess, - IdentityTokenLifetime = client.IdentityTokenLifetime, - AccessTokenLifetime = client.AccessTokenLifetime, - AuthorizationCodeLifetime = client.AuthorizationCodeLifetime, - ConsentLifetime = client.ConsentLifetime, - AbsoluteRefreshTokenLifetime = client.AbsoluteRefreshTokenLifetime, - SlidingRefreshTokenLifetime = client.SlidingRefreshTokenLifetime, - UpdateAccessTokenClaimsOnRefresh = client.UpdateAccessTokenClaimsOnRefresh, - EnableLocalLogin = client.EnableLocalLogin, - AlwaysSendClientClaims = client.AlwaysSendClientClaims, - Claims = client.Claims.Select(c => new ClientClaimModel(c.Type, c.Value)).ToList(), - AllowedCorsOrigins = client.AllowedCorsOrigins.Select(a => a.Origin).ToList(), - Properties = client.Properties.ToDictionary(p => p.Key, p => p.Value), - IdentityProviderRestrictions = client.IdentityProviderRestrictions.Select(i => i.Provider).ToList(), - AllowAccessTokensViaBrowser = client.AllowAccessTokensViaBrowser, - IncludeJwtId = client.IncludeJwtId, - AccessTokenType = (AccessTokenType)client.AccessTokenType, - DeviceCodeLifetime = client.DeviceCodeLifetime, - UserSsoLifetime = client.UserSsoLifetime, - RefreshTokenExpiration = (TokenExpiration)client.RefreshTokenExpiration, - RefreshTokenUsage = (TokenUsage)client.RefreshTokenUsage, - ClientClaimsPrefix = client.ClientClaimsPrefix, - PairWiseSubjectSalt = client.PairWiseSubjectSalt, - UserCodeType = client.UserCodeType, - ClientSecrets = client.ClientSecrets.Select(s => new SecretModel(s.Type, s.Value)).ToList(), - AllowedIdentityTokenSigningAlgorithms = client.AllowedIdentityTokenSigningAlgorithms.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(), - }; - } -} diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.md b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.md deleted file mode 100644 index 888728030..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.md +++ /dev/null @@ -1,49 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Authentication.Oidc.Cache - -Effect: - -Use the second level cache to operate resources and client data. - -```c# -├── ApiResourceCache -├── ApiScopeCache -├── ClientCache -├── IdentityResourceCache -``` - -Example: - -```C# -Install-Package Masa.Contrib.Authentication.Oidc.Cache -``` - -```C# -builder.Services.AddOidcCache(nnew RedisConfigurationOptions -{ - Servers = new List - { - new RedisServerOptions - { - Host="127.0.0.1", - Port=6379 - } - }, - DefaultDatabase = 0, - Password = "", -}); -``` - -How to use: - -```c# -var app = builder.Build(); - -app.MapGet("/GetClient", async ([FromServices] IClientCache cache) => -{ - return await cache.GetAsync("clientId"); -}); - -app.Run(); -``` diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md deleted file mode 100644 index 6e29ffc4c..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md +++ /dev/null @@ -1,49 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Authentication.Oidc.Cache - -作用: - -使用二级缓存来操作资源和客户端数据。 - -```c# -├── ApiResourceCache -├── ApiScopeCache -├── ClientCache -├── IdentityResourceCache -``` - -用例: - -```C# -Install-Package Masa.Contrib.Authentication.Oidc.Cache -``` - -```C# -builder.Services.AddOidcCache(nnew RedisConfigurationOptions -{ - Servers = new List - { - new RedisServerOptions - { - Host="127.0.0.1", - Port=6379 - } - }, - DefaultDatabase = 0, - Password = "", -}); -``` - -如何使用: - -```c# -var app = builder.Build(); - -app.MapGet("/GetClient", async ([FromServices] IClientCache cache) => -{ - return await cache.GetAsync("clientId"); -}); - -app.Run(); -``` diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs deleted file mode 100644 index a663238b9..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddOidcCache(this IServiceCollection services, RedisConfigurationOptions options) - { - services.AddMasaRedisCache(options).AddMasaMemoryCache(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - - return services; - } -} diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs deleted file mode 100644 index b52bd7fb3..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Utils; - -public static class CollectionExtensions -{ - public static void Set(this ICollection collection, T data, Func keySelector) - { - collection.Remove(data, keySelector); - collection.Add(data); - } - - public static void SetRange(this ICollection collection, IEnumerable datas, Func keySelector) - { - collection.RemoveRange(datas, keySelector); - foreach (var data in datas) - { - collection.Add(data); - } - } - - public static void Remove(this ICollection collection, T data, Func keySelector) - { - var oldData = collection.FirstOrDefault(item => keySelector(item).Equals(keySelector(data))); - if (oldData is not null) collection.Remove(oldData); - } - - public static void RemoveRange(this ICollection collection, IEnumerable datas, Func keySelector) - { - var oldDatas = collection.Where(item => datas.Any(data => keySelector(data).Equals(keySelector(item)))).ToList(); - if (oldDatas.Count() > 0) - { - foreach (var oldData in oldDatas) - { - collection.Remove(oldData); - } - } - } - - public static void Remove(this ICollection collection, Func condition) - { - var datas = collection.Where(condition).ToList(); - if(datas.Count() > 0) - { - foreach (var data in datas) - { - collection.Remove(data); - } - } - } -} diff --git a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs b/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs deleted file mode 100644 index bf854463c..000000000 --- a/src/Contrib/Authentication/Oidc/Cache/src/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; -global using Masa.Contrib.Authentication.Oidc.Cache.Caches; -global using Masa.Contrib.Authentication.Oidc.Cache.Models; -global using Masa.Contrib.Authentication.Oidc.Cache.Utils; -global using Masa.Utils.Caching.DistributedMemory.DependencyInjection; -global using Masa.Utils.Caching.DistributedMemory.Interfaces; -global using Masa.Utils.Caching.Redis.Models; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs deleted file mode 100644 index cb67b22ef..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Caches; - -public class SyncCache -{ - IClientCache _clientCache; - IApiResourceCache _apiResourceCache; - IApiScopeCache _apiScopeCache; - IIdentityResourceCache _identityResourceCache; - DbContext _context; - - public SyncCache(IClientCache clientCache, IApiResourceCache apiResourceCache, IApiScopeCache apiScopeCache, IIdentityResourceCache identityResourceCache, OidcDbContext context) - { - _clientCache = clientCache; - _apiResourceCache = apiResourceCache; - _apiScopeCache = apiScopeCache; - _identityResourceCache = identityResourceCache; - _context = context; - } - - internal async Task SyncApiResourceCacheAsync(int id) - { - var apiResource = await ApiResourceQuery().FirstOrDefaultAsync(apiResource => apiResource.Id == id); - if (apiResource is null) return; - await _apiResourceCache.SetAsync(apiResource); - } - - internal async Task SyncApiScopeCacheAsync(int id) - { - var apiScope = await ApiScopeQuery().FirstOrDefaultAsync(apiScope => apiScope.Id == id); - if (apiScope is null) return; - await _apiScopeCache.SetAsync(apiScope); - } - - internal async Task SyncIdentityResourceCacheAsync(params int[] ids) - { - var identityResources = await IdentityResourceQuery().Where(idrs => ids.Contains(idrs.Id)).ToListAsync(); - if (identityResources.Count < 0) return; - await _identityResourceCache.SetRangeAsync(identityResources); - } - - internal async Task RemoveApiResourceCacheAsync(ApiResource apiResource) - { - await _apiResourceCache.RemoveAsync(apiResource); - } - - internal async Task RemoveApiScopeCacheAsync(ApiScope apiScope) - { - await _apiScopeCache.RemoveAsync(apiScope); - } - - internal async Task RemoveIdentityResourceCacheAsync(IdentityResource identityResource) - { - await _identityResourceCache.RemoveAsync(identityResource); - } - - public async Task ResetAsync() - { - var clients = await ClientQuery().ToListAsync(); - var apiScopes = await ApiScopeQuery().ToListAsync(); - var apiResources = await ApiResourceQuery().ToListAsync(); - var identityResource = await IdentityResourceQuery().ToListAsync(); - - await _clientCache.ResetAsync(clients); - await _apiScopeCache.ResetAsync(apiScopes); - await _apiResourceCache.ResetAsync(apiResources); - await _identityResourceCache.ResetAsync(identityResource); - } - - private IQueryable ClientQuery() - { - return _context.Set() - .Include(c => c.AllowedGrantTypes) - .Include(c => c.RedirectUris) - .Include(c => c.PostLogoutRedirectUris) - .Include(c => c.Properties) - .Include(c => c.Claims) - .Include(c => c.IdentityProviderRestrictions) - .Include(c => c.AllowedCorsOrigins) - .Include(c => c.ClientSecrets) - .Include(c => c.AllowedScopes); - } - - private IQueryable IdentityResourceQuery() - { - return _context.Set() - .Include(idrs => idrs.UserClaims) - .ThenInclude(uc => uc.UserClaim) - .Include(idrs => idrs.Properties); - } - - private IQueryable ApiScopeQuery() - { - return _context.Set() - .Include(apiScope => apiScope.UserClaims) - .ThenInclude(apiScope => apiScope.UserClaim) - .Include(apiScope => apiScope.Properties); - } - - private IQueryable ApiResourceQuery() - { - return _context.Set() - .Include(apiResource => apiResource.UserClaims) - .ThenInclude(userClaim => userClaim.UserClaim) - .Include(apiResource => apiResource.Properties) - .Include(apiResource => apiResource.ApiScopes) - .ThenInclude(apiScope => apiScope.ApiScope); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs deleted file mode 100644 index 7d39a137c..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.DbContexts; - -public class OidcDbContext -{ - public DbContext Dbcontext { get; set; } - - public OidcDbContext(DbContext dbcontext) - { - Dbcontext = dbcontext; - } - - public static implicit operator DbContext(OidcDbContext context) - { - return context.Dbcontext; - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs deleted file mode 100644 index 1b1e4ee88..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ApiResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(x => x.Id); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs deleted file mode 100644 index f4acbda1c..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ApiResourceEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Name).HasMaxLength(200).IsRequired(); - builder.Property(x => x.DisplayName).HasMaxLength(200); - builder.Property(x => x.Description).HasMaxLength(1000); - builder.Property(x => x.AllowedAccessTokenSigningAlgorithms).HasMaxLength(100); - builder.HasIndex(x => x.Name).IsUnique().HasFilter("[IsDeleted] = 0"); - builder.HasMany(x => x.Secrets).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).OnDelete(DeleteBehavior.Cascade); - builder.HasMany(x => x.ApiScopes).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).IsRequired().OnDelete(DeleteBehavior.Cascade); - builder.HasMany(x => x.UserClaims).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).OnDelete(DeleteBehavior.Cascade); - builder.HasMany(x => x.Properties).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).OnDelete(DeleteBehavior.Cascade); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs deleted file mode 100644 index 6348fd9de..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ApiResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); - builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs deleted file mode 100644 index 0bb2487fc..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ApiResourceScopeEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(apiResourceScope => apiResourceScope.Id); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs deleted file mode 100644 index a147bb209..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ApiResourceSecretEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Description).HasMaxLength(1000); - builder.Property(x => x.Value).HasMaxLength(4000).IsRequired(); - builder.Property(x => x.Type).HasMaxLength(250).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs deleted file mode 100644 index 75f9f67a5..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ApiScopeClaimEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(apiScopeClaim => apiScopeClaim.Id); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs deleted file mode 100644 index e896c2544..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ApiScopeEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasIndex(apiScope => apiScope.Name).IsUnique(); - - builder.Property(apiScope => apiScope.Name).HasMaxLength(200).IsRequired(); - builder.Property(apiScope => apiScope.DisplayName).HasMaxLength(200); - builder.Property(apiScope => apiScope.Description).HasMaxLength(1000); - - builder.HasMany(apiScope => apiScope.UserClaims).WithOne(apiScope => apiScope.ApiScope).HasForeignKey(apiScope => apiScope.ApiScopeId).IsRequired().OnDelete(DeleteBehavior.Cascade); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs deleted file mode 100644 index d1e77c39c..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ApiScopePropertyEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); - builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs deleted file mode 100644 index f820fb239..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientClaimEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Type).HasMaxLength(250).IsRequired(); - builder.Property(x => x.Value).HasMaxLength(250).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs deleted file mode 100644 index b7d305fd0..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientCorsOriginEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Origin).HasMaxLength(150).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs deleted file mode 100644 index 6dfbec804..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.ClientId).HasMaxLength(200).IsRequired(); - builder.Property(x => x.ProtocolType).HasMaxLength(200).IsRequired(); - builder.Property(x => x.ClientName).HasMaxLength(200); - builder.Property(x => x.ClientUri).HasMaxLength(2000); - builder.Property(x => x.LogoUri).HasMaxLength(2000); - builder.Property(x => x.Description).HasMaxLength(1000); - builder.Property(x => x.FrontChannelLogoutUri).HasMaxLength(2000); - builder.Property(x => x.BackChannelLogoutUri).HasMaxLength(2000); - builder.Property(x => x.ClientClaimsPrefix).HasMaxLength(200); - builder.Property(x => x.PairWiseSubjectSalt).HasMaxLength(200); - builder.Property(x => x.UserCodeType).HasMaxLength(100); - builder.Property(x => x.AllowedIdentityTokenSigningAlgorithms).HasMaxLength(100); - builder.HasIndex(x => x.ClientId); - builder.HasIndex(x => x.ClientId).IsUnique().HasFilter("[IsDeleted] = 0"); - - builder.HasMany(x => x.AllowedGrantTypes).WithOne(x => x.Client); - builder.HasMany(x => x.RedirectUris).WithOne(x => x.Client); - builder.HasMany(x => x.PostLogoutRedirectUris).WithOne(x => x.Client); - builder.HasMany(x => x.AllowedScopes).WithOne(x => x.Client); - builder.HasMany(x => x.ClientSecrets).WithOne(x => x.Client); - builder.HasMany(x => x.Claims).WithOne(x => x.Client); - builder.HasMany(x => x.IdentityProviderRestrictions).WithOne(x => x.Client); - builder.HasMany(x => x.AllowedCorsOrigins).WithOne(x => x.Client); - builder.HasMany(x => x.Properties).WithOne(x => x.Client); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs deleted file mode 100644 index 078f6bee9..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientGrantTypeEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.GrantType).HasMaxLength(250).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs deleted file mode 100644 index 020d4b47a..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientIdPRestrictionEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Provider).HasMaxLength(200).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs deleted file mode 100644 index 9ec42b572..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientPostLogoutRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(x => x.Id); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs deleted file mode 100644 index 2dfc932b7..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientPropertyEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); - builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs deleted file mode 100644 index 4bd36f03a..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.RedirectUri).HasMaxLength(2000).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs deleted file mode 100644 index e1341c78f..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientScopeEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Scope).HasMaxLength(200).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs deleted file mode 100644 index 63cff7b2a..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class ClientSecretEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Value).HasMaxLength(4000).IsRequired(); - builder.Property(x => x.Type).HasMaxLength(250).IsRequired(); - builder.Property(x => x.Description).HasMaxLength(2000); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs deleted file mode 100644 index 8d0acd9d9..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class DeviceFlowCodesEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.DeviceCode).HasMaxLength(200).IsRequired(); - builder.Property(x => x.UserCode).HasMaxLength(200).IsRequired(); - builder.Property(x => x.SubjectId).HasMaxLength(200); - builder.Property(x => x.SessionId).HasMaxLength(100); - builder.Property(x => x.ClientId).HasMaxLength(200).IsRequired(); - builder.Property(x => x.Description).HasMaxLength(200); - builder.Property(x => x.CreationTime).IsRequired(); - builder.Property(x => x.Expiration).IsRequired(); - // 50000 chosen to be explicit to allow enough size to avoid truncation, yet stay beneath the MySql row size limit of ~65K - // apparently anything over 4K converts to nvarchar(max) on SqlServer - builder.Property(x => x.Data).HasMaxLength(50000).IsRequired(); - - builder.HasKey(x => new { x.UserCode }); - - builder.HasIndex(x => x.DeviceCode).IsUnique().HasFilter("[IsDeleted] = 0"); - builder.HasIndex(x => x.Expiration); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs deleted file mode 100644 index 1f96fd9bc..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class IdentityResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(identityResourceClaim => identityResourceClaim.Id); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs deleted file mode 100644 index efe5181bc..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class IdentityResourceEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Name).HasMaxLength(200).IsRequired(); - builder.Property(x => x.DisplayName).HasMaxLength(200); - builder.Property(x => x.Description).HasMaxLength(1000); - builder.HasIndex(x => x.Name).IsUnique().HasFilter("[IsDeleted] = 0"); - - builder.HasMany(x => x.UserClaims).WithOne(x => x.IdentityResource).HasForeignKey(x => x.IdentityResourceId).IsRequired().OnDelete(DeleteBehavior.Cascade); - builder.HasMany(x => x.Properties).WithOne(x => x.IdentityResource).HasForeignKey(x => x.IdentityResourceId).IsRequired().OnDelete(DeleteBehavior.Cascade); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs deleted file mode 100644 index 0ac7d865f..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class IdentityResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); - builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs deleted file mode 100644 index d01df6089..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class PersistedGrantEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.Property(x => x.Key).HasMaxLength(200).ValueGeneratedNever(); - builder.Property(x => x.Type).HasMaxLength(50).IsRequired(); - builder.Property(x => x.SubjectId).HasMaxLength(200); - builder.Property(x => x.SessionId).HasMaxLength(100); - builder.Property(x => x.ClientId).HasMaxLength(200).IsRequired(); - builder.Property(x => x.Description).HasMaxLength(200); - builder.Property(x => x.CreationTime).IsRequired(); - // 50000 chosen to be explicit to allow enough size to avoid truncation, yet stay beneath the MySql row size limit of ~65K - // apparently anything over 4K converts to nvarchar(max) on SqlServer - builder.Property(x => x.Data).HasMaxLength(50000).IsRequired(); - - builder.HasKey(x => x.Key); - - builder.HasIndex(x => new { x.SubjectId, x.ClientId, x.Type }); - builder.HasIndex(x => new { x.SubjectId, x.SessionId, x.Type }); - builder.HasIndex(x => x.Expiration); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs deleted file mode 100644 index 1230b761d..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; - -public class UserClaimEntityTypeConfiguration : IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.HasKey(x => x.Id); - builder.Property(x => x.Name).HasMaxLength(200).IsRequired(); - builder.Property(x => x.Description).HasMaxLength(1000); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj deleted file mode 100644 index 419151d21..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs deleted file mode 100644 index fcf01b693..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Options; - -public class OidcDbContextOptions -{ - internal IServiceProvider ServiceProvider { get; set; } - - public OidcDbContextOptions(IServiceProvider serviceProvider) - { - ServiceProvider = serviceProvider; - } - - public async Task SeedClientDataAsync(List clients) - { - var clientRepository = ServiceProvider.GetRequiredService(); - - foreach (var client in clients) - { - if (await clientRepository.FindAsync(s => s.ClientId == client.ClientId) is null) - { - await clientRepository.AddAsync(client); - } - } - } - - public async Task SeedStandardResourcesAsync() - { - var userClaim = ServiceProvider.GetRequiredService(); - var identityResourcerepository = ServiceProvider.GetRequiredService(); - await userClaim.AddStandardUserClaimsAsync(); - await identityResourcerepository.AddStandardIdentityResourcesAsync(); - } - - public async Task SyncCacheAsync() - { - var syncCache = ServiceProvider.GetRequiredService(); - await syncCache.ResetAsync(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md deleted file mode 100644 index cfa90b183..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md +++ /dev/null @@ -1,39 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Authentication.Oidc.EntityFrameworkCore - -Effect: - -Use the Repository to operate the Oidc database - -```c# -├── ApiResourceRepository -├── ApiScopeRepository -├── ClientRepository -├── IdentityResourceRepository -├── UserClaimRepository -``` - -Example: - -```C# -Install-Package Masa.Contrib.Authentication.Oidc.EntityFrameworkCore -``` - -```C# -builder.Services.AddOidcDbContext(option => option.UseSqlServer("ConnectionString", - b => b.MigrationsAssembly(migrationsAssembly))); -``` - -How to use: - -```c# -var app = builder.Build(); - -app.MapGet("/GetClients", async ([FromServices] IClientRepository repository) => -{ - return await repository.GetListAsync(); -}); - -app.Run(); -``` diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md deleted file mode 100644 index 20c85efa3..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md +++ /dev/null @@ -1,39 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Authentication.Oidc.EntityFrameworkCore - -作用: - -通过Repository操作Oidc数据库 - -```c# -├── ApiResourceRepository -├── ApiScopeRepository -├── ClientRepository -├── IdentityResourceRepository -├── UserClaimRepository -``` - -用例: - -```C# -Install-Package Masa.Contrib.Authentication.Oidc.EntityFrameworkCore -``` - -```C# -builder.Services.AddOidcDbContext(option => option.UseSqlServer("ConnectionString", - b => b.MigrationsAssembly(migrationsAssembly))); -``` - -如何使用: - -```c# -var app = builder.Build(); - -app.MapGet("/GetClients", async ([FromServices] IClientRepository repository) => -{ - return await repository.GetListAsync(); -}); - -app.Run(); -``` diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs deleted file mode 100644 index 846f2e75d..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; - -public class ApiResourceRepository : IApiResourceRepository -{ - SyncCache _cache; - DbContext _context; - IRepository _repository; - - public ApiResourceRepository(SyncCache cache, OidcDbContext context, IRepository repository) - { - _cache = cache; - _context = context; - _repository = repository; - } - - public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) - { - condition ??= userClaim => true; - var query = _context.Set().Where(condition); - var total = await query.LongCountAsync(); - var apiResources = await query.OrderByDescending(s => s.ModificationTime) - .ThenByDescending(s => s.CreationTime) - .Skip((page - 1) * pageSize) - .Take(pageSize) - .ToListAsync(); - return new PaginatedList() - { - Total = total, - Result = apiResources - }; - } - - public async Task GetDetailAsync(int id) - { - var apiResource = await _context.Set() - .Include(apiResource => apiResource.UserClaims) - .ThenInclude(userClaim => userClaim.UserClaim) - .Include(apiResource => apiResource.Properties) - .Include(apiResource => apiResource.ApiScopes) - .ThenInclude(apiScope => apiScope.ApiScope) - .FirstOrDefaultAsync(apiResource => apiResource.Id == id); - - return apiResource; - } - - public async Task> GetListAsync() - { - var apiResources = await _context.Set().ToListAsync(); - return apiResources; - } - - public async Task FindAsync(Expression> predicate) - { - return await _context.Set().FirstOrDefaultAsync(predicate); - } - - public async Task GetCountAsync(Expression> predicate) - { - return await _context.Set().Where(predicate).CountAsync(); - } - - public async ValueTask AddAsync(ApiResource apiResource) - { - var exist = await _context.Set().CountAsync(a => a.Name == apiResource.Name) > 0; - if (exist) - throw new UserFriendlyException($"ApiResource with name {apiResource.Name} already exists"); - - var newApiResource = await _repository.AddAsync(apiResource); - await _context.SaveChangesAsync(); - await _cache.SyncApiResourceCacheAsync(apiResource.Id); - return newApiResource; - } - - public async Task UpdateAsync(ApiResource apiResource) - { - var newApiResource = await _repository.UpdateAsync(apiResource); - await _context.SaveChangesAsync(); - await _cache.SyncApiResourceCacheAsync(apiResource.Id); - return newApiResource; - } - - public async Task RemoveAsync(ApiResource apiResource) - { - await _repository.RemoveAsync(apiResource); - await _context.SaveChangesAsync(); - await _cache.RemoveApiResourceCacheAsync(apiResource); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs deleted file mode 100644 index c85a850ee..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; - -public class ApiScopeRepository : IApiScopeRepository -{ - SyncCache _cache; - DbContext _context; - IRepository _repository; - - public ApiScopeRepository(SyncCache cache, OidcDbContext context, IRepository repository) - { - _cache = cache; - _context = context; - _repository = repository; - } - - public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) - { - condition ??= userClaim => true; - var query = _context.Set().Where(condition); - var total = await query.LongCountAsync(); - var apiScopes = await query.OrderByDescending(s => s.ModificationTime) - .ThenByDescending(s => s.CreationTime) - .Skip((page - 1) * pageSize) - .Take(pageSize) - .ToListAsync(); - return new PaginatedList() - { - Total = total, - Result = apiScopes - }; - } - - public async Task GetDetailAsync(int id) - { - var apiScope = await _context.Set() - .Include(apiScope => apiScope.UserClaims) - .ThenInclude(apiScope => apiScope.UserClaim) - .Include(apiScope => apiScope.Properties) - .FirstOrDefaultAsync(apiScope => apiScope.Id == id); - - return apiScope; - } - - public async Task> GetListAsync() - { - var apiScopes = await _context.Set().ToListAsync(); - return apiScopes; - } - - public async Task FindAsync(Expression> predicate) - { - return await _context.Set().FirstOrDefaultAsync(predicate); - } - - public async Task GetCountAsync(Expression> predicate) - { - return await _context.Set().Where(predicate).CountAsync(); - } - - public async ValueTask AddAsync(ApiScope apiScope) - { - var exist = await _context.Set().CountAsync(a => a.Name == apiScope.Name) > 0; - if (exist) - throw new UserFriendlyException($"ApiScope with name {apiScope.Name} already exists"); - - var newApiScope = await _repository.AddAsync(apiScope); - await _context.SaveChangesAsync(); - await _cache.SyncApiScopeCacheAsync(apiScope.Id); - return newApiScope; - } - - public async Task UpdateAsync(ApiScope apiScope) - { - var newApiScope = await _repository.UpdateAsync(apiScope); - await _context.SaveChangesAsync(); - await _cache.SyncApiScopeCacheAsync(apiScope.Id); - return newApiScope; - } - - public async Task RemoveAsync(ApiScope apiScope) - { - await _repository.RemoveAsync(apiScope); - await _context.SaveChangesAsync(); - await _cache.RemoveApiScopeCacheAsync(apiScope); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs deleted file mode 100644 index 7705f911f..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; - -public class ClientRepository : IClientRepository -{ - IClientCache _cache; - DbContext _context; - IRepository _repository; - - public ClientRepository(IClientCache cache, OidcDbContext context, IRepository repository) - { - _cache = cache; - _context = context; - _repository = repository; - } - - public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) - { - condition ??= userClaim => true; - var query = _context.Set().Where(condition); - var total = await query.LongCountAsync(); - var clients = await query.OrderByDescending(s => s.ModificationTime) - .ThenByDescending(s => s.CreationTime) - .Skip((page - 1) * pageSize) - .Take(pageSize) - .ToListAsync(); - return new PaginatedList() - { - Total = total, - Result = clients - }; - } - - public async Task GetDetailAsync(int id) - { - return await _context.Set() - .Where(c => c.Id == id) - .Include(c => c.AllowedGrantTypes) - .Include(c => c.RedirectUris) - .Include(c => c.PostLogoutRedirectUris) - .Include(c => c.Properties) - .Include(c => c.Claims) - .Include(c => c.IdentityProviderRestrictions) - .Include(c => c.AllowedCorsOrigins) - .Include(c => c.ClientSecrets) - .Include(c => c.AllowedScopes) - .FirstOrDefaultAsync(); - } - - public async Task> GetListAsync() - { - var clients = await _context.Set().ToListAsync(); - return clients; - } - - public async Task FindAsync(Expression> predicate) - { - return await _context.Set().FirstOrDefaultAsync(predicate); - } - - public async Task GetCountAsync(Expression> predicate) - { - return await _context.Set().Where(predicate).CountAsync(); - } - - public async ValueTask AddAsync(Client client) - { - var newClient = await _repository.AddAsync(client); - await _context.SaveChangesAsync(); - var detail = await GetDetailAsync(client.Id); - await _cache.SetAsync(detail!); - return newClient; - } - - public async Task UpdateAsync(Client client) - { - var newClient = await _repository.UpdateAsync(client); - await _context.SaveChangesAsync(); - var detail = await GetDetailAsync(client.Id); - await _cache.SetAsync(detail!); - return newClient; - } - - public async Task RemoveAsync(Client client) - { - await _repository.RemoveAsync(client); - await _context.SaveChangesAsync(); - await _cache.RemoveAsync(client); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs deleted file mode 100644 index 48621f5d0..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; - -public class IdentityResourceRepository : IIdentityResourceRepository -{ - SyncCache _cache; - DbContext _context; - IRepository _repository; - - public IdentityResourceRepository(SyncCache cache, OidcDbContext context, IRepository repository) - { - _cache = cache; - _context = context; - _repository = repository; - } - - public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) - { - condition ??= userClaim => true; - var query = _context.Set().Where(condition); - var total = await query.LongCountAsync(); - var identityResources = await query.OrderByDescending(s => s.ModificationTime) - .ThenByDescending(s => s.CreationTime) - .Skip((page - 1) * pageSize) - .Take(pageSize) - .ToListAsync(); - return new PaginatedList() - { - Total = total, - Result = identityResources - }; - } - - public async Task> GetListAsync() - { - return await _context.Set().ToListAsync(); - } - - public async Task GetDetailAsync(int id) - { - var identityResources = await _context.Set() - .Include(idrs => idrs.UserClaims) - .Include(idrs => idrs.Properties) - .FirstOrDefaultAsync(idrs => idrs.Id == id); - - return identityResources; - } - - public async Task FindAsync(Expression> predicate) - { - return await _context.Set().FirstOrDefaultAsync(predicate); - } - - public async Task GetCountAsync(Expression> predicate) - { - return await _context.Set().Where(predicate).CountAsync(); - } - - public async ValueTask AddAsync(IdentityResource identityResource) - { - var exist = await _context.Set().CountAsync(idrs => idrs.Name == identityResource.Name) > 0; - if (exist) - throw new UserFriendlyException($"IdentityResource with name {identityResource.Name} already exists"); - - var newIdentityResource = await _repository.AddAsync(identityResource); - await _context.SaveChangesAsync(); - await _cache.SyncIdentityResourceCacheAsync(identityResource.Id); - return newIdentityResource; - } - - public async Task UpdateAsync(IdentityResource identityResource) - { - var newIdentityResource = await _repository.UpdateAsync(identityResource); - await _context.SaveChangesAsync(); - await _cache.SyncIdentityResourceCacheAsync(identityResource.Id); - - return newIdentityResource; - } - - public async Task RemoveAsync(IdentityResource identityResource) - { - await _repository.RemoveAsync(identityResource); - await _context.SaveChangesAsync(); - await _cache.RemoveIdentityResourceCacheAsync(identityResource); - } - - public async Task AddStandardIdentityResourcesAsync() - { - var userClaims = await _context.Set().ToListAsync(); - var syncIdentityResources = new List(); - foreach (var identityResource in StandardIdentityResources.IdentityResources) - { - var userClaimIds = userClaims.Where(uc => identityResource.UserClaims.Contains(uc.Name)).Select(uc => uc.Id); - var existData = await FindAsync(idrs => idrs.Name == identityResource.Name); - if (existData is not null) - { - existData.Update(identityResource.DisplayName, identityResource.Description ?? "", true, identityResource.Required, identityResource.Emphasize, identityResource.ShowInDiscoveryDocument, true); - existData.BindUserClaims(userClaimIds); - await _repository.UpdateAsync(existData); - } - else - { - existData = new IdentityResource(identityResource.Name, identityResource.DisplayName, identityResource.Description ?? "", true, identityResource.Required, identityResource.Enabled, identityResource.ShowInDiscoveryDocument, true); - existData.BindUserClaims(userClaimIds); - await _repository.AddAsync(existData); - } - syncIdentityResources.Add(existData); - } - await _context.SaveChangesAsync(); - await _cache.SyncIdentityResourceCacheAsync(syncIdentityResources.Select(idrs => idrs.Id).ToArray()); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs deleted file mode 100644 index d876dc5b8..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; - -public class UserClaimRepository : IUserClaimRepository -{ - IRepository _repository; - DbContext _context; - - public UserClaimRepository(IRepository repository, OidcDbContext context) - { - _repository = repository; - _context = context; - } - - public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) - { - condition ??= userClaim => true; - var query = _context.Set().Where(condition); - var total = await query.LongCountAsync(); - var userClaims = await query.OrderByDescending(s => s.ModificationTime) - .ThenByDescending(s => s.CreationTime) - .Skip((page - 1) * pageSize) - .Take(pageSize) - .ToListAsync(); - return new PaginatedList() - { - Total = total, - Result = userClaims - }; - } - - public async Task GetDetailAsync(int id) - { - var userClaim = await _context.Set() - .FirstOrDefaultAsync(userClaim => userClaim.Id == id); - - return userClaim; - } - - public async Task> GetListAsync() - { - var userClaims = await _context.Set().ToListAsync(); - return userClaims; - } - - public async Task FindAsync(Expression> predicate) - { - return await _context.Set().FirstOrDefaultAsync(predicate); - } - - public async Task GetCountAsync(Expression> predicate) - { - return await _context.Set().Where(predicate).CountAsync(); - } - - public async ValueTask AddAsync(UserClaim userClaim) - { - var exist = await _context.Set().CountAsync(uc => uc.Name == userClaim.Name) > 0; - if (exist) - throw new UserFriendlyException($"UserClaim with name {userClaim.Name} already exists"); - - var newUserClaim = await _repository.AddAsync(userClaim); - await _context.SaveChangesAsync(); - - return newUserClaim; - } - - public async Task UpdateAsync(UserClaim userClaim) - { - var newUserClaim = await _repository.UpdateAsync(userClaim); - await _context.SaveChangesAsync(); - - return newUserClaim; - } - - public async Task RemoveAsync(UserClaim userClaim) - { - await _repository.RemoveAsync(userClaim); - await _context.SaveChangesAsync(); - } - - public async Task AddStandardUserClaimsAsync() - { - var userClaims = new List(); - foreach (var claim in StandardUserClaims.Claims) - { - var exist = await GetCountAsync(userClaim => userClaim.Name == claim.Key) > 0; - if (exist) continue; - - userClaims.Add(new UserClaim(claim.Key, claim.Value)); - } - await _repository.AddRangeAsync(userClaims); - await _context.SaveChangesAsync(); - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs deleted file mode 100644 index 9eaea907a..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.Data; -using Masa.BuildingBlocks.Data.UoW; - -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddOidcDbContext(this IServiceCollection services) where T : DbContext, IMasaDbContext - { - services.AddScoped(provider => new OidcDbContext(provider.GetRequiredService())); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - - return services; - } - - public static async Task AddOidcDbContext(this IServiceCollection services, Func options) where T : DbContext, IMasaDbContext - { - services.AddOidcDbContext(); - using var scope = services.BuildServiceProvider().CreateScope(); - var oidcDbContextOptions = new OidcDbContextOptions(scope.ServiceProvider); - await options.Invoke(oidcDbContextOptions); - var unitOfWork = scope.ServiceProvider.GetService(); - if(unitOfWork is not null) - { - await unitOfWork.CommitAsync(); - } - } -} diff --git a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs b/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs deleted file mode 100644 index 905a8f086..000000000 --- a/src/Contrib/Authentication/Oidc/EntityFrameworkCore/src/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Caches; -global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.DbContexts; -global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Options; -global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Metadata.Builders; -global using Microsoft.Extensions.DependencyInjection; -global using System.Linq.Expressions; diff --git a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj deleted file mode 100644 index e9b51e426..000000000 --- a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - $(WarningsAsErrors);CS8600;CS8601;CS8602;CS8603;CS8604;CS8609;CS8610;CS8614;CS8616;CS8618;CS8619;CS8620;CS8622;CS8625 - - - - - - - - - diff --git a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md deleted file mode 100644 index 7c54883d0..000000000 --- a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md +++ /dev/null @@ -1,47 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Authentication.Oidc.Cache.Storage - -Effect: - -Use IClientStore and IResourceStore get oidc resources and client data. - -```c# -├── IClientStore -├── IResourceStore -``` - -Example: - -```C# -Install-Package Masa.Contrib.Authentication.Oidc.Cache.Storage -``` - -```C# -builder.Services.AddOidcCacheStorage(nnew RedisConfigurationOptions -{ - Servers = new List - { - new RedisServerOptions - { - Host="127.0.0.1", - Port=6379 - } - }, - DefaultDatabase = 0, - Password = "", -}); -``` - -How to use: - -```c# -var app = builder.Build(); - -app.MapGet("/GetClient", async ([FromServices] IClientStore store) => -{ - return await store.FindClientByIdAsync("clientId"); -}); - -app.Run(); -``` diff --git a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md deleted file mode 100644 index 7d050dabb..000000000 --- a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md +++ /dev/null @@ -1,47 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Authentication.Oidc.Cache.Storag - -作用: - -通过IClientStore和IResourceStore获取资源和客户端的相关数据 - -```c# -├── IClientStore -├── IResourceStore -``` - -用例: - -```C# -Install-Package Masa.Contrib.Authentication.Oidc.Cache.Storag -``` - -```C# -builder.Services.AddOidcCacheStorage(nnew RedisConfigurationOptions -{ - Servers = new List - { - new RedisServerOptions - { - Host="127.0.0.1", - Port=6379 - } - }, - DefaultDatabase = 0, - Password = "", -}); -``` - -如何使用: - -```c# -var app = builder.Build(); - -app.MapGet("/GetClient", async ([FromServices] IClientStore store) => -{ - return await store.FindClientByIdAsync("clientId"); -}); - -app.Run(); -``` diff --git a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs deleted file mode 100644 index 850232a68..000000000 --- a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddOidcCacheStorage(this IServiceCollection services, RedisConfigurationOptions options) - { - services.AddOidcCache(options); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - - return services; - } -} diff --git a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs deleted file mode 100644 index bd2ad9e71..000000000 --- a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; - -public class ClientStore : IClientStore -{ - IClientCache _clientCache; - - public ClientStore(IClientCache clientCache) - { - _clientCache = clientCache; - } - - public async Task FindClientByIdAsync(string clientId) - { - ArgumentNullException.ThrowIfNull(clientId); - - var client = await _clientCache.GetAsync(clientId); - return client; - } -} diff --git a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs deleted file mode 100644 index 2e6f65101..000000000 --- a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; - -public class DeviceFlowStore : IDeviceFlowStore -{ - public Task FindByDeviceCodeAsync(string deviceCode) - { - throw new NotImplementedException(); - } - - public Task FindByUserCodeAsync(string userCode) - { - throw new NotImplementedException(); - } - - public Task RemoveByDeviceCodeAsync(string deviceCode) - { - throw new NotImplementedException(); - } - - public Task StoreDeviceAuthorizationAsync(string deviceCode, string userCode, DeviceCodeModel data) - { - throw new NotImplementedException(); - } - - public Task UpdateByUserCodeAsync(string userCode, DeviceCodeModel data) - { - throw new NotImplementedException(); - } -} diff --git a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs deleted file mode 100644 index ebab3a890..000000000 --- a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; - -public class PersistedGrantStore : IPersistedGrantStore -{ - public Task> GetAllAsync(PersistedGrantFilter filter) - { - throw new NotImplementedException(); - } - - public Task GetAsync(string key) - { - throw new NotImplementedException(); - } - - public Task RemoveAllAsync(PersistedGrantFilter filter) - { - throw new NotImplementedException(); - } - - public Task RemoveAsync(string key) - { - throw new NotImplementedException(); - } - - public Task StoreAsync(PersistedGrantModel grant) - { - throw new NotImplementedException(); - } -} diff --git a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs deleted file mode 100644 index 856805159..000000000 --- a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; - -public class ResourceStore : IResourceStore -{ - IIdentityResourceCache _identityResourceCache; - IApiResourceCache _apiResourceCache; - IApiScopeCache _apiScopeCache; - - public ResourceStore(IIdentityResourceCache identityResourceCache, IApiResourceCache apiResourceCache, IApiScopeCache apiScopeCache) - { - _identityResourceCache = identityResourceCache; - _apiResourceCache = apiResourceCache; - _apiScopeCache = apiScopeCache; - } - - public async Task> FindApiResourcesByNameAsync(IEnumerable apiResourceNames) - { - ArgumentNullException.ThrowIfNull(apiResourceNames); - - return await _apiResourceCache.GetListAsync(apiResourceNames); - } - - public async Task> FindApiResourcesByScopeNameAsync(IEnumerable scopeNames) - { - ArgumentNullException.ThrowIfNull(scopeNames); - - var apiResources = await _apiResourceCache.GetListAsync(); - return apiResources.Where(apiResource => apiResource.Scopes?.Any(scope => scopeNames.Contains(scope)) is true); - } - - public async Task> FindApiScopesByNameAsync(IEnumerable scopeNames) - { - ArgumentNullException.ThrowIfNull(scopeNames); - - var apiScopes = await _apiScopeCache.GetListAsync(scopeNames); - return apiScopes; - } - - public async Task> FindIdentityResourcesByScopeNameAsync(IEnumerable scopeNames) - { - ArgumentNullException.ThrowIfNull(scopeNames); - - var identityResources = await _identityResourceCache.GetListAsync(scopeNames); - return identityResources; - } - - public async Task GetAllResourcesAsync() - { - var identityResources = await _identityResourceCache.GetListAsync(); - var apiScopes = await _apiScopeCache.GetListAsync(); - var apiResources = await _apiResourceCache.GetListAsync(); - var resources = new ResourcesModel(identityResources, apiResources, apiScopes); - return resources; - } -} diff --git a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs b/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs deleted file mode 100644 index 111ca2413..000000000 --- a/src/Contrib/Authentication/Oidc/Storage/src/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; -global using Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; -global using Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; -global using Microsoft.Extensions.DependencyInjection; -global using Masa.Utils.Caching.Redis.Models; diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ConfigurationOptions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ConfigurationOptions.cs deleted file mode 100644 index 47d6531d1..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ConfigurationOptions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public class ConfigurationOptions -{ - public Assembly[] Assemblies { get; set; } - - public List ExcludeConfigurationSourceTypes { get; set; } - - public List ExcludeConfigurationProviderTypes { get; set; } - - public ConfigurationOptions() - { - Assemblies = AppDomain.CurrentDomain.GetAssemblies(); - ExcludeConfigurationSourceTypes = Internal.ConfigurationExtensions.DefaultExcludeConfigurationSourceTypes; - ExcludeConfigurationProviderTypes = Internal.ConfigurationExtensions.DefaultExcludeConfigurationProviderTypes; - } -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultConfigurationApi.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultConfigurationApi.cs deleted file mode 100644 index dcf6d8b4b..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultConfigurationApi.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public class DefaultConfigurationApi : IConfigurationApi -{ - private readonly IConfiguration _configuration; - - public DefaultConfigurationApi(IConfiguration configuration) - { - _configuration = configuration; - } - - public IConfiguration Get(string appId) - { - return _configuration.GetSection(SectionTypes.ConfigurationApi.ToString()).GetSection(appId); - } -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs deleted file mode 100644 index eab1a495e..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public class DefaultMasaConfiguration : IMasaConfiguration -{ - private readonly IConfiguration _configuration; - - public IConfiguration Local => GetConfiguration(SectionTypes.Local); - - public IConfigurationApi ConfigurationApi { get; } - - public DefaultMasaConfiguration(IConfiguration configuration, IConfigurationApi configurationApi) - { - _configuration = configuration; - ConfigurationApi = configurationApi; - } - - public IConfiguration GetConfiguration(SectionTypes sectionType) => _configuration.GetSection(sectionType.ToString()); -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs deleted file mode 100644 index 9de09e6fa..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public class DefaultMasaConfigurationSourceProvider : IMasaConfigurationSourceProvider -{ - public virtual (List MigrateConfigurationSources, List ConfigurationSources) GetMigrated( - IConfigurationBuilder configurationBuilder, - List excludeConfigurationSourceTypes, - List excludeConfigurationProviderTypes) - { - List migrateConfigurationSources = new(); - List configurationSources = new(); - foreach (var source in configurationBuilder.Sources) - { - var result = GetMigrated(source, excludeConfigurationSourceTypes, excludeConfigurationProviderTypes); - migrateConfigurationSources.AddRange(result.MigrateConfigurationSources); - configurationSources.AddRange(result.ConfigurationSources); - } - return (migrateConfigurationSources, configurationSources); - } - - public virtual (List MigrateConfigurationSources, List ConfigurationSources) - GetMigrated( - IConfiguration configuration, - List excludeConfigurationSourceTypes, - List excludeConfigurationProviderTypes) - { - List migrateConfigurationSources = new(); - List configurationSources = new(); - if (configuration is IConfigurationBuilder configurationBuilder) - { - foreach (var configurationSource in configurationBuilder.Sources) - { - var result = GetMigrated( - configurationSource, - excludeConfigurationSourceTypes, - excludeConfigurationProviderTypes); - migrateConfigurationSources.AddRange(result.MigrateConfigurationSources); - configurationSources.AddRange(result.ConfigurationSources); - } - } - else if (configuration is IConfigurationRoot configurationRoot) - { - foreach (var configurationProvider in configurationRoot.Providers) - { - var masaConfigurationSource = new MasaConfigurationSource(configurationProvider); - if (excludeConfigurationProviderTypes.Contains(configurationProvider.GetType())) - configurationSources.Add(masaConfigurationSource); - else migrateConfigurationSources.Add(masaConfigurationSource); - } - } - return new(migrateConfigurationSources, configurationSources); - } - - public virtual (List MigrateConfigurationSources, List ConfigurationSources) - GetMigrated( - IConfigurationSource configurationSource, - List excludeConfigurationSourceTypes, - List excludeConfigurationProviderTypes) - { - List migrateConfigurationSources = new(); - List configurationSources = new(); - if (excludeConfigurationSourceTypes.Contains(configurationSource.GetType())) - { - configurationSources.Add(configurationSource); - return (migrateConfigurationSources, configurationSources); - } - if (configurationSource is ChainedConfigurationSource chainedConfigurationSource) - return GetMigrated( - chainedConfigurationSource.Configuration, - excludeConfigurationSourceTypes, - excludeConfigurationProviderTypes); - - migrateConfigurationSources.Add(configurationSource); - return (migrateConfigurationSources, configurationSources); - } -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs deleted file mode 100644 index 0bdf49ab8..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public interface IMasaConfigurationSourceProvider -{ - (List MigrateConfigurationSources, List ConfigurationSources) GetMigrated( - IConfigurationBuilder configurationBuilder, - List excludeConfigurationSourceTypes, - List excludeConfigurationProviderTypes); -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs deleted file mode 100644 index 958eb9ed7..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.Internal; - -internal static class ConfigurationExtensions -{ - public static readonly List DefaultExcludeConfigurationProviderTypes = new() - { - typeof(EnvironmentVariablesConfigurationProvider), - typeof(MemoryConfigurationProvider), - typeof(CommandLineConfigurationProvider), - typeof(KeyPerFileConfigurationProvider) - }; - - public static readonly List DefaultExcludeConfigurationSourceTypes = new() - { - typeof(CommandLineConfigurationSource), - typeof(EnvironmentVariablesConfigurationSource), - typeof(KeyPerFileConfigurationSource), - typeof(MemoryConfigurationSource) - }; - - public static IConfigurationBuilder AddRange(this IConfigurationBuilder configurationBuilder, - IEnumerable configurationSources) - { - foreach (var configurationSource in configurationSources) - configurationBuilder.Add(configurationSource); - return configurationBuilder; - } -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs deleted file mode 100644 index f77e56bbc..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public abstract class LocalMasaConfigurationOptions : MasaConfigurationOptions -{ - /// - /// ParentSection is not required for local configuration - /// - [JsonIgnore] - public sealed override string? ParentSection => null; - - [JsonIgnore] - public sealed override SectionTypes SectionType => SectionTypes.Local; -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs deleted file mode 100644 index 80478d62d..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -internal class LocalMasaConfigurationRepository : AbstractConfigurationRepository -{ - public override SectionTypes SectionType => SectionTypes.Local; - - private Properties _data = new(); - - public LocalMasaConfigurationRepository( - IConfiguration configuration, - ILoggerFactory? loggerFactory) - : base(loggerFactory) - { - Initialize(configuration); - - ChangeToken.OnChange(configuration.GetReloadToken, () => - { - Initialize(configuration); - FireRepositoryChange(SectionType, Load()); - }); - } - - private void Initialize(IConfiguration configuration) - { - Dictionary data = new(); - GetData(configuration, configuration.GetChildren(), ref data); - _data = new Properties(data); - } - - private void GetData(IConfiguration configuration, IEnumerable configurationSections, - ref Dictionary dictionary) - { - foreach (var configurationSection in configurationSections) - { - var section = configuration.GetSection(configurationSection.Path); - - var childrenSections = section.GetChildren()?.ToList() ?? new List(); - - if (!section.Exists() || !childrenSections.Any()) - { - var key = section.Path; - if (!dictionary.ContainsKey(key)) - { - dictionary.Add(key, configuration[section.Path]); - } - } - else - { - GetData(configuration, childrenSections, ref dictionary); - } - } - } - - public override Properties Load() - { - return _data; - } -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj deleted file mode 100644 index c362d33f8..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs deleted file mode 100644 index 6f9a3b564..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public class MasaConfigurationBuilder : IMasaConfigurationBuilder -{ - private readonly IConfigurationBuilder _builder; - - public IServiceCollection Services { get; } - - public IDictionary Properties => _builder.Properties; - - public IList Sources => _builder.Sources; - - private IConfiguration? _configuration; - - public IConfiguration Configuration => _configuration ??= _builder.Build(); - - internal List Repositories { get; } = new(); - - internal List Relations { get; } = new(); - - public MasaConfigurationBuilder(IServiceCollection services, IConfigurationBuilder builder) - { - Services = services; - _builder = builder; - } - - public void AddRepository(IConfigurationRepository configurationRepository) - => Repositories.Add(configurationRepository); - - public void AddRelations(params ConfigurationRelationOptions[] relationOptions) - => Relations.AddRange(relationOptions); - - public IConfigurationBuilder Add(IConfigurationSource source) => _builder.Add(source); - - public IConfigurationRoot Build() => _builder.Build(); -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs deleted file mode 100644 index 19e371e7b..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public static class MasaConfigurationExtensions -{ - public static void UseMasaOptions(this IMasaConfigurationBuilder builder, Action options) - { - var relation = new MasaRelationOptions(); - options.Invoke(relation); - builder.AddRelations(relation.Relations.ToArray()); - } - - internal static void AutoMapping(this MasaConfigurationBuilder builder, params Assembly[] assemblies) - { - var optionTypes = assemblies - .SelectMany(assembly => assembly.GetTypes()) - .Where(type => type != typeof(IMasaConfigurationOptions) && - type != typeof(MasaConfigurationOptions) && - !type.IsAbstract && - typeof(IMasaConfigurationOptions).IsAssignableFrom(type)) - .ToList(); - optionTypes.ForEach(optionType => - { - var constructorInfo = optionType.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).FirstOrDefault(info => info.GetParameters().Length == 0); - - if (constructorInfo == null) - throw new Exception($"[{optionType.Name}] must have a parameterless constructor"); - - var option = (IMasaConfigurationOptions)Activator.CreateInstance(optionType, !constructorInfo.IsPublic)!; - var sectionName = option.Section ?? optionType.Name; - if (builder.Relations.Any(relation => relation.SectionType == option.SectionType && relation.Section == sectionName && relation.ObjectType == optionType)) - { - throw new ArgumentException( - "The section has been loaded, no need to load repeatedly, check whether there are duplicate sections or inheritance between auto-mapping classes"); - } - builder.AddRelations(new ConfigurationRelationOptions() - { - SectionType = option.SectionType, - ParentSection = option.ParentSection, - Section = sectionName, - ObjectType = optionType - }); - }); - } -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationProvider.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationProvider.cs deleted file mode 100644 index 61b964150..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationProvider.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public class MasaConfigurationProvider : ConfigurationProvider, IRepositoryChangeListener, IDisposable -{ - private readonly ConcurrentDictionary _data; - private readonly IEnumerable _configurationRepositories; - - public MasaConfigurationProvider(MasaConfigurationSource source) - { - _data = new(); - _configurationRepositories = source.Builder!.Repositories; - - foreach (var configurationRepository in _configurationRepositories) - { - configurationRepository.AddChangeListener(this); - } - } - - public override void Load() - { - foreach (var configurationRepository in _configurationRepositories) - { - var properties = configurationRepository.Load(); - _data[configurationRepository.SectionType] = properties; - } - SetData(); - } - - public void OnRepositoryChange(SectionTypes sectionType, Properties newProperties) - { - if (_data[sectionType] == newProperties) - return; - - _data[sectionType] = newProperties; - - SetData(); - - OnReload(); - } - - void SetData() - { - Dictionary data = new(); - - foreach (var configurationType in _data.Keys) - { - var properties = _data[configurationType]; - foreach (var key in properties.GetPropertyNames()) - { - data[$"{configurationType}{ConfigurationPath.KeyDelimiter}{key}"] = properties.GetProperty(key)!; - } - } - - Data = data; - } - - public void Dispose() - { - foreach (var configurationRepository in _configurationRepositories) - { - configurationRepository.RemoveChangeListener(this); - } - } -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationSource.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationSource.cs deleted file mode 100644 index b8739b1c1..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaConfigurationSource.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public class MasaConfigurationSource : IConfigurationSource -{ - internal readonly MasaConfigurationBuilder? Builder; - - internal readonly IConfigurationProvider? ConfigurationProvider; - - public MasaConfigurationSource(MasaConfigurationBuilder builder) => Builder = builder; - - public MasaConfigurationSource(IConfigurationProvider configurationProvider) => ConfigurationProvider = configurationProvider; - - public IConfigurationProvider Build(IConfigurationBuilder builder) - => Builder != null ? new MasaConfigurationProvider(this) : ConfigurationProvider!; -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaRelationOptions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaRelationOptions.cs deleted file mode 100644 index 8b7c9aaec..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/MasaRelationOptions.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration; - -public class MasaRelationOptions -{ - internal List Relations { get; } = new(); - - /// - /// Map Section relationship By Local - /// - /// - /// The default is null, which is consistent with the mapping class name, and string.Empty when no root node exists - /// - public MasaRelationOptions MappingLocal(string? section = null) where TModel : class - => Mapping(SectionTypes.Local, null!, section); - - /// - /// Map Section relationship By ConfigurationApi - /// - /// - /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType - /// The default is null, which is consistent with the mapping class name, and string.Empty when no root node exists - /// - public MasaRelationOptions MappingConfigurationApi(string parentSection, string? section = null) where TModel : class - => Mapping(SectionTypes.ConfigurationApi, parentSection, section); - - /// - /// Map Section relationship - /// - /// - /// - /// parent section, local section is the name of the locally configured section, and ConfigurationApi is the name of the Appid where the configuration is located - /// The default is null, which is consistent with the mapping class name - /// - /// - public MasaRelationOptions Mapping(SectionTypes sectionType, string parentSection, string? section = null) where TModel : class - { - section ??= typeof(TModel).Name; - - if (Relations.Any(relation => relation.SectionType == sectionType && relation.Section == section)) - throw new ArgumentOutOfRangeException(nameof(section), "The current section already has a configuration"); - - Relations.Add(new ConfigurationRelationOptions() - { - SectionType = sectionType, - ParentSection = parentSection, - Section = section, - ObjectType = typeof(TModel) - }); - return this; - } -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.md b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.md deleted file mode 100644 index 804ce4cba..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.md +++ /dev/null @@ -1,125 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Configuration - -Structure: - -```c# -IConfiguration -├── Local Local node (fixed) -│ ├── Redis Custom configuration -│ ├── ├── Host Parameter -├── ConfigurationApi Remote node (fixed) -│ ├── AppId Replace-With-Your-AppId -│ ├── AppId ├── Redis Custom node -│ ├── AppId ├── Redis ├── Host Parameter -``` - -Example: - -```C# -Install-Package Masa.Contrib.Configuration -Install-Package Masa.Contrib.StackSdks.Dcc //DCC can provide remote configuration capabilities -​```json -{ - //Custom configuration - "Redis": { - "Host": "localhost" - }, - //Dcc configuration, extended Configuration capabilities, support remote configuration - "DccOptions": { - "ManageServiceAddress": "http://localhost:8890", - "RedisOptions": { - "Servers": [ - { - "Host": "localhost", - "Port": 8889 - } - ], - "DefaultDatabase": 0, - "Password": "" - } - }, - "AppId": "Replace-With-Your-AppId", - "ConfigObjects": [ "Redis" ], //The name of the object to be mounted. Here, the Redis configuration will be mounted under the ConfigurationApi: node - "Secret": "", //Dcc App key - "Cluster": "Default" -} -``` - -Automatically map node relationships: - -```c# -public class RedisOptions : LocalMasaConfigurationOptions -{ - [JsonIgnore] - public override string? Section { get; init; } = "Redis"; - - public string Host { get; set; } -} - -//Use MasaConfiguration to take over Configuration, and mount the current Configuration to Local section by default -builder.AddMasaConfiguration(configurationBuilder => -{ - //configurationBuilder.UseDcc(builder.Services);//Use Dcc to extend Configuration capabilities and support remote configuration -}); -``` - -> Local configuration needs to inherit LocalMasaConfigurationOptions - -Or manually map node relationships: - -```C# -builder.AddMasaConfiguration(configurationBuilder => -{ - //configurationBuilder.UseDcc(builder.Services);//Use Dcc to extend Configuration capabilities and support remote configuration - - configurationBuilder.UseMasaOptions(options => - { - options.MappingLocal("Redis"); //Map the RedisOptions binding to the Local:Redis node - }); -}); -``` - -how to use: - -```c# -var app = builder.Build(); - -app.Map("/GetRedis", ([FromServices] IOptions option) => -{ - //Recommended (need to automatically or manually map the node relationship before it can be used) - return System.Text.Json.JsonSerializer.Serialize(option.Value); -}); - -app.Map("/GetRedis", ([FromServices] IOptionsMonitor option) => -{ - //Recommended (need to automatically or manually map the node relationship before it can be used) - options.OnChange(option => - { - //TODO Configuration update service - }); - - return System.Text.Json.JsonSerializer.Serialize(option.CurrentValue); -}); - -app.Map("/GetRedisHost", ([FromServices] IConfiguration configuration) => -{ - //Base - return configuration["Local:Redis:Host"]; -}); - -app.Run(); -``` - -How to take over more local nodes? - -```c# -builder.AddMasaConfiguration(builder => builder.AddJsonFile("custom.json", true, true));//In addition to the default ICongiguration, mount custom.json into the new Configuration -``` - -Tip: - -Configuration automatically obtains classes that inherit LocalMasaConfigurationOptions by default, and maps node relationships to facilitate obtaining configuration information through IOptions, IOptionsSnapshot, and IOptionsMonitor - -The above Redis is a local configuration, which is used to demonstrate the effect and usage of the local configuration after it is mounted to IConfiguration \ No newline at end of file diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.zh-CN.md b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.zh-CN.md deleted file mode 100644 index 84b722cd6..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/README.zh-CN.md +++ /dev/null @@ -1,131 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Configuration - -结构: - -```c# -IConfiguration -├── Local 本地节点(固定) -│ ├── Redis 自定义配置 -│ ├── ├── Host 参数 -├── ConfigurationApi 远程节点(固定) -│ ├── AppId 替换为你的AppId -│ ├── AppId ├── Redis 自定义节点 -│ ├── AppId ├── Redis ├── Host 参数 -``` - -用例: - -```C# -Install-Package Masa.Contrib.Configuration -Install-Package Masa.Contrib.StackSdks.Dcc //DCC可提供远程配置的能力 -``` - -appsettings.json -```json -{ - //自定义配置 - "Redis": { - "Host": "localhost" - }, - //Dcc配置,扩展Configuration能力,支持远程配置 - "DccOptions": { - "ManageServiceAddress ": "http://localhost:8890", - "RedisOptions": { - "Servers": [ - { - "Host": "localhost", - "Port": 8889 - } - ], - "DefaultDatabase": 0, - "Password": "" - } - }, - "AppId": "Replace-With-Your-AppId", - "ConfigObjects": [ "Redis" ], // 要挂载的对象名称,此处会将Redis配置挂载到ConfigurationApi:节点下 - "Secret": "", //Dcc App 秘钥 - "Cluster": "Default" -} -``` - -自动映射节点关系: - -```c# -/// -/// 自动映射节点关系 -/// -public class RedisOptions : LocalMasaConfigurationOptions -{ - [JsonIgnore] - public override string? Section { get; init; } = "Redis"; - - public string Host { get; set; } -} - -//使用MasaConfiguration接管Configuration,默认会将当前的Configuration挂载到Local节点下 -builder.AddMasaConfiguration(configurationBuilder => -{ - //configurationBuilder.UseDcc();//使用Dcc 扩展Configuration能力,支持远程配置 -}); -``` - -> 本地配置需要继承LocalMasaConfigurationOptions - -或手动添加映射节点关系: - -```C# -builder.AddMasaConfiguration(configurationBuilder => -{ - //configurationBuilder.UseDcc();//使用Dcc 扩展Configuration能力,支持远程配置 - - configurationBuilder.UseMasaOptions(options => - { - options.MappingLocal("Redis"); //将RedisOptions绑定映射到Local:Redis节点 - }); -}); -``` - -如何使用: - -```c# -var app = builder.Build(); - -app.Map("/GetRedis", ([FromServices] IOptions option) => -{ - //推荐(需要自动或手动映射节点关系后才能使用) - return System.Text.Json.JsonSerializer.Serialize(option.Value); -}); - -app.Map("/GetRedis", ([FromServices] IOptionsMonitor option) => -{ - options.OnChange(option => - { - //TODO 配置更新业务 - }); - - return System.Text.Json.JsonSerializer.Serialize(option.CurrentValue); -});//推荐(需要自动或手动映射节点关系后才能使用) - -app.Map("/GetRedisformHost", ([FromServices] IConfiguration configuration) => -{ - //基础 - return configuration["Local:Redis:Host"]; -}); - -app.Run(); -``` - -如何接管更多的本地节点? - -```c# -builder.AddMasaConfiguration(builder => builder.AddJsonFile("custom.json", true, true));//除了默认的ICongiguration,还将custom.json挂载到新的Configuration中 -``` - -提示: - -Configuration默认自动获取继承LocalMasaConfigurationOptions的类,并映射节点关系,方便通过IOptions、IOptionsSnapshot、IOptionsMonitor获取配置信息 - -上文Redis为本地配置,用于演示本地配置挂载到IConfiguration后的效果以及使用用法 - diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs deleted file mode 100644 index 8e039562e..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IConfigurationRoot CreateMasaConfiguration( - this IServiceCollection services, - Action? configureDelegate, - IConfigurationBuilder configurationBuilder, - params Assembly[] assemblies) - { - return services.CreateMasaConfiguration( - configureDelegate, - configurationBuilder, - options => options.Assemblies = assemblies); - } - - public static IConfigurationRoot CreateMasaConfiguration( - this IServiceCollection services, - Action? configureDelegate, - IConfigurationBuilder configurationBuilder, - Action? action) - { - if (services.Any(service => service.ImplementationType == typeof(MasaConfigurationProvider))) - return new ConfigurationBuilder().Build(); - - services.AddSingleton(); - services.AddOptions(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - var configurationOptions = new ConfigurationOptions(); - action?.Invoke(configurationOptions); - - var configurationSourceResult = services - .BuildServiceProvider() - .GetRequiredService() - .GetMigrated(configurationBuilder, configurationOptions.ExcludeConfigurationSourceTypes, configurationOptions.ExcludeConfigurationProviderTypes); - - MasaConfigurationBuilder masaConfigurationBuilder = new MasaConfigurationBuilder(services, - new ConfigurationBuilder().AddRange(configurationSourceResult.MigrateConfigurationSources)); - configureDelegate?.Invoke(masaConfigurationBuilder); - - MasaConfigurationBuilder builder = new(services, new ConfigurationBuilder()); - builder.AddRelations(masaConfigurationBuilder.Relations.ToArray()); - masaConfigurationBuilder.Repositories.ForEach(repository => builder.AddRepository(repository)); - var localConfigurationRepository = new LocalMasaConfigurationRepository( - masaConfigurationBuilder.Configuration, - services.BuildServiceProvider().GetService()); - builder.AddRepository(localConfigurationRepository); - - var source = new MasaConfigurationSource(builder); - var configuration = builder - .Add(source) - .AddRange(configurationSourceResult.ConfigurationSources) - .Build(); - - builder.AutoMapping(configurationOptions.Assemblies); - - builder.Relations.ForEach(relation => - { - List sectionNames = new() - { - relation.SectionType.ToString(), - }; - if (!string.IsNullOrEmpty(relation.ParentSection)) - sectionNames.Add(relation.ParentSection); - - if (relation.Section != "") - { - sectionNames.AddRange(relation.Section!.Split(ConfigurationPath.KeyDelimiter)); - } - - services.ConfigureOption(configuration, sectionNames, relation.ObjectType); - }); - - return configuration; - } - - private static void ConfigureOption( - this IServiceCollection services, - IConfiguration configuration, - List sectionNames, - Type optionType) - { - IConfigurationSection? configurationSection = null; - foreach (var sectionName in sectionNames) - { - if (configurationSection == null) - configurationSection = configuration.GetSection(sectionName); - else - configurationSection = configurationSection.GetSection(sectionName); - } - if (!configurationSection.Exists()) - throw new Exception($"Check if the mapping section is correct,section name is [{configurationSection!.Path}]"); - - var configurationChangeTokenSource = - Activator.CreateInstance(typeof(ConfigurationChangeTokenSource<>).MakeGenericType(optionType), string.Empty, - configurationSection)!; - services.TryAdd(new ServiceDescriptor(typeof(IOptionsChangeTokenSource<>).MakeGenericType(optionType), - configurationChangeTokenSource)); - - Action configureBinder = _ => - { - }; - var configureOptions = - Activator.CreateInstance(typeof(NamedConfigureFromConfigurationOptions<>).MakeGenericType(optionType), - string.Empty, - configurationSection, configureBinder)!; - services.TryAdd(new ServiceDescriptor(typeof(IConfigureOptions<>).MakeGenericType(optionType), - configureOptions)); - } - - private class MasaConfigurationProvider - { - - } -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs deleted file mode 100644 index bb0a3beaf..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Builder; - -public static class WebApplicationBuilderExtensions -{ - public static WebApplicationBuilder AddMasaConfiguration( - this WebApplicationBuilder builder, - Action? configureDelegate = null) - { - Action? action = null; - return builder.AddMasaConfiguration(configureDelegate, action); - } - - public static WebApplicationBuilder AddMasaConfiguration( - this WebApplicationBuilder builder, - params Assembly[] assemblies) - => builder.AddMasaConfiguration( - null, - options => options.Assemblies = assemblies); - - public static WebApplicationBuilder AddMasaConfiguration( - this WebApplicationBuilder builder, - Action? action) - => builder.AddMasaConfiguration(null, action); - - public static WebApplicationBuilder AddMasaConfiguration( - this WebApplicationBuilder builder, - Action? configureDelegate, - params Assembly[] assemblies) - => builder.AddMasaConfiguration( - configureDelegate, - options => options.Assemblies = assemblies); - - public static WebApplicationBuilder AddMasaConfiguration( - this WebApplicationBuilder builder, - Action? configureDelegate, - Action? action) - { - IConfigurationRoot masaConfiguration = - builder.Services.CreateMasaConfiguration( - configureDelegate, - builder.Configuration, - action); - - if (!masaConfiguration.Providers.Any()) - return builder; - - Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.ConfigureAppConfiguration( - builder.Host, - configBuilder => configBuilder.Sources.Clear()); - builder.Configuration.AddConfiguration(masaConfiguration); - - return builder; - } - - public static IMasaConfiguration GetMasaConfiguration(this WebApplicationBuilder builder) - => builder.Services.BuildServiceProvider().GetRequiredService(); -} diff --git a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/_Imports.cs b/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/_Imports.cs deleted file mode 100644 index 9d41a9afa..000000000 --- a/src/Contrib/Configuration/Configuration/src/Masa.Contrib.Configuration/_Imports.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Configuration; -global using Masa.BuildingBlocks.Configuration.Options; -global using Masa.Contrib.Configuration; -global using Masa.Contrib.Configuration.Internal; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.Configuration.CommandLine; -global using Microsoft.Extensions.Configuration.EnvironmentVariables; -global using Microsoft.Extensions.Configuration.KeyPerFile; -global using Microsoft.Extensions.Configuration.Memory; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using Microsoft.Extensions.Primitives; -global using System; -global using System.Collections.Concurrent; -global using System.Collections.Generic; -global using System.Linq; -global using System.Reflection; -global using System.Text.Json.Serialization; diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs deleted file mode 100644 index 3d06cf9d2..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests; - -public class EsOptions : LocalMasaConfigurationOptions -{ - public string[] Nodes { get; set; } - - public EsOptions(string[] nodes) - { - Nodes = nodes; - } -} diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj deleted file mode 100644 index 3c9bdfdf4..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - false - enable - Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests - - - - - - - diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs deleted file mode 100644 index 376df7c4a..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.AutoMap.Tests; - -public class KafkaOptions : LocalMasaConfigurationOptions -{ - public string Servers { get; set; } - - public int ConnectionPoolSize { get; set; } -} diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj deleted file mode 100644 index fcbea1bf7..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - - - diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs deleted file mode 100644 index e4b10e038..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.Tests.Config; - -public class MountSectionRedisOptions -{ - -} diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs deleted file mode 100644 index f7f9b2efb..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.Tests.Config; - -public class RabbitMqOptions : LocalMasaConfigurationOptions -{ - public string HostName { get; set; } - - public string UserName { get; set; } - - public string Password { get; set; } - - public string VirtualHost { get; set; } - - public string Port { get; set; } - - /// - /// The section null means same as the class name, else load from the specify section - /// - [JsonIgnore] - public override string? Section => "RabbitMq"; -} diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs deleted file mode 100644 index 108cdaa5a..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.Tests.Config; - -public class RedisOptions -{ - public string Ip { get; set; } - - public string Password { get; set; } - - public int Port { get; set; } -} diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs deleted file mode 100644 index ca361eb15..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.Tests.Config; - -public class SystemOptions : LocalMasaConfigurationOptions -{ - public string? Name { get; set; } -} diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs deleted file mode 100644 index 8c3d6da3a..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.Configuration.AutoMap.Tests; - -namespace Masa.Contrib.Configuration.Tests; - -[TestClass] -public class ConfigurationTest -{ - [TestMethod] - public void TestDefaultMasaConfiguration() - { - var configurationApi = Mock.Of(); - - var builder = WebApplication.CreateBuilder(); - var masaConfiguration = new DefaultMasaConfiguration(builder.Configuration, configurationApi); - var localConfiguration = masaConfiguration.GetConfiguration(SectionTypes.Local); - var configurationApiConfiguration = masaConfiguration.GetConfiguration(SectionTypes.Local); - Assert.IsTrue(!((IConfigurationSection)localConfiguration).Exists()); - Assert.IsTrue(!((IConfigurationSection)configurationApiConfiguration).Exists()); - } - - [TestMethod] - public void TestAddMasaConfigurationShouldThrowException() - { - var builder = WebApplication.CreateBuilder(); - Assert.ThrowsException(() => builder.AddMasaConfiguration()); - } - - [TestMethod] - public void TestAddJsonFileShouldReturnRabbitMqOptionAndSystemOptionsExist() - { - var builder = WebApplication.CreateBuilder(); - builder.AddMasaConfiguration(masaConfigurationBuilder - => masaConfigurationBuilder.AddJsonFile("rabbitMq.json", optional: false, reloadOnChange: true)); - var configurationApi = Mock.Of(); - var masaConfiguration = new DefaultMasaConfiguration(builder.Configuration, configurationApi); - var localConfiguration = masaConfiguration.GetConfiguration(SectionTypes.Local); - var configurationApiConfiguration = masaConfiguration.GetConfiguration(SectionTypes.ConfigurationApi); - Assert.IsTrue(((IConfigurationSection)localConfiguration).Exists()); - Assert.IsTrue(!((IConfigurationSection)configurationApiConfiguration).Exists()); - - var serviceProvider = builder.Services.BuildServiceProvider(); - var rabbitMqOptions = serviceProvider.GetRequiredService>(); - Assert.IsTrue(rabbitMqOptions is - { Value.HostName: "localhost", Value.UserName: "admin", Value.Password: "admin", Value.VirtualHost: "/", Value.Port: "5672" }); - - var systemOptions = serviceProvider.GetRequiredService>(); - Assert.IsTrue(systemOptions is { Value.Name: "Masa TEST" }); - - var redisOptions = serviceProvider.GetRequiredService>(); - Assert.IsTrue(redisOptions is { Value.Ip: null, Value.Password: null, Value.Port: 0 }); - } - - [TestMethod] - public void TestManuallyMappingShouldReturnRedisExist() - { - var builder = WebApplication.CreateBuilder(); - builder.AddMasaConfiguration(masaConfigurationBuilder => - { - masaConfigurationBuilder - .AddJsonFile("rabbitMq.json", optional: false, reloadOnChange: true) - .AddJsonFile("redis.json", optional: false, reloadOnChange: true); - - masaConfigurationBuilder.UseMasaOptions(options => - { - options.MappingLocal(); - }); - }); - - var configurationApi = Mock.Of(); - var masaConfiguration = new DefaultMasaConfiguration(builder.Configuration, configurationApi); - var localConfiguration = masaConfiguration.GetConfiguration(SectionTypes.Local); - var configurationApiConfiguration = masaConfiguration.GetConfiguration(SectionTypes.ConfigurationApi); - Assert.IsTrue(((IConfigurationSection)localConfiguration).Exists()); - Assert.IsTrue(!((IConfigurationSection)configurationApiConfiguration).Exists()); - - var serviceProvider = builder.Services.BuildServiceProvider(); - var rabbitMqOptions = serviceProvider.GetRequiredService>(); - Assert.IsTrue(rabbitMqOptions is - { Value.HostName: "localhost", Value.UserName: "admin", Value.Password: "admin", Value.VirtualHost: "/", Value.Port: "5672" }); - - var systemOptions = serviceProvider.GetRequiredService>(); - Assert.IsTrue(systemOptions is { Value.Name: "Masa TEST" }); - - var redisOptions = serviceProvider.GetRequiredService>(); - Assert.IsTrue(redisOptions is { Value.Ip: "localhost", Value.Password: "", Value.Port: 6379 }); - } - - [TestMethod] - public void TestMasaConfigurationBuilderShouldReturnSourceCount3() - { - var configurationBuilder = new ConfigurationBuilder() - .AddJsonFile("rabbitMq.json", optional: false, reloadOnChange: true) - .AddJsonFile("redis.json", optional: false, reloadOnChange: true); - var masaConfigurationBuilder = new MasaConfigurationBuilder(new ServiceCollection(), configurationBuilder); - Assert.IsTrue(masaConfigurationBuilder.Sources.Count == 2); - - var appsettingConfigurationBuilder = - new ConfigurationBuilder().AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); - Assert.IsTrue(appsettingConfigurationBuilder.Sources.Count == 1); - masaConfigurationBuilder.Add(appsettingConfigurationBuilder.Sources.FirstOrDefault()!); - Assert.IsTrue(masaConfigurationBuilder.Sources.Count == 3); - - Assert.IsTrue(masaConfigurationBuilder.Build()["KafkaOptions:Servers"] == - appsettingConfigurationBuilder.Build()["KafkaOptions:Servers"]); - - Assert.IsTrue(masaConfigurationBuilder.Properties.Count == configurationBuilder.Properties.Count); - } - - [TestMethod] - public void TestAddMultiMasaConfigurationShouldReturnIMasaConfigurationCount1() - { - var builder = WebApplication.CreateBuilder(); - builder.AddMasaConfiguration(configurationBuilder => - { - configurationBuilder.AddJsonFile("redis.json", true, true) - .AddJsonFile("rabbitMq.json", true, true); - - configurationBuilder.UseMasaOptions(option => option.MappingLocal("RedisOptions")); - }).AddMasaConfiguration(); - var serviceProvider = builder.Services.BuildServiceProvider(); - var configuration = serviceProvider.GetRequiredService(); - var redisOption = serviceProvider.GetRequiredService>(); - Assert.IsTrue(configuration["Local:RedisOptions:Ip"] == "localhost"); - Assert.IsTrue(redisOption.Value.Ip == "localhost"); - - var rabbitMqOption = serviceProvider.GetRequiredService>(); - Assert.IsTrue(configuration["Local:RabbitMq:UserName"] == "admin"); - Assert.IsTrue(rabbitMqOption.Value.UserName == "admin" && rabbitMqOption.Value.Password == "admin"); - - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestAutoMapSectionErrorShouldThrowException() - { - var builder = WebApplication.CreateBuilder(); - builder.Host.ConfigureAppConfiguration((_, config) => config.Sources.Clear()); - var chainedConfiguration = new ConfigurationBuilder() - .SetBasePath(builder.Environment.ContentRootPath) - .AddJsonFile("appsettings.json", true, true); - builder.Configuration.AddConfiguration(chainedConfiguration.Build()); - - Assert.ThrowsException(() - => builder.AddMasaConfiguration() - , $"Check if the mapping section is correct,section name is [{It.IsAny()}]"); - } - - [TestMethod] - public void TestSpecifyAssembliesShouldKafKaOptionsExist() - { - var builder = WebApplication.CreateBuilder(); - builder.Host.ConfigureAppConfiguration((_, config) => config.Sources.Clear()); - var chainedConfiguration = new ConfigurationBuilder() - .SetBasePath(builder.Environment.ContentRootPath) - .AddJsonFile("appsettings.json", true, true); - builder.Configuration.AddConfiguration(chainedConfiguration.Build()); - builder.AddMasaConfiguration(typeof(KafkaOptions).Assembly); - - var serviceProvider = builder.Services.BuildServiceProvider(); - var kafkaOptions = serviceProvider.GetRequiredService>(); - Assert.IsTrue(kafkaOptions is { Value: { Servers: "Kafka Server", ConnectionPoolSize: 10 } }); - } - - [TestMethod] - public void TestSpecifyAssembliesShouldThrowException() - { - var builder = WebApplication.CreateBuilder(); - Assert.ThrowsException(() => - { - return builder.AddMasaConfiguration(configurationBuilder => - { - configurationBuilder - .AddJsonFile("rabbitMq.json", true, true) - .AddJsonFile("redis.json", true, true); - configurationBuilder.UseMasaOptions(option => option.MappingConfigurationApi("Test")); - }); - }, $"Check if the mapping section is correct,section name is [{It.IsAny()}]"); - } - - [TestMethod] - public void TestNoParameterlessConstructorSpecifyAssembliesShouldThrowException() - { - var builder = WebApplication.CreateBuilder(); - Assert.ThrowsException( - () => builder.AddMasaConfiguration(typeof(ConfigurationTest).Assembly, typeof(EsOptions).Assembly), - $"[{It.IsAny()}] must have a parameterless constructor"); - } - - [TestMethod] - public void TestRepeatMapptingShouldThrowException() - { - var builder = WebApplication.CreateBuilder(); - Assert.ThrowsException(() => - { - builder.AddMasaConfiguration(configurationBuilder => - { - configurationBuilder.AddJsonFile("redis.json", true, true) - .AddJsonFile("rabbitMq.json", true, true); - - configurationBuilder.UseMasaOptions(option => option.MappingLocal().MappingLocal()); - }); - }, "The current section already has a configuration"); - } - - [TestMethod] - public void TestCreateMasaConfigurationShouldReturnRedisOptionsAndSystemOptionsExist() - { - var services = new ServiceCollection(); - services.CreateMasaConfiguration(configurationBuilder => - { - configurationBuilder.AddJsonFile("redis.json", true, true) - .AddJsonFile("rabbitMq.json", true, true); - - configurationBuilder.UseMasaOptions(option => option.MappingLocal().MappingLocal()); - }, new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", true, true)); - IServiceProvider serviceProvider = services.BuildServiceProvider(); - var redisOption = serviceProvider.GetRequiredService>(); - Assert.IsTrue(redisOption.Value.Ip == "localhost"); - - var systemOptions = serviceProvider.GetRequiredService>(); - Assert.IsTrue(systemOptions is { Value.Name: "Masa TEST" }); - } - - [TestMethod] - public async Task TestConfigurationChangeShouldReturnNameEmpty() - { - var builder = WebApplication.CreateBuilder(); - var rootPath = builder.Environment.ContentRootPath; - builder.AddMasaConfiguration(configurationBuilder => - { - configurationBuilder.AddJsonFile("customAppConfig.json", true, true) - .AddJsonFile("rabbitMq.json", true, true); - configurationBuilder.UseMasaOptions(option => option.MappingLocal()); - }, typeof(ConfigurationTest).Assembly); - - var serviceProvider = builder.Services.BuildServiceProvider(); - var redisOptions = serviceProvider.GetRequiredService>(); - - Assert.IsNotNull(redisOptions); - Assert.IsTrue(redisOptions.Value.Ip == "localhost" && redisOptions.Value.Port == 6379); - - var newRedisOption = redisOptions.Value; - newRedisOption.Ip = String.Empty; - - var oldContent = await File.ReadAllTextAsync(Path.Combine(rootPath, "customAppConfig.json")); - await File.WriteAllTextAsync(Path.Combine(rootPath, "customAppConfig.json"), - System.Text.Json.JsonSerializer.Serialize(new { RedisOptions = newRedisOption })); - - Thread.Sleep(2000); - var option = serviceProvider.GetRequiredService>(); - Assert.IsTrue(option.CurrentValue.Ip == "" && option.CurrentValue.Port == 6379); - - await File.WriteAllTextAsync(Path.Combine(rootPath, "customAppConfig.json"), oldContent); - } - - [TestMethod] - public void TestEnvironmentConfigurationMigrated() - { - var builder = WebApplication.CreateBuilder(); - Environment.SetEnvironmentVariable("project-name", "masa-unit-test"); - builder.AddMasaConfiguration(configurationBuilder => - { - configurationBuilder.AddJsonFile("customAppConfig.json", true, true) - .AddJsonFile("rabbitMq.json", true, true); - configurationBuilder.UseMasaOptions(option => option.MappingLocal()); - }, options => - { - options.Assemblies = new[] { typeof(ConfigurationTest).Assembly }; - options.ExcludeConfigurationSourceTypes = new List(); - options.ExcludeConfigurationProviderTypes = new List(); - }); - - Assert.IsTrue(builder.Configuration[$"{SectionTypes.Local}{ConfigurationPath.KeyDelimiter}project-name"] == "masa-unit-test"); - - } - - [TestMethod] - public void TestEnvironmentConfigurationNotMigrated() - { - var builder = WebApplication.CreateBuilder(); - Environment.SetEnvironmentVariable("project-name", "masa-unit-test"); - builder.AddMasaConfiguration(configurationBuilder => - { - configurationBuilder.AddJsonFile("customAppConfig.json", true, true) - .AddJsonFile("rabbitMq.json", true, true); - configurationBuilder.UseMasaOptions(option => option.MappingLocal()); - }, typeof(ConfigurationTest).Assembly); - - Assert.IsTrue(builder.Configuration["project-name"] == "masa-unit-test"); - } -} diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj deleted file mode 100644 index c122ce383..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj +++ /dev/null @@ -1,50 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - Always - - - - Always - - - - Always - - - - Always - - - - - - - - - - diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/_Imports.cs b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/_Imports.cs deleted file mode 100644 index 6cfdf19bb..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/_Imports.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Configuration; -global using Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests; -global using Masa.Contrib.Configuration.Tests.Config; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Text.Json.Serialization; diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/appsettings.json b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/appsettings.json deleted file mode 100644 index 124f418bc..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/appsettings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "KafkaOptions": { - "Servers": "Kafka Server", - "ConnectionPoolSize": 10 - }, - "SystemOptions": { - "Name": "Masa TEST" - }, - "EsOptions": { - "Nodes": [ - "http://localhost:9200" - ] - } -} \ No newline at end of file diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/customAppConfig.json b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/customAppConfig.json deleted file mode 100644 index 5fb6c8c30..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/customAppConfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "RedisOptions": { - "Ip": "localhost", - "Password": "", - "Port": 6379 - } -} \ No newline at end of file diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/rabbitMq.json b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/rabbitMq.json deleted file mode 100644 index 86ae5e2a1..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/rabbitMq.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "RabbitMq": { - "HostName": "localhost", - "UserName": "admin", - "Password": "admin", - "VirtualHost": "/", - "Port": 5672 - } -} \ No newline at end of file diff --git a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/redis.json b/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/redis.json deleted file mode 100644 index 5fb6c8c30..000000000 --- a/src/Contrib/Configuration/Configuration/test/Masa.Contrib.Configuration.Tests/redis.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "RedisOptions": { - "Ip": "localhost", - "Password": "", - "Port": 6379 - } -} \ No newline at end of file diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs deleted file mode 100644 index 87c8ea67a..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc; - -public class ConfigurationApiClient : ConfigurationApiBase, IConfigurationApiClient -{ - private readonly IServiceProvider _serviceProvider; - private readonly IMemoryCacheClient _client; - private readonly JsonSerializerOptions _jsonSerializerOptions; - private readonly ILogger? _logger; - - private readonly ConcurrentDictionary>> _taskExpandoObjects = new(); - private readonly ConcurrentDictionary>> _taskJsonObjects = new(); - private readonly IDeserializer _deserializer = new DeserializerBuilder().Build(); - - public ConfigurationApiClient( - IServiceProvider serviceProvider, - IMemoryCacheClient client, - JsonSerializerOptions jsonSerializerOptions, - DccSectionOptions defaultSectionOption, - List? expandSectionOptions) - : base(defaultSectionOption, expandSectionOptions) - { - _serviceProvider = serviceProvider; - _client = client; - _jsonSerializerOptions = jsonSerializerOptions; - _logger = serviceProvider.GetService>(); - } - - public Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string configObject, Action? valueChanged) - { - return GetRawAsync(GetEnvironment(string.Empty), GetCluster(string.Empty), GetAppId(string.Empty), configObject, valueChanged); - } - - public Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string environment, string cluster, string appId, - string configObject, Action? valueChanged) - { - var key = FomartKey(environment, cluster, appId, configObject); - return GetRawByKeyAsync(key, valueChanged); - } - - public Task GetAsync(string configObject, Action? valueChanged) - { - return GetAsync(GetEnvironment(string.Empty), GetCluster(string.Empty), GetAppId(string.Empty), configObject, valueChanged); - } - - public async Task GetAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged) - { - var key = FomartKey(environment, cluster, appId, configObject); - - var value = await _taskJsonObjects.GetOrAdd(key, k => new Lazy>(async () => - { - var options = new JsonSerializerOptions(_jsonSerializerOptions); - options.EnableDynamicTypes(); - - var result = await GetRawByKeyAsync(k, (value) => - { - var result = JsonSerializer.Deserialize(value, options); - - var newValue = new Lazy>(() => Task.FromResult((object)result!)); - _taskJsonObjects.AddOrUpdate(k, newValue, (_, _) => newValue); - valueChanged?.Invoke(result!); - }); - if (typeof(T).GetInterfaces().Any(type => type == typeof(IConvertible))) - { - if (result.ConfigurationType == ConfigurationTypes.Text) - return Convert.ChangeType(result.Raw, typeof(T)); - - throw new FormatException(result.Raw); - } - - return JsonSerializer.Deserialize(result.Raw, options) ?? throw new ArgumentException(nameof(configObject)); - })).Value; - - return (T)value; - } - - public async Task GetDynamicAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged) - { - var key = FomartKey(environment, cluster, appId, configObject); - - return await GetDynamicAsync(key, (k, value, options) => - { - var result = JsonSerializer.Deserialize(value, options); - var newValue = new Lazy>(() => Task.FromResult(result)!); - _taskExpandoObjects.AddOrUpdate(k, newValue!, (_, _) => newValue!); - valueChanged?.Invoke(result!); - }); - } - - public Task GetDynamicAsync(string configObject) - { - var key = FomartKey(GetEnvironment(string.Empty), GetCluster(string.Empty), GetAppId(string.Empty), configObject); - return GetDynamicAsync(key, null); - } - - protected virtual async Task GetDynamicAsync(string key, Action? valueChanged) - { - if (string.IsNullOrEmpty(key)) - throw new ArgumentNullException(nameof(key)); - - var value = _taskExpandoObjects.GetOrAdd(key, k => new Lazy>(async () => - { - var options = new JsonSerializerOptions(_jsonSerializerOptions); - options.EnableDynamicTypes(); - - var raw = await GetRawByKeyAsync(k, value => - { - valueChanged?.Invoke(k, value, options); - }); - return JsonSerializer.Deserialize(raw.Raw, options) ?? throw new ArgumentException(key); - })).Value; - - return await value; - } - - protected virtual async Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawByKeyAsync(string key, Action? valueChanged) - { - var raw = await _client.GetAsync(key, value => - { - var result = FormatRaw(value, key); - valueChanged?.Invoke(result.Raw); - }); - - return FormatRaw(raw, key); - } - - protected virtual (string Raw, ConfigurationTypes ConfigurationType) FormatRaw(string? raw, string paramName) - { - PublishRelease result = GetPublishRelease(raw, paramName); - - switch (result.ConfigFormat) - { - case ConfigFormats.Json: - return (result.Content!, ConfigurationTypes.Json); - - case ConfigFormats.Raw: - return (result.Content!, ConfigurationTypes.Text); - - case ConfigFormats.Properties: - try - { - var properties = PropertyConfigurationParser.Parse(result.Content!, _jsonSerializerOptions); - return (JsonSerializer.Serialize(properties, _jsonSerializerOptions), ConfigurationTypes.Properties); - } - catch (Exception exception) - { - _logger?.LogWarning(exception, - $"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is not a valid Properties type"); - throw new ArgumentException("configObject invalid"); - } - - case ConfigFormats.Xml: - try - { - var json = XmlConfigurationParser.XmlToJson(result.Content!); - return (json, ConfigurationTypes.Xml); - } - catch (Exception exception) - { - _logger?.LogWarning(exception, - $"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is not a valid Xml type"); - throw new ArgumentException("configObject invalid"); - } - - case ConfigFormats.Yaml: - try - { - var yamlObject = _deserializer.Deserialize(result.Content!); - - var serializer = new SerializerBuilder().JsonCompatible().Build(); - var json = serializer.Serialize(yamlObject); - return (json, ConfigurationTypes.Yaml); - } - catch (Exception exception) - { - _logger?.LogWarning(exception, - $"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is not a valid Yaml type"); - throw new ArgumentException("configObject invalid"); - } - - default: - throw new NotSupportedException("Unsupported configuration type"); - } - } - - private string FomartKey(string environment, string cluster, string appId, string configObject) - => $"{GetEnvironment(environment)}-{GetCluster(cluster)}-{GetAppId(appId)}-{GetConfigObject(configObject)}".ToLower(); - - private PublishRelease GetPublishRelease(string? raw, string paramName) - { - if (raw == null) - throw new ArgumentException($"configObject invalid, {paramName} is not null"); - - PublishRelease? result; - try - { - result = JsonSerializer.Deserialize(raw, _jsonSerializerOptions); - } - catch (Exception exception) - { - string message = $"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is not a valid response value"; - _logger?.LogWarning(exception, message); - throw new ArgumentException(message); - } - if (result == null || result.ConfigFormat == 0) - throw new ArgumentException($"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is an unsupported type"); - - return result; - } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs deleted file mode 100644 index 7b6d27c55..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.BuildingBlocks.Configuration; - -public static class ConfigurationApiExtensions -{ - - public static IConfiguration GetDefault(this IConfigurationApi configurationApi) - { - return configurationApi.Get(StaticConfig.AppId); - } - - public static IConfiguration GetPublic(this IConfigurationApi configurationApi) - { - return configurationApi.Get(StaticConfig.PublicId); - } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs deleted file mode 100644 index e4a6951e9..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc; - -public class ConfigurationApiManage : ConfigurationApiBase, IConfigurationApiManage -{ - private readonly ICaller _caller; - - public ConfigurationApiManage( - ICaller caller, - DccSectionOptions defaultSectionOption, - List? expandSectionOptions) - : base(defaultSectionOption, expandSectionOptions) - { - _caller = caller; - } - - /// - public async Task InitializeAsync(string environment, string cluster, string appId, Dictionary configObjects) - { - var requestUri = $"open-api/releasing/init/{GetEnvironment(environment)}/{GetCluster(cluster)}/{GetAppId(appId)}"; - var result = await _caller.PostAsync(requestUri, configObjects, default); - - // 299 is the status code when throwing a UserFriendlyException in masa.framework - if ((int)result.StatusCode == 299 || !result.IsSuccessStatusCode) - { - var error = await result.Content.ReadAsStringAsync(); - throw new HttpRequestException(error); - } - } - - public async Task UpdateAsync(string environment, string cluster, string appId, string configObject, object value) - { - var requestUri = $"open-api/releasing/{GetEnvironment(environment)}/{GetCluster(cluster)}/{GetAppId(appId)}/{GetConfigObject(configObject)}"; - var result = await _caller.PutAsync(requestUri, value, default); - - // 299 is the status code when throwing a UserFriendlyException in masa.framework - if ((int)result.StatusCode == 299 || !result.IsSuccessStatusCode) - { - var error = await result.Content.ReadAsStringAsync(); - throw new HttpRequestException(error); - } - } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs deleted file mode 100644 index d2420dc36..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; - -internal enum ConfigFormats -{ - Properties = 1, - Raw, - Json, - Yaml, - Xml -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs deleted file mode 100644 index 394767d04..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; - -public class ConfigurationApiBase -{ - private readonly DccSectionOptions _defaultSectionOption; - private readonly List _expandSectionOptions; - - protected ConfigurationApiBase(DccSectionOptions defaultSectionOption, List? expandSectionOptions) - { - _defaultSectionOption = defaultSectionOption; - _expandSectionOptions = expandSectionOptions ?? new(); - } - - protected string GetSecret(string appId) - { - if (_defaultSectionOption.AppId == GetAppId(appId)) - return _defaultSectionOption.Secret ?? ""; - - var option = _expandSectionOptions.FirstOrDefault(x => x.AppId == appId); - if (option == null) - throw new ArgumentNullException(nameof(appId)); - - return option.Secret ?? ""; - } - - protected string GetEnvironment(string environment) - => !string.IsNullOrEmpty(environment) ? environment : _defaultSectionOption.Environment!; - - protected string GetCluster(string cluster) - => !string.IsNullOrEmpty(cluster) ? cluster : _defaultSectionOption.Cluster!; - - protected string GetAppId(string appId) - => !string.IsNullOrEmpty(appId) ? appId : _defaultSectionOption.AppId!; - - protected string GetConfigObject(string configObject) - => !string.IsNullOrEmpty(configObject) ? configObject : throw new ArgumentNullException(nameof(configObject)); -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs deleted file mode 100644 index 3c7347eb7..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; - -internal class Constants -{ - internal const string DEFAULT_CLIENT_NAME = "masa.contrib.configuration.configurationapi.dcc"; - - internal const string DEFAULT_SUBSCRIBE_KEY_PREFIX = "masa.dcc:"; - - internal const string DEFAULT_ENVIRONMENT_NAME = "ASPNETCORE_ENVIRONMENT"; - - internal const string DATA_DICTIONARY_SECTION_NAME = "DataDictionary"; -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs deleted file mode 100644 index a4dd590ab..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; - -internal class DccConfigurationRepository : AbstractConfigurationRepository -{ - private readonly IConfigurationApiClient _client; - - public override SectionTypes SectionType => SectionTypes.ConfigurationApi; - - private readonly ConcurrentDictionary> _dictionaries = new(); - - private readonly ConcurrentDictionary _configObjectConfigurationTypeRelations = new(); - - public DccConfigurationRepository( - IEnumerable sectionOptions, - IConfigurationApiClient client, - ILoggerFactory loggerFactory) - : base(loggerFactory) - { - _client = client; - foreach (var sectionOption in sectionOptions) - { - Initialize(sectionOption).ConfigureAwait(false).GetAwaiter().GetResult(); - } - } - - private async Task Initialize(DccSectionOptions sectionOption) - { - foreach (var configObject in sectionOption.ConfigObjects) - { - string key = $"{sectionOption.Environment!}-{sectionOption.Cluster!}-{sectionOption.AppId}-{configObject}".ToLower(); - var result = await _client.GetRawAsync(sectionOption.Environment!, sectionOption.Cluster!, sectionOption.AppId, configObject, (val) => - { - if (_configObjectConfigurationTypeRelations.TryGetValue(key, out var configurationType)) - { - _dictionaries[key] = FormatRaw(sectionOption.AppId, configObject, val, configurationType); - FireRepositoryChange(SectionType, Load()); - } - }); - - _configObjectConfigurationTypeRelations.TryAdd(key, result.ConfigurationType); - _dictionaries[key] = FormatRaw(sectionOption.AppId, configObject, result.Raw, result.ConfigurationType); - } - } - - private IDictionary FormatRaw(string appId, string configObject, string? raw, ConfigurationTypes configurationType) - { - if (raw == null) - return new Dictionary(); - - switch (configurationType) - { - case ConfigurationTypes.Json: - return SecondaryFormat(appId, configObject, JsonConfigurationParser.Parse(raw)); - case ConfigurationTypes.Properties: - return SecondaryFormat(appId, configObject, JsonSerializer.Deserialize>(raw)!); - case ConfigurationTypes.Text: - return new Dictionary() - { - { $"{appId}{ConfigurationPath.KeyDelimiter}{configObject}" , raw ?? "" } - }; - default: - throw new NotSupportedException(nameof(configurationType)); - } - } - - private IDictionary SecondaryFormat( - string appId, - string configObject, - IDictionary data) - { - var dictionary = new Dictionary(); - foreach (var item in data) - { - dictionary[$"{appId}{ConfigurationPath.KeyDelimiter}{configObject}{ConfigurationPath.KeyDelimiter}{item.Key}"] = item.Value; - } - return dictionary; - } - - public override Properties Load() - { - Dictionary properties = new(); - foreach (var item in _dictionaries) - { - foreach (var key in item.Value.Keys) - { - properties[key] = item.Value[key]; - } - } - return new Properties(properties); - } - -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs deleted file mode 100644 index 5aa9592f4..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; - -internal class DccFactory -{ - public static IConfigurationApiClient CreateClient( - IServiceProvider serviceProvider, - IMemoryCacheClient client, - JsonSerializerOptions jsonSerializerOptions, - DccSectionOptions defaultSectionOption, - List? expandSectionOptions) - { - return new ConfigurationApiClient(serviceProvider, client, jsonSerializerOptions, defaultSectionOption, expandSectionOptions); - } - - public static IConfigurationApiManage CreateManage( - ICaller caller, - DccSectionOptions defaultSectionOption, - List? expandSectionOptions) - => new ConfigurationApiManage(caller, defaultSectionOption, expandSectionOptions); -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs deleted file mode 100644 index 06c331360..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Model; - -internal class Property -{ - public string Key { get; set; } = default!; - - public string Value { get; set; } = default!; -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs deleted file mode 100644 index f0cb189b3..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Model; - -internal class PublishRelease -{ - private ConfigFormats _configFormat; - public ConfigFormats ConfigFormat - { - get - { - try - { - if (_configFormat == 0 && !string.IsNullOrWhiteSpace(FormatLabelCode)) - _configFormat = (ConfigFormats)Enum.Parse(typeof(ConfigFormats), FormatLabelCode); - } - catch (Exception ex) - { - throw new NotSupportedException("Unsupported configuration type", ex); - } - - return _configFormat; - } - set - { - _configFormat = value; - } - } - - public string? FormatLabelCode { get; set; } - - public string? Content { get; set; } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs deleted file mode 100644 index 22e1755c0..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Model; - -internal class StaticConfig -{ - public static string AppId { get; set; } - - public static string PublicId => "public-$Config"; -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs deleted file mode 100644 index 1034a3621..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Options; - -internal class DccOptions -{ - public DccConfigurationOptions DccConfigurationOptions { get; } - - public DccSectionOptions DefaultSectionOptions { get; } - - public List ExpansionSectionOptions { get; } - - public DccOptions(DccConfigurationOptions dccConfigurationOptions, DccSectionOptions defaultSectionOptions, List expansionSectionOptions) - { - DccConfigurationOptions = dccConfigurationOptions; - DefaultSectionOptions = defaultSectionOptions; - ExpansionSectionOptions = expansionSectionOptions; - } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs deleted file mode 100644 index 75c139ef9..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Parser; - -/// -/// https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Configuration.Json/src/JsonConfigurationFileParser.cs -/// -internal sealed class JsonConfigurationParser -{ - private JsonConfigurationParser() - { - } - - private readonly Dictionary _data = new Dictionary(StringComparer.OrdinalIgnoreCase); - private readonly Stack _paths = new Stack(); - - public static IDictionary Parse(string json) - => new JsonConfigurationParser().ParseJson(json); - - private IDictionary ParseJson(string json) - { - var jsonDocumentOptions = new JsonDocumentOptions - { - CommentHandling = JsonCommentHandling.Skip, - AllowTrailingCommas = true, - }; - - var doc = JsonDocument.Parse(json, jsonDocumentOptions); - - if (doc.RootElement.ValueKind != JsonValueKind.Object) - { - throw new FormatException($"[{doc.RootElement.ValueKind}]Invalid top level JsonElement."); - } - - VisitElement(doc.RootElement); - - return _data; - } - - private void VisitElement(JsonElement element) - { - var isEmpty = true; - - foreach (JsonProperty property in element.EnumerateObject()) - { - isEmpty = false; - EnterContext(property.Name); - VisitValue(property.Value); - ExitContext(); - } - - if (isEmpty && _paths.Count > 0) - { - _data[_paths.Peek()] = ""; - } - } - - private void VisitValue(JsonElement value) - { - Debug.Assert(_paths.Count > 0); - - switch (value.ValueKind) - { - case JsonValueKind.Object: - VisitElement(value); - break; - - case JsonValueKind.Array: - int index = 0; - foreach (JsonElement arrayElement in value.EnumerateArray()) - { - EnterContext(index.ToString()); - VisitValue(arrayElement); - ExitContext(); - index++; - } - - break; - - case JsonValueKind.Number: - case JsonValueKind.String: - case JsonValueKind.True: - case JsonValueKind.False: - case JsonValueKind.Null: - string key = _paths.Peek(); - if (_data.ContainsKey(key)) - { - throw new FormatException($"[{key}]key is duplicated."); - } - - _data[key] = value.ToString(); - break; - - default: - throw new FormatException($"[{value.ValueKind}]Unsupported json token."); - } - } - - private void EnterContext(string context) => - _paths.Push(_paths.Count > 0 ? _paths.Peek() + ConfigurationPath.KeyDelimiter + context : context); - - private void ExitContext() => _paths.Pop(); -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs deleted file mode 100644 index 21680f28c..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Parser; - -internal class PropertyConfigurationParser -{ - public static IDictionary? Parse(string raw, JsonSerializerOptions serializerOption) - => JsonSerializer.Deserialize>(raw, serializerOption)!.ToDictionary(k => k.Key, v => v.Value); -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs deleted file mode 100644 index 93ba3445c..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using System.Data; -using System.Text; - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Parser; - -internal class XmlConfigurationParser -{ - public static string XmlToJson(string xmlStr) - { - var dataSet = XmlToDataSet(xmlStr); - - return DatasetToJson(dataSet); - } - - public static DataSet XmlToDataSet(string xmlStr) - { - try - { - var ds = new DataSet(); - using var xmlStringReader = new StringReader(xmlStr); - - ds.ReadXml(xmlStringReader); - - return ds; - } - catch (Exception ex) - { - throw new FormatException("Xml character string invalid", ex); - } - } - - public static string DatasetToJson(DataSet ds) - { - var json = new StringBuilder(); - - foreach (DataTable dt in ds.Tables) - { - json.Append("{\""); - json.Append(dt.TableName); - json.Append("\":"); - json.Append(DataTableToJson(dt)); - json.Append('}'); - } - return json.ToString(); - } - - public static string DataTableToJson(DataTable table) - { - var jsonStringBuilder = new StringBuilder(); - if (table.Rows.Count > 0) - { - jsonStringBuilder.Append('['); - for (int i = 0; i < table.Rows.Count; i++) - { - jsonStringBuilder.Append('{'); - for (int j = 0; j < table.Columns.Count; j++) - { - if (j < table.Columns.Count - 1) - { - jsonStringBuilder.Append("\"" + table.Columns[j].ColumnName.ToString() + "\":" + "\"" + table.Rows[i][j].ToString() + "\","); - } - else if (j == table.Columns.Count - 1) - { - jsonStringBuilder.Append("\"" + table.Columns[j].ColumnName.ToString() + "\":" + "\"" + table.Rows[i][j].ToString() + "\""); - } - } - if (i == table.Rows.Count - 1) - { - jsonStringBuilder.Append('}'); - } - else - { - jsonStringBuilder.Append("},"); - } - } - jsonStringBuilder.Append(']'); - } - return jsonStringBuilder.ToString(); - } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj deleted file mode 100644 index 1d1abac56..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs deleted file mode 100644 index 80b79d983..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc; - -public static class MasaConfigurationExtensions -{ - public static IMasaConfigurationBuilder UseDcc( - this IMasaConfigurationBuilder builder, - Action? jsonSerializerOptions = null, - Action? callerOptions = null) - { - var configurationSection = builder.Configuration.GetSection("DccOptions"); - var dccOptions = configurationSection.Get(); - - List expandSections = new(); - var configurationExpandSection = builder.Configuration.GetSection("ExpandSections"); - if (configurationExpandSection.Exists()) - { - configurationExpandSection.Bind(expandSections); - } - - return builder.UseDcc(() => dccOptions, option => - { - option.Environment = builder.Configuration[nameof(DccSectionOptions.Environment)]; - option.Cluster = builder.Configuration[nameof(DccSectionOptions.Cluster)]; - option.AppId = builder.Configuration[nameof(DccSectionOptions.AppId)]; - option.ConfigObjects = builder.Configuration.GetSection(nameof(DccSectionOptions.ConfigObjects)).Get>(); - option.Secret = builder.Configuration[nameof(DccSectionOptions.Secret)]; - }, option => option.ExpandSections = expandSections, jsonSerializerOptions, callerOptions); - } - - public static IMasaConfigurationBuilder UseDcc( - this IMasaConfigurationBuilder builder, - Func configureOptions, - Action defaultSectionOptions, - Action? expansionSectionOptions, - Action? jsonSerializerOptions = null, - Action? callerOptions = null) - { - ArgumentNullException.ThrowIfNull(configureOptions, nameof(configureOptions)); - DccConfigurationOptions dccConfigurationOptions = configureOptions.Invoke(); - - ArgumentNullException.ThrowIfNull(defaultSectionOptions, nameof(defaultSectionOptions)); - DccSectionOptions defaultSectionOption = new(); - defaultSectionOptions.Invoke(defaultSectionOption); - - var expansionSectionOption = new DccExpandSectionOptions(); - expansionSectionOptions?.Invoke(expansionSectionOption); - - return builder.UseDcc(dccConfigurationOptions, defaultSectionOption, expansionSectionOption.ExpandSections, - jsonSerializerOptions, callerOptions); - } - - public static IMasaConfigurationBuilder UseDcc( - this IMasaConfigurationBuilder builder, - DccConfigurationOptions configureOptions, - DccSectionOptions defaultSectionOptions, - List? expansionSectionOptions, - Action? jsonSerializerOptions, - Action? action) - { - StaticConfig.AppId = defaultSectionOptions.AppId; - - var services = builder.Services; - if (services.Any(service => service.ImplementationType == typeof(DccConfigurationProvider))) - return builder; - - services.AddSingleton(); - - var config = GetDccConfigurationOption(configureOptions, defaultSectionOptions, expansionSectionOptions); - - var jsonSerializerOption = new JsonSerializerOptions() - { - PropertyNameCaseInsensitive = true - }; - jsonSerializerOptions?.Invoke(jsonSerializerOption); - string callerName = DEFAULT_CLIENT_NAME; - services.AddCaller(options => - { - if (action == null) - { - options.UseHttpClient(() - => new MasaHttpClientBuilder(callerName, string.Empty, - opt => opt.BaseAddress = new Uri(config.DccConfigurationOptions.ManageServiceAddress)) - ); - } - else - { - action.Invoke(options); - callerName = options.Callers.Select(opt => opt.Name).FirstOrDefault() - ?? throw new Exception("Missing Caller implementation, eg: options.UseHttpClient()"); - } - }); - - services.AddMasaRedisCache(DEFAULT_CLIENT_NAME, config.DccConfigurationOptions.RedisOptions) - .AddSharedMasaMemoryCache(config.DccConfigurationOptions.SubscribeKeyPrefix ?? DEFAULT_SUBSCRIBE_KEY_PREFIX); - - TryAddConfigurationApiClient(services, config.DefaultSectionOptions, config.ExpansionSectionOptions, jsonSerializerOption); - TryAddConfigurationApiManage(services, callerName, config.DefaultSectionOptions, config.ExpansionSectionOptions); - - var sectionOptions = new List() - { - config.DefaultSectionOptions - }.Concat(config.ExpansionSectionOptions); - - var configurationApiClient = services.BuildServiceProvider().GetRequiredService(); - var loggerFactory = services.BuildServiceProvider().GetRequiredService(); - builder.AddRepository(new DccConfigurationRepository(sectionOptions, configurationApiClient, loggerFactory)); - return builder; - } - - public static IServiceCollection TryAddConfigurationApiClient(IServiceCollection services, - DccSectionOptions defaultSectionOption, - List expansionSectionOptions, - JsonSerializerOptions jsonSerializerOption) - { - services.TryAddSingleton(serviceProvider => - { - var client = serviceProvider.GetRequiredService().CreateClient(DEFAULT_CLIENT_NAME); - - ArgumentNullException.ThrowIfNull(client, nameof(client)); - - return DccFactory.CreateClient( - serviceProvider, - client, - jsonSerializerOption, - defaultSectionOption, - expansionSectionOptions); - }); - return services; - } - - public static IServiceCollection TryAddConfigurationApiManage(IServiceCollection services, - string callerName, - DccSectionOptions defaultSectionOption, - List expansionSectionOptions) - { - services.TryAddSingleton(serviceProvider => - { - var callerFactory = serviceProvider.GetRequiredService(); - return DccFactory.CreateManage(callerFactory.Create(callerName), defaultSectionOption, expansionSectionOptions); - }); - return services; - } - - private static DccOptions GetDccConfigurationOption( - DccConfigurationOptions dccConfigurationOption, - DccSectionOptions defaultSectionOptions, - List? expansionSectionOptions = null) - { - ArgumentNullException.ThrowIfNull(dccConfigurationOption, nameof(dccConfigurationOption)); - - if (string.IsNullOrEmpty(dccConfigurationOption.ManageServiceAddress)) - throw new ArgumentNullException(nameof(dccConfigurationOption.ManageServiceAddress)); - - if (dccConfigurationOption.RedisOptions == null) - throw new ArgumentNullException(nameof(dccConfigurationOption.RedisOptions)); - - if (dccConfigurationOption.RedisOptions.Servers == null || dccConfigurationOption.RedisOptions.Servers.Count == 0 || - dccConfigurationOption.RedisOptions.Servers.Any(service => string.IsNullOrEmpty(service.Host) || service.Port <= 0)) - throw new ArgumentNullException(nameof(dccConfigurationOption.RedisOptions.Servers)); - - ArgumentNullException.ThrowIfNull(defaultSectionOptions, nameof(defaultSectionOptions)); - - if (string.IsNullOrEmpty(defaultSectionOptions.AppId)) - throw new ArgumentNullException("AppId cannot be empty"); - - if (defaultSectionOptions.ConfigObjects == null || !defaultSectionOptions.ConfigObjects.Any()) - throw new ArgumentNullException("ConfigObjects cannot be empty"); - - if (string.IsNullOrEmpty(defaultSectionOptions.Cluster)) - defaultSectionOptions.Cluster = "Default"; - if (string.IsNullOrEmpty(defaultSectionOptions.Environment)) - defaultSectionOptions.Environment = GetDefaultEnvironment(); - - List expansionOptions = new(); - foreach (var expansionOption in expansionSectionOptions ?? new()) - { - if (string.IsNullOrEmpty(expansionOption.Environment)) - expansionOption.Environment = defaultSectionOptions.Environment; - if (string.IsNullOrEmpty(expansionOption.Cluster)) - expansionOption.Cluster = defaultSectionOptions.Cluster; - - if (expansionOption.ConfigObjects == null || !expansionOption.ConfigObjects.Any()) - throw new ArgumentNullException("ConfigObjects in the extension section cannot be empty"); - - if (expansionOption.AppId == defaultSectionOptions.AppId || - expansionOptions.Any(section => section.AppId == expansionOption.AppId)) - throw new ArgumentNullException("The current section already exists, no need to mount repeatedly"); - - expansionOptions.Add(expansionOption); - } - return new(dccConfigurationOption, defaultSectionOptions, expansionOptions); - } - - private static ICachingBuilder AddSharedMasaMemoryCache(this ICachingBuilder builder, string subscribeKeyPrefix) - { - builder.AddMasaMemoryCache(options => - { - options.SubscribeKeyType = SubscribeKeyTypes.SpecificPrefix; - options.SubscribeKeyPrefix = subscribeKeyPrefix; - }); - - return builder; - } - - private static string GetDefaultEnvironment() - => System.Environment.GetEnvironmentVariable(DEFAULT_ENVIRONMENT_NAME) ?? - throw new ArgumentNullException( - "Error getting environment information, please make sure the value of ASPNETCORE_ENVIRONMENT has been configured"); - - private class DccConfigurationProvider - { - - } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs deleted file mode 100644 index 46f68e0ae..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; - -public abstract class ConfigurationApiMasaConfigurationOptions : MasaConfigurationOptions -{ - /// - /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType - /// - [JsonIgnore] - public sealed override string? ParentSection => AppId; - - public virtual string AppId => StaticConfig.AppId; - - /// - /// The section null means same as the class name, else load from the specify section - /// - [JsonIgnore] - public sealed override string? Section => ObjectName; - - public virtual string? ObjectName { get; } - - /// - /// Configuration object name - /// - [JsonIgnore] - public sealed override SectionTypes SectionType => SectionTypes.ConfigurationApi; -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs deleted file mode 100644 index 605bbae3a..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; - -public class DccConfigurationOptions -{ - public RedisConfigurationOptions RedisOptions { get; set; } - - public string ManageServiceAddress { get; set; } = default!; - - /// - /// The prefix of Dcc PubSub, it is not recommended to modify - /// - public string? SubscribeKeyPrefix { get; set; } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs deleted file mode 100644 index 57ce1c9a0..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; - -public class DccExpandSectionOptions -{ - /// - /// Expansion section information - /// - public List? ExpandSections { get; set; } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs deleted file mode 100644 index 1394f89c2..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; - -public class DccSectionOptions -{ - /// - /// The environment name. - /// Get from the environment variable ASPNETCORE_ENVIRONMENT when Environment is null or empty - /// - public string? Environment { get; set; } = null; - - /// - /// The cluster name. - /// - public string? Cluster { get; set; } - - /// - /// The app id. - /// - public string AppId { get; set; } = default!; - - public List ConfigObjects { get; set; } = default!; - - public string? Secret { get; set; } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md deleted file mode 100644 index d7055f623..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md +++ /dev/null @@ -1,174 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Configuration.ConfigurationApi.Dcc - -Effect: - -Extend the ability of IConfiguration to manage remote configuration through Dcc. - -```c# -IConfiguration -├── Local Local node (fixed) -├── ConfigurationApi Remote node (fixed Dcc to expand its capacity) -│ ├── AppId Replace-With-Your-AppId -│ ├── AppId ├── Redis Custom node -│ ├── AppId ├── Redis ├── Host Parameter -``` - -Example: - -```C# -Install-Package Masa.Contrib.Configuration -Install-Package Masa.Contrib.Configuration.ConfigurationApi.Dcc //Provides the ability to remotely configure -``` - -appsettings.json -``` -{ - //Dcc configuration, extended Configuration capabilities, support remote configuration - "DccOptions": { - "ManageServiceAddress": "http://localhost:8890", - "RedisOptions": { - "Servers": [ - { - "Host": "localhost", - "Port": 8889 - } - ], - "DefaultDatabase": 0, - "Password": "" - } - }, - "AppId": "Replace-With-Your-AppId", - "Environment": "Development", - "ConfigObjects": [ "Redis" ], //The name of the object to be mounted, the Redis configuration will be mounted here under the ConfigurationApi: node - "Secret": "", //Dcc App key - "Cluster": "Default" -} - -``` - -```C# -builder.AddMasaConfiguration(configurationBuilder => configurationBuilder.UseDcc());//Ability to provide remote configuration using Dcc - -/// -/// Automatically map node relationships -/// -public class RedisOptions : ConfigurationApiMasaConfigurationOptions -{ - /// - /// The app id. - /// - [JsonIgnore] - public override string AppId { get; set; } = "Replace-With-Your-AppId"; - - [JsonIgnore] - public override string? ObjectName { get; init; } = "Redis"; - - public string Host { get; set; } - - public int Port { get; set; } - - public int DefaultDatabase { get; set; } -} - -public class CustomDccSectionOptions : ConfigurationApiMasaConfigurationOptions -{ - /// - /// The app id. - /// - [JsonIgnore] - public override string AppId { get; set; } = "Replace-With-Your-AppId"; - - /// - /// The environment name. - /// Get from the environment variable ASPNETCORE_ENVIRONMENT when Environment is null or empty - /// - public string? Environment { get; set; } = null; - - /// - /// The cluster name. - /// - public string? Cluster { get; set; } - - public List ConfigObjects { get; set; } = default!; - - public string? Secret { get; set; } - - /// - /// Mount CustomDccSectionOptions under the root node - /// - [JsonIgnore] - public virtual string? Section => string.Empty; -} -``` - -How to use configuration: - -```c# -var app = builder.Build(); - -//Read the configuration at the program entrance -var redisHost = builder.GetMasaConfiguration().ConfigurationApi.GetDefault().GetValue("Redis:Host"); - -app.MapGet("/GetRedis", ([FromServices] IOptions option) => -{ - //recommend - return System.Text.Json.JsonSerializer.Serialize(option.Value);//Or use IOptionsMonitor to support monitoring changes -}); - -app.MapGet("/GetRedisByMonitor", ([FromServices] IOptionsMonitor options) => -{ - options.OnChange(option => - { - //TODO Configuration update - }); - return System.Text.Json.JsonSerializer.Serialize(option.CurrentValue); -}); - -app.MapGet("/GetRedisHost", ([FromServices] IConfiguration configuration) => -{ - //Obtain the configuration value of the Host of the specified configuration object (ConfigObject) under the specified AppId from the configuration center - //Format ConfigurationApi::: - return configuration["ConfigurationApi::Redis:Host"]; -}); - -app.MapPut("/UpdateRedis", ([FromServices] IConfigurationAPIManage configurationAPIManage, - [FromServices] IOptions configuration, - RedisOptions newRedis) => -{ - //Modify Dcc configuration - return configurationAPIManage.UpdateAsync(option.Value.Environment, - option.Value.Cluster, - option.Value.AppId, - "",newRedis);//Here Replace-With-Your-ConfigObject is Redis -}); -app.Run(); -``` - -How to update the configuration: - -```c# -var app = builder.Build(); - -app.MapPut("/UpdateRedis", ([FromServices] IConfigurationAPIManage configurationAPIManage, - [FromServices] IOptions configuration, - RedisOptions newRedis) => -{ - //Modify Dcc configuration - return configurationAPIManage.UpdateAsync(option.Value.Environment, - option.Value.Cluster, - option.Value.AppId, - "" - ,newRedis); - //Here Replace-With-Your-ConfigObject is Redis -}); - -app.Run(); -``` - -Summarize: - -Dcc provides remote configuration management and viewing capabilities for IConfiguration. For the complete capabilities of IConfiguration, please refer to the [document](../../Configuration/Masa.Contrib.Configuration/README.md) - -Redis here is remote configuration, which introduces the effect and usage of remote configuration after mounting to IConfiguration. This configuration has nothing to do with Redis in Masa.Contrib.Configuration. It just shows the use of the same configuration information in two sources. Ways and differences in mapping node relationships \ No newline at end of file diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md deleted file mode 100644 index b217be2dc..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md +++ /dev/null @@ -1,165 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Configuration.ConfigurationApi.Dcc - -作用: - -通过Dcc扩展IConfiguration管理远程配置的能力。 - -```c# -IConfiguration -├── Local 本地节点(固定) -├── ConfigurationApi 远程节点(固定 Dcc扩展其能力) -│ ├── AppId Replace-With-Your-AppId -│ ├── AppId ├── Redis 自定义节点 -│ ├── AppId ├── Redis ├── Host 参数 -``` - -用例: - -```C# -Install-Package Masa.Contrib.Configuration -Install-Package Masa.Contrib.Configuration.ConfigurationApi.Dcc //提供远程配置的能力 -``` - -appsettings.json -``` -{ - //Dcc配置,扩展Configuration能力,支持远程配置 - "DccOptions": { - "ManageServiceAddress ": "http://localhost:8890", - "RedisOptions": { - "Servers": [ - { - "Host": "localhost", - "Port": 8889 - } - ], - "DefaultDatabase": 0, - "Password": "" - } - }, - "AppId": "Replace-With-Your-AppId", - "Environment": "Development", - "ConfigObjects": [ "Redis" ], //待挂载的对象名, 此处会将Redis配置挂载到ConfigurationApi:节点下 - "Secret": "", //Dcc App 秘钥 - "Cluster": "Default" -} - -``` - -```C# -builder.AddMasaConfiguration(configurationBuilder => configurationBuilder.UseDcc());//使用Dcc提供远程配置的能力 - -/// -/// 自动映射节点关系 -/// -public class RedisOptions : ConfigurationApiMasaConfigurationOptions -{ - /// - /// The app id. - /// - [JsonIgnore] - public override string AppId { get; set; } = "Replace-With-Your-AppId"; - - [JsonIgnore] - public override string? ObjectName { get; init; } = "Redis"; - - public string Host { get; set; } - - public int Port { get; set; } - - public int DefaultDatabase { get; set; } -} - -public class CustomDccSectionOptions : ConfigurationApiMasaConfigurationOptions -{ - /// - /// The app id. - /// - [JsonIgnore] - public override string AppId { get; set; } = "Replace-With-Your-AppId"; - - /// - /// The environment name. - /// Get from the environment variable ASPNETCORE_ENVIRONMENT when Environment is null or empty - /// - public string? Environment { get; set; } = null; - - /// - /// The cluster name. - /// - public string? Cluster { get; set; } - - public List ConfigObjects { get; set; } = default!; - - public string? Secret { get; set; } - - /// - /// 将CustomDccSectionOptions挂载到根节点下 - /// - [JsonIgnore] - public virtual string? Section => string.Empty; -} -``` - -如何使用配置: - -```c# -var app = builder.Build(); - -//在程序入口处读取配置 -var redisHost = builder.GetMasaConfiguration().ConfigurationApi.GetDefault().GetValue("Redis:Host"); - -app.MapGet("/GetRedis", ([FromServices] IOptions option) => -{ - //推荐 - return System.Text.Json.JsonSerializer.Serialize(option.Value); -}); - -app.MapGet("/GetRedisByMonitor", ([FromServices] IOptionsMonitor options) => -{ - options.OnChange(option => - { - //TODO 配置更新 - }); - return System.Text.Json.JsonSerializer.Serialize(option.CurrentValue); -}); - -app.MapGet("/GetRedisHost2", ([FromServices] IConfiguration configuration) => -{ - //从配置中心获取指定AppId下的指定配置对象(ConfigObject)的Host的配置值 - //格式:ConfigurationApi:<自定义AppId>:<自定义的ConfigObject>:<参数名Host> - return configuration["ConfigurationApi::Redis:Host"]; -}); - -app.Run(); -``` - -如何更新配置 - - -```c# -var app = builder.Build(); - -app.MapPut("/UpdateRedis", ([FromServices] IConfigurationAPIManage configurationAPIManage, - [FromServices] IOptions configuration, - RedisOptions newRedis) => -{ - //修改Dcc配置 - return configurationAPIManage.UpdateAsync(option.Value.Environment, - option.Value.Cluster, - option.Value.AppId, - "<自定义-ConfigObject>" - ,newRedis); - //此处<自定义-ConfigObject>是Redis -}); - -app.Run(); -``` - -总结: - -Dcc为IConfiguration提供了远程配置的管理以及查看能力,IConfiguration完整的能力请查看[文档](../../Configuration/Masa.Contrib.Configuration/README.zh-CN.md) - -此处Redis为远程配置,介绍的是远程配置挂载到IConfiguration之后的效果以及用法,此配置与MASA.Contrib.Configuration中Redis的毫无关系,仅仅是展示同一个配置信息在两个源的使用方式以及映射节点关系的差别 \ No newline at end of file diff --git a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs b/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs deleted file mode 100644 index 5219841a2..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/src/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Configuration; -global using Masa.BuildingBlocks.Configuration.Options; -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Model; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Options; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Parser; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; -global using Masa.Contrib.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Masa.Utils.Caching.Core.DependencyInjection; -global using Masa.Utils.Caching.Core.Models; -global using Masa.Utils.Caching.DistributedMemory.DependencyInjection; -global using Masa.Utils.Caching.DistributedMemory.Interfaces; -global using Masa.Utils.Caching.Redis.Extensions; -global using Masa.Utils.Caching.Redis.Models; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using System.Collections.Concurrent; -global using System.Diagnostics; -global using System.Dynamic; -global using System.Text.Json; -global using System.Text.Json.Serialization; -global using YamlDotNet.Serialization; -global using static Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Constants; diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs deleted file mode 100644 index 92cd83e58..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests; - -public class CustomMemoryCacheClientFactory : IMemoryCacheClientFactory -{ - private readonly IMemoryCache _memoryCache; - - public CustomMemoryCacheClientFactory(IMemoryCache memoryCache) => _memoryCache = memoryCache; - - public MemoryCacheClient CreateClient(string name) => new(_memoryCache, null!, SubscribeKeyTypes.SpecificPrefix); -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs deleted file mode 100644 index 670e9aad4..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests; - -[TestClass] -public class DccClientTest -{ - private Mock _client; - private IServiceCollection _services; - private IServiceProvider _serviceProvider => _services.BuildServiceProvider(); - private JsonSerializerOptions _jsonSerializerOptions; - private DccSectionOptions _dccSectionOptions; - private CustomTrigger _trigger; - - [TestInitialize] - public void Initialize() - { - _client = new Mock(); - _services = new ServiceCollection(); - _jsonSerializerOptions = new JsonSerializerOptions() - { - PropertyNameCaseInsensitive = true - }; - _dccSectionOptions = new DccSectionOptions() - { - Environment = "Test", - Cluster = "Default", - AppId = "DccTest", - ConfigObjects = new List() - { - "Test1" - }, - Secret = "" - }; - _trigger = new CustomTrigger(_jsonSerializerOptions); - } - - [TestMethod] - public void TestFormatCodeErrorRawReturnThrowNotSupportedException() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = "", - FormatLabelCode = "json", - }, _jsonSerializerOptions); - Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName"), "configObject invalid"); - } - - [TestMethod] - public void TestJsonFormatCodeRawReturnConfigurationTypeIsJson() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = "", - FormatLabelCode = "Json", - }, _jsonSerializerOptions); - var result = client.TestFormatRaw(raw, "DccObjectName"); - Assert.IsTrue(result.ConfigurationType == ConfigurationTypes.Json); - } - - [TestMethod] - public void TestFormatNullRawReturnThrowArgumentException() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - Assert.ThrowsException(() => client.TestFormatRaw(null, "DccObjectName"), "configObject invalid"); - } - - [TestMethod] - public void TestFormatEmptyRawReturnThrowArgumentException() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - Assert.ThrowsException(() => client.TestFormatRaw(string.Empty, "DccObjectName"), "configObject invalid"); - } - - [TestMethod] - public void TestFormatNotSupportRawReturnThrowArgumentException() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - string raw = JsonSerializer.Serialize(new PublishRelease(), _jsonSerializerOptions); - Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName"), "configObject invalid"); - } - - [TestMethod] - public void TestFormatRawByJsonReturnConfigurationTypeIsJson() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - var content = JsonSerializer.Serialize(new { Name = "Microsoft" }, _jsonSerializerOptions); - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = content, - ConfigFormat = ConfigFormats.Json - }, _jsonSerializerOptions); - var result = client.TestFormatRaw(raw, "DccObjectName"); - Assert.IsTrue(result.Raw == content && result.ConfigurationType == ConfigurationTypes.Json); - } - - [TestMethod] - public void TestFormatRawByTextReturnConfigurationTypeIsText() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - var content = "Microsoft"; - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = content, - ConfigFormat = ConfigFormats.Text - }, _jsonSerializerOptions); - var result = client.TestFormatRaw(raw, "DccObjectName"); - Assert.IsTrue(result.Raw == content && result.ConfigurationType == ConfigurationTypes.Text); - } - - [TestMethod] - public void TestFormatRawByPropertiesReturnConfigurationTypeIsProperties() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - var list = new List() - { - new() - { - Key = "Id", - Value = Guid.NewGuid().ToString(), - }, - new() - { - Key = "Name", - Value = "Microsoft" - } - }; - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = JsonSerializer.Serialize(list), - ConfigFormat = ConfigFormats.Properties - }, _jsonSerializerOptions); - var result = client.TestFormatRaw(raw, "DccObjectName"); - Dictionary dictionary = new(list.Select(x => new KeyValuePair(x.Key, x.Value)).ToList()); - Assert.IsTrue(result.Raw == JsonSerializer.Serialize(dictionary, _jsonSerializerOptions) && - result.ConfigurationType == ConfigurationTypes.Properties); - } - - [TestMethod] - public void TestFormatRawByPropertiesAndContentIsErrorReturnThrowArgumentException() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - var content = JsonSerializer.Serialize(new - { - Key = "Name", - Value = "Microsoft" - }, _jsonSerializerOptions); - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = content, - ConfigFormat = ConfigFormats.Properties - }, _jsonSerializerOptions); - Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName")); - } - - [TestMethod] - public void TestFormatRawByXmlAndContentIsErrorReturnThrowArgumentException() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - string xml = @" - - blazor - https://blazor.masastack.com/ - - "; - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = xml, - ConfigFormat = ConfigFormats.Xml - }, _jsonSerializerOptions); - - Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName")); - } - - [TestMethod] - public void TestFormatRawByXmlReturnConfigurationTypeIsXml() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - string xml = @" - - - blazor - https://blazor.masastack.com/ - - "; - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = xml, - ConfigFormat = ConfigFormats.Xml - }, _jsonSerializerOptions); - var result = client.TestFormatRaw(raw, "DccObjectName"); - - Assert.IsTrue(result.ConfigurationType == ConfigurationTypes.Xml); - } - - [TestMethod] - public void TestFormatRawByYamlAndContentIsErrorReturnThrowArgumentException() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - string yaml = @" -name: Masa, -age: 1.5 -addresses: -home: - city: hangzhou"; - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = yaml, - ConfigFormat = ConfigFormats.Yaml - }, _jsonSerializerOptions); - Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName")); - } - - [TestMethod] - public void TestFormatRawByYamlReturnConfigurationTypeIsXml() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - string yaml = @" -name: Masa -age: 1.5 -addresses: - home: - city: hangzhou"; - var deserializer = new DeserializerBuilder().Build(); - var yamlObject = deserializer.Deserialize(yaml); - - var serializer = new SerializerBuilder().JsonCompatible().Build(); - var json = serializer.Serialize(yamlObject); - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = yaml, - ConfigFormat = ConfigFormats.Yaml - }, _jsonSerializerOptions); - var result = client.TestFormatRaw(raw, "DccObjectName"); - - Assert.IsTrue(result.Raw == json && result.ConfigurationType == ConfigurationTypes.Yaml); - } - - [TestMethod] - public async Task TestGetRawByKeyAsyncReturnConfigurationTypeIsText() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - string content = "Microsoft"; - string raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = content, - ConfigFormat = ConfigFormats.Text - }, _jsonSerializerOptions); - string key = "DccObjectName"; - bool isExecute = false; - _client - .Setup(c => c.GetAsync(key, It.IsAny>()!)) - .ReturnsAsync(raw) - .Callback((string value, Action action) => - { - _trigger.Formats = ConfigFormats.Text; - _trigger.Content = JsonSerializer.Serialize(new PublishRelease() - { - Content = "Apple", - ConfigFormat = ConfigFormats.Text - }, _jsonSerializerOptions); - _trigger.Action = action; - }); - var result = await client.TestGetRawByKeyAsync(key, message => - { - isExecute = true; - }); - Assert.IsTrue(result.ConfigurationType == ConfigurationTypes.Text && result.Raw == content); - Assert.IsFalse(isExecute); - _trigger.Execute(); - Assert.IsTrue(isExecute); - } - - [TestMethod] - public void TestGetDynamicAsyncByEmptyKeyReturnThrowArgumentNullException() - { - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - Assert.ThrowsExceptionAsync(() => client.TestGetDynamicAsync(string.Empty, null)); - } - - [TestMethod] - public async Task TestGetDynamicAsyncReturnResultNameIsApple() - { - string key = "environment-cluster-appId-configObject"; - var raw = JsonSerializer.Serialize(new PublishRelease() - { - Content = JsonSerializer.Serialize(new - { - id = "1", - name = "Apple" - }, _jsonSerializerOptions), - ConfigFormat = ConfigFormats.Json - }, _jsonSerializerOptions); - _client - .Setup(c => c.GetAsync(key, It.IsAny>()!)) - .ReturnsAsync(raw) - .Callback((string str, Action action) => - { - _trigger.Formats = ConfigFormats.Json; - _trigger.Content = JsonSerializer.Serialize(new PublishRelease() - { - Content = JsonSerializer.Serialize(new - { - id = "1", - name = "HuaWei" - }, _jsonSerializerOptions), - ConfigFormat = ConfigFormats.Json - }, _jsonSerializerOptions); - _trigger.Action = action; - }); - bool isExecute = false; - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - dynamic result = await client.TestGetDynamicAsync(key, (key, value, options) => - { - isExecute = true; - }); - Assert.IsTrue(result.name == "Apple"); - Assert.IsTrue(result.id == "1"); - _trigger.Execute(); - Assert.IsTrue(isExecute); - } - - [DataTestMethod] - [DataRow("Test", "Default", "DccTest", "Brand")] - public async Task TaskGetDynamicAsyncReturnResultCountIs2(string environment, string cluster, string appId, string configObject) - { - var brand = new List() - { - new() - { - Key = "Id", - Value = Guid.NewGuid().ToString(), - }, - new() - { - Key = "Name", - Value = "Microsoft" - } - }; - _client.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>())) - .ReturnsAsync(() => new PublishRelease() - { - ConfigFormat = ConfigFormats.Properties, - Content = brand.Serialize(_jsonSerializerOptions) - }.Serialize(_jsonSerializerOptions)) - .Callback((string value, Action action) => - { - _trigger.Formats = ConfigFormats.Properties; - _trigger.Content = new List() - { - new() - { - Key = "Id", - Value = Guid.NewGuid().ToString(), - }, - new() - { - Key = "Name", - Value = "HuaWei" - } - }.Serialize(_jsonSerializerOptions); - _trigger.Action = action; - }) - .Verifiable(); - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - bool isExecute = false; - var result = await client.GetDynamicAsync(environment, cluster, appId, configObject, value => isExecute = true); - _trigger.Execute(); - Assert.IsTrue((result as ExpandoObject)!.Count() == 2); - Assert.IsTrue(isExecute); - } - - [TestMethod] - public async Task TaskGetDynamicAsyncByKeyReturnResultCountIs1() - { - var brand = new List() - { - new() - { - Key = "Id", - Value = Guid.NewGuid().ToString(), - } - }; - _client.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>())) - .ReturnsAsync(() => new PublishRelease - { - ConfigFormat = ConfigFormats.Properties, - Content = brand.Serialize(_jsonSerializerOptions) - }.Serialize(_jsonSerializerOptions)) - .Verifiable(); - var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - - string key = "environment-cluster-appId-configObject"; - var result = await client.GetDynamicAsync(key); - _trigger.Execute(); - Assert.IsTrue((result as ExpandoObject)!.Count() == 1); - } - - [TestMethod] - [DataRow("Test", "Default", "DccTest", "Brand")] - public async Task TestGetAsyncByJsonReturn(string environment, string cluster, string appId, string configObject) - { - var brand = new Brands("Microsoft"); - var newBrand = new Brands("Microsoft2"); - - _client.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result).Returns(() => new PublishRelease() - { - ConfigFormat = ConfigFormats.Json, - Content = brand.Serialize(_jsonSerializerOptions) - }.Serialize(_jsonSerializerOptions)).Callback((string str, Action action) => - { - _trigger.Formats = ConfigFormats.Json; - _trigger.Content = newBrand.Serialize(_jsonSerializerOptions); - _trigger.Action = action; - }); - var client = new ConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - var ret = await client.GetAsync(environment, cluster, appId, configObject, (Brands br) => - { - Assert.IsTrue(br.Id == newBrand.Id); - Assert.IsTrue(br.Name == newBrand.Name); - }); - Assert.IsNotNull(ret); - Assert.IsTrue(brand.Id == ret.Id && brand.Name == ret.Name); - _trigger.Execute(); - - ret = await client.GetAsync(environment, cluster, appId, configObject, It.IsAny>()); - Assert.IsNotNull(ret); - - Assert.IsTrue(ret.Id == newBrand.Id && ret.Name == newBrand.Name); - } - - // [DataTestMethod] - // [DataRow("Test", "Default", "DccTest", "Brand")] - // public async Task GetAsyncByProperty(string environment, string cluster, string appId, string configObject) - // { - // var brand = new List() - // { - // new() - // { - // Key = "Id", - // Value = Guid.NewGuid().ToString(), - // }, - // new() - // { - // Key = "Name", - // Value = "Microsoft" - // } - // }; - // _client.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result).Returns(() => new PublishRelease() - // { - // ConfigFormat = ConfigFormats.Properties, - // Content = brand.Serialize(_jsonSerializerOptions) - // }.Serialize(_jsonSerializerOptions)).Verifiable(); - // var client = new ConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); - // var ret = await client.GetAsync(environment, cluster, appId, configObject, It.IsAny>()); - // Assert.IsNotNull(ret); - // - // Assert.IsTrue(ret.Id.ToString() == brand.Where(b => b.Key == "Id").Select(t => t.Value).FirstOrDefault() && - // ret.Name == brand.Where(b => b.Key == "Name").Select(t => t.Value).FirstOrDefault()); - // } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs deleted file mode 100644 index 115ccff3a..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - - - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests; - -[TestClass] -public class DccManageTest -{ - private DccSectionOptions _dccSectionOptions; - private JsonSerializerOptions _jsonSerializerOptions; - private Mock _caller; - - [TestInitialize] - public void Initialize() - { - _dccSectionOptions = new DccSectionOptions() - { - Environment = "Test", - Cluster = "Default", - AppId = "DccTest", - ConfigObjects = new List() - { - "Test1" - }, - Secret = "Secret" - }; - _jsonSerializerOptions = new JsonSerializerOptions() - { - PropertyNameCaseInsensitive = true - }; - _caller = new Mock(); - } - - [DataTestMethod] - [DataRow("Test", "Default", "DccTest", "Brand")] - public async Task TestUpdateAsync(string environment, string cluster, string appId, string configObject) - { - var brand = new Brands("Microsoft"); - _caller.Setup(factory => factory.PutAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() - { - StatusCode = HttpStatusCode.OK, - Content = new StringContent(brand.Serialize(_jsonSerializerOptions)) - }).Verifiable(); - - var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); - await manage.UpdateAsync(environment, cluster, appId, configObject, brand); - } - - [DataTestMethod] - [DataRow("Test", "Default", "DccTest", "Brand")] - public async Task TestUpdateAsyncAndError(string environment, string cluster, string appId, string configObject) - { - var brand = new Brands("Microsoft"); - - _caller.Setup(factory => factory.PutAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() - { - StatusCode = HttpStatusCode.ExpectationFailed, - Content = new StringContent("error") - }).Verifiable(); - - var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); - await Assert.ThrowsExceptionAsync(async () => await manage.UpdateAsync(environment, cluster, appId, configObject, brand)); - } - - [DataTestMethod] - [DataRow("Test", "Default", "DccTest", "Brand")] - public async Task TestUpdateAsyncAndCustomError(string environment, string cluster, string appId, string configObject) - { - var brand = new Brands("Microsoft"); - _caller.Setup(factory => factory.PutAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() - { - StatusCode = (HttpStatusCode)299, - Content = new StringContent("custom error") - }).Verifiable(); - - var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); - await Assert.ThrowsExceptionAsync(async () => await manage.UpdateAsync(environment, cluster, appId, configObject, brand)); - } - - [DataTestMethod] - [DataRow("Test", "Default", "DccTest")] - public async Task TestInitAsync(string environment, string cluster, string appId) - { - var configObjects = new Dictionary - { - { "Appsettings", "{\"ConnectionStrings\":\"xxxx\"}" } - }; - _caller.Setup(factory => factory.PostAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() - { - StatusCode = HttpStatusCode.OK, - Content = new StringContent(configObjects.Serialize(_jsonSerializerOptions)) - }).Verifiable(); - - var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); - await manage.InitializeAsync(environment, cluster, appId, configObjects); - } - - [DataTestMethod] - [DataRow("Test", "Default", "DccTest")] - public async Task TestInitAsyncAndError(string environment, string cluster, string appId) - { - var configObjects = new Dictionary - { - { "Appsettings", "{\"ConnectionStrings\":\"xxxx\"}" } - }; - - _caller.Setup(factory => factory.PostAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() - { - StatusCode = HttpStatusCode.ExpectationFailed, - Content = new StringContent("error") - }).Verifiable(); - - var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); - await Assert.ThrowsExceptionAsync(async () => await manage.InitializeAsync(environment, cluster, appId, configObjects)); - } - - [DataTestMethod] - [DataRow("Test", "Default", "DccTest")] - public async Task TestInitAsyncAndCustomError(string environment, string cluster, string appId) - { - var configObjects = new Dictionary - { - { "Appsettings", "{\"ConnectionStrings\":\"xxxx\"}" } - }; - - _caller.Setup(factory => factory.PostAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() - { - StatusCode = (HttpStatusCode)299, - Content = new StringContent("custom error") - }).Verifiable(); - - var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); - await Assert.ThrowsExceptionAsync(async () => await manage.InitializeAsync(environment, cluster, appId, configObjects)); - } - - [DataTestMethod] - [DataRow("DccTest", "Secret")] - [DataRow("DccTest2", "Secret2")] - [DataRow("DccTest3", "")] - public void TestGetSecret(string appId, string secret) - { - var api = new CustomConfigurationAPI(_dccSectionOptions, new List() - { - new() - { - Environment = "Test2", - Cluster = "Default2", - AppId = "DccTest2", - ConfigObjects = new List() - { - "Test12" - }, - Secret = "Secret2" - } - }); - if (string.IsNullOrEmpty(secret)) - Assert.ThrowsException(() => api.GetSecret(appId)); - else - Assert.IsTrue(api.GetSecret(appId) == secret); - } - - [DataTestMethod] - [DataRow("Test2", "Test2")] - [DataRow("", "Test")] - public void TestGetEnvironment(string environment, string outEnvironment) - { - var api = new CustomConfigurationAPI(_dccSectionOptions, null); - Assert.IsTrue(api.GetEnvironment(environment) == outEnvironment); - } - - [DataTestMethod] - [DataRow("CustomCluster", "CustomCluster")] - [DataRow("", "Default")] - public void GetCluster(string cluster, string outCluster) - { - var api = new CustomConfigurationAPI(_dccSectionOptions, null); - Assert.IsTrue(api.GetCluster(cluster) == outCluster); - } - - [DataTestMethod] - [DataRow("CustomAppid", "CustomAppid")] - [DataRow("", "DccTest")] - public void GetAppid(string appId, string outAppid) - { - var api = new CustomConfigurationAPI(_dccSectionOptions, null); - Assert.IsTrue(api.GetAppId(appId) == outAppid); - } - - [DataTestMethod] - [DataRow("configObject", "configObject")] - [DataRow("", "")] - public void GetConfigObject(string configObject, string outConfigObject) - { - var api = new CustomConfigurationAPI(_dccSectionOptions, null); - if (string.IsNullOrEmpty(configObject)) - Assert.ThrowsException(() => api.GetConfigObject(configObject)); - else - Assert.IsTrue(api.GetConfigObject(configObject) == outConfigObject); - } -} - -public class CustomConfigurationAPI : ConfigurationApiBase -{ - public CustomConfigurationAPI(DccSectionOptions defaultSectionOption, List? expandSectionOptions) : base(defaultSectionOption, expandSectionOptions) - { - } - - public new string GetSecret(string appId) => base.GetSecret(appId); - - public new string GetEnvironment(string environment) => base.GetEnvironment(environment); - - public new string GetCluster(string cluster) => base.GetCluster(cluster); - - public new string GetAppId(string appId) => base.GetAppId(appId); - - public new string GetConfigObject(string configObject) => base.GetConfigObject(configObject); -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs deleted file mode 100644 index bed38fa52..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs +++ /dev/null @@ -1,842 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests; - -[TestClass] -public class DccTest -{ - private string DEFAULT_CLIENT_NAME = "masa.contrib.configuration.configurationapi.dcc"; - private Mock _masaConfigurationBuilder; - private JsonSerializerOptions _jsonSerializerOptions; - private IServiceCollection _services; - - private Mock _memoryCacheClientFactory; - private Mock _memoryCache; - private Mock _distributedCacheClient; - private const string DEFAULT_ENVIRONMENT_NAME = "ASPNETCORE_ENVIRONMENT"; - private const string DEFAULT_SUBSCRIBE_KEY_PREFIX = "masa.dcc:"; - - [TestInitialize] - public void Initialize() - { - _services = new ServiceCollection(); - _masaConfigurationBuilder = new Mock(); - var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json", true, true).Build; - _masaConfigurationBuilder.Setup(builder => builder.Configuration).Returns(configuration).Verifiable(); - _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - _memoryCacheClientFactory = new Mock(); - _memoryCache = new Mock(); - _distributedCacheClient = new Mock(); - _jsonSerializerOptions = new JsonSerializerOptions() - { - PropertyNameCaseInsensitive = true - }; - } - - [TestMethod] - public void TestTryAddConfigurationApiClient() - { - _memoryCacheClientFactory.Setup(factory => factory.CreateClient(DEFAULT_CLIENT_NAME)).Returns(() => null!).Verifiable(); - _services.AddSingleton(_ => _memoryCacheClientFactory.Object); - MasaConfigurationExtensions.TryAddConfigurationApiClient(_services, new DccSectionOptions(), new List(), null!); - Assert.IsTrue(_services.Count(service - => service.ServiceType == typeof(IConfigurationApiClient) && service.Lifetime == ServiceLifetime.Singleton) == 1); - Assert.ThrowsException(() => - { - var _ = _services.BuildServiceProvider().GetServices(); - }); - - _services = new ServiceCollection(); - _memoryCacheClientFactory - .Setup(factory => factory.CreateClient(DEFAULT_CLIENT_NAME)) - .Returns(() => new MemoryCacheClient(_memoryCache.Object, _distributedCacheClient.Object, - SubscribeKeyTypes.ValueTypeFullNameAndKey)) - .Verifiable(); - _services.AddSingleton(_ => _memoryCacheClientFactory.Object); - MasaConfigurationExtensions.TryAddConfigurationApiClient(_services, new DccSectionOptions(), new List(), - new JsonSerializerOptions() - { - Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping - }); - - var clienties = _services.BuildServiceProvider().GetServices(); - Assert.IsTrue(clienties.Count() == 1); - - _services = new ServiceCollection(); - _memoryCacheClientFactory - .Setup(factory => factory.CreateClient(DEFAULT_CLIENT_NAME)) - .Returns(() => new MemoryCacheClient(_memoryCache.Object, _distributedCacheClient.Object, - SubscribeKeyTypes.ValueTypeFullNameAndKey)) - .Verifiable(); - _services.AddSingleton(_ => _memoryCacheClientFactory.Object); - MasaConfigurationExtensions.TryAddConfigurationApiClient(_services, new DccSectionOptions(), new List(), - _jsonSerializerOptions); - MasaConfigurationExtensions.TryAddConfigurationApiClient(_services, new DccSectionOptions(), new List(), - _jsonSerializerOptions); - clienties = _services.BuildServiceProvider().GetServices(); - Assert.IsTrue(clienties.Count() == 1); - } - - [TestMethod] - public void TestTryAddConfigurationApiManage() - { - Mock httpClientFactory = new(); - _services.AddSingleton(httpClientFactory.Object); - _services.AddCaller(options => options.UseHttpClient()); - - MasaConfigurationExtensions.TryAddConfigurationApiManage( - _services, - "http", - new DccSectionOptions(), - new List()); - - MasaConfigurationExtensions.TryAddConfigurationApiManage( - _services, - "http", - new DccSectionOptions(), - new List()); - Assert.IsTrue(_services.Count(service - => service.ServiceType == typeof(IConfigurationApiManage) && service.Lifetime == ServiceLifetime.Singleton) == 1); - var serviceProvider = _services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestUseDccAndNullDccConfigurationOption() - { - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => null!, option => - { - option.AppId = "Test"; - option.Environment = "Test"; - option.ConfigObjects = new List() { "Te" }; - }, null)); - } - - [TestMethod] - public void TestCustomCaller() - { - var response = JsonSerializer.Serialize(new PublishRelease() - { - Content = string.Empty, - ConfigFormat = ConfigFormats.Text - }); - Mock memoryCacheClient = new(); - memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) - .Returns(() => response); - - var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), - memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); - _services.AddSingleton(configurationApiClient); - _masaConfigurationBuilder.Object.UseDcc(() => new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }, option => - { - option.AppId = "Test"; - option.Environment = "Test"; - option.ConfigObjects = new List() - { - "Settings" - }; - }, null, jsonSerializerOption => - { - jsonSerializerOption.Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping; - }, option => - { - option.UseHttpClient(builder => - { - builder.Name = "CustomHttpClient"; - builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); - }); - }); - var caller = _services.BuildServiceProvider().GetRequiredService().Create("CustomHttpClient"); - Assert.IsNotNull(caller); - } - - [TestMethod] - public void TestUseDccAndEmptyDccServiceAddress() - { - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "", - }; - }, null!, null), "DccServiceAddress"); - } - - [TestMethod] - public void TestUseDccAndErrorDccService() - { - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = null! - } - }; - }, null!, null), "Servers"); - - _services = new ServiceCollection(); - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions - { - Servers = new List() - } - }; - }, null!, null), "Servers"); - - _services = new ServiceCollection(); - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions - { - Servers = new List() - { - new() - { - Host = "", - Port = 8080 - } - } - } - }; - }, null!, null), "Servers"); - - _services = new ServiceCollection(); - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = -1 - } - } - } - }; - }, null!, null), "Servers"); - } - - [TestMethod] - public void TestUseDccAndErrorDefaultSectionOption() - { - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, null!, null), "defaultSectionOptions"); - - _services = new ServiceCollection(); - _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, option => - { - option.AppId = ""; - }, null), "AppId cannot be empty"); - - _services = new ServiceCollection(); - _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, option => - { - option.AppId = "Test"; - option.ConfigObjects = null!; - }, null), "ConfigObjects cannot be empty"); - - _services = new ServiceCollection(); - _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, option => - { - option.AppId = "Test"; - option.ConfigObjects = new List(); - }, null), "ConfigObjects cannot be empty"); - - _services = new ServiceCollection(); - _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, option => - { - option.AppId = "Test"; - option.ConfigObjects = new List() - { - "Brand" - }; - }, null), "Error getting environment information, please make sure the value of ASPNETCORE_ENVIRONMENT has been configured"); - } - - [TestMethod] - public void TestUseDccAndErrorExpansionSectionOptions() - { - Environment.SetEnvironmentVariable(DEFAULT_ENVIRONMENT_NAME, "Test"); - - _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, option => - { - option.AppId = "Test"; - option.ConfigObjects = new List() - { - "Brand" - }; - }, option => - { - option.ExpandSections = new List() - { - new() - { - AppId = "Test2", - } - }; - }), "ConfigObjects in the extension section cannot be empty"); - - _services = new ServiceCollection(); - _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, option => - { - option.AppId = "Test"; - option.ConfigObjects = new List() - { - "Brand" - }; - }, option => - { - option.ExpandSections = new List() - { - new() - { - AppId = "Test2", - ConfigObjects = new List() - } - }; - }), "ConfigObjects in the extension section cannot be empty"); - - _services = new ServiceCollection(); - _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, option => - { - option.AppId = "Test"; - option.ConfigObjects = new List() - { - "Brand" - }; - }, option => - { - option.ExpandSections = new List() - { - new() - { - AppId = "Test", - ConfigObjects = new List() - { - "Settings" - } - } - }; - }), "The current section already exists, no need to mount repeatedly"); - - _services = new ServiceCollection(); - _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, option => - { - option.AppId = "Test"; - option.ConfigObjects = new List() - { - "Brand" - }; - }, option => - { - option.ExpandSections = new List() - { - new() - { - AppId = "Test2", - ConfigObjects = new List() - { - "Settings" - } - }, - new() - { - AppId = "Test2", - ConfigObjects = new List() - { - "Settings" - } - } - }; - }), "The current section already exists, no need to mount repeatedly"); - } - - [DataTestMethod] - [DataRow("Development", "Default", "WebApplication1", "Brand")] - public void TestUseDccAndSuccess(string environment, string cluster, string appId, string configObject) - { - Environment.SetEnvironmentVariable(DEFAULT_ENVIRONMENT_NAME, "Test"); - var brand = new Brands("Microsoft"); - var response = JsonSerializer.Serialize(new PublishRelease() - { - Content = JsonSerializer.Serialize(brand), - ConfigFormat = ConfigFormats.Json - }); - Mock memoryCacheClient = new(); - memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) - .Returns(() => response); - - var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), - memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); - _services.AddSingleton(configurationApiClient); - - _masaConfigurationBuilder.Object.UseDcc(() => - { - return new DccConfigurationOptions() - { - ManageServiceAddress = "https://github.com", - RedisOptions = new RedisConfigurationOptions() - { - Servers = new List() - { - new() - { - Host = "localhost", - Port = 6379 - } - } - } - }; - }, option => - { - option.AppId = "Test"; - option.ConfigObjects = new List() - { - "Brand" - }; - }, null); - var optionFactory = _services.BuildServiceProvider().GetRequiredService>(); - var option = optionFactory.Create(DEFAULT_CLIENT_NAME); - - Assert.IsTrue(option.SubscribeKeyType == SubscribeKeyTypes.SpecificPrefix); - - Assert.IsTrue(option.SubscribeKeyPrefix == DEFAULT_SUBSCRIBE_KEY_PREFIX); - } - - [TestMethod] - public void TestDccConfigurationOptions() - { - var options = new DccConfigurationOptions - { - RedisOptions = new RedisConfigurationOptions() - { - SyncTimeout = 10 - }, - ManageServiceAddress = "https://github.com", - SubscribeKeyPrefix = "masa.dcc.test:" - }; - Assert.IsTrue(options.SubscribeKeyPrefix == "masa.dcc.test:"); - Assert.IsTrue(options.ManageServiceAddress == "https://github.com"); - Assert.IsTrue(options.RedisOptions.SyncTimeout == 10); - } - - [DataTestMethod] - [DataRow("Development", "Default", "WebApplication1", "Brand")] - public void TestUseDccAndSingleSection(string environment, string cluster, string appId, string configObject) - { - CustomTrigger trigger = new CustomTrigger(_jsonSerializerOptions); - var brand = new Brands("Microsoft"); - var response = JsonSerializer.Serialize(new PublishRelease() - { - Content = brand.Serialize(_jsonSerializerOptions), - ConfigFormat = ConfigFormats.Text - }); - Mock memoryCacheClient = new(); - memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) - .Returns(() => response); - var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), - memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); - _services.AddSingleton(configurationApiClient); - - _masaConfigurationBuilder.Object.UseDcc(); - Assert.IsTrue( - configurationApiClient - .GetRawAsync(environment, cluster, appId, configObject, It.IsAny>()) - .GetAwaiter() - .GetResult().Raw == brand.Serialize(_jsonSerializerOptions)); - trigger.Execute(); - } - - [DataTestMethod] - [DataRow("Development", "Default", "WebApplication1", "Brand")] - public void TestUseDccAndSingleSection2(string environment, string cluster, string appId, string configObject) - { - CustomTrigger trigger = new CustomTrigger(_jsonSerializerOptions); - Mock memoryCacheClient = new(); - Dictionary masaDic = new Dictionary() - { - { "Id", Guid.NewGuid().ToString() }, - { "Name", "Masa" } - }; - var response = JsonSerializer.Serialize(new PublishRelease() - { - Content = masaDic.Serialize(_jsonSerializerOptions), - ConfigFormat = ConfigFormats.Json - }); - memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) - .Returns(() => response); - var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), - memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); - _services.AddSingleton(configurationApiClient); - - _masaConfigurationBuilder.Object.UseDcc(); - Assert.IsTrue( - configurationApiClient.GetRawAsync( - environment, - cluster, - appId, - configObject, - It.IsAny>()).Result.Raw == masaDic.Serialize(_jsonSerializerOptions)); - } - - [DataTestMethod] - [DataRow("Development", "Default", "WebApplication1", "Brand")] - public void TestUseDccAndSingleSection3(string environment, string cluster, string appId, string configObject) - { - Mock memoryCacheClient = new(); - - var response = JsonSerializer.Serialize(new PublishRelease() - { - Content = "Test", - ConfigFormat = ConfigFormats.Text - }); - memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) - .Returns(() => response); - var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), - memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); - _services.AddSingleton(configurationApiClient); - - _masaConfigurationBuilder.Object.UseDcc(); - Assert.IsTrue(configurationApiClient.GetRawAsync( - environment, - cluster, - appId, - configObject, - It.IsAny>()).GetAwaiter().GetResult().Raw == "Test"); - } - - [DataTestMethod] - [DataRow("Development", "Default", "WebApplication1", "Brand")] - public void TestUseDccAndSingleSection4(string environment, string cluster, string appId, string configObject) - { - Mock memoryCacheClient = new(); - - var response = JsonSerializer.Serialize(new PublishRelease() - { - Content = null, - ConfigFormat = ConfigFormats.Text - }); - memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) - .Returns(() => response); - var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), - memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); - _services.AddSingleton(configurationApiClient); - - _masaConfigurationBuilder.Object.UseDcc(); - Assert.IsTrue(configurationApiClient.GetRawAsync( - environment, - cluster, - appId, - configObject, - It.IsAny>()).GetAwaiter().GetResult().Raw == null); - } - - [TestMethod] - public void TestUseDccAndSingleSection5() - { - CustomTrigger trigger = new CustomTrigger(_jsonSerializerOptions); - Mock memoryCacheClient = new(); - var response = JsonSerializer.Serialize(new PublishRelease() - { - Content = "Test", - ConfigFormat = (ConfigFormats)4 - }); - memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) - .Returns(() => response); - var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), - memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); - _services.AddSingleton(configurationApiClient); - - Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc()); - } - - [DataTestMethod] - [DataRow("Development", "Default", "WebApplication1", "Brand")] - public void TestUseMultiDcc(string environment, string cluster, string appId, string configObject) - { - var brand = new Brands("Microsoft"); - var response = JsonSerializer.Serialize(new PublishRelease() - { - Content = JsonSerializer.Serialize(brand), - ConfigFormat = ConfigFormats.Json - }); - Mock memoryCacheClient = new(); - memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result).Returns(() => response); - - var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), memoryCacheClient.Object, - _jsonSerializerOptions, new Mock().Object, new List()); - _services.AddSingleton(configurationApiClient); - - _masaConfigurationBuilder.Object.UseDcc().UseDcc(); - var result = configurationApiClient.GetRawAsync( - environment, - cluster, - appId, - configObject, - It.IsAny>()).ConfigureAwait(false).GetAwaiter().GetResult(); - Assert.IsTrue(result.Raw == JsonSerializer.Serialize(brand)); - - var httpClient = _services.BuildServiceProvider().GetRequiredService().CreateClient(DEFAULT_CLIENT_NAME); - Assert.IsTrue(httpClient.BaseAddress!.ToString() == "http://localhost:6379/"); - } - - [TestMethod] - public void TestLoadPropertiesShouldReturnJson() - { - var brands = new Brands("Microsoft"); - Mock configurationClient = new(); - configurationClient.Setup(client => client.GetRawAsync(It.IsAny(), It.IsAny(), It.IsAny(), - It.IsAny(), It.IsAny>())).ReturnsAsync((JsonSerializer.Serialize(brands), ConfigurationTypes.Json)); - } - - [TestMethod] - public void TestMasaConfigurationByConfigurationAPIReturnKeyIsExist() - { - var builder = WebApplication.CreateBuilder(); - var brand = new Brands("Apple"); - builder.Services.AddMemoryCache(); - string key = "Development-Default-WebApplication1-Brand".ToLower(); - builder.Services.AddSingleton(serviceProvider => - { - var memoryCache = serviceProvider.GetRequiredService(); - string value = new PublishRelease() - { - Content = brand.Serialize(_jsonSerializerOptions), - ConfigFormat = ConfigFormats.Json - }.Serialize(_jsonSerializerOptions); - memoryCache.Set($"{key}String", value); - return new CustomMemoryCacheClientFactory(memoryCache); - }); - - builder.AddMasaConfiguration(masaBuilder => masaBuilder.UseDcc()); - - var serviceProvider = builder.Services.BuildServiceProvider(); - var masaConfiguration = serviceProvider.GetService(); - Assert.IsTrue(masaConfiguration != null); - var configuration = masaConfiguration!.ConfigurationApi; - Assert.IsNotNull(configuration); - - Assert.IsTrue(configuration.Get("WebApplication1")["Brand:Name"] == "Apple"); - } - - [TestMethod] - public void TestGetSecretRenturnSecretEqualSecret() - { - var builder = WebApplication.CreateBuilder(); - var brand = new Brands("Apple"); - builder.Services.AddMemoryCache(); - string key = "Development-Default-WebApplication1-Brand".ToLower(); - builder.Services.AddSingleton(serviceProvider => - { - var memoryCache = serviceProvider.GetRequiredService(); - string value = new PublishRelease() - { - Content = brand.Serialize(_jsonSerializerOptions), - ConfigFormat = ConfigFormats.Json - }.Serialize(_jsonSerializerOptions); - memoryCache.Set($"{key}String", value); - return new CustomMemoryCacheClientFactory(memoryCache); - }); - builder.AddMasaConfiguration(configurationBuilder => configurationBuilder.UseDcc()); - - var serviceProvider = builder.Services.BuildServiceProvider(); - var configurationApiClient = serviceProvider.GetRequiredService(); - var field = typeof(ConfigurationApiBase).GetField("_defaultSectionOption", BindingFlags.Instance | BindingFlags.NonPublic); - var option = field!.GetValue(configurationApiClient); - Assert.IsTrue(((DccSectionOptions)option!).Secret == "Secret"); - } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs deleted file mode 100644 index 383e39b14..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Common; - -internal static class SerializeCommon -{ - public static string Serialize(this object obj, JsonSerializerOptions? jsonSerializerOptions) - => JsonSerializer.Serialize(obj, jsonSerializerOptions); -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs deleted file mode 100644 index 49cb47bdd..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Config; - -internal class Property -{ - public string Key { get; set; } = default!; - - public string Value { get; set; } = default!; -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs deleted file mode 100644 index 612d947d0..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Config; - -internal class PublishRelease -{ - public ConfigFormats ConfigFormat { get; set; } - - public string? FormatLabelCode { get; set; } - - public string? Content { get; set; } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs deleted file mode 100644 index 2a755fd91..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal; - -internal class CustomConfigurationApiClient : ConfigurationApiClient -{ - public CustomConfigurationApiClient( - IServiceProvider serviceProvider, - IMemoryCacheClient client, - JsonSerializerOptions jsonSerializerOptions, - DccSectionOptions defaultSectionOption, - List? expandSectionOptions) - : base(serviceProvider, client, jsonSerializerOptions, defaultSectionOption, expandSectionOptions) - { - } - - public (string Raw, ConfigurationTypes ConfigurationType) TestFormatRaw(string? raw, string paramName) - => base.FormatRaw(raw, paramName); - - public Task<(string Raw, ConfigurationTypes ConfigurationType)> TestGetRawByKeyAsync(string key, Action? valueChanged) - => base.GetRawByKeyAsync(key, valueChanged); - - public Task TestGetDynamicAsync(string key, Action? valueChanged) => base.GetDynamicAsync(key, valueChanged); -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs deleted file mode 100644 index f4f3360fe..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal; - -public class CustomTrigger -{ - private JsonSerializerOptions _jsonSerializerOptions; - - public CustomTrigger(JsonSerializerOptions jsonSerializerOptions) - { - _jsonSerializerOptions = jsonSerializerOptions; - } - - internal ConfigFormats Formats { get; set; } - - internal string Content { get; set; } - - internal Action Action { get; set; } - - internal void Execute() - { - Action?.Invoke(new PublishRelease() - { - ConfigFormat = Formats, - Content = Content - }.Serialize(_jsonSerializerOptions)); - } -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs deleted file mode 100644 index 96a145453..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Enum; - -internal enum ConfigFormats -{ - Properties = 1, - Text, - Json, - Yaml, - Xml -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs deleted file mode 100644 index 85f7c4c30..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Model; - -internal class Brands -{ - public Guid Id { get; init; } - - public string Name { get; set; } - - public Brands() - => this.Id = Guid.NewGuid(); - - public Brands(string Name) : this() - => this.Name = Name; -} diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj deleted file mode 100644 index 83af98cf2..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj +++ /dev/null @@ -1,41 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - Always - - - Always - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs deleted file mode 100644 index 4216f2904..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Configuration; -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Common; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Config; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Enum; -global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Model; -global using Masa.Contrib.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Masa.Utils.Caching.Core.Interfaces; -global using Masa.Utils.Caching.Core.Models; -global using Masa.Utils.Caching.DistributedMemory; -global using Masa.Utils.Caching.DistributedMemory.Interfaces; -global using Masa.Utils.Caching.DistributedMemory.Models; -global using Masa.Utils.Caching.Redis.Models; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Extensions.Caching.Memory; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Dynamic; -global using System.Net; -global using System.Reflection; -global using System.Text.Json; -global using YamlDotNet.Serialization; diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json deleted file mode 100644 index 3708a6f41..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "DccOptions": { - "ManageServiceAddress": "http://localhost:6379", - "SubscribeKeyPrefix": "masa.dcc:", - "RedisOptions": { - "Servers": [ - { - "Host": "localhost", - "Port": 6379 - } - ], - "DefaultDatabase": 0, - "Password": "" - } - }, - "AppId": "WebApplication1", - "Environment": "Development", - "Cluster": "Default", - "ConfigObjects": [ - "Brand" - ], - "Secret": "Secret" -} \ No newline at end of file diff --git a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json b/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json deleted file mode 100644 index 28e953152..000000000 --- a/src/Contrib/Configuration/ConfigurationApi/test/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "DccOptions": { - "ManageServiceAddress": "http://localhost:6379", - "RedisOptions": { - "Servers": [ - { - "Host": "localhost", - "Port": 8888 - } - ], - "DefaultDatabase": 0, - "Password": "" - } - }, - "AppId": "DccTest", - "Environment": "Test", - "Cluster": "Default", - "ConfigObjects": [ - "Test1" - ], - "Sectet": "", - "ExpandSections": [ - { - "AppId": "DccTest2", - "Environment": "Test2", - "Cluster": "Default", - "ConfigObjects": [ - "Test3" - ] - } - ] -} \ No newline at end of file diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs deleted file mode 100644 index 1e365be22..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Contracts.EF.DataFiltering; - -public class DataFilter : IDataFilter -{ - private readonly IServiceProvider _serviceProvider; - private readonly MemoryCache _cache; - - public DataFilter(IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - _cache = new(); - } - - public IDisposable Enable() where TFilter : class - => GetFilter().Enable(); - - public IDisposable Disable() where TFilter : class - => GetFilter().Disable(); - - public bool IsEnabled() where TFilter : class - => GetFilter().Enabled; - - private DataFilter GetFilter() - where TFilter : class - { - return (_cache.GetOrAdd( - typeof(TFilter), - _ => _serviceProvider.GetRequiredService>() - ) as DataFilter)!; - } -} - -public class DataFilter where TFilter : class -{ - private readonly AsyncLocal _filter; - - public DataFilter() => _filter = new AsyncLocal(); - - public bool Enabled - { - get - { - _filter.Value ??= new DataFilterState(true); - - return _filter.Value!.Enabled; - } - } - - public IDisposable Enable() - { - if (Enabled) - return NullDisposable.Instance; - - _filter.Value!.Enabled = true; - - return new DisposeAction(() => Disable()); - } - - public IDisposable Disable() - { - if (!Enabled) - return NullDisposable.Instance; - - _filter.Value!.Enabled = false; - - return new DisposeAction(() => Enable()); - } -} diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs deleted file mode 100644 index 4f406e70a..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Contracts.EF.DataFiltering; - -public class SoftDeleteSaveChangesFilter : ISaveChangesFilter - where TDbContext : DbContext - where TUserId : IComparable -{ - private readonly Type _userIdType; - private readonly IUserContext? _userContext; - private readonly TDbContext _context; - private readonly MasaDbContextOptions _masaDbContextOptions; - - public SoftDeleteSaveChangesFilter( - MasaDbContextOptions masaDbContextOptions, - TDbContext dbContext, - IUserContext? userContext = null) - { - _userIdType = typeof(TUserId); - _masaDbContextOptions = masaDbContextOptions; - _context = dbContext; - _userContext = userContext; - } - - public void OnExecuting(ChangeTracker changeTracker) - { - if (!_masaDbContextOptions.EnableSoftDelete) - return; - - changeTracker.DetectChanges(); - var entries = changeTracker.Entries().Where(entry => entry.State == EntityState.Deleted && entry.Entity is ISoftDelete); - foreach (var entity in entries) - { - HandleNavigationEntry(entity.Navigations.Where(n => (n.Metadata is not ISkipNavigation) && !((IReadOnlyNavigation)n.Metadata).IsOnDependent)); - - entity.State = EntityState.Modified; - entity.CurrentValues[nameof(ISoftDelete.IsDeleted)] = true; - - if (_userContext != null && entity.Entity is IAuditEntity && - entity.CurrentValues[nameof(IAuditEntity.Modifier)] != default) - { - var userId = GetUserId(_userContext.UserId); - if (userId != null) entity.CurrentValues[nameof(IAuditEntity.Modifier)] = userId; - - entity.CurrentValues[nameof(IAuditEntity.ModificationTime)] = - DateTime.UtcNow; //The current time to change to localization after waiting for localization - } - } - } - - protected virtual void HandleNavigationEntry(IEnumerable navigationEntries) - { - foreach (var navigationEntry in navigationEntries) - { - if (navigationEntry is CollectionEntry collectionEntry) - { - foreach (var dependentEntry in collectionEntry.CurrentValue ?? new List()) - { - HandleDependent(dependentEntry); - } - } - else - { - var dependentEntry = navigationEntry.CurrentValue; - if (dependentEntry != null) - { - HandleDependent(dependentEntry); - } - } - } - } - - protected virtual void HandleDependent(object dependentEntry) - { - var entityEntry = _context.Entry(dependentEntry); - entityEntry.State = EntityState.Modified; - - if (entityEntry.Entity is ISoftDelete) - entityEntry.CurrentValues[nameof(ISoftDelete.IsDeleted)] = true; - } - - private object? GetUserId(string? userId) - { - if (userId == null) - return null; - - if (_userIdType == typeof(Guid)) - return Guid.Parse(userId); - - return Convert.ChangeType(userId, _userIdType); - } -} diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs deleted file mode 100644 index 85364dfa7..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Contracts.EF.Internal; - -internal class DataFilterState -{ - public bool Enabled { get; set; } - - public DataFilterState(bool enabled) - { - Enabled = enabled; - } -} diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs deleted file mode 100644 index 2c179575d..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Contracts.EF.Internal; - -internal class DisposeAction : IDisposable -{ - private readonly Action _action; - - public DisposeAction(Action action) => _action = action; - - public void Dispose() => _action.Invoke(); -} diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs deleted file mode 100644 index 09a1e0e7c..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Contracts.EF.Internal; - -internal class InstanceBuilder -{ - internal delegate object InvokeDelegate(params object?[] parameters); - - public static InvokeDelegate CreateInstanceDelegate(ConstructorInfo constructorInfo) - { - ParameterInfo[] parameters = constructorInfo.GetParameters(); - var parameterParameterExpression = Expression.Parameter(typeof(object[]), "parameters"); - - var parameterCast = new List(parameters.Length); - for (int i = 0; i < parameters.Length; i++) - { - var paramInfo = parameters[i]; - var valueObj = Expression.ArrayIndex(parameterParameterExpression, Expression.Constant(i)); - var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); - parameterCast.Add(valueCast); - } - NewExpression newExp = Expression.New(constructorInfo, parameterCast); - var lambdaExp = Expression.Lambda(newExp, parameterParameterExpression); - return lambdaExp.Compile(); - } -} diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs deleted file mode 100644 index ad67a3355..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Contracts.EF.Internal; - -internal class NullDisposable : IDisposable -{ - public static NullDisposable Instance { get; } = new(); - - public void Dispose() - { - } -} diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj deleted file mode 100644 index 66ef7b261..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs deleted file mode 100644 index 7584bb2ce..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Contracts.EF; - -public static class MasaDbContextOptionsBuilderExtensions -{ - private static readonly List _types = new(); - - public static MasaDbContextBuilder UseFilter( - this MasaDbContextBuilder masaDbContextOptionsBuilder, - Action? options = null) - => masaDbContextOptionsBuilder.UseFilterCore(false, options); - - public static MasaDbContextBuilder UseTestFilter( - this MasaDbContextBuilder masaDbContextOptionsBuilder, - Action? options = null) - => masaDbContextOptionsBuilder.UseFilterCore(true, options); - - private static MasaDbContextBuilder UseFilterCore( - this MasaDbContextBuilder masaDbContextOptionsBuilder, - bool isTest, - Action? options = null) - { - var filterOptions = new FilterOptions(); - options?.Invoke(filterOptions); - - masaDbContextOptionsBuilder.Services.TryAddScoped(typeof(DataFilter<>)); - masaDbContextOptionsBuilder.Services.TryAddScoped(); - - if (filterOptions.EnableSoftDelete) masaDbContextOptionsBuilder.UseSoftDelete(isTest); - - return masaDbContextOptionsBuilder; - } - - private static void UseSoftDelete(this MasaDbContextBuilder masaDbContextOptionsBuilder, bool isTest = false) - { - if (!isTest) - { - if (_types.Any(type => masaDbContextOptionsBuilder.DbContextType == type)) - return; - - _types.Add(masaDbContextOptionsBuilder.DbContextType); - } - - var masaDbContextOptionsType = typeof(MasaDbContextOptions<>).MakeGenericType(masaDbContextOptionsBuilder.DbContextType); - var softDeleteSaveChangesFilterType = - typeof(SoftDeleteSaveChangesFilter<,>).MakeGenericType( - masaDbContextOptionsBuilder.DbContextType, - masaDbContextOptionsBuilder.UserIdType); - var constructorInfo = softDeleteSaveChangesFilterType.GetConstructors().FirstOrDefault()!; - var invokeDelegate = InstanceBuilder.CreateInstanceDelegate(constructorInfo); - - masaDbContextOptionsBuilder.Services.Add( - new ServiceDescriptor(typeof(ISaveChangesFilter), - serviceProvider => - { - var instance = invokeDelegate.Invoke( - serviceProvider.GetRequiredService(masaDbContextOptionsType), - serviceProvider.GetRequiredService(masaDbContextOptionsBuilder.DbContextType), - serviceProvider.GetService()); - return instance; - }, - ServiceLifetime.Scoped)); - - masaDbContextOptionsBuilder.EnableSoftDelete = true; - } -} diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs deleted file mode 100644 index d9d92f32d..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Contracts.EF.Options; - -public class FilterOptions -{ - /// - /// enable soft delete - /// default: true - /// If you are sure that you do not need to use soft delete in the project, you can change to false - /// IDataFilter does not support ISoftDelete when soft delete is disabled - /// - public bool EnableSoftDelete { get; set; } = true; -} diff --git a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/_Imports.cs b/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/_Imports.cs deleted file mode 100644 index 9b7d93fac..000000000 --- a/src/Contrib/Data/Contracts/src/Masa.Contrib.Data.Contracts.EF/_Imports.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; -global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.Contrib.Data.Contracts.EF.DataFiltering; -global using Masa.Contrib.Data.Contracts.EF.Internal; -global using Masa.Contrib.Data.Contracts.EF.Options; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore.Filters; -global using Masa.Utils.Caching.Memory; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.ChangeTracking; -global using Microsoft.EntityFrameworkCore.Metadata; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using System.Linq.Expressions; -global using System.Reflection; diff --git a/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs b/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs deleted file mode 100644 index afc0310fe..000000000 --- a/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Contracts.EF.Tests; - -[TestClass] -public class DataFilterTest -{ - private IServiceCollection _services; - private IDataFilter _dataFilter; - - [TestInitialize] - public void Initialize() - { - _services = new ServiceCollection(); - _services.AddSingleton(); - _services.AddSingleton(typeof(DataFilter<>)); - _dataFilter = new DataFilter(_services.BuildServiceProvider()); - } - - [TestMethod] - public void TestDataFilterReturnTrue() - { - Assert.IsTrue(_dataFilter.IsEnabled()); - - using (_dataFilter.Disable()) - { - Assert.IsFalse(_dataFilter.IsEnabled()); - } - - Assert.IsTrue(_dataFilter.IsEnabled()); - } - - [TestMethod] - public void TestDataFilterReturnFalse() - { - _dataFilter.Disable(); - Assert.IsFalse(_dataFilter.IsEnabled()); - - using (_dataFilter.Enable()) - { - Assert.IsTrue(_dataFilter.IsEnabled()); - } - - Assert.IsFalse(_dataFilter.IsEnabled()); - } -} diff --git a/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj b/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj deleted file mode 100644 index 13756c016..000000000 --- a/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - diff --git a/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs b/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs deleted file mode 100644 index 05c2ff359..000000000 --- a/src/Contrib/Data/Contracts/test/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; -global using Masa.Contrib.Data.Contracts.EF.DataFiltering; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs deleted file mode 100644 index 9d87952e2..000000000 --- a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Local; - -public class DefaultLocalDistributedLock : IDistributedLock -{ - private readonly MemoryCache _localObjects = new(); - - public IDisposable? TryGet(string key, TimeSpan timeout = default) - { - var semaphore = GetSemaphoreSlim(key); - - if (!semaphore.Wait(timeout)) - { - return null; - } - - return new DisposeAction(semaphore); - } - - public async Task TryGetAsync(string key, TimeSpan timeout = default, CancellationToken cancellationToken = default) - { - var semaphore = GetSemaphoreSlim(key); - - if (!await semaphore.WaitAsync(timeout, cancellationToken)) - { - return null; - } - - return new DisposeAction(semaphore); - } - - private SemaphoreSlim GetSemaphoreSlim(string key) - { - ArgumentNullOrWhiteSpaceException.ThrowIfNullOrWhiteSpace(key); - return _localObjects.GetOrAdd(key, _ => new SemaphoreSlim(1, 1)); - } -} diff --git a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs deleted file mode 100644 index 5298a191f..000000000 --- a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Local.Internal; - -internal class ArgumentNullOrWhiteSpaceException -{ - public static void ThrowIfNullOrWhiteSpace(string? argument, string? paramName = null) - { - paramName ??= nameof(argument); - - if (string.IsNullOrWhiteSpace(argument)) - throw new ArgumentException($"{paramName} can not be null, empty or white space!", paramName); - } -} diff --git a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs deleted file mode 100644 index 42d85c737..000000000 --- a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Local.Internal; - -internal class DisposeAction : IDisposable, IAsyncDisposable -{ - private readonly SemaphoreSlim _semaphore; - - public DisposeAction(SemaphoreSlim semaphore) => _semaphore = semaphore; - - public ValueTask DisposeAsync() - { - _semaphore.Release(); - return ValueTask.CompletedTask; - } - - public void Dispose() => _semaphore.Release(); -} diff --git a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj deleted file mode 100644 index 5cba405b0..000000000 --- a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.md b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.md deleted file mode 100644 index a8ad4be77..000000000 --- a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.md +++ /dev/null @@ -1,28 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Local - -## Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Local -``` - -1. Modify the class `Program` - -``` C# -builder.Services.AddLocalDistributedLock(); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md deleted file mode 100644 index 6904395ac..000000000 --- a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md +++ /dev/null @@ -1,28 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Local - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Local -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddLocalDistributedLock(); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs deleted file mode 100644 index b8bec19be..000000000 --- a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddLocalDistributedLock(this IServiceCollection services) - { - if (services.Any()) - return services; - - services.TryAddSingleton(); - return services; - } -} diff --git a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs b/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs deleted file mode 100644 index 4080f7033..000000000 --- a/src/Contrib/Data/DistributedLock/Local/src/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.DistributedLock.Local; -global using Masa.Contrib.Data.DistributedLock.Local.Internal; -global using Masa.Utils.Caching.Memory; -global using Microsoft.Extensions.DependencyInjection.Extensions; diff --git a/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs b/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs deleted file mode 100644 index 024dacde2..000000000 --- a/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Local.Tests; - -[TestClass] -public class LocalDistributedLockTest -{ - private IDistributedLock DistributedLock { get; set; } - - [TestInitialize] - public void Initialize() - { - var services = new ServiceCollection(); - services.AddLocalDistributedLock(); - DistributedLock = services.GetInstance(); - } - - [TestMethod] - public void TestDistributedLock() - { - using var obj = DistributedLock.TryGet("test", TimeSpan.FromSeconds(1)); - Assert.IsNotNull(obj); - } - - [TestMethod] - public async Task TestDistributedLockAsync() - { - await using var obj = await DistributedLock.TryGetAsync("test", TimeSpan.FromSeconds(1)); - Assert.IsNotNull(obj); - } -} diff --git a/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj b/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj deleted file mode 100644 index 1f13d9782..000000000 --- a/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs b/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs deleted file mode 100644 index 7c77986d2..000000000 --- a/src/Contrib/Data/DistributedLock/Local/test/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj deleted file mode 100644 index 3b60b397e..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs deleted file mode 100644 index ff3274a06..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MedallionBuilderExtensions -{ - public static void UseAzure(this MedallionBuilder medallionBuilder, - string connectionString, - string blobContainerName, - Action? options = null) - => medallionBuilder.UseAzure(new BlobContainerClient(connectionString, blobContainerName), options); - - public static void UseAzure(this MedallionBuilder medallionBuilder, - string connectionString, - string blobContainerName, - BlobClientOptions blobClientOptions, - Action? options = null) - => medallionBuilder.UseAzure(new BlobContainerClient(connectionString, blobContainerName, blobClientOptions), options); - - public static void UseAzure(this MedallionBuilder medallionBuilder, - BlobContainerClient blobContainerClient, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => new AzureBlobLeaseDistributedSynchronizationProvider(blobContainerClient, options)); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md deleted file mode 100644 index aaea956dc..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion.Azure - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Azure -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseAzure("Replace Your connectionString", "Replace your blobContainerName"); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md deleted file mode 100644 index 8baea08c5..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md +++ /dev/null @@ -1,32 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Medallion.Azure - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Azure -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseAzure("Replace Your connectionString", "Replace your blobContainerName"); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs deleted file mode 100644 index 57b06380d..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Azure.Storage.Blobs; -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Medallion.Threading; -global using Medallion.Threading.Azure; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj deleted file mode 100644 index d42ce5da9..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs deleted file mode 100644 index 9cf3ff7f7..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MedallionBuilderExtensions -{ - public static void UseFileSystem(this MedallionBuilder medallionBuilder, string path) - => medallionBuilder.UseFileSystem(new DirectoryInfo(path)); - - public static void UseFileSystem(this MedallionBuilder medallionBuilder, DirectoryInfo lockFileDirectory) - { - medallionBuilder.Services.AddSingleton(_ - => new FileDistributedSynchronizationProvider(lockFileDirectory)); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md deleted file mode 100644 index 8e6090360..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion.FileSystem - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.FileSystem -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseFileSystem("Replace your directory path"); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md deleted file mode 100644 index 47dab4155..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md +++ /dev/null @@ -1,32 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Medallion.FileSystem - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.FileSystem -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseFileSystem("Replace your directory path"); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs deleted file mode 100644 index 16aa420eb..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Medallion.Threading; -global using Medallion.Threading.FileSystem; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj deleted file mode 100644 index 5ad1dffca..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs deleted file mode 100644 index 965d11332..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MedallionBuilderExtensions -{ - public static void UseMySQL(this MedallionBuilder medallionBuilder, - string connectionString, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => new MySqlDistributedSynchronizationProvider(connectionString, options)); - } - - public static void UseMySQL(this MedallionBuilder medallionBuilder, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(serviceProvider - => - { - var unitOfWorkManager = serviceProvider.GetService(); - if (unitOfWorkManager == null) - throw new NotSupportedException("UoW is not supported"); - - using (var unitOfWork = unitOfWorkManager.CreateDbContext()) - { - var name = ConnectionStringNameAttribute.GetConnStringName(typeof(TDbContextType)); - var connectionStringProvider = unitOfWork.ServiceProvider.GetRequiredService(); - var connectionString = connectionStringProvider.GetConnectionString(name); - return new MySqlDistributedSynchronizationProvider(connectionString, options); - } - }); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md deleted file mode 100644 index 4983e5a08..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion.MySql - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.MySql -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd"); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md deleted file mode 100644 index 42699c1fa..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md +++ /dev/null @@ -1,32 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLocking.Medallion.MySql - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLocking.Medallion.MySql -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd"); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs deleted file mode 100644 index 395c74dfe..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Medallion.Threading; -global using Medallion.Threading.MySql; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj deleted file mode 100644 index 360b2e8a0..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs deleted file mode 100644 index 3dda0c231..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MedallionBuilderExtensions -{ - public static void UseOracle(this MedallionBuilder medallionBuilder, - string connectionString, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => new OracleDistributedSynchronizationProvider(connectionString, options)); - } - - public static void UseOracle(this MedallionBuilder medallionBuilder, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(serviceProvider - => - { - var unitOfWorkManager = serviceProvider.GetService(); - if (unitOfWorkManager == null) - throw new NotSupportedException("UoW is not supported"); - - using (var unitOfWork = unitOfWorkManager.CreateDbContext()) - { - var name = ConnectionStringNameAttribute.GetConnStringName(typeof(TDbContextType)); - var connectionStringProvider = unitOfWork.ServiceProvider.GetRequiredService(); - var connectionString = connectionStringProvider.GetConnectionString(name); - return new OracleDistributedSynchronizationProvider(connectionString, options); - } - }); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md deleted file mode 100644 index e686dc0c0..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion.Oracle - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Oracle -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseOracle("Data Source=MyOracleDB;Integrated Security=yes;"); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md deleted file mode 100644 index 88930baa3..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md +++ /dev/null @@ -1,32 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Medallion.Oracle - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Oracle -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseOracle("Data Source=MyOracleDB;Integrated Security=yes;"); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs deleted file mode 100644 index 28c35b3d6..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Medallion.Threading; -global using Medallion.Threading.Oracle; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj deleted file mode 100644 index 1a14c8e67..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs deleted file mode 100644 index a56d3c519..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MedallionBuilderExtensions -{ - public static void UseNpgsql(this MedallionBuilder medallionBuilder, - string connectionString, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => new PostgresDistributedSynchronizationProvider(connectionString, options)); - } - - public static void UseNpgsql(this MedallionBuilder medallionBuilder, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(serviceProvider - => - { - var unitOfWorkManager = serviceProvider.GetService(); - if (unitOfWorkManager == null) - throw new NotSupportedException("UoW is not supported"); - - using (var unitOfWork = unitOfWorkManager.CreateDbContext()) - { - var name = ConnectionStringNameAttribute.GetConnStringName(typeof(TDbContextType)); - var connectionStringProvider = unitOfWork.ServiceProvider.GetRequiredService(); - var connectionString = connectionStringProvider.GetConnectionString(name); - return new PostgresDistributedSynchronizationProvider(connectionString, options); - } - }); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md deleted file mode 100644 index 6eae77aaf..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseNpgsql("Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity"); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md deleted file mode 100644 index 9b6f7501d..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md +++ /dev/null @@ -1,32 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseNpgsql("Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity"); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs deleted file mode 100644 index 9546f8105..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Medallion.Threading; -global using Medallion.Threading.Postgres; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs deleted file mode 100644 index e90a7af6e..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Medallion.Redis.Internal; - -internal static class ConfigurationOptionsExtensions -{ - public static ConfigurationOptions GetConfigurationOptions(RedisConfigurationOptions redisOptions) - { - var configurationOptions = new ConfigurationOptions - { - AbortOnConnectFail = redisOptions.AbortOnConnectFail, - AllowAdmin = redisOptions.AllowAdmin, - ChannelPrefix = redisOptions.ChannelPrefix, - ClientName = redisOptions.ClientName, - ConnectRetry = redisOptions.ConnectRetry, - ConnectTimeout = redisOptions.ConnectTimeout, - DefaultDatabase = redisOptions.DefaultDatabase, - Password = redisOptions.Password, - Proxy = redisOptions.Proxy, - Ssl = redisOptions.Ssl, - SyncTimeout = redisOptions.SyncTimeout - }; - - foreach (var server in redisOptions.Servers) - { - configurationOptions.EndPoints.Add(server.Host, server.Port); - } - return configurationOptions; - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj deleted file mode 100644 index 4b4fa2879..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs deleted file mode 100644 index 9f2e1aba5..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MedallionBuilderExtensions -{ - public static void UseRedis(this MedallionBuilder medallionBuilder, - string connectionString, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => - { - var connection = ConnectionMultiplexer.Connect(connectionString); - return new RedisDistributedSynchronizationProvider(connection.GetDatabase(), options); - }); - } - - public static void UseRedis(this MedallionBuilder medallionBuilder, - IDatabase database, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => new RedisDistributedSynchronizationProvider(database, options)); - } - - public static void UseRedis(this MedallionBuilder medallionBuilder, - IEnumerable databases, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => new RedisDistributedSynchronizationProvider(databases, options)); - } - - public static void UseRedis(this MedallionBuilder medallionBuilder, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(serviceProvider - => - { - var redisOptions = serviceProvider.GetRequiredService>(); - var connection = ConnectionMultiplexer.Connect(ConfigurationOptionsExtensions.GetConfigurationOptions(redisOptions.Value)); - return new RedisDistributedSynchronizationProvider(connection.GetDatabase(), options); - }); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md deleted file mode 100644 index 6a8a0d7cc..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion.Redis - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Redis -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseRedis("127.0.0.1:6379"); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md deleted file mode 100644 index f93514b4e..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md +++ /dev/null @@ -1,32 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Medallion.Redis - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Redis -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseRedis("127.0.0.1:6379"); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs deleted file mode 100644 index c35b9c490..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Masa.Contrib.Data.DistributedLock.Medallion.Redis.Internal; -global using Masa.Utils.Caching.Redis.Models; -global using Medallion.Threading; -global using Medallion.Threading.Redis; -global using Microsoft.Extensions.Options; -global using StackExchange.Redis; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj deleted file mode 100644 index d9d594b3e..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - Masa.Contrib.Data.DistributedLocking.Medallion.SqlServer - - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs deleted file mode 100644 index 934b6dd45..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MedallionBuilderExtensions -{ - public static void UseSqlServer(this MedallionBuilder medallionBuilder, - string connectionString, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => new SqlDistributedSynchronizationProvider(connectionString, options)); - } - - public static void UseSqlServer(this MedallionBuilder medallionBuilder, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(serviceProvider - => - { - var unitOfWorkManager = serviceProvider.GetService(); - if (unitOfWorkManager == null) - throw new NotSupportedException("UoW is not supported"); - - using var unitOfWork = unitOfWorkManager.CreateDbContext(); - var name = ConnectionStringNameAttribute.GetConnStringName(typeof(TDbContextType)); - var connectionStringProvider = unitOfWork.ServiceProvider.GetRequiredService(); - var connectionString = connectionStringProvider.GetConnectionString(name); - return new SqlDistributedSynchronizationProvider(connectionString, options); - - }); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md deleted file mode 100644 index f8b630db2..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion.SqlServer - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.SqlServer -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md deleted file mode 100644 index e5a71cdc1..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md +++ /dev/null @@ -1,32 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Medallion.SqlServer - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.SqlServer -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs deleted file mode 100644 index 192f5b75b..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Medallion.Threading; -global using Medallion.Threading.SqlServer; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj deleted file mode 100644 index fe556e799..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - Masa.Contrib.Data.DistributedLocking.Medallion.WaitHandles - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs deleted file mode 100644 index 42a36ad86..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MedallionBuilderExtensions -{ - /// - /// used to coordinate between processes on the same machine - /// - /// - /// specifies how frequently the implementation will check to see if the original holder of a lock/semaphore abandoned it without properly releasing it while waiting for it to become available. Defaults to 2s - public static void UseWaitHandles(this MedallionBuilder medallionBuilder, - TimeSpan? abandonmentCheckCadence = null) - { - medallionBuilder.Services.AddSingleton(_ - => new WaitHandleDistributedSynchronizationProvider(abandonmentCheckCadence)); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md deleted file mode 100644 index 101963153..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseWaitHandles(); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - -> Does not support cross-machine, only supports coordination between processes on the same machine \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md deleted file mode 100644 index 6d156a984..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md +++ /dev/null @@ -1,33 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseWaitHandles(); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - -> 不支持跨机器,仅支持同一台机器上进程之间进行协调 \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs deleted file mode 100644 index 965419076..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Medallion.Threading; -global using Medallion.Threading.WaitHandles; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj deleted file mode 100644 index 22d396f1c..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs deleted file mode 100644 index 6841604a5..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MedallionBuilderExtensions -{ - public static void UseZooKeeper(this MedallionBuilder medallionBuilder, - string connectionString, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => new ZooKeeperDistributedSynchronizationProvider(connectionString, options)); - } - - public static void UseZooKeeper(this MedallionBuilder medallionBuilder, - ZooKeeperPath directoryPath, - string connectionString, - Action? options = null) - { - medallionBuilder.Services.AddSingleton(_ - => new ZooKeeperDistributedSynchronizationProvider(directoryPath, connectionString, options)); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md deleted file mode 100644 index 2df963d1b..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md +++ /dev/null @@ -1,31 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion.SqlServer - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.SqlServer -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseZooKeeper("Replace your ZooKeeper connectionString"); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md deleted file mode 100644 index 7167fa89d..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md +++ /dev/null @@ -1,32 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseZooKeeper("Replace your ZooKeeper connectionString"); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs deleted file mode 100644 index 980fcdb59..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Medallion.Threading; -global using Medallion.Threading.ZooKeeper; diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs deleted file mode 100644 index f8cd492fa..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Medallion; - -public class DefaultMedallionDistributedLock : IMasaDistributedLock -{ - private readonly IDistributedLockProvider _distributedLockProvider; - - public DefaultMedallionDistributedLock(IDistributedLockProvider distributedLockProvider) - => _distributedLockProvider = distributedLockProvider; - - public IDisposable? TryGet(string key, TimeSpan timeout = default) - { - ArgumentNullOrWhiteSpaceException.ThrowIfNullOrWhiteSpace(key); - var handle = _distributedLockProvider.TryAcquireLock(key, timeout); - if (handle == null) - return null; - - return new DisposeAction(handle); - } - - public async Task TryGetAsync(string key, TimeSpan timeout = default, CancellationToken cancellationToken = default) - { - ArgumentNullOrWhiteSpaceException.ThrowIfNullOrWhiteSpace(key); - var handle = await _distributedLockProvider.TryAcquireLockAsync(key, timeout, cancellationToken); - if (handle == null) - return null; - - return new DisposeAction(handle); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs deleted file mode 100644 index 88c311fa7..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Medallion.Internal; - -internal class ArgumentNullOrWhiteSpaceException -{ - public static void ThrowIfNullOrWhiteSpace(string? argument, string? paramName = null) - { - paramName ??= nameof(argument); - - if (string.IsNullOrWhiteSpace(argument)) - throw new ArgumentException($"{paramName} can not be null, empty or white space!", paramName); - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs deleted file mode 100644 index 29298fdae..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Medallion.Internal; - -internal class DisposeAction : IDisposable, IAsyncDisposable -{ - private readonly IDistributedSynchronizationHandle _handle; - - public DisposeAction(IDistributedSynchronizationHandle handle) => _handle = handle; - - public ValueTask DisposeAsync() - { - _handle.DisposeAsync(); - return ValueTask.CompletedTask; - } - - public void Dispose() => _handle.Dispose(); -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj deleted file mode 100644 index c635f5796..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs deleted file mode 100644 index 5ddc19f65..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Medallion; - -public class MedallionBuilder -{ - public IServiceCollection Services { get; } - - public MedallionBuilder(IServiceCollection services) => Services = services; -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.md deleted file mode 100644 index c39d912ca..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.md +++ /dev/null @@ -1,46 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.DistributedLock.Medallion - -Masa.Contrib.Data.DistributedLock.Medallion is a distributed lock based on [DistributedLock](https://github.com/madelson/DistributedLock) - -### Implementations - -- [Azure](../Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md) -- [FileSystem](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) -- [MySql](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) -- [Oracle](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) -- [PostgreSql](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) -- [Redis](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) -- [SqlServer](../Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md) -- [WaitHandles](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) -- [ZooKeeper](../Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md) - -### Example: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Redis// an example of Redis -``` - -1. Modify `Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseRedis("127.0.0.1:6379"); -}); -``` - -2. Use distributed locks - -``` C# -IDistributedLock distributedLock;//Get `IDistributedLock` from DI -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md deleted file mode 100644 index 1663a7a03..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md +++ /dev/null @@ -1,47 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.DistributedLock.Medallion - -Masa.Contrib.Data.DistributedLock.Medallion是基于[DistributedLock](https://github.com/madelson/DistributedLock)的一个分布式锁 - -## 实现 - -- [Azure](../Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md) -- [FileSystem](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) -- [MySql](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) -- [Oracle](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) -- [PostgreSql](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) -- [Redis](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) -- [SqlServer](../Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md) -- [WaitHandles](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) -- [ZooKeeper](../Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md) - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.DistributedLock.Medallion -Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Redis//以Redis举例 -``` - -1. 修改类`Program` - -``` C# -builder.Services.AddDistributedLock(medallionBuilder => -{ - medallionBuilder.UseRedis("127.0.0.1:6379"); -}); -``` - -2. 使用分布式锁 - -``` C# -IDistributedLock distributedLock;//从DI获取`IDistributedLock` -using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) -{ - if (lockObj != null) - { - // todo: The code that needs to be executed after acquiring the distributed lock - } -} -``` - diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs deleted file mode 100644 index f2df56ad4..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddDistributedLock(this IServiceCollection services, Action builder) - { - ArgumentNullException.ThrowIfNull(builder); - - if (services.Any()) - services.RemoveAll(); - - builder.Invoke(new MedallionBuilder(services)); - - if (!services.Any()) - throw new Exception("Please add IDistributedLockProvider first."); - - services.TryAddSingleton(); - return services; - } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs deleted file mode 100644 index 7360fe7df..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/src/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Data.DistributedLock.Medallion; -global using Masa.Contrib.Data.DistributedLock.Medallion.Internal; -global using Medallion.Threading; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using IMasaDistributedLock = Masa.BuildingBlocks.Data.IDistributedLock; diff --git a/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs b/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs deleted file mode 100644 index ce28bdb20..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.DistributedLock.Medallion.Tests; - -/// -/// Only supports local testing -/// -[TestClass] -public class DefaultMedallionDistributedLockTest -{ - // private IDistributedLock DistributedLock { get; set; } - // - // [TestInitialize] - // public void Initialize() - // { - // var services = new ServiceCollection(); - // services.AddDistributedLock(medallionBuilder => - // { - // medallionBuilder.UseRedis("127.0.0.1:6379"); - // }); - // DistributedLock = services.GetInstance(); - // } - // - // [TestMethod] - // public void TestDistributedLock() - // { - // using var obj = DistributedLock.TryGet("test", TimeSpan.FromSeconds(1)); - // Assert.IsNotNull(obj); - // } - // - // [TestMethod] - // public async Task TestDistributedLockAsync() - // { - // await using var obj = await DistributedLock.TryGetAsync("test", TimeSpan.FromSeconds(1)); - // Assert.IsNotNull(obj); - // } -} diff --git a/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj b/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj deleted file mode 100644 index 4d37a0092..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs deleted file mode 100644 index 7c77986d2..000000000 --- a/src/Contrib/Data/DistributedLock/Medallion/test/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs deleted file mode 100644 index f734442a5..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Cosmos.Internal; - -internal static class Parser -{ - public static Dictionary ToDictionary(this string connectionString) - { - if (string.IsNullOrEmpty(connectionString)) - throw new ArgumentException("Cosmos: empty database connection string", nameof(connectionString)); - - Dictionary dictionary = new(); - foreach (var item in connectionString.Split(';')) - { - if (string.IsNullOrEmpty(item)) - continue; - - if (item.Split('=').Length != 2) - throw new ArgumentException("Cosmos: Bad database connection string"); - - dictionary.Add(item.Split('=')[0], item.Split('=')[1]); - } - return dictionary; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj deleted file mode 100644 index b9232abc8..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs deleted file mode 100644 index 38730fe8b..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextBuilderExtensions -{ - public static MasaDbContextBuilder UseCosmos( - this MasaDbContextBuilder builder, - Action? cosmosOptionsAction = null) - { - builder.Builder = (serviceProvider, dbContextOptionsBuilder) => - { - var connectionStringProvider = serviceProvider.GetRequiredService(); - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - var configurationDic = connectionStringProvider.GetConnectionString(name).ToDictionary(); - - if (!configurationDic.TryGetValue("Database", out string? databaseName)) - throw new ArgumentException("Cosmos: Bad database connection string, Failed to get [Database] name"); - - if (configurationDic.TryGetValue("ConnectionString", out string? connectionString)) - { - dbContextOptionsBuilder.UseCosmos(connectionString, databaseName, cosmosOptionsAction); - return; - } - - if (!configurationDic.TryGetValue("AccountKey", out string? accountKey) || - !configurationDic.TryGetValue("AccountEndpoint", out string? accountEndpoint)) - throw new ArgumentException( - "Cosmos: Bad database connection string, Failed to get [AccountKey] name or [AccountEndpoint] name"); - - dbContextOptionsBuilder.UseCosmos(accountEndpoint, accountKey, databaseName, cosmosOptionsAction); - }; - return builder; - } - - public static MasaDbContextBuilder UseCosmos( - this MasaDbContextBuilder builder, - string accountEndpoint, - string accountKey, - string databaseName, - Action? cosmosOptionsAction = null) - => builder.UseCosmosCore(accountEndpoint, accountKey, databaseName, false, cosmosOptionsAction); - - public static MasaDbContextBuilder UseTestCosmos( - this MasaDbContextBuilder builder, - string accountEndpoint, - string accountKey, - string databaseName, - Action? cosmosOptionsAction = null) - => builder.UseCosmosCore(accountEndpoint, accountKey, databaseName, true, cosmosOptionsAction); - - private static MasaDbContextBuilder UseCosmosCore( - this MasaDbContextBuilder builder, - string accountEndpoint, - string accountKey, - string databaseName, - bool isTest, - Action? cosmosOptionsAction = null) - { - builder.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseCosmos(accountEndpoint, accountKey, databaseName, cosmosOptionsAction); - return builder.UseCosmosCore($"AccountEndpoint={accountEndpoint};AccountKey={accountKey};Database={databaseName};", isTest); - } - - public static MasaDbContextBuilder UseCosmos( - this MasaDbContextBuilder builder, - string connectionString, - string databaseName, - Action? cosmosOptionsAction = null) - => builder.UseCosmosCore(connectionString, databaseName, false, cosmosOptionsAction); - - public static MasaDbContextBuilder UseTestCosmos( - this MasaDbContextBuilder builder, - string connectionString, - string databaseName, - Action? cosmosOptionsAction = null) - => builder.UseCosmosCore(connectionString, databaseName, true, cosmosOptionsAction); - - private static MasaDbContextBuilder UseCosmosCore( - this MasaDbContextBuilder builder, - string connectionString, - string databaseName, - bool isTest, - Action? cosmosOptionsAction = null) - { - builder.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseCosmos(connectionString, databaseName, cosmosOptionsAction); - return builder.UseCosmosCore($"{connectionString};Database={databaseName};", isTest); - } - - private static MasaDbContextBuilder UseCosmosCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest = false) - { - var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) - throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); - - dbConnectionOptions.TryAddConnectionString(name, connectionString); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs deleted file mode 100644 index 5b5b97b55..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextOptionsBuilderExtensions -{ - public static MasaDbContextOptionsBuilder UseCosmos( - this MasaDbContextOptionsBuilder builder, - string accountEndpoint, - string accountKey, - string databaseName, - Action? cosmosOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseCosmos(accountEndpoint, accountKey, databaseName, cosmosOptionsAction); - return builder; - } - - public static MasaDbContextOptionsBuilder UseCosmos( - this MasaDbContextOptionsBuilder builder, - string connectionString, - string databaseName, - Action? cosmosOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseCosmos(connectionString, databaseName, cosmosOptionsAction); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md deleted file mode 100644 index de4021a5f..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md +++ /dev/null @@ -1,34 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.EntityFrameworkCore.Cosmos - -## Example: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Cosmos -``` - -##### Usage 1: - -1. Configure appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "AccountKey=AccountKey;AccountEndpoint=AccountEndpoint;Database=Database"// or "ConnectionString=ConnectionString;Database=Database" - } -} -``` - -2. Using MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos()); -``` - -##### Usage 2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos($"{accountEndpoint}",$"{accountKey}",$"{databaseName}")); -//builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos($"{connectionString}",$"{databaseName}")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md deleted file mode 100644 index fba9c83bf..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md +++ /dev/null @@ -1,34 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.EntityFrameworkCore.Cosmos - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Cosmos -``` - -#### 用法1: - -1. 配置appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "AccountKey=AccountKey;AccountEndpoint=AccountEndpoint;Database=Database"//或"ConnectionString=ConnectionString;Database=Database" - } -} -``` - -2. 使用MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos()); -``` - -#### 用法2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos($"{accountEndpoint}",$"{accountKey}",$"{databaseName}")); -//builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos($"{connectionString}",$"{databaseName}")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs deleted file mode 100644 index aab4fdb17..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.EntityFrameworkCore.Cosmos.Internal; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Infrastructure; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj deleted file mode 100644 index 3edf550bc..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs deleted file mode 100644 index 4eddf1d3b..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextBuilderExtensions -{ - public static MasaDbContextBuilder UseInMemoryDatabase( - this MasaDbContextBuilder builder, - Action? inMemoryOptionsAction = null) - { - builder.Builder = (serviceProvider, dbContextOptionsBuilder) => - { - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - var connectionStringProvider = serviceProvider.GetRequiredService(); - dbContextOptionsBuilder.UseInMemoryDatabase( - connectionStringProvider.GetConnectionString(name), - inMemoryOptionsAction); - }; - return builder; - } - - public static MasaDbContextBuilder UseInMemoryDatabase( - this MasaDbContextBuilder builder, - string databaseName, - Action? inMemoryOptionsAction = null) - => builder.UseInMemoryDatabaseCore(databaseName, false, inMemoryOptionsAction); - - public static MasaDbContextBuilder UseInMemoryTestDatabase( - this MasaDbContextBuilder builder, - string databaseName, - Action? inMemoryOptionsAction = null) - => builder.UseInMemoryDatabaseCore(databaseName, true, inMemoryOptionsAction); - - private static MasaDbContextBuilder UseInMemoryDatabaseCore( - this MasaDbContextBuilder builder, - string databaseName, - bool isTest, - Action? inMemoryOptionsAction) - { - builder.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseInMemoryDatabase(databaseName, inMemoryOptionsAction); - return builder.UseInMemoryDatabaseCore(databaseName, isTest); - } - - private static MasaDbContextBuilder UseInMemoryDatabaseCore( - this MasaDbContextBuilder builder, - string databaseName, - bool isTest = false) - { - var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) - throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); - - dbConnectionOptions.TryAddConnectionString(name, databaseName); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs deleted file mode 100644 index 7d8293971..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextOptionsBuilderExtensions -{ - public static MasaDbContextOptionsBuilder UseInMemoryDatabase( - this MasaDbContextOptionsBuilder builder, - string connectionString, - Action? inMemoryOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseInMemoryDatabase(connectionString, inMemoryOptionsAction); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md deleted file mode 100644 index b4293b730..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.EntityFrameworkCore.InMemory - -## Example: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.InMemory -``` - -##### Usage 1: - -1. Configure appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "identity" - } -} -``` - -2. Using MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseInMemoryDatabase()); -``` - -##### Usage 2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseInMemoryDatabase("identity")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md deleted file mode 100644 index e28c40a0e..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md +++ /dev/null @@ -1,33 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.EntityFrameworkCore.InMemory - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.InMemory -``` - -#### 用法1: - -1. 配置appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "identity" - } -} -``` - -2. 使用MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseInMemoryDatabase()); -``` - -#### 用法2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseInMemoryDatabase("identity")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs deleted file mode 100644 index 4ec3d59f9..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Infrastructure; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj deleted file mode 100644 index 77df81d87..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs deleted file mode 100644 index 7ae2bbe24..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextBuilderExtensions -{ - public static MasaDbContextBuilder UseMySQL( - this MasaDbContextBuilder builder, - Action? mySqlOptionsAction = null) - { - builder.Builder = (serviceProvider, dbContextOptionsBuilder) => - { - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - var connectionStringProvider = serviceProvider.GetRequiredService(); - dbContextOptionsBuilder.UseMySQL( - connectionStringProvider.GetConnectionString(name), - mySqlOptionsAction); - }; - return builder; - } - - public static MasaDbContextBuilder UseMySQL( - this MasaDbContextBuilder builder, - string connectionString, - Action? mySqlOptionsAction = null) - => builder.UseMySQLCore(connectionString, false, mySqlOptionsAction); - - public static MasaDbContextBuilder UseTestMySQL( - this MasaDbContextBuilder builder, - string connectionString, - Action? mySqlOptionsAction = null) - => builder.UseMySQLCore(connectionString, true, mySqlOptionsAction); - - private static MasaDbContextBuilder UseMySQLCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest, - Action? mySqlOptionsAction) - { - builder.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseMySQL(connectionString, mySqlOptionsAction); - return builder.UseMySQLCore(connectionString, isTest); - } - - public static MasaDbContextBuilder UseMySQL( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? mySqlOptionsAction = null) - => builder.UseMySQLCore(connection, false, mySqlOptionsAction); - - public static MasaDbContextBuilder UseTestMySQL( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? mySqlOptionsAction = null) - => builder.UseMySQLCore(connection, true, mySqlOptionsAction); - - private static MasaDbContextBuilder UseMySQLCore( - this MasaDbContextBuilder builder, - DbConnection connection, - bool isTest, - Action? mySqlOptionsAction = null) - { - builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseMySQL(connection, mySqlOptionsAction); - return builder.UseMySQLCore(connection.ConnectionString, isTest); - } - - private static MasaDbContextBuilder UseMySQLCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest = false) - { - var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) - throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); - - dbConnectionOptions.TryAddConnectionString(name, connectionString); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs deleted file mode 100644 index d83be809a..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextOptionsBuilderExtensions -{ - public static MasaDbContextOptionsBuilder UseMySQL( - this MasaDbContextOptionsBuilder builder, - string connectionString, - Action? mySqlOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseMySQL(connectionString, mySqlOptionsAction); - return builder; - } - - public static MasaDbContextOptionsBuilder UseMySQL( - this MasaDbContextOptionsBuilder builder, - DbConnection connection, - Action? mySqlOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseMySQL(connection, mySqlOptionsAction); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md deleted file mode 100644 index 967a2674f..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.EntityFrameworkCore.MySql - -## Example: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.MySql -``` - -##### Usage 1: - -1. Configure appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;" - } -} -``` - -2. Using MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySQL()); -``` - -##### Usage 2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md deleted file mode 100644 index f19a31586..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md +++ /dev/null @@ -1,33 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.EntityFrameworkCore.MySql - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.MySql -``` - -#### 用法1: - -1. 配置appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;" - } -} -``` - -2. 使用MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySQL()); -``` - -#### 用法2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs deleted file mode 100644 index 686d0e2ae..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using MySql.EntityFrameworkCore.Infrastructure; -global using System.Data.Common; diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj deleted file mode 100644 index ef7797dc1..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs deleted file mode 100644 index d9fe02baa..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextBuilderExtensions -{ - public static MasaDbContextBuilder UseOracle( - this MasaDbContextBuilder builder, - Action? oracleOptionsAction = null) - { - builder.Builder = (serviceProvider, dbContextOptionsBuilder) => - { - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - var connectionStringProvider = serviceProvider.GetRequiredService(); - dbContextOptionsBuilder.UseOracle( - connectionStringProvider.GetConnectionString(name), - oracleOptionsAction); - }; - return builder; - } - - public static MasaDbContextBuilder UseOracle( - this MasaDbContextBuilder builder, - string connectionString, - Action? oracleOptionsAction = null) - => builder.UseOracleCore(connectionString, false, oracleOptionsAction); - - public static MasaDbContextBuilder UseTestOracle( - this MasaDbContextBuilder builder, - string connectionString, - Action? oracleOptionsAction = null) - => builder.UseOracleCore(connectionString, true, oracleOptionsAction); - - private static MasaDbContextBuilder UseOracleCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest, - Action? oracleOptionsAction) - { - builder.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseOracle(connectionString, oracleOptionsAction); - return builder.UseOracleCore(connectionString, isTest); - } - - public static MasaDbContextBuilder UseOracle( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? oracleOptionsAction = null) - => builder.UseOracleCore(connection, false, oracleOptionsAction); - - public static MasaDbContextBuilder UseTestOracle( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? oracleOptionsAction = null) - => builder.UseOracleCore(connection, true, oracleOptionsAction); - - private static MasaDbContextBuilder UseOracleCore( - this MasaDbContextBuilder builder, - DbConnection connection, - bool isTest = false, - Action? oracleOptionsAction = null) - { - builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseOracle(connection, oracleOptionsAction); - return builder.UseOracleCore(connection.ConnectionString, isTest); - } - - private static MasaDbContextBuilder UseOracleCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest = false) - { - var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) - throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); - - dbConnectionOptions.TryAddConnectionString(name, connectionString); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs deleted file mode 100644 index 50591cd78..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextOptionsBuilderExtensions -{ - public static MasaDbContextOptionsBuilder UseOracle( - this MasaDbContextOptionsBuilder builder, - string connectionString, - Action? oracleOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseOracle(connectionString, oracleOptionsAction); - return builder; - } - - public static MasaDbContextOptionsBuilder UseOracle( - this MasaDbContextOptionsBuilder builder, - DbConnection connection, - Action? oracleOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseOracle(connection, oracleOptionsAction); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md deleted file mode 100644 index 97f1a32b5..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.EntityFrameworkCore.Oracle - -## Example: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Oracle -``` - -##### Usage 1: - -1. Configure appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Data Source=MyOracleDB;Integrated Security=yes;" - } -} -``` - -2. Using MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseOracle()); -``` - -##### Usage 2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseOracle("Data Source=MyOracleDB;Integrated Security=yes;")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md deleted file mode 100644 index fd3328d07..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md +++ /dev/null @@ -1,33 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.EntityFrameworkCore.Oracle - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Oracle -``` - -#### 用法1: - -1. 配置appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Data Source=MyOracleDB;Integrated Security=yes;" - } -} -``` - -2. 使用MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseOracle()); -``` - -#### 用法2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseOracle("Data Source=MyOracleDB;Integrated Security=yes;")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs deleted file mode 100644 index b9b2a72c4..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using Oracle.EntityFrameworkCore.Infrastructure; -global using System.Data.Common; diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj deleted file mode 100644 index 5abc63273..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs deleted file mode 100644 index 9edc1bf94..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextBuilderExtensions -{ - public static MasaDbContextBuilder UseMySql( - this MasaDbContextBuilder builder, - ServerVersion serverVersion, - Action? mySqlOptionsAction = null) - { - builder.Builder = (serviceProvider, dbContextOptionsBuilder) => - { - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - var connectionStringProvider = serviceProvider.GetRequiredService(); - dbContextOptionsBuilder.UseMySql( - connectionStringProvider.GetConnectionString(name), - serverVersion, - mySqlOptionsAction); - }; - return builder; - } - - public static MasaDbContextBuilder UseMySql( - this MasaDbContextBuilder builder, - string connectionString, - ServerVersion serverVersion, - Action? mySqlOptionsAction = null) - => builder.UseMySqlCore(connectionString, serverVersion, false, mySqlOptionsAction); - - public static MasaDbContextBuilder UseTestMySql( - this MasaDbContextBuilder builder, - string connectionString, - ServerVersion serverVersion, - Action? mySqlOptionsAction = null) - => builder.UseMySqlCore(connectionString, serverVersion, true, mySqlOptionsAction); - - private static MasaDbContextBuilder UseMySqlCore( - this MasaDbContextBuilder builder, - string connectionString, - ServerVersion serverVersion, - bool isTest, - Action? mySqlOptionsAction = null) - { - builder.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseMySql(connectionString, serverVersion, mySqlOptionsAction); - return builder.UseMySqlCore(connectionString, isTest); - } - - public static MasaDbContextBuilder UseMySql( - this MasaDbContextBuilder builder, - DbConnection connection, - ServerVersion serverVersion, - Action? mySqlOptionsAction = null) - => builder.UseMySqlCore(connection, serverVersion, false, mySqlOptionsAction); - - public static MasaDbContextBuilder UseTestMySql( - this MasaDbContextBuilder builder, - DbConnection connection, - ServerVersion serverVersion, - Action? mySqlOptionsAction = null) - => builder.UseMySqlCore(connection, serverVersion, true, mySqlOptionsAction); - - private static MasaDbContextBuilder UseMySqlCore( - this MasaDbContextBuilder builder, - DbConnection connection, - ServerVersion serverVersion, - bool isTest, - Action? mySqlOptionsAction = null) - { - builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseMySql(connection, serverVersion, mySqlOptionsAction); - return builder.UseMySqlCore(connection.ConnectionString, isTest); - } - - private static MasaDbContextBuilder UseMySqlCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest = false) - { - var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) - throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); - - dbConnectionOptions.TryAddConnectionString(name, connectionString); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs deleted file mode 100644 index 485b3f63e..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextOptionsBuilderExtensions -{ - public static MasaDbContextOptionsBuilder UseMySql( - this MasaDbContextOptionsBuilder builder, - string connectionString, - ServerVersion serverVersion, - Action? mySqlOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseMySql(connectionString, serverVersion, mySqlOptionsAction); - return builder; - } - - public static MasaDbContextOptionsBuilder UseMySql( - this MasaDbContextOptionsBuilder builder, - DbConnection connection, - ServerVersion serverVersion, - Action? mySqlOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseMySql(connection, serverVersion, mySqlOptionsAction); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md deleted file mode 100644 index 5d170c32a..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql - -## Example: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql -``` - -##### Usage 1: - -1. Configure appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;" - } -} -``` - -2. Using MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySql(Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.28-mysql"))); -``` - -##### Usage 2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySql("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;", Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.28-mysql"))); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md deleted file mode 100644 index 9113e1bb1..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md +++ /dev/null @@ -1,33 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql -``` - -#### 用法1: - -1. 配置appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;" - } -} -``` - -2. 使用MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySql(Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.28-mysql"))); -``` - -#### 用法2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySql("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;", Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.28-mysql"))); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs deleted file mode 100644 index 4bc00c11b..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Infrastructure; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using System.Data.Common; diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj deleted file mode 100644 index 699e24cd3..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs deleted file mode 100644 index 1ffcf34e0..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextBuilderExtensions -{ - public static MasaDbContextBuilder UseNpgsql( - this MasaDbContextBuilder builder, - Action? npgsqlOptionsAction = null) - { - builder.Builder = (serviceProvider, dbContextOptionsBuilder) => - { - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - var connectionStringProvider = serviceProvider.GetRequiredService(); - dbContextOptionsBuilder.UseNpgsql( - connectionStringProvider.GetConnectionString(name), - npgsqlOptionsAction); - }; - return builder; - } - - public static MasaDbContextBuilder UseNpgsql( - this MasaDbContextBuilder builder, - string connectionString, - Action? npgsqlOptionsAction = null) - => builder.UseNpgsqlCore(connectionString, false, npgsqlOptionsAction); - - public static MasaDbContextBuilder UseTestNpgsql( - this MasaDbContextBuilder builder, - string connectionString, - Action? npgsqlOptionsAction = null) - => builder.UseNpgsqlCore(connectionString, true, npgsqlOptionsAction); - - private static MasaDbContextBuilder UseNpgsqlCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest, - Action? npgsqlOptionsAction) - { - builder.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseNpgsql(connectionString, npgsqlOptionsAction); - return builder.UseNpgsqlCore(connectionString, isTest); - } - - public static MasaDbContextBuilder UseNpgsql( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? npgsqlOptionsAction = null) - => builder.UseNpgsqlCore(connection, false, npgsqlOptionsAction); - - public static MasaDbContextBuilder UseTestNpgsql( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? npgsqlOptionsAction = null) - => builder.UseNpgsqlCore(connection, true, npgsqlOptionsAction); - - private static MasaDbContextBuilder UseNpgsqlCore( - this MasaDbContextBuilder builder, - DbConnection connection, - bool isTest, - Action? npgsqlOptionsAction = null) - { - builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseNpgsql(connection, npgsqlOptionsAction); - return builder.UseNpgsqlCore(connection.ConnectionString, isTest); - } - - private static MasaDbContextBuilder UseNpgsqlCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest = false) - { - var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) - throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); - - dbConnectionOptions.TryAddConnectionString(name, connectionString); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs deleted file mode 100644 index 17624e597..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextOptionsBuilderExtensions -{ - public static MasaDbContextOptionsBuilder UseNpgsql( - this MasaDbContextOptionsBuilder builder, - string connectionString, - Action? npgsqlOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseNpgsql(connectionString, npgsqlOptionsAction); - return builder; - } - - public static MasaDbContextOptionsBuilder UseNpgsql( - this MasaDbContextOptionsBuilder builder, - DbConnection connection, - Action? npgsqlOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseNpgsql(connection, npgsqlOptionsAction); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md deleted file mode 100644 index 88af3796e..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.EntityFrameworkCore.PostgreSql - -## Example: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.PostgreSql -``` - -##### Usage 1: - -1. Configure appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity" - } -} -``` - -2. Using MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseNpgsql()); -``` - -##### Usage 2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseNpgsql("Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md deleted file mode 100644 index 99af59623..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md +++ /dev/null @@ -1,33 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.EntityFrameworkCore.PostgreSql - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.PostgreSql -``` - -#### 用法1: - -1. 配置appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity" - } -} -``` - -2. 使用MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseNpgsql()); -``` - -#### 用法2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseNpgsql("Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs deleted file mode 100644 index 4e2f40e11..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure; -global using System.Data.Common; diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj deleted file mode 100644 index ee9aca007..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs deleted file mode 100644 index 25939987a..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextBuilderExtensions -{ - public static MasaDbContextBuilder UseSqlServer( - this MasaDbContextBuilder builder, - Action? sqlServerOptionsAction = null) - { - builder.Builder = (serviceProvider, dbContextOptionsBuilder) => - { - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - var connectionStringProvider = serviceProvider.GetRequiredService(); - dbContextOptionsBuilder.UseSqlServer( - connectionStringProvider.GetConnectionString(name), - sqlServerOptionsAction); - }; - return builder; - } - - public static MasaDbContextBuilder UseSqlServer( - this MasaDbContextBuilder builder, - string connectionString, - Action? sqlServerOptionsAction = null) - => builder.UseSqlServerCore(connectionString, false, sqlServerOptionsAction); - - public static MasaDbContextBuilder UseTestSqlServer( - this MasaDbContextBuilder builder, - string connectionString, - Action? sqlServerOptionsAction) - => builder.UseSqlServerCore(connectionString, true, sqlServerOptionsAction); - - private static MasaDbContextBuilder UseSqlServerCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest, - Action? sqlServerOptionsAction) - { - builder.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseSqlServer(connectionString, sqlServerOptionsAction); - return builder.UseSqlServerCore(connectionString, isTest); - } - - public static MasaDbContextBuilder UseSqlServer( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? sqlServerOptionsAction = null) - => builder.UseSqlServerCore(connection, false, sqlServerOptionsAction); - - public static MasaDbContextBuilder UseTestSqlServer( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? sqlServerOptionsAction = null) - => builder.UseSqlServerCore(connection, true, sqlServerOptionsAction); - - private static MasaDbContextBuilder UseSqlServerCore( - this MasaDbContextBuilder builder, - DbConnection connection, - bool isTest, - Action? sqlServerOptionsAction = null) - { - builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseSqlServer(connection, sqlServerOptionsAction); - return builder.UseSqlServerCore(connection.ConnectionString, isTest); - } - - private static MasaDbContextBuilder UseSqlServerCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest = false) - { - var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) - throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); - - dbConnectionOptions.TryAddConnectionString(name, connectionString); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs deleted file mode 100644 index dcd110898..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextOptionsBuilderExtensions -{ - public static MasaDbContextOptionsBuilder UseSqlServer( - this MasaDbContextOptionsBuilder builder, - string connectionString, - Action? sqlServerOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseSqlServer(connectionString, sqlServerOptionsAction); - return builder; - } - - public static MasaDbContextOptionsBuilder UseSqlServer( - this MasaDbContextOptionsBuilder builder, - DbConnection connection, - Action? sqlServerOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseSqlServer(connection, sqlServerOptionsAction); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md deleted file mode 100644 index 3bb2223f2..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.EntityFrameworkCore.SqlServer - -## Example: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -##### Usage 1: - -1. Configure appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity" - } -} -``` - -2. Using MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlServer()); -``` - -##### Usage 2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md deleted file mode 100644 index baca04f2f..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md +++ /dev/null @@ -1,33 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.EntityFrameworkCore.SqlServer - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -#### 用法1: - -1. 配置appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity" - } -} -``` - -2. 使用MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlServer()); -``` - -#### 用法2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs deleted file mode 100644 index 4bc00c11b..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Infrastructure; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using System.Data.Common; diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj deleted file mode 100644 index 6ddda3d22..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs deleted file mode 100644 index 6d3ada22d..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextBuilderExtensions -{ - public static MasaDbContextBuilder UseSqlite( - this MasaDbContextBuilder builder, - Action? sqliteOptionsAction = null) - { - builder.Builder = (serviceProvider, dbContextOptionsBuilder) => - { - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - var connectionStringProvider = serviceProvider.GetRequiredService(); - dbContextOptionsBuilder.UseSqlite( - connectionStringProvider.GetConnectionString(name), - sqliteOptionsAction); - }; - return builder; - } - - public static MasaDbContextBuilder UseSqlite( - this MasaDbContextBuilder builder, - string connectionString, - Action? sqliteOptionsAction = null) - => builder.UseSqliteCore(connectionString, false, sqliteOptionsAction); - - public static MasaDbContextBuilder UseTestSqlite( - this MasaDbContextBuilder builder, - string connectionString, - Action? sqliteOptionsAction = null) - => builder.UseSqliteCore(connectionString, true, sqliteOptionsAction); - - private static MasaDbContextBuilder UseSqliteCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest, - Action? sqliteOptionsAction) - { - builder.Builder = (_, dbContextOptionsBuilder) - => dbContextOptionsBuilder.UseSqlite(connectionString, sqliteOptionsAction); - return builder.UseSqliteCore(connectionString, isTest); - } - - public static MasaDbContextBuilder UseSqlite( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? sqliteOptionsAction = null) - => builder.UseSqliteCore(connection, false, sqliteOptionsAction); - - public static MasaDbContextBuilder UseTestSqlite( - this MasaDbContextBuilder builder, - DbConnection connection, - Action? sqliteOptionsAction = null) - => builder.UseSqliteCore(connection, true, sqliteOptionsAction); - - private static MasaDbContextBuilder UseSqliteCore( - this MasaDbContextBuilder builder, - DbConnection connection, - bool isTest, - Action? sqliteOptionsAction = null) - { - builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseSqlite(connection, sqliteOptionsAction); - return builder.UseSqliteCore(connection.ConnectionString, isTest); - } - - private static MasaDbContextBuilder UseSqliteCore( - this MasaDbContextBuilder builder, - string connectionString, - bool isTest = false) - { - var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; - var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); - if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) - throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); - - dbConnectionOptions.TryAddConnectionString(name, connectionString); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs deleted file mode 100644 index c8bc12f72..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class MasaDbContextOptionsBuilderExtensions -{ - public static MasaDbContextOptionsBuilder UseSqlite( - this MasaDbContextOptionsBuilder builder, - string connectionString, - Action? sqliteOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseSqlite(connectionString, sqliteOptionsAction); - return builder; - } - - public static MasaDbContextOptionsBuilder UseSqlite( - this MasaDbContextOptionsBuilder builder, - DbConnection connection, - Action? sqliteOptionsAction = null) - { - builder.DbContextOptionsBuilder.UseSqlite(connection, sqliteOptionsAction); - return builder; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md deleted file mode 100644 index f67058740..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md +++ /dev/null @@ -1,33 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.EntityFrameworkCore.Sqlite - -## Example: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Sqlite -``` - -##### Usage 1: - -1. Configure appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Data Source=c:\mydb.db;Version=3;Password=P@ssw0rd;" - } -} -``` - -2. Using MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlite()); -``` - -##### Usage 2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlite("Data Source=c:\mydb.db;Version=3;Password=P@ssw0rd;")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md deleted file mode 100644 index bcef8183c..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md +++ /dev/null @@ -1,33 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.EntityFrameworkCore.Sqlite - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Sqlite -``` - -#### 用法1: - -1. 配置appsettings.json - -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "Data Source=c:\mydb.db;Version=3;Password=P@ssw0rd;" - } -} -``` - -2. 使用MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlite()); -``` - -#### 用法2: - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlite("Data Source=c:\mydb.db;Version=3;Password=P@ssw0rd;")); -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs deleted file mode 100644 index 4bc00c11b..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Infrastructure; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using System.Data.Common; diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs deleted file mode 100644 index 243a36930..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public class DbConnectionStringProvider : BaseDbConnectionStringProvider -{ - private readonly IOptionsMonitor _options; - - public DbConnectionStringProvider(IOptionsMonitor options) => _options = options; - - protected override List GetDbContextOptionsList() - => _options.CurrentValue.ConnectionStrings.Select(item => new MasaDbContextConfigurationOptions(item.Value)).Distinct().ToList(); -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs deleted file mode 100644 index d351e6dce..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public class DefaultConnectionStringProvider : IConnectionStringProvider -{ - private readonly IOptionsMonitor _options; - - public DefaultConnectionStringProvider(IOptionsMonitor options) => _options = options; - - public Task GetConnectionStringAsync(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) => Task.FromResult(GetConnectionString(name)); - - public string GetConnectionString(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) - { - if (string.IsNullOrEmpty(name)) - return _options.CurrentValue.ConnectionStrings.DefaultConnection; - - return _options.CurrentValue.ConnectionStrings.GetConnectionString(name); - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs deleted file mode 100644 index 505fc7ff0..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public static class EntityTypeBuilderExtensions -{ - private const int _maxLength = 36; - - public static void TryConfigureConcurrencyStamp( - this EntityTypeBuilder entityTypeBuilder, - string? propertyName) - => entityTypeBuilder.TryConfigureConcurrencyStamp(_maxLength, propertyName); - - public static void TryConfigureConcurrencyStamp( - this EntityTypeBuilder entityTypeBuilder, - int maxLength = _maxLength, - string? propertyName = null) - { - if (entityTypeBuilder.Metadata.ClrType.IsAssignableTo(typeof(IHasConcurrencyStamp))) - { - entityTypeBuilder.Property(nameof(IHasConcurrencyStamp.RowVersion)) - .IsConcurrencyToken() - .HasMaxLength(maxLength) - .HasColumnName(propertyName ?? nameof(IHasConcurrencyStamp.RowVersion)); - } - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs deleted file mode 100644 index ac9e73fc4..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Filters; - -public interface ISaveChangesFilter -{ - void OnExecuting(ChangeTracker changeTracker); -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs deleted file mode 100644 index f9daadfe5..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Filters; - -public class SaveChangeFilter : ISaveChangesFilter - where TDbContext : DbContext -{ - private readonly Type _userIdType; - private readonly IUserContext? _userContext; - - public SaveChangeFilter(IUserContext? userContext = null) - { - _userIdType = typeof(TUserId); - _userContext = userContext; - } - - public void OnExecuting(ChangeTracker changeTracker) - { - changeTracker.DetectChanges(); - - foreach (var entity in changeTracker.Entries() - .Where(entry => entry.Entity is IAuditEntity && - (entry.State == EntityState.Added || entry.State == EntityState.Modified))) - { - var userId = GetUserId(_userContext?.UserId); - if (entity.State == EntityState.Added) - { - if (userId != null) - { - entity.CurrentValues[nameof(IAuditEntity.Creator)] = userId; - entity.CurrentValues[nameof(IAuditEntity.Modifier)] = userId; - } - entity.CurrentValues[nameof(IAuditEntity.CreationTime)] = - DateTime.UtcNow; //The current time to change to localization after waiting for localization - } - else if (entity.CurrentValues[nameof(IAuditEntity.Modifier)] != default && userId != null) - { - entity.CurrentValues[nameof(IAuditEntity.Modifier)] = userId; - } - entity.CurrentValues[nameof(IAuditEntity.ModificationTime)] = - DateTime.UtcNow; //The current time to change to localization after waiting for localization - } - } - - private object? GetUserId(string? userId) - { - if (userId == null) - return null; - - if (_userIdType == typeof(Guid)) - return Guid.Parse(userId); - - return Convert.ChangeType(userId, _userIdType); - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs deleted file mode 100644 index 0fa3ebcb5..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public interface IModelCreatingProvider -{ - /// - /// For building DbContext models and their mappings - /// - /// - void Configure(ModelBuilder modelBuilder); -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj deleted file mode 100644 index f89361a32..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs deleted file mode 100644 index 5d3a0d14e..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public abstract class MasaDbContext : DbContext, IMasaDbContext -{ - private bool _isInitialize = false; - private IDataFilter? _dataFilter; - - protected IDataFilter? DataFilter - { - get - { - TryInitialize(); - return _dataFilter; - } - } - - protected readonly MasaDbContextOptions Options; - - private IDomainEventBus? _domainEventBus; - - protected IDomainEventBus? DomainEventBus - { - get - { - TryInitialize(); - return _domainEventBus; - } - } - - private IConcurrencyStampProvider? _concurrencyStampProvider; - - public IConcurrencyStampProvider? ConcurrencyStampProvider - { - get - { - TryInitialize(); - return _concurrencyStampProvider; - } - } - - public MasaDbContext(MasaDbContextOptions options) : base(options) - { - Options = options; - } - - protected virtual void TryInitialize() - { - if (!_isInitialize) Initialize(); - } - - protected virtual void Initialize() - { - _dataFilter = Options.ServiceProvider?.GetService(); - _domainEventBus = Options.ServiceProvider?.GetService(); - _concurrencyStampProvider = Options.ServiceProvider?.GetRequiredService(); - } - - /// - /// Automatic filter soft delete data. - /// When you override this method,you should call base.. - /// - /// - /// - protected sealed override void OnModelCreating(ModelBuilder modelBuilder) - { - OnModelCreatingExecuting(modelBuilder); - - OnModelCreatingConfigureGlobalFilters(modelBuilder); - - // null when run dotnet ef cli - if (Options == null) - { - base.OnModelCreating(modelBuilder); - return; - } - - foreach (var provider in Options.ModelCreatingProviders) - provider.Configure(modelBuilder); - } - - /// - /// Use this method instead of OnModelCreating - /// - /// - protected virtual void OnModelCreatingExecuting(ModelBuilder modelBuilder) - { - - } - - protected virtual void OnModelCreatingConfigureGlobalFilters(ModelBuilder modelBuilder) - { - var methodInfo = typeof(MasaDbContext).GetMethod(nameof(ConfigureGlobalFilters), BindingFlags.NonPublic | BindingFlags.Instance); - - foreach (var entityType in modelBuilder.Model.GetEntityTypes()) - { - methodInfo!.MakeGenericMethod(entityType.ClrType).Invoke(this, new object?[] { modelBuilder, entityType }); - } - } - - protected virtual void ConfigureGlobalFilters(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) - where TEntity : class - { - if (mutableEntityType.BaseType == null) - { - var filterExpression = CreateFilterExpression(); - if (filterExpression != null) - modelBuilder.Entity().HasQueryFilter(filterExpression); - } - } - - protected virtual Expression>? CreateFilterExpression() - where TEntity : class - { - Expression>? expression = null; - - if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity))) - { - expression = entity => !IsSoftDeleteFilterEnabled || !EF.Property(entity, nameof(ISoftDelete.IsDeleted)); - } - - return expression; - } - - protected virtual bool IsSoftDeleteFilterEnabled - => (Options?.EnableSoftDelete ?? false) && (DataFilter?.IsEnabled() ?? false); - - /// - /// Automatic soft delete. - /// - /// - /// - public override int SaveChanges() => SaveChanges(true); - - public sealed override int SaveChanges(bool acceptAllChangesOnSuccess) - { - OnBeforeSaveChanges(); - return base.SaveChanges(acceptAllChangesOnSuccess); - } - - protected virtual void OnBeforeSaveChanges() - { - if (Options != null) - { - UpdateRowVesion(ChangeTracker); - OnBeforeSaveChangesByFilters(); - DomainEventEnqueueAsync(ChangeTracker).ConfigureAwait(false).GetAwaiter().GetResult(); - } - } - - protected virtual async Task OnBeforeSaveChangesAsync() - { - if (Options != null) - { - UpdateRowVesion(ChangeTracker); - OnBeforeSaveChangesByFilters(); - await DomainEventEnqueueAsync(ChangeTracker); - } - } - - protected virtual void OnBeforeSaveChangesByFilters() - { - foreach (var filter in Options.SaveChangesFilters) - { - try - { - filter.OnExecuting(ChangeTracker); - } - catch (Exception ex) - { - throw new Exception("An error occured when intercept SaveChanges() or SaveChangesAsync()", ex); - } - } - } - - protected virtual async Task DomainEventEnqueueAsync(ChangeTracker changeTracker) - { - if (DomainEventBus == null) - return; - - var domainEntities = changeTracker - .Entries() - .Where(entry => entry.Entity.GetDomainEvents().Any()); - - var domainEvents = domainEntities - .SelectMany(entry => entry.Entity.GetDomainEvents()) - .ToList(); - - domainEntities.ToList() - .ForEach(entity => entity.Entity.ClearDomainEvents()); - - foreach (var domainEvent in domainEvents) - await DomainEventBus.Enqueue(domainEvent); - } - - protected virtual void UpdateRowVesion(ChangeTracker changeTracker) - { - if (ConcurrencyStampProvider == null) - return; - - var entries = changeTracker.Entries().Where(entry - => (entry.State == EntityState.Added || entry.State == EntityState.Modified || entry.State == EntityState.Deleted) && - entry.Entity is IHasConcurrencyStamp); - foreach (var entity in entries) - { - entity.CurrentValues[nameof(IHasConcurrencyStamp.RowVersion)] = ConcurrencyStampProvider.GetRowVersion(); - } - } - - /// - /// Automatic soft delete. - /// - /// - /// - /// - public override Task SaveChangesAsync(CancellationToken cancellationToken = default) => SaveChangesAsync(true, cancellationToken); - - /// - /// Automatic soft delete. - /// - /// - /// - /// - /// - public sealed override async Task SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default) - { - await OnBeforeSaveChangesAsync(); - return await base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken); - } -} - -public abstract class MasaDbContext : MasaDbContext - where TDbContext : DbContext, IMasaDbContext -{ - public MasaDbContext(MasaDbContextOptions options) : base(options) - { - } - - protected override void OnModelCreatingConfigureGlobalFilters(ModelBuilder modelBuilder) - { - var methodInfo = - typeof(MasaDbContext).GetMethod(nameof(ConfigureGlobalFilters), BindingFlags.NonPublic | BindingFlags.Instance); - - foreach (var entityType in modelBuilder.Model.GetEntityTypes()) - { - methodInfo!.MakeGenericMethod(entityType.ClrType).Invoke(this, new object?[] { modelBuilder, entityType }); - } - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs deleted file mode 100644 index 2877a57f0..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public class MasaDbContextBuilder -{ - private IServiceProvider? _serviceProvider; - - public IServiceProvider ServiceProvider => _serviceProvider ??= Services.BuildServiceProvider(); - - public IServiceCollection Services { get; } - - public Type DbContextType { get; } - - public Type UserIdType { get; } - - public Action Builder { get; set; } = default!; - - public bool EnableSoftDelete { get; set; } - - public MasaDbContextBuilder(IServiceCollection services, Type dbContextType, Type userIdType) - { - Services = services; - DbContextType = dbContextType; - UserIdType = userIdType; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs deleted file mode 100644 index 68af024e7..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public abstract class MasaDbContextOptions : DbContextOptions -{ - public readonly IServiceProvider? ServiceProvider; - - public abstract IEnumerable ModelCreatingProviders { get; } - - /// - /// Can be used to intercept SaveChanges(Async) method - /// - public abstract IEnumerable SaveChangesFilters { get; } - - public bool EnableSoftDelete { get; } - - internal MasaDbContextOptions(IServiceProvider? serviceProvider, bool enableSoftDelete) - { - ServiceProvider = serviceProvider; - EnableSoftDelete = enableSoftDelete; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs deleted file mode 100644 index eef2f8263..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public abstract class MasaDbContextOptionsBuilder -{ - internal IServiceProvider? ServiceProvider { get; } - - public bool EnableSoftDelete { get; } - - public virtual DbContextOptionsBuilder DbContextOptionsBuilder { get; } - - protected MasaDbContextOptionsBuilder(IServiceProvider? serviceProvider, MasaDbContextOptions options) - { - ServiceProvider = serviceProvider; - EnableSoftDelete = options.EnableSoftDelete; - DbContextOptionsBuilder = new DbContextOptionsBuilder(options); - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs deleted file mode 100644 index dbfe6a65a..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public class MasaDbContextOptionsBuilder : MasaDbContextOptionsBuilder - where TDbContext : MasaDbContext, IMasaDbContext -{ - public MasaDbContextOptions MasaOptions - => new(ServiceProvider, (DbContextOptions)DbContextOptionsBuilder.Options, EnableSoftDelete); - - public MasaDbContextOptionsBuilder(bool enableSoftDelete = false) : this(null, enableSoftDelete) - { - } - - public MasaDbContextOptionsBuilder( - IServiceProvider? serviceProvider, - bool enableSoftDelete) - : base(serviceProvider, new MasaDbContextOptions(serviceProvider, new DbContextOptions(), enableSoftDelete)) - { - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs deleted file mode 100644 index a00b7ad08..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore; - -public class MasaDbContextOptions : MasaDbContextOptions - where TContext : DbContext -{ - private readonly DbContextOptions _originOptions; - - public MasaDbContextOptions( - IServiceProvider? serviceProvider, - DbContextOptions originOptions, - bool enableSoftDelete) : base(serviceProvider, enableSoftDelete) => _originOptions = originOptions; - - private IEnumerable? _modelCreatingProviders; - - /// - /// Can be used to filter data - /// - public override IEnumerable ModelCreatingProviders - => _modelCreatingProviders ??= ServiceProvider?.GetServices() ?? new List(); - - private IEnumerable? _saveChangesFilters; - - /// - /// Can be used to intercept SaveChanges(Async) method - /// - public override IEnumerable SaveChangesFilters - => _saveChangesFilters ??= ServiceProvider?.GetServices() ?? new List(); - - /// - /// - /// - public override Type ContextType => _originOptions.ContextType; - - /// - /// - /// - public override bool IsFrozen => _originOptions.IsFrozen; - - /// - /// - /// - public override IEnumerable Extensions => _originOptions.Extensions; - - /// - /// - /// - /// - /// - /// - public override DbContextOptions WithExtension(TExtension extension) - => _originOptions.WithExtension(extension); - - public override TExtension? FindExtension() where TExtension : class - => _originOptions.FindExtension(); - - /// - /// - /// - public override void Freeze() => _originOptions.Freeze(); - - /// - /// - /// - /// - /// - public override TExtension GetExtension() - => _originOptions.GetExtension(); -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.md deleted file mode 100644 index 6d3f9645d..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.md +++ /dev/null @@ -1,47 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.EntityFrameworkCore - -## Example: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore -Install-Package Microsoft.EntityFrameworkCore.SqlServer -``` - -#### Basic usage: - -Using MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => -{ - optionsBuilder.UseFilter();//enable filtering - optionsBuilder.DbContextOptionsBuilder.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"); -}); -``` - -Recommended usage: - -- [SqlServer](../Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md) -- [MySql](../Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md) -- [Pomelo.MySql](../Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md) -- [Sqlite](../Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md) -- [Cosmos](../Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md) -- [InMemory](../Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md) -- [Oracle](../Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md) -- [PostgreSql](../Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md) - -#### data filter - -``` C# -public async Task GetAllAsync([FromServices] IRepository repository, [FromServices] IDataFilter dataFilter) -{ - // Temporarily disable soft delete filtering - using (dataFilter.Disable()) - { - var list = (await repository.GetListAsync()).ToList(); - return System.Text.Json.JsonSerializer.Serialize(list); - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md deleted file mode 100644 index 1f2182399..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md +++ /dev/null @@ -1,48 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.EntityFrameworkCore - -## 用例: - -```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore -Install-Package Masa.Contrib.Data.Contracts.EF -Install-Package Microsoft.EntityFrameworkCore.SqlServer//这里以SqlServer举例 -``` - -#### 基本用法: - -使用MasaDbContext - -``` C# -builder.Services.AddMasaDbContext(optionsBuilder => -{ - optionsBuilder.UseFilter();//启用过滤 - optionsBuilder.DbContextOptionsBuilder.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"); -}); -``` - -推荐用法: - -- [SqlServer](../Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md) -- [MySql](../Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md) -- [Pomelo.MySql](../Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md) -- [Sqlite](../Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md) -- [Cosmos](../Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md) -- [InMemory](../Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md) -- [Oracle](../Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md) -- [PostgreSql](../Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md) - -#### 数据过滤器 - -``` C# -public async Task GetAllAsync([FromServices] IRepository repository, [FromServices] IDataFilter dataFilter) -{ - // 临时禁用软删除过滤 - using (dataFilter.Disable()) - { - var list = (await repository.GetListAsync()).ToList(); - return System.Text.Json.JsonSerializer.Serialize(list); - } -} -``` \ No newline at end of file diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs deleted file mode 100644 index 56c031de6..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddMasaDbContext( - this IServiceCollection services, - Action? optionsBuilder = null, - ServiceLifetime contextLifetime = ServiceLifetime.Scoped, - ServiceLifetime optionsLifetime = ServiceLifetime.Scoped) - where TDbContextImplementation : MasaDbContext, IMasaDbContext - => services.AddMasaDbContext(optionsBuilder, contextLifetime, optionsLifetime); - - public static IServiceCollection AddMasaDbContext( - this IServiceCollection services, - Action? optionsBuilder = null, - ServiceLifetime contextLifetime = ServiceLifetime.Scoped, - ServiceLifetime optionsLifetime = ServiceLifetime.Scoped) - where TDbContextImplementation : MasaDbContext, IMasaDbContext - where TUserId : IComparable - => services - .AddDbContext(contextLifetime, optionsLifetime) - .AddCoreServices(optionsBuilder, optionsLifetime); - - private static IServiceCollection AddCoreServices( - this IServiceCollection services, - Action? optionsBuilder, - ServiceLifetime optionsLifetime) - where TDbContextImplementation : MasaDbContext, IMasaDbContext - where TUserId : IComparable - { - services.TryAddConfigure(); - - MasaDbContextBuilder masaBuilder = new(services, typeof(TDbContextImplementation), typeof(TUserId)); - optionsBuilder?.Invoke(masaBuilder); - return services.AddCoreServices((serviceProvider, efDbContextOptionsBuilder) => - { - masaBuilder.Builder.Invoke(serviceProvider, efDbContextOptionsBuilder.DbContextOptionsBuilder); - }, masaBuilder.EnableSoftDelete, optionsLifetime); - } - - private static IServiceCollection AddCoreServices( - this IServiceCollection services, - Action? optionsBuilder, - bool enableSoftDelete, - ServiceLifetime optionsLifetime) - where TDbContextImplementation : MasaDbContext, IMasaDbContext - where TUserId : IComparable - { - services.TryAddSingleton(); - services.TryAddScoped(); - services.TryAddSingleton(); - - services.TryAdd( - new ServiceDescriptor( - typeof(MasaDbContextOptions), - serviceProvider => CreateMasaDbContextOptions(serviceProvider, optionsBuilder, enableSoftDelete), - optionsLifetime)); - - services.TryAdd( - new ServiceDescriptor( - typeof(MasaDbContextOptions), - serviceProvider => serviceProvider.GetRequiredService>(), - optionsLifetime)); - - services.TryAddEnumerable(new ServiceDescriptor(typeof(ISaveChangesFilter), - typeof(SaveChangeFilter), ServiceLifetime.Scoped)); - return services; - } - - private static MasaDbContextOptions CreateMasaDbContextOptions( - IServiceProvider serviceProvider, - Action? optionsBuilder, - bool enableSoftDelete) - where TDbContextImplementation : MasaDbContext, IMasaDbContext - { - var masaDbContextOptionsBuilder = new MasaDbContextOptionsBuilder(serviceProvider, enableSoftDelete); - optionsBuilder?.Invoke(serviceProvider, masaDbContextOptionsBuilder); - - return masaDbContextOptionsBuilder.MasaOptions; - } - - private static IServiceCollection TryAddConfigure( - this IServiceCollection services) - where TOptions : class - => services.TryAddConfigure(ConnectionStrings.DEFAULT_SECTION); - - /// - /// Only consider using MasaConfiguration and database configuration using local configuration - /// When using MasaConfiguration and the database configuration is stored in ConfigurationApi, you need to specify the mapping relationship in Configuration by yourself - /// - /// - /// - /// - /// - private static IServiceCollection TryAddConfigure( - this IServiceCollection services, - string sectionName) - where TOptions : class - { - services.AddOptions(); - var serviceProvider = services.BuildServiceProvider(); - IConfiguration? configuration = serviceProvider.GetService()?.Local ?? - serviceProvider.GetService(); - if (configuration == null) - return services; - - string name = Microsoft.Extensions.Options.Options.DefaultName; - var configurationSection = configuration.GetSection(sectionName); - if (!configurationSection.Exists()) - return services; - - services.TryAddSingleton>( - new ConfigurationChangeTokenSource(name, configuration)); - services.TryAddSingleton>(new NamedConfigureFromConfigurationOptions(name, - configuration, _ => - { - })); - return services; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs deleted file mode 100644 index be8768eeb..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/src/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Configuration; -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; -global using Masa.BuildingBlocks.Data.Options; -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; -global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore.Filters; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.ChangeTracking; -global using Microsoft.EntityFrameworkCore.Infrastructure; -global using Microsoft.EntityFrameworkCore.Metadata; -global using Microsoft.EntityFrameworkCore.Metadata.Builders; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Options; -global using System.Linq.Expressions; -global using System.Reflection; diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs deleted file mode 100644 index 9538e0227..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; - -public class CustomDbContext : MasaDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } - - protected override void OnModelCreatingExecuting(ModelBuilder modelBuilder) - { - modelBuilder.Entity(); - modelBuilder.Entity().OwnsOne(x => x.Address); - modelBuilder.Entity().OwnsMany(t => t.Hobbies); - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs deleted file mode 100644 index e72d3336d..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; - -[TestClass] -public class DbContextTest : TestBase -{ - [TestMethod] - public async Task TestAddAsync() - { - await using var dbContext = CreateDbContext(true, out _); - await dbContext.Set().AddAsync(new Student() - { - Id = 1, - Name = "Jim", - Age = 18, - Address = new Address() - { - City = "ShangHai", - Street = "PuDong", - }, - Hobbies = new List() - { - new() - { - Name = "Sing", - Description = "loves singing" - }, - new() - { - Name = "Game", - Description = "mobile game" - } - } - }); - await dbContext.SaveChangesAsync(); - Assert.IsTrue(await dbContext.Set().CountAsync() == 1); - } - - [TestMethod] - public async Task TestSoftDeleteAsync() - { - Services.Configure(options => - { - options.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = $"data source=soft-delete-db-{Guid.NewGuid()}" - }; - }); - await using var dbContext = CreateDbContext(true, out IServiceProvider serviceProvider, false); - var student = new Student() - { - Id = 1, - Name = "Jim", - Age = 18, - Address = new Address() - { - City = "ShangHai", - Street = "PuDong", - }, - Hobbies = new List() - { - new() - { - Name = "Sing", - Description = "loves singing" - }, - new() - { - Name = "Game", - Description = "mobile game" - } - } - }; - await dbContext.Set().AddAsync(student); - await dbContext.SaveChangesAsync(); - Assert.IsTrue(await dbContext.Set().CountAsync() == 1); - - student = await dbContext.Set().Include(s => s.Address).Include(s => s.Hobbies).FirstAsync(); - dbContext.Set().Remove(student); - await dbContext.SaveChangesAsync(); - - Assert.IsTrue(await dbContext.Set().CountAsync() == 0); - - var dataFilter = serviceProvider.GetRequiredService(); - using (dataFilter.Disable()) - { - Assert.IsTrue(await dbContext.Set().CountAsync() == 1); - - student = (await dbContext.Set().Include(s => s.Address).FirstOrDefaultAsync())!; - Assert.IsTrue(student.Id == 1); - Assert.IsTrue(student.Name == "Jim"); - Assert.IsTrue(student.Age == 18); - Assert.IsTrue(student.IsDeleted); - Assert.IsTrue(student.Address.City == "ShangHai"); - Assert.IsTrue(student.Address.Street == "PuDong"); - - Assert.IsTrue(student.Hobbies.Count == 2); - Assert.IsTrue(student.Hobbies.Any(h => h.Name == "Sing")); - Assert.IsTrue(student.Hobbies.Any(h => h.Name == "Game")); - } - } - - [TestMethod] - public async Task TestDisabledSoftDelete() - { - Services.AddMasaDbContext(options - => options.UseTestFilter().UseTestSqlite($"data source=disabled-soft-delete-db-{Guid.NewGuid()}")); - var serviceProvider = Services.BuildServiceProvider(); - var dbContext = serviceProvider.GetRequiredService(); - await dbContext.Database.EnsureCreatedAsync(); - var student = new Student - { - Id = 1, - Name = "Jim", - Age = 18, - Address = new Address() - { - City = "ShangHai", - Street = "PuDong", - } - }; - await dbContext.Set().AddAsync(student); - await dbContext.SaveChangesAsync(); - Assert.IsTrue(await dbContext.Set().CountAsync() == 1); - - dbContext.Set().Remove(student); - await dbContext.SaveChangesAsync(); - - Assert.IsTrue(await dbContext.Set().CountAsync() == 0); - - var dataFilter = serviceProvider.GetRequiredService(); - using (dataFilter.Disable()) - { - var count = await dbContext.Set().IgnoreQueryFilters().CountAsync(); - Assert.IsTrue(count == 1); - } - } - - [TestMethod] - public void TestAddMultiMasaDbContextReturnSaveChangeFilterEqual1() - { - var services = new ServiceCollection(); - services.AddMasaDbContext() - .AddMasaDbContext(); - - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestAddMasaDbContextReturnSaveChangeFilterEqual2() - { - var services = new ServiceCollection(); - services.AddMasaDbContext(opt => - { - opt.UseTestSqlite(Guid.NewGuid().ToString()).UseFilter(); - }); - - var serviceProvider = services.BuildServiceProvider(); - - var filters = serviceProvider.GetServices(); - Assert.IsTrue(filters.Count() == 2); - } - - [TestMethod] - public async Task TestGetPaginatedListAsyncReturnCountEqualResultCount() - { - Services.Configure(options => - { - options.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = $"data source=soft-delete-db-{Guid.NewGuid()}" - }; - }); - await using var dbContext = CreateDbContext(true, out IServiceProvider serviceProvider); - var students = new List() - { - new() - { - Id = 1, - Name = "Jim", - Age = 18, - Address = new Address() - { - City = "ShangHai", - Street = "PuDong", - } - }, - new() - { - Id = 2, - Name = "Tom", - Age = 20, - Address = new Address() - { - City = "ShangHai", - Street = "PuDong", - } - } - }; - await dbContext.Set().AddRangeAsync(students); - await dbContext.SaveChangesAsync(); - Assert.IsTrue(await dbContext.Set().CountAsync() == 2); - - var student = await dbContext.Set().FirstAsync(); - dbContext.Set().Remove(student); - await dbContext.SaveChangesAsync(); - - var result = await new Repository(dbContext).GetPaginatedListAsync(new PaginatedOptions() - { - Page = 1, - PageSize = 10 - }); - - Assert.IsTrue(result.Result.Count == result.Total); - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs deleted file mode 100644 index b14e73e0e..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; - -[TestClass] -public class DefaultConnectionStringProviderTest -{ - [TestMethod] - public async Task TestGetConnectionStringAsyncReturnTest1() - { - IServiceCollection services = new ServiceCollection(); - services.Configure(options => - { - options.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = "Test1" - }; - }); - var serviceProvider = services.BuildServiceProvider(); - var options = serviceProvider.GetRequiredService>(); - var defaultConnectionStringProvider = new DefaultConnectionStringProvider(options); - var connectionString = await defaultConnectionStringProvider.GetConnectionStringAsync(); - Assert.AreEqual("Test1", connectionString); - } - - [TestMethod] - public async Task TestGetConnectionStringAsyncAndNameIsEmptyReturnTest1() - { - IServiceCollection services = new ServiceCollection(); - services.Configure(options => - { - options.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = "Test1" - }; - }); - var serviceProvider = services.BuildServiceProvider(); - var options = serviceProvider.GetRequiredService>(); - var defaultConnectionStringProvider = new DefaultConnectionStringProvider(options); - var connectionString = await defaultConnectionStringProvider.GetConnectionStringAsync(string.Empty); - Assert.AreEqual("Test1", connectionString); - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs deleted file mode 100644 index 14a21d266..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; - -internal class PaginatedOptions -{ - public int Page { get; set; } - - public int PageSize { get; set; } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs deleted file mode 100644 index 8977dee53..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; - -internal class Repository -{ - private readonly CustomDbContext _testDbContext; - - public Repository(CustomDbContext testDbContext) => _testDbContext = testDbContext; - - public Task> GetPaginatedListAsync(int skip, int take, CancellationToken cancellationToken = default) - => _testDbContext.Set().Skip(skip).Take(take).ToListAsync(cancellationToken); - - public virtual async Task> GetPaginatedListAsync(PaginatedOptions options, CancellationToken cancellationToken = default) - { - var result = await GetPaginatedListAsync( - (options.Page - 1) * options.PageSize, - options.PageSize <= 0 ? int.MaxValue : options.PageSize, - cancellationToken - ); - - var total = await GetCountAsync(cancellationToken); - - return new BasePaginatedList() - { - Total = total, - Result = result, - TotalPages = (int)Math.Ceiling(total / (decimal)options.PageSize) - }; - } - - public async Task GetCountAsync(CancellationToken cancellationToken = default) - => await _testDbContext.Set().LongCountAsync(cancellationToken); -} diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj deleted file mode 100644 index b876c07fa..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs deleted file mode 100644 index 2909884f3..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; - -public class Address -{ - public string City { get; set; } = default!; - - public string Street { get; set; } = default!; -} diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs deleted file mode 100644 index 366e9a9b9..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; - -public class Hobby -{ - public Guid Id { get; set; } - - public string Name { get; set; } = default!; - - public string Description { get; set; } = default!; - - public Hobby() - { - Id = Guid.NewGuid(); - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs deleted file mode 100644 index 9850f1531..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; - -public class Student : ISoftDelete -{ - public int Id { get; set; } - - public string Name { get; set; } = default!; - - public int Age { get; set; } - - public bool IsDeleted { get; private set; } = default!; - - public Address Address { get; set; } = default!; - - public List Hobbies { get; set; } = default!; -} diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs deleted file mode 100644 index 1f6585563..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; - -public class TestBase -{ - protected IServiceCollection Services; - - [TestInitialize] - public void Initialize() - { - Services = new ServiceCollection(); - } - - protected CustomDbContext CreateDbContext(bool enableSoftDelete, out IServiceProvider serviceProvider, - bool initConnectionString = true) - { - Services.AddMasaDbContext(options => - { - if (enableSoftDelete) - options.UseTestFilter(); - - if (initConnectionString) - options.UseTestSqlite($"data source=test-{Guid.NewGuid()}"); - else - options.UseSqlite(); - }); - serviceProvider = Services.BuildServiceProvider(); - var dbContext = serviceProvider.GetRequiredService(); - dbContext.Database.EnsureCreated(); - return dbContext; - } -} diff --git a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs deleted file mode 100644 index ad5bdcf50..000000000 --- a/src/Contrib/Data/EntityFrameworkCore/test/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; -global using Masa.BuildingBlocks.Data.Contracts.Paginated; -global using Masa.Contrib.Data.Contracts.EF; -global using Masa.Contrib.Data.EntityFrameworkCore.Filters; -global using Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; -global using Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj deleted file mode 100644 index fdc771a75..000000000 --- a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs deleted file mode 100644 index d59be78bf..000000000 --- a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.NormalGuid; - -public class NormalGuidGenerator : IGuidGenerator -{ - public Guid NewId() => Guid.NewGuid(); -} - - diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md deleted file mode 100644 index 73b167c47..000000000 --- a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md +++ /dev/null @@ -1,26 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.IdGenerator.SimpleGuid - -Masa.Contrib.Data.IdGenerator.SimpleGuid is a simple guid constructor that provides a unique identifier of type Guid - -## Example: - -1. Install `Masa.Contrib.Data.IdGenerator.SimpleGuid` - - ````c# - Install-Package Masa.Contrib.Data.IdGenerator.SimpleGuid - ```` - -2. Use `Masa.Contrib.Data.IdGenerator.SimpleGuid` - - ```` C# - builder.Services.AddSimpleGuidGenerator(); - ```` - -3. Get Id - - ```` - IGuidGenerator generator;// Get it through DI, or get it through IdGeneratorFactory.GuidGenerator - generator.NewId();//Create a unique id - ```` \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md deleted file mode 100644 index 20fa99c97..000000000 --- a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md +++ /dev/null @@ -1,26 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.IdGenerator.NormalGuid - -Masa.Contrib.Data.IdGenerator.NormalGuid是一个简单的Guid构造器,提供Guid类型的唯一标识 - -## 用例: - -1. 安装`Masa.Contrib.Data.IdGenerator.NormalGuid` - - ```c# - Install-Package Masa.Contrib.Data.IdGenerator.NormalGuid - ``` - -2. 使用`Masa.Contrib.Data.IdGenerator.NormalGuid` - - ``` C# - builder.Services.AddSimpleGuidGenerator(); - ``` - -3. 获取Id - - ``` - IGuidGenerator generator;// 通过DI获取,或者通过IdGeneratorFactory.GuidGenerator获取 - generator.NewId();//创建唯一id - ``` diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs deleted file mode 100644 index 832b93820..000000000 --- a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddSimpleGuidGenerator(this IServiceCollection services) - { - services.TryAddSingleton(); - services.TryAddSingleton, IGuidGenerator>(); - IdGeneratorFactory.SetGuidGenerator(services.BuildServiceProvider().GetRequiredService()); - return services; - } -} diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs b/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs deleted file mode 100644 index 152235712..000000000 --- a/src/Contrib/Data/IdGenerator/NormalGuid/src/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.IdGenerator.NormalGuid; -global using Microsoft.Extensions.DependencyInjection.Extensions; diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj deleted file mode 100644 index fdc771a75..000000000 --- a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md deleted file mode 100644 index 07182ecec..000000000 --- a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md +++ /dev/null @@ -1,26 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.IdGenerator.SequentialGuid - -Masa.Contrib.Data.IdGenerator.SequentialGuid is an ordered Guid constructor that provides a unique identifier of the Guid type - -## Example: - -1. Install `Masa.Contrib.Data.IdGenerator.SequentialGuid` - - ````c# - Install-Package Masa.Contrib.Data.IdGenerator.SequentialGuid - ```` - -2. Use `Masa.Contrib.Data.IdGenerator.SequentialGuid` - - ```` C# - builder.Services.AddSequentialGuidGenerator(); - ```` - -3. Get Id - - ```` - ISequentialGuidGenerator generator;// Obtained through DI, or obtained through IdGeneratorFactory.SequentialGuidGenerator - generator.NewId();//Create a unique id - ```` \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md deleted file mode 100644 index af7381f03..000000000 --- a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md +++ /dev/null @@ -1,26 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.IdGenerator.SequentialGuid - -Masa.Contrib.Data.IdGenerator.SequentialGuid是一个有序的Guid构造器,提供Guid类型的唯一标识 - -## 用例: - -1. 安装`Masa.Contrib.Data.IdGenerator.SequentialGuid` - - ```c# - Install-Package Masa.Contrib.Data.IdGenerator.SequentialGuid - ``` - -2. 使用`Masa.Contrib.Data.IdGenerator.SequentialGuid` - - ``` C# - builder.Services.AddSequentialGuidGenerator(); - ``` - -3. 获取Id - - ``` - ISequentialGuidGenerator generator;// 通过DI获取,或者通过IdGeneratorFactory.SequentialGuidGenerator获取 - generator.NewId();//创建唯一id - ``` diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs deleted file mode 100644 index 61aab967f..000000000 --- a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.SequentialGuid; - -public class SequentialGuidGenerator : ISequentialGuidGenerator -{ - private static readonly RandomNumberGenerator RandomGenerator = RandomNumberGenerator.Create(); - - private readonly SequentialGuidType _guidType; - - public SequentialGuidGenerator(SequentialGuidType guidType) => _guidType = guidType; - - public Guid NewId() => Create(_guidType); - - public Guid Create(SequentialGuidType guidType) - { - byte[] randomBytes = GetRandomBytes(); - byte[] timestampBytes = GetTimestampBytes(); - byte[] guidBytes = GetGuidBytes(guidType, timestampBytes, randomBytes); - return new Guid(guidBytes); - } - - private byte[] GetTimestampBytes() - { - long timestamp = DateTime.UtcNow.Ticks / 10000L; - byte[] timestampBytes = BitConverter.GetBytes(timestamp); - if (BitConverter.IsLittleEndian) - { - Array.Reverse(timestampBytes); - } - return timestampBytes; - } - - private byte[] GetRandomBytes() - { - byte[] randomBytes = new byte[10]; - RandomGenerator.GetBytes(randomBytes); - return randomBytes; - } - - private byte[] GetGuidBytes(SequentialGuidType sequentialGuidType, byte[] timestampBytes, byte[] randomBytes) - { - byte[] guidBytes = new byte[16]; - switch (sequentialGuidType) - { - case SequentialGuidType.SequentialAtEnd: - - Buffer.BlockCopy(randomBytes, 0, guidBytes, 0, 10); - Buffer.BlockCopy(timestampBytes, 2, guidBytes, 10, 6); - break; - - case SequentialGuidType.SequentialAsString: - case SequentialGuidType.SequentialAsBinary: - - Buffer.BlockCopy(timestampBytes, 2, guidBytes, 0, 6); - Buffer.BlockCopy(randomBytes, 0, guidBytes, 6, 10); - - if (sequentialGuidType == SequentialGuidType.SequentialAsString && BitConverter.IsLittleEndian) - { - Array.Reverse(guidBytes, 0, 4); - Array.Reverse(guidBytes, 4, 2); - } - break; - - default: - throw new NotSupportedException($"unsupported {sequentialGuidType}"); - } - return guidBytes; - } -} diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs deleted file mode 100644 index 44681154a..000000000 --- a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddSequentialGuidGenerator(this IServiceCollection services) - => services.AddSequentialGuidGenerator(SequentialGuidType.SequentialAtEnd); - - public static IServiceCollection AddSequentialGuidGenerator(this IServiceCollection services, SequentialGuidType guidType) - { - services.TryAddSingleton(_ => new SequentialGuidGenerator(guidType)); - services.TryAddSingleton>(serviceProvider - => serviceProvider.GetRequiredService()); - IdGeneratorFactory.SetSequentialGuidGenerator(services.BuildServiceProvider().GetRequiredService()); - return services; - } -} diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs deleted file mode 100644 index c763fdd36..000000000 --- a/src/Contrib/Data/IdGenerator/SequentialGuid/src/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.IdGenerator.SequentialGuid; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using System.Security.Cryptography; diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj b/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj deleted file mode 100644 index 0ee173290..000000000 --- a/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - false - - - - - - - - - - - - - - diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs deleted file mode 100644 index c891db7f3..000000000 --- a/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests; - -[TestClass] -public class SequentialGuidGeneratorTest -{ - [TestMethod] - public void Test() - { - int count = 10000000; - List guids = new(); - for (int i = 0; i < count; i++) - { - guids.Add(new SequentialGuidGenerator(SequentialGuidType.SequentialAsString).NewId()); - } - Assert.IsTrue(guids.Count == guids.Distinct().Count()); - } -} diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs deleted file mode 100644 index 801a4c366..000000000 --- a/src/Contrib/Data/IdGenerator/SequentialGuid/test/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System; -global using System.Collections.Generic; -global using System.Linq; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs deleted file mode 100644 index f9899456b..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks; - -[MarkdownExporter, AsciiDocExporter, HtmlExporter] -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 1000)] -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 10000)] -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100000)] -[MinColumn, MaxColumn, MeanColumn, MedianColumn] -public class Benchmarks -{ - private IIdGenerator _idGenerator; - private IIdGenerator _idGeneratorBySecond; - private IIdGenerator _idGeneratorByEnableMachineClock; - private IIdGenerator _idGeneratorBySecondAndEnableMachineClock; - - [GlobalSetup] - public void GlobalSetup() - { - _idGenerator = InitializeIdGenerator(services => services.AddSnowflake()); - _idGeneratorBySecond = - InitializeIdGenerator(services => services.AddSnowflake(options => options.TimestampType = TimestampType.Seconds)); - _idGeneratorByEnableMachineClock = - InitializeIdGenerator(services => services.AddSnowflake(options => options.EnableMachineClock = true)); - _idGeneratorBySecondAndEnableMachineClock = - InitializeIdGenerator(services => services.AddSnowflake(options => - { - options.EnableMachineClock = true; - options.TimestampType = TimestampType.Seconds; - })); - } - - private IIdGenerator InitializeIdGenerator(Action action) - { - IServiceCollection services = new ServiceCollection(); - action.Invoke(services); - var serviceProvider = services.BuildServiceProvider(); - var idGenerator = serviceProvider.GetRequiredService>(); - idGenerator.NewId(); - return idGenerator; - } - - [Benchmark(Baseline = true)] - public void SnowflakeByMillisecond() - => _idGenerator.NewId(); - - [Benchmark] - public void SnowflakeBySecond() - => _idGeneratorBySecond.NewId(); - - [Benchmark] - public void SnowflakeByMillisecondAndEnableMachineClock() - => _idGeneratorByEnableMachineClock.NewId(); - - [Benchmark] - public void SnowflakeBySecondAndEnableMachineClock() - => _idGeneratorBySecondAndEnableMachineClock.NewId(); -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj deleted file mode 100644 index c37414772..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - Exe - net6.0 - AnyCPU - false - enable - false - enable - - - - - - - - - - - - diff --git a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs deleted file mode 100644 index 422680280..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks; - -class Program -{ - static void Main(string[] args) - { - var config = DefaultConfig.Instance - .AddValidator(ExecutionValidator.FailOnError) - .WithOptions(ConfigOptions.DisableOptimizationsValidator); - BenchmarkRunner.Run(config); - Console.ReadLine(); - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs deleted file mode 100644 index 1dda9dd1e..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using BenchmarkDotNet.Attributes; -global using BenchmarkDotNet.Configs; -global using BenchmarkDotNet.Engines; -global using BenchmarkDotNet.Jobs; -global using BenchmarkDotNet.Running; -global using BenchmarkDotNet.Validators; -global using Masa.BuildingBlocks.Data; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs deleted file mode 100644 index f3a67128f..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks; - -/// -/// Only supports the use of Redis environment -/// -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 1000)] -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 10000)] -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100000)] -[MinColumn, MaxColumn, MeanColumn, MedianColumn] -public class DistributedBenchmarks -{ - private IIdGenerator _idGenerator; - - [GlobalSetup] - public void GlobalSetup() - { - IServiceCollection services = new ServiceCollection(); - services.AddMasaRedisCache(opt => - { - opt.Password = ""; - opt.DefaultDatabase = 2; - opt.Servers = new List() - { - new("127.0.0.1", 6379) - }; - }); - services.AddSnowflake(options => - { - options.UseRedis(); - options.EnableMachineClock = true; - }); - var serviceProvider = services.BuildServiceProvider(); - _idGenerator = serviceProvider.GetRequiredService>(); - _idGenerator.NewId(); - } - - [Benchmark] - public void Distributed() - { - _idGenerator.NewId(); - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj deleted file mode 100644 index bdb200574..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - Exe - net6.0 - AnyCPU - false - enable - false - enable - - - - - - - - - - - - - - diff --git a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs deleted file mode 100644 index d8860fe0a..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks; - -class Program -{ - static void Main(string[] args) - { - var config = DefaultConfig.Instance - .AddValidator(ExecutionValidator.FailOnError) - .WithOptions(ConfigOptions.DisableOptimizationsValidator); - // BenchmarkRunner.Run(config); - Console.ReadLine(); - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs deleted file mode 100644 index d9175cc2d..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/perf/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using BenchmarkDotNet.Attributes; -global using BenchmarkDotNet.Configs; -global using BenchmarkDotNet.Engines; -global using BenchmarkDotNet.Jobs; -global using BenchmarkDotNet.Running; -global using BenchmarkDotNet.Validators; -global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; -global using Masa.Utils.Caching.Redis.Models; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs deleted file mode 100644 index fe5446e12..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; - -public class BaseRedis -{ - protected IDistributedCacheClient DistributedCacheClient { get; } - internal ConnectionMultiplexer Connection { get; } - internal IDatabase Database { get; } - - public BaseRedis(IDistributedCacheClient distributedCacheClient, IOptions redisOptions) - { - DistributedCacheClient = distributedCacheClient; - var options = GetConfigurationOptions(redisOptions.Value); - Connection = ConnectionMultiplexer.Connect(options); - Database = Connection.GetDatabase(options.DefaultDatabase ?? 0); - } - - private ConfigurationOptions GetConfigurationOptions(RedisConfigurationOptions redisOptions) - { - var configurationOptions = new ConfigurationOptions - { - AbortOnConnectFail = redisOptions.AbortOnConnectFail, - AllowAdmin = redisOptions.AllowAdmin, - ChannelPrefix = redisOptions.ChannelPrefix, - ClientName = redisOptions.ClientName, - ConnectRetry = redisOptions.ConnectRetry, - ConnectTimeout = redisOptions.ConnectTimeout, - DefaultDatabase = redisOptions.DefaultDatabase, - Password = redisOptions.Password, - Proxy = redisOptions.Proxy, - Ssl = redisOptions.Ssl, - SyncTimeout = redisOptions.SyncTimeout - }; - - foreach (var server in redisOptions.Servers) - { - configurationOptions.EndPoints.Add(server.Host, server.Port); - } - return configurationOptions; - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs deleted file mode 100644 index d83f092d4..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; - -public class DistributedIdGeneratorOptions -{ - /// - /// When there is no available WorkerId, Recycle idle and unused WorkerIds and recycle them - /// default: 120000ms(2min) - /// - /// - public long IdleTimeOut { get; set; } = 2 * 60 * 1000; - - /// - /// Get the minimum interval for WorkerId - /// default: 5000ms - /// - public long GetWorkerIdMinInterval { get; set; } = 5 * 1000; - - /// - /// refresh timestamp period - /// default: 500ms - /// - public long RefreshTimestampInterval { get; set; } = 500; - - public IdGeneratorOptions IdGeneratorOptions { get; } - - public DistributedIdGeneratorOptions(IdGeneratorOptions idGeneratorOptions) - => IdGeneratorOptions = idGeneratorOptions; -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs deleted file mode 100644 index 624e84ab5..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; - -public class DistributedWorkerProvider : BaseRedis, IWorkerProvider -{ - private readonly string _channel = "snowflake.workerid"; - private long? _workerId; - private readonly TimestampType _timestampType; - private readonly long _idleTimeOut; - private readonly long _maxWorkerId; - private readonly long _workerIdMinInterval; - private readonly string _currentWorkerKey; - private readonly string _inUseWorkerKey; - private readonly string _logOutWorkerKey; - private readonly string _getWorkerIdKey; - private readonly string _token; - private readonly TimeSpan _timeSpan; - private DateTime? _lastTime; - private readonly ILogger? _logger; - private readonly object _lock = new(); - private readonly string? _uniquelyIdentifies; - - public DistributedWorkerProvider( - IDistributedCacheClient distributedCacheClient, - DistributedIdGeneratorOptions? distributedIdGeneratorOptions, - IOptions redisOptions, - ILogger? logger) : base(distributedCacheClient, redisOptions) - { - _uniquelyIdentifies ??= Guid.NewGuid().ToString(); - ArgumentNullException.ThrowIfNull(distributedIdGeneratorOptions); - - _timestampType = distributedIdGeneratorOptions.IdGeneratorOptions.TimestampType; - _idleTimeOut = distributedIdGeneratorOptions.IdleTimeOut; - _maxWorkerId = distributedIdGeneratorOptions.IdGeneratorOptions.MaxWorkerId; - _workerIdMinInterval = distributedIdGeneratorOptions.GetWorkerIdMinInterval; - _currentWorkerKey = "snowflake.current.workerid"; - _inUseWorkerKey = "snowflake.inuse.workerid"; - _logOutWorkerKey = "snowflake.logout.workerid"; - _getWorkerIdKey = "snowflake.get.workerid"; - _token = Environment.MachineName; - _timeSpan = TimeSpan.FromSeconds(10); - _logger = logger; - - DistributedCacheClient.Subscribe(_channel, options => - { - if (options.Key == _uniquelyIdentifies) - return; - - if (_workerId.HasValue && _workerId.Value == options.Value) - _workerId = null; - }); - } - - public Task GetWorkerIdAsync() - { - if (_workerId.HasValue) - return Task.FromResult(_workerId.Value); - - if (_lastTime != null && (DateTime.UtcNow - _lastTime.Value).TotalMilliseconds < _workerIdMinInterval) - { - _logger?.LogDebug("Failed to get WorkerId, please rest for a while and try again"); - throw new MasaException("Failed to get WorkerId, please rest for a while and try again"); - } - - _lastTime = DateTime.UtcNow; - lock (_lock) - { - if (_workerId.HasValue) - return Task.FromResult(_workerId.Value); - - _workerId = GetNextWorkerIdAsync().ConfigureAwait(false).GetAwaiter().GetResult(); - - RefreshAsync().ConfigureAwait(false).GetAwaiter().GetResult(); - - DistributedCacheClient.Publish(_channel, options => - { - options.Key = _uniquelyIdentifies!; - options.Value = _workerId.Value; - }); - return Task.FromResult(_workerId.Value); - } - } - - public async Task RefreshAsync() - { - if (_workerId == null) - throw new MasaException("No WorkerId available"); - - await Database.SortedSetAddAsync(_inUseWorkerKey, _workerId, GetCurrentTimestamp()); - } - - public async Task LogOutAsync() - { - if (_workerId == null) - return; - - var workerId = _workerId; - _workerId = null; - - _logger?.LogDebug("----- Logout WorkerId, the current WorkerId: {WorkerId}, currentTime: {CurrentTime}", - workerId, - DateTime.UtcNow); - - await Database.SortedSetAddAsync(_logOutWorkerKey, workerId, GetCurrentTimestamp()); - await Database.SortedSetRemoveAsync(_inUseWorkerKey, workerId); - - _logger?.LogDebug("----- Logout WorkerId succeeded, the current WorkerId: {WorkerId}, currentTime: {CurrentTime}", - workerId, - DateTime.UtcNow); - } - - private async Task GetNextWorkerIdAsync() - { - var workerId = await DistributedCacheClient.HashIncrementAsync(_currentWorkerKey, 1) - 1; - if (workerId > _maxWorkerId) - { - var lockdb = Connection.GetDatabase(); - if (await lockdb.LockTakeAsync(_getWorkerIdKey, _token, _timeSpan)) - { - try - { - workerId = await GetNextWorkerIdByDistributedLockAsync(); - } - finally - { - await lockdb.LockReleaseAsync(_getWorkerIdKey, _token); - } - } - else - { - _logger?.LogDebug( - "----- Failed to obtain WorkerId, failed to obtain distributed lock, the currentTime: {CurrentTime}", - DateTime.UtcNow); - throw new MasaException("----- Failed to get WorkerId, please try again later"); - } - } - else - { - _workerId = workerId; - } - - return workerId; - } - - private async Task GetNextWorkerIdByDistributedLockAsync() - { - var workerId = await GetWorkerIdByLogOutAsync(); - if (workerId != null) - return workerId.Value; - - workerId = await GetWorkerIdByInUseAsync(); - if (workerId != null) - return workerId.Value; - - throw new MasaException("No WorkerId available"); - } - - protected virtual async Task GetWorkerIdByLogOutAsync() - { - var entries = await Database.SortedSetRangeByScoreWithScoresAsync(_logOutWorkerKey, take: 1); - if (entries is { Length: > 0 }) - return long.Parse(entries[0].Element); - - return null; - } - - protected virtual async Task GetWorkerIdByInUseAsync() - { - var entries = await Database.SortedSetRangeByScoreWithScoresAsync( - _inUseWorkerKey, - 0, - GetCurrentTimestamp(DateTime.UtcNow.AddMilliseconds(-_idleTimeOut)), - take: 1); - - if (entries is { Length: > 0 }) - return long.Parse(entries[0].Element); - - return null; - } - - private long GetCurrentTimestamp(DateTime? dateTime = null) - => new DateTimeOffset(dateTime ?? DateTime.UtcNow).GetTimestamp(_timestampType); -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs deleted file mode 100644 index 5adf99045..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; - -public static class IdGeneratorOptionsExtensions -{ - public static void UseRedis(this IdGeneratorOptions idGeneratorOptions, Action? action = null) - { - idGeneratorOptions.EnableSupportDistributed(); - DistributedIdGeneratorOptions distributedIdGeneratorOptions = new DistributedIdGeneratorOptions(idGeneratorOptions); - action?.Invoke(distributedIdGeneratorOptions); - - if (!idGeneratorOptions.Services.Any(service => service.ServiceType == typeof(IDistributedCacheClientFactory) && - service.ImplementationType == typeof(RedisCacheClientFactory))) - throw new MasaException("Please add first using AddMasaRedisCache"); - - if (distributedIdGeneratorOptions.IdleTimeOut <= idGeneratorOptions.HeartbeatInterval) - { - throw new ArgumentOutOfRangeException( - $"{nameof(distributedIdGeneratorOptions.IdleTimeOut)} must be greater than {idGeneratorOptions.HeartbeatInterval}"); - } - - idGeneratorOptions.Services.TryAddSingleton(serviceProvider - => new DistributedWorkerProvider(serviceProvider.GetRequiredService(), - distributedIdGeneratorOptions, - serviceProvider.GetRequiredService>(), - serviceProvider.GetService>())); - - if (idGeneratorOptions.EnableMachineClock) - { - idGeneratorOptions.Services.TryAddSingleton(serviceProvider - => new MachineClockIdGenerator(serviceProvider.GetRequiredService(), - serviceProvider.GetRequiredService(), - serviceProvider.GetRequiredService>(), - distributedIdGeneratorOptions)); - } - } - - private static TService GetInstance(this IServiceCollection services) where TService : notnull => - services.BuildServiceProvider().GetRequiredService(); - - -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs deleted file mode 100644 index 24114114a..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Internal; - -internal static class SnowflakeExtensions -{ - /// - /// get timestamp - /// - /// - /// Timestamp type: milliseconds: 1, seconds: 2 - /// - public static long GetTimestamp(this DateTimeOffset dateTimeOffset, TimestampType timestampType) - { - if (timestampType == TimestampType.Milliseconds) - return dateTimeOffset.ToUnixTimeMilliseconds(); - - return dateTimeOffset.ToUnixTimeSeconds(); - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs deleted file mode 100644 index cb72f564d..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; - -public class MachineClockIdGenerator : Snowflake.MachineClockIdGenerator -{ - private readonly string _lastTimestampKey = "snowflake.last_timestamp"; - private long _lastRefreshTimestamp = 0; - private readonly long _refreshTimestampInterval; - private readonly BaseRedis _redis; - - public MachineClockIdGenerator( - IDistributedCacheClient distributedCacheClient, - IWorkerProvider workerProvider, - IOptions redisOptions, - DistributedIdGeneratorOptions distributedIdGeneratorOptions) - : base(workerProvider, distributedIdGeneratorOptions.IdGeneratorOptions) - { - _redis = new BaseRedis(distributedCacheClient, redisOptions); - _refreshTimestampInterval = distributedIdGeneratorOptions.IdGeneratorOptions.TimestampType == TimestampType.Milliseconds ? - long.Parse(Math.Ceiling(distributedIdGeneratorOptions.RefreshTimestampInterval / 1000m) - .ToString(CultureInfo.InvariantCulture)) : distributedIdGeneratorOptions.RefreshTimestampInterval; - if (_redis.Database.HashExists(_lastTimestampKey, GetHashField())) - { - LastTimestamp = long.Parse(_redis.Database.HashGet(_lastTimestampKey, GetHashField())) + _refreshTimestampInterval; - } - } - - public string GetHashField() => base.GetWorkerId().ToString(); - - protected override long TilNextMillis(long lastTimestamp) - { - lastTimestamp += 1; - if (lastTimestamp - _lastRefreshTimestamp >= _refreshTimestampInterval) - { - _redis.Database.HashSetAsync(_lastTimestampKey, GetHashField(), lastTimestamp); - _lastRefreshTimestamp = lastTimestamp; - } - return lastTimestamp; - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj deleted file mode 100644 index 8a2eac792..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md deleted file mode 100644 index c36e62f88..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md +++ /dev/null @@ -1,38 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis - -Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis is based on `Masa.Contrib.Data.IdGenerator.Snowflake` -The upgraded version supports distributed deployment, relies on Redis to provide WorkerId, and supports deployment under K8s - -## Example: - -1. Install `Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis`, - - ````c# - Install-Package Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis - ```` - -2. Use `Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis` - - ```` C# - builder.Services.AddSnowflake(option => option.UseRedis()); - ```` - - > Due to the dependency on Redis, [Masa.Utils.Caching.Redis](https://github.com/masastack/MASA.Utils/tree/main/src/Caching/Masa.Utils.Caching.Redis) - -3. Get id - - ```` - ISnowflakeGenerator generator;// Get it through DI, or get it through IdGeneratorFactory.SnowflakeGenerator - generator.NewId();//Create a unique id - ```` - -### Parameters: - -* IdleTimeOut: Idle recycling time, default: 120000ms (2min), when there is no available WorkerId, it will try to obtain the WorkerId whose active time exceeds IdleTimeOut from the historically used WorkerId collection, and select the one that is farthest away from the current WorkerId for reuse -* GetWorkerIdMinInterval: Time interval for getting WorkerId, default: 5000ms (5s) - > When the current WorkerId is available, the WorkerId will be returned directly without any restrictions - > When the service fails to refresh the WorkerId and the duration exceeds the specified time, the WorkerId will be automatically released. When a new Id is obtained again, it will try to obtain a new WorkerId again. If the latest WorkerId obtained and the current time are less than GetWorkerIdMinInterval, the Denied service -* RefreshTimestampInterval: default 500ms - > After selecting to enable the clock lock, when the obtained next time stamp and the most recent time stamp exceed RefreshTimestampInterval, the corresponding relationship between the current time stamp and WorkerId will be saved in Redis for subsequent use, reducing the need for the current system time dependence \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md deleted file mode 100644 index 0f9327495..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md +++ /dev/null @@ -1,37 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis - -Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis是基于`Masa.Contrib.Data.IdGenerator.Snowflake`的升级版,支持分布式部署,依赖于Redis提供WorkerId,支持在K8s下部署 - -## 用例: - -1. 安装`Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis`、 - - ```c# - Install-Package Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis - ``` - -2. 使用`Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis` - - ``` C# - builder.Services.AddSnowflake(option => option.UseRedis()); - ``` - - > 由于依赖Redis,需使用[Masa.Utils.Caching.Redis](https://github.com/masastack/MASA.Utils/tree/main/src/Caching/Masa.Utils.Caching.Redis) - -3. 获取id - - ``` - ISnowflakeGenerator generator;// 通过DI获取,或者通过IdGeneratorFactory.SnowflakeGenerator获取 - generator.NewId();//创建唯一id - ``` - -### 参数: - -* IdleTimeOut: 闲置回收时间,默认: 120000ms (2min),当无可用的WorkerId后会尝试从历史使用的WorkerId集合中获取活跃时间超过IdleTimeOut的WorkerId,并选取距离现在最远的一个WorkerId进行复用 -* GetWorkerIdMinInterval: 获取WorkerId的时间间隔,默认: 5000ms (5s) - > 当前WorkerId可用时,会将WorkerId直接返回,不会有任何限制 - > 当服务刷新WorkerId失败,并持续时间超过指定时间后,会自动释放WorkerId,当再次获取新的Id时,会尝试重新获取新的WorkerId,若最近一次获取WorkerId时间与当前时间小于GetWorkerIdMinInterval时,会被拒绝提供服务 -* RefreshTimestampInterval: 默认500ms - > 选择启用时钟锁后,当获取到下次的时间戳与最近一次的时间戳超过RefreshTimestampInterval时,会将当前的时间戳与WorkerId对应关系保存在Redis中,用于后续继续使用,减少对当前系统时间的依赖 \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs deleted file mode 100644 index e69f3df50..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Internal; -global using Masa.Utils.Caching.Core.Interfaces; -global using Masa.Utils.Caching.Redis; -global using Masa.Utils.Caching.Redis.Models; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using StackExchange.Redis; -global using System.Globalization; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs deleted file mode 100644 index 5815d83ab..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake; - -public abstract class BaseIdGenerator -{ - private readonly IWorkerProvider _workerProvider; - - /// - /// start timestamp - /// - protected long Twepoch { get; } - - /// - /// milliseconds: 1 - /// seconds: 2 - /// - protected TimestampType TimestampType { get; } - - protected long MaxCallBackTime { get; } - - /// - /// sequence mask, used to limit the sequence maximum - /// - protected long SequenceMask { get; } - - protected int SequenceBits { get; } - - /// - /// Timestamp shift offset bits - /// - protected int TimestampLeftShift { get; } - - /// - /// Sequence within milliseconds - /// - protected long Sequence { get; set; } - - /// - /// The last time the ID was generated - /// - protected long LastTimestamp { get; set; } = -1L; - - protected object Lock { get; } = new(); - - public BaseIdGenerator(IWorkerProvider workerProvider, IdGeneratorOptions idGeneratorOptions) - { - _workerProvider = workerProvider; - TimestampType = idGeneratorOptions.TimestampType; - MaxCallBackTime = idGeneratorOptions.MaxCallBackTime; - Twepoch = new DateTimeOffset(idGeneratorOptions.BaseTime).ToUnixTimeMilliseconds(); - SequenceMask = ~(-1 << idGeneratorOptions.SequenceBits); - SequenceBits = idGeneratorOptions.SequenceBits; - TimestampLeftShift = idGeneratorOptions.SequenceBits + idGeneratorOptions.WorkerIdBits; - } - - public virtual long NewId() - { - lock (Lock) - { - var currentTimestamp = GetCurrentTimestamp(); - - if (currentTimestamp < LastTimestamp) - { - var res = TimeCallBack(currentTimestamp); - - if (res.Support) LastTimestamp = res.LastTimestamp; - else - throw new Exception( - $"InvalidSystemClock: Clock moved backwards, Refusing to generate id for {LastTimestamp - currentTimestamp} milliseconds"); - } - - if (LastTimestamp == currentTimestamp) - { - Sequence = (Sequence + 1) & SequenceMask; - if (Sequence == 0) currentTimestamp = TilNextMillis(LastTimestamp); - } - else - { - Sequence = 0; - } - - LastTimestamp = currentTimestamp; - - return NextId(currentTimestamp - Twepoch); - } - } - - protected virtual (bool Support, long LastTimestamp) TimeCallBack(long currentTimestamp) => (false, 0); - - protected virtual long NextId(long deltaSeconds) - { - return (deltaSeconds << TimestampLeftShift) - | (GetWorkerId() << SequenceBits) - | Sequence; - } - - protected virtual long TilNextMillis(long lastTimestamp) - { - var timestamp = GetCurrentTimestamp(); - while (timestamp <= lastTimestamp) timestamp = GetCurrentTimestamp(); - return timestamp; - } - - protected virtual long GetWorkerId() => _workerProvider.GetWorkerIdAsync().ConfigureAwait(false).GetAwaiter().GetResult(); - - protected long GetCurrentTimestamp() => new DateTimeOffset(DateTime.UtcNow).GetTimestamp(TimestampType); -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs deleted file mode 100644 index a40f2d357..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake; - -public sealed class DefaultWorkerProvider : IWorkerProvider -{ - private readonly long _workerId; - - public DefaultWorkerProvider() - { - _workerId = EnironmentExtensions.GetEnvironmentVariable(Const.DEFAULT_WORKER_ID_KEY) ?? 0; - } - - public Task GetWorkerIdAsync() => Task.FromResult(_workerId); - - public Task RefreshAsync() => Task.CompletedTask; - - public Task LogOutAsync() => Task.CompletedTask; -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs deleted file mode 100644 index 88a398d73..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake; - -public interface IWorkerProvider -{ - /// - /// Working machine id - /// - Task GetWorkerIdAsync(); - - /// - /// Refresh workid activity status - /// - /// - Task RefreshAsync(); - - /// - /// logout workid active status - /// - /// - Task LogOutAsync(); -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs deleted file mode 100644 index 4c8162e79..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake; - -public class IdGeneratorOptions -{ - public IServiceCollection Services { get;} - - /// - /// Baseline time, it is not recommended to change after use to avoid duplicate ids - /// - public DateTime BaseTime { get; set; } = new(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc); - - /// - /// The number of digits the sequence occupies in the id - /// default: 10 - /// - public int SequenceBits { get; set; } = 12; - - /// - /// The number of digits occupied by the working machines in the id - /// - public int WorkerIdBits { get; set; } = 10; - - public TimestampType TimestampType { get; set; } = TimestampType.Milliseconds; - - /// - /// When the machine clock is enabled, the timestamp is meaningless - /// After the machine clock is enabled, the timestamp will be meaningless. - /// The time when the project first obtains the id is used as the starting time, which is not affected by the clock callback. - /// - public bool EnableMachineClock { get; set; } = false; - - /// - /// Maximum acceptable callback duration, default 3000ms(3s) - /// - public long MaxCallBackTime { get; set; } = 3000; - - /// - /// Whether to support distributed id - /// - public bool SupportDistributed { get; private set; } - - /// - /// WorkerId check interval(Suitable for distributed deployment) - /// - public int HeartbeatInterval { get; set; } = Const.DEFAULT_HEARTBEAT_INTERVAL; - - /// - /// The maximum expiration time. When the new WorkerId is not obtained after this time, the WorkerId of the current service will be cancelled. - /// - public int MaxExpirationTime { get; set; } = Const.DEFAULT_EXPIRATION_TIME; - - /// - /// Maximum supported worker machine id - /// - public long MaxWorkerId => ~(-1L << WorkerIdBits); - - public void EnableSupportDistributed() => SupportDistributed = true; - - public IdGeneratorOptions(IServiceCollection services) - { - Services = services; - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs deleted file mode 100644 index daea77545..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; - -internal class Const -{ - /// - /// Default working cluster idkey - /// - public const string DEFAULT_WORKER_ID_KEY = "WORKER_ID"; - - /// - /// By default, the status of the workid is refreshed every 3 seconds to ensure that the workid will not be removed. - /// default: 3s - /// - public const int DEFAULT_HEARTBEAT_INTERVAL = 3 * 1000; - - /// - /// If the interval for failure to obtain WorkerId exceeds 10s - /// it is considered that the current service cannot provide a valid WorkerId - /// and the use is temporarily stopped. - /// default: 10s - /// - public const int DEFAULT_EXPIRATION_TIME = 10 * 1000; -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs deleted file mode 100644 index 94360c2fe..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; - -internal class EnironmentExtensions -{ - public static int? GetEnvironmentVariable(string variable) - { - var environmentVariable = Environment.GetEnvironmentVariable(variable); - if (string.IsNullOrEmpty(environmentVariable)) - return null; - - return int.Parse(environmentVariable); - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs deleted file mode 100644 index 98ecc198a..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; - -internal static class SnowflakeExtensions -{ - /// - /// get timestamp - /// - /// - /// Timestamp type: milliseconds: 1, seconds: 2 - /// - public static long GetTimestamp(this DateTimeOffset dateTimeOffset, TimestampType timestampType) - { - if (timestampType == TimestampType.Milliseconds) - return dateTimeOffset.ToUnixTimeMilliseconds(); - - return dateTimeOffset.ToUnixTimeSeconds(); - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs deleted file mode 100644 index 0cf96aabf..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; - -public class SnowflakeIdGenerator : BaseIdGenerator, ISnowflakeGenerator -{ - public SnowflakeIdGenerator(IWorkerProvider workerProvider, IdGeneratorOptions idGeneratorOptions) - : base(workerProvider, idGeneratorOptions) - { - } - - protected override (bool Support, long LastTimestamp) TimeCallBack(long currentTimestamp) - { - if ((TimestampType == TimestampType.Milliseconds && LastTimestamp - currentTimestamp <= MaxCallBackTime) || - (TimestampType == TimestampType.Seconds && LastTimestamp - currentTimestamp <= Math.Floor(MaxCallBackTime / 1000m))) - return (true, TilNextMillis(LastTimestamp)); - - return (false, 0); - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs deleted file mode 100644 index 8ddce1b9d..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; - -internal class WorkerIdBackgroundServices : BackgroundService -{ - private readonly int _heartbeatInterval; - private readonly int _maxExpirationTime; - private readonly IWorkerProvider _workerProvider; - private readonly ILogger? _logger; - private bool _isAvailable; - private DateTime? _firstFailedTime; - - public WorkerIdBackgroundServices(int heartbeatInterval, int maxExpirationTime, IWorkerProvider workerProvider, - ILogger? logger) - { - _heartbeatInterval = heartbeatInterval; - _maxExpirationTime = maxExpirationTime; - _workerProvider = workerProvider; - _logger = logger; - } - - protected override async Task ExecuteAsync(CancellationToken stoppingToken) - { - if (stoppingToken.IsCancellationRequested) - { - await _workerProvider.LogOutAsync(); - } - else - { - while (true) - { - try - { - if (_isAvailable) - await _workerProvider.RefreshAsync(); - else - await _workerProvider.GetWorkerIdAsync(); //Get new WorkerId - - _firstFailedTime = null; - _isAvailable = true; - } - catch (Exception ex) - { - _firstFailedTime ??= DateTime.UtcNow; - if (_firstFailedTime != null && (DateTime.UtcNow - _firstFailedTime.Value).TotalMilliseconds > _maxExpirationTime) - { - _isAvailable = false; - _logger?.LogWarning(_isAvailable ? - "----- Logout WorkerId, Failed to refresh WorkerId, error reason: {Error}, current time: {CurrentTime}" : - "----- Logout WorkerId, Failed to get new WorkerId, error reason: {Error}, current time: {CurrentTime}", - ex, - DateTime.UtcNow); - - await _workerProvider.LogOutAsync(); - } - else - { - _logger?.LogWarning( - _isAvailable ? "Failed to refresh WorkerId, error reason: {Error}, current time: {CurrentTime}" : - "Failed to get new WorkerId, error reason: {Error}, current time: {CurrentTime}", - ex, - DateTime.UtcNow); - } - } - finally - { - await Task.Delay(_heartbeatInterval, stoppingToken); - } - } - } - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs deleted file mode 100644 index 4c6e41bff..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake; - -public class MachineClockIdGenerator : BaseIdGenerator, ISnowflakeGenerator -{ - public MachineClockIdGenerator(IWorkerProvider workerProvider, IdGeneratorOptions idGeneratorOptions) - : base(workerProvider, idGeneratorOptions) - { - LastTimestamp = GetCurrentTimestamp(); - } - - public override long NewId() - { - lock (Lock) - { - var timestamp = LastTimestamp; - Sequence = (Sequence + 1) & SequenceMask; - if (Sequence == 0) timestamp = TilNextMillis(LastTimestamp); - - LastTimestamp = timestamp; - - return NextId(timestamp - Twepoch); - } - } - - protected override long TilNextMillis(long lastTimestamp) => lastTimestamp + 1; -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj deleted file mode 100644 index dcdabc675..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.md b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.md deleted file mode 100644 index e48dd4cfb..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.md +++ /dev/null @@ -1,113 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.IdGenerator.Snowflake - -Masa.Contrib.Data.IdGenerator.Snowflake is an id constructor based on snowflake id, providing a unique identifier of long type - -## Example: - -1. Install `Masa.Contrib.Data.IdGenerator.Snowflake` - - ````c# - Install-Package Masa.Contrib.Data.IdGenerator.Snowflake - ```` - -2. Using `Masa.Contrib.Data.IdGenerator.Snowflake` - - ```` C# - builder.Services.AddSnowflake(); - ```` - -3. Set the value of WorkerId for the current service, add the value of the environment variable `WORKER_ID`, the range is: 0-1023 (2^MaxWorkerId-1) - -4. Get Id - - ```` - ISnowflakeGenerator generator;// Get it through DI, or get it through IdGeneratorFactory.SnowflakeGenerator - generator.NewId();//Create a unique id - ```` - -### Parameters and FAQs: - -* Parameter Description - * BaseTime: Base time, less than current time (time zone: UTC +0) - > It is recommended to choose a fixed time that is closer to now. Once used, it cannot be changed (changes may lead to: duplicate id) - * SequenceBits: serial number, default: 12, support 0-4095 (2^12-1) - > 4095 requests per worker per millisecond - * WorkerIdBits: Worker machine id, default: 10, supports 0-1023 machines (2^10-1) - > By default, it is not supported to be used in k8s clusters. The WorkerId obtained by multiple copies in a Pod is the same, and there may be duplicate IDs. - * EnableMachineClock: enable clock lock, default: false - > After enabling the clock lock, the generated id no longer has an absolute relationship with the current time. The generated id takes the time when the project was started as the initial time, and the clock callback after the project runs will not affect the generation of the id - * The value of WorkerId is obtained from the environment variable `WORKER_ID` by default, if not set, it will return 0 - > When deploying on multiple machines, please ensure that the WorkerId of each service is unique - * TimestampType: Timestamp type, default: 1 (milliseconds: Milliseconds, seconds: Seconds) - > When TimestampType is Milliseconds, the maximum length of SequenceBits + WorkerIdBits is 22 - > - > When TimestampType is Seconds, the maximum length of SequenceBits + WorkerIdBits is 31 -* When distributed deployment - * SupportDistributed: supports distributed deployment, default: false (assigned by the class library provided by WorkerId) - * HeartbeatInterval: Heartbeat interval, default: 3000ms - > Used to periodically check the status of the refresh service to ensure that the WorkerId will not be recycled - * MaxExpirationTime: Maximum expiration time: Default: 10000ms - > When the refresh service status fails, check that the time difference between the current time and the first refresh service failure exceeds the maximum expiration time, actively give up the current WorkerId, and refuse to provide the service for generating id until a new WorkerId can be obtained and then provide it again Serve - * MaxCallBackTime: maximum callback time, default: 3000 (milliseconds) - > When the clock lock is not enabled, if the time callback is less than MaxCallBackTime, the id will be generated again after the waiting time is greater than the last time the id was generated. If it is greater than the maximum callback time, an exception will be thrown - -### Performance Testing - -1. TimestampType is 1 (milliseconds) - `BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) - 11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores - .NET SDK=7.0.100-preview.4.22252.9 - [Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT DEBUG - Job-JPQDWN : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT - Job-BKJUSV : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT - Job-UGZQME : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` - -`Runtime=.NET 6.0 RunStrategy=ColdStart` - -| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | -|----------------------- |----------- |--------------- |-----------:|----------:|-----------:|-----------:|-----------:|-------------:| -| SnowflakeByMillisecond | Job-JPQDWN | 1000 | 2,096.1 ns | 519.98 ns | 4,982.3 ns | 1,900.0 ns | 1,000.0 ns | 156,600.0 ns | -| SnowflakeByMillisecond | Job-BKJUSV | 10000 | 934.0 ns | 58.44 ns | 1,775.5 ns | 500.0 ns | 200.0 ns | 161,900.0 ns | -| SnowflakeByMillisecond | Job-UGZQME | 100000 | 474.6 ns | 5.54 ns | 532.8 ns | 400.0 ns | 200.0 ns | 140,500.0 ns | - -2. TimestampType is 2 (seconds) - -`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) -11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores -.NET SDK=7.0.100-preview.4.22252.9 -[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-RVUKKG : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-JAUDMW : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-LOMSTK : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` - -`Runtime=.NET 6.0 RunStrategy=ColdStart` - -| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | -|------------------ |----------- |--------------- |----------:|-----------:|-------------:|----------:|----------:|-------------:| -| SnowflakeBySecond | Job-RVUKKG | 1000 | 1.882 us | 0.5182 us | 4.965 us | 1.5000 us | 0.9000 us | 158.0 us | -| SnowflakeBySecond | Job-JAUDMW | 10000 | 11.505 us | 35.1131 us | 1,066.781 us | 0.4000 us | 0.3000 us | 106,678.8 us | -| SnowflakeBySecond | Job-LOMSTK | 100000 | 22.097 us | 15.0311 us | 1,444.484 us | 0.4000 us | 0.2000 us | 118,139.7 us | - -3. TimestampType is 1 (milliseconds), enable clock lock - -`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) -11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores -.NET SDK=7.0.100-preview.4.22252.9 -[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-BBZSDR : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-NUSWYF : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-FYICRN : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` - -`Runtime=.NET 6.0 RunStrategy=ColdStart` - -| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | -|-------------------------- |----------- |--------------- |-----------:|----------:|-----------:|-----------:|------------:|-------------:| -| MachineClockByMillisecond | Job-BBZSDR | 1000 | 1,502.0 ns | 498.35 ns | 4,775.1 ns | 1,100.0 ns | 700.0000 ns | 151,600.0 ns | -| MachineClockByMillisecond | Job-NUSWYF | 10000 | 602.0 ns | 54.76 ns | 1,663.7 ns | 200.0 ns | 100.0000 ns | 145,400.0 ns | -| MachineClockByMillisecond | Job-FYICRN | 100000 | 269.8 ns | 5.64 ns | 542.4 ns | 200.0 ns | 0.0000 ns | 140,900.0 ns | - -### Notice: - -The snowflake id algorithm relies heavily on time. Even after the clock lock is enabled, the project still needs to obtain the current time as the reference time at startup. If the initial acquisition time obtained is an expired time, the generated id may still be repeated. \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md deleted file mode 100644 index 4071aa952..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md +++ /dev/null @@ -1,115 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.IdGenerator.Snowflake - -Masa.Contrib.Data.IdGenerator.Snowflake是一个基于雪花id的id构造器,提供long类型的唯一标识 - -## 用例: - -1. 安装`Masa.Contrib.Data.IdGenerator.Snowflake` - - ```c# - Install-Package Masa.Contrib.Data.IdGenerator.Snowflake - ``` - -2. 使用`Masa.Contrib.Data.IdGenerator.Snowflake` - - ``` C# - builder.Services.AddSnowflake(); - ``` - -3. 为当前服务设置WorkerId的值,添加环境变量`WORKER_ID`的值,其范围为:0-1023 (2^MaxWorkerId-1) - -4. 获取Id - - ``` - ISnowflakeGenerator generator;// 通过DI获取,或者通过IdGeneratorFactory.SnowflakeGenerator获取 - generator.NewId();//创建唯一id - ``` - -### 参数及常见问题: - -* 参数说明 - * BaseTime: 基准时间,小于当前时间(时区:UTC +0) - > 建议选用现在更近的固定时间,一经使用,不可更变(更改可能导致: 重复id) - * SequenceBits: 序列号, 默认: 12,支持0-4095 (2^12-1) - > 每毫秒每个工作机器最多产生4095个请求 - * WorkerIdBits: 工作机器id,默认: 10,支持0-1023个机器 (2^10-1) - > 默认不支持在k8s集群中使用,在一个Pod中多副本获取到的WorkerId是一样的,可能会出现重复id - * EnableMachineClock: 启用时钟锁,默认: false - > 启用时钟锁后,生成的id不再与当前时间有绝对关系,生成的id以项目启动时的时间作为初始时间,项目运行后时钟回拨不会影响id的生成 - * WorkerId的值默认从环境变量`WORKER_ID`中获取,如未设置则会返回0 - > 多机部署时请确保每个服务的WorkerId是唯一的 - * TimestampType: 时间戳类型,默认: 1 (毫秒: Milliseconds, 秒: Seconds) - > TimestampType为Milliseconds时,SequenceBits + WorkerIdBits 最大长度为22 - > - > TimestampType为Seconds时,SequenceBits + WorkerIdBits 最大长度为31 - * MaxCallBackTime: 最大回拨时间,默认: 3000 (毫秒) - > 当不启用时钟锁时,如果出现时间回拨小于MaxCallBackTime,则会等待时间大于最后一次生成id的时间后,再次生成id,如果大于最大回拨时间,则会抛出异常 - -* 分布式部署时 - * SupportDistributed: 支持分布式部署,默认: false (由WorkerId的提供类库赋值) - * HeartbeatInterval: 心跳周期,默认: 3000ms - > 用于定期检查刷新服务的状态,确保WorkerId不会被回收 - * MaxExpirationTime: 最大过期时间: 默认: 10000ms - > 当刷新服务状态失败时,检查当前时间与第一次刷新服务失败的时间差超过最大过期时间后,主动放弃当前的WorkerId,并拒绝提供生成id的服务,直到可以获取到新的WokerId后再次提供服务 - -### 性能测试 - -1. TimestampType为1(毫秒) - -`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) -11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores -.NET SDK=7.0.100-preview.4.22252.9 -[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT DEBUG -Job-JPQDWN : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-BKJUSV : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-UGZQME : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` - -`Runtime=.NET 6.0 RunStrategy=ColdStart` - -| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | -|----------------------- |----------- |--------------- |-----------:|----------:|-----------:|-----------:|-----------:|-------------:| -| SnowflakeByMillisecond | Job-JPQDWN | 1000 | 2,096.1 ns | 519.98 ns | 4,982.3 ns | 1,900.0 ns | 1,000.0 ns | 156,600.0 ns | -| SnowflakeByMillisecond | Job-BKJUSV | 10000 | 934.0 ns | 58.44 ns | 1,775.5 ns | 500.0 ns | 200.0 ns | 161,900.0 ns | -| SnowflakeByMillisecond | Job-UGZQME | 100000 | 474.6 ns | 5.54 ns | 532.8 ns | 400.0 ns | 200.0 ns | 140,500.0 ns | - -2. TimestampType为2(秒) - -`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) -11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores -.NET SDK=7.0.100-preview.4.22252.9 -[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-RVUKKG : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-JAUDMW : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-LOMSTK : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` - -`Runtime=.NET 6.0 RunStrategy=ColdStart` - -| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | -|------------------ |----------- |--------------- |----------:|-----------:|-------------:|----------:|----------:|-------------:| -| SnowflakeBySecond | Job-RVUKKG | 1000 | 1.882 us | 0.5182 us | 4.965 us | 1.5000 us | 0.9000 us | 158.0 us | -| SnowflakeBySecond | Job-JAUDMW | 10000 | 11.505 us | 35.1131 us | 1,066.781 us | 0.4000 us | 0.3000 us | 106,678.8 us | -| SnowflakeBySecond | Job-LOMSTK | 100000 | 22.097 us | 15.0311 us | 1,444.484 us | 0.4000 us | 0.2000 us | 118,139.7 us | - -3. TimestampType为1(毫秒)、启用时钟锁 - -`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) -11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores -.NET SDK=7.0.100-preview.4.22252.9 -[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-BBZSDR : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-NUSWYF : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT -Job-FYICRN : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` - -`Runtime=.NET 6.0 RunStrategy=ColdStart` - -| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | -|-------------------------- |----------- |--------------- |-----------:|----------:|-----------:|-----------:|------------:|-------------:| -| MachineClockByMillisecond | Job-BBZSDR | 1000 | 1,502.0 ns | 498.35 ns | 4,775.1 ns | 1,100.0 ns | 700.0000 ns | 151,600.0 ns | -| MachineClockByMillisecond | Job-NUSWYF | 10000 | 602.0 ns | 54.76 ns | 1,663.7 ns | 200.0 ns | 100.0000 ns | 145,400.0 ns | -| MachineClockByMillisecond | Job-FYICRN | 100000 | 269.8 ns | 5.64 ns | 542.4 ns | 200.0 ns | 0.0000 ns | 140,900.0 ns | - -### 注意: - -雪花id算法严重依赖时间,哪怕是启用时钟锁后,项目在启动时仍然需要获取一次当前时间作为基准时间,如果获取到的初始获取时间为已经过期的时间,那生成的id仍然有重复的可能 diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs deleted file mode 100644 index a85f95745..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddSnowflake(this IServiceCollection services) - => services.AddSnowflake(null); - - public static IServiceCollection AddSnowflake(this IServiceCollection services, Action? options) - { - var idGeneratorOptions = new IdGeneratorOptions(services); - options?.Invoke(idGeneratorOptions); - - services.TryAddSingleton(); - - CheckIdGeneratorOptions(services, idGeneratorOptions); - - services.TryAddSingleton>(serviceProvider - => serviceProvider.GetRequiredService()); - if (idGeneratorOptions.EnableMachineClock) - { - services.TryAddSingleton(serviceProvider - => new MachineClockIdGenerator(serviceProvider.GetRequiredService(), idGeneratorOptions)); - } - else - { - services.TryAddSingleton(serviceProvider - => new SnowflakeIdGenerator(serviceProvider.GetRequiredService(), - idGeneratorOptions)); - } - - if (idGeneratorOptions.SupportDistributed) - { - services.Add(ServiceDescriptor.Singleton(serviceProvider - => new WorkerIdBackgroundServices( - idGeneratorOptions.HeartbeatInterval, - idGeneratorOptions.MaxExpirationTime, - serviceProvider.GetRequiredService(), - serviceProvider.GetService>() - ))); - } - IdGeneratorFactory.SetSnowflakeGenerator(services.BuildServiceProvider().GetRequiredService()); - return services; - } - - private static TService GetInstance(this IServiceCollection services) where TService : notnull => - services.BuildServiceProvider().GetRequiredService(); - - private static void CheckIdGeneratorOptions(IServiceCollection services, IdGeneratorOptions generatorOptions) - { - if (generatorOptions.BaseTime > DateTime.UtcNow) - throw new ArgumentOutOfRangeException(nameof(generatorOptions.BaseTime), - $"{nameof(generatorOptions.BaseTime)} must not be greater than the current time"); - - if (generatorOptions.SupportDistributed) - { - if (generatorOptions.HeartbeatInterval < 100) - throw new ArgumentOutOfRangeException($"{nameof(generatorOptions.HeartbeatInterval)} must be greater than 100"); - } - else - { - long workerId = GetInstance(services).GetWorkerIdAsync().ConfigureAwait(false).GetAwaiter().GetResult(); - if (workerId > generatorOptions.MaxWorkerId) - throw new ArgumentOutOfRangeException( - $"workerId must be greater than 0 or less than or equal to {generatorOptions.MaxWorkerId}"); - } - - var maxLength = generatorOptions.TimestampType == TimestampType.Milliseconds ? 22 : 31; - if (generatorOptions.SequenceBits + generatorOptions.WorkerIdBits > maxLength) - throw new ArgumentOutOfRangeException( - $"The sum of {nameof(generatorOptions.WorkerIdBits)} And {nameof(generatorOptions.SequenceBits)} must be less than {maxLength}"); - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs deleted file mode 100644 index 4e0eab734..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/src/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.IdGenerator.Snowflake; -global using Masa.Contrib.Data.IdGenerator.Snowflake.Internal; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Hosting; -global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs deleted file mode 100644 index 316f17bcc..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests; - -public class CustomDistributedWorkerProvider : DistributedWorkerProvider -{ - public CustomDistributedWorkerProvider(IDistributedCacheClient distributedCacheClient, - DistributedIdGeneratorOptions? distributedIdGeneratorOptions, - IOptions redisOptions, - ILogger? logger) - : base(distributedCacheClient, distributedIdGeneratorOptions, redisOptions, logger) - { - } - - protected override Task GetWorkerIdByLogOutAsync() - { - return Task.FromResult(null); - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs b/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs deleted file mode 100644 index 42def1c0a..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests; - -[TestClass] -public class IdGeneratorTest -{ - private RedisCacheClient _redisCacheClient; - private IOptions _redisOptions; - - /// - /// Only supports local testing - /// - [TestInitialize] - public Task InitRedisDataAsync() - { - RedisConfigurationOptions redisConfigurationOptions = new() - { - Password = "", - DefaultDatabase = 2, - Servers = new List() - { - new("127.0.0.1", 6379) - } - }; - _redisOptions = Options.Create(redisConfigurationOptions); - var options = GetConfigurationOptions(_redisOptions.Value); - _redisCacheClient = new RedisCacheClient(options); - // var connection = await ConnectionMultiplexer.ConnectAsync(options); - // var db = connection.GetDatabase(options.DefaultDatabase ?? 0); - // db.KeyDelete("snowflake.current.workerid"); - // db.KeyDelete("snowflake.inuse.workerid"); - // db.KeyDelete("snowflake.logout.workerid"); - // db.KeyDelete("snowflake.get.workerid"); - return Task.CompletedTask; - } - - [TestMethod] - public void TestEnableMachineClock() - { - var services = new ServiceCollection(); - services.AddSnowflake(opt => - { - opt.EnableMachineClock = true; - }); - var serviceProvider = services.BuildServiceProvider(); - var idGenerator = serviceProvider.GetRequiredService>(); - int count = 1; - List ids = new(); - while (count < 500000) - { - var id = idGenerator.NewId(); - ids.Add(id); - count++; - } - - if (ids.Distinct().Count() != ids.Count) - throw new Exception("duplicate id"); - } - - [TestMethod] - public void TestDisableMachineClock() - { - var services = new ServiceCollection(); - services.AddSnowflake(); - var serviceProvider = services.BuildServiceProvider(); - var idGenerator = serviceProvider.GetRequiredService>(); - int count = 1; - List ids = new(); - while (count < 500000) - { - var id = idGenerator.NewId(); - ids.Add(id); - count++; - } - - if (ids.Distinct().Count() != ids.Count) - throw new Exception("duplicate id"); - } - - [TestMethod] - public void TestErrorBaseTimeReturnThrowArgumentOutOfRangeException() - { - var services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddSnowflake(options => - { - options.BaseTime = DateTime.UtcNow.AddHours(1); - }); - }); - } - - [TestMethod] - public void TestErrorWorkerIdReturnThrowArgumentOutOfRangeException() - { - long maxWorkerId = ~(-1L << 5); - long workerId = maxWorkerId + 1; - Environment.SetEnvironmentVariable("WORKER_ID", workerId.ToString()); - var services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddSnowflake(options => - { - options.WorkerIdBits = 5; - }); - }); - } - - [TestMethod] - public void TestErrorSequenceBitsReturnThrowArgumentOutOfRangeException() - { - var services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddSnowflake(options => - { - options.SequenceBits = 21; - options.WorkerIdBits = 2; - }); - }); - } - - [TestMethod] - public void TestErrorHeartbeatIntervalReturnThrowArgumentOutOfRangeException() - { - var services = new ServiceCollection(); - services.AddMasaRedisCache(opt => - { - opt.Password = ""; - opt.DefaultDatabase = 2; - opt.Servers = new List() - { - new("127.0.0.1", 6379) - }; - }); - Assert.ThrowsException(() => - { - services.AddSnowflake(options => - { - options.UseRedis(); - options.HeartbeatInterval = 99; - }); - }); - } - - /// - /// Only supports local testing - /// - [TestMethod] - public void TestDistributedSnowflake() - { - // var services = new ServiceCollection(); - // services.AddMasaRedisCache(opt => - // { - // opt.Password = ""; - // opt.DefaultDatabase = 2; - // opt.Servers = new List() - // { - // new("127.0.0.1", 6379) - // }; - // }); - // - // services.AddDistributedSnowflake(); - // var serviceProvider = services.BuildServiceProvider(); - // var idGenerator = serviceProvider.GetRequiredService>(); - // int count = 1; - // List ids = new(); - // while (count < 500000) - // { - // var id = idGenerator.Create(); - // ids.Add(id); - // count++; - // } - // - // if (ids.Distinct().Count() != ids.Count) - // throw new Exception("duplicate id"); - } - - /// - /// Only supports local testing - /// - [TestMethod] - public Task TestDistributedWorkerAsync() - { - // var services = new ServiceCollection(); - // services.AddMasaRedisCache(opt => - // { - // opt.Password = ""; - // opt.DefaultDatabase = 2; - // opt.Servers = new List() - // { - // new("127.0.0.1", 6379) - // }; - // }); - // - // services.AddDistributedSnowflake(distributedIdGeneratorOptions => - // { - // distributedIdGeneratorOptions.GetWorkerIdMinInterval = 0; - // }); - // - // var serviceProvider = services.BuildServiceProvider(); - // var workerIdProvider = serviceProvider.GetRequiredService(); - // List workerIds = new(); - // var maxWorkerId = ~(-1L << 10); - // for (int index = 0; index <= maxWorkerId; index++) - // { - // var workerId = await workerIdProvider.GetWorkerIdAsync(); - // await workerIdProvider.LogOutAsync(); - // workerIds.Add(workerId); - // } - // - // Assert.IsTrue(workerIds.Distinct().Count() == workerIds.Count && workerIds.Count == maxWorkerId + 1); - return Task.CompletedTask; - } - - /// - /// Only supports local testing - /// - [TestMethod] - public void TestDistributedWorkerAndEnableMachineClock() - { - // var services = new ServiceCollection(); - // services.AddMasaRedisCache(opt => - // { - // opt.Password = ""; - // opt.DefaultDatabase = 2; - // opt.Servers = new List() - // { - // new("127.0.0.1", 6379) - // }; - // }); - // - // services.AddDistributedSnowflake(distributedIdGeneratorOptions => - // { - // distributedIdGeneratorOptions.GetWorkerIdMinInterval = 0; - // distributedIdGeneratorOptions.EnableMachineClock = true; - // }); - // - // var serviceProvider = services.BuildServiceProvider(); - // var idGenerator = serviceProvider.GetRequiredService>(); - // var id = idGenerator.Create(); - // var maxSequenceBit = ~(-1L << 12); - // for (int i = 1; i < maxSequenceBit; i++) - // { - // var idTemp = idGenerator.Create(); - // Assert.IsTrue(i + id == idTemp); - // } - } - - /// - /// Only supports local testing - /// - [TestMethod] - public Task TestGetWorkerIdAsync() - { - // var workerIdProvider = GetWorkerProvider(); - // List workerIds = new(); - // var errCount = 0; - // var maxWorkerId = ~(-1L << 10); - // for (int index = 0; index <= maxWorkerId + 1; index++) - // { - // try - // { - // var workerId = await workerIdProvider.GetWorkerIdAsync(); - // await workerIdProvider.LogOutAsync(); - // workerIds.Add(workerId); - // } - // catch (MasaException ex) - // { - // errCount = 1; - // Assert.IsTrue(ex.Message == "No WorkerId available" && index == maxWorkerId + 1); - // } - // } - // Assert.IsTrue(workerIds.Count == maxWorkerId + 1); - // Assert.IsTrue(errCount == 1); - return Task.CompletedTask; - } - - /// - /// Only supports local testing - /// - [TestMethod] - public Task TestGetDistibutedLockFaieldAsync() - { - // var workerIdBits = 10; - // var maxWorkerId = ~(-1L << workerIdBits); - // var tasks = new ConcurrentBag(); - // ThreadPool.GetMinThreads(out _, out var minIoc); - // ThreadPool.SetMinThreads((int)maxWorkerId, minIoc); - // - // int laterTime = 0; - // try - // { - // Parallel.For(0, maxWorkerId * 2, i => - // { - // tasks.Add(GetWorkerIdAsync(null, workerIdBits)); - // }); - // await Task.WhenAll(tasks); - // } - // catch (Exception ex) - // { - // if (ex.Message.Contains("please try again later") || - // (ex.InnerException != null && ex.InnerException.Message.Contains("please try again later"))) - // { - // laterTime++; - // } - // } - // Assert.IsTrue(laterTime > 0); - return Task.CompletedTask; - } - - private Task GetWorkerIdAsync(IServiceCollection? services, int workerIdBits) - => GetWorkerProvider(services, workerIdBits).GetWorkerIdAsync(); - - private IWorkerProvider GetWorkerProvider(IServiceCollection? services, int workerIdBits = 10) - { - var idGeneratorOptions = new IdGeneratorOptions(services ?? new ServiceCollection()) - { - WorkerIdBits = workerIdBits - }; - DistributedIdGeneratorOptions distributedIdGeneratorOptions = new DistributedIdGeneratorOptions(idGeneratorOptions) - { - GetWorkerIdMinInterval = 0 - }; - return new CustomDistributedWorkerProvider(_redisCacheClient, distributedIdGeneratorOptions, _redisOptions, null); - } - - private ConfigurationOptions GetConfigurationOptions(RedisConfigurationOptions redisOptions) - { - var configurationOptions = new ConfigurationOptions - { - AbortOnConnectFail = redisOptions.AbortOnConnectFail, - AllowAdmin = redisOptions.AllowAdmin, - ChannelPrefix = redisOptions.ChannelPrefix, - ClientName = redisOptions.ClientName, - ConnectRetry = redisOptions.ConnectRetry, - ConnectTimeout = redisOptions.ConnectTimeout, - DefaultDatabase = redisOptions.DefaultDatabase, - Password = redisOptions.Password, - Proxy = redisOptions.Proxy, - Ssl = redisOptions.Ssl, - SyncTimeout = redisOptions.SyncTimeout - }; - - foreach (var server in redisOptions.Servers) - { - configurationOptions.EndPoints.Add(server.Host, server.Port); - } - return configurationOptions; - } -} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj b/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj deleted file mode 100644 index b0a1cf434..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - false - - - - - - - - - - - - - - diff --git a/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs deleted file mode 100644 index 15da5bb58..000000000 --- a/src/Contrib/Data/IdGenerator/Snowflake/test/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; -global using Masa.Utils.Caching.Core.Interfaces; -global using Masa.Utils.Caching.Redis; -global using Masa.Utils.Caching.Redis.Models; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using StackExchange.Redis; -global using System; -global using System.Collections.Generic; -global using System.Linq; -global using System.Threading.Tasks; diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs deleted file mode 100644 index ed893e326..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster; - -public class DefaultMapper : IMapper -{ - private readonly IMappingConfigProvider _provider; - - public DefaultMapper(IMappingConfigProvider provider) - => _provider = provider; - - public TDestination Map(TSource source, MapOptions? options = null) - { - ArgumentNullException.ThrowIfNull(source, nameof(source)); - - return source.Adapt(_provider.GetConfig(source.GetType(), typeof(TDestination), options)); - } - - public TDestination Map(object source, MapOptions? options = null) - { - ArgumentNullException.ThrowIfNull(source, nameof(source)); - - return source.Adapt(_provider.GetConfig(source.GetType(), typeof(TDestination), options)); - } - - public TDestination Map(TSource source, TDestination destination, MapOptions? options = null) - { - ArgumentNullException.ThrowIfNull(source, nameof(source)); - - Type destinationType = destination?.GetType() ?? typeof(TDestination); - return source.Adapt(destination, _provider.GetConfig(source.GetType(), destinationType, options)); - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs deleted file mode 100644 index bf1136d5f..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster; - -public class DefaultMappingConfigProvider : IMappingConfigProvider -{ - private readonly MemoryCache<(Type SourceType, Type DestinationType, MapOptions? MapOptions), TypeAdapterConfig?> _cache = new(); - - private readonly MapOptions _options; - - public DefaultMappingConfigProvider(MapOptions options) => _options = options; - - public TypeAdapterConfig GetConfig(Type sourceType, Type destinationType, MapOptions? options = null) - => GetConfigByCache(sourceType, destinationType, options); - - protected virtual TypeAdapterConfig GetConfigByCache(Type sourceType, Type destinationType, MapOptions? options) - { - TypeAdapterConfig? config = _cache.GetOrAdd( - (sourceType, destinationType, options), - type => GetAdapterConfig(type.SourceType, type.DestinationType, options)); - - return config ?? GetDefaultConfig(options); - } - - protected virtual TypeAdapterConfig? GetAdapterConfig(Type sourceType, Type destinationType, MapOptions? options) - { - TypeAdapterConfig adapterConfig = GetDefaultConfig(options); - - var mapTypes = GetMapAndSelectorTypes(adapterConfig, sourceType, destinationType, options, true); - - foreach (var item in mapTypes) - { - var methodExecutor = InvokeBuilder.Build(item.SourceType, item.DestinationType); - methodExecutor.Invoke(adapterConfig, item.Constructor); - } - - return IsShare(options) ? null : adapterConfig; //When in shared mode, Config returns empty to save memory space - } - - //todo: In the follow-up, according to the situation, consider whether the configuration requires Fork, which is not processed for the time being - private List GetMapTypes( - TypeAdapterConfig adapterConfig, - Type sourceType, - Type destinationType, - MapOptions? options) - { - if (!NeedAutomaticMap(sourceType, destinationType)) - return new List(); - - List mapTypes = new(); - var sourceProperties = sourceType.GetProperties().ToList(); - var destinationProperties = destinationType.GetProperties().ToList(); - - List destinationConstructors = destinationType - .GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) - .Where(c => c.GetParameters().Length <= sourceProperties.Count) - .OrderByDescending(c => c.GetParameters().Length) - .ToList(); - - MapTypeOptions mapTypeOption = new(sourceType, destinationType) - { - Constructor = GetBestConstructor(destinationConstructors, sourceProperties) - }; - if (!RuleMapIsExist(adapterConfig, sourceType, destinationType)) - { - mapTypes.Add(mapTypeOption); - } - - List<(string Name, Type DdestinationPropertyType)> destinationPropertyList = destinationProperties - .Select(p => (p.Name.ToLower(), p.PropertyType)) - .Concat(mapTypeOption.Constructor.GetParameters().Select(p => (p.Name!.ToLower(), p.ParameterType))!) - .Distinct() - .ToList(); - - foreach (var sourceProperty in sourceProperties) - { - if (!sourceProperty.CanRead) - continue; - - var destinationProperty = destinationPropertyList.FirstOrDefault(p - => p.Name.Equals(sourceProperty.Name, StringComparison.OrdinalIgnoreCase)); - if (destinationProperty != default) - { - var subMapTypes = GetMapAndSelectorTypes(adapterConfig, sourceProperty.PropertyType, - destinationProperty.DdestinationPropertyType, options, false); - - if (!subMapTypes.Any() || mapTypes.Any(option => subMapTypes.Any(subOption - => subOption.SourceType == option.SourceType && subOption.DestinationType == option.DestinationType))) - continue; - - mapTypes.AddRange(subMapTypes); - } - } - - return mapTypes; - } - - private List GetMapAndSelectorTypes(TypeAdapterConfig adapterConfig, Type sourceType, Type destinationType, - MapOptions? options, bool isFirst) - { - bool sourcePropertyIsEnumerable = IsCollection(sourceType); - bool destinationPropertyIsEnumerable = IsCollection(destinationType); - if (!sourcePropertyIsEnumerable && !destinationPropertyIsEnumerable) - { - var subMapTypes = GetMapTypes( - adapterConfig, - sourceType, - destinationType, - options); - if (subMapTypes.Any()) return subMapTypes; - } - else if (sourcePropertyIsEnumerable && destinationPropertyIsEnumerable) - { - var subMapTypes = GetMapTypes(adapterConfig, - sourceType.GetGenericArguments()[0], - destinationType.GetGenericArguments()[0], - options); - - if (subMapTypes.Any()) return subMapTypes; - } - return new(); - } - - protected virtual bool IsCollection(Type type) - => type.IsGenericType && type.GetInterfaces().Any(x => x.GetGenericTypeDefinition() == typeof(IEnumerable<>)); - - protected virtual ConstructorInfo GetBestConstructor(List destinationConstructors, List sourceProperties) - { - if (destinationConstructors.Count <= 1) - return destinationConstructors.First(); - - foreach (var constructor in destinationConstructors) - { - if (IsPreciseMatch(constructor, sourceProperties)) - return constructor; - } - - throw new Exception("Failed to get the best constructor"); - } - - protected virtual bool IsPreciseMatch(ConstructorInfo destinationConstructor, List sourceProperties) - { - foreach (var parameter in destinationConstructor.GetParameters()) - { - if (!sourceProperties.Any(p - => p.Name.Equals(parameter.Name, StringComparison.OrdinalIgnoreCase) && p.PropertyType == parameter.ParameterType)) - { - return false; - } - } - return true; - } - - protected virtual List NotNeedAutomaticMapTypes => new() - { - typeof(string) - }; - - protected virtual bool NeedAutomaticMap(Type sourceType, Type destinationType) - => sourceType.IsClass && - !IsCollection(sourceType) && - (sourceType != destinationType || (sourceType != typeof(object) || destinationType != typeof(object))) && - !NotNeedAutomaticMapTypes.Contains(sourceType); - - protected virtual bool RuleMapIsExist(TypeAdapterConfig adapterConfig, Type sourceType, Type destinationType) - => adapterConfig.RuleMap.Any(r => r.Key == new TypeTuple(sourceType, destinationType)); - - protected virtual bool IsShare(MapOptions? options) => (options?.Mode ?? _options.Mode) == MapMode.Shared; - - /// - /// Get initial configuration - /// When currently in shared mode, return the default global settings - /// - /// - protected virtual TypeAdapterConfig GetDefaultConfig(MapOptions? options) - { - //todo: Other modes are currently not supported, and will be added in the future according to the situation - switch (options?.Mode ?? _options.Mode) - { - case MapMode.Shared: - return TypeAdapterConfig.GlobalSettings; - default: - throw new ArgumentException("Only shared configuration is supported", nameof(MapOptions.Mode)); - } - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs deleted file mode 100644 index 60e9aa742..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster; - -public interface IMappingConfigProvider -{ - TypeAdapterConfig GetConfig(Type sourceType, Type destinationType, MapOptions? options = null); -} diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs deleted file mode 100644 index 9ae65c460..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Internal; - -internal class InvokeBuilder -{ - private static readonly MethodInfo _newConfigMethodInfo; - private static readonly Type _typeAdapterConfigType; - - static InvokeBuilder() - { - var typeAdapterSetterExpandType = typeof(TypeAdapterSetterExpand); - _newConfigMethodInfo = typeAdapterSetterExpandType.GetMethod(nameof(TypeAdapterSetterExpand.NewConfigByConstructor))!; - _typeAdapterConfigType = typeof(TypeAdapterConfig); - } - - internal delegate TypeAdapterSetter MethodExecutor(TypeAdapterConfig target, object parameter); - - public static MethodExecutor Build( - Type sourceType, - Type destinationType) - { - var methodInfo = _newConfigMethodInfo.MakeGenericMethod(sourceType, destinationType); - - ParameterExpression[] parameters = - { - Expression.Parameter(_typeAdapterConfigType, "adapterConfigParameter"), - Expression.Parameter(typeof(object), "constructorInfoParameter") - }; - var newConfigMethodCall = Expression.Call( - null, - methodInfo, - parameters - ); - - var lambda = Expression.Lambda(newConfigMethodCall, parameters); - return lambda.Compile(); - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs deleted file mode 100644 index 7f93638c2..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Internal.Options; - -internal class MapTypeOptions -{ - public Type SourceType { get; } = default!; - - public Type DestinationType { get; } = default!; - - public ConstructorInfo Constructor { get; set; } = default!; - - public MapTypeOptions(Type sourceType, Type destinationType) - { - SourceType = sourceType; - DestinationType = destinationType; - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs deleted file mode 100644 index f119e2d95..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Internal; - -internal class TypeAdapterSetterExpand -{ - public static TypeAdapterSetter NewConfigByConstructor(TypeAdapterConfig adapterConfig, - object constructorInfo) - { - return adapterConfig - .NewConfig() - .MapToConstructor((constructorInfo as ConstructorInfo)!); - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj deleted file mode 100644 index a5ead0346..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.md b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.md deleted file mode 100644 index c6bd1958c..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.md +++ /dev/null @@ -1,85 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Data.Mapping.Mapster - -Masa.Contrib.Data.Mapping.Mapster is an object-to-object mapper based on [Mapster](https://github.com/MapsterMapper/Mapster). It adds automatic acquisition and uses the best constructor mapping on the original basis. Nested mapping is supported to reduce the workload of mapping. - -## Mapping Rules - -* When the target object has no constructor: use an empty constructor, which maps to fields and properties. - -* Target object has multiple constructors: get the best constructor map - - > Best constructor: The number of parameters of the target object constructor is searched in descending order, the parameter names are the same (case-insensitive), and the parameter types are the same as the source object properties - -## Example: - -1. Install `Masa.Contrib.Data.Mapping.Mapster` - - ````c# - Install-Package Masa.Contrib.Data.Mapping.Mapster - ```` - -2. Using `Mapping` - - ```` C# - builder.Services.AddMapster(); - ```` - -3. Mapping objects - - ```` - IMapper mapper;// Get through DI - - var request = new - { - Name = "Teach you to learn Dapr...", - OrderItem = new OrderItem("Teach you to learn Dapr hand by hand", 49.9m) - }; - var order = mapper.Map(request);// Map the request to a new object, Parameters with the same attribute name and type of the source object and the target object will be automatically mapped, or the constructor parameter name (case-insensitive) and type of the target object are the same as those of the source object, and they will be mapped through the constructor - ```` - - Mapping class `Order`: - - ```` Order.cs - public class Order - { - public string Name { get; set; } - - public decimal TotalPrice { get; set; } - - public List OrderItems { get; set; } - - public Order(string name) - { - Name = name; - } - - public Order(string name, OrderItem orderItem) : this(name) - { - OrderItems = new List { orderItem }; - TotalPrice = OrderItems.Sum(item => item.Price * item.Number); - } - } - - public class OrderItem - { - public string Name { get; set; } - - public decimal Price { get; set; } - - public int Number { get; set; } - - public OrderItem(string name, decimal price) : this(name, price, 1) - { - - } - - public OrderItem(string name, decimal price, int number) - { - Name = name; - Price = price; - Number = number; - } - } - ```` \ No newline at end of file diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md deleted file mode 100644 index 3565a78ba..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md +++ /dev/null @@ -1,86 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Data.Mapping.Mapster - -Masa.Contrib.Data.Mapping.Mapster是基于[Mapster](https://github.com/MapsterMapper/Mapster)的一个对象到对象的映射器,在原来的基础上增加自动获取并使用最佳构造函数映射,支持嵌套映射,减轻映射的工作量。 - -## 映射规则 - -* 目标对象没有构造函数时:使用空构造函数,映射到字段和属性。 - -* 目标对象存在多个构造函数:获取最佳构造函数映射 - - > 最佳构造函数: 目标对象构造函数参数数量从大到小降序查找,参数名称一致(不区分大小写)且参数类型与源对象属性一致 - -## 用例: - -1. 安装`Masa.Contrib.Data.Mapping.Mapster` - - ```c# - Install-Package Masa.Contrib.Data.Mapping.Mapster - ``` - -2. 使用`Mapping` - - ``` C# - builder.Services.AddMapster(); - ``` - -3. 映射对象 - - ``` - IMapper mapper;// 通过DI获取 - - var request = new - { - Name = "Teach you to learn Dapr ……", - OrderItem = new OrderItem("Teach you to learn Dapr hand by hand", 49.9m) - }; - var order = mapper.Map(request);// 将request映射到新的对象 - - ``` - - 映射类`Order`: - - ``` Order.cs - public class Order - { - public string Name { get; set; } - - public decimal TotalPrice { get; set; } - - public List OrderItems { get; set; } - - public Order(string name) - { - Name = name; - } - - public Order(string name, OrderItem orderItem) : this(name) - { - OrderItems = new List { orderItem }; - TotalPrice = OrderItems.Sum(item => item.Price * item.Number); - } - } - - public class OrderItem - { - public string Name { get; set; } - - public decimal Price { get; set; } - - public int Number { get; set; } - - public OrderItem(string name, decimal price) : this(name, price, 1) - { - - } - - public OrderItem(string name, decimal price, int number) - { - Name = name; - Price = price; - Number = number; - } - } - ``` \ No newline at end of file diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs deleted file mode 100644 index 80ae4839d..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddMapster(this IServiceCollection services) - => services.AddMapster(MapMode.Shared); - - public static IServiceCollection AddMapster(this IServiceCollection services, MapMode mode) - => services.AddMapster(new MapOptions() - { - Mode = mode - }); - - public static IServiceCollection AddMapster(this IServiceCollection services, MapOptions mapOptions) - { - if (services.Any(service => service.ImplementationType == typeof(MappingProvider))) - return services; - - services.AddSingleton(); - - services.TryAddSingleton(_ => new DefaultMappingConfigProvider(mapOptions)); - services.TryAddSingleton(); - - Mapper.Instance = new Mapper(services); - return services; - } - - [Obsolete("Use AddMapster instead")] - public static IServiceCollection AddMapping(this IServiceCollection services) - => services.AddMapster(MapMode.Shared); - - [Obsolete("Use AddMapster instead")] - public static IServiceCollection AddMapping(this IServiceCollection services, MapMode mode) - => services.AddMapster(mode); - - [Obsolete("Use AddMapster instead")] - public static IServiceCollection AddMapping(this IServiceCollection services, MapOptions mapOptions) - => services.AddMapster(mapOptions); - - private class MappingProvider - { - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs b/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs deleted file mode 100644 index 0862034c5..000000000 --- a/src/Contrib/Data/Mapping/Mapster/src/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Mapster; -global using Mapster.Models; -global using Masa.BuildingBlocks.Data.Mapping; -global using Masa.BuildingBlocks.Data.Mapping.Options; -global using Masa.BuildingBlocks.Data.Mapping.Options.Enum; -global using Masa.Contrib.Data.Mapping.Mapster; -global using Masa.Contrib.Data.Mapping.Mapster.Internal; -global using Masa.Contrib.Data.Mapping.Mapster.Internal.Options; -global using Masa.Utils.Caching.Memory; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using System.Linq.Expressions; -global using System.Reflection; diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs deleted file mode 100644 index 5701ea8fe..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests; - -[TestClass] -public class BaseMappingTest -{ - protected IServiceCollection _services; - protected IMapper _mapper = default!; - - [TestInitialize] - public void Initialize() - { - _services = new ServiceCollection(); - _services.AddMapster(); - var serviceProvider = _services.BuildServiceProvider(); - _mapper = serviceProvider.GetRequiredService(); - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs deleted file mode 100644 index cf21dff84..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Orders; - -public class Order -{ - public Guid Id { get; set; } - - public string Name { get; set; } - - public decimal TotalPrice { get; set; } - - public List OrderItems { get; set; } - - private Order() - { - Id = Guid.NewGuid(); - } - - public Order(string name) : this() - { - Name = name; - } - - public Order(string name, OrderItem orderItem) : this(name, new List { orderItem }) - { - } - - public Order(string name, List orderItems) : this(name) - { - Name = name; - OrderItems = orderItems; - TotalPrice = orderItems.Sum(item => item.Price * item.Number); - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs deleted file mode 100644 index ff48919c7..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Orders; - -public class OrderItem -{ - public string Name { get; set; } - - public decimal Price { get; set; } - - public int Number { get; set; } - - public OrderItem(string name, decimal price) : this(name, price, 1) - { - - } - - public OrderItem(string name, decimal price, int number) - { - Name = name; - Price = price; - Number = number; - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs deleted file mode 100644 index ac3609192..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Users; - -public class User -{ - public string Name { get; set; } - - public int Age { get; set; } - - public string Description { get; set; } - - public DateTime Birthday { get; set; } - - public AddressItem Hometown { get; set; } - - - public User() - { - - } - public User(string name) - { - Name = name; - } - - public User(string name, int age, string description, DateTime birthday) - : this(name) - { - Age = age; - Description = description; - Birthday = birthday; - } - - public User(string name, int age, string description, DateTime birthday, AddressItem hometown) - : this(name, age, description, birthday) - { - Hometown = hometown; - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs deleted file mode 100644 index b99b089b9..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.ValueObjects; - -public class AddressItem -{ - public string Province { get; set; } - - public string City { get; set; } - - public string Address { get; set; } - - public AddressItem(string fullAddress) : this(fullAddress.Split(',')[0], fullAddress.Split(',')[1], fullAddress.Split(',')[2]) - { - - } - - public AddressItem(string province, string city, string address) - { - Province = province; - City = city; - Address = address; - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs deleted file mode 100644 index 5ac2153ee..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests; - -[TestClass] -public class MappingExtensionsTest -{ - [TestInitialize] - public void Initialize() - { - var services = new ServiceCollection(); - services.AddMapster(); - } - - [TestMethod] - public void TestCreateUserRequestMapToUserReturnUserNameEqualRequestName() - { - var request = new CreateUserRequest() - { - Name = "Jim", - }; - var user = request.Map(); - Assert.IsNotNull(user); - Assert.IsTrue(user.Name == request.Name); - } - - [TestMethod] - public void TestObjectMapToUserReturnUserIsNotNull() - { - var request = new - { - Name = "Jim", - Age = 18, - Birthday = DateTime.Now, - Description = "i am jim" - }; - - var user = request.Map(); - Assert.IsNotNull(user); - Assert.AreEqual(request.Name, user.Name); - Assert.AreEqual(request.Age, user.Age); - Assert.AreEqual(request.Birthday, user.Birthday); - Assert.AreEqual(request.Description, user.Description); - } - - [TestMethod] - public void TestObjectMapToUserAndSourceParameterGreatherThanDestinationControllerParameterLength() - { - var request = new - { - Name = "Jim", - Age = 18, - Birthday = DateTime.Now, - Description = "i am jim", - Tag = Array.Empty() - }; - - var user = request.Map(); - Assert.IsNotNull(user); - Assert.AreEqual(request.Name, user.Name); - Assert.AreEqual(request.Age, user.Age); - Assert.AreEqual(request.Birthday, user.Birthday); - Assert.AreEqual(request.Description, user.Description); - } - - [TestMethod] - public void TestCreateFullUserRequestMapToUserReturnHometownIsNotNull() - { - var request = new CreateFullUserRequest() - { - Name = "Jim", - Age = 18, - Birthday = DateTime.Now, - Hometown = new AddressItemRequest() - { - Province = "BeiJing", - City = "BeiJing", - Address = "National Sport Stadium" - } - }; - - var user = request.Map(); - Assert.IsNotNull(user); - Assert.AreEqual(request.Name, user.Name); - Assert.AreEqual(request.Age, user.Age); - Assert.AreEqual(request.Birthday, user.Birthday); - Assert.AreEqual(request.Description, user.Description); - Assert.IsNotNull(request.Hometown); - Assert.AreEqual(request.Hometown.Province, user.Hometown.Province); - Assert.AreEqual(request.Hometown.City, user.Hometown.City); - Assert.AreEqual(request.Hometown.Address, user.Hometown.Address); - } - - [TestMethod] - public void TestOrderRequestMapToOrderReturnTotalPriceIs10() - { - var request = new OrderRequest() - { - Name = "orderName", - OrderItem = new OrderItem("apple", 10) - }; - - var order = request.Map(); - Assert.IsNotNull(order); - Assert.AreEqual(order.Name, request.Name); - Assert.AreEqual(order.OrderItems.Count, 1); - Assert.AreEqual(order.OrderItems[0].Name, request.OrderItem.Name); - Assert.AreEqual(order.OrderItems[0].Price, request.OrderItem.Price); - Assert.AreEqual(order.OrderItems[0].Number, 1); - Assert.AreEqual(order.TotalPrice, 1 * 10); - } - - [TestMethod] - public void TestOrderMultiRequestMapToOrderReturnOrderItemsCountIs1AndTotalPriceIs10() - { - var request = new - { - Name = "Order Name", - OrderItems = new List() - { - new("Apple", 10) - } - }; - - var order = request.Map(); - Assert.IsNotNull(order); - Assert.AreEqual(order.Name, request.Name); - Assert.AreEqual(order.OrderItems.Count, 1); - Assert.AreEqual(order.OrderItems[0].Name, request.OrderItems[0].Name); - Assert.AreEqual(order.OrderItems[0].Price, request.OrderItems[0].Price); - Assert.AreEqual(order.OrderItems[0].Number, 1); - Assert.AreEqual(order.TotalPrice, 10); - } - - [TestMethod] - public void TestOrderMultiRequestMapToOrderReturnOrderItemsCountIs1() - { - var request = new OrderMultiRequest() - { - Name = "Order Name", - OrderItems = new List() - { - new() - { - Name = "Apple", - Price = 10, - Number = 1 - } - } - }; - - var order = request.Map(); - Assert.IsNotNull(order); - Assert.AreEqual(order.Name, request.Name); - Assert.AreEqual(order.OrderItems.Count, 1); - Assert.AreEqual(order.OrderItems[0].Name, request.OrderItems[0].Name); - Assert.AreEqual(order.OrderItems[0].Price, request.OrderItems[0].Price); - Assert.AreEqual(order.OrderItems[0].Number, 1); - Assert.AreEqual(order.TotalPrice, 0); - } - - [TestMethod] - public void TestMapToExistingObject() - { - var request = new - { - Name = "Jim", - Age = 18 - }; - User user = new User("Time") - { - Description = "Description", - }; - - var newUser = request.Map(user); - Assert.IsNotNull(newUser); - Assert.IsTrue(newUser.Description == "Description"); - Assert.IsTrue(newUser.Name == "Jim"); - Assert.IsTrue(newUser.Age == 18); - } - - [TestMethod] - public void TestCreateUserRequestListMapToUsers() - { - List requests = new List() - { - new() - { - Name = "Jim" - } - }; - List users = new(); - var newUsers = requests.Map(users); - Assert.IsTrue(newUsers.Count == 1); - Assert.IsTrue(newUsers[0].Name == "Jim"); - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs deleted file mode 100644 index 685c2586b..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests; - -[TestClass] -public class MappingFormTest : BaseMappingTest -{ - [TestMethod] - public void TestUseShareModeReturnMapRuleIsExist() - { - var request = new CreateUserRequest() - { - Name = "Jim", - }; - _mapper.Map(request); - Assert.IsTrue(TypeAdapterConfig.GlobalSettings.RuleMap.Any(r - => r.Key.Source == typeof(CreateUserRequest) && r.Key.Destination == typeof(User))); - } - - [TestMethod] - public void TestAddMultiMapping() - { - _services.AddMapster(); - var mappers = _services.BuildServiceProvider().GetServices(); - Assert.IsTrue(mappers.Count() == 1); - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs deleted file mode 100644 index ceb5d22af..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests; - -[TestClass] -public class MappingTest : BaseMappingTest -{ - [TestMethod] - public void TestCreateUserRequestMapToUserReturnUserNameEqualRequestName() - { - var request = new CreateUserRequest() - { - Name = "Jim", - }; - var user = _mapper.Map(request); - Assert.IsNotNull(user); - Assert.IsTrue(user.Name == request.Name); - } - - [TestMethod] - public void TestObjectMapToUserReturnUserIsNotNull() - { - var request = new - { - Name = "Jim", - Age = 18, - Birthday = DateTime.Now, - Description = "i am jim" - }; - - var user = _mapper.Map(request); - Assert.IsNotNull(user); - Assert.AreEqual(request.Name, user.Name); - Assert.AreEqual(request.Age, user.Age); - Assert.AreEqual(request.Birthday, user.Birthday); - Assert.AreEqual(request.Description, user.Description); - } - - [TestMethod] - public void TestObjectMapToUserAndSourceParameterGreatherThanDestinationControllerParameterLength() - { - var request = new - { - Name = "Jim", - Age = 18, - Birthday = DateTime.Now, - Description = "i am jim", - Tag = Array.Empty() - }; - - var user = _mapper.Map(request); - Assert.IsNotNull(user); - Assert.AreEqual(request.Name, user.Name); - Assert.AreEqual(request.Age, user.Age); - Assert.AreEqual(request.Birthday, user.Birthday); - Assert.AreEqual(request.Description, user.Description); - } - - [TestMethod] - public void TestCreateFullUserRequestMapToUserReturnHometownIsNotNull() - { - var request = new CreateFullUserRequest() - { - Name = "Jim", - Age = 18, - Birthday = DateTime.Now, - Hometown = new AddressItemRequest() - { - Province = "BeiJing", - City = "BeiJing", - Address = "National Sport Stadium" - } - }; - - var user = _mapper.Map(request); - Assert.IsNotNull(user); - Assert.AreEqual(request.Name, user.Name); - Assert.AreEqual(request.Age, user.Age); - Assert.AreEqual(request.Birthday, user.Birthday); - Assert.AreEqual(request.Description, user.Description); - Assert.IsNotNull(request.Hometown); - Assert.AreEqual(request.Hometown.Province, user.Hometown.Province); - Assert.AreEqual(request.Hometown.City, user.Hometown.City); - Assert.AreEqual(request.Hometown.Address, user.Hometown.Address); - } - - [TestMethod] - public void TestOrderRequestMapToOrderReturnTotalPriceIs10() - { - var request = new OrderRequest() - { - Name = "orderName", - OrderItem = new OrderItem("apple", 10) - }; - - var order = _mapper.Map(request); - Assert.IsNotNull(order); - Assert.AreEqual(order.Name, request.Name); - Assert.AreEqual(order.OrderItems.Count, 1); - Assert.AreEqual(order.OrderItems[0].Name, request.OrderItem.Name); - Assert.AreEqual(order.OrderItems[0].Price, request.OrderItem.Price); - Assert.AreEqual(order.OrderItems[0].Number, 1); - Assert.AreEqual(order.TotalPrice, 1 * 10); - } - - [TestMethod] - public void TestOrderMultiRequestMapToOrderReturnOrderItemsCountIs1AndTotalPriceIs10() - { - var request = new - { - Name = "Order Name", - OrderItems = new List() - { - new("Apple", 10) - } - }; - - var order = _mapper.Map(request); - Assert.IsNotNull(order); - Assert.AreEqual(order.Name, request.Name); - Assert.AreEqual(order.OrderItems.Count, 1); - Assert.AreEqual(order.OrderItems[0].Name, request.OrderItems[0].Name); - Assert.AreEqual(order.OrderItems[0].Price, request.OrderItems[0].Price); - Assert.AreEqual(order.OrderItems[0].Number, 1); - Assert.AreEqual(order.TotalPrice, 10); - } - - [TestMethod] - public void TestOrderMultiRequestMapToOrderReturnOrderItemsCountIs1() - { - var request = new OrderMultiRequest() - { - Name = "Order Name", - OrderItems = new List() - { - new() - { - Name = "Apple", - Price = 10, - Number = 1 - } - } - }; - - var order = _mapper.Map(request); - Assert.IsNotNull(order); - Assert.AreEqual(order.Name, request.Name); - Assert.AreEqual(order.OrderItems.Count, 1); - Assert.AreEqual(order.OrderItems[0].Name, request.OrderItems[0].Name); - Assert.AreEqual(order.OrderItems[0].Price, request.OrderItems[0].Price); - Assert.AreEqual(order.OrderItems[0].Number, 1); - Assert.AreEqual(order.TotalPrice, 0); - } - - [TestMethod] - public void TestMapToExistingObject() - { - var request = new - { - Name = "Jim", - Age = 18 - }; - User user = new User("Time") - { - Description = "Description", - }; - - var newUser = _mapper.Map(request, user); - Assert.IsNotNull(newUser); - Assert.IsTrue(newUser.Description == "Description"); - Assert.IsTrue(newUser.Name == "Jim"); - Assert.IsTrue(newUser.Age == 18); - } - - [TestMethod] - public void TestCreateUserRequestListMapToUsers() - { - List requests = new List() - { - new() - { - Name = "Jim" - } - }; - List users = new(); - var newUsers = _mapper.Map(requests, users); - Assert.IsTrue(newUsers.Count == 1); - Assert.IsTrue(newUsers[0].Name == "Jim"); - } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj deleted file mode 100644 index d951bf543..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net6.0 - enable - - false - - - - - - - - - - - - - - - - diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs deleted file mode 100644 index 8981f95dc..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests; - -public class AddressItemRequest -{ - public string Province { get; set; } - - public string City { get; set; } - - public string Address { get; set; } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs deleted file mode 100644 index afdf4f0b5..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Orders; - -public class OrderItemRequest -{ - public string Name { get; set; }= default!; - - public decimal Price { get; set; } - - public int Number { get; set; } -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs deleted file mode 100644 index a3a3a1e39..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Orders; - -public class OrderMultiRequest -{ - public Guid Id { get; set; } - - public string Name { get; set; } = default!; - - public List OrderItems { get; set; } = default!; -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs deleted file mode 100644 index 9c8139dc2..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Orders; - -public class OrderRequest -{ - public string Name { get; set; }= default!; - - public OrderItem OrderItem { get; set; }= default!; -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs deleted file mode 100644 index e6ccb82b6..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Users; - -public class CreateFullUserRequest : CreateUserRequest -{ - public int Age { get; set; } - - public string Description { get; set; } = default!; - - public DateTime Birthday { get; set; } - - public AddressItemRequest Hometown { get; set; } = default!; -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs deleted file mode 100644 index feb0041f9..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Users; - -public class CreateUserRequest -{ - public string Name { get; set; } = default!; -} diff --git a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs b/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs deleted file mode 100644 index 0f0e72afa..000000000 --- a/src/Contrib/Data/Mapping/Mapster/test/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Mapster; -global using Masa.BuildingBlocks.Data.Mapping; -global using Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Orders; -global using Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Users; -global using Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.ValueObjects; -global using Masa.Contrib.Data.Mapping.Mapster.Tests.Requests; -global using Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Orders; -global using Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Users; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System; -global using System.Collections.Generic; -global using System.Linq; diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs deleted file mode 100644 index b6d21ebc7..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.UoW.EF; - -public class DefaultConnectionStringProvider : IConnectionStringProvider -{ - private readonly IUnitOfWorkAccessor _unitOfWorkAccessor; - private readonly IOptionsMonitor _options; - private readonly ILogger? _logger; - - public DefaultConnectionStringProvider( - IUnitOfWorkAccessor unitOfWorkAccessor, - IOptionsMonitor options, - ILogger? logger = null) - { - _unitOfWorkAccessor = unitOfWorkAccessor; - _options = options; - _logger = logger; - } - - public Task GetConnectionStringAsync(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) => Task.FromResult(GetConnectionString(name)); - - public string GetConnectionString(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) - { - if (_unitOfWorkAccessor.CurrentDbContextOptions != null) - return _unitOfWorkAccessor.CurrentDbContextOptions.ConnectionString; - - var connectionStrings = _options.CurrentValue.ConnectionStrings; - var connectionString = string.IsNullOrEmpty(name) ? connectionStrings.DefaultConnection : connectionStrings.GetConnectionString(name); - if (string.IsNullOrEmpty(connectionString)) - _logger?.LogError("Failed to get database connection string, please check whether the configuration of IOptionsSnapshot is abnormal"); - - _unitOfWorkAccessor.CurrentDbContextOptions = new MasaDbContextConfigurationOptions(connectionString); - return connectionString; - } -} diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs deleted file mode 100644 index dfd338586..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.UoW.EF; - -public static class DispatcherOptionsExtensions -{ - public static IEventBusBuilder UseUoW( - this IEventBusBuilder eventBusBuilder, - Action? optionsBuilder = null, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - => eventBusBuilder.UseUoW(optionsBuilder, disableRollbackOnFailure, useTransaction); - - public static IEventBusBuilder UseUoW( - this IEventBusBuilder eventBusBuilder, - Action? optionsBuilder = null, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - where TUserId : IComparable - { - eventBusBuilder.Services.UseUoW(nameof(eventBusBuilder.Services), optionsBuilder, disableRollbackOnFailure, - useTransaction); - return eventBusBuilder; - } - - public static IDispatcherOptions UseUoW( - this IDispatcherOptions options, - Action? optionsBuilder = null, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - => options.UseUoW(optionsBuilder, disableRollbackOnFailure, useTransaction); - - public static IDispatcherOptions UseUoW( - this IDispatcherOptions options, - Action? optionsBuilder = null, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - where TUserId : IComparable - { - options.Services.UseUoW(nameof(options.Services), optionsBuilder, disableRollbackOnFailure, useTransaction); - return options; - } - - private static IServiceCollection UseUoW( - this IServiceCollection services, - string paramName, - Action? optionsBuilder = null, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - where TUserId : IComparable - { - if (services == null) - throw new ArgumentNullException(paramName); - - if (services.Any(service => service.ImplementationType == typeof(UoWProvider))) - return services; - - services.AddSingleton(); - services.TryAddScoped(); - services.TryAddSingleton>(); - services.TryAddScoped(); - - services.AddScoped(serviceProvider => new UnitOfWork(serviceProvider) - { - DisableRollbackOnFailure = disableRollbackOnFailure, - UseTransaction = useTransaction - }); - if (services.All(service => service.ServiceType != typeof(MasaDbContextOptions))) - services.AddMasaDbContext(optionsBuilder); - - services.AddScoped(); - return services; - } - - private class UoWProvider - { - } -} diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Internal/Const.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Internal/Const.cs deleted file mode 100644 index 7c0b9d177..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Internal/Const.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.UoW.EF.Internal; - -internal class Const -{ - public const string DEFAULT_SECTION = "ConnectionStrings"; -} diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj deleted file mode 100644 index 12be8ba78..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.md b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.md deleted file mode 100644 index 002778c9a..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.md +++ /dev/null @@ -1,25 +0,0 @@ -[中](README.zh-CN.md) | EN - -## UoW.EF - -Example: - -```C# -Install-Package Masa.Contrib.Dispatcher.Events -Install-Package Masa.Contrib.Data.UoW.EF -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. Configure appsettings.json -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity" - } -} -``` - -2. Use UoW -```C# -builder.Services.AddEventBus(eventBusBuilder => eventBusBuilder.UseUoW(dbOptions => dbOptions.UseSqlServer())); -``` \ No newline at end of file diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.zh-CN.md b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.zh-CN.md deleted file mode 100644 index d2af8dc5c..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/README.zh-CN.md +++ /dev/null @@ -1,25 +0,0 @@ -中 | [EN](README.md) - -## UoW.EF - -用例: - -```C# -Install-Package Masa.Contrib.Dispatcher.Events -Install-Package Masa.Contrib.Data.UoW.EF -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. 配置appsettings.json -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity" - } -} -``` - -2. 使用UoW -```C# -builder.Services.AddEventBus(eventBusBuilder => eventBusBuilder.UseUoW(dbOptions => dbOptions.UseSqlServer())); -``` diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Transaction.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Transaction.cs deleted file mode 100644 index 664d8c2e7..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/Transaction.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.UoW.EF; - -public class Transaction : ITransaction -{ - [JsonIgnore] - public IUnitOfWork? UnitOfWork { get; set; } - - public Transaction(IUnitOfWork unitOfWork) => UnitOfWork = unitOfWork; -} diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs deleted file mode 100644 index bba189c70..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.UoW.EF; - -public class UnitOfWork : IUnitOfWork where TDbContext : MasaDbContext, IMasaDbContext -{ - public IServiceProvider ServiceProvider { get; } - - private DbContext? _context; - - protected DbContext Context => _context ??= ServiceProvider.GetRequiredService(); - - public DbTransaction Transaction - { - get - { - if (!UseTransaction) - throw new NotSupportedException("Doesn't support transaction opening"); - - if (TransactionHasBegun) - return Context.Database.CurrentTransaction!.GetDbTransaction(); - - return Context.Database.BeginTransaction().GetDbTransaction(); - } - } - - public bool TransactionHasBegun => Context.Database.CurrentTransaction != null; - - public bool DisableRollbackOnFailure { get; set; } - - public EntityState EntityState { get; set; } = EntityState.UnChanged; - - public CommitState CommitState { get; set; } = CommitState.Commited; - - public bool UseTransaction { get; set; } = true; - - public UnitOfWork(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; - - public async Task SaveChangesAsync(CancellationToken cancellationToken = default) - { - if (EntityState == EntityState.UnChanged) - return; - - await Context.SaveChangesAsync(cancellationToken); - EntityState = EntityState.UnChanged; - } - - public async Task CommitAsync(CancellationToken cancellationToken = default) - { - var domainEventBus = GetDomainEventBus(); - while (domainEventBus != null && await domainEventBus.AnyQueueAsync()) - { - await domainEventBus.PublishQueueAsync(); - - await SaveChangesAsync(cancellationToken); - } - - if (UseTransaction && TransactionHasBegun && CommitState == CommitState.UnCommited) - { - await Context.Database.CommitTransactionAsync(cancellationToken); - CommitState = CommitState.Commited; - } - } - - public async Task RollbackAsync(CancellationToken cancellationToken = default) - { - if (!UseTransaction || !TransactionHasBegun) - return; - - if (TransactionHasBegun) - { - DetachAll(); - await Context.Database.RollbackTransactionAsync(cancellationToken); - } - } - - /// - /// Release entity tracking, prevent pre-submit exceptions, be processed by other Handlers and continue execution - /// - private void DetachAll() - { - var entityEntrys = Context.ChangeTracker.Entries(); - foreach (var entry in entityEntrys) - { - if (entry != null) - { - entry.State = Microsoft.EntityFrameworkCore.EntityState.Detached; - } - } - } - - public Task AddDomainEventAsync(TDomainEvent @event) where TDomainEvent : class - { - var domainEventBus = GetDomainEventBus(); - if (domainEventBus == null || @event is not IDomainEvent domainEvent) - return Task.CompletedTask; - - domainEventBus.Enqueue(domainEvent); - return Task.CompletedTask; - } - - public async ValueTask DisposeAsync() => await (_context?.DisposeAsync() ?? ValueTask.CompletedTask); - - public void Dispose() => _context?.Dispose(); - - private IDomainEventBus? GetDomainEventBus() - => ServiceProvider.GetService(); -} diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs deleted file mode 100644 index 9f25b6e13..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.UoW.EF; - -public class UnitOfWorkAccessor : IUnitOfWorkAccessor -{ - public MasaDbContextConfigurationOptions? CurrentDbContextOptions { get; set; } -} diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs deleted file mode 100644 index 39b9a2ad0..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.UoW.EF; - -public class UnitOfWorkManager : IUnitOfWorkManager where TDbContext : MasaDbContext, IMasaDbContext -{ - private readonly IServiceProvider _serviceProvider; - - public UnitOfWorkManager(IServiceProvider serviceProvider) => _serviceProvider = serviceProvider; - - /// - /// Create new DbContext - /// We create DbContext with lazy loading enabled by default - /// - /// Deferred creation of DbContext, easy to specify tenant or environment by yourself, which is very effective for physical isolation - /// - public IUnitOfWork CreateDbContext(bool lazyLoading = true) - { - var scope = _serviceProvider.CreateAsyncScope(); - if (!lazyLoading) - scope.ServiceProvider.GetRequiredService(); - - return scope.ServiceProvider.GetRequiredService(); - } - - public IUnitOfWork CreateDbContext(MasaDbContextConfigurationOptions options) - { - ArgumentNullException.ThrowIfNull(options, nameof(options)); - if (string.IsNullOrEmpty(options.ConnectionString)) - throw new ArgumentException($"Invalid {nameof(options)}"); - - var scope = _serviceProvider.CreateAsyncScope(); - var unitOfWorkAccessor = scope.ServiceProvider.GetRequiredService(); - unitOfWorkAccessor.CurrentDbContextOptions = options; - - return scope.ServiceProvider.GetRequiredService(); - } -} diff --git a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/_Imports.cs b/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/_Imports.cs deleted file mode 100644 index 87fb70f0c..000000000 --- a/src/Contrib/Data/UoW/src/Masa.Contrib.Data.UoW.EF/_Imports.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.Options; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Storage; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using System.Data.Common; -global using System.Text.Json.Serialization; -global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; diff --git a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs deleted file mode 100644 index 380088173..000000000 --- a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.UoW.EF.Tests; - -public class CustomDbContext : MasaDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) { } - - public DbSet User { get; set; } - - protected override void OnModelCreatingExecuting(ModelBuilder builder) - { - builder.Entity(ConfigureUserEntry); - } - - void ConfigureUserEntry(EntityTypeBuilder builder) - { - builder.ToTable("Users"); - - builder.HasKey(e => e.Id); - - builder.Property(e => e.Id) - .IsRequired(); - - builder.Property(e => e.Name) - .HasMaxLength(6) - .IsRequired(); - } -} - -public class Users -{ - public Guid Id { get; private set; } - - public string Name { get; set; } = default!; - - public Users() - { - this.Id = Guid.NewGuid(); - } -} diff --git a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj deleted file mode 100644 index 8b69c1b7f..000000000 --- a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj +++ /dev/null @@ -1,45 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - Always - - - - - - - - - - diff --git a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs deleted file mode 100644 index 8b06e74be..000000000 --- a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Data.UoW.EF.Tests; - -public class TestBase -{ - protected readonly string _connectionString = "DataSource=:memory:"; - protected readonly SqliteConnection Connection; - - protected TestBase() - { - Connection = new SqliteConnection(_connectionString); - Connection.Open(); - } - - public void Dispose() - { - Connection.Close(); - } -} diff --git a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs deleted file mode 100644 index f3400d93b..000000000 --- a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Microsoft.Extensions.Options; -using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; - -namespace Masa.Contrib.Data.UoW.EF.Tests; - -[TestClass] -public class TestUnitOfWork : TestBase -{ - private Mock _options; - - [TestInitialize] - public void Initialize() - { - _options = new(); - _options.Setup(option => option.Services).Returns(new ServiceCollection()).Verifiable(); - } - - [TestMethod] - public void TestAddUoWAndNullServices() - { - var options = new Mock(); - Assert.ThrowsException(() => options.Object.UseUoW()); - } - - [TestMethod] - public void TestAddUoWAndUseSqlLite() - { - _options.Object.UseUoW(options => options.UseTestSqlite(_connectionString)); - var serviceProvider = _options.Object.Services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetRequiredService()); - } - - [TestMethod] - public void TestAddMultUoW() - { - _options.Object - .UseUoW(options => options.UseTestSqlite(_connectionString)) - .UseUoW(options => options.UseTestSqlite(_connectionString)); - - var serviceProvider = _options.Object.Services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestTransaction() - { - Mock uoW = new(); - Assert.IsTrue(new Transaction(uoW.Object).UnitOfWork!.Equals(uoW.Object)); - } - - [TestMethod] - public async Task TestUseTranscationAsync() - { - _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); - var serviceProvider = _options.Object.Services.BuildServiceProvider(); - var dbContext = serviceProvider.GetRequiredService(); - await dbContext.Database.EnsureCreatedAsync(); - var uoW = serviceProvider.GetRequiredService(); - - var transaction = uoW.Transaction; - Users user = new Users() - { - Name = Guid.NewGuid().ToString() - }; - dbContext.Add(user); - uoW.EntityState = EntityState.Changed; - await uoW.SaveChangesAsync(); - uoW.CommitState = CommitState.UnCommited; - await uoW.RollbackAsync(); - - Assert.IsTrue(!dbContext.User.ToList().Any()); - } - - [TestMethod] - public async Task TestCommitAsync() - { - _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); - var serviceProvider = _options.Object.Services.BuildServiceProvider(); - var dbContext = serviceProvider.GetRequiredService(); - await dbContext.Database.EnsureCreatedAsync(); - var uoW = new UnitOfWork(serviceProvider); - var user = new Users() - { - Name = "Tom" - }; - var transcation = uoW.Transaction; - dbContext.User.Add(user); - uoW.EntityState = EntityState.Changed; - await uoW.SaveChangesAsync(); - uoW.CommitState = CommitState.UnCommited;//todo: Using Repository does not require manual changes to Commit status - await uoW.CommitAsync(); - - Assert.IsTrue(dbContext.User.ToList().Count == 1); - } - - [TestMethod] - public async Task TestOpenRollbackAsync() - { - _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); - var serviceProvider = _options.Object.Services.BuildServiceProvider(); - var dbContext = serviceProvider.GetRequiredService(); - await dbContext.Database.EnsureCreatedAsync(); - var uoW = serviceProvider.GetRequiredService(); - var user = new Users(); - var transcation = uoW.Transaction; - dbContext.User.Add(user); - await uoW.CommitAsync(); - - Assert.IsTrue(!await dbContext.User.AnyAsync()); - } - - [TestMethod] - public async Task TestAddLoggerAndOpenRollbackAsync() - { - _options.Object.Services.AddLogging(); - _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); - var serviceProvider = _options.Object.Services.BuildServiceProvider(); - var dbContext = serviceProvider.GetRequiredService(); - await dbContext.Database.EnsureCreatedAsync(); - var uoW = serviceProvider.GetRequiredService(); - var user = new Users(); - var transcation = uoW.Transaction; - dbContext.User.Add(user); - await uoW.CommitAsync(); - - Assert.IsTrue(!await dbContext.User.AnyAsync()); - } - - [TestMethod] - public void TestDataConnectionString() - { - IConfiguration configuration = new ConfigurationManager(); - _options.Object.Services.AddSingleton(_ => configuration); - _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); - var serviceProvider = _options.Object.Services.BuildServiceProvider(); - var dataConnectionStringProvider = serviceProvider.GetRequiredService(); - Assert.IsTrue(dataConnectionStringProvider.DbContextOptionsList.Count == 1 && - dataConnectionStringProvider.DbContextOptionsList.Any(option => option.ConnectionString == _connectionString)); - } - - [TestMethod] - public void TestUnitOfWorkManager() - { - _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); - var serviceProvider = _options.Object.Services.BuildServiceProvider(); - var unitOfWorkManager = serviceProvider.GetRequiredService(); - var unitOfWork = serviceProvider.GetRequiredService(); - var dbContext = serviceProvider.GetRequiredService(); - var dbContext2 = serviceProvider.GetRequiredService(); - Assert.IsTrue(dbContext.Equals(dbContext2)); - - var newUnitOfWork = - unitOfWorkManager.CreateDbContext( - new MasaDbContextConfigurationOptions(_connectionString)); - Assert.IsFalse(newUnitOfWork.Equals(unitOfWork)); - var newDbContext = newUnitOfWork.ServiceProvider.GetRequiredService(); - Assert.IsFalse(dbContext.Equals(newDbContext)); - - Assert.ThrowsException(() - => unitOfWorkManager.CreateDbContext(new MasaDbContextConfigurationOptions(""))); - } - - [TestMethod] - public async Task TestUnitOfWorkAccessorAsync() - { - var services = new ServiceCollection(); - services.Configure(options => - { - options.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = _connectionString - }; - }); - _options.Setup(option => option.Services).Returns(services).Verifiable(); - _options.Object.UseUoW(options => options.UseSqlite()); - var serviceProvider = _options.Object.Services.BuildServiceProvider(); - var unitOfWorkAccessor = serviceProvider.GetService(); - Assert.IsTrue(unitOfWorkAccessor is { CurrentDbContextOptions: null }); - var unitOfWork = serviceProvider.GetRequiredService(); - Assert.IsNotNull(unitOfWork); - Assert.IsTrue(!unitOfWork.TransactionHasBegun); - unitOfWorkAccessor = serviceProvider.GetService(); - Assert.IsTrue(unitOfWorkAccessor!.CurrentDbContextOptions != null && unitOfWorkAccessor.CurrentDbContextOptions.ConnectionString == - _connectionString); - - var unitOfWorkManager = serviceProvider.GetRequiredService(); - var unitOfWorkNew = unitOfWorkManager.CreateDbContext(false); - var unitOfWorkAccessorNew = unitOfWorkNew.ServiceProvider.GetService(); - Assert.IsTrue(unitOfWorkAccessorNew!.CurrentDbContextOptions != null && - unitOfWorkAccessorNew.CurrentDbContextOptions.ConnectionString == - _connectionString); - - var unitOfWorkNew2 = - unitOfWorkManager.CreateDbContext(new MasaDbContextConfigurationOptions("test")); - var unitOfWorkAccessorNew2 = unitOfWorkNew2.ServiceProvider.GetService(); - Assert.IsTrue(unitOfWorkAccessorNew2!.CurrentDbContextOptions != null && - unitOfWorkAccessorNew2.CurrentDbContextOptions.ConnectionString == "test"); - - var connectionString = - await unitOfWorkNew2.ServiceProvider.GetRequiredService().GetConnectionStringAsync(); - Assert.IsTrue(connectionString == "test"); - } - - [TestMethod] - public void TestUnitOfWorkByEventBusBuilder() - { - var services = new ServiceCollection(); - services.Configure(options => - { - options.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = _connectionString - }; - }); - Mock eventBuilder = new(); - eventBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - eventBuilder.Object.UseUoW(options => options.UseSqlite()); - - var serviecProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviecProvider.GetService()); - Assert.IsNotNull(serviecProvider.GetService()); - Assert.IsNotNull(serviecProvider.GetService()); - } - - [TestMethod] - public void TestUnitOfWorkAndAddMasaConfiguationReturnUnitOfWorkIsNotNull() - { - var builder = WebApplication.CreateBuilder(); - builder.AddMasaConfiguration(); - Mock eventBuilder = new(); - eventBuilder.Setup(eb => eb.Services).Returns(builder.Services).Verifiable(); - eventBuilder.Object.UseUoW(options => options.UseSqlite()); - - var serviecProvider = builder.Services.BuildServiceProvider(); - Assert.IsNotNull(serviecProvider.GetService()); - Assert.IsNotNull(serviecProvider.GetService()); - Assert.IsNotNull(serviecProvider.GetService()); - - var customDbContext = serviecProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(customDbContext) == - serviecProvider.GetRequiredService().Local[ - "ConnectionStrings:DefaultConnection"]); - } - - [TestMethod] - public async Task TestGetConnectionStringAndCurrentDbContextOptionsAsyncReturnTest1() - { - Mock unitOfWorkAccessor = new(); - string connectionString = "Test1"; - unitOfWorkAccessor.Setup(accessor => accessor.CurrentDbContextOptions) - .Returns(new MasaDbContextConfigurationOptions(connectionString)); - var connectionStringProvider = new DefaultConnectionStringProvider(unitOfWorkAccessor.Object, null!); - Assert.IsTrue(await connectionStringProvider.GetConnectionStringAsync() == connectionString); - } - - [TestMethod] - public async Task TestGetConnectionStringAsyncReturnTest1() - { - Mock unitOfWorkAccessor = new(); - string connectionString = "Test1"; - IServiceCollection services = new ServiceCollection(); - services.Configure(options => - { - options.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = connectionString - }; - }); - var serviceProvider = services.BuildServiceProvider(); - var connectionStringProvider = new DefaultConnectionStringProvider(unitOfWorkAccessor.Object, - serviceProvider.GetRequiredService>()); - Assert.IsTrue(await connectionStringProvider.GetConnectionStringAsync() == connectionString); - } - - private string GetDataBaseConnectionString(CustomDbContext dbContext) => dbContext.Database.GetConnectionString()!; -} diff --git a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs deleted file mode 100644 index 0640ec664..000000000 --- a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Configuration; -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.Options; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Data.Sqlite; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Metadata.Builders; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System; -global using System.Threading.Tasks; diff --git a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json b/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json deleted file mode 100644 index de2c1c208..000000000 --- a/src/Contrib/Data/UoW/test/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ConnectionStrings": { - "DefaultConnection": "DataSource=:memory:" - } -} \ No newline at end of file diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs deleted file mode 100644 index bb6151953..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF; - -public static class DispatcherOptionsExtensions -{ - public static IDispatcherOptions UseRepository( - this IDispatcherOptions options) - where TDbContext : DbContext - { - if (options.Services == null) - throw new ArgumentNullException(nameof(options.Services)); - - if (options.Services.Any(service => service.ImplementationType == typeof(RepositoryProvider))) - return options; - - options.Services.AddSingleton(); - - if (options.Services.All(service => service.ServiceType != typeof(IUnitOfWork))) - throw new Exception("Please add UoW first."); - - options.Services.TryAddRepository(options.Assemblies); - return options; - } - - private class RepositoryProvider - { - - } -} diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs deleted file mode 100644 index 262255fc0..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Internal; - -internal static class LinqExtensions -{ - public static IQueryable GetQueryable(this IQueryable query, Dictionary fields) where TEntity : class - { - foreach (var field in fields) - { - query = query.GetQueryable(field.Key, field.Value); - } - return query; - } - - private static IQueryable GetQueryable(this IQueryable query, string field, object val) where TEntity : class - { - Type type = typeof(TEntity); - var parameter = Expression.Parameter(type, "entity"); - - PropertyInfo property = type.GetProperty(field)!; - Expression expProperty = Expression.Property(parameter, property.Name); - - Expression> valueLamda = () => val; - Expression expValue = Expression.Convert(valueLamda.Body, property.PropertyType); - Expression expression = Expression.Equal(expProperty, expValue); - Expression> filter = (Expression>)Expression.Lambda(expression, parameter); - return query.Where(filter); - } - - public static IQueryable OrderBy(this IQueryable query, Dictionary fields) where TEntity : class - { - var index = 0; - foreach (var field in fields) - { - if (index == 0) - query = query.OrderBy(field.Key, field.Value); - else - query = query.ThenBy(field.Key, field.Value); - index++; - } - - return query; - } - - internal static IQueryable OrderBy(this IQueryable query, string field, bool desc) where TEntity : class - { - ParameterExpression parameterExpression = Expression.Parameter(typeof(TEntity)); - Expression key = Expression.Property(parameterExpression, field); - var propertyInfo = GetPropertyInfo(typeof(TEntity), field); - var orderExpression = GetOrderExpression(typeof(TEntity), propertyInfo); - if (desc) - { - var method = typeof(Queryable).GetMethods().FirstOrDefault(m => m.Name == "OrderByDescending" && m.GetParameters().Length == 2); - var genericMethod = method!.MakeGenericMethod(typeof(TEntity), propertyInfo.PropertyType); - return (genericMethod.Invoke(null, new object[] { query, orderExpression }) as IQueryable)!; - } - else - { - var method = typeof(Queryable).GetMethods().FirstOrDefault(m => m.Name == "OrderBy" && m.GetParameters().Length == 2); - var genericMethod = method!.MakeGenericMethod(typeof(TEntity), propertyInfo.PropertyType); - return (IQueryable)genericMethod.Invoke(null, new object[] { query, orderExpression })!; - } - } - - private static IQueryable ThenBy(this IQueryable query, string field, bool desc) where T : class - { - ParameterExpression parameterExpression = Expression.Parameter(typeof(T)); - Expression key = Expression.Property(parameterExpression, field); - var propertyInfo = GetPropertyInfo(typeof(T), field); - var orderExpression = GetOrderExpression(typeof(T), propertyInfo); - if (desc) - { - var method = typeof(Queryable).GetMethods().FirstOrDefault(m => m.Name == "ThenByDescending" && m.GetParameters().Length == 2); - var genericMethod = method!.MakeGenericMethod(typeof(T), propertyInfo.PropertyType); - return (genericMethod.Invoke(null, new object[] { query, orderExpression }) as IQueryable)!; - } - else - { - var method = typeof(Queryable).GetMethods().FirstOrDefault(m => m.Name == "ThenBy" && m.GetParameters().Length == 2); - var genericMethod = method!.MakeGenericMethod(typeof(T), propertyInfo.PropertyType); - return (IQueryable)genericMethod.Invoke(null, new object[] { query, orderExpression })!; - } - } - - private static PropertyInfo GetPropertyInfo(Type entityType, string field) - => entityType.GetProperties().FirstOrDefault(p => p.Name.Equals(field, StringComparison.OrdinalIgnoreCase))!; - - private static LambdaExpression GetOrderExpression(Type entityType, PropertyInfo propertyInfo) - { - var parametersExpression = Expression.Parameter(entityType); - var fieldExpression = Expression.PropertyOrField(parametersExpression, propertyInfo.Name); - return Expression.Lambda(fieldExpression, parametersExpression); - } -} diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs deleted file mode 100644 index 2dae71cb8..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Internal; - -internal static class ServiceCollectionRepositoryExtensions -{ - public static IServiceCollection TryAddRepository( - this IServiceCollection services, - params Assembly[] assemblies) - where TDbContext : DbContext - { - if (assemblies == null || assemblies.Length == 0) - { - throw new ArgumentNullException(nameof(assemblies)); - } - - var allTypes = assemblies.SelectMany(assembly => assembly.GetTypes()).ToList(); - var entityTypes = allTypes.Where(type => type.IsEntity()); - foreach (var entityType in entityTypes) - { - var repositoryInterfaceType = typeof(IRepository<>).MakeGenericType(entityType); - services.TryAddAddDefaultRepository(repositoryInterfaceType, GetRepositoryImplementationType(typeof(TDbContext), entityType)); - services.TryAddCustomRepository(repositoryInterfaceType, allTypes); - - if (typeof(IEntity<>).IsGenericInterfaceAssignableFrom(entityType)) - { - var fieldType = entityType.GetProperty("Id")!.PropertyType; - repositoryInterfaceType = typeof(IRepository<,>).MakeGenericType(entityType, fieldType); - services.TryAddAddDefaultRepository(repositoryInterfaceType, - GetRepositoryImplementationType(typeof(TDbContext), entityType, fieldType)); - services.TryAddCustomRepository(repositoryInterfaceType, allTypes); - } - } - - return services; - } - - private static bool IsEntity(this Type type) - => type.IsClass && !type.IsGenericType && !type.IsAbstract && typeof(IEntity).IsAssignableFrom(type); - - private static void TryAddCustomRepository(this IServiceCollection services, Type repositoryInterfaceType, List allTypes) - { - var customerRepositoryInterfaceTypes = allTypes.Where(type - => type.GetInterfaces().Any(t => t == repositoryInterfaceType) && type.IsInterface && !type.IsGenericType); - foreach (var customerRepositoryInterfaceType in customerRepositoryInterfaceTypes) - { - var customerRepositoryImplementationTypes = - allTypes.Where(type => type.IsClass && customerRepositoryInterfaceType.IsAssignableFrom(type)).ToList(); - if (customerRepositoryImplementationTypes.Count != 1) - { - throw new NotSupportedException( - $"The number of types of {customerRepositoryInterfaceType.FullName} implementation classes must be 1"); - } - services.TryAddScoped(customerRepositoryInterfaceType, customerRepositoryImplementationTypes.FirstOrDefault()!); - } - } - - private static void TryAddAddDefaultRepository(this IServiceCollection services, Type repositoryInterfaceType, - Type repositoryImplementationType) - { - if (repositoryInterfaceType.IsAssignableFrom(repositoryImplementationType)) - { - services.TryAddScoped(repositoryInterfaceType, repositoryImplementationType); - } - } - - private static Type GetRepositoryImplementationType(Type dbContextType, Type entityType) - => typeof(Repository<,>).MakeGenericType(dbContextType, entityType); - - private static Type GetRepositoryImplementationType(Type dbContextType, Type entityType, Type keyType) - => typeof(Repository<,,>).MakeGenericType(dbContextType, entityType, keyType); -} diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs deleted file mode 100644 index 50746c304..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Internal; - -internal static class TypeExtensions -{ - public static bool IsConcrete(this Type type) => !type.GetTypeInfo().IsAbstract && !type.GetTypeInfo().IsInterface; - - public static bool IsGenericInterfaceAssignableFrom(this Type eventHandlerType, Type type) => - type.IsConcrete() && - type.GetInterfaces().Any(t => t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == eventHandlerType); -} diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj deleted file mode 100644 index c6cb4decf..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.md b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.md deleted file mode 100644 index 08c0f8c37..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.md +++ /dev/null @@ -1,71 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Ddd.Domain.Repository.EF - -Example: - -```c# -Install-Package Masa.Contrib.Ddd.Domain.Repository.EF -``` - -> Advantages: The EF version of IRepository provides basic CRUD - -1. Add Repository.EF - -```c# -builder.Services -.AddDomainEventBus(options => -{ - options.UseRepository();//Use the EF version of Repository to achieve -} -``` - -2. How to use - -```C# -public class ProductItem -{ - public string Name { get; set; } -} - -public class DemoService : ServiceBase -{ - public CatalogService(IServiceCollection services) : base(services) - { - - } - - public async Task CreateProduct(ProductItem product,[FromService]IRepository repository) - { - await repository.AddAsync(product); - await repository.UnitOfWork.SaveChangesAsync(); - } -} -``` - -If the method defined by IRepository is not enough to support the business, you can custom the Repository - -```C# -public interface IProductRepository : IRepository -{ - Task> ItemsWithNameAsync(string name); -} - -public class ProductRepository : Repository, IProductRepository -{ - public Task> ItemsWithNameAsync(string name) - { - //Todo - } -} -``` - -In use: - -```C# -public async Task> ItemsWithNameAsync(string name, [FromService] IProductRepository productRepository) -{ - return await productRepository.ItemsWithNameAsync(name); -} -``` - diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md deleted file mode 100644 index 4770e9e1c..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md +++ /dev/null @@ -1,71 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Ddd.Domain.Repository.EF - -用例: - -```c# -Install-Package Masa.Contrib.Ddd.Domain.Repository.EF -``` - -> 优势:IRepository的EF版实现,提供了基础的CRUD - -1. 添加Repository.EF - -```c# -builder.Services -.AddDomainEventBus(options => -{ - options.UseRepository();//使用Repository的EF版实现 -} -``` - -2. 如何使用 - -```C# -public class ProductItem -{ - public string Name { get; set; } -} - -public class DemoService : ServiceBase -{ - public CatalogService(IServiceCollection services) : base(services) - { - - } - - public async Task CreateProduct(ProductItem product,[FromService]IRepository repository) - { - await repository.AddAsync(product); - await repository.UnitOfWork.SaveChangesAsync(); - } -} -``` - -如果IRepository定义的方法不足以支撑业务,则可以自定义Repository - -```C# -public interface IProductRepository : IRepository -{ - Task> ItemsWithNameAsync(string name); -} - -public class ProductRepository : Repository, IProductRepository -{ - public Task> ItemsWithNameAsync(string name) - { - //Todo - } -} -``` - -在使用上: - -```C# -public async Task> ItemsWithNameAsync(string name, [FromService] IProductRepository productRepository) -{ - return await productRepository.ItemsWithNameAsync(name); -} -``` - diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs deleted file mode 100644 index 08d615825..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF; - -public class Repository : - BaseRepository - where TEntity : class, IEntity - where TDbContext : DbContext -{ - protected TDbContext Context { get; } - - public Repository(TDbContext context, IUnitOfWork unitOfWork) : base(unitOfWork.ServiceProvider) - { - Context = context; - UnitOfWork = unitOfWork; - } - - public override IUnitOfWork UnitOfWork { get; } - - public override EntityState EntityState - { - get => UnitOfWork.EntityState; - set - { - UnitOfWork.EntityState = value; - if (value == EntityState.Changed) - CheckAndOpenTransaction(); - } - } - - public override async ValueTask AddAsync( - TEntity entity, - CancellationToken cancellationToken = default) - { - var response = (await Context.AddAsync(entity, cancellationToken).AsTask()).Entity; - EntityState = EntityState.Changed; - return response; - } - - public override async Task AddRangeAsync( - IEnumerable entities, - CancellationToken cancellationToken = default) - { - await Context.AddRangeAsync(entities, cancellationToken); - EntityState = EntityState.Changed; - } - - public override Task FindAsync( - IEnumerable> keyValues, - CancellationToken cancellationToken = default) - { - Dictionary fields = new(keyValues); - return Context.Set().IgnoreQueryFilters().GetQueryable(fields).FirstOrDefaultAsync(cancellationToken); - } - - public override Task FindAsync( - Expression> predicate, - CancellationToken cancellationToken = default) - => Context.Set().Where(predicate).FirstOrDefaultAsync(cancellationToken); - - public override async Task GetCountAsync(CancellationToken cancellationToken = default) - => await Context.Set().LongCountAsync(cancellationToken); - - public override Task GetCountAsync( - Expression> predicate, - CancellationToken cancellationToken = default) - => Context.Set().LongCountAsync(predicate, cancellationToken); - - public override async Task> GetListAsync(CancellationToken cancellationToken = default) - => await Context.Set().ToListAsync(cancellationToken); - - public override async Task> GetListAsync(string sortField, bool isDescending = true, - CancellationToken cancellationToken = default) - => await Context.Set().OrderBy(sortField, isDescending).ToListAsync(cancellationToken); - - public override async Task> GetListAsync( - Expression> predicate, - CancellationToken cancellationToken = default) - => await Context.Set().Where(predicate).ToListAsync(cancellationToken); - - public override async Task> GetListAsync( - Expression> predicate, - string sortField, - bool isDescending = true, - CancellationToken cancellationToken = default) - => await Context.Set().OrderBy(sortField, isDescending).Where(predicate).ToListAsync(cancellationToken); - - /// - /// Get a paginated list after sorting according to skip and take - /// - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Sort field name - /// true descending order, false ascending order, default: true - /// - /// - public override Task> GetPaginatedListAsync(int skip, int take, string sortField, bool isDescending, - CancellationToken cancellationToken = default) - => Context.Set().OrderBy(sortField, isDescending).Skip(skip).Take(take).ToListAsync(cancellationToken); - - /// - /// Get a paginated list after sorting according to skip and take - /// - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Key: sort field name, Value: true descending order, false ascending order - /// - /// - public override Task> GetPaginatedListAsync( - int skip, - int take, - Dictionary? sorting = null, - CancellationToken cancellationToken = default) - { - sorting ??= new Dictionary(); - - return Context.Set().OrderBy(sorting).Skip(skip).Take(take).ToListAsync(cancellationToken); - } - - /// - /// Get a paginated list after sorting by condition - /// - /// A function to test each element for a condition - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Sort field name - /// true descending order, false ascending order, default: true - /// - /// - public override Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, - string sortField, - bool isDescending = true, CancellationToken cancellationToken = default) - => Context.Set().Where(predicate).OrderBy(sortField, isDescending).Skip(skip).Take(take).ToListAsync(cancellationToken); - - /// - /// Get a paginated list after sorting by condition - /// - /// A function to test each element for a condition - /// The number of elements to skip before returning the remaining elements - /// The number of elements to return - /// Key: sort field name, Value: true descending order, false ascending order - /// - /// - public override Task> GetPaginatedListAsync( - Expression> predicate, - int skip, - int take, - Dictionary? sorting = null, - CancellationToken cancellationToken = default) - { - sorting ??= new Dictionary(); - - return Context.Set().Where(predicate).OrderBy(sorting).Skip(skip).Take(take).ToListAsync(cancellationToken); - } - - public override Task RemoveAsync(TEntity entity, CancellationToken cancellationToken = default) - { - Context.Set().Remove(entity); - EntityState = EntityState.Changed; - return Task.FromResult(entity); - } - - public override async Task RemoveAsync(Expression> predicate, CancellationToken cancellationToken = default) - { - var entities = await GetListAsync(predicate, cancellationToken); - EntityState = EntityState.Changed; - Context.Set().RemoveRange(entities); - } - - public override Task RemoveRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) - { - Context.Set().RemoveRange(entities); - EntityState = EntityState.Changed; - return Task.CompletedTask; - } - - public override Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default) - { - Context.Set().Update(entity); - EntityState = EntityState.Changed; - return Task.FromResult(entity); - } - - public override Task UpdateRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) - { - Context.Set().UpdateRange(entities); - EntityState = EntityState.Changed; - return Task.CompletedTask; - } - - /// - /// When additions, deletions and changes are made through the Repository and the transaction is currently allowed and the transaction is not opened, the transaction is started - /// - private void CheckAndOpenTransaction() - { - if (!UnitOfWork.UseTransaction) - return; - - if (!UnitOfWork.TransactionHasBegun) - { - _ = UnitOfWork.Transaction; // Open the transaction - } - CommitState = CommitState.UnCommited; - } -} - -public class Repository : - Repository, - IRepository - where TEntity : class, IEntity - where TDbContext : DbContext - where TKey : IComparable -{ - public Repository(TDbContext context, IUnitOfWork unitOfWork) : base(context, unitOfWork) - { - } - - public virtual Task FindAsync(TKey id, CancellationToken cancellationToken = default) - => Context.Set().FirstOrDefaultAsync(entity => entity.Id.Equals(id), cancellationToken); - - public virtual Task RemoveAsync(TKey id, CancellationToken cancellationToken = default) - => base.RemoveAsync(entity => entity.Id.Equals(id), cancellationToken); - - public virtual Task RemoveRangeAsync(IEnumerable ids, CancellationToken cancellationToken = default) - => base.RemoveAsync(entity => ids.Contains(entity.Id), cancellationToken); -} diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs deleted file mode 100644 index 5fea19f73..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Ddd.Domain.Repository.EF.Internal; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Storage; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using System.Data.Common; -global using System.Linq.Expressions; -global using System.Reflection; -global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; -global using System.Runtime.CompilerServices; diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainEventBus.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainEventBus.cs deleted file mode 100644 index fa7ac6dc7..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainEventBus.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain; - -public class DomainEventBus : IDomainEventBus -{ - private readonly IEventBus _eventBus; - private readonly IIntegrationEventBus _integrationEventBus; - private readonly IUnitOfWork _unitOfWork; - private readonly DispatcherOptions _options; - - private readonly ConcurrentQueue _eventQueue = new(); - - public DomainEventBus( - IEventBus eventBus, - IIntegrationEventBus integrationEventBus, - IUnitOfWork unitOfWork, - IOptions options) - { - _eventBus = eventBus; - _integrationEventBus = integrationEventBus; - _unitOfWork = unitOfWork; - _options = options.Value; - } - - public async Task PublishAsync(TEvent @event) where TEvent : IEvent - { - if (@event is IDomainEvent domainEvent && !IsAssignableFromDomainQuery(@event.GetType())) - { - domainEvent.UnitOfWork = _unitOfWork; - } - if (@event is IIntegrationEvent integrationEvent) - { - integrationEvent.UnitOfWork ??= _unitOfWork; - await _integrationEventBus.PublishAsync(integrationEvent); - } - else - { - await _eventBus.PublishAsync(@event); - } - - bool IsAssignableFromDomainQuery(Type? type) - { - if (type == null) - return false; - - if (!type.IsGenericType) - { - return IsAssignableFromDomainQuery(type.BaseType); - } - return type.GetInterfaces().Any(type => type.GetGenericTypeDefinition() == typeof(IDomainQuery<>)); - } - } - - public Task Enqueue(TDomainEvent @event) where TDomainEvent : IDomainEvent - { - _eventQueue.Enqueue(@event); - return Task.CompletedTask; - } - - public async Task PublishQueueAsync() - { - while (_eventQueue.TryDequeue(out IDomainEvent? @event)) - { - await PublishAsync(@event); - } - } - - public Task AnyQueueAsync() - { - return Task.FromResult(_eventQueue.Count > 0); - } - - public async Task CommitAsync(CancellationToken cancellationToken = default) - => await _unitOfWork.CommitAsync(cancellationToken); - - public IEnumerable GetAllEventTypes() => _options.AllEventTypes.Concat(_eventBus.GetAllEventTypes()).Distinct(); -} diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainService.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainService.cs deleted file mode 100644 index 488f0c13a..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/DomainService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain; - -public class DomainService : IDomainService -{ - public IDomainEventBus EventBus { get; } - - public DomainService(IDomainEventBus eventBus) => EventBus = eventBus; -} diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj deleted file mode 100644 index 98b48f536..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs deleted file mode 100644 index 576290ace..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Options; - -public class DispatcherOptions : IDistributedDispatcherOptions -{ - public IServiceCollection Services { get; } - - public Assembly[] Assemblies { get; } - - private bool IsAggregateRootEntity(Type type) - => type.IsClass && !type.IsGenericType && !type.IsAbstract && type != typeof(AggregateRoot) && - typeof(IAggregateRoot).IsAssignableFrom(type); - - private IEnumerable Types { get; set; } - - private IEnumerable GetTypes(Type type) => Types.Where(t => t.IsClass && type.IsAssignableFrom(t)); - - internal List AllEventTypes { get; private set; } - - internal List AllDomainServiceTypes { get; private set; } - - internal List AllAggregateRootTypes { get; private set; } - - private DispatcherOptions(IServiceCollection services) => Services = services; - - public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) - : this(services) - { - if (assemblies == null || assemblies.Length == 0) - throw new ArgumentException(nameof(assemblies)); - - Assemblies = assemblies; - Types = assemblies.SelectMany(assembly => assembly.GetTypes()); - AllEventTypes = GetTypes(typeof(IEvent)).ToList(); - AllDomainServiceTypes = GetTypes(typeof(DomainService)).ToList(); - AllAggregateRootTypes = GetTypes(typeof(IAggregateRoot)).Where(IsAggregateRootEntity).ToList(); - } -} diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.md b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.md deleted file mode 100644 index 673abbee7..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.md +++ /dev/null @@ -1,125 +0,0 @@ -[中](README.zh-CN.md) | EN - -### DomainEventBus - -Example: - -```c# -Install-Package Masa.Contrib.Ddd.Domain -Install-Package Masa.Contrib.Ddd.Domain.Repository.EF - -Install-Package Masa.Contrib.Dispatcher.Events - -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF -Install-Package Masa.Contrib.Data.UoW.EF -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. Add DomainEventBus - -```C# -builder.Services -.AddDomainEventBus(options => -{ - options.UseIntegrationEventBus(opt => - { - opt.UseDapr(); - opt.UseEventLog();//Use cross-process events - }); - options - // .UseEventBus(eventBuilder => eventBuilder.UseMiddleware(typeof(ValidatorMiddleware<>))) // Use in-process events and use middleware - .UseEventBus() // Use in-process events - .UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=idientity")) - .UseRepository();//Use the EF version of Repository to achieve -}) -``` - -2. Add DomainCommand - -```C# -public class RegisterUserDomainCommand : DomainCommand -{ - public string User { get; set; } = default!; - - public string Password { get; set; } = default!; - - public string PhoneNumber { get; set; } = default!; -} -``` -> DomainQuery refers to Query in Cqrs - -3. Add Handler (in process) - -```C# -public class UserHandler -{ - [EventHandler] - public Task RegisterUserHandlerAsync(RegisterUserDomainCommand command) - { - //TODO Registered user business - } -} -``` - -4. Send DomainCommand - -```C# -IDomainEventBus eventBus;//Get IDomainEventBus through DI -await eventBus.PublishAsync(new RegisterUserDomainCommand());//Send DomainCommand -``` - -5. Define domain events - -```C# -public class RegisterUserSucceededIntegrationEvent : IntegrationDomainEvent -{ - public override string Topic { get; set; } = nameof(RegisterUserSucceededIntegrationEvent); - - public string Account { get; set; } = default!; -} - -public class RegisterUserSucceededEvent : DomainEvent -{ - public string Account { get; set; } = default!; -} -``` - -6. Define domain services - -```C# -public class UserDomainService : DomainService -{ - public UserDomainService(IDomainEventBus eventBus) : base(eventBus) - { - } - - public async Task RegisterSucceededAsync(string account) - { - await EventBus.Enqueue(new RegisterUserSucceededIntegrationEvent() { Account = account }); - await EventBus.Enqueue(new RegisterUserSucceededEvent() { Account = account }); - await EventBus.PublishQueueAsync(); - } -} -``` - -> DomainEvent (in-process) and IntegrationDomainEvent (cross-process) can be inherited as needed -> -> If you only need to send a domain event, you can directly use EventBus.PublishQueueAsync(new RegisterUserSucceededEvent()) -> -> If you want to send in a unified way, you can send it through EventBus.Enqueue() and finally call EventBus.PublishQueueAsync() - -Tip: - -> 1. The use of DomainEventBus must require the implementation of IEventBus and IIntegrationEventBus and IUnitOfWork -> 2. EventBus only supports in-process scheduling, cross-process scheduling is not supported, and the sending order is consistent with the enqueue order, but the actual execution order is unknown - -7. Cross-process event subscription - -```C# -[Topic("pubsub", nameof(RegisterUserSucceededIntegrationEvent))] -public async Task RegisterUserSucceededHandlerAsync(RegisterUserSucceededIntegrationEvent @event) -{ - //todo -} -``` diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.zh-CN.md b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.zh-CN.md deleted file mode 100644 index f8af90b57..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/README.zh-CN.md +++ /dev/null @@ -1,125 +0,0 @@ -中 | [EN](README.md) - -### DomainEventBus - -用例: - -```c# -Install-Package Masa.Contrib.Ddd.Domain -Install-Package Masa.Contrib.Ddd.Domain.Repository.EF - -Install-Package Masa.Contrib.Dispatcher.Events - -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF -Install-Package Masa.Contrib.Data.UoW.EF -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. 添加DomainEventBus - -```C# -builder.Services -.AddDomainEventBus(options => -{ - options.UseIntegrationEventBus(opt => - { - opt.UseDapr(); - opt.UseEventLog();//使用跨进程事件 - }); - options - // .UseEventBus(eventBuilder => eventBuilder.UseMiddleware(typeof(ValidatorMiddleware<>))) // 使用进程内事件并使用中间件 - .UseEventBus()//使用进程内事件 - .UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=idientity")) - .UseRepository();//使用Repository的EF版实现 -}) -``` - -2. 添加DomainCommand - -```C# -public class RegisterUserDomainCommand : DomainCommand -{ - public string User { get; set; } = default!; - - public string Password { get; set; } = default!; - - public string PhoneNumber { get; set; } = default!; -} -``` -> DomainQuery参考Cqrs中的Query - -3. 添加Handler(进程内) - -```C# -public class UserHandler -{ - [EventHandler] - public Task RegisterUserHandlerAsync(RegisterUserDomainCommand command) - { - //TODO 注册用户业务 - } -} -``` - -4. 发送DomainCommand - -```C# -IDomainEventBus eventBus;//通过DI得到IDomainEventBus -await eventBus.PublishAsync(new RegisterUserDomainCommand());//发送DomainCommand -``` - -5. 定义领域事件 - -```C# -public class RegisterUserSucceededIntegrationEvent : IntegrationDomainEvent -{ - public override string Topic { get; set; } = nameof(RegisterUserSucceededIntegrationEvent); - - public string Account { get; set; } = default!; -} - -public class RegisterUserSucceededEvent : DomainEvent -{ - public string Account { get; set; } = default!; -} -``` - -6. 定义领域服务 - -```C# -public class UserDomainService : DomainService -{ - public UserDomainService(IDomainEventBus eventBus) : base(eventBus) - { - } - - public async Task RegisterSucceededAsync(string account) - { - await EventBus.Enqueue(new RegisterUserSucceededIntegrationEvent() { Account = account }); - await EventBus.Enqueue(new RegisterUserSucceededEvent() { Account = account }); - await EventBus.PublishQueueAsync(); - } -} -``` - -> 可根据需要继承DomainEvent(进程内)、IntegrationDomainEvent(跨进程) -> -> 如果只需要发送一个领域事件,则可以直接使用EventBus.PublishQueueAsync(new RegisterUserSucceededEvent())即可 -> -> 如果希望统一发送,则可以通过EventBus.Enqueue()、最后调用EventBus.PublishQueueAsync()发送 - -提示: - -> 1. 使用DomainEventBus必须要求实现IEventBus以及IIntegrationEventBus以及IUnitOfWork -> 2. EventBus只支持进程内编排、跨进程不支持编排,发送顺序与入队顺序一致,但实际执行顺序未知 - -7. 跨进程事件订阅 - -```C# -[Topic("pubsub", nameof(RegisterUserSucceededIntegrationEvent))] -public async Task RegisterUserSucceededHandlerAsync(RegisterUserSucceededIntegrationEvent @event) -{ - //todo -} -``` diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs deleted file mode 100644 index 38a459fc6..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddDomainEventBus( - this IServiceCollection services, - Action? options = null) - => services.AddDomainEventBus(AppDomain.CurrentDomain.GetAssemblies(), options); - - public static IServiceCollection AddDomainEventBus( - this IServiceCollection services, - Assembly[] assemblies, - Action? options = null) - { - if (services.Any(service => service.ImplementationType == typeof(DomainEventBusProvider))) - return services; - - services.AddSingleton(); - - var dispatcherOptions = new DispatcherOptions(services, assemblies); - options?.Invoke(dispatcherOptions); - services.AddSingleton(typeof(IOptions), _ => Microsoft.Extensions.Options.Options.Create(dispatcherOptions)); - - if (services.All(service => service.ServiceType != typeof(IEventBus))) - throw new Exception("Please add EventBus first."); - - if (services.All(service => service.ServiceType != typeof(IUnitOfWork))) - throw new Exception("Please add UoW first."); - - if (services.All(service => service.ServiceType != typeof(IIntegrationEventBus))) - throw new Exception("Please add IntegrationEventBus first."); - - services.CheckAggregateRootRepositories(dispatcherOptions.AllAggregateRootTypes); - - foreach (var domainServiceType in dispatcherOptions.AllDomainServiceTypes) - { - services.TryAddScoped(domainServiceType); - } - - services.TryAddScoped(); - services.TryAddScoped(); - return services; - } - - private static void CheckAggregateRootRepositories(this IServiceCollection services, List aggregateRootRepositoryTypes) - { - foreach (var aggregateRootRepositoryType in aggregateRootRepositoryTypes) - { - var serviceType = GetServiceRepositoryType(aggregateRootRepositoryType); - if (services.All(service => service.ServiceType != serviceType)) - throw new NotImplementedException($"The number of types of {serviceType.FullName} implementation class must be 1."); - } - } - - private static Type GetServiceRepositoryType(Type entityType) => typeof(IRepository<>).MakeGenericType(entityType); - - private class DomainEventBusProvider - { - - } -} diff --git a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/_Imports.cs b/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/_Imports.cs deleted file mode 100644 index 67bae5cf5..000000000 --- a/src/Contrib/Ddd/Domain/src/Masa.Contrib.Ddd.Domain/_Imports.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.BuildingBlocks.Ddd.Domain.Services; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Ddd.Domain; -global using Masa.Contrib.Ddd.Domain.Options; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Options; -global using System.Collections.Concurrent; -global using System.Reflection; diff --git a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs deleted file mode 100644 index 174a0114d..000000000 --- a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; - -public class Address : ValueObject -{ - public string Street { get; set; } - - public string City { get; set; } - - public string State { get; set; } - - public string Country { get; set; } - - public string ZipCode { get; set; } - - protected override IEnumerable GetEqualityValues() - { - yield return Street; - yield return City; - yield return State; - yield return Country; - yield return ZipCode; - } -} diff --git a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs deleted file mode 100644 index 0ce6f25bd..000000000 --- a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; - -public class OrderItem : Entity -{ - public Guid OrderId { get; set; } - - public int ProductId { get; set; } - - public string ProductName { get; set; } - - public decimal UnitPrice { get; set; } - - public int Units { get; set; } - - public string PictureUrl { get; set; } -} diff --git a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs deleted file mode 100644 index 9660fdbe6..000000000 --- a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; - -public class Orders : AuditAggregateRoot -{ - public int OrderNumber { get; set; } - - public DateTime OrderDate { get; private set; } - - public string OrderStatus { get; private set; } - - public string Description { get; set; } = default!; - - public List OrderItems { get; set; } - - public Orders(int id) - { - this.OrderDate = DateTime.UtcNow; - this.OrderItems = new(); - this.OrderStatus = "Submitted"; - base.Id = id; - } - - /// - /// Joint primary key, when this method does not exist, the primary key is Id - /// - /// - public override IEnumerable<(string Name, object Value)> GetKeys() - { - return new List<(string Name, object value)> - { - ("Id", Id), - ("OrderNumber", OrderNumber) - }; - } -} diff --git a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj deleted file mode 100644 index 9d6058b55..000000000 --- a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - diff --git a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs deleted file mode 100644 index 5c71a7669..000000000 --- a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests; - -[TestClass] -public class RepositoryTest -{ - [TestInitialize] - public void Initialize() - { - } - - [TestMethod] - public async Task TestAddRangeReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.AddRangeAsync(It.IsAny(), default)) - .Verifiable(); - - Mock unitOfWork = new(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - - var orders = new List() - { - new(9999) - }; - await repository.AddRangeAsync(orders); - dbContext.Verify(context => context.AddRangeAsync(It.IsAny>(), default), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); - } - - [TestMethod] - public async Task TestAddRangeAndUseTransactionReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.AddRangeAsync(It.IsAny(), default)) - .Verifiable(); - - Mock unitOfWork = new(); - unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - Assert.IsTrue(repository.UnitOfWork.UseTransaction); - - var orders = new List() - { - new(9999) - }; - await repository.AddRangeAsync(orders); - dbContext.Verify(context => context.AddRangeAsync(It.IsAny>(), default), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); - } - - [TestMethod] - public async Task TestUpdateRangeReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.Set().UpdateRange(It.IsAny>())) - .Verifiable(); - - Mock unitOfWork = new(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - - var orders = new List() - { - new(9999) - }; - await repository.UpdateRangeAsync(orders); - dbContext.Verify(context => context.Set().UpdateRange(It.IsAny>()), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); - } - - [TestMethod] - public async Task TestUpdateRangeAndUseTransactionReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.Set().UpdateRange(It.IsAny>())) - .Verifiable(); - - Mock unitOfWork = new(); - unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - Assert.IsTrue(repository.UnitOfWork.UseTransaction); - - var orders = new List() - { - new(9999) - }; - await repository.UpdateRangeAsync(orders); - dbContext.Verify(context => context.Set().UpdateRange(It.IsAny>()), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); - } - - [TestMethod] - public async Task TestUpdateReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.Set().Update(It.IsAny())) - .Verifiable(); - - Mock unitOfWork = new(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - - var order = new Orders(999); - await repository.UpdateAsync(order); - dbContext.Verify(context => context.Set().Update(It.IsAny()), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); - } - - [TestMethod] - public async Task TestUpdateAndUseTransactionReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.Set().Update(It.IsAny())) - .Verifiable(); - - Mock unitOfWork = new(); - unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - Assert.IsTrue(repository.UnitOfWork.UseTransaction); - - var order = new Orders(999); - await repository.UpdateAsync(order); - dbContext.Verify(context => context.Set().Update(It.IsAny()), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); - } - - [TestMethod] - public async Task TestRemoveRangeReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.Set().RemoveRange(It.IsAny>())) - .Verifiable(); - - Mock unitOfWork = new(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - - var orders = new List() - { - new(9999) - }; - await repository.RemoveRangeAsync(orders); - dbContext.Verify(context => context.Set().RemoveRange(It.IsAny>()), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); - } - - [TestMethod] - public async Task TestRemoveRangeAndUseTransactionReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.Set().RemoveRange(It.IsAny>())) - .Verifiable(); - - Mock unitOfWork = new(); - unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - Assert.IsTrue(repository.UnitOfWork.UseTransaction); - - var orders = new List() - { - new(9999) - }; - await repository.RemoveRangeAsync(orders); - dbContext.Verify(context => context.Set().RemoveRange(It.IsAny>()), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); - } - - - [TestMethod] - public async Task TestRemoveReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.Set().Remove(It.IsAny())) - .Verifiable(); - - Mock unitOfWork = new(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - - var order = new Orders(999); - await repository.RemoveAsync(order); - dbContext.Verify(context => context.Set().Remove(It.IsAny()), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); - } - - [TestMethod] - public async Task TestRemoveAndUseTransactionReturnEntityStateEqualChangedAsync() - { - Mock dbContext = new(); - dbContext - .Setup(context => context.Set().Remove(It.IsAny())) - .Verifiable(); - - Mock unitOfWork = new(); - unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); - var repository = new Repository(dbContext.Object, unitOfWork.Object); - Assert.IsTrue(repository.EntityState == EntityState.UnChanged); - Assert.IsTrue(repository.UnitOfWork.UseTransaction); - - var order = new Orders(999); - await repository.RemoveAsync(order); - dbContext.Verify(context => context.Set().Remove(It.IsAny()), Times.Once); - unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); - unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); - } -} diff --git a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs b/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs deleted file mode 100644 index 74b5a26bc..000000000 --- a/src/Contrib/Ddd/Domain/test/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System; -global using System.Collections.Generic; -global using System.Linq; -global using System.Reflection; -global using Microsoft.EntityFrameworkCore; -global using Moq; -global using Masa.BuildingBlocks.Ddd.Domain.Entities; -global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; -global using Masa.BuildingBlocks.Ddd.Domain.Values; -global using Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; -global using Masa.BuildingBlocks.Data.UoW; -global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; diff --git a/src/Contrib/Dispatcher/Events/docs/LoadEvent.md b/src/Contrib/Dispatcher/Events/docs/LoadEvent.md deleted file mode 100644 index 65d1db9e3..000000000 --- a/src/Contrib/Dispatcher/Events/docs/LoadEvent.md +++ /dev/null @@ -1,10 +0,0 @@ -# LoadEvent - -## Getting "Event" relationship chain failed - -When Event, EventHandler, and the main project are not in the same assembly, there will be a failure to obtain the "Event" relationship chain when publishing Events through EventBus. When we use AddEventBus without a special specified assembly, the assembly under the current domain is used by default. Due to the delayed loading feature of dotnet, the acquisition of the event relationship chain is incomplete. There are the following two solutions : - -1. When using AddEventBus, specify the complete set of application assemblies used by the current project by specifying Assemblies - -2. Before using AddEventBus, by calling Event directly -Any method or class of the assembly where the EventHandler is located, make sure that the application assembly where it is located has been loaded into the current assembly ( AppDomain.CurrentDomain.GetAssemblies() ) diff --git a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs deleted file mode 100644 index b09f5a7cd..000000000 --- a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Benchmarks; - -[MarkdownExporter, AsciiDocExporter, HtmlExporter] -[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100)] -[MinColumn, MaxColumn, MeanColumn, MedianColumn] -public class Benchmarks -{ - private RegisterUserEvent _userEvent; - private AddShoppingCartEvent _shoppingCartEvent; - private IServiceProvider _serviceProvider; - private IEventBus _eventBus; - private IMediator _mediator; - - [GlobalSetup] - public void GlobalSetup() - { - IServiceCollection services = new ServiceCollection(); - services.AddLogging(loggingBuilder => loggingBuilder.ClearProviders()); - services.AddMediatR(typeof(Benchmarks)); - services.AddEventBus(); - _serviceProvider = services.BuildServiceProvider(); - _eventBus = _serviceProvider.GetRequiredService(); - _mediator = _serviceProvider.GetRequiredService(); - _userEvent = new RegisterUserEvent() - { - Name = "tom", - PhoneNumber = "18888888888" - }; - _shoppingCartEvent = new AddShoppingCartEvent() - { - Count = 1, - GoodsId = "Microsoft" - }; - } - - [Benchmark(Baseline = true)] - public async Task SendCouponByDirect() - { - var _couponHandler = new CouponHandler(_serviceProvider); - await _couponHandler.SendCoupon(_userEvent); - await _couponHandler.SendNotice(_userEvent); - } - - [Benchmark] - public async Task SendCouponByEventBus() - { - await _eventBus.PublishAsync(_userEvent); - } - - [Benchmark] - public async Task AddShoppingCartByEventBusAsync() - { - await _eventBus.PublishAsync(_shoppingCartEvent); - } - - [Benchmark] - public async Task AddShoppingCartByMediatRAsync() - { - await _mediator.Send(_shoppingCartEvent); - } -} diff --git a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs deleted file mode 100644 index b788ac541..000000000 --- a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; - -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; - -public class AddShoppingCartEventHandler : IRequestHandler -{ - [EventHandler] - public Task AddShoppingCartAsync(AddShoppingCartEvent @event) - => Task.CompletedTask; - - public Task Handle(AddShoppingCartEvent request, CancellationToken cancellationToken) - => Unit.Task; -} diff --git a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs deleted file mode 100644 index 87c019e6e..000000000 --- a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; - -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; - -public class CouponHandler -{ - private readonly ILogger? _logger; - - public CouponHandler(IServiceProvider serviceProvider) => _logger = serviceProvider.GetService>(); - - [EventHandler(Order = 10, FailureLevels = FailureLevels.ThrowAndCancel)] - public Task SendCoupon(RegisterUserEvent @event) - { - _logger?.LogInformation("------Send Coupon------"); - - var num = new Random().Next(1, 3); - if (num % 2 == 0) - { - //throw new Exception("Failed to send coupons"); - } - - return Task.CompletedTask; - } - - [EventHandler(Order = 20, FailureLevels = FailureLevels.Ignore)] - public Task SendNotice(RegisterUserEvent @event) - { - _logger?.LogInformation("------Send Coupon------"); - - var num = new Random().Next(1, 3); - if (num % 2 == 0) - { - //throw new Exception("Failed to send coupons"); - } - - return Task.CompletedTask; - } - - [EventHandler(Order = 10, RetryTimes = 5, IsCancel = true)] - public Task CancelSendCoupon(RegisterUserEvent @event) - { - _logger?.LogInformation("------Cancel Send Coupon------"); - - var num = new Random().Next(1, 3); - if (num % 2 == 0) - { - //throw new Exception("Failed to cancel send coupons"); - } - - return Task.CompletedTask; - } -} diff --git a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs deleted file mode 100644 index 4b92d5b9d..000000000 --- a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; - -public record AddShoppingCartEvent : Event, IRequest -{ - public string GoodsId { get; set; } - - public int Count { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs deleted file mode 100644 index c3c720563..000000000 --- a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; - -public record RegisterUserEvent : Event -{ - public string Name { get; set; } - - public string PhoneNumber { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs deleted file mode 100644 index 9aed0a5bf..000000000 --- a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Middleware; - -public class LoggingMiddleware : Middleware where TEvent : notnull, IEvent -{ - private readonly ILogger>? _logger; - public LoggingMiddleware(ILogger>? logger = null) => _logger = logger; - - public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) - { - var eventType = @event.GetType(); - _logger?.LogInformation("----- Handling command {CommandName} ({@Command})", eventType.FullName, @event); - - await next(); - } -} diff --git a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj deleted file mode 100644 index a3e75aa23..000000000 --- a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - Exe - net6.0 - AnyCPU - false - enable - false - enable - - - - - - - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs deleted file mode 100644 index e1b4af502..000000000 --- a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Benchmarks; - -class Program -{ - static void Main(string[] args) - { - var config = DefaultConfig.Instance - .AddValidator(ExecutionValidator.FailOnError) - .WithOptions(ConfigOptions.DisableOptimizationsValidator); - BenchmarkRunner.Run(config); - - Console.ReadLine(); - } -} diff --git a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs b/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs deleted file mode 100644 index cb2ba6dbc..000000000 --- a/src/Contrib/Dispatcher/Events/perf/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using BenchmarkDotNet.Attributes; -global using BenchmarkDotNet.Configs; -global using BenchmarkDotNet.Engines; -global using BenchmarkDotNet.Jobs; -global using BenchmarkDotNet.Running; -global using BenchmarkDotNet.Validators; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; -global using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; -global using Masa.Contrib.Dispatcher.Events.Enums; -global using MediatR; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; -global using System; -global using System.Threading.Tasks; diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs deleted file mode 100644 index ca2d8a69e..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events; - -public class DefaultExceptionStrategyProvider : IExceptionStrategyProvider -{ - private readonly ILogger? _logger; - - public DefaultExceptionStrategyProvider(ILogger? logger = null) - => _logger = logger; - - /// - /// Default UserFriendlyException does not support retry - /// - /// - /// - public bool SupportRetry(Exception? exception) - { - return exception is not UserFriendlyException; - } - - public void LogWrite(LogLevel logLevel, Exception? exception, string? message, params object?[] args) - { - if (exception is not UserFriendlyException) - _logger?.Log(logLevel, exception, message, args); - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs deleted file mode 100644 index 4393028a0..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events; - -public static class DispatcherOptionsExtensions -{ - public static IDispatcherOptions UseEventBus( - this IDispatcherOptions options) - => options.UseEventBus(ServiceLifetime.Scoped); - - public static IDispatcherOptions UseEventBus( - this IDispatcherOptions options, - Action eventBusBuilder) - => options.UseEventBus(eventBusBuilder, ServiceLifetime.Scoped); - - public static IDispatcherOptions UseEventBus( - this IDispatcherOptions options, - ServiceLifetime lifetime) - => options.UseEventBus(null, lifetime); - - public static IDispatcherOptions UseEventBus( - this IDispatcherOptions options, - Action? eventBusBuilder, - ServiceLifetime lifetime) - { - ArgumentNullException.ThrowIfNull(options.Services, nameof(options.Services)); - - options.Services.AddEventBus(options.Assemblies, lifetime, eventBusBuilder); - return options; - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs deleted file mode 100644 index 2dadcc33f..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Enums; - -public enum FailureLevels -{ - Throw = 1, - - ThrowAndCancel, - - Ignore -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBus.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBus.cs deleted file mode 100644 index 6edf6115b..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBus.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events; - -public class EventBus : IEventBus -{ - private readonly IServiceProvider _serviceProvider; - - private readonly Internal.Dispatch.Dispatcher _dispatcher; - - private readonly DispatcherOptions _options; - - private readonly IUnitOfWork? _unitOfWork; - - private readonly string LoadEventHelpLink = "https://github.com/masastack/Masa.Contrib/tree/main/docs/LoadEvent.md"; - - public readonly IInitializeServiceProvider _initializeServiceProvider; - - public EventBus(IServiceProvider serviceProvider, - IOptions options, - IInitializeServiceProvider initializeServiceProvider, - IUnitOfWork? unitOfWork = null) - { - _serviceProvider = serviceProvider; - _dispatcher = serviceProvider.GetRequiredService(); - _options = options.Value; - _initializeServiceProvider = initializeServiceProvider; - _unitOfWork = unitOfWork; - } - - public async Task PublishAsync(TEvent @event) where TEvent : IEvent - { - ArgumentNullException.ThrowIfNull(@event, nameof(@event)); - var eventType = @event.GetType(); - - var middlewares = _serviceProvider.GetRequiredService>>(); - if (!_options.UnitOfWorkRelation.ContainsKey(eventType)) - { - throw new NotSupportedException( - $"Getting \"{eventType.Name}\" relationship chain failed, see {LoadEventHelpLink} for details. "); - } - - if (_options.UnitOfWorkRelation[eventType]) - { - ITransaction transactionEvent = (ITransaction)@event; - transactionEvent.UnitOfWork = _unitOfWork; - } - - if (_initializeServiceProvider.IsInitialize) - middlewares = middlewares.Where(middleware => middleware.SupportRecursive); - - _initializeServiceProvider.Initialize(); - - EventHandlerDelegate eventHandlerDelegate = async () => - { - await _dispatcher.PublishEventAsync(_serviceProvider, @event); - }; - await middlewares.Reverse().Aggregate(eventHandlerDelegate, (next, middleware) => () => middleware.HandleAsync(@event, next))(); - } - - public IEnumerable GetAllEventTypes() => _options.AllEventTypes; - - public async Task CommitAsync(CancellationToken cancellationToken = default) - { - if (_unitOfWork is null) - throw new ArgumentNullException("You need to UseUoW when adding services"); - - await _unitOfWork.CommitAsync(cancellationToken); - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs deleted file mode 100644 index fc00ed4c0..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events; - -public class EventBusBuilder : IEventBusBuilder -{ - public IServiceCollection Services { get; } - - public EventBusBuilder(IServiceCollection services) => Services = services; - - public IEventBusBuilder UseMiddleware(Type middleware, ServiceLifetime middlewareLifetime = ServiceLifetime.Transient) - { - if (!typeof(IMiddleware<>).IsGenericInterfaceAssignableFrom(middleware)) - throw new ArgumentException($"{middleware.Name} doesn't implement IMiddleware<>"); - - var descriptor = new ServiceDescriptor(typeof(IMiddleware<>), middleware, middlewareLifetime); - Services.TryAddEnumerable(descriptor); - return this; - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs deleted file mode 100644 index f975bc9da..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events; - -[AttributeUsage(AttributeTargets.Method)] -public class EventHandlerAttribute : Attribute -{ - public EventHandlerAttribute() : this(DefaultOrder) - { - } - - public EventHandlerAttribute(int order) : this(order, false) - { - - } - - public EventHandlerAttribute(int order, bool enableRetry) : this(order, enableRetry, enableRetry ? DefaultRetryCount : 0) - { - - } - - public EventHandlerAttribute(int order, FailureLevels failureLevels) : this(order, failureLevels, false) - { - - } - - public EventHandlerAttribute(int order, bool enableRetry, int retryTimes) : this(order, FailureLevels.Throw, enableRetry, retryTimes) - { - - } - - public EventHandlerAttribute(int order, bool enableRetry, bool isCancel) : this(order, enableRetry, isCancel, - enableRetry ? DefaultRetryCount : 0) - { - - } - - public EventHandlerAttribute(int order, bool enableRetry, bool isCancel, int retryTimes) : this(order, FailureLevels.Throw, enableRetry, - retryTimes, isCancel) - { - - } - - public EventHandlerAttribute(int order, FailureLevels failureLevels, bool enableRetry) : this(order, failureLevels, enableRetry, - enableRetry ? DefaultRetryCount : 0) - { - - } - - public EventHandlerAttribute(int order, FailureLevels failureLevels, bool enableRetry, bool isCancel) : this(order, failureLevels, - enableRetry, enableRetry ? DefaultRetryCount : 0, isCancel) - { - - } - - public EventHandlerAttribute(int order, FailureLevels failureLevels, bool enableRetry, int retryTimes, bool isCancel = false) - { - Order = order; - FailureLevels = failureLevels; - EnableRetry = enableRetry; - RetryTimes = enableRetry ? retryTimes : 0; - IsCancel = isCancel; - } - - /// - /// The default number of retry attempts. - /// - private const int DefaultRetryCount = 3; - - private const int DefaultOrder = int.MaxValue; - - private int _order; - - /// - /// Used to control the order in which methods are executed, in ascending order. default is int.MaxValue - /// Must be greater than or equal to 0 - /// - public int Order - { - get => _order; - set - { - if (value < 0) - throw new ArgumentOutOfRangeException("The order must be greater than or equal to 0"); - - _order = value; - } - } - - public FailureLevels FailureLevels { get; set; } - - public bool EnableRetry { get; set; } - - /// - /// The default value is 3,EnableRetry must be true to take effect - /// - public int RetryTimes { get; set; } - - /// - /// Used to cancel or compensate - /// - public bool IsCancel { get; set; } - - internal MethodInfo ActionMethodInfo { get; set; } - - internal Type InstanceType { get; set; } - - internal Type EventType { get; set; } - - internal int ActualRetryTimes => EnableRetry ? RetryTimes : 0; - - internal TaskInvokeDelegate? InvokeDelegate { get; private set; } - - private object Instance { get; set; } = default!; - - private object? EventHandler { get; set; } - - internal bool IsEventHandler => FailureLevels == FailureLevels.Throw || FailureLevels == FailureLevels.ThrowAndCancel; - - internal void BuildExpression() - { - InvokeDelegate = InvokeBuilder.Build(ActionMethodInfo, InstanceType); - } - - internal async Task ExcuteAction(IServiceProvider serviceProvider, TEvent @event) where TEvent : IEvent - { - if (InvokeDelegate != null) - { - Instance = serviceProvider.GetRequiredService(InstanceType); - await InvokeDelegate.Invoke(Instance, @event); - } - else - { - await ExcuteSagaAction(serviceProvider, @event); - } - } - - private async Task ExcuteSagaAction(IServiceProvider serviceProvider, TEvent @event) where TEvent : IEvent - { - if (!IsCancel) - { - if (EventHandler == null) - { - var handlers = serviceProvider.GetServices>(); - var handler = handlers.FirstOrDefault(x => x.GetType() == InstanceType)!; - EventHandler = handler; - } - await ((IEventHandler)EventHandler).HandleAsync(@event); - } - else - { - if (EventHandler == null) - { - var handlers = serviceProvider.GetServices>(); - var handler = handlers.FirstOrDefault(x => x.GetType() == InstanceType)!; - EventHandler = handler; - } - await ((ISagaEventHandler)EventHandler).CancelAsync(@event); - } - } - - internal bool IsHandlerMissing(int maxCancelOrder) => FailureLevels == FailureLevels.ThrowAndCancel && Order < maxCancelOrder || - FailureLevels == FailureLevels.Throw && Order <= maxCancelOrder; -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs deleted file mode 100644 index 2c4eebad1..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events; - -public interface IExceptionStrategyProvider -{ - bool SupportRetry(Exception? exception); - - void LogWrite(LogLevel logLevel, Exception? exception, string? message, params object?[] args); -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs deleted file mode 100644 index 3d6404220..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events; - -/// -/// Used to filter EventBus middleware that does not support recursion -/// -public interface IInitializeServiceProvider -{ - /// - /// Get the initialization state. If it has been initialized, the middleware that does not support recursion is no longer executed. - /// - bool IsInitialize { get; } - - /// - /// service has been initialized - /// - void Initialize(); - - /// - /// reset initialization state - /// - void Reset(); -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs deleted file mode 100644 index 5007b94ef..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Internal.Dispatch; - -internal class DispatchRelationNetwork -{ - public Dictionary> RelationNetwork { get; set; } = new(); - - public Dictionary> HandlerRelationNetwork { get; set; } = new(); - - public Dictionary> CancelRelationNetwork { get; set; } = new(); - - private readonly ILogger? _logger; - - public DispatchRelationNetwork(ILogger? logger) => _logger = logger; - - public void Add(Type keyEventType, EventHandlerAttribute handler) - { - Add(keyEventType, handler, !handler.IsCancel ? HandlerRelationNetwork : CancelRelationNetwork); - } - - /// - /// If the relationship does not exist in the network, add it - /// - /// - /// - /// - private void Add(Type keyEventType, - EventHandlerAttribute handlers, - Dictionary> dispatchRelativeNetwork) - { - if (!dispatchRelativeNetwork.ContainsKey(keyEventType)) - { - dispatchRelativeNetwork.Add(keyEventType, new List()); - } - - if (!dispatchRelativeNetwork[keyEventType].Any(x => x.ActionMethodInfo.Equals(handlers.ActionMethodInfo) && x.InstanceType == handlers.InstanceType)) - { - dispatchRelativeNetwork[keyEventType].Add(handlers); - } - } - - public void Build() - { - Sort(); - CheckConstraints(); - RelationNetwork = HandlerRelationNetwork.ToDictionary(relationNetwork => relationNetwork.Key, - relationNetwork => relationNetwork.Value.Select(handler => new DispatchRelationOptions(handler)).ToList()); - - foreach (var relation in RelationNetwork) - { - foreach (var relationOption in RelationNetwork[relation.Key]!) - { - if (CancelRelationNetwork.TryGetValue(relation.Key, out List? cancelRelations)) - { - var cancelHandlers = cancelRelations.TakeWhile(cancelHandler => relationOption.IsCancelHandler(cancelHandler)).Reverse().ToList(); - relationOption.AddCancelHandler(cancelHandlers); - } - } - } - } - - private void Sort() - { - HandlerRelationNetwork = Sort(HandlerRelationNetwork); - CancelRelationNetwork = Sort(CancelRelationNetwork); - } - - private Dictionary> Sort(Dictionary> dispatchRelatives) - where TDispatchHandlerAttribute : EventHandlerAttribute - { - return dispatchRelatives.ToDictionary( - dispatchRelative => dispatchRelative.Key, - dispatchRelative => dispatchRelative.Value.OrderBy(attr => attr.Order).ToList() - ); - } - - /// - /// Checking scheduling Relationships - /// Throw an exception for a Handler that only has Cancel - /// and warn a Handler that the Cancel will never perform because the Order is improperly set - /// - private void CheckConstraints() - { - foreach (var cancelRelation in CancelRelationNetwork) - { - if (HandlerRelationNetwork.All(relation => relation.Key != cancelRelation.Key)) - { - throw new NotSupportedException($"{cancelRelation.Key.Name} is only have a cancel handler, it must have an event handler."); - } - - var maxCancelOrder = cancelRelation.Value.Max(handler => handler.Order); - var maxHandlerOrder = HandlerRelationNetwork[cancelRelation.Key].Where(handler => handler.IsEventHandler).OrderByDescending(handler => handler.Order).ThenByDescending(handler => handler.FailureLevels).FirstOrDefault(); - if (maxHandlerOrder == null || maxHandlerOrder.IsHandlerMissing(maxCancelOrder)) - { - var methodName = cancelRelation.Value.Select(x => x.ActionMethodInfo.Name).LastOrDefault(); - _logger?.LogWarning($"The {methodName} method is meaningless, because its Order attribute is too large, and no handler corresponding to the Order can be triggered. It is suggested to lower the Order attribute of {methodName} or add a matching handler - {cancelRelation.Value.Select(x => x.InstanceType.FullName).LastOrDefault()}"); - } - } - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs deleted file mode 100644 index 3fdedfebe..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Internal.Dispatch; - -internal class Dispatcher : DispatcherBase -{ - public Dispatcher(IServiceCollection services, Assembly[] assemblies, bool forceInit = false) : base(services, assemblies, forceInit) - { - } - - public Dispatcher Build(ServiceLifetime lifetime) - { - foreach (var assembly in Assemblies) - { - AddRelationNetwork(assembly); - } - foreach (var dispatchInstance in GetAddServiceTypeList()) - { - Services.Add(dispatchInstance, dispatchInstance, lifetime); - } - Build(); - return this; - } - - private void AddRelationNetwork(Assembly assembly) - { - foreach (var type in assembly.GetTypes()) - { - if (!type.IsConcrete()) - { - continue; //Handler and Cancel must be normal classes, not abstract classes or interfaces - } - - foreach (var method in type.GetMethods()) - { - AddRelationNetwork(type, method); - } - } - } - - private void AddRelationNetwork(Type type, MethodInfo method) - { - try - { - var attribute = method.GetCustomAttributes(typeof(EventHandlerAttribute), true).FirstOrDefault(); - if (attribute is not null && attribute is EventHandlerAttribute handler) - { - var parameters = method.GetParameters(); - - if (parameters == null || parameters.Length != 1 || - !parameters.Any(parameter => typeof(IEvent).IsAssignableFrom(parameter.ParameterType))) - throw new ArgumentOutOfRangeException($"[{method.Name}] must have only one argument and inherit from Event"); - - if (IsSagaMode(type, method)) - return; - - var parameter = parameters.FirstOrDefault()!; - handler.ActionMethodInfo = method; - handler.InstanceType = type; - handler.EventType = parameter.ParameterType; - handler.BuildExpression(); - AddRelationNetwork(parameter.ParameterType, handler); - } - } - catch (Exception ex) - { - Logger?.LogError($"Dispatcher: Failed to get EventBus network, type name: [{type.FullName ?? type.Name}], method: [{method.Name}]", ex); - throw; - } - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs deleted file mode 100644 index 25b3ff9b6..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Internal.Dispatch; - -internal class DispatcherBase -{ - protected static DispatchRelationNetwork? SharingRelationNetwork; - - protected readonly IServiceCollection Services; - - protected readonly Assembly[] Assemblies; - - protected readonly ILogger? Logger; - - public DispatcherBase(IServiceCollection services, Assembly[] assemblies, bool forceInit) - { - Services = services; - Assemblies = assemblies; - var serviceProvider = services.BuildServiceProvider(); - if (SharingRelationNetwork == null || forceInit) - { - SharingRelationNetwork = new DispatchRelationNetwork(serviceProvider.GetService>()); - } - Logger = serviceProvider.GetService>(); - } - - public async Task PublishEventAsync(IServiceProvider serviceProvider, TEvent @event) - where TEvent : IEvent - { - ArgumentNullException.ThrowIfNull(@event, nameof(@event)); - var eventType = @event.GetType(); - if (!SharingRelationNetwork!.RelationNetwork.TryGetValue(eventType, out List? dispatchRelations)) - { - if (@event is IIntegrationEvent) - { - Logger?.LogError($"Dispatcher: The current event is an out-of-process event. You should use IIntegrationEventBus or IDomainEventBus to send it"); - throw new ArgumentNullException($"The current event is an out-of-process event. You should use IIntegrationEventBus or IDomainEventBus to send it"); - } - - Logger?.LogError($"Dispatcher: The {eventType.FullName} Handler method was not found. Check to see if the EventHandler feature is added to the method and if the Assembly is specified when using EventBus"); - throw new ArgumentNullException($"The {eventType.FullName} Handler method was not found. Check to see if the EventHandler feature is added to the method and if the Assembly is specified when using EventBus"); - } - await ExecuteEventHandlerAsync(serviceProvider, dispatchRelations, @event); - } - - private async Task ExecuteEventHandlerAsync(IServiceProvider serviceProvider, - List dispatchRelations, - TEvent @event) - where TEvent : IEvent - { - var executionStrategy = serviceProvider.GetRequiredService(); - StrategyOptions strategyOptions = new StrategyOptions(); - bool isCancel = false; - EventHandlerAttribute dispatchHandler; - foreach (var dispatchRelation in dispatchRelations) - { - if (isCancel) return; - dispatchHandler = dispatchRelation.Handler; - - strategyOptions.SetStrategy(dispatchHandler); - - await executionStrategy.ExecuteAsync(strategyOptions, @event, async (@event) => - { - Logger?.LogDebug("----- Publishing event {@Event}: message id: {messageId} -----", @event, @event.GetEventId()); - await dispatchHandler.ExcuteAction(serviceProvider, @event); - }, async (@event, ex, failureLevels) => - { - if (failureLevels != FailureLevels.Ignore) - { - isCancel = true; - if (dispatchRelation.CancelHandlers.Any()) - await ExecuteEventCanceledHandlerAsync(serviceProvider, Logger, executionStrategy, dispatchRelation.CancelHandlers, @event); - else - ex.ThrowException(); - } - else - { - Logger?.LogError("----- Publishing event {@Event} error rollback is ignored: message id: {messageId} -----", @event, @event.GetEventId()); - } - }); - } - } - - private async Task ExecuteEventCanceledHandlerAsync(IServiceProvider serviceProvider, - ILogger? logger, - IExecutionStrategy executionStrategy, - IEnumerable cancelHandlers, - TEvent @event) - where TEvent : IEvent - { - StrategyOptions strategyOptions = new StrategyOptions(); - foreach (var cancelHandler in cancelHandlers) - { - strategyOptions.SetStrategy(cancelHandler); - await executionStrategy.ExecuteAsync(strategyOptions, @event, async @event => - { - logger?.LogDebug("----- Publishing event {@Event} rollback start: message id: {messageId} -----", @event, @event.GetEventId()); - await cancelHandler.ExcuteAction(serviceProvider, @event); - }, (@event, ex, failureLevels) => - { - if (failureLevels != FailureLevels.Ignore) - ex.ThrowException(); - - logger?.LogError("----- Publishing event {@Event} rollback error ignored: message id: {messageId} -----", @event, @event.GetEventId()); - return Task.CompletedTask; - }); - } - } - - protected void AddRelationNetwork(Type parameterType, EventHandlerAttribute handler) - { - SharingRelationNetwork!.Add(parameterType, handler); - } - - protected IEnumerable GetAddServiceTypeList() => SharingRelationNetwork!.HandlerRelationNetwork - .Concat(SharingRelationNetwork.CancelRelationNetwork) - .SelectMany(relative => relative.Value) - .Where(dispatchHandler => dispatchHandler.InvokeDelegate != null) - .Select(dispatchHandler => dispatchHandler.InstanceType).Distinct(); - - protected void Build() => SharingRelationNetwork!.Build(); - - protected bool IsSagaMode(Type handlerType, MethodInfo method) => - typeof(IEventHandler<>).IsGenericInterfaceAssignableFrom(handlerType) && method.Name.Equals(nameof(IEventHandler.HandleAsync)) || - typeof(ISagaEventHandler<>).IsGenericInterfaceAssignableFrom(handlerType) && method.Name.Equals(nameof(ISagaEventHandler.CancelAsync)); -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs deleted file mode 100644 index fe8cb36e5..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Internal.Dispatch; - -internal class SagaDispatcher : DispatcherBase -{ - public SagaDispatcher(IServiceCollection services, Assembly[] assemblies, bool forceInit = false) : base(services, assemblies, forceInit) { } - - public SagaDispatcher Build(ServiceLifetime lifetime) - { - AddSagaDispatchRelation(Services, typeof(IEventHandler<>), lifetime); - AddSagaDispatchRelation(Services, typeof(ISagaEventHandler<>), lifetime); - return this; - } - - private IServiceCollection AddSagaDispatchRelation(IServiceCollection services, Type eventBusHandlerType, ServiceLifetime lifetime) - { - foreach (var item in GetAddSagaServices(eventBusHandlerType)) - { - services.Add(item.ServiceType, item.ImplementationType, lifetime); - AddSagaRelationNetwork(item.ImplementationType); - } - return services; - } - - private void AddSagaRelationNetwork(Type eventBusHandlerType) - { - var eventHandlers = GetSagaHandlers(eventBusHandlerType); - var eventHandler = eventHandlers.FirstOrDefault(x => x.Order != int.MaxValue); - var actualOrder = eventHandler?.Order ?? int.MaxValue; - - foreach (var handler in eventHandlers) - { - if (actualOrder != handler.Order) - { - handler.Order = actualOrder; - } - AddRelationNetwork(handler.EventType, handler); - } - } - - private List GetSagaHandlers(Type eventBusHandlerType) - { - var methods = eventBusHandlerType.GetMethods(); - Type? eventType = null!; - List eventHandlers = new(); - foreach (var method in methods) - { - var parameters = method.GetParameters(); - if (parameters.Length == 1 && parameters.All(parameter => typeof(IEvent).IsAssignableFrom(parameter.ParameterType) && !typeof(IIntegrationEvent).IsAssignableFrom(parameter.ParameterType)) && IsSagaMode(eventBusHandlerType, method)) - { - var attribute = method.GetCustomAttributes(typeof(EventHandlerAttribute), true).FirstOrDefault(); - var handler = attribute as EventHandlerAttribute; - eventType ??= parameters.Select(x => x.ParameterType).FirstOrDefault()!; - - handler ??= new EventHandlerAttribute(); - handler.ActionMethodInfo = method; - handler.InstanceType = eventBusHandlerType; - handler.EventType = eventType; - handler.IsCancel = method.Name.Equals(nameof(ISagaEventHandler.CancelAsync)); - eventHandlers.Add(handler); - } - } - - //In saga mode, when the user sets an Order for either HandlerAsync or CancelAsync - //the default int.MaxValue Order will be overridden - //but when the Order of HandlerAsync and CancelAsync are inconsistent - //an error will be displayed - if (eventHandlers.Where(handler => handler.Order != int.MaxValue).Select(handler => handler.Order).Distinct().Count() > 1) - { - throw new ArgumentException($"In saga mode {nameof(IEventHandler.HandleAsync)} needs to be the same as {nameof(ISagaEventHandler.CancelAsync)} Order"); - } - return eventHandlers; - } - - private List<(Type ServiceType, Type ImplementationType)> GetAddSagaServices(Type eventBusHandlerType) - { - List<(Type ServiceType, Type ImplementationType)> list = new(); - var serviceTypeAndImplementationInfo = GetSagaServiceTypeAndImplementations(eventBusHandlerType); - foreach (var serviceType in serviceTypeAndImplementationInfo.ServiceTypeList) - { - var implementationTypes = serviceTypeAndImplementationInfo.ImplementationType.Where(implementationType => serviceType.IsAssignableFrom(implementationType)).ToList(); - - foreach (var implementationType in implementationTypes) - { - list.Add((serviceType, implementationType)); - } - } - - return list; - } - - private (List ServiceTypeList, List ImplementationType) GetSagaServiceTypeAndImplementations(Type eventBusHandlerType) - { - var concretions = new List(); - var interfaces = new List(); - foreach (var type in Assemblies.SelectMany(a => a.DefinedTypes).Where(t => !t.IsGeneric())) - { - if (type.IsConcrete()) - { - concretions.Add(type); - } - - if (eventBusHandlerType.IsGenericInterfaceAssignableFrom(type) && !interfaces.Contains(type)) - { - interfaces.AddRange(type.GetInterfaces()); - } - } - return (interfaces, concretions); - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs deleted file mode 100644 index 44661d8ba..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Internal; - -internal static class DispatcherExtensions -{ - public static IServiceCollection Add(this IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime) - { - services.Add(new ServiceDescriptor(serviceType, implementationType, lifetime)); - return services; - } - - public static IServiceCollection TryAdd(this IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime) - { - services.TryAdd(new ServiceDescriptor(serviceType, implementationType, lifetime)); - return services; - } - - public static IServiceCollection TryAdd(this IServiceCollection services, Type serviceType, Func factory, ServiceLifetime lifetime) - { - services.TryAdd(new ServiceDescriptor(serviceType, factory, lifetime)); - return services; - } - - public static bool IsGeneric(this Type type) => type.GetTypeInfo().IsGenericTypeDefinition || type.GetTypeInfo().ContainsGenericParameters; - - public static bool IsConcrete(this Type type) => !type.GetTypeInfo().IsAbstract && !type.GetTypeInfo().IsInterface; - - public static bool IsGenericInterfaceAssignableFrom(this Type eventHandlerType, Type type) => - type.IsConcrete() && - type.GetInterfaces().Any(t => t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == eventHandlerType); - - /// - /// Keep the original stack information and throw an exception - /// - /// - public static void ThrowException(this Exception exception) - { - ExceptionDispatchInfo.Capture(exception).Throw(); - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs deleted file mode 100644 index b60befc5e..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Internal.Expressions; - -internal delegate Task TaskInvokeDelegate(object target, params object[] parameters); - -internal delegate void VoidInvokeDelegate(object target, object[] parameters); - -internal class InvokeBuilder -{ - public static TaskInvokeDelegate Build(MethodInfo methodInfo, Type targetType) - { - // Parameters to executor - var targetParameter = Expression.Parameter(typeof(object), "target"); - var parametersParameter = Expression.Parameter(typeof(object[]), "parameters"); - - // Build parameter list - var parameters = new List(); - var paramInfos = methodInfo.GetParameters(); - for (var i = 0; i < paramInfos.Length; i++) - { - var paramInfo = paramInfos[i]; - var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); - var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); - - // valueCast is "(Ti) parameters[i]" - parameters.Add(valueCast); - } - - // Call method - var instanceCast = Expression.Convert(targetParameter, targetType); - var methodCall = Expression.Call(instanceCast, methodInfo, parameters); - - // methodCall is "((Ttarget) target) method((T0) parameters[0], (T1) parameters[1], ...)" - // Create function - if (methodCall.Type == typeof(void)) - { - var lambda = Expression.Lambda(methodCall, targetParameter, parametersParameter); - var voidExecutor = lambda.Compile(); - return delegate (object target, object[] parameters) - { - voidExecutor(target, parameters); - return Task.CompletedTask; - }; - } - else if (methodCall.Type == typeof(Task)) - { - // must coerce methodCall to match ActionExecutor signature - var castMethodCall = Expression.Convert(methodCall, typeof(Task)); - var lambda = Expression.Lambda(castMethodCall, targetParameter, parametersParameter); - return lambda.Compile(); - } - else - { - throw new NotSupportedException($"The return type of the [{methodInfo.Name}] method must be Task or void"); - } - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs deleted file mode 100644 index e90c2f1ff..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Internal; - -internal class InitializeServiceProvider : IInitializeServiceProvider -{ - private bool _initialized; - - public bool IsInitialize => _initialized; - - public InitializeServiceProvider() - { - _initialized = false; - } - - public void Initialize() - { - _initialized = true; - } - - public void Reset() - { - _initialized = false; - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs deleted file mode 100644 index d225d9e65..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Internal.Middleware; - -internal class TransactionMiddleware : Middleware - where TEvent : IEvent -{ - private readonly IInitializeServiceProvider _initializeServiceProvider; - private readonly IUnitOfWork? _unitOfWork; - - public override bool SupportRecursive => false; - - public TransactionMiddleware(IInitializeServiceProvider initializeServiceProvider, IUnitOfWork? unitOfWork = null) - { - _initializeServiceProvider = initializeServiceProvider; - _unitOfWork = unitOfWork; - } - - public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) - { - try - { - await next(); - - if (_unitOfWork != null) - { - await _unitOfWork.SaveChangesAsync(); - await _unitOfWork.CommitAsync(); - } - } - catch (Exception) - { - if (_unitOfWork is { DisableRollbackOnFailure: false }) - { - await _unitOfWork!.RollbackAsync(); - } - - throw; - } - finally - { - _initializeServiceProvider.Reset(); - } - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj deleted file mode 100644 index 8b7d15700..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs deleted file mode 100644 index cab6842d7..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Options; - -public class DispatchRelationOptions -{ - public EventHandlerAttribute Handler { get; set; } = new(); - - public IEnumerable CancelHandlers { get; set; } = new List(); - - public DispatchRelationOptions() { } - - public DispatchRelationOptions(EventHandlerAttribute handler) : this() => Handler = handler; - - public void AddCancelHandler(IEnumerable cancelHandlers) - => CancelHandlers = cancelHandlers; - - public bool IsCancelHandler(EventHandlerAttribute cancelHandler) - { - return Handler.FailureLevels == FailureLevels.ThrowAndCancel && cancelHandler.Order <= Handler.Order - || Handler.FailureLevels == FailureLevels.Throw && cancelHandler.Order < Handler.Order; - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs deleted file mode 100644 index d0067205a..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Options; - -public class DispatcherOptions -{ - private IServiceCollection Services { get; } - - private Assembly[] Assemblies { get; } - - private bool IsSupportUnitOfWork(Type eventType) - => typeof(ITransaction).IsAssignableFrom(eventType) && !typeof(IDomainQuery<>).IsGenericInterfaceAssignableFrom(eventType); - - internal Dictionary UnitOfWorkRelation { get; } = new(); - - public IEnumerable AllEventTypes { get; } - - private DispatcherOptions(IServiceCollection services) => Services = services; - - public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) - : this(services) - { - if (assemblies == null || assemblies.Length == 0) - throw new ArgumentException(nameof(assemblies)); - - Assemblies = assemblies; - AllEventTypes = assemblies - .SelectMany(assembly => assembly.GetTypes()) - .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) - .ToList(); - UnitOfWorkRelation = AllEventTypes.ToDictionary(type => type, IsSupportUnitOfWork); - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.md b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.md deleted file mode 100644 index f34381cfc..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.md +++ /dev/null @@ -1,218 +0,0 @@ -[中](README.zh-CN.md) | EN - -## EventBus - -Example: - -```c# -Install-Package Masa.Contrib.Dispatcher.Events -``` - -##### Basic usage: - -1. Add EventBus - -```c# -var builder = WebApplication.CreateBuilder(args); -var app = builder.Services - .AddEventBus() - //TODO -``` - -2. Custom Event - -```C# -public class TransferEvent : Event -{ - public string Account { get; set; } = default!; - - public string ReceiveAccount { get; set; } = default!; - - public decimal Money{ get; set; } -} -``` - -3. Send Event - -```C# -IEventBus eventBus;//Get IEventBus through DI -await eventBus.PublishAsync(new TransferEvent());//Send Event -``` - -4. Define Handler - -```C# -public class TransferHandler -{ - [EventHandler] - public Task TransferAsync(TransferEvent @event) - { - //TODO Simulated transfer business - } -} -``` - -Or use the way to implement the interface: - -```C# -public class TransferHandler : IEventHandler -{ - public Task HandleAsync(TransferEvent @event) - { - //TODO Simulated transfer business - } -} -``` - -##### Advanced usage: - -1. Handler arrangement: - -```C# -public class TransferHandler -{ - [EventHandler(1)] - public Task CheckBalanceAsync(TransferEvent @event) - { - //TODO Simulate check balance - } - - [EventHandler(2)] - public Task DeductionBalanceAsync(RegisterUserEvent @event) - { - //TODO Simulated deduction balance - } -} -``` - -2. Support Saga mode - -If there is an error in sending the deducted balance, try again 3 times. If it still fails, check whether the balance is deducted and ensure that there is no deduction and notify the transfer failure - -```C# -public class TransferHandler -{ - [EventHandler(1)] - public Task CheckBalanceAsync(TransferEvent @event) - { - //TODO Simulate check balance - } - - [EventHandler(1, FailureLevels.Ignore, false, true)] - public Task NotificationTransferFailedAsync(TransferEvent @event) - { - //TODO Simulation notification transfer failed - } - - [EventHandler(2, FailureLevels.ThrowAndCancel, true, 3)] - public Task DeductionBalanceAsync(TransferEvent @event) - { - //TODO Simulated deduction balance - throw new Exception("Failed to deduct balance"); - } - - [EventHandler(2, FailureLevels.Ignore, false, true)] - public Task CancelDeductionBalanceAsync(TransferEvent @event) - { - //TODO Idempotent check to ensure that the balance has not been deducted - } -} -``` - -> Execution order: CheckBalanceAsync -> DeductionBalanceAsync (execute 1 time, retry 3 times) -> CancelDeductionBalanceAsync -> NotificationTransferFailedAsync - -Or use the way to implement the interface - -```C# -public class TransferHandler : ISagaEventHandler -{ - [EventHandler(1, FailureLevels.ThrowAndCancel, true, 3)] - public Task HandleAsync(TransferEvent @event) - { - //TODO Simulate check balance deduction balance - } - - [EventHandler(1, FailureLevels.Ignore, false, true)] - public Task CancelAsync(TransferEvent @event) - { - //TODO Idempotent verification and notification of transfer failure - } -} -``` - -> Tip: -> The method where the Handler is located only supports one parameter -> The return type of the method where the Handler is located only supports Task or void two types -> The parameters of the constructor of the class where the Handler is located must support getting from DI - -3. Support Middleware - - 1. Custom Middleware -```C# -public class LoggingMiddleware - : IMiddleware where TEvent : notnull, IEvent -{ - private readonly ILogger> _logger; - public LoggingMiddleware(ILogger> logger) => _logger = logger; - - public async Task HandleAsync(TEvent @event, EventHandlerDelegate next) - { - _logger.LogInformation("----- Handling command {EventName} ({@Event})", typeof(TEvent).FullName, @event); - await next(); - } -} -``` - 2. Enable custom Middleware - - -```C# -builder.Services.AddEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(ValidatorMiddleware<>))); -``` - -4. Support Transaction - -> Used in conjunction with Contracts.EF and UnitOfWork, when Event implements ITransaction, the transaction will be automatically opened after the first CUD is executed, and the transaction will be submitted after all Handlers are executed. When an exception occurs in the transaction, the transaction will be automatically rolled back. - -##### Performance Testing - -BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) -11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores -.NET SDK=7.0.100-preview.4.22252.9 - [Host] : .NET 6.0.6 (6.0.622.26707), X64 RyuJIT DEBUG - Job-MHJZJL : .NET 6.0.6 (6.0.622.26707), X64 RyuJIT - -Runtime=.NET 6.0 IterationCount=100 RunStrategy=ColdStart - -| Method | Mean | Error | StdDev | Median | Min | Max | -|------------------------------- |----------:|----------:|------------:|---------:|---------:|------------:| -| SendCouponByDirect | 18.10 us | 47.19 us | 139.13 us | 3.600 us | 3.000 us | 1,395.4 us | -| SendCouponByEventBus | 126.16 us | 374.20 us | 1,103.33 us | 9.950 us | 8.100 us | 11,043.7 us | -| AddShoppingCartByEventBusAsync | 124.80 us | 346.93 us | 1,022.94 us | 8.650 us | 6.500 us | 10,202.4 us | -| AddShoppingCartByMediatRAsync | 110.57 us | 306.47 us | 903.64 us | 7.500 us | 5.300 us | 9,000.1 us | - -##### Summarize - -IEventBus is the core of the event bus. It can be used with Cqrs, Uow, Masa.Contrib.Ddd.Domain.Repository.EF to automatically execute SaveChange (enable UoW) and Commit (enable UoW without closing transaction) operations after sending Command, And support to roll back the transaction after an exception occurs - -> Question 1. Publishing events through eventBus, Handler error -> and handler throw exception - - > 1. Check custom events or inherited classes to make sure ITransaction is implemented - > 2. Confirm that UoW is used - > 3. Make sure the UseTransaction property of UnitOfWork is false - > 4. Make sure that the DisableRollbackOnFailure property of UnitOfWork is true - -> Question 2. Under what circumstances will SaveChange be automatically saved -> When auto call SaveChange? - - > Use UoW and Masa.Contrib.Ddd.Domain.Repository.EF, and use the Add, Update, Delete operations provided by IRepository, publish events through EventBus, and automatically execute SaveChange after executing EventHandler - -> Question 3. If the SaveChange method of UoW is manually called in EventHandler to save, will the framework also save automatically? - - > If the SaveChange method of UoW is manually called in the EventHandler to save, and the Add, Update, and Delete operations provided by IRepository are not used afterward, the SaveChange operation will not be executed twice after the EventHandler execution ends, but if the UoW is manually called. After the SaveChange method is saved and continue to use the Add, Update, and Delete operations provided by IRepository, the framework will call the SaveChange operation again to ensure that the data is saved successfully. - -> Question 4. Why is exception retry enabled but not executed? - - > The default `UserFriendlyException` does not support retries, if you need to support retries, you need to reimplement `IExceptionStrategyProvider` - -> Question 5. Is EventBus thread safe? - - > EventBus is not thread-safe. If multiple threads execute EventBus.PublishAsync() concurrently, exceptions such as data unsubmitted may occur \ No newline at end of file diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.zh-CN.md b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.zh-CN.md deleted file mode 100644 index e69033f44..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/README.zh-CN.md +++ /dev/null @@ -1,217 +0,0 @@ -中 | [EN](README.md) - -## EventBus - -用例: - -```c# -Install-Package Masa.Contrib.Dispatcher.Events -``` - -##### 基本用法: - -1. 添加EventBus - -```c# -var builder = WebApplication.CreateBuilder(args); -var app = builder.Services - .AddEventBus() - //TODO -``` - -2. 自定义Event - -```C# -public class TransferEvent : Event -{ - public string Account { get; set; } = default!; - - public string ReceiveAccount { get; set; } = default!; - - public decimal Money{ get; set; } -} -``` - -3. 发送Event - -```C# -IEventBus eventBus;//通过DI得到IEventBus -await eventBus.PublishAsync(new TransferEvent());//发送Event -``` - -4. 定义Handler - -```C# -public class TransferHandler -{ - [EventHandler] - public Task TransferAsync(TransferEvent @event) - { - //TODO 模拟转账业务 - } -} -``` - -或使用实现接口的方式: - -```C# -public class TransferHandler : IEventHandler -{ - public Task HandleAsync(TransferEvent @event) - { - //TODO 模拟转账业务 - } -} -``` - -##### 高级用法: - -1. Handler编排: - -```C# -public class TransferHandler -{ - [EventHandler(1)] - public Task CheckBalanceAsync(TransferEvent @event) - { - //TODO 模拟检查余额 - } - - [EventHandler(2)] - public Task DeductionBalanceAsync(RegisterUserEvent @event) - { - //TODO 模拟扣减余额 - } -} -``` - -2. 支持Saga模式 - -假如扣减余额发送出错,则重试3次,如果仍然失败则校验余额是否扣减,确保无扣减后通知转账失败 - -```C# -public class TransferHandler -{ - [EventHandler(1)] - public Task CheckBalanceAsync(TransferEvent @event) - { - //TODO 模拟检查余额 - } - - [EventHandler(1, FailureLevels.Ignore, false, true)] - public Task NotificationTransferFailedAsync(TransferEvent @event) - { - //TODO 模拟通知转账失败 - } - - [EventHandler(2, FailureLevels.ThrowAndCancel, true, 3)] - public Task DeductionBalanceAsync(TransferEvent @event) - { - //TODO 模拟扣减余额 - throw new Exception("扣减余额失败"); - } - - [EventHandler(2, FailureLevels.Ignore, false, true)] - public Task CancelDeductionBalanceAsync(TransferEvent @event) - { - //TODO 幂等校验,确保余额未扣减 - } -} -``` - -> 执行顺序: CheckBalanceAsync -> DeductionBalanceAsync (执行1次,重试3次)-> CancelDeductionBalanceAsync -> NotificationTransferFailedAsync - -或者使用实现接口的方式 - -```C# -public class TransferHandler : ISagaEventHandler -{ - [EventHandler(1, FailureLevels.ThrowAndCancel, true, 3)] - public Task HandleAsync(TransferEvent @event) - { - //TODO 模拟检查余额扣减余额 - } - - [EventHandler(1, FailureLevels.Ignore, false, true)] - public Task CancelAsync(TransferEvent @event) - { - //TODO 幂等校验并通知转账失败 - } -} -``` - -> 注意: -> Handler所在的方法仅支持一个参数 -> Handler所在的方法返回类型仅支持Task或void两种类型 -> Handler所在的类的构造函数的参数必须支持从DI中获取 - -3. 支持Middleware - - 1. 自定义Middleware -```C# -public class LoggingMiddleware - : IMiddleware where TEvent : notnull, IEvent -{ - private readonly ILogger> _logger; - public LoggingMiddleware(ILogger> logger) => _logger = logger; - - public async Task HandleAsync(TEvent @event, EventHandlerDelegate next) - { - _logger.LogInformation("----- Handling command {EventName} ({@Event})", typeof(TEvent).FullName, @event); - await next(); - } -} -``` - 2. 启用自定义Middleware - -```C# -builder.Services.AddEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(ValidatorMiddleware<>))); -``` - -4. 支持Transaction - -> 配合MASA.Contrib.Ddd.Domain.Repository.EF.Repository、UnitOfWork使用,当Event实现了ITransaction,会在执行Add、Update、Delete方法时自动开启事务,且在Handler全部执行后提交事务,当事务出现异常后,会自动回滚事务 - -##### 性能测试 - -BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) -11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores -.NET SDK=7.0.100-preview.4.22252.9 - [Host] : .NET 6.0.6 (6.0.622.26707), X64 RyuJIT DEBUG - Job-MHJZJL : .NET 6.0.6 (6.0.622.26707), X64 RyuJIT - -Runtime=.NET 6.0 IterationCount=100 RunStrategy=ColdStart - -| Method | Mean | Error | StdDev | Median | Min | Max | -|------------------------------- |----------:|----------:|------------:|---------:|---------:|------------:| -| SendCouponByDirect | 18.10 us | 47.19 us | 139.13 us | 3.600 us | 3.000 us | 1,395.4 us | -| SendCouponByEventBus | 126.16 us | 374.20 us | 1,103.33 us | 9.950 us | 8.100 us | 11,043.7 us | -| AddShoppingCartByEventBusAsync | 124.80 us | 346.93 us | 1,022.94 us | 8.650 us | 6.500 us | 10,202.4 us | -| AddShoppingCartByMediatRAsync | 110.57 us | 306.47 us | 903.64 us | 7.500 us | 5.300 us | 9,000.1 us | - -##### 总结 - -IEventBus是事件总线的核心,配合Cqrs、Uow、Masa.Contrib.Ddd.Domain.Repository.EF使用,可实现自动执行SaveChange(启用UoW)与Commit(启用UoW且无关闭事务)操作,并支持出现异常后,回滚事务 - -> 问题1. 通过eventBus发布事件,Handler出错,但数据依然保存到数据库中,事务并未回滚 - - > 1. 检查自定义事件或继承类,确保已经实现ITransaction - > 2. 确认已使用UoW - > 3. 确认UnitOfWork的UseTransaction属性为false - > 4. 确认UnitOfWork的DisableRollbackOnFailure属性为true - -> 问题2. 什么时候自动调用SaveChanges - - > 使用UoW且使用了MASA.Contrib.Ddd.Domain.Repository.EF,并且使用IRepository提供的Add、Update、Delete操作,通过EventBus发布事件,在执行EventHandler后会自动执行SaveChange - -> 问题3. 如果在EventHandler中手动调用UoW的SaveChange方法保存,那框架还会自动保存吗? - - > 如果在EventHandler中手动调用了UoW的SaveChange方法保存,且之后并未再使用IRepository提供的Add、Update、Delete操作,则在EventHandler执行结束后不会二次执行SaveChange操作,但如果在手动调用UoW的SaveChange方法保存后又继续使用IRepository提供的Add、Update、Delete操作,则框架会再次调用SaveChange操作以确保数据保存成功 - -> 问题4. 为什么开启了异常重试却未执行重试? - - > 默认`UserFriendlyException`不支持重试,如果需要支持重试,则需要重新实现`IExceptionStrategyProvider` - -> 问题5. EventBus是线程安全的吗? - - > EventBus不是线程安全的,如果多线程并发执行EventBus.PublishAsync(),则可能会出现数据未提交等异常 \ No newline at end of file diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs deleted file mode 100644 index 13fdf894c..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddEventBus( - this IServiceCollection services, - Action? eventBusBuilder = null) - => services.AddEventBus(AppDomain.CurrentDomain.GetAssemblies(), eventBusBuilder); - - public static IServiceCollection AddEventBus( - this IServiceCollection services, - Assembly[] assemblies, - Action? eventBusBuilder = null) - => services.AddEventBus(assemblies, ServiceLifetime.Scoped, eventBusBuilder); - - public static IServiceCollection AddEventBus( - this IServiceCollection services, - Assembly[] assemblies, - ServiceLifetime lifetime, - Action? eventBusBuilder = null) - { - if (services.Any(service => service.ImplementationType == typeof(EventBusProvider))) - return services; - - services.AddSingleton(); - - var builder = new EventBusBuilder(services); - eventBusBuilder?.Invoke(builder); - - DispatcherOptions dispatcherOptions = new DispatcherOptions(services, assemblies); - services.AddSingleton(typeof(IOptions), - _ => Microsoft.Extensions.Options.Options.Create(dispatcherOptions)); - services.AddSingleton(new SagaDispatcher(services, assemblies).Build(lifetime)); - services.AddSingleton(new Dispatcher(services, assemblies).Build(lifetime)); - services.TryAddSingleton(); - services.TryAdd(typeof(IExecutionStrategy), typeof(ExecutionStrategy), ServiceLifetime.Singleton); - services.TryAddScoped(); - services.AddTransient(typeof(IMiddleware<>), typeof(TransactionMiddleware<>)); - services.AddScoped(typeof(IEventBus), typeof(EventBus)); - return services; - } - - public static IServiceCollection AddTestEventBus( - this IServiceCollection services, - Assembly[] assemblies, - ServiceLifetime lifetime, - Action? eventBusBuilder = null) - { - if (services.Any(service => service.ImplementationType == typeof(EventBusProvider))) - return services; - - services.AddSingleton(); - - eventBusBuilder?.Invoke(new EventBusBuilder(services)); - - DispatcherOptions dispatcherOptions = new DispatcherOptions(services, assemblies); - services.AddSingleton(typeof(IOptions), - _ => Microsoft.Extensions.Options.Options.Create(dispatcherOptions)); - services.AddSingleton(new SagaDispatcher(services, assemblies, true).Build(lifetime)); - services.AddSingleton(new Dispatcher(services, assemblies).Build(lifetime)); - services.TryAddSingleton(); - services.TryAdd(typeof(IExecutionStrategy), typeof(ExecutionStrategy), ServiceLifetime.Singleton); - services.TryAddScoped(); - services.AddTransient(typeof(IMiddleware<>), typeof(TransactionMiddleware<>)); - services.AddScoped(typeof(IEventBus), typeof(EventBus)); - - return services; - } - - private class EventBusProvider - { - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs deleted file mode 100644 index fa2d49086..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Strategies; - -public class ExecutionStrategy : IExecutionStrategy -{ - private readonly IExceptionStrategyProvider _exceptionStrategyProvider; - private readonly ILogger? _logger; - - public ExecutionStrategy(IExceptionStrategyProvider exceptionStrategyProvider, ILogger? logger = null) - { - _exceptionStrategyProvider = exceptionStrategyProvider; - _logger = logger; - } - - public async Task ExecuteAsync(StrategyOptions strategyOptions, TEvent @event, Func func, - Func cancel) - where TEvent : IEvent - { - int retryTimes = 0; - - Exception? exception = null!; - while (strategyOptions.IsRetry(retryTimes)) - { - try - { - if (retryTimes > 0) - { - _exceptionStrategyProvider.LogWrite(LogLevel.Warning, - null, - "----- Error Publishing event {@Event} start: The {retries}th retrying consume a message failed. message id: {messageId} -----", - @event, retryTimes, @event.GetEventId()); - } - await func.Invoke(@event); - return; - } - catch (Exception? ex) - { - if (retryTimes > 0) - { - _exceptionStrategyProvider.LogWrite(LogLevel.Error, - ex, - "----- Error Publishing event {@Event} finish: The {retries}th retrying consume a message failed. message id: {messageId} -----", - @event, retryTimes, @event.GetEventId()); - } - else - { - _exceptionStrategyProvider.LogWrite(LogLevel.Error, - ex, - "----- Error Publishing event {@Event}: after {maxRetries}th executions and we will stop retrying. message id: {messageId} -----", - @event, strategyOptions.MaxRetryCount, @event.GetEventId()); - } - exception = ex; - if (_exceptionStrategyProvider.SupportRetry(exception)) - { - retryTimes++; - } - else - { - retryTimes = strategyOptions.MaxRetryCount + 1; - } - } - } - - //perform the cancel handler - - await cancel(@event, exception, strategyOptions.FailureLevels); - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs deleted file mode 100644 index 65234475f..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Strategies; - -public interface IExecutionStrategy -{ - Task ExecuteAsync(StrategyOptions strategyOptions, TEvent @event, Func func, Func cancel) - where TEvent : IEvent; -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs deleted file mode 100644 index e56196996..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Strategies; - -public class StrategyOptions -{ - /// - /// The maximum number of retry attempts. - /// - public int MaxRetryCount { get; set; } - - public FailureLevels FailureLevels { get; set; } - - public bool IsRetry(int retryTimes) => retryTimes <= MaxRetryCount; - - public void SetStrategy(EventHandlerAttribute dispatchHandler) - { - MaxRetryCount = dispatchHandler.ActualRetryTimes; ; - FailureLevels = dispatchHandler.FailureLevels; - } -} diff --git a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/_Imports.cs b/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/_Imports.cs deleted file mode 100644 index 1287a75ca..000000000 --- a/src/Contrib/Dispatcher/Events/src/Masa.Contrib.Dispatcher.Events/_Imports.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.Events.Enums; -global using Masa.Contrib.Dispatcher.Events.Internal; -global using Masa.Contrib.Dispatcher.Events.Internal.Dispatch; -global using Masa.Contrib.Dispatcher.Events.Internal.Expressions; -global using Masa.Contrib.Dispatcher.Events.Internal.Middleware; -global using Masa.Contrib.Dispatcher.Events.Options; -global using Masa.Contrib.Dispatcher.Events.Strategies; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using System.Linq.Expressions; -global using System.Reflection; -global using System.Runtime.ExceptionServices; diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs deleted file mode 100644 index 09709123a..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.EventHandlers; - -public class AddGoodsHandler -{ - [EventHandler] - public void AddGoods(AddGoodsEvent @event, ILogger? logger) - { - logger?.LogInformation($"add goods log,GoodsId:{@event.GoodsId},GoodsName:{@event.GoodsName},CategoryId:{@event.CategoryId}"); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs deleted file mode 100644 index ae2a19a2e..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.Dispatcher.Events; - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; - -public record AddGoodsEvent : Event -{ - public string GoodsId { get; set; } - - public string CategoryId { get; set; } - - public string GoodsName { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj deleted file mode 100644 index cd88463e7..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs deleted file mode 100644 index 9ec9d05db..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; -global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs deleted file mode 100644 index a3dcbeb12..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.EventHandlers; - -public class DeleteGoodsHandler -{ - [EventHandler] - public void DeleteGoods() - { - - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs deleted file mode 100644 index c13bf9475..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.Dispatcher.Events; - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.Events; - -public record DeleteGoodsEvent : Event -{ - public string GoodsId { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj deleted file mode 100644 index 21d79c49d..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs deleted file mode 100644 index 2b37cc14c..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs +++ /dev/null @@ -1,2 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs deleted file mode 100644 index 23b84d3d9..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.EventHandlers; - -public class AddCatalogHandler -{ - /// - /// The method name of this method can be named according to the actual business - /// but we recommend HandlerAsync or CancelAsync if the business is single - /// - /// - /// - [EventHandler] - public Task HandleAsync(AddCatalogEvent @event) - { - return Task.FromResult("success"); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs deleted file mode 100644 index 58bf51f55..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; - -public class AddCatalogEvent -{ - public string GoodsId { get; set; } - - public int Count { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj deleted file mode 100644 index 21d79c49d..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs deleted file mode 100644 index 1b7958315..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs deleted file mode 100644 index a815ac47b..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.EventHandlers; - -public class AddBasketHandler -{ - private readonly ILogger? _logger; - public AddBasketHandler(ILogger? logger) => _logger = logger; - - [EventHandler] - public Task AddLog(AddBasketEvent @event) - { - _logger?.LogInformation($"add basket log:GoogdsId:{@event.GoodsId},count:{@event.Count}"); - return Task.FromResult("success"); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs deleted file mode 100644 index c865aba59..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.Events; - -public record AddBasketEvent : Event -{ - public string GoodsId { get; set; } - - public int Count { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj deleted file mode 100644 index 21d79c49d..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs deleted file mode 100644 index 26c080239..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.Events; -global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs deleted file mode 100644 index 0191f09c5..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Masa.Contrib.Dispatcher.Events.Enums; - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.EventHandlers; - -public class Handler -{ - [EventHandler(Order = 1)] - public void First(CalculateEvent @event) - { - @event.Result = @event.ParameterA + @event.ParameterB; - if (@event.Result % 2 == 0) - throw new Exception("result is even"); - } - - [EventHandler(Order = 2, IsCancel = true)] - public void SecondCancal(CalculateEvent @event) - { - @event.Result = @event.Result - 2; - } - - [EventHandler(Order = 2, FailureLevels = FailureLevels.Throw)] - public void Second(CalculateEvent @event) - { - @event.Result *= 3; - - if (@event.Result / 12 > 0) - throw new Exception("result must not be greater than 11"); - } - - [EventHandler(Order = 3, FailureLevels = FailureLevels.ThrowAndCancel)] - public void Third(CalculateEvent @event) - { - if (@event.Result == 9) - throw new Exception("result is not equal to 9"); - } - - [EventHandler(Order = 3, IsCancel = true)] - public void ThirdCancel(CalculateEvent @event) - { - @event.Result -= 5; - } - - [EventHandler(Order = 1, IsCancel = true)] - public void FirstCancal(CalculateEvent @event) - { - @event.Result -= 3; - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs deleted file mode 100644 index 3e3a17fc4..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.Dispatcher.Events; - -namespace Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; - -public record CalculateEvent : Event -{ - public int ParameterA { get; set; } - - public int ParameterB { get; set; } - - public int Result { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj deleted file mode 100644 index 21d79c49d..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs deleted file mode 100644 index 2cca0d35a..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs deleted file mode 100644 index d464a50e6..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.EventHandlers; - -public class UserEventHandler -{ - [EventHandler(IsCancel = true)] - public void BindPhoneNumber(BindPhoneNumberEvent @event) - { - - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs deleted file mode 100644 index dc27c12ae..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.Dispatcher.Events; - -namespace Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.Events; - -public record BindPhoneNumberEvent : Event -{ - public string AccountId { get; set; } - - public string PhoneNumber { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj deleted file mode 100644 index 21d79c49d..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs deleted file mode 100644 index f456f264e..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.Events; diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs deleted file mode 100644 index 0fe1cf865..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.EventHandlers; - -public class EditCategoryHandler : ISagaEventHandler -{ - private readonly ILogger? _logger; - public EditCategoryHandler(ILogger? logger = null) => _logger = logger; - - [EventHandler(10)] - public Task CancelAsync(EditCategoryEvent @event) - { - _logger?.LogInformation($"cancel edit category log,CategoryId:{@event.CategoryId},Name:{@event.CategoryName}"); - return Task.CompletedTask; - } - - [EventHandler(20)] - public Task HandleAsync(EditCategoryEvent @event) - { - _logger?.LogInformation($"edit category log,CategoryId:{@event.CategoryId},Name:{@event.CategoryName}"); - return Task.CompletedTask; - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs deleted file mode 100644 index 42a82b0c5..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.Events; - -public record EditCategoryEvent : Event -{ - public string CategoryId { get; set; } - - public string CategoryName { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj deleted file mode 100644 index 21d79c49d..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs deleted file mode 100644 index 753bdd870..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.Events; -global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs deleted file mode 100644 index 104ff7d80..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests; - -[TestClass] -public class AssemblyResolutionTests -{ - [TestMethod] - public void TestResolveEventBus() - { - var services = new ServiceCollection(); - services - .AddEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(LoggingMiddleware<>))) - .AddLogging(loggingBuilder => loggingBuilder.AddConsole()); - var serviceProvider = services.BuildServiceProvider(); - var eventBus = serviceProvider.GetService(); - Assert.IsNotNull(eventBus, "Event bus injection failed"); - Assert.IsNotNull(eventBus.GetAllEventTypes()); - } - - [TestMethod] - public void TestAddNullAssembly() - { - var services = new ServiceCollection(); - services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); - Assert.ThrowsException(() => - { - Assembly[] assemblies = null!; - services.AddEventBus(assemblies!); - }); - } - - [TestMethod] - public void TestAddEmptyAssembly() - { - var services = new ServiceCollection(); - services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); - Assert.ThrowsException(() => - { - services.AddEventBus(Array.Empty()); - }); - } - - [TestMethod] - public void TestEventBusByAddNullAssembly() - { - var services = new ServiceCollection(); - services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); - Assert.ThrowsException(() => - { - services.AddTestEventBus(null!, ServiceLifetime.Scoped); - }); - } - - [TestMethod] - public void TestEventBus() - { - var services = new ServiceCollection(); - services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); - services.AddTestEventBus(AppDomain.CurrentDomain.GetAssemblies(), ServiceLifetime.Scoped,eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(LoggingMiddleware<>))); - var serviceProvider = services.BuildServiceProvider(); - var eventBus = serviceProvider.GetService(); - Assert.IsNotNull(eventBus, "Event bus injection failed"); - Assert.IsNotNull(eventBus.GetAllEventTypes()); - } - - [TestMethod] - public void TestUseEventBus() - { - var assemblies = AppDomain.CurrentDomain.GetAssemblies(); - var services = new ServiceCollection(); - services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); - Mock dispatcherOptions = new(); - dispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies).Verifiable(); - dispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); - dispatcherOptions.Object.UseEventBus(eventBuilder => eventBuilder.UseMiddleware(typeof(LoggingMiddleware<>))); - var eventBus = services.BuildServiceProvider().GetService(); - Assert.IsNotNull(eventBus); - } - - [TestMethod] - public void TestAddMultEventBus() - { - var assemblies = AppDomain.CurrentDomain.GetAssemblies(); - var services = new ServiceCollection(); - services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); - Mock dispatcherOptions = new(); - dispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies).Verifiable(); - dispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); - dispatcherOptions.Object - .UseEventBus() - .UseEventBus(); - - Assert.IsTrue(services.BuildServiceProvider().GetServices().Count() == 1); - } - - [TestMethod] - public void TestUseEventBusAndNullServices() - { - var assemblies = AppDomain.CurrentDomain.GetAssemblies(); - IServiceCollection services = null!; - Mock dispatcherOptions = new(); - dispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies).Verifiable(); - dispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); - Assert.ThrowsException(() => dispatcherOptions.Object.UseEventBus()); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs deleted file mode 100644 index 1a55607e3..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests; - -[TestClass] -public class ChoreTest : TestBase -{ - private readonly IEventBus _eventBus; - public ChoreTest() - { - _eventBus = _serviceProvider.GetRequiredService(); - } - - [DataTestMethod] - [DataRow("jordan", "19999999999", 1, "A very ordinary boy who likes code")] - [DataRow("tom", "18888888888", 0, "A girl who likes to dance")] - public async Task TestNotHandler(string account, string phone, int gender, string abstracts) - { - AddUserEvent @event = new AddUserEvent() - { - Account = account, - Phone = phone, - Gender = gender == 1, - Abstract = abstracts - }; - await Assert.ThrowsExceptionAsync(async () => - { - await _eventBus.PublishAsync(@event); - }); - } - - [TestMethod] - public void TestDispatchHandlerConstructor() - { - var dispatchHandler = new EventHandlerAttribute(); - Assert.IsTrue(dispatchHandler.Order.Equals(int.MaxValue)); - - dispatchHandler = new EventHandlerAttribute(1); - Assert.IsTrue(dispatchHandler.Order.Equals(1)); - - dispatchHandler = new EventHandlerAttribute(1, true); - Assert.IsTrue(dispatchHandler.Order.Equals(1)); - Assert.IsTrue(dispatchHandler.EnableRetry.Equals(true)); - - dispatchHandler = new EventHandlerAttribute(2, FailureLevels.Ignore); - Assert.IsTrue(dispatchHandler.Order.Equals(2)); - Assert.IsTrue(dispatchHandler.EnableRetry.Equals(false)); - Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.Ignore)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(0)); - - dispatchHandler = new EventHandlerAttribute(10, true, false); - Assert.IsTrue(dispatchHandler.Order.Equals(10)); - Assert.IsTrue(dispatchHandler.EnableRetry.Equals(true)); - Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(3)); - - dispatchHandler = new EventHandlerAttribute(10, true, false, 5); - Assert.IsTrue(dispatchHandler.Order.Equals(10)); - Assert.IsTrue(dispatchHandler.EnableRetry.Equals(true)); - Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(5)); - - dispatchHandler = new EventHandlerAttribute(10, false, false, 5); - Assert.IsTrue(dispatchHandler.Order.Equals(10)); - Assert.IsTrue(dispatchHandler.EnableRetry.Equals(false)); - Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(0)); - - dispatchHandler = new EventHandlerAttribute(10, FailureLevels.ThrowAndCancel, true); - Assert.IsTrue(dispatchHandler.Order.Equals(10)); - Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.ThrowAndCancel)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(3)); - - dispatchHandler = new EventHandlerAttribute(10, FailureLevels.Ignore, true, false); - Assert.IsTrue(dispatchHandler.Order.Equals(10)); - Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.Ignore)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(3)); - Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); - - dispatchHandler = new EventHandlerAttribute(10, FailureLevels.Ignore, false, true); - Assert.IsTrue(dispatchHandler.Order.Equals(10)); - Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.Ignore)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(0)); - Assert.IsTrue(dispatchHandler.IsCancel.Equals(true)); - - dispatchHandler = new EventHandlerAttribute(10, FailureLevels.ThrowAndCancel, true, 10); - Assert.IsTrue(dispatchHandler.Order.Equals(10)); - Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.ThrowAndCancel)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(10)); - Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); - - dispatchHandler = new EventHandlerAttribute(10, FailureLevels.ThrowAndCancel, false, 10); - Assert.IsTrue(dispatchHandler.Order.Equals(10)); - Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.ThrowAndCancel)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(0)); - Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); - - dispatchHandler = new EventHandlerAttribute(10, FailureLevels.ThrowAndCancel, true, 5, true); - Assert.IsTrue(dispatchHandler.Order.Equals(10)); - Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.ThrowAndCancel)); - Assert.IsTrue(dispatchHandler.RetryTimes.Equals(5)); - Assert.IsTrue(dispatchHandler.IsCancel.Equals(true)); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs deleted file mode 100644 index 1d74baa70..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; - -public class ChangePasswordEventHandler : ISagaEventHandler -{ - private readonly ILogger? _logger; - public ChangePasswordEventHandler(ILogger? logger=null) => _logger = logger; - - [EventHandler(10, FailureLevels.ThrowAndCancel)] - public Task HandleAsync(ChangePasswordEvent @event) - { - if (@event.Content.Contains("@")) - { - throw new ArgumentException("Invalid content parameter"); - } - return Task.CompletedTask; - } - - public Task CancelAsync(ChangePasswordEvent @event) - { - if (@event.Account.Equals("mark")) - { - throw new ArgumentException("System error, please try again later"); - } - _logger?.LogInformation("cancel success"); - return Task.CompletedTask; - } - - - [EventHandler(0, FailureLevels.Ignore, IsCancel = true)] - public Task AddCancelLogs(ChangePasswordEvent @event) - { - if (@event.Account.Equals("roller")) - { - throw new ArgumentException("System error, please try again later"); - } - _logger?.LogInformation("cancel success"); - return Task.CompletedTask; - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs deleted file mode 100644 index 41a0c0d5d..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; - -public class MarketingEventHandler -{ - [EventHandler(10, true, false)] - public void Discount(ComputeEvent computeEvent) - { - var discountRate = 0.7m; - computeEvent.DiscountAmount = computeEvent.Amount * (1 - discountRate); - computeEvent.PayAmount = computeEvent.Amount * discountRate; - } - - [EventHandler(20)] - public void FullReduction(ComputeEvent computeEvent) - { - var discounts = 0; - if (computeEvent.PayAmount > 200) - { - discounts = 50; - computeEvent.DiscountAmount += discounts; - } - computeEvent.PayAmount -= discounts; - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs deleted file mode 100644 index 9c2cbfb8c..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; - -public class OrderPaymentSucceededEventHandler -{ - private readonly ILogger _logger; - public OrderPaymentSucceededEventHandler(ILogger logger) => _logger = logger; - - [EventHandler(10, FailureLevels.Ignore)] - public void AddTradeRecords(OrderPaymentSucceededEvent @event) - { - _logger.LogInformation("Order paid successfully, add transaction record"); - if (@event.OrderId.Length > 10) - { - throw new NotSupportedException("Wrong order number"); - } - } - - [EventHandler(10, FailureLevels = FailureLevels.Ignore, IsCancel = true)] - public void Cancel(OrderPaymentSucceededEvent @event) - { - _logger.LogInformation("Order paid successfully, rollback transaction record"); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs deleted file mode 100644 index 77c02b1f4..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; - -public class RegisterUserEventHandler -{ - [EventHandler] - public void RegisterUser(RegisterUserEvent registerUserEvent) - { - throw new NotSupportedException(); - } -} - diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs deleted file mode 100644 index 75e08dda4..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; - -public class ShipOrderEventHandler : ISagaEventHandler -{ - private int ExecCount { get; set; } - - private readonly ILogger? _logger; - - public ShipOrderEventHandler(ILogger? logger = null) - { - _logger = logger; - ExecCount = 0; - } - - [EventHandler(10, FailureLevels.ThrowAndCancel, true)] - public Task HandleAsync(ShipOrderEvent @event) - { - ExecCount++; - if (ExecCount - 1 <= 1) - { - throw new Exception("try again"); - } - - _logger?.LogInformation("update express information"); - if (@event.OrderId.Length > 8) - { - @event.Message = "the delivery failure"; - throw new Exception("the delivery failure"); - } - @event.Message = "the delivery success"; - return Task.CompletedTask; - } - - [EventHandler(10, false, true)] - public Task CancelAsync(ShipOrderEvent @event) - { - @event.Message = "the delivery failed, rolling back success"; - _logger?.LogInformation("the delivery failed, rolling back success"); - return Task.CompletedTask; - } -} - -public class ShipOrderAndNoticeHandler : IEventHandler -{ - private readonly ILogger? _logger; - public ShipOrderAndNoticeHandler(ILogger? logger = null) => _logger = logger; - - [EventHandler(20)] - public Task HandleAsync(ShipOrderEvent @event) - { - @event.Message = "the delivery and notice success"; - _logger?.LogInformation("order delivered successfully"); - return Task.CompletedTask; - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs deleted file mode 100644 index 78c8302d0..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; - -public class ShoppingCardEventHandler -{ - private readonly ILogger _logger; - public ShoppingCardEventHandler(ILogger logger) => _logger = logger; - - [EventHandler(FailureLevels = FailureLevels.Ignore)] - public void AddShoppingCard(AddShoppingCartEvent @event) - { - _logger.LogInformation($"add shopping card log,GoodsId:{@event.GoodsId},Count:{@event.Count}"); - throw new ArgumentException(nameof(@event)); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs deleted file mode 100644 index 6aa41c3d4..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; - -public class TransferEventHandler : ISagaEventHandler -{ - private readonly List _blackAccount = new List() { "roller", "thomas" }; - - private readonly ILogger? _logger; - private readonly IEventBus _eventBus; - - public TransferEventHandler(IEventBus eventBus, ILogger? logger = null) - { - _logger = logger; - _eventBus = eventBus; - } - - [EventHandler(EnableRetry = true, RetryTimes = 3)] - public Task HandleAsync(TransferEvent @event) - { - if (_blackAccount.Contains(@event.Account)) - { - throw new NotSupportedException("System error, please try again later"); - } - _logger?.LogInformation("deduct account balance {event}", @event.ToString()); - return Task.CompletedTask; - } - - [EventHandler(EnableRetry = true, RetryTimes = 3)] - public Task CancelAsync(TransferEvent @event) - { - if (@event.Price > 1000000) - { - throw new NotSupportedException("Large transfer returns are not supported."); - } - else - { - return Task.CompletedTask; - } - } - - [EventHandler] - public async Task DeductionMoneyHandler(DeductionMoneyEvent @event) - { - // TODO: The simulated deduction is successful - - IncreaseMoneyEvent increaseMoneyEvent = new IncreaseMoneyEvent() - { - Account = @event.PayeeAccount, - TransferAccount = @event.Account, - Money = @event.Money - }; - await _eventBus.PublishAsync(increaseMoneyEvent); - } - - [EventHandler] - public Task IncreaseMoneyHandler(IncreaseMoneyEvent @event) - { - // TODO: Succeeded in simulated increase - return Task.CompletedTask; - } -} - -public class ReceiveTransferHandler -{ - private readonly List _blackAccount = new List() { "clark", "evan" }; - - private readonly ILogger _logger; - - public ReceiveTransferHandler(ILogger logger) => _logger = logger; - - [EventHandler(EnableRetry = true, RetryTimes = 3, FailureLevels = FailureLevels.ThrowAndCancel)] - public Task HandleAsync(TransferEvent @event) - { - if (_blackAccount.Contains(@event.OptAccount)) - { - throw new NotSupportedException("System error, please try again later"); - } - _logger.LogInformation("add opt account balance"); - return Task.CompletedTask; - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs deleted file mode 100644 index b5a129556..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public record AddShoppingCartEvent : Event -{ - public string GoodsId { get; set; } - - public int Count { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs deleted file mode 100644 index 7f744f5de..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -/// -/// Just event, not handler, so let's see what happens when you publish an event -/// -public record AddUserEvent : Event -{ - public string Account { get; set; } - - public string Phone { get; set; } - - public bool Gender { get; set; } - - public string Abstract { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs deleted file mode 100644 index 476dc95ce..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public class ChangePasswordEvent : IEvent -{ - public string Account { get; set; } - - public string Content { get; set; } - - public Guid Id { get; set; } = Guid.NewGuid(); - - public DateTime CreationTime { get; set; } = DateTime.UtcNow; - - public Guid GetEventId() => Id; - - public void SetEventId(Guid eventId) => Id = eventId; - - public DateTime GetCreationTime() => CreationTime; - - public void SetCreationTime(DateTime creationTime) => CreationTime = creationTime; -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs deleted file mode 100644 index 16f2c817e..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public record ComputeEvent : Event -{ - /// - /// the unit price - /// - public decimal Price { get; set; } - - public int Count { get; set; } - - /// - /// original price - /// - public decimal Amount => Price * Count; - - /// - /// preferential price - /// - public decimal DiscountAmount { get; set; } - - /// - /// actual amount paid - /// - public decimal PayAmount { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs deleted file mode 100644 index 85b915f8a..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public record DeductionMoneyEvent : Event, ITransaction -{ - public IUnitOfWork? UnitOfWork { get; set; } - - public string Account { get; set; } - - public string PayeeAccount { get; set; } - - public decimal Money { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs deleted file mode 100644 index 40761b570..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public record IncreaseMoneyEvent : Event, ITransaction -{ - public IUnitOfWork? UnitOfWork { get; set; } - - public string Account { get; set; } - - public string TransferAccount { get; set; } - - public decimal Money { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs deleted file mode 100644 index c5b237504..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public class OrderPaymentFailedIntegrationEvent : IIntegrationEvent -{ - public Guid Id { get; set; } - - public DateTime CreationTime { get; set; } - - public string Topic { get; set; } = nameof(OrderPaymentFailedIntegrationEvent); - - public IUnitOfWork? UnitOfWork { get; set; } - - public string OrderId { get; set; } - - public OrderPaymentFailedIntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } - - public OrderPaymentFailedIntegrationEvent(Guid id, DateTime creationTime) - { - this.Id = id; - this.CreationTime = creationTime; - } - - public Guid GetEventId() => Id; - - public void SetEventId(Guid eventId) => Id = eventId; - - public DateTime GetCreationTime() => CreationTime; - - public void SetCreationTime(DateTime creationTime) => CreationTime = creationTime; -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs deleted file mode 100644 index 040cf6a97..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public record OrderPaymentSucceededEvent : Event -{ - public string OrderId { get; set; } - - public long Timespan { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs deleted file mode 100644 index dbd1d9ce3..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public record RegisterUserEvent(string Name) : Event -{ -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs deleted file mode 100644 index 1b471ed27..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public record SendCouponEvent : Event -{ - public string CouponCode { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs deleted file mode 100644 index 61b4a8f11..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public record ShipOrderEvent : Event -{ - public string OrderId { get; set; } - - public string OrderState { get; set; } - - public string Message { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs deleted file mode 100644 index bb9ee0b94..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Events; - -public record TransferEvent : Event -{ - public string Account { get; set; } - - public string OptAccount { get; set; } - - public decimal Price { get; set; } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs deleted file mode 100644 index 4f804f982..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs +++ /dev/null @@ -1,380 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests; - -[TestClass] -public class FeaturesTest : TestBase -{ - private readonly IEventBus _eventBus; - - public FeaturesTest() : base() - { - _eventBus = _serviceProvider.GetRequiredService(); - } - - [TestMethod] - public async Task TestMethodsReturnType() - { - await Assert.ThrowsExceptionAsync(async () => - { - try - { - ResetMemoryEventBus(typeof(AddBasketEvent).Assembly); - } - catch (Exception) - { - ResetMemoryEventBus(typeof(FeaturesTest).Assembly); - throw; - } - await Task.CompletedTask; - }); - } - - [TestMethod] - public async Task TestNotImplementationIEvent() - { - await Assert.ThrowsExceptionAsync(async () => - { - try - { - ResetMemoryEventBus(typeof(AddCatalogEvent).Assembly); - } - catch (Exception) - { - ResetMemoryEventBus(typeof(FeaturesTest).Assembly); - throw; - } - await Task.CompletedTask; - }); - } - - [TestMethod] - public async Task TestMultiParameter() - { - await Assert.ThrowsExceptionAsync(async () => - { - try - { - ResetMemoryEventBus(typeof(AddGoodsEvent).Assembly); - } - catch (Exception) - { - ResetMemoryEventBus(typeof(FeaturesTest).Assembly); - throw; - } - await Task.CompletedTask; - }); - } - - [TestMethod] - public async Task TestCorrectEventBus() - { - AddShoppingCartEvent @event = new AddShoppingCartEvent() - { - GoodsId = Guid.NewGuid().ToString(), - Count = 1 - }; - await _eventBus.PublishAsync(@event); - } - - [TestMethod] - public async Task TestNullEvent() - { - AddShoppingCartEvent? @event = null; - await Assert.ThrowsExceptionAsync(async () => await _eventBus.PublishAsync(@event!)); - } - - [DataTestMethod] - [DataRow("50", 2, "30", "70")] - [DataRow("60", 5, "140", "160")] - public async Task TestMultiHandler(string price, int count, string discountAmount, string payAmount) - { - ComputeEvent @event = new ComputeEvent() - { - Price = Convert.ToDecimal(price), - Count = count - }; - await _eventBus.PublishAsync(@event); - Assert.IsTrue(@event.DiscountAmount == Convert.ToDecimal(discountAmount) && @event.PayAmount == Convert.ToDecimal(payAmount)); - } - - [TestMethod] - public async Task TestNotParameter() - { - await Assert.ThrowsExceptionAsync(async () => - { - try - { - ResetMemoryEventBus(typeof(DeleteGoodsEvent).Assembly); - } - catch (Exception) - { - ResetMemoryEventBus(typeof(FeaturesTest).Assembly); - throw; - } - await Task.CompletedTask; - }); - } - - [TestMethod] - public Task TestOnlyCancelHandler() - { - Assert.ThrowsException(() => - { - try - { - ResetMemoryEventBus(typeof(OnlyCancelHandler.Tests.Events.BindPhoneNumberEvent).Assembly); - } - catch (NotSupportedException) - { - ResetMemoryEventBus(typeof(FeaturesTest).Assembly); - throw; - } - }); - return Task.CompletedTask; - } - - [TestMethod] - public async Task TestHandlerIsIgnore() - { - var @event = new OrderPaymentSucceededEvent() - { - OrderId = "123456789012", - Timespan = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await _eventBus.PublishAsync(@event); - } - - [TestMethod] - public async Task TestPublishIntegrationEvent() - { - var @event = new OrderPaymentFailedIntegrationEvent() - { - OrderId = "123456789012", - }; - await Assert.ThrowsExceptionAsync(async () => - { - await _eventBus.PublishAsync(@event); - }); - } - - [TestMethod] - public async Task TestPublishIntegrationEventAndUseUoW() - { - base.ResetMemoryEventBus(services => - { - var unitOfWork = new Mock(); - services.AddScoped(serviceProvider => unitOfWork.Object); - return services; - }, true, typeof(AssemblyResolutionTests).Assembly); - var @event = new OrderPaymentFailedIntegrationEvent() - { - OrderId = "123456789012", - }; - await Assert.ThrowsExceptionAsync(async () => - { - await _services.BuildServiceProvider().GetRequiredService().PublishAsync(@event); - }); - } - - [TestMethod] - public async Task TestTransferEventAndOpenTransaction() - { - base.ResetMemoryEventBus(services => - { - var uoW = new Mock(); - uoW.Setup(x => x.TransactionHasBegun).Returns(true); - uoW.Setup(e => e.CommitAsync(CancellationToken.None)).Verifiable(); - services.AddScoped(serviceProvider => uoW.Object); - return services; - }, true, typeof(AssemblyResolutionTests).Assembly); - var @event = new DeductionMoneyEvent() - { - Account = "tom", - PayeeAccount = "Jim", - Money = 100 - }; - await _services.BuildServiceProvider().GetRequiredService().PublishAsync(@event); - } - - [TestMethod] - public async Task TestCommitAsync() - { - base.ResetMemoryEventBus(services => - { - return services; - }, true, typeof(AssemblyResolutionTests).Assembly); - var @event = new DeductionMoneyEvent() - { - Account = "tom", - PayeeAccount = "Jim", - Money = 100 - }; - var serviceProvider = _services.BuildServiceProvider(); - var eventBus = serviceProvider.GetRequiredService(); - - await Assert.ThrowsExceptionAsync(async () => await eventBus.CommitAsync(default)); - } - - [TestMethod] - public async Task TestUseUoWCommitAsync() - { - var uoW = new Mock(); - base.ResetMemoryEventBus(services => - { - uoW.Setup(e => e.CommitAsync(CancellationToken.None)).Verifiable(); - services.AddScoped(serviceProvider => uoW.Object); - return services; - }, true, typeof(AssemblyResolutionTests).Assembly); - var @event = new DeductionMoneyEvent() - { - Account = "tom", - PayeeAccount = "Jim", - Money = 100 - }; - var serviceProvider = _services.BuildServiceProvider(); - var eventBus = serviceProvider.GetRequiredService(); - await eventBus.PublishAsync(@event); - - uoW.Verify(u => u.CommitAsync(default), Times.Once); - } - - [DataTestMethod] - [DataRow(1, 2, -1)] - [DataRow(5, 4, 24)] - public async Task TestEventBusCancelOrder(int parameterA, int parameterB, int result) - { - IServiceCollection services = new ServiceCollection(); - services.AddTestEventBus(new[] { typeof(CalculateEvent).Assembly }, ServiceLifetime.Scoped); - var @event = new CalculateEvent() - { - ParameterA = parameterA, - ParameterB = parameterB - }; - var eventBus = services.BuildServiceProvider().GetRequiredService(); - await eventBus.PublishAsync(@event); - Assert.IsTrue(@event.Result == result); - } - - [DataTestMethod] - public void TestEventHandler() - { - var order = 1; - bool enableRetry = true; - var failureLevels = FailureLevels.ThrowAndCancel; - bool isCancel = true; - int retryTimes = 5; - int defaultRetryTimes = 3; - - var eventAttribute = new EventHandlerAttribute(order); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry == false && - eventAttribute.RetryTimes == 0 && - eventAttribute.FailureLevels == FailureLevels.Throw && - eventAttribute.IsCancel == false - ); - - eventAttribute = new EventHandlerAttribute(order, failureLevels); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry == false && - eventAttribute.RetryTimes == 0 && - eventAttribute.FailureLevels == failureLevels && - eventAttribute.IsCancel == false - ); - - eventAttribute = new EventHandlerAttribute(order, failureLevels, enableRetry); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry == enableRetry && - eventAttribute.RetryTimes == defaultRetryTimes && - eventAttribute.FailureLevels == failureLevels && - eventAttribute.IsCancel == false - ); - - eventAttribute = new EventHandlerAttribute(order, failureLevels, enableRetry, isCancel); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry == enableRetry && - eventAttribute.RetryTimes == defaultRetryTimes && - eventAttribute.FailureLevels == failureLevels && - eventAttribute.IsCancel == isCancel - ); - - eventAttribute = new EventHandlerAttribute(order, failureLevels, enableRetry, retryTimes); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry == enableRetry && - eventAttribute.RetryTimes == retryTimes && - eventAttribute.FailureLevels == failureLevels && - eventAttribute.IsCancel == false - ); - - eventAttribute = new EventHandlerAttribute(order, failureLevels, enableRetry, retryTimes, isCancel); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry == enableRetry && - eventAttribute.RetryTimes == retryTimes && - eventAttribute.FailureLevels == failureLevels && - eventAttribute.IsCancel == isCancel - ); - - eventAttribute = new EventHandlerAttribute(order, enableRetry); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry && - eventAttribute.RetryTimes == defaultRetryTimes && - eventAttribute.FailureLevels == FailureLevels.Throw && - eventAttribute.IsCancel == false - ); - - eventAttribute = new EventHandlerAttribute(order, enableRetry, retryTimes); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry && - eventAttribute.RetryTimes == retryTimes && - eventAttribute.FailureLevels == FailureLevels.Throw && - eventAttribute.IsCancel == false - ); - - eventAttribute = new EventHandlerAttribute(order, enableRetry, isCancel); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry && - eventAttribute.RetryTimes == defaultRetryTimes && - eventAttribute.FailureLevels == FailureLevels.Throw && - eventAttribute.IsCancel == isCancel - ); - - eventAttribute = new EventHandlerAttribute(order, enableRetry, isCancel, retryTimes); - Assert.IsTrue( - eventAttribute.Order == order && - eventAttribute.EnableRetry && - eventAttribute.RetryTimes == retryTimes && - eventAttribute.FailureLevels == FailureLevels.Throw && - eventAttribute.IsCancel == isCancel - ); - - } - - [TestMethod] - public void TestOrderLessThanZero() - { - Assert.ThrowsException(() => - { - _ = new EventHandlerAttribute(-10); - }, "The order must be greater than or equal to 0"); - } - - [TestMethod] - public async Task TestEventBusExceptionAsync() - { - var services = new ServiceCollection(); - services.AddTestEventBus(new Assembly[] { typeof(FeaturesTest).Assembly }, ServiceLifetime.Scoped); - var registerUserEvent = new RegisterUserEvent("Jim"); - var eventBus = services.BuildServiceProvider().GetRequiredService(); - await Assert.ThrowsExceptionAsync(async () => await eventBus.PublishAsync(registerUserEvent)); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj deleted file mode 100644 index cac228ab0..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - net6.0 - false - enable - Full - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs deleted file mode 100644 index 708bd1e19..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests.Middleware; - -public class LoggingMiddleware : Middleware where TEvent : IEvent -{ - private readonly ILogger>? _logger; - public LoggingMiddleware(ILogger>? logger = null) => _logger = logger; - - public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) - { - var eventType = @event.GetType(); - _logger?.LogInformation("----- Handling command {FullName} ({event})", eventType.FullName, @event); - await next(); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs deleted file mode 100644 index b2ffcc365..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests; - -[TestClass] -public class SagaTest : TestBase -{ - private readonly IEventBus _eventBus; - public SagaTest() : base() - { - _eventBus = _serviceProvider.GetRequiredService(); - } - - [DataTestMethod] - [DataRow("60040012", "success", "the delivery and notice success")] - [DataRow("601454112", "error", "the delivery failed, rolling back success")] - public async Task TestExecuteAbnormalExit(string orderId, string orderState, string result) - { - ShipOrderEvent @event = new ShipOrderEvent() - { - OrderId = orderId, - OrderState = orderState - }; - await _eventBus.PublishAsync(@event); - Assert.IsTrue(@event.Message == result); - } - - [DataTestMethod] - [DataRow("roller", "change password notcices", 0)] - [DataRow("mark", "change password notcices @", 1)] - [DataRow("roller", "change password notcices @", 0)] - [DataRow("jordan", "change password notcices @", 0)] - public async Task TestLastCancelError(string account, string content, int isError) - { - ResetMemoryEventBus(false, null!); - ChangePasswordEvent @event = new ChangePasswordEvent() - { - Account = account, - Content = content - }; - if (isError == 1) - { - await Assert.ThrowsExceptionAsync(async () => - { - await _eventBus.PublishAsync(@event); - }); - } - else - { - await _eventBus.PublishAsync(@event); - } - } - - [DataTestMethod] - [DataRow("smith", "alice", "1000", 0)] - [DataRow("roller", "alice", "1000", 1)] - [DataRow("eddie", "clark", "2000", 0)] - [DataRow("eddie", "clark", "20000000", 1)] - public async Task TestMultiHandlerBySaga(string account, string optAccount, string price, int isError) - { - TransferEvent @event = new TransferEvent() - { - Account = account, - OptAccount = optAccount, - Price = Convert.ToDecimal(price) - }; - if (isError == 1) - { - await Assert.ThrowsExceptionAsync(async () => await _eventBus.PublishAsync(@event)); - } - else - { - await _eventBus.PublishAsync(@event); - } - } - - [TestMethod] - public async Task TestMultiOrderBySaga() - { - IEventBus? eventBus = null; - Assert.ThrowsException(() => - { - ResetMemoryEventBus(false, typeof(SagaTest).Assembly, typeof(EditCategoryEvent).Assembly); - eventBus = _serviceProvider.GetRequiredService(); - }); - EditCategoryEvent @event = new EditCategoryEvent() - { - CategoryId = new Random().Next(100, 10000).ToString(), - CategoryName = "Name" - }; - if (eventBus != null) - { - await eventBus.PublishAsync(@event); - } - ResetMemoryEventBus(false, null!); - } -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs deleted file mode 100644 index 867348885..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.Events.Tests; - -[TestClass] -public class TestBase -{ - protected IServiceProvider _serviceProvider { get; private set; } - - protected IServiceCollection _services { get; private set; } - - public TestBase() : this(null) - { - - } - - public TestBase(Func? func = null) => ResetMemoryEventBus(func, false, null); - - protected void ResetMemoryEventBus(Func? func = null, bool isAddLog = true, params Assembly[]? assemblies) - { - _services = new ServiceCollection(); - if (isAddLog) - { - _services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); - } - else - { - _services.AddLogging(loggingBuilder => - { - loggingBuilder.ClearProviders(); - loggingBuilder.Services.RemoveAll(typeof(ILogger<>)); - }); - } - - _services.AddTransient(typeof(IMiddleware<>), typeof(LoggingMiddleware<>)); - func?.Invoke(_services); - _services = assemblies == null ? _services.AddTestEventBus(_defaultAssemblies, ServiceLifetime.Scoped) : _services.AddTestEventBus(assemblies, ServiceLifetime.Scoped); - _serviceProvider = _services.BuildServiceProvider(); - } - - private static Assembly[] _defaultAssemblies => new Assembly[1] { typeof(TestBase).Assembly }; - - protected void ResetMemoryEventBus(params Assembly[] assemblies) => ResetMemoryEventBus(null, true, assemblies); - - protected void ResetMemoryEventBus(bool isAddLog, params Assembly[] assemblies) => ResetMemoryEventBus(null, true, assemblies); -} diff --git a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs b/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs deleted file mode 100644 index 85935366e..000000000 --- a/src/Contrib/Dispatcher/Events/test/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.Enums; -global using Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.Tests.Middleware; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Reflection; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs deleted file mode 100644 index cee186833..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; - -public static class DispatcherOptionsExtensions -{ - private const string DAPR_PUBSUB_NAME = "pubsub"; - - public static IDispatcherOptions UseDapr( - this Masa.Contrib.Dispatcher.IntegrationEvents.Options.DispatcherOptions dispatcherOptions, - string daprPubSubName = DAPR_PUBSUB_NAME, - Action? builder = null) - { - dispatcherOptions.Services.TryAddSingleton(serviceProvider => new Publisher(serviceProvider, daprPubSubName)); - dispatcherOptions.Services.AddDaprClient(builder); - return dispatcherOptions; - } - - #region Obsolete - - [Obsolete("Use UseIntegrationEventBus(opt => opt.UseDapr())")] - public static IDistributedDispatcherOptions UseDaprEventBus( - this IDistributedDispatcherOptions dispatcherOptions, - string daprPubSubName) - where TIntegrationEventLogService : class, IIntegrationEventLogService - => dispatcherOptions.UseDaprEventBus(option => option.PubSubName = daprPubSubName); - - - [Obsolete("Use UseIntegrationEventBus(opt => opt.UseDapr())")] - public static IDistributedDispatcherOptions UseDaprEventBus( - this IDistributedDispatcherOptions dispatcherOptions, - Action? optionAction = null) - where TIntegrationEventLogService : class, IIntegrationEventLogService - => dispatcherOptions.UseDaprEventBus(optionAction, null); - - [Obsolete("Use UseIntegrationEventBus(opt => opt.UseDapr())")] - public static IDistributedDispatcherOptions UseDaprEventBus( - this IDistributedDispatcherOptions dispatcherOptions, - Action? optionAction, - Action? builder) - where TIntegrationEventLogService : class, IIntegrationEventLogService - { - ArgumentNullException.ThrowIfNull(dispatcherOptions.Services, nameof(dispatcherOptions.Services)); - - dispatcherOptions.Services.TryAddDaprEventBus(dispatcherOptions.Assemblies, option => - { - option.PubSubName = DAPR_PUBSUB_NAME; - optionAction?.Invoke(option); - }, builder); - return dispatcherOptions; - } - - #endregion - -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj deleted file mode 100644 index b1dda57bb..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs deleted file mode 100644 index e430860a9..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Options; - -[Obsolete("Later versions will be changed to Internal")] -public class DispatcherOptions : Masa.Contrib.Dispatcher.IntegrationEvents.Options.DispatcherOptions -{ - private string _pubSubName = "pubsub"; - - public string PubSubName - { - get => _pubSubName; - set - { - if (string.IsNullOrWhiteSpace(value)) - throw new ArgumentNullException(nameof(PubSubName)); - - _pubSubName = value; - } - } - - public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) - : base(services, assemblies) - { - } - - [Obsolete("Later versions will be deleted")] - internal void CopyTo(Masa.Contrib.Dispatcher.IntegrationEvents.Options.DispatcherOptions dispatcherOptions) - { - dispatcherOptions.LocalRetryTimes = LocalRetryTimes; - dispatcherOptions.MaxRetryTimes = MaxRetryTimes; - dispatcherOptions.FailedRetryInterval = FailedRetryInterval; - dispatcherOptions.MinimumRetryInterval = MinimumRetryInterval; - dispatcherOptions.LocalFailedRetryInterval = LocalFailedRetryInterval; - dispatcherOptions.RetryBatchSize = RetryBatchSize; - dispatcherOptions.CleaningLocalQueueExpireInterval = CleaningLocalQueueExpireInterval; - dispatcherOptions.CleaningExpireInterval = CleaningExpireInterval; - dispatcherOptions.PublishedExpireTime = PublishedExpireTime; - dispatcherOptions.DeleteBatchCount = DeleteBatchCount; - dispatcherOptions.GetCurrentTime = GetCurrentTime; - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs deleted file mode 100644 index b470fd72a..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; - -public class Publisher : IPublisher -{ - private readonly IServiceProvider _serviceProvider; - private DaprClient? _daprClient; - public DaprClient DaprClient => _daprClient ??= _serviceProvider.GetRequiredService(); - private readonly string _pubSubName; - - public Publisher(IServiceProvider serviceProvider, string pubSubName) - { - _serviceProvider = serviceProvider; - _pubSubName = pubSubName; - } - - public async Task PublishAsync(string topicName, T @event, CancellationToken stoppingToken = default) where T : IIntegrationEvent - { - await DaprClient.PublishEventAsync(_pubSubName, topicName, @event, stoppingToken); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md deleted file mode 100644 index 89e48253f..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md +++ /dev/null @@ -1,71 +0,0 @@ -[中](README.zh-CN.md) | EN - -## IntegrationEvents.Dapr - -Example: - -```C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //Use cross-process -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //Send cross-process messages -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //Record cross-process message logs -Install-Package Masa.Contrib.Data.UoW.EF //Use UnitOfWork -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // Use SqlServer -``` - -1. Add IIntegrationEventBus - -```C# -builder.Services - .AddIntegrationEventBus(options=> - { - options.UseDapr(); - options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity")) - .UseEventLog(); - }); -``` - -> CustomerDbContext needs to inherit MasaDbContext - -2. Custom IntegrationEvent - -```C# -public class DemoIntegrationEvent : IntegrationEvent -{ - public override string Topic { get; set; } = nameof(DemoIntegrationEvent);//dapr topic name - - //todo Custom attribute parameters -} -``` - -3. Custom CustomDbContext - -```C# -public class CustomDbContext : MasaDbContext -{ - public DbSet Users { get; set; } = null!; - - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - - } -} -``` - -4. Send Event - -```C# -IIntegrationEventBus eventBus;//Get IIntegrationEventBus through DI -await eventBus.PublishAsync(new DemoIntegrationEvent());//Send cross-process events -``` - -5. Subscribe to events - -```C# -[Topic("pubsub", nameof(DomeIntegrationEvent))] -public async Task DomeIntegrationEventHandleAsync(DomeIntegrationEvent @event) -{ - //todo -} -``` - -> Implement pub/sub capability based on Dapr \ No newline at end of file diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md deleted file mode 100644 index d99cdfc64..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md +++ /dev/null @@ -1,71 +0,0 @@ -中 | [EN](README.md) - -## IntegrationEvents.Dapr - -用例: - -```C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //使用跨进程事件 -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //通过dapr完成跨进程事件 -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //记录跨进程消息日志 -Install-Package Masa.Contrib.Data.UoW.EF //使用工作单元 -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // 使用SqlServer -``` - -1. 添加IIntegrationEventBus - -```C# -builder.Services - .AddIntegrationEventBus(options=> - { - options.UseDapr(); - options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//使用工作单元,推荐使用 - .UseEventLog(); - }); -``` - -> CustomerDbContext 需要继承MasaDbContext - -2. 自定义 IntegrationEvent - -```C# -public class DemoIntegrationEvent : IntegrationEvent -{ - public override string Topic { get; set; } = nameof(DemoIntegrationEvent);//dapr topic name - - //todo 自定义属性参数 -} -``` - -3. 自定义CustomDbContext - -```C# -public class CustomDbContext : MasaDbContext -{ - public DbSet Users { get; set; } = null!; - - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - - } -} -``` - -4. 发送 Event - -```C# -IIntegrationEventBus eventBus;//通过DI得到IIntegrationEventBus -await eventBus.PublishAsync(new DemoIntegrationEvent());//发送跨进程事件 -``` - -5. 订阅事件 - -```C# -[Topic("pubsub", nameof(DomeIntegrationEvent))] -public async Task DomeIntegrationEventHandleAsync(DomeIntegrationEvent @event) -{ - //todo -} -``` - -> 基于Dapr实现pub/sub能力 \ No newline at end of file diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs deleted file mode 100644 index ecda874d4..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - #region Obsolete - - [Obsolete("Use AddIntegrationEventBus instead")] - public static IServiceCollection AddDaprEventBus( - this IServiceCollection services, - Action? options = null) - where TIntegrationEventLogService : class, IIntegrationEventLogService - => services.AddDaprEventBus(AppDomain.CurrentDomain.GetAssemblies(), options); - - [Obsolete("Use AddIntegrationEventBus instead")] - public static IServiceCollection AddDaprEventBus( - this IServiceCollection services, - Assembly[] assemblies, - Action? options = null, - Action? builder = null) - where TIntegrationEventLogService : class, IIntegrationEventLogService - => services.TryAddDaprEventBus(assemblies, options, builder); - - internal static IServiceCollection TryAddDaprEventBus( - this IServiceCollection services, - Assembly[] assemblies, - Action? options, - Action? builder = null) - where TIntegrationEventLogService : class, IIntegrationEventLogService - { - if (services.Any(service => service.ImplementationType == typeof(IntegrationEventBusProvider))) - return services; - - services.AddSingleton(); - - services.AddDaprClient(builder); - - return services.AddIntegrationEventBus(assemblies, opt => - { - DispatcherOptions daprDispatcherOptions = new DispatcherOptions(opt.Services, opt.Assemblies); - options?.Invoke(daprDispatcherOptions); - services.TryAddSingleton(serviceProvider=> new Publisher(serviceProvider,daprDispatcherOptions.PubSubName)); - - daprDispatcherOptions.CopyTo(opt); - }); - } - - private class IntegrationEventBusProvider - { - } - - #endregion -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs deleted file mode 100644 index b46e749ce..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Dapr.Client; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -global using Masa.Contrib.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Options; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using System.Reflection; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs deleted file mode 100644 index ed85e1da8..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; - -public static class DispatcherOptionsExtensions -{ - /// - /// User database with IntegrationEventLogContext merge - /// User-defined DbContext need IntegrationEventLogContext inheritance - /// - /// - /// - /// - public static IDispatcherOptions UseEventLog( - this IDispatcherOptions options) where TDbContext : MasaDbContext, IMasaDbContext - { - if (options.Services == null) - throw new ArgumentNullException(nameof(options.Services)); - - if (options.Services.Any(service => service.ImplementationType == typeof(EventLogProvider))) return options; - - options.Services.AddSingleton(); - - options.Services.TryAddScoped(); - - //Add local message table model mapping - options.Services.TryAddEnumerable(new ServiceDescriptor(typeof(IModelCreatingProvider), - typeof(IntegrationEventLogModelCreatingProvider), ServiceLifetime.Singleton)); - options.Services.TryAddScoped(typeof(IntegrationEventLogContext), - serviceProvider => new IntegrationEventLogContext(serviceProvider.GetRequiredService())); - return options; - } - - private class EventLogProvider - { - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs deleted file mode 100644 index b9321e39d..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; - -public class IntegrationEventLogContext -{ - public readonly DbContext DbContext; - - public IntegrationEventLogContext(DbContext dbContext) => DbContext = dbContext; - - public DbSet EventLogs => DbContext.Set(); -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs deleted file mode 100644 index 118d0936c..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; - -public class IntegrationEventLogEntityTypeConfiguration: IEntityTypeConfiguration -{ - public void Configure(EntityTypeBuilder builder) - { - builder.ToTable("IntegrationEventLog"); - - builder.HasKey(e => e.Id); - - builder.Property(e => e.Id) - .IsRequired(); - - builder.Property(e => e.Content) - .IsRequired(); - - builder.Property(e => e.CreationTime) - .IsRequired(); - - builder.Property(e => e.ModificationTime) - .IsRequired(); - - builder.Property(e => e.State) - .IsRequired(); - - builder.Property(e => e.TimesSent) - .IsRequired(); - - builder.Property(nameof(IHasConcurrencyStamp.RowVersion)) - .IsConcurrencyToken() - .HasMaxLength(36) - .HasColumnName(nameof(IHasConcurrencyStamp.RowVersion)); - - builder.Property(e => e.EventTypeName) - .IsRequired(); - - builder.HasIndex(e => new { e.State, e.ModificationTime }, "index_state_modificationtime"); - builder.HasIndex(e => new { e.State, e.TimesSent, e.ModificationTime }, "index_state_timessent_modificationtime"); - builder.HasIndex(e => new { e.EventId, e.RowVersion }, "index_eventid_version"); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs deleted file mode 100644 index ab4d49be3..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; - -public class IntegrationEventLogModelCreatingProvider : IModelCreatingProvider -{ - public void Configure(ModelBuilder modelBuilder) - { - var integrationEventLogEntityTypeConfiguration = new IntegrationEventLogEntityTypeConfiguration(); - modelBuilder.Entity(integrationEventLogEntityTypeConfiguration.Configure); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs deleted file mode 100644 index f8c21ddfd..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; - -public class IntegrationEventLogService : IIntegrationEventLogService -{ - private readonly IntegrationEventLogContext _eventLogContext; - private readonly IServiceProvider _serviceProvider; - private readonly Logger? _logger; - private IEnumerable? _eventTypes; - - public IntegrationEventLogService( - IntegrationEventLogContext eventLogContext, - IServiceProvider serviceProvider, - Logger? logger = null) - { - _eventLogContext = eventLogContext; - _serviceProvider = serviceProvider; - _logger = logger; - } - - /// - /// Get messages to retry - /// - /// maximum number of retries per retry - /// - /// default: 60s - /// - public async Task> RetrieveEventLogsFailedToPublishAsync(int retryBatchSize = 200, - int maxRetryTimes = 10, int minimumRetryInterval = 60) - { - //todo: Subsequent acquisition of the current time needs to be uniformly replaced with the unified time method provided by the framework, which is convenient for subsequent uniform replacement to UTC time or other urban time. The default setting here is Utc time. - var time = DateTime.UtcNow.AddSeconds(-minimumRetryInterval); - var result = await _eventLogContext.EventLogs - .Where(e => (e.State == IntegrationEventStates.PublishedFailed || e.State == IntegrationEventStates.InProgress) && - e.TimesSent <= maxRetryTimes && - e.ModificationTime < time) - .OrderBy(o => o.CreationTime) - .Take(retryBatchSize) - .ToListAsync(); - - if (result.Any()) - { - _eventTypes ??= _serviceProvider.GetRequiredService().GetAllEventTypes() - .Where(type => typeof(IIntegrationEvent).IsAssignableFrom(type)); - - return result.OrderBy(o => o.CreationTime) - .Select(e => e.DeserializeJsonContent(_eventTypes.First(t => t.Name == e.EventTypeShortName))); - } - - return result; - } - - public async Task SaveEventAsync(IIntegrationEvent @event, DbTransaction transaction) - { - if (transaction == null) - throw new ArgumentNullException(nameof(transaction)); - - if (_eventLogContext.DbContext.Database.CurrentTransaction == null) - await _eventLogContext.DbContext.Database.UseTransactionAsync(transaction, Guid.NewGuid()); - - var eventLogEntry = new IntegrationEventLog(@event, _eventLogContext.DbContext.Database.CurrentTransaction!.TransactionId); - await _eventLogContext.EventLogs.AddAsync(eventLogEntry); - await _eventLogContext.DbContext.SaveChangesAsync(); - - CheckAndDetached(eventLogEntry); - } - - public Task MarkEventAsPublishedAsync(Guid eventId) - { - return UpdateEventStatus(eventId, IntegrationEventStates.Published, eventLog => - { - if (eventLog.State != IntegrationEventStates.InProgress) - { - _logger?.LogWarning( - "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", - IntegrationEventStates.Published, eventLog.State, eventLog.Id); - throw new UserFriendlyException( - $"Failed to modify the state of the local message table to {IntegrationEventStates.Published}, the current State is {eventLog.State}, Id: {eventLog.Id}"); - } - }); - } - - public Task MarkEventAsInProgressAsync(Guid eventId) - { - return UpdateEventStatus(eventId, IntegrationEventStates.InProgress, eventLog => - { - if (eventLog.State != IntegrationEventStates.NotPublished && eventLog.State != IntegrationEventStates.PublishedFailed) - { - _logger?.LogWarning( - "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", - IntegrationEventStates.InProgress, eventLog.State, eventLog.Id); - throw new UserFriendlyException( - $"Failed to modify the state of the local message table to {IntegrationEventStates.InProgress}, the current State is {eventLog.State}, Id: {eventLog.Id}"); - } - }); - } - - public Task MarkEventAsFailedAsync(Guid eventId) - { - return UpdateEventStatus(eventId, IntegrationEventStates.PublishedFailed, eventLog => - { - if (eventLog.State != IntegrationEventStates.InProgress) - { - _logger?.LogWarning( - "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", - IntegrationEventStates.PublishedFailed, eventLog.State, eventLog.Id); - throw new UserFriendlyException( - $"Failed to modify the state of the local message table to {IntegrationEventStates.PublishedFailed}, the current State is {eventLog.State}, Id: {eventLog.Id}"); - } - }); - } - - public async Task DeleteExpiresAsync(DateTime expiresAt, int batchCount = 1000, CancellationToken token = default) - { - var eventLogs = _eventLogContext.EventLogs.Where(e => e.ModificationTime < expiresAt && e.State == IntegrationEventStates.Published) - .OrderBy(e => e.CreationTime).Take(batchCount); - _eventLogContext.EventLogs.RemoveRange(eventLogs); - await _eventLogContext.DbContext.SaveChangesAsync(token); - - if (_eventLogContext.DbContext.ChangeTracker.QueryTrackingBehavior != QueryTrackingBehavior.TrackAll) - { - foreach (var log in eventLogs) - _eventLogContext.DbContext.Entry(log).State = EntityState.Detached; - } - } - - private async Task UpdateEventStatus(Guid eventId, IntegrationEventStates status, Action? action = null) - { - var eventLogEntry = _eventLogContext.EventLogs.FirstOrDefault(e => e.EventId == eventId); - if (eventLogEntry == null) - throw new ArgumentException(nameof(eventId)); - - action?.Invoke(eventLogEntry); - - eventLogEntry.State = status; - eventLogEntry.ModificationTime = eventLogEntry.GetCurrentTime(); - - if (status == IntegrationEventStates.InProgress) - eventLogEntry.TimesSent++; - - _eventLogContext.EventLogs.Update(eventLogEntry); - - try - { - await _eventLogContext.DbContext.SaveChangesAsync(); - } - catch (DbUpdateConcurrencyException ex) - { - _logger?.LogWarning( - ex, - "Concurrency error, Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", - status, eventLogEntry.State, eventLogEntry.Id); - throw new UserFriendlyException("Concurrency conflict, update exception"); - } - - CheckAndDetached(eventLogEntry); - } - - private void CheckAndDetached(IntegrationEventLog integrationEvent) - { - if (_eventLogContext.DbContext.ChangeTracker.QueryTrackingBehavior != QueryTrackingBehavior.TrackAll) - _eventLogContext.DbContext.Entry(integrationEvent).State = EntityState.Detached; - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj deleted file mode 100644 index e7d2c0000..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md deleted file mode 100644 index 2b144ed68..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md +++ /dev/null @@ -1,24 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF - -> Provide support for sending IntegrationEvent - -Example: - -```C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF -``` - -1. Add EventLogs.EF - -```C# -.AddIntegrationEventBus(options => -{ - options - // TODO - .UseEventLog(); -} -``` - -> Tip: CustomDbContext needs to inherit MasaDbContext \ No newline at end of file diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md deleted file mode 100644 index e994ab67f..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md +++ /dev/null @@ -1,24 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF - -> 为发送IntegrationEvent提供支持 - -用例: - -```C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF -``` - -1. 使用EventLogs.EF - -```C# -.AddIntegrationEventBus(options => -{ - options - // TODO - .UseEventLog(); -} -``` - -> 提示:CustomDbContext需要继承MasaDbContext diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs deleted file mode 100644 index 745ce1fb5..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Metadata.Builders; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using System; -global using System.Collections.Generic; -global using System.Data.Common; -global using System.Linq; -global using System.Threading.Tasks; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs deleted file mode 100644 index f6abb9fd2..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents; - -public static class DispatcherOptionsExtensions -{ - public static IDistributedDispatcherOptions UseIntegrationEventBus( - this IDistributedDispatcherOptions dispatcherOptions, - Action? optionAction = null) - { - ArgumentNullException.ThrowIfNull(dispatcherOptions.Services, nameof(dispatcherOptions.Services)); - - dispatcherOptions.Services.TryAddIntegrationEventBus(dispatcherOptions.Assemblies, option => optionAction?.Invoke(option)); - return dispatcherOptions; - } - - public static IDistributedDispatcherOptions UseIntegrationEventBus( - this IDistributedDispatcherOptions dispatcherOptions, - Action? optionAction = null) - where TIntegrationEventLogService : class, IIntegrationEventLogService - { - ArgumentNullException.ThrowIfNull(dispatcherOptions.Services, nameof(dispatcherOptions.Services)); - - dispatcherOptions.Services.TryAddIntegrationEventBus(dispatcherOptions.Assemblies, - option => optionAction?.Invoke(option)); - return dispatcherOptions; - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs deleted file mode 100644 index c1adf03f0..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents; - -public interface IProcessingServer -{ - Task ExecuteAsync(CancellationToken stoppingToken); -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs deleted file mode 100644 index 67872a256..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents; - -public interface IProcessor -{ - Task ExecuteAsync(CancellationToken stoppingToken); - - /// - /// Easy to switch between background tasks - /// - /// unit: seconds - /// - Task DelayAsync(int delay); -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs deleted file mode 100644 index fd92ff4bf..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents; - -public interface IPublisher -{ - Task PublishAsync(string topicName, T @event, CancellationToken stoppingToken = default) where T : IIntegrationEvent; -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs deleted file mode 100644 index 23740d315..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents; - -public class IntegrationEventBus : IIntegrationEventBus -{ - private readonly DispatcherOptions _dispatcherOptions; - private readonly IPublisher _publisher; - private readonly ILogger? _logger; - private readonly IIntegrationEventLogService? _eventLogService; - private readonly IOptionsMonitor? _appConfig; - private readonly IEventBus? _eventBus; - private readonly IUnitOfWork? _unitOfWork; - - public IntegrationEventBus(IOptions options, - IPublisher publisher, - IIntegrationEventLogService? eventLogService = null, - IOptionsMonitor? appConfig = null, - ILogger? logger = null, - IEventBus? eventBus = null, - IUnitOfWork? unitOfWork = null) - { - _dispatcherOptions = options.Value; - _publisher = publisher; - _eventLogService = eventLogService; - _appConfig = appConfig; - _logger = logger; - _eventBus = eventBus; - _unitOfWork = unitOfWork; - } - - public IEnumerable GetAllEventTypes() => - _eventBus == null - ? _dispatcherOptions.AllEventTypes - : _dispatcherOptions.AllEventTypes.Concat(_eventBus.GetAllEventTypes()).Distinct(); - - public async Task PublishAsync(TEvent @event) - where TEvent : IEvent - { - if (@event is IIntegrationEvent integrationEvent) - { - await PublishIntegrationAsync(integrationEvent); - } - else if (_eventBus != null) - { - await _eventBus.PublishAsync(@event); - } - else - { - throw new NotSupportedException(nameof(@event)); - } - } - - private async Task PublishIntegrationAsync(TEvent @event) - where TEvent : IIntegrationEvent - { - if (@event.UnitOfWork == null && _unitOfWork != null) - @event.UnitOfWork = _unitOfWork; - - var topicName = @event.Topic; - if (@event.UnitOfWork is { UseTransaction: true } && _eventLogService != null) - { - try - { - _logger?.LogDebug("----- Saving changes and integrationEvent: {IntegrationEventId}", @event.GetEventId()); - await _eventLogService.SaveEventAsync(@event, @event.UnitOfWork!.Transaction); - - _logger?.LogDebug( - "----- Publishing integration event: {IntegrationEventIdPublished} from {AppId} - ({IntegrationEvent})", - @event.GetEventId(), - _appConfig?.CurrentValue.AppId ?? string.Empty, @event); - - await _eventLogService.MarkEventAsInProgressAsync(@event.GetEventId()); - - _logger?.LogDebug("Publishing event {Event} to {TopicName}", @event, topicName); - await _publisher.PublishAsync(topicName, (dynamic)@event); - - await _eventLogService.MarkEventAsPublishedAsync(@event.GetEventId()); - } - catch (Exception ex) - { - _logger?.LogError(ex, "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", - @event.GetEventId(), _appConfig?.CurrentValue.AppId ?? string.Empty, @event); - LocalQueueProcessor.Default.AddJobs(new IntegrationEventLogItem(@event.GetEventId(), @event.Topic, @event)); - await _eventLogService.MarkEventAsFailedAsync(@event.GetEventId()); - } - } - else - { - _logger?.LogDebug( - "----- Publishing integration event (don't use local message): {IntegrationEventIdPublished} from {AppId} - ({IntegrationEvent})", - @event.GetEventId(), - _appConfig?.CurrentValue.AppId ?? string.Empty, @event); - - await _publisher.PublishAsync(topicName, (dynamic)@event); - } - } - - public async Task CommitAsync(CancellationToken cancellationToken = default) - { - if (_unitOfWork is null) - throw new ArgumentNullException(nameof(IUnitOfWork), "You need to UseUoW when adding services"); - - await _unitOfWork.CommitAsync(cancellationToken); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs deleted file mode 100644 index 9956d8d58..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Microsoft.Extensions.Hosting; - -namespace Masa.Contrib.Dispatcher.IntegrationEvents; - -public class IntegrationEventHostedService : BackgroundService -{ - private readonly ILogger? _logger; - private readonly IProcessingServer _processingServer; - - public IntegrationEventHostedService(IProcessingServer processingServer, ILogger? logger = null) - { - _logger = logger; - _processingServer = processingServer; - } - - protected override Task ExecuteAsync(CancellationToken stoppingToken) - { - _logger?.LogDebug("----- IntegrationEvent background task is starting"); - - return _processingServer.ExecuteAsync(stoppingToken); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs deleted file mode 100644 index a66d617fd..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Internal; - -/// -/// Use the local queue to retry sending failed messages -/// -internal class IntegrationEventLogItem -{ - public Guid EventId { get; } - - public string Topic { get; } - - public DateTime CreationTime { get; } - - public int RetryCount { get; private set; } - - public IIntegrationEvent Event { get; private set; } - - public IntegrationEventLogItem(Guid eventId, string topic, IIntegrationEvent @event) - { - EventId = eventId; - Topic = topic; - RetryCount = 0; - CreationTime = DateTime.UtcNow; - Event = @event; - } - - public void Retry() - { - this.RetryCount++; - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs deleted file mode 100644 index 5d262d8d7..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Internal; - -internal class LocalQueueProcessor -{ - private readonly ConcurrentDictionary _retryEventLogs; - - public static ILogger? Logger; - public static readonly LocalQueueProcessor Default = new(); - - public LocalQueueProcessor() => _retryEventLogs = new(); - - public static void SetLogger(IServiceCollection services) - { - Logger = services.BuildServiceProvider().GetService>(); - } - - public void AddJobs(IntegrationEventLogItem items) - => _retryEventLogs.TryAdd(items.EventId, items); - - public void RemoveJobs(Guid eventId) - => _retryEventLogs.TryRemove(eventId, out _); - - public void RetryJobs(Guid eventId) - { - if (_retryEventLogs.TryGetValue(eventId, out IntegrationEventLogItem? item)) - { - item.Retry(); - } - } - - public bool IsExist(Guid eventId) - => _retryEventLogs.ContainsKey(eventId); - - public void Delete(int maxRetryTimes) - { - var eventLogItems = _retryEventLogs.Values.Where(log => log.RetryCount >= maxRetryTimes - 1).ToList(); - eventLogItems.ForEach(item => RemoveJobs(item.EventId)); - } - - public List RetrieveEventLogsFailedToPublishAsync(int maxRetryTimes, int retryBatchSize) - { - try - { - return _retryEventLogs - .Select(item => item.Value) - .Where(log => log.RetryCount < maxRetryTimes) - .OrderBy(log => log.RetryCount) - .ThenBy(log => log.CreationTime) - .Take(retryBatchSize) - .ToList(); - } - catch (Exception ex) - { - Logger?.LogWarning(ex, "... getting local retry queue error"); - - Thread.Sleep(TimeSpan.FromSeconds(2)); - return new List(); - } - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj deleted file mode 100644 index d6384daaf..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs deleted file mode 100644 index 383659973..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Options; - -public class DispatcherOptions : IDispatcherOptions -{ - public IServiceCollection Services { get; } - - public Assembly[] Assemblies { get; } - - private int _localRetryTimes = 3; - - /// - /// Local queue maximum number of retries - /// - public int LocalRetryTimes - { - get => _localRetryTimes; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(LocalRetryTimes)); - - _localRetryTimes = value; - } - } - - private int _maxRetryTimes = 10; - - /// - /// maximum number of retries - /// Default is 10 - /// - public int MaxRetryTimes - { - get => _maxRetryTimes; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(MaxRetryTimes)); - - _maxRetryTimes = value; - } - } - - private int _failedRetryInterval = 60; - - /// - /// The interval at which db polls for failure messages. - /// Default is 60 seconds. - /// unit: seconds - /// - public int FailedRetryInterval - { - get => _failedRetryInterval; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(FailedRetryInterval)); - - _failedRetryInterval = value; - } - } - - private int _minimumRetryInterval = 60; - - /// - /// Minimum execution retry interval - /// Default is 60 seconds. - /// - public int MinimumRetryInterval - { - get => _minimumRetryInterval; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(MinimumRetryInterval)); - - _minimumRetryInterval = value; - } - } - - private int _localFailedRetryInterval = 3; - - /// - /// The interval at which the local queue is polled for failed messages. - /// Local queue does not rebuild after service crash - /// Default is 3 seconds. - /// unit: seconds - /// - public int LocalFailedRetryInterval - { - get => _localFailedRetryInterval; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(LocalFailedRetryInterval)); - - _localFailedRetryInterval = value; - } - } - - private int _retryBatchSize = 100; - - /// - /// maximum number of retries per retry - /// - public int RetryBatchSize - { - get => _retryBatchSize; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(RetryBatchSize)); - - _retryBatchSize = value; - } - } - - private int _cleaningLocalQueueExpireInterval = 60; - - /// - /// Delete local queue expired event interval - /// Default is 60 seconds - /// unit: seconds - /// - public int CleaningLocalQueueExpireInterval - { - get => _cleaningLocalQueueExpireInterval; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(CleaningLocalQueueExpireInterval)); - - _cleaningLocalQueueExpireInterval = value; - } - } - - private int _cleaningExpireInterval = 300; - - /// - /// Delete expired event interval - /// Default is 300 seconds. - /// unit: seconds - /// - public int CleaningExpireInterval - { - get => _cleaningExpireInterval; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(CleaningExpireInterval)); - - _cleaningExpireInterval = value; - } - } - - private long _publishedExpireTime = 24 * 3600; - - /// - /// Expiration time, when the message status is successful and has expired, it will be deleted by the scheduled task - /// Default: ( 24 * 3600 )s - /// - public long PublishedExpireTime - { - get => _publishedExpireTime; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(PublishedExpireTime)); - - _publishedExpireTime = value; - } - } - - private int _deleteBatchCount = 1000; - - /// - /// Bulk delete expired messages - /// - public int DeleteBatchCount - { - get => _deleteBatchCount; - set - { - if (value <= 0) - throw new ArgumentException("must be greater than 0", nameof(DeleteBatchCount)); - - _deleteBatchCount = value; - } - } - - public Func? GetCurrentTime { get; set; } - - public List AllEventTypes { get; } - - private DispatcherOptions(IServiceCollection services) => Services = services; - - public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) - : this(services) - { - if (assemblies == null || assemblies.Length == 0) - throw new ArgumentException(nameof(assemblies)); - - Assemblies = assemblies; - AllEventTypes = assemblies - .SelectMany(assembly => assembly.GetTypes()) - .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) - .ToList(); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs deleted file mode 100644 index c2e0fa40d..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; - -public class DeleteLocalQueueExpiresProcessor : ProcessorBase -{ - private readonly IOptions _options; - - public override int Delay => _options.Value.CleaningLocalQueueExpireInterval; - - public DeleteLocalQueueExpiresProcessor(IOptions options) : base(null) - { - _options = options; - } - - /// - /// Delete expired events - /// - /// - protected override void Executing() - { - LocalQueueProcessor.Default.Delete(_options.Value.LocalRetryTimes); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs deleted file mode 100644 index 0f7e3635b..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; - -public class DeletePublishedExpireEventProcessor : ProcessorBase -{ - private readonly IOptions _options; - - public override int Delay => _options.Value.CleaningExpireInterval; - - public DeletePublishedExpireEventProcessor(IServiceProvider serviceProvider, IOptions options) - : base(serviceProvider) - { - _options = options; - } - - /// - /// Delete expired events - /// - /// - /// - protected override async Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) - { - var logService = serviceProvider.GetRequiredService(); - var expireDate = (_options.Value.GetCurrentTime?.Invoke() ?? DateTime.UtcNow).AddSeconds(-_options.Value.PublishedExpireTime); - await logService.DeleteExpiresAsync(expireDate, _options.Value.DeleteBatchCount, stoppingToken); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs deleted file mode 100644 index bdbca3659..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; - -public class InfiniteLoopProcessor : ProcessorBase -{ - private readonly IProcessor _processor; - private readonly ILogger? _logger; - - public InfiniteLoopProcessor(IServiceProvider serviceProvider, IProcessor processor) - : base(serviceProvider) - { - _processor = processor; - _logger = serviceProvider.GetService>(); - } - - public override async Task ExecuteAsync(CancellationToken stoppingToken) - { - while (!stoppingToken.IsCancellationRequested) - { - try - { - await _processor.ExecuteAsync(stoppingToken); - await DelayAsync(((ProcessorBase)_processor).Delay); - } - catch (OperationCanceledException ex) - { - //ignore - _logger?.LogWarning("Operation canceled", ex); - } - catch (Exception ex) - { - _logger?.LogWarning(ex, "Processor '{ProcessorName}' failed", _processor.ToString()); - - await DelayAsync(2); - } - } - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs deleted file mode 100644 index 944229d6f..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; - -public abstract class ProcessorBase : IProcessor -{ - protected readonly IServiceProvider? ServiceProvider; - - /// - /// Task delay time, unit: seconds - /// - public virtual int Delay { get; } - - protected ProcessorBase(IServiceProvider? serviceProvider) => ServiceProvider = serviceProvider; - - public virtual async Task ExecuteAsync(CancellationToken stoppingToken) - { - if (ServiceProvider != null) - { - var unitOfWorkManager = ServiceProvider.GetRequiredService(); - var dataConnectionStringProvider = ServiceProvider.GetRequiredService(); - var optionsList = dataConnectionStringProvider.DbContextOptionsList; - foreach (var option in optionsList) - { - await using var unitOfWork = unitOfWorkManager.CreateDbContext(option); - await ExecuteAsync(unitOfWork.ServiceProvider, stoppingToken); - } - } - else - { - Executing(); - } - } - - // /// - // /// Easy to switch between background tasks - // /// - /// unit: seconds - // /// - public Task DelayAsync(int delay) => Task.Delay(TimeSpan.FromSeconds(delay)); - - protected virtual Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) => Task.CompletedTask; - - protected virtual void Executing() { } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs deleted file mode 100644 index e75b0da5e..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; - -public class RetryByDataProcessor : ProcessorBase -{ - private readonly IServiceProvider _serviceProvider; - private readonly IOptions _options; - private readonly IOptionsMonitor? _appConfig; - private readonly ILogger? _logger; - - public override int Delay => _options.Value.FailedRetryInterval; - - public RetryByDataProcessor( - IServiceProvider serviceProvider, - IOptions options, - IOptionsMonitor? appConfig = null, - ILogger? logger = null) : base(serviceProvider) - { - _serviceProvider = serviceProvider; - _appConfig = appConfig; - _options = options; - _logger = logger; - } - - protected override async Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) - { - var unitOfWork = serviceProvider.GetService(); - if (unitOfWork != null) - unitOfWork.UseTransaction = false; - - var publisher = serviceProvider.GetRequiredService(); - var eventLogService = serviceProvider.GetRequiredService(); - - var retrieveEventLogs = - await eventLogService.RetrieveEventLogsFailedToPublishAsync(_options.Value.RetryBatchSize, _options.Value.MaxRetryTimes, - _options.Value.MinimumRetryInterval); - - foreach (var eventLog in retrieveEventLogs) - { - try - { - if (LocalQueueProcessor.Default.IsExist(eventLog.EventId)) - continue; // The local queue is retrying, no need to retry - - await eventLogService.MarkEventAsInProgressAsync(eventLog.EventId); - - _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", - eventLog, - eventLog.Event.Topic); - - await publisher.PublishAsync(eventLog.Event.Topic, eventLog.Event, stoppingToken); - - LocalQueueProcessor.Default.RemoveJobs(eventLog.EventId); - - await eventLogService.MarkEventAsPublishedAsync(eventLog.EventId); - } - catch (UserFriendlyException) - { - //Update state due to multitasking contention, no processing required - } - catch (Exception ex) - { - _logger?.LogError(ex, - "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", - eventLog.EventId, _appConfig?.CurrentValue.AppId ?? string.Empty, eventLog); - await eventLogService.MarkEventAsFailedAsync(eventLog.EventId); - } - } - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs deleted file mode 100644 index eca5e4715..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; - -public class RetryByLocalQueueProcessor : ProcessorBase -{ - private readonly IOptionsMonitor? _appConfig; - private readonly IOptions _options; - private readonly ILogger? _logger; - - public override int Delay => _options.Value.LocalFailedRetryInterval; - - public RetryByLocalQueueProcessor( - IServiceProvider serviceProvider, - IOptions options, - IOptionsMonitor? appConfig = null, - ILogger? logger = null) : base(serviceProvider) - { - _appConfig = appConfig; - _options = options; - _logger = logger; - } - - protected override async Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) - { - var unitOfWork = serviceProvider.GetService(); - if (unitOfWork != null) - unitOfWork.UseTransaction = false; - - var publisher = serviceProvider.GetRequiredService(); - var eventLogService = serviceProvider.GetRequiredService(); - - var retrieveEventLogs = - LocalQueueProcessor.Default.RetrieveEventLogsFailedToPublishAsync(_options.Value.LocalRetryTimes, - _options.Value.RetryBatchSize); - - foreach (var eventLog in retrieveEventLogs) - { - try - { - LocalQueueProcessor.Default.RetryJobs(eventLog.EventId); - - await eventLogService.MarkEventAsInProgressAsync(eventLog.EventId); - - _logger?.LogDebug( - "Publishing integration event {Event} to {TopicName}", - eventLog, - eventLog.Topic); - - await publisher.PublishAsync(eventLog.Topic, eventLog.Event, stoppingToken); - - await eventLogService.MarkEventAsPublishedAsync(eventLog.EventId); - - LocalQueueProcessor.Default.RemoveJobs(eventLog.EventId); - } - catch (UserFriendlyException) - { - //Update state due to multitasking contention - LocalQueueProcessor.Default.RemoveJobs(eventLog.EventId); - } - catch (Exception ex) - { - _logger?.LogError(ex, - "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", - eventLog.EventId, _appConfig?.CurrentValue.AppId ?? string.Empty, eventLog); - await eventLogService.MarkEventAsFailedAsync(eventLog.EventId); - } - } - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.md deleted file mode 100644 index fd7da4bf1..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.md +++ /dev/null @@ -1,119 +0,0 @@ -[中](README.zh-CN.md) | EN - -## IntegrationEventBus - -Example: - -``` C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //Use cross-process -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //For example, use dapr to provide pub and sub capabilities, or you can choose other implementations by yourself -Install-Package Masa.Contrib.Data.UoW.EF //Use UnitOfWork -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // Use SqlServer -``` - -1. Add IIntegrationEventBus - -1.1 Specify the local message service - -``` C# -builder.Services - .AddIntegrationEventBus(options=> - { - options.UseDapr();//Use Dapr to provide pub/sub capabilities, or you can choose other - options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//Use unit of work, recommended; - }); -``` - -> CustomIntegrationEventLogService (custom local message service) needs to inherit IIntegrationEventLogService, and the parameters in the constructor must support getting from CI - -1.2 Use the provided EF version of the local message service - -Install `Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF` - -``` C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //Record cross-process message log -``` - -``` C# -builder.Services - .AddIntegrationEventBus(options=> - { - options.UseDapr();//Use Dapr to provide pub/sub capabilities, or you can choose other - options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//Use unit of work, recommended - .UseEventLog(); - }); -``` - -> CustomerDbContext needs to inherit MasaDbContext - -2. Custom IntegrationEvent - -``` C# -public class DemoIntegrationEvent : IntegrationEvent -{ - public override string Topic { get; set; } = nameof(DemoIntegrationEvent);//dapr topic name - - //todo Custom attribute parameters -} -``` - -3. Custom CustomDbContext - -``` C# -public class CustomDbContext : MasaDbContext -{ - public DbSet Users { get; set; } = null!; - - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - - } -} -``` - -4. Send Event - -``` C# -IIntegrationEventBus eventBus;//Get IIntegrationEventBus through DI -await eventBus.PublishAsync(new DemoIntegrationEvent());//Send cross-process events -``` - -### retry policy - -```C# -builder.Services - .AddIntegrationEventBus(options=> - { - options.UseDapr();//Use Dapr to provide pub/sub capabilities, or you can choose other - // options.MaxRetryTimes = 50;//Maximum number of retries, default: 50 - // options.RetryBatchSize = 100;//Number of single retry events, used to get retry events from persistent data source, default 100 - // options.FailedRetryInterval = 60;//Persistent data source retry pause interval, default 60s - // options.CleaningExpireInterval = 300;//Clearing expired event pause interval, unit: s, default 300s - // options.ExpireDate = 24 * 3600;//Expiration time, CreationTime + ExpireDate = Expiration time, default 1 day - - // options.LocalFailedRetryInterval = 3;//Local queue retry pause interval, default 3s - // options.CleaningLocalQueueExpireInterval = 60;//Clearing local queue expired event pause interval, unit: s, default 60s - }); -``` - -Retry is divided into local queue retry and retry from persistent data source: - -local queue: - -Features: -- Short retry interval, support second-level retry interval -- Get data from memory, faster -- After the system crashes, the previous local queue will not be rebuilt, and will be automatically demoted to the persistent queue to retry the task - -Persistent data source queue: - -Features: - -- After the system crashes, the retry queue can be obtained from db or other persistent sources to ensure 100% retry of events -- As a downgrade solution for local memory queues, lower pressure on db or other data sources - -In the case of a single copy, the tasks of the two queues will only be executed in a single queue, and there will be no simultaneous execution of the two queues. -In the case of multiple copies, the same task may be executed by multiple copies. Although we have made idempotent, but the delivery guarantee is At Least Once, it is still possible that the event publishing is successful, but the state change fails. -At this point, the event may be re-sent. We recommend that the task executor retry across events. - -> At present, the standardized Sub capability is not supported, and the native writing method of the implementer is temporarily used. \ No newline at end of file diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md deleted file mode 100644 index f5f1810b2..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md +++ /dev/null @@ -1,119 +0,0 @@ -中 | [EN](README.md) - -## IntegrationEventBus - -用例: - -```C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //使用跨进程事件 -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //例如使用dapr提供pub、sub能力,也可自行选择其他实现 -Install-Package Masa.Contrib.Data.UoW.EF //使用工作单元 -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // 使用SqlServer -``` - -1. 添加IIntegrationEventBus - -1.1 指定本地消息服务 - -```C# -builder.Services - .AddIntegrationEventBus(options=> - { - options.UseDapr();//使用Dapr提供pub/sub能力,也可以自行选择其他的 - options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//使用工作单元,推荐使用; - }); -``` - -> CustomIntegrationEventLogService(自定义本地消息服务)需继承IIntegrationEventLogService,并且构造函数中的参数必须支持从CI获取 - -1.2 使用提供的EF版的本地消息服务 - -安装`Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF` - -``` C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //记录跨进程消息日志 -``` - -```C# -builder.Services - .AddIntegrationEventBus(options=> - { - options.UseDapr();//使用Dapr提供pub/sub能力,也可以自行选择其他的 - options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//使用工作单元,推荐使用 - .UseEventLog(); - }); -``` - -> CustomerDbContext 需要继承MasaDbContext - -2. 自定义 IntegrationEvent - -```C# -public class DemoIntegrationEvent : IntegrationEvent -{ - public override string Topic { get; set; } = nameof(DemoIntegrationEvent);//dapr topic name - - //todo 自定义属性参数 -} -``` - -3. 自定义CustomDbContext - -```C# -public class CustomDbContext : MasaDbContext -{ - public DbSet Users { get; set; } = null!; - - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - - } -} -``` - -4. 发送 Event - -```C# -IIntegrationEventBus eventBus;//通过DI得到IIntegrationEventBus -await eventBus.PublishAsync(new DemoIntegrationEvent());//发送跨进程事件 -``` - -### 重试策略 - -```C# -builder.Services - .AddIntegrationEventBus(options=> - { - options.UseDapr();//使用Dapr提供pub/sub能力,也可以自行选择其他的 - // options.MaxRetryTimes = 50;//最大重试次数, 默认:50 - // options.RetryBatchSize = 100;//单次重试事件数量, 用于从持久化数据源获取待重试事件, 默认100 - // options.FailedRetryInterval = 60;//持久化数据源重试停歇间隔, 默认60s - // options.CleaningExpireInterval = 300;//清除已过期事件停歇间隔,单位:s, 默认 300s - // options.ExpireDate = 24 * 3600;//过期时间,CreationTime + ExpireDate = 过期时间, 默认1天 - - // options.LocalFailedRetryInterval = 3;//本地队列重试停歇间隔, 默认3s - // options.CleaningLocalQueueExpireInterval = 60;//清除本地队列已过期事件停歇间隔,单位:s, 默认 60s - }); -``` - -重试分为本地队列重试以及从持久化数据源重试两种: - -本地队列: - -特点: -- 重试间隔短,支持秒级别重试间隔 -- 从内存获取数据,速度更快 -- 系统崩溃后,之前的本地队列不会重建,自动降级到持久化队列中重试任务 - -持久化数据源队列: - -特点: - -- 系统崩溃后,可以从db或者其他持久化源获取重试队列,确保事件100%重试 -- 作为本地内存队列的降级方案,对db或者其他数据源压力更低 - -在单副本情况下,两种队列的任务仅会在单个队列中执行,不会存在两个队列同时执行的情况。 -在多副本情况下,同一个任务可能会被多个副本所执行,虽然我们有做幂等,但为交付保证是 At Least Once,仍然有可能出现事件发布成功,但状态更改失败的情况, -此时事件可能会重发,我们建议任务执行者做好对跨事件的重试 - -> 目前还未支持标准化的Sub能力,暂时使用实现方原生的写法 diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs deleted file mode 100644 index 42f70b04e..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Servers; - -public class DefaultHostedService : IProcessingServer -{ - private readonly IServiceProvider _serviceProvider; - private readonly IEnumerable _processors; - - public DefaultHostedService(IServiceProvider serviceProvider, IEnumerable processors) - { - _serviceProvider = serviceProvider; - _processors = processors; - } - - public Task ExecuteAsync(CancellationToken stoppingToken) - { - if (_serviceProvider.GetService() == null) - return Task.CompletedTask; - - var processorTasks = _processors.Select(processor => new InfiniteLoopProcessor(_serviceProvider, processor)) - .Select(process => process.ExecuteAsync(stoppingToken)); - return Task.WhenAll(processorTasks); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs deleted file mode 100644 index f4617dae6..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddIntegrationEventBus( - this IServiceCollection services, - Action? options = null) - => services.AddIntegrationEventBus(AppDomain.CurrentDomain.GetAssemblies(), options); - - public static IServiceCollection AddIntegrationEventBus( - this IServiceCollection services, - Assembly[] assemblies, - Action? options = null) - => services.TryAddIntegrationEventBus(assemblies, options); - - public static IServiceCollection AddIntegrationEventBus( - this IServiceCollection services, - Action? options = null) - where TIntegrationEventLogService : class, IIntegrationEventLogService - => services.AddIntegrationEventBus(AppDomain.CurrentDomain.GetAssemblies(), options); - - public static IServiceCollection AddIntegrationEventBus( - this IServiceCollection services, - Assembly[] assemblies, - Action? options = null) - where TIntegrationEventLogService : class, IIntegrationEventLogService - => services.TryAddIntegrationEventBus(assemblies, options); - - internal static IServiceCollection TryAddIntegrationEventBus( - this IServiceCollection services, - Assembly[] assemblies, - Action? options) - where TIntegrationEventLogService : class, IIntegrationEventLogService - { - return services.TryAddIntegrationEventBus(assemblies, options, () => - { - services.AddScoped(); - }); - } - - internal static IServiceCollection TryAddIntegrationEventBus( - this IServiceCollection services, - Assembly[] assemblies, - Action? options, - Action? action = null) - { - if (services.Any(service => service.ImplementationType == typeof(IntegrationEventBusProvider))) - return services; - - services.AddSingleton(); - - var dispatcherOptions = new DispatcherOptions(services, assemblies); - options?.Invoke(dispatcherOptions); - - services.TryAddSingleton(typeof(IOptions), - serviceProvider => Microsoft.Extensions.Options.Options.Create(dispatcherOptions)); - - LocalQueueProcessor.SetLogger(services); - services.AddScoped(); - action?.Invoke(); - - if (services.Any(d => d.ServiceType == typeof(IIntegrationEventLogService))) - { - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - } - services.TryAddSingleton(); - - services.AddHostedService(); - if (services.All(service => service.ServiceType != typeof(IUnitOfWork))) - { - var logger = services.BuildServiceProvider().GetService>(); - logger?.LogDebug("UoW is not enabled or add delay, UoW is not used will affect 100% delivery of the message"); - } - - if (services.All(d => d.ServiceType != typeof(IPublisher))) - throw new NotSupportedException($"{nameof(IPublisher)} has no implementing"); - - return services; - } - - private class IntegrationEventBusProvider - { - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs deleted file mode 100644 index 5b99e8c77..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/src/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -global using Masa.Contrib.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Internal; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Options; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Processor; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Servers; -global using Masa.Utils.Models.Config; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using System.Collections.Concurrent; -global using System.Reflection; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs deleted file mode 100644 index 3fd775ccc..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests; - -[TestClass] -public class DispatcherOptionTest -{ - private DispatcherOptions _options; - - [TestInitialize] - public void Initialize() - { - var services = new ServiceCollection(); - _options = new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies()); - } - - [TestMethod] - public void TestEmptyPubSub() - { - Assert.ThrowsException(() => _options.PubSubName = ""); - } - - [TestMethod] - public void TestSetPubSub() - { - Assert.IsTrue(_options.PubSubName == "pubsub"); - _options.PubSubName = "pubsub2"; - Assert.IsTrue(_options.PubSubName == "pubsub2"); - } - - [TestMethod] - public void UseDaprEventBus() - { - Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); - var services = new ServiceCollection(); - Mock distributedDispatcherOptions = new(); - distributedDispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); - distributedDispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies).Verifiable(); - distributedDispatcherOptions.Object.UseDaprEventBus("pubsub2"); - var serviceProvider = services.BuildServiceProvider(); - - var integrationEventBus = serviceProvider.GetService(); - Assert.IsNotNull(integrationEventBus); - - var publisher = serviceProvider.GetService(); - Assert.IsNotNull(publisher); - - var field = publisher.GetType().GetField("_pubSubName", BindingFlags.Instance | BindingFlags.NonPublic); - Assert.IsNotNull(field); - var fieldValue = field.GetValue(publisher); - Assert.IsNotNull(fieldValue); - Assert.IsTrue(fieldValue.ToString() == "pubsub2"); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs deleted file mode 100644 index 71376914e..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests; - -[TestClass] -public class IntegrationEventBusTest -{ - private Mock _options; - private Mock> _dispatcherOptions; - private Mock _eventLog; - private Mock> _appConfig; - private Mock _uoW; - - [TestInitialize] - public void Initialize() - { - _options = new(); - _options.Setup(option => option.Services).Returns(new ServiceCollection()).Verifiable(); - _dispatcherOptions = new(); - _dispatcherOptions - .Setup(option => option.Value) - .Returns(() => new DispatcherOptions(_options.Object.Services, AppDomain.CurrentDomain.GetAssemblies())); - _eventLog = new(); - _eventLog.Setup(eventLog => eventLog.SaveEventAsync(It.IsAny(), null!)).Verifiable(); - _eventLog.Setup(eventLog => eventLog.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); - _eventLog.Setup(eventLog => eventLog.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); - _eventLog.Setup(eventLog => eventLog.MarkEventAsFailedAsync(It.IsAny())).Verifiable(); - _appConfig = new(); - _appConfig.Setup(appConfig => appConfig.CurrentValue).Returns(() => new AppConfig() - { - AppId = "Test" - }); - _uoW = new(); - _uoW.Setup(uoW => uoW.CommitAsync(default)).Verifiable(); - _uoW.Setup(uoW => uoW.Transaction).Returns(() => null!); - _uoW.Setup(uoW => uoW.UseTransaction).Returns(true); - } - - [TestMethod] - public void TestDispatcherOption() - { - var services = new ServiceCollection(); - DispatcherOptions options; - - Assert.ThrowsException(() => - { - options = new DispatcherOptions(services, null!); - }); - Assert.ThrowsException(() => - { - options = new DispatcherOptions(services, Array.Empty()); - }); - options = new DispatcherOptions(services, new[] { typeof(IntegrationEventBusTest).Assembly }); - Assert.IsTrue(options.Services.Equals(services)); - var allEventTypes = new[] { typeof(IntegrationEventBusTest).Assembly }.SelectMany(assembly => assembly.GetTypes()) - .Where(type => type.IsClass && type != typeof(IntegrationEvent) && typeof(IEvent).IsAssignableFrom(type)).ToList(); - Assert.IsTrue(options.AllEventTypes.Count == allEventTypes.Count()); - } - - [TestMethod] - public void TestAddMultDaprEventBus() - { - var services = new ServiceCollection(); - Mock distributedDispatcherOptions = new(); - distributedDispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); - distributedDispatcherOptions.Setup(option => option.Assemblies).Returns(AppDomain.CurrentDomain.GetAssemblies()).Verifiable(); - distributedDispatcherOptions.Object - .UseDaprEventBus() - .UseDaprEventBus(); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestAddDaprEventBus() - { - IServiceCollection services = new ServiceCollection(); - services.AddDaprEventBus(); - var serviceProvider = services.BuildServiceProvider(); - var integrationEventBus = serviceProvider.GetRequiredService(); - Assert.IsNotNull(integrationEventBus); - } - - [TestMethod] - public void TestNotUseLoggerAndUoW() - { - IServiceCollection services = new ServiceCollection(); - services.AddLogging(); - services - .AddDaprEventBus< - CustomIntegrationEventLogService>(); //The logger cannot be mocked and cannot verify that the logger is executed only once - - var serviceProvider = services.BuildServiceProvider(); - var integrationEventBus = serviceProvider.GetRequiredService(); - Assert.IsNotNull(integrationEventBus); - } - - [TestMethod] - public void TestUseLogger() - { - IServiceCollection services = new ServiceCollection(); - - services.AddDaprEventBus(AppDomain.CurrentDomain.GetAssemblies(), option => - { - option.PubSubName = "pubsub"; - }); - var serviceProvider = services.BuildServiceProvider(); - var integrationEventBus = serviceProvider.GetRequiredService(); - Assert.IsNotNull(integrationEventBus); - } - - [TestMethod] - public void TestAddDaprEventBusAndNullServicesAsync() - { - IServiceCollection services = null!; - Mock distributedDispatcherOptions = new(); - distributedDispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); - distributedDispatcherOptions.Setup(option => option.Assemblies).Returns(AppDomain.CurrentDomain.GetAssemblies()).Verifiable(); - Assert.ThrowsException(() => - distributedDispatcherOptions.Object.UseDaprEventBus(), - $"Value cannot be null. (Parameter '{nameof(_options.Object.Services)}')"); - } - - [TestMethod] - public void TestUseDaprReturnNotNull() - { - var services = new ServiceCollection(); - services.AddIntegrationEventBus(opt => - { - opt.UseDapr(); - }); - Mock eventLogService = new(); - services.AddScoped(_ => eventLogService.Object); - - var serviceProvider = services.BuildServiceProvider(); - var publisher = serviceProvider.GetService(); - Assert.IsNotNull(publisher); - var integrationEventBus = serviceProvider.GetService(); - Assert.IsNotNull(integrationEventBus); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj deleted file mode 100644 index a6d684bda..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - net6.0 - enable - enable - - false - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs deleted file mode 100644 index 6a3920cf1..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests; - -[TestClass] -public class ProcessorTest -{ - private IServiceProvider _serviceProvider; - private IOptions _options; - - [TestInitialize] - public void Initialize() - { - var services = new ServiceCollection(); - services.AddDaprEventBus(); - _serviceProvider = services.BuildServiceProvider(); - _options = Microsoft.Extensions.Options.Options.Create(new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies())); - } - - [TestMethod] - public async Task DeletePublishedExpireEventProcessorExecuteTestAsync() - { - Mock integrationEventLogService = new(); - integrationEventLogService.Setup(service => service.DeleteExpiresAsync(It.IsAny(), It.IsAny(), default)) - .Verifiable(); - _options.Value.Services.AddScoped(_ => integrationEventLogService.Object); - - Mock uoW = new(); - uoW.Setup(uow => uow.ServiceProvider).Returns(_options.Value.Services.BuildServiceProvider()).Verifiable(); - - Mock unitOfWorkManager = new(); - unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) - .Verifiable(); - _options.Value.Services.AddSingleton(_ => unitOfWorkManager.Object); - - Mock dataConnectionStringProvider = new(); - dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List() - { - new(string.Empty) - }).Verifiable(); - _options.Value.Services.AddSingleton(_ => dataConnectionStringProvider.Object); - - var processor = new DeletePublishedExpireEventProcessor(_options.Value.Services.BuildServiceProvider(), _options); - await processor.ExecuteAsync(default); - - integrationEventLogService.Verify(service => service.DeleteExpiresAsync(It.IsAny(), It.IsAny(), default), - Times.Once); - } - - [TestMethod] - public async Task InfiniteLoopProcessorExecuteTestAsync() - { - Mock processor = new(); - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(3000); - processor.Setup(pro => pro.ExecuteAsync(cancellationTokenSource.Token)).Verifiable(); - - InfiniteLoopProcessor infiniteLoopProcessor = new InfiniteLoopProcessor(_serviceProvider, processor.Object); - await infiniteLoopProcessor.ExecuteAsync(cancellationTokenSource.Token); - - processor.Verify(pro => pro.ExecuteAsync(cancellationTokenSource.Token), Times.AtLeastOnce); - } - - [TestMethod] - public async Task InfiniteLoopProcessorExecuteAndUseLoggerTestAsync() - { - Mock processor = new(); - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(3000); - processor.Setup(pro => pro.ExecuteAsync(cancellationTokenSource.Token)).Verifiable(); - - InfiniteLoopProcessor infiniteLoopProcessor = - new InfiniteLoopProcessor(_serviceProvider, processor.Object); - await infiniteLoopProcessor.ExecuteAsync(cancellationTokenSource.Token); - - processor.Verify(pro => pro.ExecuteAsync(cancellationTokenSource.Token), Times.AtLeastOnce); - } - - [TestMethod] - public async Task DefaultHostedServiceTestAsync() - { - var services = new ServiceCollection(); - Mock unitOfWorkManager = new(); - services.AddSingleton(_ => unitOfWorkManager.Object); - services.AddScoped(); - services.AddDaprEventBus(opt => - { - opt.CleaningLocalQueueExpireInterval = 1; - opt.CleaningExpireInterval = 1; - opt.FailedRetryInterval = 1; - opt.LocalFailedRetryInterval = 1; - }); - var serviceProvider = services.BuildServiceProvider(); - var hostedService = serviceProvider.GetService(); - Assert.IsNotNull(hostedService); - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(5000); - await hostedService.ExecuteAsync(cancellationTokenSource.Token); - - Assert.IsTrue(CustomProcessor.Times > 0); - } - - [TestMethod] - public async Task DefaultHostedServiceAndUseLoggerTestAsync() - { - var services = new ServiceCollection(); - Mock unitOfWorkManager = new(); - services.AddSingleton(_ => unitOfWorkManager.Object); - services.AddLogging(); - services.AddScoped(); - services.AddDaprEventBus(opt => - { - opt.CleaningLocalQueueExpireInterval = 1; - opt.CleaningExpireInterval = 1; - opt.FailedRetryInterval = 1; - opt.LocalFailedRetryInterval = 1; - }); - var serviceProvider = services.BuildServiceProvider(); - var hostedService = serviceProvider.GetService(); - Assert.IsNotNull(hostedService); - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(5000); - await hostedService.ExecuteAsync(cancellationTokenSource.Token); - - Assert.IsTrue(CustomProcessor.Times > 0); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs deleted file mode 100644 index 30d002d09..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.Options; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Options; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Processor; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; -global using Masa.Utils.Models.Config; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Reflection; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs deleted file mode 100644 index b83c9b1fe..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Domain.Entities; - -public class User -{ - public string Id { get; set; } - - public string Name { get; set; } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs deleted file mode 100644 index f7403095a..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Events; - -public abstract record IntegrationEvent : IIntegrationEvent -{ - public Guid Id { get; set; } - - public DateTime CreationTime { get; set; } - - [JsonIgnore] - public IUnitOfWork? UnitOfWork { get; set; } - - public abstract string Topic { get; set; } - - public IntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } - - public IntegrationEvent(Guid Id, DateTime CreationTime) - { - this.Id = Id; - this.CreationTime = CreationTime; - } - - public Guid GetEventId() => Id; - - public void SetEventId(Guid eventId) => Id = eventId; - - public DateTime GetCreationTime() => CreationTime; - - public void SetCreationTime(DateTime creationTime) => CreationTime = creationTime; -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs deleted file mode 100644 index 93ff694be..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Events; - -internal record OrderPaymentSucceededIntegrationEvent : IntegrationEvent -{ - public string OrderId { get; set; } - - public long PaymentTime { get; set; } - - public override string Topic { get; set; } = nameof(OrderPaymentSucceededIntegrationEvent); -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs deleted file mode 100644 index b76ea0101..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Infrastructure; - -internal class CustomDbContext : MasaDbContext -{ - public DbSet Users { get; set; } = null!; - - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs deleted file mode 100644 index f19970b41..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests; - -[TestClass] -public class IntegrationEventLogContextTest : TestBase -{ - [TestMethod] - public void TestCreateDbContext() - { - var services = new ServiceCollection(); - services.AddMasaDbContext(builder => builder.UseSqlite(ConnectionString)); - var distributedDispatcherOptions = CreateDispatcherOptions(services); - distributedDispatcherOptions.UseEventLog(); - var serviceProvider = services.BuildServiceProvider(); - - var customDbContext = serviceProvider.GetRequiredService(); - var entity = customDbContext.Model.GetEntityTypes() - .FirstOrDefault(entityType => entityType.Name == typeof(IntegrationEventLog).FullName)!; - - Assert.IsTrue(entity.GetTableName() == "IntegrationEventLog"); - var properties = entity.GetProperties().ToList(); - Assert.IsTrue(properties.Where(x => x.Name == "Id").Select(x => x.IsPrimaryKey()).FirstOrDefault()); - Assert.IsFalse(properties.Where(x => x.Name == "Id").Select(x => x.IsNullable).FirstOrDefault()); - Assert.IsFalse(properties.Where(x => x.Name == "Content").Select(x => x.IsNullable).FirstOrDefault()); - Assert.IsFalse(properties.Where(x => x.Name == "CreationTime").Select(x => x.IsNullable).FirstOrDefault()); - Assert.IsFalse(properties.Where(x => x.Name == "State").Select(x => x.IsNullable).FirstOrDefault()); - Assert.IsFalse(properties.Where(x => x.Name == "TimesSent").Select(x => x.IsNullable).FirstOrDefault()); - Assert.IsFalse(properties.Where(x => x.Name == "EventTypeName").Select(x => x.IsNullable).FirstOrDefault()); - - var integrationEventLogDbContext = serviceProvider.GetRequiredService(); - Assert.IsTrue(customDbContext == integrationEventLogDbContext.DbContext); - } - - [TestMethod] - public void TestAddDbContext() - { - var services = new ServiceCollection(); - services.AddDbContext(options => options.UseSqlite(Connection)); - var serviceProvider = services.BuildServiceProvider(); - - var dbContext = serviceProvider.GetService(); - Assert.IsTrue(dbContext == null); - - Assert.ThrowsException(() => serviceProvider.GetService()); - } - - [TestMethod] - public void TestUseEventLog() - { - var distributedDispatcherOptions = CreateDispatcherOptions(new ServiceCollection()); - distributedDispatcherOptions.Services.AddDbContext(options => options.UseSqlite(Connection)); - distributedDispatcherOptions.UseEventLog(); - var serviceProvider = distributedDispatcherOptions.Services.BuildServiceProvider(); - - Assert.ThrowsException(() => serviceProvider.GetService()); - - Assert.ThrowsException(() => serviceProvider.GetService()); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs deleted file mode 100644 index 71c610d92..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests; - -[TestClass] -public class IntegrationEventLogServiceTest : TestBase -{ - [TestMethod] - public async Task TestNullDbTransactionAsync() - { - var services = new ServiceCollection(); - services.AddMasaDbContext(builder => builder.UseTestSqlite(ConnectionString)) - .AddScoped(); - IDispatcherOptions dispatcherOptions = CreateDispatcherOptions(services); - dispatcherOptions.UseEventLog(); - var serviceProvider = services.BuildServiceProvider(); - - DbTransaction transaction = null!; - var @event = new OrderPaymentSucceededIntegrationEvent() - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - - var eventLogService = serviceProvider.GetRequiredService(); - await Assert.ThrowsExceptionAsync(async () => await eventLogService.SaveEventAsync(@event, transaction)); - } - - [TestMethod] - public void TestNullServices() - { - var dispatcherOptions = CreateDispatcherOptions(null!); - - Assert.ThrowsException(() => - { - dispatcherOptions.UseEventLog(); - }); - } - - [TestMethod] - public void TestAddMultEventLog() - { - var services = new ServiceCollection(); - IDispatcherOptions dispatcherOptions = CreateDispatcherOptions(services); - dispatcherOptions.UseEventLog().UseEventLog(); - Assert.IsTrue(services.Count(service => service.ImplementationType == typeof(IntegrationEventLogModelCreatingProvider)) == 1); - Assert.IsTrue(services.Count(service => service.ServiceType == typeof(IntegrationEventLogContext)) == 1); - } - - [TestMethod] - public async Task TestRetrieveEventLogsFailedToPublishAsync() - { - var dispatcherOptions = CreateDispatcherOptions(new ServiceCollection()); - dispatcherOptions.UseEventLog(); - dispatcherOptions.Services.AddMasaDbContext(option => option.UseTestSqlite(Connection)); - dispatcherOptions.Services.AddScoped(); - var serviceProvider = dispatcherOptions.Services.BuildServiceProvider(); - await serviceProvider.GetRequiredService().Database.EnsureCreatedAsync(); - var logService = serviceProvider.GetRequiredService(); - var list = await logService.RetrieveEventLogsFailedToPublishAsync(); - Assert.IsTrue(!list.Any()); - } - - [TestMethod] - public async Task TestRetrieveEventLogsFailedToPublish2Async() - { - var response = await InitializeAsync(); - - #region Initialization data - - var logs = await response.CustomDbContext.Set().ToListAsync(); - response.CustomDbContext.Set().RemoveRange(logs); - - var @event = new OrderPaymentSucceededIntegrationEvent - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await response.CustomDbContext.Set().AddAsync(new IntegrationEventLog(@event, Guid.NewGuid()) - { - State = IntegrationEventStates.InProgress, - ModificationTime = DateTime.UtcNow.AddSeconds(-120), - }); - await response.CustomDbContext.SaveChangesAsync(); - - #endregion - - var logService = response.ServiceProvider.GetRequiredService(); - var list = (await logService.RetrieveEventLogsFailedToPublishAsync()).ToList(); - Assert.IsTrue(list.Count == 1); - - var eventLog = list.Select(log => log.Event).FirstOrDefault()!; - Assert.IsTrue(eventLog.Equals(@event)); - } - - [TestMethod] - public async Task TestSaveEventAsync() - { - var response = await InitializeAsync(); - - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); - - await using (var transcation = await response.CustomDbContext.Database.BeginTransactionAsync()) - { - var logService = response.ServiceProvider.GetRequiredService(); - var @event = new OrderPaymentSucceededIntegrationEvent - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); - await transcation.CommitAsync(); - } - - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 1); - - Assert.IsTrue(await response.CustomDbContext.Set() - .CountAsync(log => log.State == IntegrationEventStates.NotPublished) == 1); - } - - [TestMethod] - public async Task TestSaveEventByExceptionAsync() - { - var response = await InitializeAsync(); - - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); - - await Assert.ThrowsExceptionAsync(async () => - { - await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); - var logService = response.ServiceProvider.GetRequiredService(); - var @event = new OrderPaymentSucceededIntegrationEvent - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); - throw new Exception("custom exception"); - }, "custom exception"); - - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); - } - - [TestMethod] - public async Task TestMarkEventAsInProgressAsync() - { - var response = await InitializeAsync(); - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); - - await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); - var logService = response.ServiceProvider.GetRequiredService(); - var @event = new OrderPaymentSucceededIntegrationEvent - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); - - await logService.MarkEventAsInProgressAsync(@event.Id); - Assert.IsTrue(await response.CustomDbContext.Set() - .CountAsync(log => log.State == IntegrationEventStates.InProgress) == 1); - await transcation.CommitAsync(); - - Assert.IsTrue(await response.CustomDbContext.Set() - .CountAsync(log => log.State == IntegrationEventStates.InProgress) == 1); - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 1); - } - - [TestMethod] - public async Task TestMarkEventAsInProgress2Async() - { - var response = await InitializeAsync(); - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); - - await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); - var logService = response.ServiceProvider.GetRequiredService(); - - - var @event = new OrderPaymentSucceededIntegrationEvent - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await response.CustomDbContext.Set().AddAsync(new IntegrationEventLog(@event, Guid.NewGuid()) - { - State = IntegrationEventStates.Published - }); - - await response.CustomDbContext.SaveChangesAsync(); - - await Assert.ThrowsExceptionAsync(async () => await logService.MarkEventAsInProgressAsync(@event.Id)); - } - - [TestMethod] - public async Task TestMarkEventAsPublishedAsync() - { - var response = await InitializeAsync(); - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); - - await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); - var logService = response.ServiceProvider.GetRequiredService(); - var @event = new OrderPaymentSucceededIntegrationEvent - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); - - await logService.MarkEventAsInProgressAsync(@event.Id); - - await logService.MarkEventAsPublishedAsync(@event.Id); - - await transcation.CommitAsync(); - - Assert.IsTrue(await response.CustomDbContext.Set() - .CountAsync(log => log.State == IntegrationEventStates.Published) == 1); - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 1); - } - - [TestMethod] - public async Task TestMarkEventAsPublished2Async() - { - var response = await InitializeAsync(); - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); - - await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); - var logService = response.ServiceProvider.GetRequiredService(); - var @event = new OrderPaymentSucceededIntegrationEvent - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); - - await Assert.ThrowsExceptionAsync(async () => await logService.MarkEventAsPublishedAsync(@event.Id)); - } - - [TestMethod] - public async Task TestMarkEventAsFailedAsync() - { - var response = await InitializeAsync(); - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); - - await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); - var logService = response.ServiceProvider.GetRequiredService(); - var @event = new OrderPaymentSucceededIntegrationEvent - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); - await logService.MarkEventAsInProgressAsync(@event.Id); - await logService.MarkEventAsFailedAsync(@event.Id); - await transcation.CommitAsync(); - - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync(log => log.State == IntegrationEventStates.PublishedFailed) == 1); - } - - [TestMethod] - public async Task TestMarkEventAsFailed2Async() - { - var response = await InitializeAsync(); - Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); - - await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); - var logService = response.ServiceProvider.GetRequiredService(); - var @event = new OrderPaymentSucceededIntegrationEvent - { - OrderId = "1234567890123", - PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds - }; - await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); - await Assert.ThrowsExceptionAsync(async () => await logService.MarkEventAsFailedAsync(@event.Id)); - } - - private async Task<(CustomDbContext CustomDbContext, IServiceProvider ServiceProvider)> InitializeAsync() - { - var dispatcherOptions = CreateDispatcherOptions(new ServiceCollection()); - dispatcherOptions.UseEventLog(); - dispatcherOptions.Services.AddMasaDbContext(option => - option.UseTestSqlite(Connection)); - dispatcherOptions.Services.AddScoped(); - Mock integrationEventBus = new(); - var types = AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(assembly => assembly.GetTypes()) - .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) - .ToList(); - integrationEventBus.Setup(eventBus => eventBus.GetAllEventTypes()).Returns(types).Verifiable(); - dispatcherOptions.Services.AddScoped(_ => integrationEventBus.Object); - var serviceProvider = dispatcherOptions.Services.BuildServiceProvider(); - var customDbContext = serviceProvider.GetRequiredService(); - await customDbContext.Database.EnsureCreatedAsync(); - return new(customDbContext, serviceProvider); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj deleted file mode 100644 index 51a37c31a..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs deleted file mode 100644 index 1808bb4e2..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests; - -public class TestBase : IDisposable -{ - protected readonly string ConnectionString = "DataSource=:memory:"; - protected readonly SqliteConnection Connection; - - protected TestBase() - { - Connection = new SqliteConnection(ConnectionString); - Connection.Open(); - } - - public void Dispose() - { - Connection.Close(); - } - - protected IDispatcherOptions CreateDispatcherOptions(IServiceCollection services, Assembly[]? assemblies = null) - { - Mock dispatcherOptions = new(); - dispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); - dispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies ?? AppDomain.CurrentDomain.GetAssemblies()) - .Verifiable(); - return dispatcherOptions.Object; - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs deleted file mode 100644 index ee23b3b12..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Domain.Entities; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Events; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Infrastructure; -global using Microsoft.Data.Sqlite; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Storage; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Data.Common; -global using System.Reflection; -global using System.Text.Json.Serialization; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs deleted file mode 100644 index 99bb21525..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests; - -[TestClass] -public class BackgroundServiceTest -{ - [TestInitialize] - public void Initialize() - { - } - - [TestMethod] - public async Task IntegrationEventHostedServiceTask() - { - Mock processingServer = new(); - processingServer.Setup(service => service.ExecuteAsync(default)).Verifiable(); - - var integrationEventHostedService = new CustomIntegrationEventHostedService(processingServer.Object); - await integrationEventHostedService.TestExecuteAsync(default); - - processingServer.Verify(service => service.ExecuteAsync(default), Times.Once); - } - - [TestMethod] - public async Task IntegrationEventHostedServiceAndUseLoggerTask() - { - Mock processingServer = new(); - processingServer.Setup(service => service.ExecuteAsync(default)).Verifiable(); - - var integrationEventHostedService = new CustomIntegrationEventHostedService(processingServer.Object, new NullLoggerFactory()); - await integrationEventHostedService.TestExecuteAsync(default); - - processingServer.Verify(service => service.ExecuteAsync(default), Times.Once); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs deleted file mode 100644 index 79a51335e..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests; - -[TestClass] -public class DispatcherOptionTest -{ - private DispatcherOptions _options; - - [TestInitialize] - public void Initialize() - { - var services = new ServiceCollection(); - _options = new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies()); - } - - [TestMethod] - public void TestSetLocalRetryTimes() - { - Assert.IsTrue(_options.LocalRetryTimes == 3); - _options.LocalRetryTimes = 5; - Assert.IsTrue(_options.LocalRetryTimes == 5); - - Assert.ThrowsException(() => _options.LocalRetryTimes = 0); - } - - [TestMethod] - public void TestSetMaxRetryTimes() - { - Assert.IsTrue(_options.MaxRetryTimes == 10); - _options.MaxRetryTimes = 5; - Assert.IsTrue(_options.MaxRetryTimes == 5); - - Assert.ThrowsException(() => _options.MaxRetryTimes = 0); - } - - [TestMethod] - public void TestSetFailedRetryInterval() - { - Assert.IsTrue(_options.FailedRetryInterval == 60); - _options.FailedRetryInterval = 5; - Assert.IsTrue(_options.FailedRetryInterval == 5); - - Assert.ThrowsException(() => _options.FailedRetryInterval = 0); - } - - [TestMethod] - public void TestSetMinimumRetryInterval() - { - Assert.IsTrue(_options.MinimumRetryInterval == 60); - _options.MinimumRetryInterval = 5; - Assert.IsTrue(_options.MinimumRetryInterval == 5); - - Assert.ThrowsException(() => _options.MinimumRetryInterval = 0); - } - - [TestMethod] - public void TestSetLocalFailedRetryInterval() - { - Assert.IsTrue(_options.LocalFailedRetryInterval == 3); - _options.LocalFailedRetryInterval = 5; - Assert.IsTrue(_options.LocalFailedRetryInterval == 5); - - Assert.ThrowsException(() => _options.LocalFailedRetryInterval = -1); - } - - [TestMethod] - public void TestSetRetryBatchSize() - { - Assert.IsTrue(_options.RetryBatchSize == 100); - _options.RetryBatchSize = 5; - Assert.IsTrue(_options.RetryBatchSize == 5); - - Assert.ThrowsException(() => _options.RetryBatchSize = -1); - } - - [TestMethod] - public void TestSetCleaningLocalQueueExpireInterval() - { - Assert.IsTrue(_options.CleaningLocalQueueExpireInterval == 60); - _options.CleaningLocalQueueExpireInterval = 5; - Assert.IsTrue(_options.CleaningLocalQueueExpireInterval == 5); - - Assert.ThrowsException(() => _options.CleaningLocalQueueExpireInterval = 0); - } - - [TestMethod] - public void TestSetCleaningExpireInterval() - { - Assert.IsTrue(_options.CleaningExpireInterval == 300); - _options.CleaningExpireInterval = 5; - Assert.IsTrue(_options.CleaningExpireInterval == 5); - - Assert.ThrowsException(() => _options.CleaningExpireInterval = 0); - } - - [TestMethod] - public void TestSetPublishedExpireTime() - { - Assert.IsTrue(_options.PublishedExpireTime == 24 * 3600); - _options.PublishedExpireTime = 24 * 3 * 3600; - Assert.IsTrue(_options.PublishedExpireTime == 24 * 3 * 3600); - - Assert.ThrowsException(() => _options.PublishedExpireTime = 0); - } - - [TestMethod] - public void TestSetDeleteBatchCount() - { - Assert.IsTrue(_options.DeleteBatchCount == 1000); - _options.DeleteBatchCount = 100; - Assert.IsTrue(_options.DeleteBatchCount == 100); - - Assert.ThrowsException(() => _options.DeleteBatchCount = 0); - } - - [TestMethod] - public void TestGetCurrentTime() - { - Assert.IsTrue(_options.GetCurrentTime == null); - _options.GetCurrentTime = () => DateTime.UtcNow; - Assert.IsTrue((_options.GetCurrentTime.Invoke() - DateTime.UtcNow).Minutes == 0); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs deleted file mode 100644 index b464641f5..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; - -public record CreateUserEvent : IEvent -{ - public string Name { get; set; } - - public Guid Id { get; set; } - - public DateTime CreationTime { get; set; } - - public CreateUserEvent() - { - this.Id = Guid.NewGuid(); - this.CreationTime = DateTime.UtcNow; - } - - public CreateUserEvent(string name) : this() - { - this.Name = name; - } - - public Guid GetEventId() => Id; - - public void SetEventId(Guid eventId) => Id = eventId; - - public DateTime GetCreationTime() => CreationTime; - - public void SetCreationTime(DateTime creationTime) => CreationTime = creationTime; -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs deleted file mode 100644 index 92ad97308..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; - -public record PaySuccessedIntegrationEvent() : IntegrationEvent() -{ - public string OrderNo { get; set; } - - public override string Topic { get; set; } = nameof(PaySuccessedIntegrationEvent); - - public PaySuccessedIntegrationEvent(string orderNo) : this() - { - OrderNo = orderNo; - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs deleted file mode 100644 index a530cdefb..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; - -public record RegisterUserIntegrationEvent : IntegrationEvent -{ - public string Account { get; set; } - - public string Password { get; set; } - - public override string Topic { get; set; } = nameof(RegisterUserIntegrationEvent); -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs deleted file mode 100644 index 9fa0c9967..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; - -public class CustomIntegrationEventHostedService : IntegrationEventHostedService -{ - public CustomIntegrationEventHostedService( - IProcessingServer processingServer, ILoggerFactory? loggerFactory = null) : - base(processingServer, loggerFactory?.CreateLogger()) - { - } - - public Task TestExecuteAsync(CancellationToken stoppingToken) - { - return ExecuteAsync(stoppingToken); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs deleted file mode 100644 index 2403d0ee1..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; - -public class CustomIntegrationEventLogService : IIntegrationEventLogService -{ - public Task MarkEventAsFailedAsync(Guid eventId) - { - return Task.CompletedTask; - } - - public Task DeleteExpiresAsync(DateTime expiresAt, int batchCount = 1000, CancellationToken token = new CancellationToken()) - { - throw new NotImplementedException(); - } - - public Task MarkEventAsInProgressAsync(Guid eventId) - { - return Task.CompletedTask; - } - - public Task MarkEventAsPublishedAsync(Guid eventId) - { - return Task.CompletedTask; - } - - public Task> RetrieveEventLogsFailedToPublishAsync( - int retryBatchSize = 200, - int maxRetryTimes = 10, - int minimumRetryInterval = 60) - { - return Task.FromResult(new List().AsEnumerable()); - } - - public Task SaveEventAsync(IIntegrationEvent @event, DbTransaction transaction) - { - return Task.CompletedTask; - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs deleted file mode 100644 index 1e8129489..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; - -public class CustomProcessor : ProcessorBase -{ - public static int Times = 0; - - public override int Delay => 2; - - public CustomProcessor(IServiceProvider? serviceProvider) : base(serviceProvider) - { - } - - public override Task ExecuteAsync(CancellationToken stoppingToken) - { - Times++; - return Task.CompletedTask; - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs deleted file mode 100644 index d48518d04..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests; - -[TestClass] -public class IntegrationEventBusTest -{ - private Mock _options; - private Mock> _dispatcherOptions; - private Mock _publisher; - private Mock> _logger; - private Mock _eventLog; - private Mock> _appConfig; - private Mock _eventBus; - private Mock _uoW; - - [TestInitialize] - public void Initialize() - { - _options = new(); - _options.Setup(option => option.Services).Returns(new ServiceCollection()).Verifiable(); - _dispatcherOptions = new(); - _dispatcherOptions - .Setup(option => option.Value) - .Returns(() => new DispatcherOptions(_options.Object.Services, AppDomain.CurrentDomain.GetAssemblies())); - _publisher = new(); - _logger = new(); - _eventLog = new(); - _eventLog.Setup(eventLog => eventLog.SaveEventAsync(It.IsAny(), null!)).Verifiable(); - _eventLog.Setup(eventLog => eventLog.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); - _eventLog.Setup(eventLog => eventLog.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); - _eventLog.Setup(eventLog => eventLog.MarkEventAsFailedAsync(It.IsAny())).Verifiable(); - _appConfig = new(); - _appConfig.Setup(appConfig => appConfig.CurrentValue).Returns(() => new AppConfig() - { - AppId = "Test" - }); - _eventBus = new(); - _uoW = new(); - _uoW.Setup(uoW => uoW.CommitAsync(default)).Verifiable(); - _uoW.Setup(uoW => uoW.Transaction).Returns(() => null!); - _uoW.Setup(uoW => uoW.UseTransaction).Returns(true); - } - - [TestMethod] - public void TestDispatcherOption() - { - var services = new ServiceCollection(); - DispatcherOptions options; - - Assert.ThrowsException(() => - { - options = new DispatcherOptions(services, null!); - }); - Assert.ThrowsException(() => - { - options = new DispatcherOptions(services, Array.Empty()); - }); - options = new DispatcherOptions(services, new[] { typeof(IntegrationEventBusTest).Assembly }); - Assert.IsTrue(options.Services.Equals(services)); - var allEventTypes = new[] { typeof(IntegrationEventBusTest).Assembly }.SelectMany(assembly => assembly.GetTypes()) - .Where(type => type.IsClass && type != typeof(IntegrationEvent) && typeof(IEvent).IsAssignableFrom(type)).ToList(); - Assert.IsTrue(options.AllEventTypes.Count == allEventTypes.Count()); - } - - [TestMethod] - public async Task TestPublishIntegrationEventAsync() - { - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - _eventBus.Object, - _uoW.Object); - RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() - { - Account = "lisa", - Password = "123456" - }; - _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) - .Verifiable(); - await integrationEventBus.PublishAsync(@event); - - _publisher.Verify(pub => pub.PublishAsync(@event.Topic, @event, default), - Times.Once); - } - - [TestMethod] - public async Task TestNotUseUoWAndLoggerAsync() - { - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - null, - _eventBus.Object); - RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() - { - Account = "lisa", - Password = "123456" - }; - _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) - .Verifiable(); - await integrationEventBus.PublishAsync(@event); - - _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Never); - _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), - Times.Once); - _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Never); - _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Never); - } - - [TestMethod] - public async Task TestNotUseTransactionAsync() - { - _uoW.Setup(uoW => uoW.UseTransaction).Returns(false); - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - _eventBus.Object, - _uoW.Object); - RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() - { - Account = "lisa", - Password = "123456" - }; - _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) - .Verifiable(); - await integrationEventBus.PublishAsync(@event); - - _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Never); - _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), - Times.Once); - _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Never); - _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Never); - } - - [TestMethod] - public async Task TestUseTranscationAndNotUseLoggerAsync() - { - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - null, - _eventBus.Object, - _uoW.Object); - RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() - { - Account = "lisa", - Password = "123456" - }; - _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) - .Verifiable(); - await integrationEventBus.PublishAsync(@event); - - _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Once); - _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), - Times.Once); - _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Once); - _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Never); - } - - [TestMethod] - public async Task TestSaveEventFailedAndNotUseLoggerAsync() - { - _eventLog.Setup(eventLog => eventLog.SaveEventAsync(It.IsAny(), null!)) - .Callback(() => throw new Exception("custom exception")); - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - null, - _eventBus.Object, - _uoW.Object); - RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() - { - Account = "lisa", - Password = "123456" - }; - _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) - .Verifiable(); - await integrationEventBus.PublishAsync(@event); - - _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Never); - _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), - Times.Never); - _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Never); - _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Once); - } - - [TestMethod] - public async Task TestPublishIntegrationEventAndFailedAsync() - { - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - _eventBus.Object, - _uoW.Object); - RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() - { - Account = "lisa", - Password = "123456" - }; - _eventLog.Setup(eventLog => eventLog.MarkEventAsPublishedAsync(It.IsAny())).Throws(); - _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) - .Verifiable(); - await integrationEventBus.PublishAsync(@event); - - _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Once); - _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), - Times.Once); - _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Once); - _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Once); - } - - [TestMethod] - public async Task TestPublishIntegrationEventAndNotUoWAsync() - { - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - _eventBus.Object, - _uoW.Object); - RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() - { - Account = "lisa", - Password = "123456", - UnitOfWork = _uoW.Object - }; - _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) - .Verifiable(); - await integrationEventBus.PublishAsync(@event); - - _publisher.Verify(pub => pub.PublishAsync(@event.Topic, @event, default), - Times.Once); - } - - [TestMethod] - public async Task TestPublishEventAsync() - { - _eventBus.Setup(eventBus => eventBus.PublishAsync(It.IsAny())).Verifiable(); - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - _eventBus.Object, - _uoW.Object); - CreateUserEvent @event = new CreateUserEvent() - { - Name = "Tom" - }; - await integrationEventBus.PublishAsync(@event); - - _eventBus.Verify(eventBus => eventBus.PublishAsync(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestPublishEventAndNotEventBusAsync() - { - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - null, - _uoW.Object); - CreateUserEvent @event = new CreateUserEvent() - { - Name = "Tom" - }; - await Assert.ThrowsExceptionAsync(async () => - { - await integrationEventBus.PublishAsync(@event); - }); - } - - [TestMethod] - public async Task TestCommitAsync() - { - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - _eventBus.Object, - _uoW.Object); - - await integrationEventBus.CommitAsync(default); - _uoW.Verify(uoW => uoW.CommitAsync(default), Times.Once); - } - - [TestMethod] - public async Task TestNotUseUowCommitAsync() - { - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - _eventBus.Object, - null); - - await Assert.ThrowsExceptionAsync(async () => await integrationEventBus.CommitAsync()); - } - - [TestMethod] - public void TestGetAllEventTypes() - { - _dispatcherOptions - .Setup(option => option.Value) - .Returns(() => new DispatcherOptions(_options.Object.Services, new[] { typeof(IntegrationEventBusTest).Assembly })); - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - null, - null); - - Assert.IsTrue(integrationEventBus.GetAllEventTypes().Count() == _dispatcherOptions.Object.Value.AllEventTypes.Count()); - } - - [TestMethod] - public void TestUseEventBusGetAllEventTypes() - { - var defaultAssembly = new System.Reflection.Assembly[1] { typeof(IntegrationEventBusTest).Assembly }; - _dispatcherOptions - .Setup(option => option.Value) - .Returns(() => new DispatcherOptions(_options.Object.Services, defaultAssembly)); - var allEventType = defaultAssembly - .SelectMany(assembly => assembly.GetTypes()) - .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) - .ToList(); - _eventBus.Setup(eventBus => eventBus.GetAllEventTypes()).Returns(() => allEventType).Verifiable(); - var integrationEventBus = new IntegrationEventBus( - _dispatcherOptions.Object, - _publisher.Object, - _eventLog.Object, - _appConfig.Object, - _logger.Object, - _eventBus.Object, - null); - - Assert.IsTrue(integrationEventBus.GetAllEventTypes().Count() == _dispatcherOptions.Object.Value.AllEventTypes.Count()); - Assert.IsTrue(integrationEventBus.GetAllEventTypes().Count() == allEventType.Count()); - } - - [TestMethod] - public void TestAddIntegrationEventBusReturnThrowNoImplementing() - { - var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddIntegrationEventBus()); - } - - [TestMethod] - public void TestAddMultiIntegrationEventBusReturnIntegrationEventBusCountEqual1() - { - var services = new ServiceCollection(); - services.AddIntegrationEventBus(dispatcherOptions => - { - Mock publisher = new(); - dispatcherOptions.Services.TryAddSingleton(publisher.Object); - }).AddIntegrationEventBus(dispatcherOptions => - { - Mock publisher = new(); - dispatcherOptions.Services.TryAddSingleton(publisher.Object); - }); - var serviceProvider = services.BuildServiceProvider(); - var integrationEventBuses = serviceProvider.GetServices(); - Assert.IsTrue(integrationEventBuses.Count() == 1); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj deleted file mode 100644 index ba78a3dd4..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs deleted file mode 100644 index a2b26ac9b..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; -using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; - -namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests; - -[TestClass] -public class ProcessorTest -{ - private IServiceProvider _serviceProvider; - private IOptions _options; - - [TestInitialize] - public void Initialize() - { - var services = new ServiceCollection(); - MockPublisher(services); - services.AddIntegrationEventBus(); - _serviceProvider = services.BuildServiceProvider(); - _options = _serviceProvider.GetRequiredService>(); - } - - [TestMethod] - public void DeleteLocalQueueExpiresProcessorDelayTestAsync() - { - ProcessorBase processor = new DeleteLocalQueueExpiresProcessor(_options); - Assert.IsTrue(processor.Delay == _options.Value.CleaningLocalQueueExpireInterval); - } - - [TestMethod] - public void DeletePublishedExpireEventDelayTestAsync() - { - ProcessorBase processor = new DeletePublishedExpireEventProcessor(_serviceProvider, _options); - Assert.IsTrue(processor.Delay == _options.Value.CleaningExpireInterval); - } - - [TestMethod] - public void RetryByDataProcessorDelayTestAsync() - { - ProcessorBase processor = new RetryByDataProcessor(_serviceProvider, _options); - Assert.IsTrue(processor.Delay == _options.Value.FailedRetryInterval); - } - - [TestMethod] - public async Task RetryByDataProcessorExecuteTestAsync() - { - var services = new ServiceCollection(); - services.AddLogging(); - - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(1000); - - Mock publisher = new(); - publisher.Setup(client - => client.PublishAsync(It.IsAny(), It.IsAny(), cancellationTokenSource.Token)); - services.AddScoped(_ => publisher.Object); - - Mock integrationEventLogService = new(); - RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent(); - - integrationEventLogService.Setup(service => service.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); - integrationEventLogService.Setup(service => service.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); - - List list = new List() - { - new(@event, Guid.Empty), - new(@event, Guid.Empty) - }; - list.ForEach(item => - { - item.DeserializeJsonContent(typeof(RegisterUserIntegrationEvent)); - }); - integrationEventLogService.Setup(service => - service.RetrieveEventLogsFailedToPublishAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(() => list) - .Verifiable(); - services.AddScoped(_ => integrationEventLogService.Object); - - Mock uoW = new(); - uoW.Setup(u => u.CommitAsync(cancellationTokenSource.Token)).Verifiable(); - uoW.Setup(u => u.ServiceProvider).Returns(services.BuildServiceProvider()).Verifiable(); - services.AddScoped(_ => uoW.Object); - - Mock unitOfWorkManager = new(); - unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) - .Verifiable(); - services.AddSingleton(_ => unitOfWorkManager.Object); - - Mock dataConnectionStringProvider = new(); - dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List - { - new(string.Empty) - }).Verifiable(); - services.AddSingleton(_ => dataConnectionStringProvider.Object); - - Mock> options = new(); - options.Setup(opt => opt.Value).Returns(new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies())); - AppConfig appConfig = new() - { - AppId = "test" - }; - - var serviceProvider = services.BuildServiceProvider(); - RetryByDataProcessor retryByDataProcessor = new( - serviceProvider, - options.Object, - Mock.Of>(a => a.CurrentValue == appConfig), - serviceProvider.GetService>()); - await retryByDataProcessor.ExecuteAsync(cancellationTokenSource.Token); - - integrationEventLogService.Verify(service => service.MarkEventAsInProgressAsync(It.IsAny()), Times.Exactly(2)); - integrationEventLogService.Verify(service => service.MarkEventAsPublishedAsync(It.IsAny()), Times.Exactly(2)); - } - - [TestMethod] - public async Task RetryByDataProcessorExecute2TestAsync() - { - var services = new ServiceCollection(); - services.AddLogging(); - - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(1000); - - Mock integrationEventLogService = new(); - integrationEventLogService.Setup(service => service.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); - integrationEventLogService.Setup(service => service.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); - integrationEventLogService.Setup(service => service.MarkEventAsFailedAsync(It.IsAny())).Verifiable(); - - List list = new List() - { - new(new RegisterUserIntegrationEvent(), Guid.Empty), - new(new PaySuccessedIntegrationEvent(Guid.NewGuid().ToString()), Guid.Empty) - }; - for (int index = 0; index < list.Count; index++) - { - if (index == 0) - list[index].DeserializeJsonContent(typeof(RegisterUserIntegrationEvent)); - else - list[index].DeserializeJsonContent(typeof(PaySuccessedIntegrationEvent)); - } - - Mock publisher = new(); - publisher.Setup(client - => client.PublishAsync(nameof(RegisterUserIntegrationEvent), It.IsAny(), - cancellationTokenSource.Token)) - .Throws(new Exception("custom exception")); - publisher.Setup(client - => client.PublishAsync(nameof(PaySuccessedIntegrationEvent), It.IsAny(), - cancellationTokenSource.Token)) - .Throws(new UserFriendlyException("custom exception")); - services.AddScoped(_ => publisher.Object); - - integrationEventLogService.Setup(service => - service.RetrieveEventLogsFailedToPublishAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(() => list) - .Verifiable(); - services.AddScoped(_ => integrationEventLogService.Object); - - Mock uoW = new(); - uoW.Setup(u => u.CommitAsync(cancellationTokenSource.Token)).Verifiable(); - uoW.Setup(u => u.ServiceProvider).Returns(services.BuildServiceProvider()).Verifiable(); - services.AddScoped(_ => uoW.Object); - - Mock unitOfWorkManager = new(); - unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) - .Verifiable(); - services.AddSingleton(_ => unitOfWorkManager.Object); - - Mock dataConnectionStringProvider = new(); - dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List - { - new(string.Empty) - }).Verifiable(); - services.AddSingleton(_ => dataConnectionStringProvider.Object); - - Mock> options = new(); - options.Setup(opt => opt.Value).Returns(new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies())); - AppConfig appConfig = new() - { - AppId = "test" - }; - - var serviceProvider = services.BuildServiceProvider(); - RetryByDataProcessor retryByDataProcessor = new( - serviceProvider, - options.Object, - Mock.Of>(a => a.CurrentValue == appConfig), - serviceProvider.GetService>()); - await retryByDataProcessor.ExecuteAsync(cancellationTokenSource.Token); - - integrationEventLogService.Verify(service => service.MarkEventAsInProgressAsync(It.IsAny()), Times.Exactly(2)); - integrationEventLogService.Verify(service => service.MarkEventAsPublishedAsync(It.IsAny()), Times.Never); - integrationEventLogService.Verify(service => service.MarkEventAsFailedAsync(It.IsAny()), Times.Exactly(1)); - } - - [TestMethod] - public async Task RetryByDataProcessorExecute2AndNotUseLoggerTestAsync() - { - var services = new ServiceCollection(); - - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(1000); - - Mock integrationEventLogService = new(); - integrationEventLogService.Setup(service => service.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); - integrationEventLogService.Setup(service => service.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); - integrationEventLogService.Setup(service => service.MarkEventAsFailedAsync(It.IsAny())).Verifiable(); - - List list = new List() - { - new(new RegisterUserIntegrationEvent(), Guid.Empty), - new(new PaySuccessedIntegrationEvent(Guid.NewGuid().ToString()), Guid.Empty) - }; - for (int index = 0; index < list.Count; index++) - { - if (index == 0) - list[index].DeserializeJsonContent(typeof(RegisterUserIntegrationEvent)); - else - list[index].DeserializeJsonContent(typeof(PaySuccessedIntegrationEvent)); - } - - Mock publisher = new(); - publisher.Setup(client - => client.PublishAsync(nameof(RegisterUserIntegrationEvent), It.IsAny(), - cancellationTokenSource.Token)) - .Throws(new Exception("custom exception")); - publisher.Setup(client - => client.PublishAsync(nameof(PaySuccessedIntegrationEvent), It.IsAny(), - cancellationTokenSource.Token)) - .Throws(new UserFriendlyException("custom exception")); - services.AddScoped(_ => publisher.Object); - - integrationEventLogService.Setup(service => - service.RetrieveEventLogsFailedToPublishAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(() => list) - .Verifiable(); - services.AddScoped(_ => integrationEventLogService.Object); - - Mock> options = new(); - options.Setup(opt => opt.Value).Returns(new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies())); - AppConfig appConfig = new() - { - AppId = "test" - }; - - Mock uoW = new(); - uoW.Setup(u => u.CommitAsync(cancellationTokenSource.Token)).Verifiable(); - uoW.Setup(u => u.ServiceProvider).Returns(services.BuildServiceProvider()).Verifiable(); - services.AddScoped(_ => uoW.Object); - - Mock unitOfWorkManager = new(); - unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) - .Verifiable(); - services.AddSingleton(_ => unitOfWorkManager.Object); - - Mock dataConnectionStringProvider = new(); - dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List() - { - new(string.Empty) - }).Verifiable(); - services.AddSingleton(_ => dataConnectionStringProvider.Object); - - var serviceProvider = services.BuildServiceProvider(); - RetryByDataProcessor retryByDataProcessor = new( - serviceProvider, - options.Object, - Mock.Of>(a => a.CurrentValue == appConfig), - serviceProvider.GetService>()); - await retryByDataProcessor.ExecuteAsync(cancellationTokenSource.Token); - - integrationEventLogService.Verify(service => service.MarkEventAsInProgressAsync(It.IsAny()), Times.Exactly(2)); - integrationEventLogService.Verify(service => service.MarkEventAsPublishedAsync(It.IsAny()), Times.Never); - integrationEventLogService.Verify(service => service.MarkEventAsFailedAsync(It.IsAny()), Times.Exactly(1)); - } - - [TestMethod] - public void RetryByLocalQueueProcessorDelayTestAsync() - { - ProcessorBase processor = new RetryByLocalQueueProcessor(_serviceProvider, _options); - Assert.IsTrue(processor.Delay == _options.Value.LocalFailedRetryInterval); - } - - [TestMethod] - public async Task DeletePublishedExpireEventProcessorExecuteTestAsync() - { - Mock integrationEventLogService = new(); - integrationEventLogService.Setup(service => service.DeleteExpiresAsync(It.IsAny(), It.IsAny(), default)) - .Verifiable(); - _options.Value.Services.AddScoped(_ => integrationEventLogService.Object); - - Mock uoW = new(); - uoW.Setup(uow => uow.ServiceProvider).Returns(_options.Value.Services.BuildServiceProvider()).Verifiable(); - - Mock unitOfWorkManager = new(); - unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) - .Verifiable(); - _options.Value.Services.AddSingleton(_ => unitOfWorkManager.Object); - - Mock dataConnectionStringProvider = new(); - dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List() - { - new(string.Empty) - }).Verifiable(); - _options.Value.Services.AddSingleton(_ => dataConnectionStringProvider.Object); - - var processor = new DeletePublishedExpireEventProcessor(_options.Value.Services.BuildServiceProvider(), _options); - await processor.ExecuteAsync(default); - - integrationEventLogService.Verify(service => service.DeleteExpiresAsync(It.IsAny(), It.IsAny(), default), - Times.Once); - } - - [TestMethod] - public async Task InfiniteLoopProcessorExecuteTestAsync() - { - Mock processor = new(); - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(3000); - processor.Setup(pro => pro.ExecuteAsync(cancellationTokenSource.Token)).Verifiable(); - - InfiniteLoopProcessor infiniteLoopProcessor = new InfiniteLoopProcessor(_serviceProvider, processor.Object); - await infiniteLoopProcessor.ExecuteAsync(cancellationTokenSource.Token); - - processor.Verify(pro => pro.ExecuteAsync(cancellationTokenSource.Token), Times.AtLeastOnce); - } - - [TestMethod] - public async Task InfiniteLoopProcessorExecuteAndUseLoggerTestAsync() - { - Mock processor = new(); - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(3000); - processor.Setup(pro => pro.ExecuteAsync(cancellationTokenSource.Token)).Verifiable(); - - InfiniteLoopProcessor infiniteLoopProcessor = - new InfiniteLoopProcessor(_serviceProvider, processor.Object); - await infiniteLoopProcessor.ExecuteAsync(cancellationTokenSource.Token); - - processor.Verify(pro => pro.ExecuteAsync(cancellationTokenSource.Token), Times.AtLeastOnce); - } - - [TestMethod] - public async Task DefaultHostedServiceTestAsync() - { - var services = new ServiceCollection(); - MockPublisher(services); - Mock unitOfWorkManager = new(); - services.AddSingleton(_ => unitOfWorkManager.Object); - services.AddScoped(); - services.AddIntegrationEventBus(opt => - { - opt.CleaningLocalQueueExpireInterval = 1; - opt.CleaningExpireInterval = 1; - opt.FailedRetryInterval = 1; - opt.LocalFailedRetryInterval = 1; - }); - var serviceProvider = services.BuildServiceProvider(); - var hostedService = serviceProvider.GetService(); - Assert.IsNotNull(hostedService); - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(5000); - await hostedService.ExecuteAsync(cancellationTokenSource.Token); - - Assert.IsTrue(CustomProcessor.Times > 0); - } - - [TestMethod] - public async Task DefaultHostedServiceAndUseLoggerTestAsync() - { - var services = new ServiceCollection(); - MockPublisher(services); - Mock unitOfWorkManager = new(); - services.AddSingleton(_ => unitOfWorkManager.Object); - services.AddLogging(); - services.AddScoped(); - services.AddIntegrationEventBus(opt => - { - opt.CleaningLocalQueueExpireInterval = 1; - opt.CleaningExpireInterval = 1; - opt.FailedRetryInterval = 1; - opt.LocalFailedRetryInterval = 1; - }); - var serviceProvider = services.BuildServiceProvider(); - var hostedService = serviceProvider.GetService(); - Assert.IsNotNull(hostedService); - CancellationTokenSource cancellationTokenSource = new(); - cancellationTokenSource.CancelAfter(5000); - await hostedService.ExecuteAsync(cancellationTokenSource.Token); - - Assert.IsTrue(CustomProcessor.Times > 0); - } - - private void MockPublisher(IServiceCollection services) - { - Mock publisher = new(); - publisher.Setup(p => p.PublishAsync(It.IsAny(), It.IsAny(), default)).Verifiable(); - services.AddSingleton(publisher.Object); - } -} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs deleted file mode 100644 index 9dc39e12a..000000000 --- a/src/Contrib/Dispatcher/IntegrationEvents/test/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.Options; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Options; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Processor; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; -global using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; -global using Masa.Utils.Models.Config; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Logging.Abstractions; -global using Microsoft.Extensions.Options; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Data.Common; -global using System.Reflection; diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs deleted file mode 100644 index 7ec98fcb8..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel; - -public static class ClaimExtensions -{ - public static string? FindClaimValue(this ClaimsPrincipal claimsPrincipal, string claimType) - => claimsPrincipal.Claims.FirstOrDefault(c => c.Type == claimType)?.Value; -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs deleted file mode 100644 index 45ec16a17..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel.Const; - -public class ClaimType -{ - public const string DEFAULT_USER_ID = ClaimTypes.NameIdentifier; - - public const string DEFAULT_USER_NAME = ClaimTypes.Name; - - public const string DEFAULT_USER_ROLE = ClaimTypes.Role; - - public const string DEFAULT_TENANT_ID = $"{DEFAULT_PREFIX}/tenantid"; - - public const string DEFAULT_ENVIRONMENT = $"{DEFAULT_PREFIX}/environment"; - - private const string DEFAULT_PREFIX = "https://masastack.com/security/identity/claims"; -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs deleted file mode 100644 index 23013421c..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel; - -internal class DefaultIsolatedUserContext : DefaultUserContext, IIsolatedUserContext -{ - public string? TenantId => GetUser()?.TenantId; - - public string? Environment => GetUser()?.Environment; - - private readonly IOptionsMonitor _optionsMonitor; - - public DefaultIsolatedUserContext( - ITypeConvertProvider typeConvertProvider, - ICurrentPrincipalAccessor currentPrincipalAccessor, - IOptionsMonitor optionsMonitor, - ILoggerFactory? loggerFactory = null) - : base(typeConvertProvider, currentPrincipalAccessor, optionsMonitor, loggerFactory) - { - _optionsMonitor = optionsMonitor; - } - - public TTenantId? GetTenantId() - { - var tenantId = TenantId; - if (tenantId == null) - return default; - - return TypeConvertProvider.ConvertTo(tenantId); - } - - protected override IsolatedIdentityUser? GetUser() - { - var identityUser = GetUserBasicInfo(); - if (identityUser == null) - { - return null; - } - - return new IsolatedIdentityUser - { - Id = identityUser.Id, - UserName = identityUser.UserName, - Roles = identityUser.Roles, - TenantId = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.TenantId), - Environment = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.Environment), - }; - } -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs deleted file mode 100644 index 3c1d8cd3d..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel; - -internal class DefaultMultiEnvironmentUserContext : DefaultUserContext, IMultiEnvironmentUserContext -{ - public string? Environment => GetUser()?.Environment; - - private readonly IOptionsMonitor _optionsMonitor; - - public DefaultMultiEnvironmentUserContext( - ITypeConvertProvider typeConvertProvider, - ICurrentPrincipalAccessor currentPrincipalAccessor, - IOptionsMonitor optionsMonitor, - ILoggerFactory? loggerFactory = null) - : base(typeConvertProvider, currentPrincipalAccessor, optionsMonitor, loggerFactory) - { - _optionsMonitor = optionsMonitor; - } - - protected override MultiEnvironmentIdentityUser? GetUser() - { - var identityUser = GetUserBasicInfo(); - if (identityUser == null) - { - return null; - } - - return new MultiEnvironmentIdentityUser - { - Id = identityUser.Id, - UserName = identityUser.UserName, - Roles = identityUser.Roles, - Environment = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.Environment), - }; - } -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs deleted file mode 100644 index 1ff28c5bd..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel; - -internal class DefaultMultiTenantUserContext : DefaultUserContext, IMultiTenantUserContext -{ - public string? TenantId => GetUser()?.TenantId; - - private readonly IOptionsMonitor _optionsMonitor; - - public DefaultMultiTenantUserContext( - ITypeConvertProvider typeConvertProvider, - ICurrentPrincipalAccessor currentPrincipalAccessor, - IOptionsMonitor optionsMonitor, - ILoggerFactory? loggerFactory = null) - : base(typeConvertProvider, currentPrincipalAccessor, optionsMonitor, loggerFactory) - { - _optionsMonitor = optionsMonitor; - } - - public virtual TTenantId? GetTenantId() - { - var tenantId = TenantId; - if (tenantId == null) - return default; - - return TypeConvertProvider.ConvertTo(tenantId); - } - - protected override MultiTenantIdentityUser? GetUser() - { - var identityUser = GetUserBasicInfo(); - if (identityUser == null) - { - return null; - } - - return new MultiTenantIdentityUser - { - Id = identityUser.Id, - UserName = identityUser.UserName, - Roles = identityUser.Roles, - TenantId = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.TenantId), - }; - } -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs deleted file mode 100644 index 64e0ad129..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel; - -internal class DefaultUserContext : UserContext -{ - private readonly IOptionsMonitor _optionsMonitor; - private readonly ILogger? _logger; - - protected ClaimsPrincipal? ClaimsPrincipal { get; set; } - - public DefaultUserContext( - ITypeConvertProvider typeConvertProvider, - ICurrentPrincipalAccessor currentPrincipalAccessor, - IOptionsMonitor optionsMonitor, ILoggerFactory? loggerFactory = null) - : base(typeConvertProvider) - { - _optionsMonitor = optionsMonitor; - ClaimsPrincipal = currentPrincipalAccessor.GetCurrentPrincipal(); - _logger = loggerFactory?.CreateLogger(); - } - - protected override IdentityUser? GetUser() - { - return GetUserBasicInfo(); - } - - protected override IdentityUser? GetUserBasicInfo() - { - - var userId = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.UserId); - if (userId == null) - return null; - - var roleStr = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.Role); - var roles = new List>(); - if (!string.IsNullOrWhiteSpace(roleStr)) - { - try - { - roles = JsonSerializer.Deserialize>>(roleStr) ?? roles; - } - catch (Exception e) - { - _logger?.LogError("role data deserialization failed", e); - } - } - return new IdentityUser - { - Id = userId, - UserName = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.UserName), - Roles = roles - }; - } -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs deleted file mode 100644 index 98d647299..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel; - -public class HttpContextCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor -{ - private readonly IHttpContextAccessor _httpContextAccessor; - - public HttpContextCurrentPrincipalAccessor(IHttpContextAccessor httpContextAccessor) => _httpContextAccessor = httpContextAccessor; - - public override ClaimsPrincipal? GetCurrentPrincipal() - => _httpContextAccessor.HttpContext?.User ?? base.GetCurrentPrincipal(); -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs deleted file mode 100644 index 056376d42..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel; - -public interface ICurrentPrincipalAccessor -{ - ClaimsPrincipal? GetCurrentPrincipal(); -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs deleted file mode 100644 index 4f64d1aa5..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel; - -public class IdentityClaimOptions -{ - public string UserId { get; set; } - - public string UserName { get; set; } - - public string Role { get; set; } - - public string TenantId { get; set; } - - public string Environment { get; set; } - - public IdentityClaimOptions() - { - UserId = ClaimType.DEFAULT_USER_ID; - UserName = ClaimType.DEFAULT_USER_NAME; - Role = ClaimType.DEFAULT_USER_ROLE; - TenantId = ClaimType.DEFAULT_TENANT_ID; - Environment = ClaimType.DEFAULT_ENVIRONMENT; - } -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj deleted file mode 100644 index e063714c7..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.md b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.md deleted file mode 100644 index 8f704f771..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.md +++ /dev/null @@ -1,49 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Identity - -Example: - -```` C# -Install-Package Masa.Contrib.Identity.IdentityModel -```` - -1. Modify `Program.cs` - -```` C# -builder.Services.AddMasaIdentityModel(); -```` - -2. Get user information - -```` C# -IUserContext userContext;//Get IUserContext from DI -userContext.User;//Get user information -```` - -> The default user information is obtained from HttpContext.User -> -> UserId: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_USER_ID -> -> UserName: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_USER_NAME -> -> TenantId: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_TENANT_ID -> -> Environment: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_ENVIRONMENT - -3. Temporarily change the current login user information - -```` C# -IUserSetter userSetter;//Get IUserSetter from DI -var user = new IdentityUser() -{ - Id = "2", - UserName = "Tom", - Environment = "Production", - TenantId = "2" -}; -using(userSetter.Change(user)) -{ - //The obtained user information is Tom -} -```` \ No newline at end of file diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md deleted file mode 100644 index 916fba22b..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md +++ /dev/null @@ -1,49 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Identity - -用例: - -``` C# -Install-Package Masa.Contrib.Identity.IdentityModel -``` - -1. 修改`Program.cs` - -``` C# -builder.Services.AddMasaIdentityModel(); -``` - -2. 获取用户信息 - -``` C# -IUserContext userContext;//从DI中获取IUserContext -userContext.User;//获取用户信息 -``` - -> 默认用户信息从HttpContext.User中获取 -> -> UserId: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_USER_ID -> -> UserName: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_USER_NAME -> -> TenantId: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_TENANT_ID -> -> Environment: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_ENVIRONMENT - -3. 临时更改当前登录用户信息 - -``` C# -IUserSetter userSetter;//从DI中获取IUserSetter -var user = new IdentityUser() -{ - Id = "2", - UserName = "Tom", - Environment = "Production", - TenantId = "2" -}; -using (userSetter.Change(user)) -{ - //获取到的用户信息为Tom -} -``` \ No newline at end of file diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs deleted file mode 100644 index 28e782e81..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddMasaIdentityModel( - this IServiceCollection services, - IdentityType identityType = IdentityType.Basic) - => services.AddMasaIdentityModel(identityType, _ => - { - }); - - public static IServiceCollection AddMasaIdentityModel( - this IServiceCollection services, - IdentityType identityType, - Action configureOptions) - { - ArgumentNullException.ThrowIfNull(configureOptions); - - if (services.Any()) - return services; - - services.AddSingleton(); - services.TryAddSingleton(); - services.AddHttpContextAccessor(); - services.TryAddSingleton(); - - services.Configure(configureOptions); - - if (identityType.HasFlag(IdentityType.MultiTenant) && identityType.HasFlag(IdentityType.MultiEnvironment)) - return services.AddMasaIdentityByIsolation(); - - if (identityType.HasFlag(IdentityType.MultiTenant)) - return services.AddMasaIdentityByMultiTenant(); - - if (identityType.HasFlag(IdentityType.MultiEnvironment)) - return services.AddMasaIdentityByMultiEnvironment(); - - if ((identityType & IdentityType.Basic) != 0) - return services.AddMasaIdentityByBasic(); - - throw new NotSupportedException(nameof(identityType)); - } - - private static IServiceCollection AddMasaIdentityByBasic(this IServiceCollection services) - { - services.TryAddScoped(); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - return services; - } - - private static IServiceCollection AddMasaIdentityByMultiTenant(this IServiceCollection services) - { - services.TryAddScoped(); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - return services; - } - - private static IServiceCollection AddMasaIdentityByMultiEnvironment(this IServiceCollection services) - { - services.TryAddScoped(); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - return services; - } - - private static IServiceCollection AddMasaIdentityByIsolation(this IServiceCollection services) - { - services.TryAddScoped(); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - services.TryAddScoped(serviceProvider - => serviceProvider.GetRequiredService()); - return services; - } - - private class IdentityProvider - { - } -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs deleted file mode 100644 index f6aaae84d..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel; - -public class ThreadCurrentPrincipalAccessor : ICurrentPrincipalAccessor -{ - public virtual ClaimsPrincipal? GetCurrentPrincipal() => Thread.CurrentPrincipal as ClaimsPrincipal; -} diff --git a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/_Imports.cs b/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/_Imports.cs deleted file mode 100644 index 287fe982b..000000000 --- a/src/Contrib/Identity/IdentityModel/src/Masa.Contrib.Identity.IdentityModel/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.Contrib.Identity.IdentityModel; -global using Masa.Contrib.Identity.IdentityModel.Const; -global using Microsoft.AspNetCore.Http; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using System.Security.Claims; -global using System.Text.Json; diff --git a/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj b/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj deleted file mode 100644 index 833f48940..000000000 --- a/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - diff --git a/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs b/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs deleted file mode 100644 index b7c42cea6..000000000 --- a/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Identity.IdentityModel.Tests; - -[TestClass] -public class TestIdentity -{ - [TestMethod] - public void TestIdentityClaimOptionsReturnTenantIdEqualTenantId() - { - var services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiTenant | IdentityType.MultiEnvironment, identityClaimOptions => - { - identityClaimOptions.TenantId = "TenantId"; - }); - var serviceProvider = services.BuildServiceProvider(); - var optionsMonitor = serviceProvider.GetRequiredService>(); - Assert.IsTrue(optionsMonitor.CurrentValue.TenantId == "TenantId"); - Assert.IsTrue(optionsMonitor.CurrentValue.Environment == ClaimType.DEFAULT_ENVIRONMENT); - } - - [TestMethod] - public void TestIdentityType() - { - var services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.Basic); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNull(serviceProvider.GetService()); - Assert.IsNull(serviceProvider.GetService()); - - services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.MultiTenant); - serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService()); - Assert.IsNull(serviceProvider.GetService()); - - services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiTenant); - serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService()); - Assert.IsNull(serviceProvider.GetService()); - - services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.MultiEnvironment); - serviceProvider = services.BuildServiceProvider(); - Assert.IsNull(serviceProvider.GetService()); - Assert.IsNotNull(serviceProvider.GetService()); - - services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiEnvironment); - serviceProvider = services.BuildServiceProvider(); - Assert.IsNull(serviceProvider.GetService()); - Assert.IsNotNull(serviceProvider.GetService()); - - services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.MultiTenant | IdentityType.MultiEnvironment); - serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService()); - Assert.IsNotNull(serviceProvider.GetService()); - - services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiTenant | IdentityType.MultiEnvironment); - serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService()); - Assert.IsNotNull(serviceProvider.GetService()); - Assert.IsNotNull(serviceProvider.GetService()); - } - - [TestMethod] - public void TestDefaultIdentityReturnTenantIdEqualtenantid() - { - var services = new ServiceCollection(); - services.AddMasaIdentityModel(); - var serviceProvider = services.BuildServiceProvider(); - var optionsMonitor = serviceProvider.GetRequiredService>(); - Assert.IsTrue(optionsMonitor.CurrentValue.TenantId == ClaimType.DEFAULT_TENANT_ID); - Assert.IsTrue(optionsMonitor.CurrentValue.Environment == ClaimType.DEFAULT_ENVIRONMENT); - } - - [TestMethod] - public void TestAddIsolationIdentityReturnUserIdEqual1AndTenantIdEqual1() - { - var services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiTenant | IdentityType.MultiEnvironment); - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext() - { - User = new ClaimsPrincipal(new List() - { - new(new List() - { - new(ClaimType.DEFAULT_USER_ID, "1"), - new(ClaimType.DEFAULT_USER_NAME, "Jim"), - new(ClaimType.DEFAULT_TENANT_ID, "1"), - new(ClaimType.DEFAULT_ENVIRONMENT, "dev") - }) - }) - }; - var userContext = serviceProvider.GetService(); - Assert.IsNotNull(userContext); - - Assert.IsTrue(userContext.UserId == "1"); - - var multiTenantUserContext = serviceProvider.GetService(); - Assert.IsNotNull(multiTenantUserContext); - - Assert.IsTrue(multiTenantUserContext.TenantId == "1"); - - var multiEnvironmentUserContext = serviceProvider.GetService(); - Assert.IsNotNull(multiEnvironmentUserContext); - - Assert.IsTrue(multiEnvironmentUserContext.Environment == "dev"); - - var isolationUserContext = serviceProvider.GetService(); - Assert.IsNotNull(isolationUserContext); - - Assert.IsTrue(isolationUserContext.IsAuthenticated); - Assert.IsTrue(isolationUserContext.UserId == "1"); - Assert.IsTrue(isolationUserContext.UserName == "Jim"); - Assert.IsTrue(isolationUserContext.TenantId == "1"); - Assert.IsTrue(isolationUserContext.Environment == "dev"); - } - - [TestMethod] - public void TestAddSimpleIdentityReturnUserIdEqual1() - { - var services = new ServiceCollection(); - services.AddMasaIdentityModel(); - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext() - { - User = new ClaimsPrincipal(new List() - { - new(new List() - { - new(ClaimType.DEFAULT_USER_ID, "1"), - new(ClaimType.DEFAULT_USER_NAME, "Jim"), - new(ClaimType.DEFAULT_TENANT_ID, "1"), - new(ClaimType.DEFAULT_USER_ROLE, "[{ \"Name\": \"admin\",\"Id\": \"1\" }]") - }) - }) - }; - var userContext = serviceProvider.GetService(); - Assert.IsNotNull(userContext); - Assert.IsTrue(userContext.IsAuthenticated); - Assert.IsTrue(userContext.UserId == "1"); - Assert.IsTrue(userContext.UserName == "Jim"); - Assert.IsTrue(userContext.GetUserRoles().Count() == 1); - - var multiTenantUserContext = serviceProvider.GetService(); - Assert.IsNull(multiTenantUserContext); - - var multiEnvironmentUserContext = serviceProvider.GetService(); - Assert.IsNull(multiEnvironmentUserContext); - - var isolationUserContext = serviceProvider.GetService(); - Assert.IsNull(isolationUserContext); - } - - [TestMethod] - public void TestAddMultiTenantIdentityReturnTenantIdIs1() - { - var services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.MultiTenant); - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext() - { - User = new ClaimsPrincipal(new List() - { - new(new List() - { - new(ClaimType.DEFAULT_USER_ID, "1"), - new(ClaimType.DEFAULT_USER_NAME, "Jim"), - new(ClaimType.DEFAULT_TENANT_ID, "1"), - new(ClaimType.DEFAULT_USER_ROLE, "[{ \"Name\": \"admin\",\"Id\": \"1\" }]") - }) - }) - }; - var userContext = serviceProvider.GetService(); - Assert.IsNotNull(userContext); - Assert.IsTrue(userContext.IsAuthenticated); - Assert.IsTrue(userContext.UserId == "1"); - Assert.IsTrue(userContext.UserName == "Jim"); - Assert.IsTrue(userContext.GetUserRoles().Count() > 0); - - var multiTenantUserContext = serviceProvider.GetService(); - Assert.IsNotNull(multiTenantUserContext); - Assert.IsTrue(multiTenantUserContext.TenantId == "1"); - - var multiEnvironmentUserContext = serviceProvider.GetService(); - Assert.IsNull(multiEnvironmentUserContext); - - var isolationUserContext = serviceProvider.GetService(); - Assert.IsNull(isolationUserContext); - } - - [TestMethod] - public void TestTemporarilyUserReturnUserIdEqual1() - { - var services = new ServiceCollection(); - services.AddMasaIdentityModel(); - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext() - { - User = new ClaimsPrincipal(new List() - { - new(new List() - { - new(ClaimType.DEFAULT_USER_ID, "1"), - new(ClaimType.DEFAULT_USER_NAME, "Jim") - }) - }) - }; - var userContext = serviceProvider.GetRequiredService(); - var userSetter = serviceProvider.GetRequiredService(); - - var user = new IdentityUser() - { - Id = "2", - UserName = "Tom" - }; - using (userSetter.Change(user)) - { - Assert.IsTrue(userContext.IsAuthenticated); - Assert.IsTrue(userContext.UserId == "2"); - Assert.IsTrue(userContext.UserName == "Tom"); - } - - Assert.IsTrue(userContext.IsAuthenticated); - Assert.IsTrue(userContext.UserId == "1"); - Assert.IsTrue(userContext.UserName == "Jim"); - } -} diff --git a/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs b/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs deleted file mode 100644 index 0e455e7f8..000000000 --- a/src/Contrib/Identity/IdentityModel/test/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.Contrib.Identity.IdentityModel.Const; -global using Microsoft.AspNetCore.Http; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System.Security.Claims; diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs deleted file mode 100644 index c7d630b9c..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation; - -public class DefaultDbIsolationConnectionStringProvider : IConnectionStringProvider -{ - private readonly IUnitOfWorkAccessor _unitOfWorkAccessor; - private readonly IOptionsSnapshot _options; - private readonly IEnvironmentContext? _environmentContext; - private readonly ITenantContext? _tenantContext; - private readonly ILogger? _logger; - - public DefaultDbIsolationConnectionStringProvider( - IUnitOfWorkAccessor unitOfWorkAccessor, - IOptionsSnapshot options, - IEnvironmentContext? environmentContext = null, - ITenantContext? tenantContext = null, - ILogger? logger = null) - { - _unitOfWorkAccessor = unitOfWorkAccessor; - _options = options; - _environmentContext = environmentContext; - _tenantContext = tenantContext; - _logger = logger; - } - - public Task GetConnectionStringAsync(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) => Task.FromResult(GetConnectionString(name)); - - public string GetConnectionString(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) - { - if (_unitOfWorkAccessor.CurrentDbContextOptions != null) - return _unitOfWorkAccessor.CurrentDbContextOptions.ConnectionString; //todo: UnitOfWork does not currently support multi-context versions - - Expression> condition = option - => name != ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME ? option.Name == name : option.Name == name || option.Name == string.Empty; - - if (_tenantContext != null) - { - if (_tenantContext.CurrentTenant == null) - _logger?.LogDebug( - $"Tenant resolution failed, the currently used ConnectionString is [{nameof(_options.Value.ConnectionStrings.DefaultConnection)}]"); - - condition = condition.And(option => option.TenantId == "*" || (_tenantContext.CurrentTenant != null && - _tenantContext.CurrentTenant.Id.Equals(option.TenantId, StringComparison.CurrentCultureIgnoreCase))); - } - - if (_environmentContext != null) - { - if (string.IsNullOrEmpty(_environmentContext.CurrentEnvironment)) - { - _logger?.LogDebug( - $"Environment resolution failed, the currently used ConnectionString is [{nameof(_options.Value.ConnectionStrings.DefaultConnection)}]"); - } - - condition = condition.And(option - => option.Environment == "*" || - option.Environment.Equals(_environmentContext.CurrentEnvironment, StringComparison.CurrentCultureIgnoreCase)); - } - - string? connectionString; - var list = _options.Value.IsolationConnectionStrings.Where(condition.Compile()).ToList(); - if (list.Count >= 1) - { - connectionString = list.OrderByDescending(option => option.Score).Select(option => option.ConnectionString).FirstOrDefault()!; - if (list.Count > 1) - _logger?.LogInformation( - "{Message}, Matches multiple available database link strings, the currently used ConnectionString is [{ConnectionString}]", - GetMessage(), connectionString); - } - else - { - connectionString = _options.Value.ConnectionStrings.DefaultConnection; - _logger?.LogDebug("{Message}, the currently used ConnectionString is [{ConnectionString}]", GetMessage(), - nameof(_options.Value.ConnectionStrings.DefaultConnection)); - } - return SetConnectionString(connectionString); - } - - private string SetConnectionString(string? connectionString = null) - { - _unitOfWorkAccessor.CurrentDbContextOptions = - new MasaDbContextConfigurationOptions(connectionString ?? _options.Value.ConnectionStrings.DefaultConnection); - return _unitOfWorkAccessor.CurrentDbContextOptions.ConnectionString; - } - - private string GetMessage() - { - List messages = new List(); - if (_environmentContext != null) - messages.Add($"Environment: [{_environmentContext.CurrentEnvironment ?? ""}]"); - if (_tenantContext != null) - messages.Add($"Tenant: [{_tenantContext.CurrentTenant?.Id ?? ""}]"); - return string.Join(", ", messages); - } -} diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs deleted file mode 100644 index dbec9efec..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation; - -public static class DispatcherOptionsExtensions -{ - /// - /// It is not recommended to use directly here, please use UseIsolationUoW - /// - /// - /// - /// - public static IEventBusBuilder UseIsolation(this IEventBusBuilder eventBusBuilder, Action isolationBuilder) - { - eventBusBuilder.Services.AddIsolation(isolationBuilder); - return eventBusBuilder; - } - - /// - /// It is not recommended to use directly here, please use UseIsolationUoW - /// - /// - /// - /// - public static IDispatcherOptions UseIsolation(this IDispatcherOptions options, Action isolationBuilder) - { - options.Services.AddIsolation(isolationBuilder); - return options; - } - - private static void AddIsolation(this IServiceCollection services, Action isolationBuilder) - { - ArgumentNullException.ThrowIfNull(services); - ArgumentNullException.ThrowIfNull(isolationBuilder); - - if (services.Any(service => service.ImplementationType == typeof(IsolationProvider))) - return; - - services.AddSingleton(); - - IsolationBuilder builder = new IsolationBuilder(services); - isolationBuilder.Invoke(builder); - - if (services.Count(service => - service.ServiceType == typeof(ITenantContext) || - service.ServiceType == typeof(IEnvironmentContext)) < 1) - throw new NotSupportedException("Tenant isolation and environment isolation use at least one"); - - services.AddHttpContextAccessor(); - - services - .TryAddConfigure() - .AddTransient(typeof(IMiddleware<>), typeof(IsolationMiddleware<>)) - .TryAddSingleton(); - - if (services.Any(service => service.ServiceType == typeof(IConnectionStringProvider))) - services.Replace(new ServiceDescriptor(typeof(IConnectionStringProvider), typeof(DefaultDbIsolationConnectionStringProvider), ServiceLifetime.Scoped)); - else - services.TryAddScoped(); - } - - private static IServiceCollection TryAddConfigure( - this IServiceCollection services) - where TOptions : class - { - services.AddOptions(); - var serviceProvider = services.BuildServiceProvider(); - IConfiguration? configuration = serviceProvider.GetService()?.Local ?? - serviceProvider.GetService(); - - if (configuration == null) - return services; - - string name = Options.DefaultName; - services.TryAddSingleton>( - new ConfigurationChangeTokenSource(name, configuration)); - services.TryAddSingleton>(new NamedConfigureFromConfigurationOptions( - name, - configuration, _ => - { - })); - return services; - } - - private class IsolationProvider - { - } -} diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilder.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilder.cs deleted file mode 100644 index 867e239ac..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilder.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation; - -public class IsolationBuilder : IIsolationBuilder -{ - public IServiceCollection Services { get; } - - public IsolationBuilder(IServiceCollection services) - { - Services = services; - } -} diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs deleted file mode 100644 index ca410d787..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Builder; - -public static class IsolationBuilderExtensions -{ - public static TApplicationBuilder UseIsolation(this TApplicationBuilder app) where TApplicationBuilder : IApplicationBuilder - { - app.UseMiddleware(); - return app; - } -} diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationDbContextProvider.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationDbContextProvider.cs deleted file mode 100644 index 6f13962b9..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/IsolationDbContextProvider.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation; - -public class IsolationDbContextProvider : BaseDbConnectionStringProvider -{ - private readonly IOptionsMonitor _options; - - public IsolationDbContextProvider(IOptionsMonitor options) => _options = options; - - protected override List GetDbContextOptionsList() - { - var connectionStrings = _options.CurrentValue.IsolationConnectionStrings - .Select(connectionString => connectionString.ConnectionString) - .Distinct() - .ToList(); - if (!connectionStrings.Contains(_options.CurrentValue.ConnectionStrings.DefaultConnection)) - connectionStrings.Add(_options.CurrentValue.ConnectionStrings.DefaultConnection); - - return connectionStrings.Select(connectionString => new MasaDbContextConfigurationOptions(connectionString)).ToList(); - } -} diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj deleted file mode 100644 index 6cd1fbfdf..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs deleted file mode 100644 index 20ca0c518..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.Middleware; - -public class IsolationMiddleware : Middleware where TEvent : IEvent -{ - private readonly IEnumerable _middlewares; - - public IsolationMiddleware(IEnumerable middlewares) - { - _middlewares = middlewares; - } - - public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) - { - foreach (var middleware in _middlewares) - { - await middleware.HandleAsync(); - } - - await next(); - } -} - -public class IsolationMiddleware -{ - private readonly RequestDelegate _next; - - public IsolationMiddleware(RequestDelegate next) - { - _next = next; - } - - public async Task InvokeAsync(HttpContext httpContext, IEnumerable middlewares) - { - foreach (var middleware in middlewares) - { - await middleware.HandleAsync(); - } - - await _next(httpContext); - } -} diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.md b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.md deleted file mode 100644 index 01ddc5466..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.md +++ /dev/null @@ -1,5 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Isolation - -The core library of Masa.Contrib.Isolation provides database address selection and parser for Isolation. It does not support stand-alone use yet. It needs to be used through Masa.Contrib.Isolation.UoW.EF. [View usage](../Masa.Contrib.Isolation.UoW.EF/README.md) \ No newline at end of file diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.zh-CN.md b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.zh-CN.md deleted file mode 100644 index cee55a777..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/README.zh-CN.md +++ /dev/null @@ -1,5 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Isolation - -Masa.Contrib.Isolation核心库,为Isolation提供数据库地址选择以及解析器,暂不支持单独使用,需要通过Masa.Contrib.Isolation.UoW.EF来使用,[查看用法](../Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md) \ No newline at end of file diff --git a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/_Imports.cs b/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/_Imports.cs deleted file mode 100644 index 85a7c4dad..000000000 --- a/src/Contrib/Isolation/Isolation/src/Masa.Contrib.Isolation/_Imports.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Configuration; -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.Options; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Isolation; -global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.BuildingBlocks.Isolation.Middleware; -global using Masa.BuildingBlocks.Isolation.MultiTenant; -global using Masa.BuildingBlocks.Isolation.Options; -global using Masa.Contrib.Isolation.Middleware; -global using Microsoft.AspNetCore.Http; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using System.Linq.Expressions; diff --git a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj deleted file mode 100644 index 38f9cf5fd..000000000 --- a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - diff --git a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs deleted file mode 100644 index 2329421c9..000000000 --- a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.Tests; - -public class RequestCookieCollection : Dictionary, IRequestCookieCollection -{ - public new ICollection Keys { get; } -} diff --git a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs deleted file mode 100644 index 67e394dd9..000000000 --- a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs +++ /dev/null @@ -1,533 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.Tests; - -[TestClass] -public class TestDbIsolationConnectionStringProvider -{ - private IServiceCollection _services; - - [TestInitialize] - public void Initialize() - { - _services = new ServiceCollection(); - _services.AddScoped(); - } - - [TestMethod] - public async Task TestGetConnectionStringAsync() - { - string defaultConnectionString = "data source=test1;"; - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - unitOfWorkAccessor.CurrentDbContextOptions = new MasaDbContextConfigurationOptions(defaultConnectionString); - var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, null!); - - Assert.IsTrue(await provider.GetConnectionStringAsync() == defaultConnectionString); - } - - [TestMethod] - public async Task TestGetConnectionString2Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - - var options = _services.BuildServiceProvider().GetRequiredService>(); - var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options); - Assert.IsTrue(await provider.GetConnectionStringAsync() == connectionStrings.DefaultConnection); - } - - [TestMethod] - public async Task TestGetConnectionString3Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - Environment = "dev", - ConnectionString = "data source=test2;" - }, - new() - { - Environment = "pro", - ConnectionString = "data source=test3;" - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("pro").Verifiable(); - var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test3;"); - } - - [TestMethod] - public async Task TestGetConnectionString4Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - Environment = "dev", - ConnectionString = "data source=test2;" - }, - new() - { - Environment = "pro", - ConnectionString = "data source=test3;" - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("Staging").Verifiable(); - var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test1;"); - } - - [TestMethod] - public async Task TestGetConnectionString5Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - TenantId = "1", - ConnectionString = "data source=test2;" - }, - new() - { - TenantId = "2", - ConnectionString = "data source=test3;" - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("1")).Verifiable(); - var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, null, tenantContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test2;"); - } - - [TestMethod] - public async Task TestGetConnectionString6Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - TenantId = "1", - ConnectionString = "data source=test2;" - }, - new() - { - TenantId = "2", - ConnectionString = "data source=test3;" - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("2")).Verifiable(); - var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, null, tenantContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test3;"); - } - - [TestMethod] - public async Task TestGetConnectionString7Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - TenantId = "1", - ConnectionString = "data source=test2;" - }, - new() - { - TenantId = "2", - ConnectionString = "data source=test3;" - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("11")).Verifiable(); - var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, null, tenantContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test1;"); - } - - [TestMethod] - public async Task TestGetConnectionString8Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - TenantId = "1", - Environment = "dev", - ConnectionString = "data source=test2;" - }, - new() - { - TenantId = "2", - Environment = "dev", - ConnectionString = "data source=test3;" - }, - new() - { - TenantId = "2", - Environment = "pro", - ConnectionString = "data source=test4;" - }, - new() - { - TenantId = "*", - Environment = "pro", - ConnectionString = "data source=test5;", - Score = 99 - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("Staging").Verifiable(); - - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("11")).Verifiable(); - var provider = - new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test1;"); - } - - [TestMethod] - public async Task TestGetConnectionString9Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - TenantId = "1", - Environment = "dev", - ConnectionString = "data source=test2;" - }, - new() - { - TenantId = "2", - Environment = "dev", - ConnectionString = "data source=test3;" - }, - new() - { - TenantId = "2", - Environment = "pro", - ConnectionString = "data source=test4;" - }, - new() - { - TenantId = "*", - Environment = "pro", - ConnectionString = "data source=test5;", - Score = 99 - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("dev").Verifiable(); - - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("1")).Verifiable(); - var provider = - new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test2;"); - } - - [TestMethod] - public async Task TestGetConnectionString10Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - TenantId = "1", - Environment = "dev", - ConnectionString = "data source=test2;" - }, - new() - { - TenantId = "2", - Environment = "dev", - ConnectionString = "data source=test3;" - }, - new() - { - TenantId = "2", - Environment = "pro", - ConnectionString = "data source=test4;" - }, - new() - { - TenantId = "*", - Environment = "pro", - ConnectionString = "data source=test5;", - Score = 99 - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("dev").Verifiable(); - - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("2")).Verifiable(); - var provider = - new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test3;"); - } - - [TestMethod] - public async Task TestGetConnectionString11Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - TenantId = "1", - Environment = "dev", - ConnectionString = "data source=test2;" - }, - new() - { - TenantId = "2", - Environment = "dev", - ConnectionString = "data source=test3;" - }, - new() - { - TenantId = "2", - Environment = "pro", - ConnectionString = "data source=test4;" - }, - new() - { - TenantId = "*", - Environment = "pro", - ConnectionString = "data source=test5;", - Score = 99 - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("pro").Verifiable(); - - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("2")).Verifiable(); - var provider = - new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test4;"); - } - - [TestMethod] - public async Task TestGetConnectionString12Async() - { - _services.AddLogging(); - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - TenantId = "1", - Environment = "dev", - ConnectionString = "data source=test2;" - }, - new() - { - TenantId = "2", - Environment = "dev", - ConnectionString = "data source=test3;" - }, - new() - { - TenantId = "2", - Environment = "pro", - ConnectionString = "data source=test4;" - }, - new() - { - TenantId = "*", - Environment = "pro", - ConnectionString = "data source=test5;", - Score = 99 - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("pro").Verifiable(); - - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("2")).Verifiable(); - var provider = - new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test4;"); - } - - [TestMethod] - public async Task TestGetConnectionString13Async() - { - var connectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test1;" - }; - _services.Configure(option => option.ConnectionStrings = connectionStrings); - var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; - _services.Configure(option => - { - option.ConnectionStrings = connectionStrings; - option.IsolationConnectionStrings = new List - { - new() - { - TenantId = "1", - Environment = "dev", - ConnectionString = "data source=test2;" - }, - new() - { - TenantId = "2", - Environment = "dev", - ConnectionString = "data source=test3;" - }, - new() - { - TenantId = "2", - Environment = "pro", - ConnectionString = "data source=test4;" - }, - new() - { - TenantId = "*", - Environment = "pro", - ConnectionString = "data source=test5;", - Score = 99 - } - }; - }); - var options = _services.BuildServiceProvider().GetRequiredService>(); - - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("pro").Verifiable(); - - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("10")).Verifiable(); - var provider = - new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); - Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test5;"); - } - -} diff --git a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestIsolation.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestIsolation.cs deleted file mode 100644 index a9061928c..000000000 --- a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestIsolation.cs +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.Tests; - -[TestClass] -public class TestIsolation -{ - [TestMethod] - public void TestGetDbContextOptionsList() - { - var services = new ServiceCollection(); - services.Configure(option => - { - option.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test2" - }; - option.IsolationConnectionStrings = new() - { - new() - { - Environment = "dev", - ConnectionString = "data source=test3" - }, - new() - { - Environment = "pro", - ConnectionString = "data source=test4" - } - }; - }); - services.AddSingleton(); - var serviceProvider = services.BuildServiceProvider(); - var provider = serviceProvider.GetRequiredService(); - Assert.IsTrue(provider.DbContextOptionsList.Distinct().Count() == 3); - } - - [TestMethod] - public void TestUseIsolation() - { - var services = new ServiceCollection(); - Mock eventBuilder = new(); - eventBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - Assert.ThrowsException(() => - { - eventBuilder.Object.UseIsolation(isolationBuilder => - { - }); - }, "Tenant isolation and environment isolation use at least one"); - } - - [TestMethod] - public void TestUseIsolation2() - { - IServiceCollection services = null!; - Mock eventBuilder = new(); - eventBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - Assert.ThrowsException(() => - { - eventBuilder.Object.UseIsolation(isolationBuilder => - { - }); - }); - } - - [TestMethod] - public void TestUseIsolation3() - { - IServiceCollection services = null!; - Mock options = new(); - options.Setup(option => option.Services).Returns(services).Verifiable(); - Assert.ThrowsException(() => - { - options.Object.UseIsolation(isolationBuilder => - { - }); - }); - } - - [TestMethod] - public void TestUseIsolation4() - { - IServiceCollection services = new ServiceCollection(); - Mock eventBuilder = new(); - eventBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - Assert.ThrowsException(() => - { - eventBuilder.Object.UseIsolation(null!); - }); - } - - [TestMethod] - public void TestUseIsolation5() - { - IServiceCollection services = new ServiceCollection(); - Mock options = new(); - options.Setup(option => option.Services).Returns(services).Verifiable(); - Assert.ThrowsException(() => - { - options.Object.UseIsolation(null!); - }); - } - - [TestMethod] - public void TestUseIsolation6() - { - IServiceCollection services = new ServiceCollection(); - Mock options = new(); - options.Setup(option => option.Services).Returns(services).Verifiable(); - options.Object.UseIsolation(isolationBuilder => isolationBuilder.UseMultiEnvironment()); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(services.Count(service => service.ServiceType == typeof(IIsolationMiddleware)) == 1); - - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - Assert.IsTrue(!serviceProvider.GetServices().Any()); - } - - [TestMethod] - public void TestUseIsolation7() - { - IServiceCollection services = new ServiceCollection(); - Mock options = new(); - options.Setup(option => option.Services).Returns(services).Verifiable(); - - options.Object.UseIsolation(isolationBuilder => isolationBuilder.UseMultiTenant()); - - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(services.Count(service => service.ServiceType == typeof(IIsolationMiddleware)) == 1); - - Assert.IsTrue(!serviceProvider.GetServices().Any()); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestUseIsolation8() - { - IServiceCollection services = new ServiceCollection(); - Mock options = new(); - options.Setup(option => option.Services).Returns(services).Verifiable(); - options.Object.UseIsolation(isolationBuilder - => isolationBuilder.UseMultiTenant().UseMultiEnvironment()); - options.Object.UseIsolation(isolationBuilder - => isolationBuilder.UseMultiTenant().UseMultiEnvironment()); - - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(services.Count(service => service.ServiceType == typeof(IIsolationMiddleware)) == 2); - - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestUseIsolation9() - { - - } -} diff --git a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestParserProvider.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestParserProvider.cs deleted file mode 100644 index 6e49fdb35..000000000 --- a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/TestParserProvider.cs +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.Tests; - -[TestClass] -public class TestParserProvider -{ - [TestMethod] - public async Task TestCookieParserAsync() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = - { - Cookies = new RequestCookieCollection - { - { - tenantKey, "1" - } - } - } - }; - var provider = new CookieParserProvider(); - Assert.IsTrue(provider.Name == "Cookie"); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => - { - Assert.IsTrue(tenantId == "1"); - }); - Assert.IsTrue(handler); - } - - [TestMethod] - public async Task TestCookieParser2Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = - { - Cookies = new RequestCookieCollection() - } - }; - var provider = new CookieParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => { }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestCookieParser3Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var provider = new CookieParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => { }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestFormParserAsync() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = - { - Form = new FormCollection(new Dictionary - { - { tenantKey, "1" } - } - ) - } - }; - var provider = new FormParserProvider(); - Assert.IsTrue(provider.Name == "Form"); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => - { - Assert.IsTrue(tenantId == "1"); - }); - Assert.IsTrue(handler); - } - - [TestMethod] - public async Task TestFormParser2Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = - { - Form = new FormCollection(new Dictionary()) - } - }; - var provider = new FormParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => - { - }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestFormParser3Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = - { - QueryString = QueryString.Create(tenantKey, "1") - } - }; - var provider = new FormParserProvider(); - Assert.IsTrue(provider.Name == "Form"); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => - { - }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestHeaderParserAsync() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = - { - Headers = - { - { tenantKey, "1" } - } - } - }; - var provider = new HeaderParserProvider(); - Assert.IsTrue(provider.Name == "Header"); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => - { - Assert.IsTrue(tenantId == "1"); - }); - Assert.IsTrue(handler); - } - - [TestMethod] - public async Task TestHeaderParser2Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = - { - Headers = { } - } - }; - var provider = new HeaderParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => - { - }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestHttpContextItemParserAsync() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { tenantKey, "1" } - } - }; - var provider = new HttpContextItemParserProvider(); - Assert.IsTrue(provider.Name == "Items"); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => - { - Assert.IsTrue(tenantId == "1"); - }); - Assert.IsTrue(handler); - } - - [TestMethod] - public async Task TestHttpContextItemParser2Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Items = new Dictionary() - }; - var provider = new HttpContextItemParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => - { - }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestHttpContextItemParser3Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var provider = new HttpContextItemParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => - { - }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestQueryStringParserAsync() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = { QueryString = QueryString.Create(tenantKey, "1") } - }; - var provider = new QueryStringParserProvider(); - Assert.IsTrue(provider.Name == "QueryString"); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => - { - Assert.IsTrue(tenantId == "1"); - }); - Assert.IsTrue(handler); - } - - [TestMethod] - public async Task TestQueryStringParser2Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = { QueryString = new QueryString() } - }; - var provider = new QueryStringParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => - { - }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestQueryStringParser3Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var provider = new QueryStringParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => - { - }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestRouteParserAsync() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = - { - RouteValues = new RouteValueDictionary - { - { tenantKey, "1" } - } - } - }; - var provider = new RouteParserProvider(); - Assert.IsTrue(provider.Name == "Route"); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => - { - Assert.IsTrue(tenantId == "1"); - }); - Assert.IsTrue(handler); - } - - [TestMethod] - public async Task TestRouteParser2Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var serviceProvider = services.BuildServiceProvider(); - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext - { - Request = - { - RouteValues = new RouteValueDictionary() - } - }; - var provider = new RouteParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => - { - }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestRouteParser3Async() - { - var services = new ServiceCollection(); - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var provider = new RouteParserProvider(); - var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => - { - }); - Assert.IsFalse(handler); - } - - [TestMethod] - public async Task TestEnvironmentVariablesParserAsync() - { - var services = new ServiceCollection(); - string environmentKey = "env"; - System.Environment.SetEnvironmentVariable(environmentKey, "dev"); - var serviceProvider = services.BuildServiceProvider(); - var environmentVariablesParserProvider = new EnvironmentVariablesParserProvider(); - var handler = await environmentVariablesParserProvider.ResolveAsync(serviceProvider, environmentKey, environment => - { - Assert.IsTrue(environment == "dev"); - }); - Assert.IsTrue(environmentVariablesParserProvider.Name == "EnvironmentVariables"); - Assert.IsTrue(handler); - } -} diff --git a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs deleted file mode 100644 index 2b9d6c1d2..000000000 --- a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.Data.Options; - -namespace Masa.Contrib.Isolation.Tests; - -public class UnitOfWorkAccessor: IUnitOfWorkAccessor -{ - public MasaDbContextConfigurationOptions? CurrentDbContextOptions { get; set; } -} diff --git a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/_Imports.cs b/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/_Imports.cs deleted file mode 100644 index 8dc426a07..000000000 --- a/src/Contrib/Isolation/Isolation/test/Masa.Contrib.Isolation.Tests/_Imports.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.Options; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.BuildingBlocks.Isolation.Middleware; -global using Masa.BuildingBlocks.Isolation.MultiTenant; -global using Masa.BuildingBlocks.Isolation.Options; -global using Masa.BuildingBlocks.Isolation.Parser; -global using Masa.Contrib.Isolation.MultiEnvironment; -global using Masa.Contrib.Isolation.MultiTenant; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Routing; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using Microsoft.Extensions.Primitives; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System; -global using System.Linq; diff --git a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs deleted file mode 100644 index 56c624c3e..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiEnvironment; - -public class EnvironmentContext : IEnvironmentContext, IEnvironmentSetter -{ - public string CurrentEnvironment { get; private set; } = string.Empty; - - public void SetEnvironment(string environment) => CurrentEnvironment = environment; -} diff --git a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs deleted file mode 100644 index ab0824a76..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiEnvironment; - -public static class IsolationBuilderExtensions -{ - public const string DEFAULT_ENVIRONMENT_NAME = "ASPNETCORE_ENVIRONMENT"; - - public static IIsolationBuilder UseMultiEnvironment(this IIsolationBuilder isolationBuilder) - => isolationBuilder.UseMultiEnvironment(DEFAULT_ENVIRONMENT_NAME); - - public static IIsolationBuilder UseMultiEnvironment(this IIsolationBuilder isolationBuilder, List? parserProviders) - => isolationBuilder.UseMultiEnvironment(DEFAULT_ENVIRONMENT_NAME, parserProviders); - - public static IIsolationBuilder UseMultiEnvironment(this IIsolationBuilder isolationBuilder, string environmentName, List? parserProviders = null) - { - if (isolationBuilder.Services.Any(service => service.ImplementationType == typeof(EnvironmentProvider))) - return isolationBuilder; - - isolationBuilder.Services.AddSingleton(); - - isolationBuilder.Services.AddScoped(serviceProvider => new MultiEnvironmentMiddleware(serviceProvider, environmentName, parserProviders)); - isolationBuilder.Services.TryAddScoped(); - isolationBuilder.Services.TryAddScoped(typeof(IEnvironmentContext), serviceProvider => serviceProvider.GetRequiredService()); - isolationBuilder.Services.TryAddScoped(typeof(IEnvironmentSetter), serviceProvider => serviceProvider.GetRequiredService()); - return isolationBuilder; - } - - private class EnvironmentProvider - { - } -} diff --git a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj deleted file mode 100644 index c77cd51bc..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs deleted file mode 100644 index 487f31c46..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiEnvironment.Middleware; - -public class MultiEnvironmentMiddleware : IIsolationMiddleware -{ - private readonly IServiceProvider _serviceProvider; - private readonly ILogger? _logger; - private readonly IEnumerable _parserProviders; - private readonly IEnvironmentContext _environmentContext; - private readonly IEnvironmentSetter _environmentSetter; - private readonly IMultiEnvironmentUserContext? _environmentUserContext; - private readonly string _environmentKey; - private bool _handled; - - public MultiEnvironmentMiddleware( - IServiceProvider serviceProvider, - string environmentKey, - IEnumerable? parserProviders) - { - _serviceProvider = serviceProvider; - _environmentKey = environmentKey; - _parserProviders = parserProviders ?? GetDefaultParserProviders(); - _logger = _serviceProvider.GetService>(); - _environmentContext = _serviceProvider.GetRequiredService(); - _environmentSetter = _serviceProvider.GetRequiredService(); - _environmentUserContext = _serviceProvider.GetService(); - } - - public async Task HandleAsync() - { - if (_handled) - return; - - if (!string.IsNullOrEmpty(_environmentContext.CurrentEnvironment)) - { - _logger?.LogDebug($"The environment is successfully resolved, and the resolver is: empty"); - return; - } - - if (_environmentUserContext is { IsAuthenticated: true, Environment: { } }) - { - _environmentSetter.SetEnvironment(_environmentUserContext.Environment); - return; - } - - List parsers = new(); - foreach (var environmentParserProvider in _parserProviders) - { - parsers.Add(environmentParserProvider.Name); - if (await environmentParserProvider.ResolveAsync(_serviceProvider, _environmentKey, - environment => _environmentSetter.SetEnvironment(environment))) - { - _logger?.LogDebug("The environment is successfully resolved, and the resolver is: {Resolvers}", string.Join("、 ", parsers)); - _handled = true; - return; - } - } - _logger?.LogDebug("Failed to resolve environment, and the resolver is: {Resolvers}", string.Join("、 ", parsers)); - _handled = true; - } - - private List GetDefaultParserProviders() - { - return new List - { - new HttpContextItemParserProvider(), - new QueryStringParserProvider(), - new FormParserProvider(), - new RouteParserProvider(), - new HeaderParserProvider(), - new CookieParserProvider(), - new EnvironmentVariablesParserProvider() - }; - } -} diff --git a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.md b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.md deleted file mode 100644 index e4a5dd061..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.md +++ /dev/null @@ -1,96 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Isolation.MultiEnvironment - -Example: - -```C# -Install-Package Masa.Contrib.Isolation.UoW.EF -Install-Package Masa.Contrib.Isolation.MultiEnvironment -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. Configure `appsettings.json` -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - "IsolationConnectionStrings": [ - { - "Environment": "development", - "ConnectionString": "server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - { - "Environment": "staging", - "ConnectionString": "server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity;" - } - ] -} -``` -* 1.1 When the current environment is development: database address: server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; -* 1.2 When the current environment is staging: database address: server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; -* 1.3 When the current environment is another environment: database address: server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; - -2. Using Isolation.UoW.EF -```` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiEnvironment(), - dbOptions => dbOptions.UseSqlServer()); -}); -```` - -3. DbContext needs to inherit IsolationDbContext - -```` C# -public class CustomDbContext : IsolationDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } -} -```` - -4. The class corresponding to the isolated table needs to implement IMultiEnvironment - -You can also choose not to implement IMultiEnvironment when using physical isolation - -##### Summarize - -* How is the environment resolved in the controller or MinimalAPI? - * The environment provides 7 parsers by default, and the execution order is: HttpContextItemParserProvider、 QueryStringParserProvider、 FormParserProvider、 RouteParserProvider、 HeaderParserProvider、 CookieParserProvider、 EnvironmentVariablesParserProvider (Get the parameters in the system environment variables, the parameters of the default environment isolation: ASPNETCORE_ENVIRONMENT) - * HttpContextItemParserProvider: Get environment information through the Items property of the requested HttpContext - * QueryStringParserProvider: Get environment information through the requested QueryString - * https://github.com/masastack?ASPNETCORE_ENVIRONMENT=development (environment information is development) - * FormParserProvider: Get environment information through Form form - * RouteParserProvider: Get environment information through routing - * HeaderParserProvider: Get environment information through request headers - * CookieParserProvider: Get environmental information through cookies - * EnvironmentVariablesParserProvider: Get environment information through system environment variables -* If the parser fails to resolve the environment, what is the last database used? - * If the parsing environment fails, return DefaultConnection directly -* How to change the default environment parameter name - -```` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiEnvironment("env"),// Use environment isolation - dbOptions => dbOptions.UseSqlServer()); -}); -```` -* How to change the parser - -```` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiEnvironment("env", new List() - { - new EnvironmentVariablesParserProvider() //By default, environment information in environment isolation is obtained from system environment variables - }), - dbOptions => dbOptions.UseSqlServer());// Use environment isolation -}); -```` \ No newline at end of file diff --git a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md deleted file mode 100644 index 4aa69480c..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md +++ /dev/null @@ -1,97 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Isolation.MultiEnvironment - -用例: - -```C# -Install-Package Masa.Contrib.Isolation.UoW.EF -Install-Package Masa.Contrib.Isolation.MultiEnvironment -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. 配置`appsettings.json` -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - "IsolationConnectionStrings": [ - { - "Environment": "development", - "ConnectionString": "server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - { - "Environment": "staging", - "ConnectionString": "server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity;" - } - ] -} -``` - -* 1.1 当前环境是development时:数据库地址:server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; -* 1.2 当前环境是staging时:数据库地址:server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; -* 1.3 当前环境是其他环境时:数据库地址:server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; - -2. 使用Isolation.UoW.EF -``` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiEnvironment(), - dbOptions => dbOptions.UseSqlServer()); -}); -``` - -3. DbContext需要继承IsolationDbContext - -``` C# -public class CustomDbContext : IsolationDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } -} -``` - -4. 隔离的表对应的类需要实现IMultiEnvironment - -采用物理隔离时也可以选择不实现IMultiEnvironment - -##### 总结 - -* 控制器或MinimalAPI中环境如何解析? - * 环境默认提供了7个解析器,执行顺序为:HttpContextItemParserProvider、QueryStringParserProvider、FormParserProvider、RouteParserProvider、HeaderParserProvider、CookieParserProvider、EnvironmentVariablesParserProvider (获取系统环境变量中的参数,默认环境隔离的参数:ASPNETCORE_ENVIRONMENT) - * HttpContextItemParserProvider: 通过请求的HttpContext的Items属性获取环境信息 - * QueryStringParserProvider: 通过请求的QueryString获取环境信息 - * https://github.com/masastack?ASPNETCORE_ENVIRONMENT=development (环境信息是development) - * FormParserProvider: 通过Form表单获取环境信息 - * RouteParserProvider: 通过路由获取环境信息 - * HeaderParserProvider: 通过请求头获取环境信息 - * CookieParserProvider: 通过Cookie获取环境信息 - * EnvironmentVariablesParserProvider: 通过系统环境变量获取环境信息 -* 如果解析器解析环境失败,那最后使用的数据库是? - * 若解析环境失败,则直接返回DefaultConnection -* 如何更改默认环境参数名 - -``` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiEnvironment("env"),// 使用环境隔离 - dbOptions => dbOptions.UseSqlServer()); -}); -``` -* 如何更改解析器 - -``` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiEnvironment("env", new List() - { - new EnvironmentVariablesParserProvider() // 默认从系统环境变量中获取环境隔离中的环境信息 - }), - dbOptions => dbOptions.UseSqlServer());// 使用环境隔离 -}); -``` \ No newline at end of file diff --git a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs b/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs deleted file mode 100644 index b185df42d..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/src/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.BuildingBlocks.Isolation; -global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.BuildingBlocks.Isolation.Middleware; -global using Masa.BuildingBlocks.Isolation.Parser; -global using Masa.Contrib.Isolation.MultiEnvironment.Middleware; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj b/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj deleted file mode 100644 index 5b30f1403..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs b/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs deleted file mode 100644 index ec091afca..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiEnvironment.Tests; - -[TestClass] -public class TestEnvironment -{ - [TestMethod] - public void TestSetEnvironment() - { - var services = new ServiceCollection(); - Mock isolationBuilder = new(); - isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - isolationBuilder.Object.UseMultiEnvironment(); - - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(string.IsNullOrEmpty(serviceProvider.GetRequiredService().CurrentEnvironment)); - - serviceProvider.GetRequiredService().SetEnvironment("dev"); - Assert.IsTrue(serviceProvider.GetRequiredService().CurrentEnvironment == "dev"); - } - - [TestMethod] - public void TestUseMultiEnvironment() - { - IServiceCollection services = new ServiceCollection(); - Mock options = new(); - options.Setup(option => option.Services).Returns(services).Verifiable(); - options.Object.UseMultiEnvironment(); - - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetService() != null); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - Assert.IsTrue(serviceProvider.GetService() != null); - Assert.IsTrue(serviceProvider.GetService() != null); - Assert.IsTrue(serviceProvider.GetService() != null); - } - - [TestMethod] - public void TestUseMultiEnvironment2() - { - IServiceCollection services = new ServiceCollection(); - Mock options = new(); - options.Setup(option => option.Services).Returns(services).Verifiable(); - options.Object.UseMultiEnvironment().UseMultiEnvironment(); - - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetService() != null); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - Assert.IsTrue(serviceProvider.GetService() != null); - Assert.IsTrue(serviceProvider.GetService() != null); - Assert.IsTrue(serviceProvider.GetService() != null); - } - - [TestMethod] - public void TestUseMultiEnvironment3() - { - IServiceCollection services = new ServiceCollection(); - Mock options = new(); - options.Setup(option => option.Services).Returns(services).Verifiable(); - options.Object.UseMultiEnvironment(new List() { }); - - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetService() != null); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - Assert.IsTrue(serviceProvider.GetService() != null); - Assert.IsTrue(serviceProvider.GetService() != null); - Assert.IsTrue(serviceProvider.GetService() != null); - } -} diff --git a/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs b/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs deleted file mode 100644 index f34a13880..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiEnvironment.Tests; - -[TestClass] -public class TestMiddleware -{ - [TestMethod] - public async Task TestMultiEnvironmentMiddlewareAsync() - { - var services = new ServiceCollection(); - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("").Verifiable(); - services.AddScoped(_ => environmentContext.Object); - - Mock environmentSetter = new(); - environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); - services.AddScoped(_ => environmentSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider - => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - List parserProviders = new List - { - parserProvider.Object - }; - string environmentKey = "env"; - var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, parserProviders); - await middleware.HandleAsync(); - parserProvider.Verify( - provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Once); - } - - [TestMethod] - public async Task TestMultiEnvironmentMiddleware2Async() - { - var services = new ServiceCollection(); - services.AddLogging(); - - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("").Verifiable(); - services.AddScoped(_ => environmentContext.Object); - - Mock environmentSetter = new(); - environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); - services.AddScoped(_ => environmentSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())).Verifiable(); - List parserProviders = new List - { - parserProvider.Object - }; - string environmentKey = "env"; - var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, parserProviders); - await middleware.HandleAsync(); - parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Once); - } - - [TestMethod] - public async Task TestMultiEnvironmentMiddleware3Async() - { - var services = new ServiceCollection(); - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("dev").Verifiable(); - services.AddScoped(_ => environmentContext.Object); - - Mock environmentSetter = new(); - environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); - services.AddScoped(_ => environmentSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider - => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - List parserProviders = new List - { - parserProvider.Object - }; - string environmentKey = "env"; - var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, parserProviders); - await middleware.HandleAsync(); - parserProvider.Verify( - provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); - } - - [TestMethod] - public async Task TestMultiEnvironmentMiddleware4Async() - { - var services = new ServiceCollection(); - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("").Verifiable(); - services.AddScoped(_ => environmentContext.Object); - - Mock environmentSetter = new(); - environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); - services.AddScoped(_ => environmentSetter.Object); - - services.AddHttpContextAccessor(); - string environmentKey = "env"; - var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; - httpContextAccessor = new HttpContextAccessor - { - HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { environmentKey, "dev" } - } - } - }; - var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, null); - await middleware.HandleAsync(); - environmentSetter.Verify(setter => setter.SetEnvironment(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestMultiEnvironmentMiddleware5Async() - { - var services = new ServiceCollection(); - services.AddLogging(); - Mock environmentContext = new(); - environmentContext.Setup(context => context.CurrentEnvironment).Returns("").Verifiable(); - services.AddScoped(_ => environmentContext.Object); - - Mock environmentSetter = new(); - environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); - services.AddScoped(_ => environmentSetter.Object); - - services.AddHttpContextAccessor(); - string environmentKey = "env"; - var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; - httpContextAccessor = new HttpContextAccessor - { - HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { environmentKey, "dev" } - } - } - }; - var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, null); - await middleware.HandleAsync(); - environmentSetter.Verify(setter => setter.SetEnvironment(It.IsAny()), Times.Once); - } -} diff --git a/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs b/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs deleted file mode 100644 index fad417443..000000000 --- a/src/Contrib/Isolation/MultiEnvironment/test/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Isolation; -global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.BuildingBlocks.Isolation.Middleware; -global using Masa.Contrib.Isolation.MultiEnvironment.Middleware; -global using Microsoft.AspNetCore.Http; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System; diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs deleted file mode 100644 index 38f781c2d..000000000 --- a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiTenant; - -public class ConvertProvider : IConvertProvider -{ - public object ChangeType(string value, Type conversionType) - { - var result = conversionType == typeof(Guid) ? Guid.Parse(value) : Convert.ChangeType(value, conversionType); - return result; - } -} diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs deleted file mode 100644 index b3fea58c5..000000000 --- a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiTenant; - -public static class IsolationBuilderExtensions -{ - public const string DEFAULT_TENANT_NAME = "__tenant"; - - public static IIsolationBuilder UseMultiTenant(this IIsolationBuilder isolationBuilder) - => isolationBuilder.UseMultiTenant(DEFAULT_TENANT_NAME); - - public static IIsolationBuilder UseMultiTenant(this IIsolationBuilder isolationBuilder, string tenantName) - => isolationBuilder.UseMultiTenant(tenantName, null); - - public static IIsolationBuilder UseMultiTenant(this IIsolationBuilder isolationBuilder, List? parserProviders) - => isolationBuilder.UseMultiTenant(DEFAULT_TENANT_NAME, parserProviders); - - public static IIsolationBuilder UseMultiTenant(this IIsolationBuilder isolationBuilder, string tenantName, List? parserProviders) - { - if (isolationBuilder.Services.Any(service => service.ImplementationType == typeof(MultiTenantProvider))) - return isolationBuilder; - - isolationBuilder.Services.AddSingleton(); - - isolationBuilder.Services.AddScoped(serviceProvider => new MultiTenantMiddleware(serviceProvider, tenantName, parserProviders)); - isolationBuilder.Services.TryAddSingleton(); - isolationBuilder.Services.TryAddScoped(); - isolationBuilder.Services.TryAddScoped(typeof(ITenantContext), serviceProvider => serviceProvider.GetRequiredService()); - isolationBuilder.Services.TryAddScoped(typeof(ITenantSetter), serviceProvider => serviceProvider.GetRequiredService()); - return isolationBuilder; - } - - private class MultiTenantProvider - { - } -} diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj deleted file mode 100644 index c77cd51bc..000000000 --- a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs deleted file mode 100644 index a1f388a62..000000000 --- a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiTenant.Middleware; - -public class MultiTenantMiddleware : IIsolationMiddleware -{ - private readonly IServiceProvider _serviceProvider; - private readonly ILogger? _logger; - private readonly IEnumerable _parserProviders; - private readonly ITenantContext _tenantContext; - private readonly ITenantSetter _tenantSetter; - private readonly IMultiTenantUserContext? _tenantUserContext; - private readonly string _tenantKey; - private bool _handled; - - public MultiTenantMiddleware( - IServiceProvider serviceProvider, - string tenantKey, - IEnumerable? parserProviders) - { - _serviceProvider = serviceProvider; - _tenantKey = tenantKey; - _parserProviders = parserProviders ?? GetDefaultParserProviders(); - _logger = _serviceProvider.GetService>(); - _tenantContext = _serviceProvider.GetRequiredService(); - _tenantSetter = _serviceProvider.GetRequiredService(); - _tenantUserContext = _serviceProvider.GetService(); - } - - public async Task HandleAsync() - { - if (_handled) - return; - - if (_tenantContext.CurrentTenant != null && !string.IsNullOrEmpty(_tenantContext.CurrentTenant.Id)) - { - _logger?.LogDebug($"The tenant is successfully resolved, and the resolver is: empty"); - return; - } - - if (_tenantUserContext is { IsAuthenticated: true, TenantId: { } }) - { - var tenant = new Tenant(_tenantUserContext.TenantId); - _tenantSetter.SetTenant(tenant); - return; - } - - List parsers = new(); - foreach (var tenantParserProvider in _parserProviders) - { - parsers.Add(tenantParserProvider.Name); - if (await tenantParserProvider.ResolveAsync(_serviceProvider, _tenantKey, - tenantId => _tenantSetter.SetTenant(new Tenant(tenantId)))) - { - _logger?.LogDebug("The tenant is successfully resolved, and the resolver is: {Resolvers}", string.Join("、 ", parsers)); - _handled = true; - return; - } - } - _logger?.LogDebug("Failed to resolve tenant, and the resolver is: {Resolvers}", string.Join("、 ", parsers)); - _handled = true; - } - - private List GetDefaultParserProviders() - { - return new List - { - new HttpContextItemParserProvider(), - new QueryStringParserProvider(), - new FormParserProvider(), - new RouteParserProvider(), - new HeaderParserProvider(), - new CookieParserProvider() - }; - } -} diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs deleted file mode 100644 index 6978310ff..000000000 --- a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiTenant; - -public class MultiTenantOptions -{ - public string TenantKey { get; set; } - - public List ParserProviders { get; set; } -} diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.md b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.md deleted file mode 100644 index b5c366fd9..000000000 --- a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.md +++ /dev/null @@ -1,99 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Isolation.MultiTenant - -Example: - -```C# -Install-Package Masa.Contrib.Isolation.UoW.EF -Install-Package Masa.Contrib.Isolation.MultiTenant -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. Configure `appsettings.json` -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - "IsolationConnectionStrings": [ - { - "TenantId": "00000000-0000-0000-0000-000000000002", - "ConnectionString": "server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - { - "TenantId": "00000000-0000-0000-0000-000000000003", - "ConnectionString": "server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity;" - } - ] -} -``` - -* 1.1 When the current tenant is 00000000-0000-0000-0000-000000000002: database address: server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; -* 1.2 When the current tenant is 00000000-0000-0000-0000-000000000003: database address: server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; -* 1.3 Other tenants or hosts: database address: server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; - -2. Using Isolation.UoW.EF -```` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiTenant(),// Use tenant isolation - dbOptions => dbOptions.UseSqlServer()); -}); -```` - -3. DbContext needs to inherit IsolationDbContext - -```` C# -public class CustomDbContext : IsolationDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } -} -```` - -4. The class corresponding to the isolated table needs to implement IMultiTenant - -You can also choose not to implement IMultiTenant when using physical isolation - -> The tenant id type can be specified by yourself, the default Guid type -> * For example: Implement IMultiTenant to implement IMultiTenant, UseIsolationUoW() to UseIsolationUoW() - -##### Summarize - -* How to resolve the tenant in the controller or MinimalAPI? - * The tenant provides 6 parsers by default, the execution order is: HttpContextItemParserProvider、QueryStringParserProvider、FormParserProvider、RouteParserProvider、HeaderParserProvider、CookieParserProvider (tenant parameter default: __tenant) - * HttpContextItemParserProvider: Obtain tenant information through the Items property of the requested HttpContext - * QueryStringParserProvider: Get tenant information through the requested QueryString - * https://github.com/masastack?__tenant=1 (tenant id is 1) - * FormParserProvider: Get tenant information through the Form form - * RouteParserProvider: Get tenant information through routing - * HeaderParserProvider: Get tenant information through request headers - * CookieParserProvider: Get tenant information through cookies -* If the resolver fails to resolve the tenant, what is the last database used? - * If the resolution of the tenant fails, return the DefaultConnection directly -* How to change the default tenant parameter name - -```` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiTenant("tenant"), - dbOptions => dbOptions.UseSqlServer());// Use tenant isolation -}); -```` -* The default parser is not easy to use, want to change the default parser? - -```` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiTenant("tenant", new List() - { - new QueryStringTenantParserProvider() // only use QueryStringTenantParserProvider, other parsers are removed - }), - dbOptions => dbOptions.UseSqlServer());// Use tenant isolation -}); -```` diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md deleted file mode 100644 index 65a69b8fb..000000000 --- a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md +++ /dev/null @@ -1,100 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Isolation.MultiTenant - -用例: - -```C# -Install-Package Masa.Contrib.Isolation.UoW.EF -Install-Package Masa.Contrib.Isolation.MultiTenant -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. 配置`appsettings.json` -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - "IsolationConnectionStrings": [ - { - "TenantId": "00000000-0000-0000-0000-000000000002", - "ConnectionString": "server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - { - "TenantId": "00000000-0000-0000-0000-000000000003", - "ConnectionString": "server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity;" - } - ] -} -``` - -* 1.1 当前租户为00000000-0000-0000-0000-000000000002时:数据库地址:server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; -* 1.2 当前租户为00000000-0000-0000-0000-000000000003时:数据库地址:server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; -* 1.3 其他租户或宿主:数据库地址:server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; - -2. 使用Isolation.UoW.EF -``` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiTenant(),// 使用租户隔离 - dbOptions => dbOptions.UseSqlServer()); -}); -``` - -3. DbContext需要继承IsolationDbContext - -``` C# -public class CustomDbContext : IsolationDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } -} -``` - -4. 隔离的表对应的类需要实现IMultiTenant - -采用物理隔离时也可以选择不实现IMultiTenant - -> 租户id类型支持自行指定,默认Guid类型 -> * 如:实现IMultiTenant改为实现IMultiTenant,UseIsolationUoW()改为UseIsolationUoW() - -##### 总结 - -* 控制器或MinimalAPI中租户如何解析? - * 租户默认提供了6个解析器,执行顺序分别为:HttpContextItemParserProvider、QueryStringParserProvider、FormParserProvider、RouteParserProvider、HeaderParserProvider、CookieParserProvider (租户参数默认:__tenant) - * HttpContextItemParserProvider: 通过请求的HttpContext的Items属性获取租户信息 - * QueryStringParserProvider: 通过请求的QueryString获取租户信息 - * https://github.com/masastack?__tenant=1 (租户id为1) - * FormParserProvider: 通过Form表单获取租户信息 - * RouteParserProvider: 通过路由获取租户信息 - * HeaderParserProvider: 通过请求头获取租户信息 - * CookieParserProvider: 通过Cookie获取租户信息 -* 如果解析器解析租户失败,那最后使用的数据库是? - * 若解析租户失败,则直接返回DefaultConnection -* 如何更改默认租户参数名 - -``` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiTenant("tenant"),// 使用租户隔离 - dbOptions => dbOptions.UseSqlServer()); -}); -``` -* 默认解析器不好用,希望更改默认解析器? - -``` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiTenant("tenant", new List() - { - new QueryStringTenantParserProvider() // 只使用QueryStringTenantParserProvider, 其它解析器移除掉 - }), - dbOptions => dbOptions.UseSqlServer());// 使用租户隔离 -}); -``` - diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs deleted file mode 100644 index 4a203ac3d..000000000 --- a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiTenant; - -public class TenantContext : ITenantContext, ITenantSetter -{ - public Tenant? CurrentTenant { get; private set; } - - public void SetTenant(Tenant? tenant) => CurrentTenant = tenant; -} diff --git a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/_Imports.cs b/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/_Imports.cs deleted file mode 100644 index d6e1c98f6..000000000 --- a/src/Contrib/Isolation/MultiTenant/src/Masa.Contrib.Isolation.MultiTenant/_Imports.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.BuildingBlocks.Isolation; -global using Masa.BuildingBlocks.Isolation.Middleware; -global using Masa.BuildingBlocks.Isolation.MultiTenant; -global using Masa.BuildingBlocks.Isolation.Parser; -global using Masa.Contrib.Isolation.MultiTenant.Middleware; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using System.Linq; diff --git a/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj b/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj deleted file mode 100644 index 4746a18e7..000000000 --- a/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs b/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs deleted file mode 100644 index 5e304d375..000000000 --- a/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiTenant.Tests; - -[TestClass] -public class TestMiddleware -{ - [TestMethod] - public async Task TestMultiTenantMiddlewareAsync() - { - var services = new ServiceCollection(); - Mock tenantContext = new(); - Tenant tenant = null!; - tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); - services.AddScoped(_ => tenantContext.Object); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider - => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - List parserProviders = new List - { - parserProvider.Object - }; - string tenantKey = "tenant"; - var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, parserProviders); - await middleware.HandleAsync(); - parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Once); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware2Async() - { - var services = new ServiceCollection(); - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("1")).Verifiable(); - services.AddScoped(_ => tenantContext.Object); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider - => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - List parserProviders = new List - { - parserProvider.Object - }; - string tenantKey = "tenant"; - var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, parserProviders); - await middleware.HandleAsync(); - parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware3Async() - { - var services = new ServiceCollection(); - Mock tenantContext = new(); - Tenant tenant = null!; - tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); - services.AddScoped(_ => tenantContext.Object); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; - httpContextAccessor = new HttpContextAccessor - { - HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { tenantKey, "1" } - } - } - }; - var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, null); - await middleware.HandleAsync(); - tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware4Async() - { - var services = new ServiceCollection(); - Mock isolationBuilder = new(); - isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - string tenantKey = "tenant"; - - isolationBuilder.Object.UseMultiTenant(tenantKey); - - Mock parserProvider = new(); - parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - - services.AddHttpContextAccessor(); - var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; - httpContextAccessor = new HttpContextAccessor - { - HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { tenantKey, "1" } - } - } - }; - - var middleware = services.BuildServiceProvider().GetRequiredService(); - await middleware.HandleAsync(); - tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); - - await middleware.HandleAsync(); - tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware5Async() - { - var services = new ServiceCollection(); - Mock isolationBuilder = new(); - isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - isolationBuilder.Object.UseMultiTenant(); - - Mock parserProvider = new(); - parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - - services.AddHttpContextAccessor(); - var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; - httpContextAccessor = new HttpContextAccessor - { - HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { "__tenant", "1" } - } - } - }; - - var middleware = services.BuildServiceProvider().GetRequiredService(); - await middleware.HandleAsync(); - tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); - - await middleware.HandleAsync(); - tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware6Async() - { - var services = new ServiceCollection(); - Mock isolationBuilder = new(); - isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - isolationBuilder.Object.UseMultiTenant(new List()); - - Mock parserProvider = new(); - parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - - services.AddHttpContextAccessor(); - var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; - httpContextAccessor = new HttpContextAccessor - { - HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { "__tenant", "1" } - } - } - }; - - var middleware = services.BuildServiceProvider().GetRequiredService(); - await middleware.HandleAsync(); - tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Never); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware7Async() - { - var services = new ServiceCollection(); - services.AddLogging(); - Mock tenantContext = new(); - Tenant tenant = null!; - tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); - services.AddScoped(_ => tenantContext.Object); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider - => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - List parserProviders = new List - { - parserProvider.Object - }; - string tenantKey = "tenant"; - var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, parserProviders); - await middleware.HandleAsync(); - parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Once); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware8Async() - { - var services = new ServiceCollection(); - Mock tenantContext = new(); - Tenant tenant = null!; - tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); - services.AddScoped(_ => tenantContext.Object); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; - httpContextAccessor = new HttpContextAccessor - { - HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { tenantKey, "1" } - } - } - }; - var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, null); - await middleware.HandleAsync(); - tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware9Async() - { - var services = new ServiceCollection(); - services.AddLogging(); - Mock isolationBuilder = new(); - isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - isolationBuilder.Object.UseMultiTenant(new List()); - - Mock parserProvider = new(); - parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - - services.AddHttpContextAccessor(); - var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; - httpContextAccessor = new HttpContextAccessor - { - HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { "__tenant", "1" } - } - } - }; - - var middleware = services.BuildServiceProvider().GetRequiredService(); - await middleware.HandleAsync(); - tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Never); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware10Async() - { - var services = new ServiceCollection(); - services.AddLogging(); - Mock tenantContext = new(); - Tenant tenant = null!; - tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); - services.AddScoped(_ => tenantContext.Object); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - - services.AddHttpContextAccessor(); - string tenantKey = "tenant"; - var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; - httpContextAccessor = new HttpContextAccessor - { - HttpContext = new DefaultHttpContext - { - Items = new Dictionary - { - { tenantKey, "1" } - } - } - }; - var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, null); - await middleware.HandleAsync(); - tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestMultiTenantMiddleware11Async() - { - var services = new ServiceCollection(); - services.AddLogging(); - Mock tenantContext = new(); - tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("1")).Verifiable(); - services.AddScoped(_ => tenantContext.Object); - - Mock tenantSetter = new(); - tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); - services.AddScoped(_ => tenantSetter.Object); - - Mock parserProvider = new(); - parserProvider.Setup(provider - => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); - List parserProviders = new List - { - parserProvider.Object - }; - string tenantKey = "tenant"; - var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, parserProviders); - await middleware.HandleAsync(); - parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); - } -} diff --git a/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs b/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs deleted file mode 100644 index 45b5347c1..000000000 --- a/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.MultiTenant.Tests; - -[TestClass] -public class TestEnvironment -{ - [TestMethod] - public void TestSetTenant() - { - var services = new ServiceCollection(); - Mock isolationBuilder = new(); - isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); - isolationBuilder.Object.UseMultiTenant(); - - var serviceProvider = services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetRequiredService().CurrentTenant == null); - - var tenant = new Tenant("1"); - serviceProvider.GetRequiredService().SetTenant(tenant); - Assert.IsTrue(serviceProvider.GetRequiredService().CurrentTenant == tenant); - } - - [TestMethod] - public void TestChangeType() - { - var convertProvider = new ConvertProvider(); - object result = convertProvider.ChangeType("1", typeof(int)); - Assert.IsTrue(result.Equals(1)); - - var guid = Guid.NewGuid(); - result = convertProvider.ChangeType(guid.ToString(), typeof(Guid)); - Assert.IsTrue(result.Equals(guid)); - - var str = "dev"; - result = convertProvider.ChangeType(str, typeof(string)); - Assert.IsTrue(result.Equals(str)); - - result = convertProvider.ChangeType("1.1", typeof(decimal)); - Assert.IsTrue(result.Equals((decimal)1.1)); - - result = convertProvider.ChangeType("1.2", typeof(float)); - Assert.IsTrue(result.Equals((float)1.2)); - - result = convertProvider.ChangeType("1.3", typeof(double)); - Assert.IsTrue(result.Equals(1.3d)); - - result = convertProvider.ChangeType("1", typeof(ushort)); - Assert.IsTrue(result.Equals((ushort)1)); - - bool isProduction = true; - result = convertProvider.ChangeType(isProduction.ToString(), typeof(bool)); - Assert.IsTrue(result.Equals(isProduction)); - } -} diff --git a/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs b/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs deleted file mode 100644 index 3d800e35a..000000000 --- a/src/Contrib/Isolation/MultiTenant/test/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Isolation; -global using Masa.BuildingBlocks.Isolation.Middleware; -global using Masa.BuildingBlocks.Isolation.MultiTenant; -global using Masa.Contrib.Isolation.MultiTenant.Middleware; -global using Microsoft.AspNetCore.Http; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System; diff --git a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs deleted file mode 100644 index 73bb2f01a..000000000 --- a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF; - -public static class DispatcherOptionsExtensions -{ - public static IEventBusBuilder UseIsolationUoW( - this IEventBusBuilder eventBusBuilder, - Action isolationBuilder, - Action? optionsBuilder, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - => eventBusBuilder.UseIsolationUoW(isolationBuilder, optionsBuilder, disableRollbackOnFailure, useTransaction); - - public static IEventBusBuilder UseIsolationUoW( - this IEventBusBuilder eventBusBuilder, - Action isolationBuilder, - Action? optionsBuilder, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - where TTenantId : IComparable - => eventBusBuilder.UseIsolationUoW(isolationBuilder, optionsBuilder, disableRollbackOnFailure, - useTransaction); - - public static IEventBusBuilder UseIsolationUoW( - this IEventBusBuilder eventBusBuilder, - Action isolationBuilder, - Action? optionsBuilder, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - where TTenantId : IComparable - where TUserId : IComparable - { - eventBusBuilder.Services.UseIsolationUoW(); - return eventBusBuilder.UseIsolation(isolationBuilder) - .UseUoW(optionsBuilder, disableRollbackOnFailure, useTransaction); - } - - public static IDispatcherOptions UseIsolationUoW( - this IDispatcherOptions options, - Action isolationBuilder, - Action? optionsBuilder, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - => options.UseIsolationUoW(isolationBuilder, optionsBuilder, disableRollbackOnFailure, useTransaction); - - public static IDispatcherOptions UseIsolationUoW( - this IDispatcherOptions options, - Action isolationBuilder, - Action? optionsBuilder, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - where TTenantId : IComparable - => options.UseIsolationUoW(isolationBuilder, optionsBuilder, disableRollbackOnFailure, - useTransaction); - - public static IDispatcherOptions UseIsolationUoW( - this IDispatcherOptions options, - Action isolationBuilder, - Action? optionsBuilder, - bool disableRollbackOnFailure = false, - bool useTransaction = true) - where TDbContext : MasaDbContext, IMasaDbContext - where TTenantId : IComparable - where TUserId : IComparable - { - options.Services.UseIsolationUoW(); - return options.UseIsolation(isolationBuilder) - .UseUoW(optionsBuilder, disableRollbackOnFailure, useTransaction); - } - - private static void UseIsolationUoW(this IServiceCollection services) where TTenantId : IComparable - => services.TryAddEnumerable(new ServiceDescriptor(typeof(ISaveChangesFilter), typeof(IsolationSaveChangesFilter), - ServiceLifetime.Scoped)); -} diff --git a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs deleted file mode 100644 index 6a2bbec3b..000000000 --- a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Internal; - -internal static class TypeExtensions -{ - static bool IsConcrete(this Type type) => !type.GetTypeInfo().IsAbstract && !type.GetTypeInfo().IsInterface; - - public static bool IsGenericInterfaceAssignableFrom(this Type genericType, Type type) => - type.IsConcrete() && - type.GetInterfaces().Any(t => t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == genericType); -} diff --git a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs deleted file mode 100644 index bc054d6b1..000000000 --- a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF; - -/// -/// DbContext providing isolation -/// -/// tenant id type -/// -public abstract class IsolationDbContext : IsolationDbContext - where TKey : IComparable - where TDbContext : DbContext, IMasaDbContext -{ - protected IsolationDbContext(MasaDbContextOptions options) : base(options) - { - } -} - -/// -/// DbContext providing isolation -/// -/// tenant id type -public abstract class IsolationDbContext : IsolationDbContext -{ - protected IsolationDbContext(MasaDbContextOptions options) : base(options) - { - } -} - -/// -/// DbContext providing isolation -/// -/// tenant id type -public abstract class IsolationDbContext : MasaDbContext - where TKey : IComparable -{ - private readonly IEnvironmentContext? _environmentContext; - private readonly ITenantContext? _tenantContext; - - public IsolationDbContext(MasaDbContextOptions options) : base(options) - { - _environmentContext = options.ServiceProvider?.GetService(); - _tenantContext = options.ServiceProvider?.GetService(); - } - - protected override Expression>? CreateFilterExpression() - where TEntity : class - { - Expression>? expression = null; - - if (typeof(IMultiTenant<>).IsGenericInterfaceAssignableFrom(typeof(TEntity)) && _tenantContext != null) - { - string defaultTenantId = default(TKey)?.ToString() ?? string.Empty; - Expression> tenantFilter = entity => !IsTenantFilterEnabled || - (Microsoft.EntityFrameworkCore.EF.Property(entity, nameof(IMultiTenant.TenantId)).ToString() ?? string.Empty) - .Equals(_tenantContext.CurrentTenant != null ? _tenantContext.CurrentTenant.Id : defaultTenantId); - - expression = ExpressionExtensions.And(tenantFilter, expression != null, expression); - } - - if (typeof(IMultiEnvironment).IsAssignableFrom(typeof(TEntity)) && _environmentContext != null) - { - Expression> envFilter = entity => !IsEnvironmentFilterEnabled || - Microsoft.EntityFrameworkCore.EF.Property(entity, nameof(IMultiEnvironment.Environment)) - .Equals(_environmentContext != null ? _environmentContext.CurrentEnvironment : default); - expression = ExpressionExtensions.And(envFilter, expression != null, expression); - } - - var secondExpression = base.CreateFilterExpression(); - if (secondExpression != null) - expression = ExpressionExtensions.And(secondExpression, expression != null, expression); - - return expression; - } - - protected virtual bool IsEnvironmentFilterEnabled => DataFilter?.IsEnabled() ?? false; - - protected virtual bool IsTenantFilterEnabled => DataFilter?.IsEnabled>() ?? false; -} diff --git a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs deleted file mode 100644 index 43be7b9a1..000000000 --- a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF; - -public class IsolationSaveChangesFilter : ISaveChangesFilter where TTenantId : IComparable -{ - private readonly ITenantContext? _tenantContext; - private readonly IConvertProvider? _convertProvider; - private readonly IEnvironmentContext? _environmentContext; - - public IsolationSaveChangesFilter(IServiceProvider serviceProvider) - { - _tenantContext = serviceProvider.GetService(); - _convertProvider = serviceProvider.GetService(); - _environmentContext = serviceProvider.GetService(); - } - - public void OnExecuting(ChangeTracker changeTracker) - { - changeTracker.DetectChanges(); - var entries = changeTracker.Entries().Where(entry => entry.State == EntityState.Added); - foreach (var entity in entries) - { - if (entity.Entity is IMultiTenant && _tenantContext != null) - { - if (_tenantContext.CurrentTenant != null && !string.IsNullOrEmpty(_tenantContext.CurrentTenant.Id)) - { - ArgumentNullException.ThrowIfNull(_convertProvider, nameof(_convertProvider)); - object tenantId = _convertProvider.ChangeType(_tenantContext.CurrentTenant.Id, typeof(TTenantId)); - entity.CurrentValues[nameof(IMultiTenant.TenantId)] = tenantId; - } - else - { - entity.CurrentValues[nameof(IMultiTenant.TenantId)] = default(TTenantId); - } - } - - if (entity.Entity is IMultiEnvironment && _environmentContext != null) - { - entity.CurrentValues[nameof(IMultiEnvironment.Environment)] = _environmentContext.CurrentEnvironment; - } - } - } -} diff --git a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj deleted file mode 100644 index 1a5395bf9..000000000 --- a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.md b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.md deleted file mode 100644 index 2ec875fb9..000000000 --- a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.md +++ /dev/null @@ -1,76 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Isolation.UoW.EF - -Example: - -```C# -Install-Package Masa.Contrib.Isolation.UoW.EF -Install-Package Masa.Contrib.Data.Contracts.EF -Install-Package Masa.Contrib.Isolation.MultiEnvironment // Environmental isolation Quote on demand -Install-Package Masa.Contrib.Isolation.MultiTenant // Multi-tenant isolation On-demand reference -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. Configure `appsettings.json` -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - "IsolationConnectionStrings": [ - { - "TenantId": "*",//match all tenants - "Environment": "development", - "ConnectionString": "server=localhost,1434;uid=sa;pwd=P@ssw0rd;database=identity;", - "Score": 99 //When multiple environments are matched according to the conditions, the highest one is selected as the link address of the current DbContext according to the descending order of scores. The default Score is 100. - }, - { - "TenantId": "00000000-0000-0000-0000-000000000002", - "Environment": "development", - "ConnectionString": "server=localhost,1435;uid=sa;pwd=P@ssw0rd;database=identity;" - } - ] -} -``` - -* 1.1 When the current environment is equal to development: - * When the tenant is equal to 00000000-0000-0000-0000-000000000002, the database address: server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; - * When the tenant is not equal to 00000000-0000-0000-0000-000000000002, the database address: server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; - -* 1.2 When the environment is not equal to development: - * No tenant distinction, database address: server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; - -2. 使用Isolation.UoW.EF -``` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiEnvironment().UseMultiTenant(),// Select usage environment or tenant isolation as needed - dbOptions => dbOptions.UseFilter().UseSqlServer()); -}); -``` - -3. DbContext needs to inherit IsolationDbContext - -``` C# -public class CustomDbContext : IsolationDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } -} -``` - -4. The class corresponding to the isolated table needs to implement IMultiTenant or IMultiEnvironment - -Tenant isolation implements IMultiTenant, and environment isolation implements IMultiEnvironment - -##### Summarize -* How many kinds of parser are currently supported? - * Currently two kinds of parsers are supported, one is [Environment Parser](../Masa.Contrib.Isolation.MultiEnvironment/README.md), the other is [Tenant Parser](../Masa.Contrib.Isolation.MultiTenant/README.md) -* How is the parser used? - * After publishing events through EventBus, EventBus will automatically call the parser middleware to trigger the environment and tenant parser to parse and assign values according to the isolation usage - * For scenarios where EventBus is not used, `app.UseIsolation();` needs to be added to Program.cs. After the request is initiated, it will first pass through the AspNetCore middleware provided by Isolation, and trigger the environment and tenant resolvers to parse and assign values. When the request arrives at the specified controller or Minimal method, the parsing is complete -* What does the parser do? - * Obtain the current environment and tenant information through the parser to provide data support for isolation, which needs to be called and executed before creating DbContext \ No newline at end of file diff --git a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md deleted file mode 100644 index 4eb2bc41b..000000000 --- a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md +++ /dev/null @@ -1,76 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Isolation.UoW.EF - -用例: - -```C# -Install-Package Masa.Contrib.Isolation.UoW.EF -Install-Package Masa.Contrib.Data.Contracts.EF -Install-Package Masa.Contrib.Isolation.MultiEnvironment // 环境隔离 按需引用 -Install-Package Masa.Contrib.Isolation.MultiTenant // 多租户隔离 按需引用 -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer -``` - -1. 配置`appsettings.json` -``` appsettings.json -{ - "ConnectionStrings": { - "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" - }, - "IsolationConnectionStrings": [ - { - "TenantId": "*",//匹配所有租户 - "Environment": "development", - "ConnectionString": "server=localhost,1434;uid=sa;pwd=P@ssw0rd;database=identity;", - "Score": 99 //当根据条件匹配到多个环境时,根据分值降序选择其中最高的作为当前DbContext的链接地址,Score默认为100 - }, - { - "TenantId": "00000000-0000-0000-0000-000000000002", - "Environment": "development", - "ConnectionString": "server=localhost,1435;uid=sa;pwd=P@ssw0rd;database=identity;" - } - ] -} -``` - -* 1.1 当前环境等于development时: - * 当租户等于00000000-0000-0000-0000-000000000002时,数据库地址:server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; - * 当租户不等于00000000-0000-0000-0000-000000000002时,数据库地址:server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; - -* 1.2 当环境不等于development时: - * 不区分租户,数据库地址:server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; - -2. 使用Isolation.UoW.EF -``` C# -builder.Services.AddEventBus(eventBusBuilder => -{ - eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiEnvironment().UseMultiTenant(),// 按需选择使用环境或者租户隔离 - dbOptions => dbOptions.UseFilter().UseSqlServer()); -}); -``` - -3. DbContext需要继承IsolationDbContext - -``` C# -public class CustomDbContext : IsolationDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) - { - } -} -``` - -4. 隔离的表对应的类需要实现IMultiTenant或IMultiEnvironment - -租户隔离实现IMultiTenant、环境隔离实现IMultiEnvironment - -##### 总结 -* 解析器目前支持几种? - * 目前支持两种解析器,一个是[环境解析器](../Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md)、一个是[租户解析器](../Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md) -* 解析器如何使用? - * 通过EventBus发布事件后,EventBus会自动调用解析器中间件,根据隔离性使用情况触发环境、租户解析器进行解析并赋值 - * 针对未使用EventBus的场景,需要在Program.cs中添加`app.UseIsolation();`,在请求发起后会先经过Isolation提供的AspNetCore中间件,并触发环境、租户解析器进行解析并赋值,当请求到达指定的控制器或者Minimal的方法时已经解析完成 -* 解析器的作用? - * 通过解析器获取当前的环境以及租户信息,为隔离提供数据支撑,需要在创建DbContext之前被调用执行 \ No newline at end of file diff --git a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/_Imports.cs b/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/_Imports.cs deleted file mode 100644 index 0c716833b..000000000 --- a/src/Contrib/Isolation/UoW/src/Masa.Contrib.Isolation.UoW.EF/_Imports.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Isolation; -global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.BuildingBlocks.Isolation.MultiTenant; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore.Filters; -global using Masa.Contrib.Data.UoW.EF; -global using Masa.Contrib.Isolation.UoW.EF.Internal; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.ChangeTracking; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using System.Linq.Expressions; -global using System.Reflection; diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs deleted file mode 100644 index c0e8e0624..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Tests; - -public class CustomDbContext : MasaDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) { } - - public DbSet User { get; set; } - - public DbSet Tag { get; set; } - - protected override void OnModelCreatingExecuting(ModelBuilder builder) - { - builder.Entity(ConfigureUserEntry); - } - - void ConfigureUserEntry(EntityTypeBuilder builder) - { - builder.ToTable("Users"); - - builder.HasKey(e => e.Id); - - builder.Property(e => e.Id) - .IsRequired(); - - builder.Property(e => e.Name) - .HasMaxLength(6) - .IsRequired(); - } -} - -public class User -{ - public Guid Id { get; private set; } - - public string Name { get; set; } = default!; - - public User() - { - this.Id = Guid.NewGuid(); - } -} - -public class Tag : ISoftDelete -{ - public Guid Id { get; private set; } - - public string Name { get; set; } = default!; - - public bool IsDeleted { get; protected set; } - - public Tag() - { - this.Id = Guid.NewGuid(); - } -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj deleted file mode 100644 index 8f85213e6..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - Always - - - - - - - - - - - - - diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs deleted file mode 100644 index 2a37498ed..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Tests; - -public class TestBase : IDisposable -{ - protected readonly string _connectionString = "DataSource=:memory:"; - protected readonly SqliteConnection Connection; - - protected TestBase() - { - Connection = new SqliteConnection(_connectionString); - Connection.Open(); - } - - public void Dispose() - { - Connection.Close(); - } -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs deleted file mode 100644 index 16e21e12a..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Tests; - -[TestClass] -public class TestIsolation : TestBase -{ - private IServiceCollection _services; - - [TestInitialize] - public void Initialize() - { - _services = new ServiceCollection(); - } - - [TestMethod] - public void TestUseIsolationUoW() - { - Mock eventBuilder = new(); - eventBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - Assert.ThrowsException(() => - { - eventBuilder.Object.UseIsolationUoW(_ => - { - }, dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); - }, "Tenant isolation and environment isolation use at least one"); - } - - [TestMethod] - public void TestUseIsolationUoW2() - { - Mock eventBuilder = new(); - eventBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); - Assert.ThrowsException(() => - { - eventBuilder.Object.UseIsolationUoW(null!, - dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); - }); - } - - [TestMethod] - public void TestUseIsolationUoW3() - { - Mock dispatcherOption = new(); - dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); - Assert.ThrowsException(() => - { - dispatcherOption.Object.UseIsolationUoW(_ => - { - }, dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); - }, "Tenant isolation and environment isolation use at least one"); - } - - [TestMethod] - public void TestUseIsolationUoW4() - { - Mock dispatcherOption = new(); - dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); - Assert.ThrowsException(() => - { - dispatcherOption.Object.UseIsolationUoW(null!, dbOptionBuilder => dbOptionBuilder.UseSqlite()); - }); - } - - [TestMethod] - public void TestUseIsolationUoWByUseEnvironment() - { - Mock dispatcherOption = new(); - dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); - dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiEnvironment(), - dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); - - var serviceProvider = dispatcherOption.Object.Services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService()); - Assert.IsNotNull(serviceProvider.GetService()); - } - - [TestMethod] - public void TestUseIsolationUoWByUseMultiEnvironment() - { - Mock dispatcherOption = new(); - dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); - dispatcherOption.Object.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiEnvironment().UseMultiEnvironment(), - dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); - - var serviceProvider = dispatcherOption.Object.Services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestUseIsolationUoWByUseTenant() - { - Mock dispatcherOption = new(); - dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); - dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiTenant(), - dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); - - var serviceProvider = dispatcherOption.Object.Services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService()); - Assert.IsNotNull(serviceProvider.GetService()); - } - - [TestMethod] - public void TestUseIsolationUoWByUseMultiTenant() - { - Mock dispatcherOption = new(); - dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); - dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiTenant().UseMultiTenant(), - dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); - - var serviceProvider = dispatcherOption.Object.Services.BuildServiceProvider(); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestUseIsolation() - { - var configurationRoot = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", true, true) - .Build(); - _services.AddSingleton(configurationRoot); - Mock dispatcherOption = new(); - dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); - dispatcherOption.Object.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiTenant().UseMultiEnvironment(), dbOptionBuilder => dbOptionBuilder.UseSqlite()); - var serviceProvider = _services.BuildServiceProvider(); - var customDbContext = serviceProvider.GetRequiredService(); - var unitOfWorkAccessor = serviceProvider.GetRequiredService(); - var currentDbContextOptions = unitOfWorkAccessor.CurrentDbContextOptions; - Assert.IsNotNull(currentDbContextOptions); - Assert.IsTrue(currentDbContextOptions.ConnectionString == "data source=test1"); - - var unitOfWorkManager = serviceProvider.GetRequiredService(); - var unifOfWorkNew = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew = unifOfWorkNew.ServiceProvider.GetRequiredService(); - - Assert.IsNull(unitOfWorkAccessorNew.CurrentDbContextOptions); - - Assert.IsTrue(unifOfWorkNew.ServiceProvider.GetRequiredService().CurrentTenant == null); - - Assert.IsTrue(string.IsNullOrEmpty(unifOfWorkNew.ServiceProvider.GetRequiredService().CurrentEnvironment)); - - unifOfWorkNew.ServiceProvider.GetRequiredService().SetTenant(new Tenant("00000000-0000-0000-0000-000000000002")); - Assert.IsTrue(unifOfWorkNew.ServiceProvider.GetRequiredService().CurrentTenant!.Id == - "00000000-0000-0000-0000-000000000002"); - unifOfWorkNew.ServiceProvider.GetRequiredService().SetEnvironment("dev"); - - Assert.IsTrue(unifOfWorkNew.ServiceProvider.GetRequiredService().CurrentEnvironment == "dev"); - - var dbContext = unifOfWorkNew.ServiceProvider.GetRequiredService(); - - Assert.IsTrue(GetDataBaseConnectionString(dbContext) == "data source=test1" && - unitOfWorkAccessorNew.CurrentDbContextOptions!.ConnectionString == "data source=test1"); - - var unifOfWorkNew2 = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); - unifOfWorkNew2.ServiceProvider.GetRequiredService().SetEnvironment("development"); - var dbContext2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(dbContext2) == "data source=test2" && - unitOfWorkAccessorNew2.CurrentDbContextOptions!.ConnectionString == "data source=test2"); - - var unifOfWorkNew3 = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); - unifOfWorkNew3.ServiceProvider.GetRequiredService().SetTenant(new Tenant("00000000-0000-0000-0000-000000000002")); - unifOfWorkNew3.ServiceProvider.GetRequiredService().SetEnvironment("development"); - var dbContext3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(dbContext3) == "data source=test2" && - unitOfWorkAccessorNew3.CurrentDbContextOptions!.ConnectionString == "data source=test2"); - - var unifOfWorkNew4 = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); - unifOfWorkNew4.ServiceProvider.GetRequiredService().SetTenant(new Tenant("00000000-0000-0000-0000-000000000002")); - unifOfWorkNew4.ServiceProvider.GetRequiredService().SetEnvironment("production"); - var dbContext4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(dbContext4) == "data source=test3" && - unitOfWorkAccessorNew4.CurrentDbContextOptions!.ConnectionString == "data source=test3"); - } - - [TestMethod] - public void TestUseMultiEnvironment() - { - _services.Configure(option => - { - option.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test4" - }; - option.IsolationConnectionStrings = new List - { - new() - { - ConnectionString = "data source=test5", - Environment = "dev" - }, - new() - { - ConnectionString = "data source=test6", - Environment = "pro" - } - }; - }); - Mock dispatcherOption = new(); - dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); - dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiEnvironment(), - dbOptionBuilder => dbOptionBuilder.UseSqlite()); - var serviceProvider = _services.BuildServiceProvider(); - var customDbContext = serviceProvider.GetRequiredService(); - var unitOfWorkAccessor = serviceProvider.GetRequiredService(); - var currentDbContextOptions = unitOfWorkAccessor.CurrentDbContextOptions; - Assert.IsNotNull(currentDbContextOptions); - Assert.IsTrue(currentDbContextOptions.ConnectionString == "data source=test4"); - - var unitOfWorkManager = serviceProvider.GetRequiredService(); - - var unifOfWorkNew2 = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); - unifOfWorkNew2.ServiceProvider.GetRequiredService().SetEnvironment("dev"); - var dbContext2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(dbContext2) == "data source=test5" && - unitOfWorkAccessorNew2.CurrentDbContextOptions!.ConnectionString == "data source=test5"); - - var unifOfWorkNew3 = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); - unifOfWorkNew3.ServiceProvider.GetRequiredService().SetEnvironment("pro"); - var dbContext3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(dbContext3) == "data source=test6" && - unitOfWorkAccessorNew3.CurrentDbContextOptions!.ConnectionString == "data source=test6"); - - var unifOfWorkNew4 = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); - unifOfWorkNew4.ServiceProvider.GetRequiredService().SetEnvironment("staging"); - var dbContext4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(dbContext4) == "data source=test4" && - unitOfWorkAccessorNew4.CurrentDbContextOptions!.ConnectionString == "data source=test4"); - } - - [TestMethod] - public void TestUseMultiTenant() - { - _services.Configure(option => - { - option.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = "data source=test7" - }; - option.IsolationConnectionStrings = new List - { - new() - { - ConnectionString = "data source=test8", - TenantId = "1" - }, - new() - { - ConnectionString = "data source=test9", - TenantId = "2" - } - }; - }); - Mock dispatcherOption = new(); - dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); - dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiTenant(), - dbOptionBuilder => dbOptionBuilder.UseSqlite()); - var serviceProvider = _services.BuildServiceProvider(); - var customDbContext = serviceProvider.GetRequiredService(); - var unitOfWorkAccessor = serviceProvider.GetRequiredService(); - var currentDbContextOptions = unitOfWorkAccessor.CurrentDbContextOptions; - Assert.IsNotNull(currentDbContextOptions); - Assert.IsTrue(currentDbContextOptions.ConnectionString == "data source=test7"); - - var unitOfWorkManager = serviceProvider.GetRequiredService(); - - var unifOfWorkNew2 = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); - unifOfWorkNew2.ServiceProvider.GetRequiredService().SetTenant(new Tenant("1")); - var dbContext2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(dbContext2) == "data source=test8" && - unitOfWorkAccessorNew2.CurrentDbContextOptions!.ConnectionString == "data source=test8"); - - var unifOfWorkNew3 = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); - unifOfWorkNew3.ServiceProvider.GetRequiredService().SetTenant(new Tenant("2")); - var dbContext3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(dbContext3) == "data source=test9" && - unitOfWorkAccessorNew3.CurrentDbContextOptions!.ConnectionString == "data source=test9"); - - var unifOfWorkNew4 = unitOfWorkManager.CreateDbContext(true); - var unitOfWorkAccessorNew4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); - unifOfWorkNew4.ServiceProvider.GetRequiredService().SetTenant(null!); - var dbContext4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); - Assert.IsTrue(GetDataBaseConnectionString(dbContext4) == "data source=test7" && - unitOfWorkAccessorNew4.CurrentDbContextOptions!.ConnectionString == "data source=test7"); - } - - [TestMethod] - public void TestUseMultiTenantAndAddMasaConfiguration() - { - var builder = WebApplication.CreateBuilder(); - builder.AddMasaConfiguration(); - Mock dispatcherOption = new(); - dispatcherOption.Setup(opt => opt.Services).Returns(builder.Services).Verifiable(); - dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiEnvironment(), - dbOptionBuilder => dbOptionBuilder.UseSqlite()); - var serviceProvider = builder.Services.BuildServiceProvider(); - var customDbContext = serviceProvider.GetRequiredService(); - var unitOfWorkAccessor = serviceProvider.GetRequiredService(); - var currentDbContextOptions = unitOfWorkAccessor.CurrentDbContextOptions; - Assert.IsNotNull(currentDbContextOptions); - Assert.IsTrue(currentDbContextOptions.ConnectionString == "data source=test1"); - } - - [TestMethod] - public async Task TestUseMultiTenantAndUseFilterAsync() - { - var services = new ServiceCollection(); - services.Configure(option => - { - option.ConnectionStrings = new ConnectionStrings() - { - DefaultConnection = $"data source=test_{Guid.NewGuid()}" - }; - option.IsolationConnectionStrings = new List - { - new() - { - ConnectionString = $"data source=test_{Guid.NewGuid()}", - TenantId = "1" - } - }; - }); - Mock dispatcherOption = new(); - dispatcherOption.Setup(opt => opt.Services).Returns(services).Verifiable(); - dispatcherOption.Object.UseIsolationUoW(isolationBuilder => - isolationBuilder.UseMultiTenant(), - dbOptionBuilder => dbOptionBuilder.UseSqlite().UseFilter().UseFilter()); - - var serviceProvider = services.BuildServiceProvider(); - var customDbContext = serviceProvider.GetRequiredService(); - await customDbContext.Database.EnsureCreatedAsync(); - var tag = new Tag() - { - Name = "Tom" - }; - await customDbContext.Set().AddAsync(tag); - await customDbContext.SaveChangesAsync(); - - Assert.IsTrue(await customDbContext.Set().CountAsync() == 1); - - tag = await customDbContext.Set().FirstOrDefaultAsync(t => t.Id == tag.Id); - Assert.IsNotNull(tag); - - customDbContext.Set().Remove(tag); - await customDbContext.SaveChangesAsync(); - Assert.IsTrue(await customDbContext.Set().CountAsync() == 0); - - var dataFilter = serviceProvider.GetRequiredService(); - using (dataFilter.Disable()) - { - Assert.IsTrue(await customDbContext.Set().CountAsync() == 1); - tag = await customDbContext.Set().FirstOrDefaultAsync(t => t.Id == tag.Id); - Assert.IsNotNull(tag); - } - } - - private string GetDataBaseConnectionString(CustomDbContext dbContext) => dbContext.Database.GetConnectionString()!; -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs deleted file mode 100644 index 39f2e841b..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data; -global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; -global using Masa.BuildingBlocks.Data.UoW; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.BuildingBlocks.Isolation.MultiTenant; -global using Masa.BuildingBlocks.Isolation.Options; -global using Masa.Contrib.Data.Contracts.EF; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Isolation.MultiEnvironment; -global using Masa.Contrib.Isolation.MultiTenant; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Data.Sqlite; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Metadata.Builders; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System; -global using System.IO; -global using System.Linq; diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json deleted file mode 100644 index dbbc90933..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ConnectionStrings": { - "DefaultConnection": "data source=test1" - }, - "IsolationConnectionStrings": [ - { - "TenantId": "*", - "Environment": "development", - "ConnectionString": "data source=test2", - "Score": 99 - }, - { - "TenantId": "00000000-0000-0000-0000-000000000002", - "Environment": "production", - "ConnectionString": "data source=test3" - } - ] -} \ No newline at end of file diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs deleted file mode 100644 index 645ea5c6a..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests; - -public class CustomDbContext : IsolationDbContext -{ - public CustomDbContext(MasaDbContextOptions options) : base(options) { } - - public DbSet User { get; set; } - - public DbSet Role { get; set; } - - protected override void OnModelCreatingExecuting(ModelBuilder builder) - { - builder.Entity(ConfigureUserEntry); - builder.Entity(ConfigureRoleEntry); - } - - void ConfigureUserEntry(EntityTypeBuilder builder) - { - builder.ToTable("Users"); - - builder.HasKey(user => user.Id); - - builder.Property(user => user.Id) - .IsRequired(); - - builder.Property(user => user.Account) - .HasMaxLength(20) - .IsRequired(); - - builder.Property(user => user.Account) - .HasMaxLength(50) - .IsRequired(); - } - - void ConfigureRoleEntry(EntityTypeBuilder builder) - { - builder.ToTable("Roles"); - - builder.HasKey(role => role.Id); - - builder.Property(e => e.Id) - .IsRequired(); - - builder.Property(e => e.Name) - .HasMaxLength(20) - .IsRequired(); - - builder.Property(e => e.Quantity) - .IsRequired(); - } -} - -public class User : IIsolation -{ - public Guid Id { get; private set; } - - public string Account { get; set; } = default!; - - public string Password { get; set; } = default!; - - public int TenantId { get; set; } - - public string Environment { get; set; } - - public User() - { - this.Id = Guid.NewGuid(); - } -} - -public class Role : IIsolation, ISoftDelete -{ - public Guid Id { get; private set; } - - public string Name { get; set; } - - public int Quantity { get; set; } - - public bool IsDeleted { get; set; } - - public int TenantId { get; set; } - - public string Environment { get; set; } - - public Role() - { - this.Id = Guid.NewGuid(); - } -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs deleted file mode 100644 index 1e4407e15..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests; - -[TestClass] -public class EdgeDriverTest -{ - private IServiceCollection _services; - - [TestInitialize] - public void Initialize() - { - var configurationRoot = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", true, true) - .Build(); - _services = new ServiceCollection(); - _services.AddSingleton(configurationRoot); - _services.AddEventBus(eventBusBuilder => eventBusBuilder.UseIsolationUoW( - isolationBuilder => isolationBuilder.UseMultiTenant("tenant").UseMultiEnvironment("env"), dbOptions => dbOptions.UseFilter().UseSqlite())); - System.Environment.SetEnvironmentVariable("env", "pro"); - } - - [TestMethod] - public async Task TestTenantAsync() - { - var serviceProvider = _services.BuildServiceProvider(); - - #region Manually assign values to tenants and environments, and in real scenarios, automatically parse and assign values based on the current HttpContext - - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext(); - httpContextAccessor.HttpContext.Items = new Dictionary - { - { "tenant", "2" } - }; - - #endregion - - var registerUserEvent = new RegisterUserEvent("jim", "123456"); - var eventBus = serviceProvider.GetRequiredService(); - await eventBus.PublishAsync(registerUserEvent); - } - - [TestMethod] - public async Task TestTenant2Async() - { - var serviceProvider = _services.BuildServiceProvider(); - - #region Manually assign values to tenants and environments, and in real scenarios, automatically parse and assign values based on the current HttpContext - - var httpContextAccessor = serviceProvider.GetRequiredService(); - httpContextAccessor.HttpContext = new DefaultHttpContext(); - httpContextAccessor.HttpContext.Items = new Dictionary - { - { "tenant", "1" } - }; - - #endregion - - var addRoleEvent = new AddRoleEvent("Admin", 1); - var eventBus = serviceProvider.GetRequiredService(); - await eventBus.PublishAsync(addRoleEvent); - } -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs deleted file mode 100644 index 9f3922a82..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.EventHandlers; - -public class AddRoleEventHandler -{ - private readonly CustomDbContext _customDbContext; - private readonly IDataFilter _dataFilter; - private readonly IEnvironmentSetter _environmentSetter; - private readonly IEnvironmentContext _environmentContext; - - public AddRoleEventHandler(CustomDbContext customDbContext, IDataFilter dataFilter, IEnvironmentSetter environmentSetter, - IEnvironmentContext environmentContext) - { - _customDbContext = customDbContext; - _dataFilter = dataFilter; - _environmentSetter = environmentSetter; - _environmentContext = environmentContext; - } - - [EventHandler] - public async Task AddRoleAsync(AddRoleEvent @event) - { - await _customDbContext.Database.EnsureCreatedAsync(); - Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test1"); - var role = new Role - { - Name = @event.Name, - Quantity = @event.Quantity - }; - await _customDbContext.Set().AddAsync(role); - await _customDbContext.SaveChangesAsync(); - - var role2 = await _customDbContext.Set().FirstOrDefaultAsync(); - Assert.IsTrue(role2!.Name == @event.Name); - Assert.IsTrue(role2.IsDeleted == false); - - _environmentSetter.SetEnvironment("dev"); //In EventHandler, physical isolation is not retriggered if a new DbContext is not recreated, it can only be used to filter changes - Assert.IsTrue(_environmentContext.CurrentEnvironment == "dev"); - Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test1"); - - var role3 = await _customDbContext.Set().FirstOrDefaultAsync(); - Assert.IsNull(role3); - - using (_dataFilter.Disable()) - { - Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test1"); - var role4 = await _customDbContext.Set().FirstOrDefaultAsync(); - Assert.IsNotNull(role4); - } - } -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs deleted file mode 100644 index d8ecd5d51..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.EventHandlers; - -public class RegisterUserEventHandler -{ - private readonly CustomDbContext _customDbContext; - private readonly IDataFilter _dataFilter; - private readonly IEnvironmentSetter _environmentSetter; - private readonly IEnvironmentContext _environmentContext; - - public RegisterUserEventHandler(CustomDbContext customDbContext, IDataFilter dataFilter, IEnvironmentSetter environmentSetter, - IEnvironmentContext environmentContext) - { - _customDbContext = customDbContext; - _dataFilter = dataFilter; - _environmentSetter = environmentSetter; - _environmentContext = environmentContext; - } - - [EventHandler] - public async Task RegisterUserAsync(RegisterUserEvent @event) - { - await _customDbContext.Database.EnsureCreatedAsync(); - Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test3"); - var user = new User - { - Account = @event.Account, - Password = MD5Utils.Encrypt(@event.Password, @event.Password) - }; - await _customDbContext.Set().AddAsync(user); - await _customDbContext.SaveChangesAsync(); - - var user2 = await _customDbContext.Set().FirstOrDefaultAsync(); - Assert.IsTrue(user2!.Account == @event.Account); - Assert.IsTrue(user2.Environment == "pro"); - Assert.IsTrue(user2.TenantId == 2); - - _environmentSetter.SetEnvironment("dev"); //In EventHandler, physical isolation is not retriggered if a new DbContext is not recreated, it can only be used to filter changes - Assert.IsTrue(_environmentContext.CurrentEnvironment == "dev"); - Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test3"); - - var user3 = await _customDbContext.Set().FirstOrDefaultAsync(); - Assert.IsNull(user3); - - using (_dataFilter.Disable()) - { - Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test3"); - var user4 = await _customDbContext.Set().FirstOrDefaultAsync(); - Assert.IsNotNull(user4); - } - } -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs deleted file mode 100644 index c52982224..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.Events; - -public record AddRoleEvent(string Name,int Quantity) : Event -{ -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs deleted file mode 100644 index 5e8aca201..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.Events; - -public record RegisterUserEvent(string Account,string Password) : Event -{ -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj deleted file mode 100644 index 609447000..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - - - - - - - - - Always - - - - - - - - - - - - - - - diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs deleted file mode 100644 index 8e2d90ed5..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests; - -public class TestBase : IDisposable -{ - protected readonly string _connectionString = "DataSource=:memory:"; - protected readonly SqliteConnection Connection; - - protected TestBase() - { - Connection = new SqliteConnection(_connectionString); - Connection.Open(); - } - - public void Dispose() - { - Connection.Close(); - } -} diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs deleted file mode 100644 index 1b483b585..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.Isolation; -global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.Contrib.Data.Contracts.EF; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Dispatcher.Events; -global using Masa.Contrib.Isolation.MultiEnvironment; -global using Masa.Contrib.Isolation.MultiTenant; -global using Masa.Contrib.Isolation.UoW.EF.Web.Tests.Events; -global using Masa.Utils.Security.Cryptography; -global using Microsoft.AspNetCore.Http; -global using Microsoft.Data.Sqlite; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Metadata.Builders; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System; -global using System.Collections.Generic; -global using System.IO; -global using System.Threading.Tasks; diff --git a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json b/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json deleted file mode 100644 index 478264b26..000000000 --- a/src/Contrib/Isolation/UoW/test/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "ConnectionStrings": { - "DefaultConnection": "data source=test1" - }, - "IsolationConnectionStrings": [ - { - "TenantId": "1", - "Environment": "dev", - "ConnectionString": "data source=test2", - "Score": 99 - }, - { - "TenantId": "2", - "Environment": "pro", - "ConnectionString": "data source=test3" - } - ] -} \ No newline at end of file diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs deleted file mode 100644 index 46acfac6d..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Commands; - -public abstract class CommandHandler : ICommandHandler, ISagaEventHandler - where TCommand : ICommand -{ - public abstract Task HandleAsync(TCommand @event); - - public virtual Task CancelAsync(TCommand @event) - { - return Task.CompletedTask; - } -} diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj deleted file mode 100644 index 939c33053..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs deleted file mode 100644 index df6cd1861..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Queries; - -public abstract class QueryHandler : IQueryHandler - where TQuery : IQuery - where TResult : notnull -{ - public abstract Task HandleAsync(TQuery @event); -} diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md deleted file mode 100644 index 0fd550e09..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md +++ /dev/null @@ -1,86 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Cqrs - -Example: - -1. Define Command and Query base classes -2. Support the Handler of Saga mode, and provide the basic implementation of CommandHandler - - ```C# - Install-Package Masa.Contrib.ReadWriteSpliting.Cqrs - ``` - -##### Query: - -1. Define Query - - ```C# - public class CatalogItemQuery : Query> - { - public string Name { get; set; } = default!; - - public override List Result { get; set; } = default!; - } - ``` - -2. Define QueryHandler - - ```C# - public class CatalogQueryHandler : QueryHandler> - { - private readonly ICatalogItemRepository _catalogItemRepository; - - public CatalogQueryHandler(ICatalogItemRepository catalogItemRepository) => _catalogItemRepository = catalogItemRepository; - - public async Task HandleAsync(CatalogItemQuery query) - { - query.Result = await _catalogItemRepository.GetListAsync(query.Name); - } - } - ``` - -3. Send Query - - ```c# - IEventBus eventBus;//Get IEventBus through DI - await eventBus.PublishAsync(new CatalogItemQuery() { Name = "Rolex" }); - ``` - - > Tip: The generic type after Query is consistent with the return type of Result. You need to assign a value to Result in Handler so that the caller can get the result. - -##### Command - -1. Define Command - - ```c# - public class CreateCatalogItemCommand : Command - { - public string Name { get; set; } = default!; - - //todo - } - ``` - -2. Add CommandHandler - - ```c# - public class CatalogCommandHandler : CommandHandler - { - private readonly ICatalogItemRepository _catalogItemRepository; - - public CatalogCommandHandler(ICatalogItemRepository catalogItemRepository) => _catalogItemRepository = catalogItemRepository; - - public async Task HandleAsync(CreateCatalogItemCommand command) - { - //todo - } - } - ``` - -3. Send Command - - ```C# - IEventBus eventBus;//Get IEventBus through DI - await eventBus.PublishAsync(new CreateCatalogItemCommand()); - ``` \ No newline at end of file diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md deleted file mode 100644 index 0cf2b9384..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md +++ /dev/null @@ -1,87 +0,0 @@ -中 | [EN](README.md) - -## Cqrs - -用例: - -1. 定义了Command与Query基类 -2. 支持Saga模式的Handler,并提供CommandHandler基础实现 - - ```C# - Install-Package Masa.Contrib.ReadWriteSpliting.Cqrs - ``` - -##### Query: - -1. 定义Query - - ```C# - public class CatalogItemQuery : Query> - { - public string Name { get; set; } = default!; - - public override List Result { get; set; } = default!; - } - ``` - -2. 定义QueryHandler - - ```C# - public class CatalogQueryHandler : QueryHandler> - { - private readonly ICatalogItemRepository _catalogItemRepository; - - public CatalogQueryHandler(ICatalogItemRepository catalogItemRepository) - => _catalogItemRepository = catalogItemRepository; - - public async Task HandleAsync(CatalogItemQuery query) - { - query.Result = await _catalogItemRepository.GetListAsync(query.Name); - } - } - ``` - -3. 发送Query - - ```c# - IEventBus eventBus;//通过DI得到IEventBus - await eventBus.PublishAsync(new CatalogItemQuery() { Name = "Rolex" }); - ``` - - > 提示:Query后的泛型与Result的返回类型保持一致,需要再Handler中为Result赋值,以便调用方得到结果 - -##### Command - -1. 定义 Command - - ```c# - public class CreateCatalogItemCommand : Command - { - public string Name { get; set; } = default!; - - //todo - } - ``` - -2. 添加 CommandHandler - - ```c# - public class CatalogCommandHandler : CommandHandler - { - private readonly ICatalogItemRepository _catalogItemRepository; - - public CatalogCommandHandler(ICatalogItemRepository catalogItemRepository) => _catalogItemRepository = catalogItemRepository; - - public async Task HandleAsync(CreateCatalogItemCommand command) - { - //todo - } - } - ``` - -3. 发送 Command - - ```C# - IEventBus eventBus;//通过DI得到IEventBus - await eventBus.PublishAsync(new CreateCatalogItemCommand()); - ``` diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs b/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs deleted file mode 100644 index 9690a40df..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/src/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; -global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs deleted file mode 100644 index 15c7908f5..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; - -namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Commands; - -public record CreateProductionCommand : Command -{ - public string Name { get; set; } - - public int Count { get; set; } -} diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs deleted file mode 100644 index cf3bb5c12..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests; - -[TestClass] -public class CQRSTest -{ - private IServiceCollection _services; - private IServiceProvider _serviceProvider; - private IEventBus _eventBus; - - [TestInitialize] - public void Initialize() - { - _services = new ServiceCollection(); - _services.AddEventBus(); - _serviceProvider = _services.BuildServiceProvider(); - _eventBus = _serviceProvider.GetRequiredService(); - } - - - [DataTestMethod] - [DataRow("")] - [DataRow("tom")] - public void TestCommand(string name) - { - var command = new CreateProductionCommand() - { - Name = name, - Count = 0 - }; - _eventBus.PublishAsync(command); - if (string.IsNullOrEmpty(name)) - { - Assert.IsTrue(command.Count == 2); - } - else - { - Assert.IsTrue(command.Count == 1); - } - } - - [TestMethod] - public void TestQuery() - { - var query = new ProductionItemQuery() - { - ProductionId = "1" - }; - _eventBus.PublishAsync(query); - Assert.IsTrue(query.Result == "Apple"); - } -} diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs deleted file mode 100644 index 675fc7ba2..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests; - -public class CreateProductionCommandHandler : CommandHandler -{ - [EventHandler(1, Dispatcher.Events.Enums.FailureLevels.ThrowAndCancel, false)] - public override Task HandleAsync(CreateProductionCommand @event) - { - @event.Count++; - if (string.IsNullOrEmpty(@event.Name)) - throw new ArgumentNullException(nameof(@event)); - - if (@event.GetEventId() == default(Guid) || @event.GetCreationTime() > DateTime.UtcNow) - throw new ArgumentNullException(nameof(@event)); - - return Task.CompletedTask; - } - - [EventHandler(1)] - public override Task CancelAsync(CreateProductionCommand @event) - { - @event.Count++; - return base.CancelAsync(@event); - } -} diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj deleted file mode 100644 index a6a6331df..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs deleted file mode 100644 index f863a4769..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests; - -public class ProductionQueryHandler : QueryHandler -{ - public override Task HandleAsync(ProductionItemQuery @event) - { - if (string.IsNullOrEmpty(@event.ProductionId)) - throw new ArgumentNullException(nameof(@event)); - - if (@event.GetEventId() == default(Guid) || @event.GetCreationTime() > DateTime.UtcNow) - throw new ArgumentNullException(nameof(@event)); - - if (@event.ProductionId == "1") - @event.Result = "Apple"; - - return Task.CompletedTask; - } -} diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs deleted file mode 100644 index 491ddb173..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; - -namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Queries; - -public record ProductionItemQuery : Query -{ - public override string Result { get; set; } - - public string ProductionId { get; set; } -} diff --git a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs b/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs deleted file mode 100644 index 0ec013682..000000000 --- a/src/Contrib/ReadWriteSpliting/Cqrs/test/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.Events; -global using Masa.Contrib.ReadWriteSpliting.Cqrs.Commands; -global using Masa.Contrib.ReadWriteSpliting.Cqrs.Queries; -global using Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Commands; -global using Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Queries; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs deleted file mode 100644 index 4b5e5f1d9..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.SearchEngine.AutoComplete; - -public class AutoCompleteClient : BaseAutoCompleteClient -{ - private readonly IElasticClient _elasticClient; - private readonly IMasaElasticClient _client; - private readonly string _indexName; - private readonly Operator _defaultOperator; - private readonly SearchType _defaultSearchType; - private readonly bool _enableMultipleCondition; - - public AutoCompleteClient( - IElasticClient elasticClient, - IMasaElasticClient client, - string indexName, - Operator defaultOperator, - SearchType defaultSearchType, - bool enableMultipleCondition) - { - _elasticClient = elasticClient; - _client = client; - _indexName = indexName; - _defaultOperator = defaultOperator; - _defaultSearchType = defaultSearchType; - _enableMultipleCondition = enableMultipleCondition; - } - - public override async Task> GetBySpecifyDocumentAsync( - string keyword, - AutoCompleteOptions? options = null, - CancellationToken cancellationToken = default) - { - var newOptions = options ?? new(_defaultSearchType); - var searchType = newOptions.SearchType ?? _defaultSearchType; - - keyword = keyword.Trim(); - - if (string.IsNullOrEmpty(keyword)) - return new Masa.BuildingBlocks.SearchEngine.AutoComplete.Response.GetResponse(true, string.Empty, new List()); - - if (searchType == SearchType.Fuzzy) - { - var ret = await _client.GetPaginatedListAsync( - new PaginatedOptions( - _indexName, - GetFuzzyKeyword(keyword), - newOptions.Field, - newOptions.Page, - newOptions.PageSize, - _defaultOperator) - , cancellationToken); - return new Masa.BuildingBlocks.SearchEngine.AutoComplete.Response.GetResponse(ret.IsValid, ret.Message) - { - Total = ret.Total, - TotalPages = ret.TotalPages, - Data = ret.Data - }; - } - else - { - var ret = await _elasticClient.SearchAsync(s => s - .Index(_indexName) - .From((newOptions.Page - 1) * newOptions.PageSize) - .Size(newOptions.PageSize) - .Query(q => GetQueryDescriptor(q, newOptions.Field, keyword.ToLower())) - , cancellationToken - ); - return new Masa.BuildingBlocks.SearchEngine.AutoComplete.Response.GetResponse(ret.IsValid, - ret.ServerError?.ToString() ?? "") - { - Data = ret.Hits.Select(hit => hit.Source).ToList(), - Total = ret.Total, - TotalPages = (int)Math.Ceiling(ret.Total / (decimal)newOptions.PageSize) - }; - } - } - - private string GetFuzzyKeyword(string keyword) - { - if (_enableMultipleCondition) - return string.Join(' ', keyword.Split(' ').Select(CompleteKeyword)); - - if (!keyword.Contains(" ")) - return CompleteKeyword(keyword); - - return $"\"{keyword}\""; //Content contains spaces and is treated as a phrase for search - } - - private string CompleteKeyword(string keyword) - { - if (keyword.Equals("*")) - return keyword; - - keyword = keyword.Trim('*'); - return $"({keyword} OR *{keyword} OR {keyword}*)"; - } - - private QueryContainer GetQueryDescriptor(QueryContainerDescriptor queryContainerDescriptor, string field, string keyword) - where T : class - { - var queryContainer = _defaultOperator == Operator.And ? - queryContainerDescriptor.Bool(boolQueryDescriptor => GetBoolQueryDescriptor(boolQueryDescriptor, field, keyword)) : - queryContainerDescriptor.Terms(descriptor - => descriptor.Field(field).Terms(_enableMultipleCondition ? keyword.Split(' ') : new[] { keyword })); - return queryContainer; - } - - private BoolQueryDescriptor GetBoolQueryDescriptor(BoolQueryDescriptor boolQueryDescriptor, string field, string keyword) - where T : class - { - if (!_enableMultipleCondition) - return boolQueryDescriptor.Must(queryContainerDescriptor => queryContainerDescriptor.Term(field, keyword)); - - foreach (var item in keyword.Split(' ')) - { - boolQueryDescriptor = boolQueryDescriptor.Must(queryContainerDescriptor => queryContainerDescriptor.Term(field, item)); - } - return boolQueryDescriptor; - } - - - public override Task SetBySpecifyDocumentAsync(IEnumerable documents, - SetOptions? options = null, - CancellationToken cancellationToken = default) - { - SetOptions newOptions = options ?? new(); - if (newOptions.IsOverride) - return SetMultiAsync(documents, cancellationToken); - - return SetByNotOverrideAsync(documents, cancellationToken); - } - - /// - /// Set documents in batches - /// add them if they don’t exist, update them if they exist - /// - /// - /// - /// - /// - private async Task SetMultiAsync( - IEnumerable documents, - CancellationToken cancellationToken = default) - where TDocument : AutoCompleteDocument - { - var request = new SetDocumentRequest(_indexName); - foreach (var document in documents) - request.AddDocument(document, document.GetDocumentId()); - - var ret = await _client.SetDocumentAsync(request, cancellationToken); - return new SetResponse(ret.IsValid, ret.Message) - { - Items = ret.Items.Select(item => new SetResponseItems(item.Id, item.IsValid, item.Message)).ToList() - }; - } - - /// - /// Set documents in batches - /// Update if it does not exist, skip if it exists - /// - /// - /// - /// - /// - private async Task SetByNotOverrideAsync( - IEnumerable documents, - CancellationToken cancellationToken = default) - where TDocument : AutoCompleteDocument - { - var request = new CreateMultiDocumentRequest(_indexName); - foreach (var document in documents) - request.AddDocument(document, document.GetDocumentId()); - - var ret = await _client.CreateMultiDocumentAsync(request, cancellationToken); - return new SetResponse(ret.IsValid, ret.Message) - { - Items = ret.Items.Select(item => new SetResponseItems(item.Id, item.IsValid, item.Message)).ToList() - }; - } - - public override async Task DeleteAsync(string id, CancellationToken cancellationToken = default) - { - var response = await _client.DeleteDocumentAsync(new DeleteDocumentRequest(_indexName, id), cancellationToken); - return new DeleteResponse(response.IsValid, response.Message); - } - - public override async Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) - { - var response = await _client.DeleteMultiDocumentAsync(new DeleteMultiDocumentRequest(_indexName, ids.ToArray()), cancellationToken); - return new DeleteMultiResponse(response.IsValid, response.Message, - response.Data.Select(item => new DeleteRangeResponseItems(item.Id, item.IsValid, item.Message))); - } -} diff --git a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs deleted file mode 100644 index 66e5e685a..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.SearchEngine.AutoComplete; - -public class AutoCompleteFactory : IAutoCompleteFactory -{ - private readonly List _relations; - - public AutoCompleteFactory(AutoCompleteRelationsOptions options) => _relations = options.Relations; - - public IAutoCompleteClient CreateClient() - { - var item = _relations.SingleOrDefault(r => r.IsDefault) ?? _relations.FirstOrDefault(); - ArgumentNullException.ThrowIfNull(item, "You should use AddAutoComplete before the project starts"); - return new AutoCompleteClient( - item.ElasticClient, - item.MasaElasticClient, - item.RealIndexName, - item.DefaultOperator, - item.DefaultSearchType, - item.EnableMultipleCondition); - } - - /// - /// Create a client corresponding to the index - /// - /// indexName or alias - /// - public IAutoCompleteClient CreateClient(string name) - { - var item = _relations.FirstOrDefault(relation => relation.IndexName == name || relation.Alias == name); - ArgumentNullException.ThrowIfNull(item, nameof(name)); - return new AutoCompleteClient( - item.ElasticClient, - item.MasaElasticClient, - item.RealIndexName, - item.DefaultOperator, - item.DefaultSearchType, - item.EnableMultipleCondition); - } -} diff --git a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj deleted file mode 100644 index fe01e276d..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - Masa.Contrib.SearchEngine.AutoComplete - - - - - - - - - - - - diff --git a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs deleted file mode 100644 index 0871382e5..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.SearchEngine.AutoComplete.Options; - -public class AutoCompleteOptions - where TDocument : AutoCompleteDocument -{ - internal string IndexName { get; private set; } - - internal string? Alias { get; private set; } - - internal bool IsDefault { get; private set; } - - internal SearchType DefaultSearchType { get; private set; } = SearchType.Fuzzy; - - internal Operator DefaultOperator { get; private set; } = Operator.Or; - - internal bool EnableMultipleCondition { get; private set; } = true; - - internal Action>? Action { get; private set; } - - internal Action? IndexSettingAction { get; private set; } - - public AutoCompleteOptions UseIndexName(string indexName) - { - IndexName = indexName; - return this; - } - - /// - /// Set index alias - /// - /// When it is null, no alias is set - /// - public AutoCompleteOptions UseAlias(string alias) - { - Alias = alias; - return this; - } - - /// - /// Set the default AutoComplete - /// - /// - public AutoCompleteOptions UseDefault() - { - IsDefault = true; - return this; - } - - public AutoCompleteOptions UseDefaultSearchType(SearchType defaultSearchType) - { - DefaultSearchType = defaultSearchType; - return this; - } - - /// - /// custom mapping - /// - /// - /// - public AutoCompleteOptions Mapping(Action> action) - { - Action = action; - return this; - } - - public AutoCompleteOptions IndexSettings(Action indexSettingAction) - { - IndexSettingAction = indexSettingAction; - return this; - } - - public AutoCompleteOptions UseDefaultOperator(Operator defaultOperator) - { - DefaultOperator = defaultOperator; - return this; - } - - public AutoCompleteOptions UseMultipleConditions(bool enableMultipleCondition = true) - { - EnableMultipleCondition = enableMultipleCondition; - return this; - } -} diff --git a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs deleted file mode 100644 index d7cef1d31..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.SearchEngine.AutoComplete.Options; - -public class AutoCompleteRelationsOptions -{ - internal List Relations = new(); - - public AutoCompleteRelationsOptions AddRelation(AutoCompleteRelations options) - { - Relations.Add(options); - return this; - } -} - -public class AutoCompleteRelations -{ - internal bool IsDefault { get; } - - internal string IndexName { get; } - - internal string? Alias { get; } - - internal string RealIndexName { get; } - - internal Operator DefaultOperator { get; } - - internal bool EnableMultipleCondition { get; } - - internal IElasticClient ElasticClient { get; } - - internal IMasaElasticClient MasaElasticClient { get; } - - internal SearchType DefaultSearchType { get; } - - internal AutoCompleteRelations( - IElasticClient elasticClient, - IMasaElasticClient masaElasticClient, - string indexName, - string? alias, - bool isDefault, - Operator defaultOperator, - SearchType defaultSearchType, - bool enableMultipleCondition) - { - ElasticClient = elasticClient; - MasaElasticClient = masaElasticClient; - IndexName = indexName; - Alias = alias; - RealIndexName = alias ?? indexName; - IsDefault = isDefault; - DefaultOperator = defaultOperator; - DefaultSearchType = defaultSearchType; - EnableMultipleCondition = enableMultipleCondition; - } -} diff --git a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md deleted file mode 100644 index 19a8fc36c..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md +++ /dev/null @@ -1,186 +0,0 @@ -[中](README.zh-CN.md) | EN - -## AutoComplete.ElasticSearch - -Example: - -``` c# -Install-Package Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch -``` - -Basic usage: - -Using AutoComplete - -* Use the default model `AutoCompleteDocument`, where TValue does not support classes - -``` C# -string userIndexName = "user_index_01"; -string userAlias = "user_index"; -builder.Services - .AddElasticsearchClient("es", option => option.UseNodes("http://localhost:9200").UseDefault()) - .AddAutoComplete(option => option.UseIndexName(userIndexName).UseAlias(userAlias)); -``` - -* Use a custom model, eg: `UserDocument` - -``` C# -string userIndexName = "user_index_01"; -string userAlias = "user_index"; -builder.Services - .AddElasticsearchClient("es", option => option.UseNodes("http://localhost:9200").UseDefault()) - .AddAutoCompleteBySpecifyDocument(option => option.UseIndexName(userIndexName).UseAlias(userAlias)); - -public class User : AutoCompleteDocument -{ - public int Id { get; set; } - - public string Name { get; set; } - - public string Phone { get; set; } - - protected override string GetText() - { - return $"{Name}:{Phone}"; - } - - /// - /// If you want the id to be unique - /// - /// - public override string GetDocumentId() => Id.ToString(); -} -``` - -##### Setting data (SetAsync) - -1. Set up a single document: - -1.1. Using the default model (key-value model): - - ``` C# - public async Task SetAsync([FromServices] IAutoCompleteClient client) - { - await client.SetAsync(new AutoCompleteDocument("Edward Adam Davis", 1)); - } - ``` - -1.2 Using a custom model - - ``` C# - public async Task SetAsync([FromServices] IAutoCompleteClient client) - { - await client.SetBySpecifyDocumentAsync(new User - { - Id = 1, - Name = "Tony", - Phone = "13999999999" - }); - } - ``` - -2. Set up multiple documents: - -2.1 Use the default model (key-value model): - - ``` C# - public async Task SetAsync([FromServices] IAutoCompleteClient client) - { - await client.SetAsync(new AutoCompleteDocument[] - { - new("Edward Adam Davis", 1), - new("Edward Jim", 1) - }); - } - ``` - -2.2 Using a custom model - - ``` C# - public async Task SetAsync([FromServices] IAutoCompleteClient client) - { - await client.SetBySpecifyDocumentAsync(new User[] - { - new() - { - Id = 1, - Name = "Jim", - Phone = "13999999999" - }, - new() - { - Id = 2, - Name = "Tony", - Phone = "13888888888" - } - }); - } - ``` - -##### Get data (GetAsync) - -1. Search by keyword: - -1.1 Use the default model (key-value model): - - ``` C# - public async Task GetAsync([FromServices] IAutoCompleteClient client) - { - var response = await client.GetAsync("Edward Adam Davis"); - return System.Text.Json.JsonSerializer.Serialize(response); - } - ``` - -1.2 Using a custom model - - ``` - public async Task GetAsync([FromServices] IAutoCompleteClient client) - { - var response = await client.GetBySpecifyDocumentAsync("Tony"); - return System.Text.Json.JsonSerializer.Serialize(response); - } - ``` - -##### Delete document (DeleteAsync) - -1. To delete a single document: - - ```` C# - public async Task DeleteAsync([FromServices] IAutoCompleteClient client) - { - var response = await client.DeleteAsync(1); - return System.Text.Json.JsonSerializer.Serialize(response); - } - ```` - -2. To delete multiple documents: - - ```` C# - public async Task DeleteAsync([FromServices] IAutoCompleteClient client) - { - var response = await client.DeleteAsync(new long[] { 1, 2 }); - return System.Text.Json.JsonSerializer.Serialize(response); - } - ```` - -Plugins that need to be added by default: - -> https://github.com/medcl/elasticsearch-analysis-ik -> -> https://github.com/medcl/elasticsearch-analysis-pinyin - -## FAQ - -1. The error message is: `"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` - - We enable the compatibility mode by default, namely `EnableApiVersioningHeader(true)`, which supports the 8.* version very well, but will cause errors in some 7.*, in this case, you need to manually turn off the compatibility mode, that is, `EnableApiVersioningHeader(false)`. - - ```` C# - service.AddElasticsearchClient("es", option => - { - option.UseNodes("http://localhost:9200") - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); - }); - ```` - -[Why turn on compatibility mode? ](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md deleted file mode 100644 index 0e05d2e20..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md +++ /dev/null @@ -1,186 +0,0 @@ -中 | [EN](README.md) - -## AutoComplete.ElasticSearch - -用例: - -```c# -Install-Package Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch -``` - -基本用法: - -使用AutoComplete - -* 使用默认模型`AutoCompleteDocument`,其中TValue仅支持简单类型 - -``` C# -string userIndexName = "user_index_01"; -string userAlias = "user_index"; -builder.Services - .AddElasticsearchClient("es", option => option.UseNodes("http://localhost:9200").UseDefault()) - .AddAutoComplete(option => option.UseIndexName(userIndexName).UseAlias(userAlias)); -``` - -* 使用自定义模型,例如: `UserDocument` - -``` C# -string userIndexName = "user_index_01"; -string userAlias = "user_index"; -builder.Services - .AddElasticsearchClient("es", option => option.UseNodes("http://localhost:9200").UseDefault()) - .AddAutoCompleteBySpecifyDocument(option => option.UseIndexName(userIndexName).UseAlias(userAlias)); - -public class User : AutoCompleteDocument -{ - public int Id { get; set; } - - public string Name { get; set; } - - public string Phone { get; set; } - - protected override string GetText() - { - return $"{Name}:{Phone}"; - } - - /// - /// 如果希望id是唯一标识 - /// - /// - public override string GetDocumentId() => Id.ToString(); -} -``` - -##### 设置数据 (SetAsync) - -1. 设置单个文档: - -1.1. 使用默认模型(键值模型): - - ``` C# - public async Task SetAsync([FromServices] IAutoCompleteClient client) - { - await client.SetAsync(new AutoCompleteDocument("Edward Adam Davis", 1)); - } - ``` - -1.2 使用自定义模型 - - ``` C# - public async Task SetAsync([FromServices] IAutoCompleteClient client) - { - await client.SetBySpecifyDocumentAsync(new User - { - Id = 1, - Name = "托尼", - Phone = "13999999999" - }); - } - ``` - -2. 设置多个文档: - -2.1 使用默认模型(键值模型): - - ``` C# - public async Task SetAsync([FromServices] IAutoCompleteClient client) - { - await client.SetAsync(new AutoCompleteDocument[] - { - new("Edward Adam Davis", 1), - new("Edward Jim", 1) - }); - } - ``` - -2.2 使用自定义模型 - - ``` C# - public async Task SetAsync([FromServices] IAutoCompleteClient client) - { - await client.SetBySpecifyDocumentAsync(new User[] - { - new() - { - Id = 1, - Name = "吉姆", - Phone = "13999999999" - }, - new() - { - Id = 2, - Name = "托尼", - Phone = "13888888888" - } - }); - } - ``` - -##### 获取数据 (GetAsync) - -1. 根据关键字搜索: - -1.1 使用默认模型(键值模型): - - ``` C# - public async Task GetAsync([FromServices] IAutoCompleteClient client) - { - var response = await client.GetAsync("Edward Adam Davis"); - return System.Text.Json.JsonSerializer.Serialize(response); - } - ``` - -1.2 使用自定义模型 - - ``` - public async Task GetAsync([FromServices] IAutoCompleteClient client) - { - var response = await client.GetBySpecifyDocumentAsync("托尼"); - return System.Text.Json.JsonSerializer.Serialize(response); - } - ``` - -##### 删除文档 (DeleteAsync) - -1. 删除单个文档: - - ``` C# - public async Task DeleteAsync([FromServices] IAutoCompleteClient client) - { - var response = await client.DeleteAsync(1); - return System.Text.Json.JsonSerializer.Serialize(response); - } - ``` - -2. 删除多个文档: - - ``` C# - public async Task DeleteAsync([FromServices] IAutoCompleteClient client) - { - var response = await client.DeleteAsync(new long[] { 1, 2 }); - return System.Text.Json.JsonSerializer.Serialize(response); - } - ``` - -默认需要添加的插件: - -> https://github.com/medcl/elasticsearch-analysis-ik -> -> https://github.com/medcl/elasticsearch-analysis-pinyin - -## 常见问题 - -1. 出错提示为:`"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` - - 我们默认启用兼容模式,即`EnableApiVersioningHeader(true)`,这样对8.*版本支持很好,但在部分7.*会导致错误,此时需要手动关闭兼容模式,即`EnableApiVersioningHeader(false)`。 - - ``` C# - service.AddElasticsearchClient("es", option => - { - option.UseNodes("http://localhost:9200") - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); - }); - ``` - -[为何开启兼容模式?](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs deleted file mode 100644 index d3273e6b7..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static MasaElasticsearchBuilder AddAutoComplete(this MasaElasticsearchBuilder builder) - => builder.AddAutoComplete(); - - public static MasaElasticsearchBuilder AddAutoComplete( - this MasaElasticsearchBuilder builder) where TValue : notnull - { - var indexName = builder.ElasticClient.ConnectionSettings.DefaultIndex; - if (string.IsNullOrEmpty(indexName)) - throw new ArgumentNullException( - nameof(builder.ElasticClient.ConnectionSettings.DefaultIndex), - "The default IndexName is not set"); - - return builder.AddAutoComplete>(option => option.UseIndexName(indexName)); - } - - public static MasaElasticsearchBuilder AddAutoComplete(this MasaElasticsearchBuilder builder, - Action>>? action) - => builder.AddAutoComplete(action); - - public static MasaElasticsearchBuilder AddAutoComplete( - this MasaElasticsearchBuilder builder, - Action>>? action) where TValue : notnull - { - if (typeof(TValue).IsClass) - throw new ArgumentException($"TValue does not support Class, please use AddAutoCompleteBySpecifyDocument"); - - AutoCompleteOptions> options = new AutoCompleteOptions>(); - action?.Invoke(options); - builder.Services.AddAutoCompleteCore(builder.ElasticClient, builder.Client, options); - return builder; - } - - [Obsolete($"{nameof(AddAutoComplete)} expired, please use {nameof(AddAutoCompleteBySpecifyDocument)}")] - public static MasaElasticsearchBuilder AddAutoComplete( - this MasaElasticsearchBuilder builder) - where TDocument : AutoCompleteDocument - where TValue : notnull - => builder.AddAutoCompleteBySpecifyDocument(); - - [Obsolete($"{nameof(AddAutoComplete)} expired, please use {nameof(AddAutoCompleteBySpecifyDocument)}")] - public static MasaElasticsearchBuilder AddAutoComplete( - this MasaElasticsearchBuilder builder, - Action>? action) - where TDocument : AutoCompleteDocument - where TValue : notnull - => builder.AddAutoCompleteBySpecifyDocument(action); - - public static MasaElasticsearchBuilder AddAutoCompleteBySpecifyDocument( - this MasaElasticsearchBuilder builder) - where TDocument : AutoCompleteDocument - { - var indexName = builder.ElasticClient.ConnectionSettings.DefaultIndex; - if (string.IsNullOrEmpty(indexName)) - throw new ArgumentNullException( - nameof(builder.ElasticClient.ConnectionSettings.DefaultIndex), - "The default IndexName is not set"); - - return builder.AddAutoCompleteBySpecifyDocument(option => option.UseIndexName(indexName)); - } - - public static MasaElasticsearchBuilder AddAutoCompleteBySpecifyDocument( - this MasaElasticsearchBuilder builder, - Action>? action) - where TDocument : AutoCompleteDocument - { - AutoCompleteOptions options = new AutoCompleteOptions(); - action?.Invoke(options); - builder.Services.AddAutoCompleteCore(builder.ElasticClient, builder.Client, options); - return builder; - } - - private static void AddAutoCompleteCore(this IServiceCollection services, - IElasticClient elasticClient, - IMasaElasticClient client, - AutoCompleteOptions option) - where TDocument : AutoCompleteDocument - { - ArgumentNullException.ThrowIfNull(services); - - ArgumentNullException.ThrowIfNull(option.IndexName, nameof(option.IndexName)); - - services.TryAddSingleton(new AutoCompleteRelationsOptions()); - - var autoCompleteRelations = new AutoCompleteRelations( - elasticClient, - client, - option.IndexName, - option.Alias, - option.IsDefault, - option.DefaultOperator, - option.DefaultSearchType, - option.EnableMultipleCondition); - services.TryAddAutoCompleteRelation(autoCompleteRelations); - - services.TryAddSingleton(); - services.TryAddSingleton(serviceProvider => serviceProvider.GetRequiredService().CreateClient()); - client.TryCreateIndexAsync(services.BuildServiceProvider().GetService>(), option); - } - - private static void TryAddAutoCompleteRelation(this IServiceCollection services, AutoCompleteRelations relation) - { - var serviceProvider = services.BuildServiceProvider(); - var relationsOptions = serviceProvider.GetRequiredService(); - - if (relationsOptions.Relations.Any(r => r.Alias == relation.Alias || r.IndexName == relation.IndexName)) - throw new ArgumentException($"indexName or alias exists"); - - if (relation.IsDefault && relationsOptions.Relations.Any(r => r.IsDefault)) - throw new ArgumentException("ElasticClient can only have one default", nameof(ElasticsearchRelations.IsDefault)); - - relationsOptions.AddRelation(relation); - } - - private static void TryCreateIndexAsync( - this IMasaElasticClient client, - ILogger? logger, - AutoCompleteOptions option) - where TDocument : AutoCompleteDocument - { - IAliases? aliases = null; - if (option.Alias != null) - { - aliases = new Aliases(); - aliases.Add(option.Alias, new Alias()); - } - - var existsResponse = client.IndexExistAsync(option.IndexName, CancellationToken.None).ConfigureAwait(false).GetAwaiter() - .GetResult(); - if (!existsResponse.IsValid || existsResponse.Exists) - { - if (!existsResponse.IsValid) - logger?.LogError("AutoComplete: Initialization index is abnormal, {Message}", existsResponse.Message); - - return; - } - - client.CreateIndex(logger, option.IndexName, aliases, option); - } - - private static void CreateIndex( - this IMasaElasticClient client, - ILogger? logger, - string indexName, - IAliases? aliases, - AutoCompleteOptions option) - where TDocument : AutoCompleteDocument - { - IAnalysis analysis = new AnalysisDescriptor(); - analysis.Analyzers = new Analyzers(); - analysis.TokenFilters = new TokenFilters(); - IIndexSettings indexSettings = new IndexSettings() - { - Analysis = analysis - }; - string analyzer = "ik_max_word_pinyin"; - if (option.IndexSettingAction != null) - option.IndexSettingAction.Invoke(indexSettings); - else - { - string pinyinFilter = "pinyin"; - string wordDelimiterFilter = "word_delimiter"; - indexSettings.Analysis.Analyzers.Add(analyzer, new CustomAnalyzer() - { - Filter = new[] { pinyinFilter, wordDelimiterFilter, "lowercase" }, - Tokenizer = "ik_max_word" - }); - indexSettings.Analysis.TokenFilters.Add(pinyinFilter, new PinYinTokenFilterDescriptor()); - } - - TypeMappingDescriptor mapping = new TypeMappingDescriptor(); - if (option.Action != null) - option.Action.Invoke(mapping); - else - { - mapping = mapping - .AutoMap() - .Properties(ps => - ps.Text(s => - s.Name(n => n.Text) - .Analyzer(analyzer) - ) - ); - } - - var createIndexResponse = client.CreateIndexAsync(indexName, new CreateIndexOptions() - { - Aliases = aliases, - Mappings = mapping, - IndexSettings = indexSettings - }).ConfigureAwait(false).GetAwaiter().GetResult(); - if (!createIndexResponse.IsValid) - logger?.LogError("AutoComplete: Initialization index is abnormal, {Message}", createIndexResponse.Message); - } -} diff --git a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs b/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs deleted file mode 100644 index 0b99cb8a5..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/src/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.SearchEngine.AutoComplete; -global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; -global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; -global using Masa.Contrib.SearchEngine.AutoComplete; -global using Masa.Contrib.SearchEngine.AutoComplete.Options; -global using Masa.Utils.Data.Elasticsearch; -global using Masa.Utils.Data.Elasticsearch.Analysis.TokenFilters; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Create; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Delete; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Query; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Set; -global using Masa.Utils.Data.Elasticsearch.Options.Index; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Nest; -global using DeleteResponse = Masa.BuildingBlocks.SearchEngine.AutoComplete.Response.DeleteResponse; diff --git a/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs b/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs deleted file mode 100644 index 2844fe306..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs +++ /dev/null @@ -1,679 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests; - -[TestClass] -public class AutoCompleteTest -{ - private IServiceCollection _services; - - [TestInitialize] - public void Initialize() - { - _services = new ServiceCollection(); - } - - [TestMethod] - public void TestAddAutoCompleteAndNoIndexName() - { - var builder = _services.AddElasticsearchClient(); - Assert.ThrowsException(() - => builder.AddAutoComplete(option => option.UseDefaultSearchType(SearchType.Precise).UseDefaultOperator(Operator.And))); - } - - [TestMethod] - public void TestAddAutoComplete() - { - _services.AddElasticsearchClient("es", option => - { - option.UseConnectionSettings(setting => - { - setting.EnableApiVersioningHeader(false); - setting.DefaultIndex("user_index"); - }); - }).AddAutoComplete(option - => option.UseIndexName("user_index").UseDefaultSearchType(SearchType.Precise).UseDefaultOperator(Operator.And)); - var serviceProvider = _services.BuildServiceProvider(); - var autoCompleteClient = serviceProvider.GetService(); - Assert.IsNotNull(autoCompleteClient); - - var autoCompleteFactory = serviceProvider.GetService(); - Assert.IsNotNull(autoCompleteFactory); - - var autoCompleteClient2 = autoCompleteFactory.CreateClient(); - Assert.IsNotNull(autoCompleteClient2); - - var elasticClientField = typeof(AutoCompleteClient).GetField("_elasticClient", BindingFlags.Instance | BindingFlags.NonPublic)!; - Assert.IsTrue(elasticClientField.GetValue(autoCompleteClient) == elasticClientField.GetValue(autoCompleteClient2)); - } - - [TestMethod] - public void TestAddMultiAutoComplete() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services - .AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))) - .AddAutoComplete(option - => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And)); - Assert.ThrowsException(() => builder.AddAutoComplete(option - => option.UseIndexName(userIndexName).UseDefaultSearchType(SearchType.Precise).UseDefaultOperator(Operator.And))); - } - - [TestMethod] - public void TestAddMultiDefaultAutoComplete() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services - .AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))) - .AddAutoComplete(option - => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefault().UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And)); - Assert.ThrowsException(() - => builder.AddAutoComplete(option - => option.UseIndexName("employee_index").UseDefault().UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And))); - } - - [TestMethod] - public async Task TestGetAsync() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services - .AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - - await builder.Client.DeleteIndexByAliasAsync(userAlias); - - builder.AddAutoComplete(option - => option.UseIndexName(userIndexName) - .UseAlias(userAlias) - .UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And)); - - var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); - var autoCompleteClient = autoCompleteFactory.CreateClient(userIndexName); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new("张三", 1), - new("李四", 2), - new("张丽", 3) - }); - - Thread.Sleep(1000); - - var response = await autoCompleteClient.GetAsync("张三"); - Assert.IsTrue(response.IsValid && response.Total == 1); - - response = await autoCompleteClient.GetAsync("三"); - Assert.IsTrue(response.IsValid && response.Total == 1); - - response = await autoCompleteClient.GetAsync("zs"); - Assert.IsTrue(response.IsValid && response.Total == 1); - - response = await autoCompleteClient.GetAsync("zhang"); - Assert.IsTrue(response.IsValid && response.Total == 2); - - response = await autoCompleteClient.GetAsync("li"); - Assert.IsTrue(response.IsValid && response.Total == 2); - - response = await autoCompleteClient.GetAsync("si", new AutoCompleteOptions(SearchType.Fuzzy)); - Assert.IsTrue(response.IsValid && response.Total == 1); - - response = await autoCompleteClient.GetAsync("zhang", new AutoCompleteOptions(SearchType.Fuzzy)); - Assert.IsTrue(response.IsValid && response.Total == 2); - - response = await autoCompleteClient.GetAsync("", new AutoCompleteOptions(SearchType.Fuzzy)); - Assert.IsTrue(response.IsValid && response.Total == 0); - } - - [TestMethod] - public async Task TestMultiConditionsAsyncReturnTotalIs2() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services - .AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - - await builder.Client.DeleteIndexByAliasAsync(userAlias); - - builder.AddAutoComplete(option - => option.UseIndexName(userIndexName) - .UseAlias(userAlias)); - - var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); - var autoCompleteClient = autoCompleteFactory.CreateClient(userIndexName); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new("张三", 1), - new("张丽", 2), - new("李四", 3) - }); - - Thread.Sleep(1000); - - var response = await autoCompleteClient.GetAsync("张三 ls"); - Assert.IsTrue(response.Total == 3); - Assert.IsTrue(response.Data[0].Value == 1); - Assert.IsTrue(response.Data[1].Value == 3); - Assert.IsTrue(response.Data[2].Value == 2); - - await builder.Client.DeleteIndexByAliasAsync(userAlias); - } - - - [TestMethod] - public async Task TestMultiConditionsAsyncReturnTotalIs1() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services - .AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - - await builder.Client.DeleteIndexByAliasAsync(userAlias); - - builder.AddAutoComplete(option - => option.UseIndexName(userIndexName) - .UseAlias(userAlias) - .UseDefaultOperator(Operator.And)); - - var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); - var autoCompleteClient = autoCompleteFactory.CreateClient(userIndexName); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new("张三", 1), - new("李四", 2), - new("张丽", 3) - }); - - Thread.Sleep(1000); - - var response = await autoCompleteClient.GetAsync("张 li"); - Assert.IsTrue(response.Total == 1); - Assert.IsTrue(response.Data[0].Value == 3); - - await builder.Client.DeleteIndexByAliasAsync(userAlias); - } - - [TestMethod] - public async Task TestDisableMultiConditionsAsyncReturnTotalIs0() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services - .AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - - await builder.Client.DeleteIndexByAliasAsync(userAlias); - - builder.AddAutoComplete(option - => option.UseIndexName(userIndexName) - .UseAlias(userAlias) - .UseDefaultOperator(Operator.And) - .UseMultipleConditions(false)); - - var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); - var autoCompleteClient = autoCompleteFactory.CreateClient(userIndexName); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new("张三", 1), - new("李四", 2), - new("张丽", 3), - new("唐伯虎", 4), - }); - - Thread.Sleep(1000); - - var response = await autoCompleteClient.GetAsync("唐 虎"); - Assert.IsTrue(response.Total == 0); - - var response2 = await autoCompleteClient.GetAsync("唐"); - Assert.IsTrue(response2.Total == 1); - - var response3 = await autoCompleteClient.GetAsync("zs"); - Assert.IsTrue(response3.Total == 1); - - var response4 = await autoCompleteClient.GetAsync("tang"); - Assert.IsTrue(response4.Total == 1); - - await builder.Client.DeleteIndexByAliasAsync(userAlias); - } - - [TestMethod] - public async Task TestCustomModelAsync() - { - string employeeIndexName = $"employee_index_{Guid.NewGuid()}"; - string employeeAlias = $"employee_index_{Guid.NewGuid()}"; - var builder = _services.AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - - await builder.Client.DeleteIndexByAliasAsync(employeeAlias); - - string analyzer = "ik_max_word_pinyin"; - builder.AddAutoCompleteBySpecifyDocument(option => option - .UseIndexName(employeeIndexName) - .UseAlias(employeeAlias) - .UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And) - .Mapping(descriptor => - { - descriptor.AutoMap() - .Properties(ps => - ps.Text(s => - s.Name(n => n.Text) - .Analyzer(analyzer) - ) - ) - .Properties(ps => - ps.Text(s => - s.Name(n => n.Phone) - .Analyzer(analyzer) - ) - ) - .Properties(ps => - ps.Text(s => - s.Name(n => n.Name) - .Analyzer(analyzer) - ) - ); - })); - - var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); - var employeeClient = autoCompleteFactory.CreateClient(employeeAlias); - await employeeClient.SetBySpecifyDocumentAsync(new Employee[] - { - new() - { - Name = "吉姆", - Id = 1, - Phone = "13999999999" - }, - new() - { - Name = "托尼", - Id = 2, - Phone = "13888888888" - } - }); - - Thread.Sleep(1000); - - var employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("吉姆"); - Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 1); - - employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("139"); - Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 0); - - employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("139*", new AutoCompleteOptions(SearchType.Fuzzy) - { - Field = "phone" - }); - Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 1); - - employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("*", new AutoCompleteOptions(SearchType.Fuzzy)); - Assert.IsTrue(employeeResponse.Data.All(employee => employee.Phone == "13999999999" || employee.Phone == "13888888888")); - - await employeeClient.SetBySpecifyDocumentAsync(new Employee - { - Name = "吉姆", - Id = 1, - Phone = "13777777777" - }); - - Thread.Sleep(1000); - - employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("*", new AutoCompleteOptions(SearchType.Fuzzy)); - Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 2); - Assert.IsTrue(employeeResponse.Data.Any(employee => employee.Phone == "13777777777")); - - await employeeClient.SetBySpecifyDocumentAsync(new Employee - { - Name = "吉姆", - Id = 1, - Phone = "13999999999" - }, new SetOptions() - { - IsOverride = false - }); - - Thread.Sleep(1000); - - employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("*", new AutoCompleteOptions(SearchType.Fuzzy)); - Assert.IsTrue(employeeResponse.Data.Any(employee => employee.Phone == "13777777777")); - } - - [TestMethod] - public async Task TestPreciseAsync() - { - string employeeIndexName = $"employee_index_{Guid.NewGuid()}"; - string employeeAlias = $"employee_index_{Guid.NewGuid()}"; - var builder = _services.AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - - await builder.Client.DeleteIndexByAliasAsync(employeeAlias); - builder.AddAutoComplete(option => option - .UseIndexName(employeeIndexName) - .UseAlias(employeeAlias) - .UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And)); - - var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); - var employeeClient = autoCompleteFactory.CreateClient(employeeAlias); - var res = await employeeClient.SetAsync(new[] - { - new Employee() - { - Name = "吉姆", - Id = 1, - Phone = "13999999999" - }, - new Employee() - { - Name = "托尼", - Id = 2, - Phone = "13888888888" - } - }); - - Thread.Sleep(1000); - - var employeeResponse = await employeeClient.GetAsync("ji*", new(SearchType.Fuzzy)); - Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 1); - - employeeResponse = await employeeClient.GetAsync("13999999999", new() - { - Field = "phone" - }); - Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 1 && - employeeResponse.Data.Any(employee => employee.Id == 1)); - } - - [TestMethod] - public async Task TestOperatorAndAsync() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services - .AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))) - .AddAutoComplete(option => - option.UseIndexName(userIndexName) - .UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise).UseDefaultOperator(Operator.And)); - - await builder.Client.ClearDocumentAsync(userAlias); - - var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); - var autoCompleteClient = autoCompleteFactory.CreateClient(userAlias); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new() - { - Text = "Edward Adam Davis", - Value = 1 - }, - new() - { - Text = "Edward Jim", - Value = 2 - } - }); - - Thread.Sleep(1000); - - var response = await autoCompleteClient.GetAsync("Edward Adam Davis"); - Assert.IsTrue(response.IsValid && response.Total == 1); - } - - [TestMethod] - public async Task TestOperatorOrAsync() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services - .AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - - await builder.Client.DeleteIndexAsync(userIndexName); - - builder.AddAutoComplete(option => - option.UseIndexName(userIndexName) - .UseAlias(userAlias) - .UseDefaultOperator(Operator.Or) - .UseDefaultSearchType(SearchType.Precise)); - - var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); - var autoCompleteClient = autoCompleteFactory.CreateClient(userAlias); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new() - { - Text = "Edward Adam Davis", - Value = 1 - }, - new() - { - Text = "Edward Jim", - Value = 2 - } - }); - - Thread.Sleep(1000); - - var response = await autoCompleteClient.GetAsync("Edward Adam Davis", new(SearchType.Fuzzy)); - Assert.IsTrue(response.IsValid && response.Total == 2); - } - - [TestMethod] - public void TestNullIndexName() - { - var builder = _services.AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - - string analyzer = "ik_max_word_pinyin"; - - Assert.ThrowsException(() => builder.AddAutoCompleteBySpecifyDocument(option => option - .UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And) - .Mapping(descriptor => - { - descriptor.AutoMap() - .Properties(ps => - ps.Text(s => - s.Name(n => n.Text) - .Analyzer(analyzer) - ) - ) - .Properties(ps => - ps.Text(s => - s.Name(n => n.Phone) - .Analyzer(analyzer) - ) - ); - }))); - } - - [TestMethod] - public async Task DeleteAsyncReturnDocumentIsNotExist() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - var builder = _services.AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - await builder.Client.DeleteIndexAsync(userIndexName); - - builder.AddAutoComplete(option - => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And)); - var serviceProvider = builder.Services.BuildServiceProvider(); - var autoCompleteClient = serviceProvider.GetRequiredService(); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new() - { - Text = "张三", - Value = 1 - }, - new() - { - Text = "李四", - Value = 2 - } - }); - Thread.Sleep(1000); - - var response = await autoCompleteClient.DeleteAsync(10); - Assert.IsTrue(!response.IsValid); - } - - [TestMethod] - public async Task DeleteAsyncReturnDeleteSuccess() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - var builder = _services.AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - await builder.Client.DeleteIndexAsync(userIndexName); - - builder.AddAutoComplete(option - => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And)); - var serviceProvider = builder.Services.BuildServiceProvider(); - var autoCompleteClient = serviceProvider.GetRequiredService(); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new() - { - Text = "张三", - Value = 1 - }, - new() - { - Text = "李四", - Value = 2 - } - }); - Thread.Sleep(1000); - - var response = await autoCompleteClient.DeleteAsync(1); - Assert.IsTrue(response.IsValid); - } - - [TestMethod] - public async Task DeleteUserReturnEmpty() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services.AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - await builder.Client.DeleteIndexAsync(userIndexName); - - builder.AddAutoComplete(option - => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And)); - var serviceProvider = builder.Services.BuildServiceProvider(); - var autoCompleteClient = serviceProvider.GetRequiredService(); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new() - { - Text = "张三", - Value = 1 - }, - new() - { - Text = "李四", - Value = 2 - } - }); - - Thread.Sleep(1000); - - var getResponse = await autoCompleteClient.GetAsync("张三"); - Assert.IsTrue(getResponse.IsValid && getResponse.Total == 1); - - var deleteResponse = await autoCompleteClient.DeleteAsync(new[] { 1 }); - Assert.IsTrue(deleteResponse.IsValid); - - Thread.Sleep(1000); - - getResponse = await autoCompleteClient.GetAsync("张三"); - Assert.IsTrue(getResponse.IsValid && getResponse.Total == 0); - } - - [TestMethod] - public async Task DeleteMultiUserReturnEmpty() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string userAlias = $"user_index_{Guid.NewGuid()}"; - - var builder = _services.AddElasticsearchClient("es", - option => option.UseNodes("http://localhost:9200").UseDefault() - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); - await builder.Client.DeleteIndexAsync(userIndexName); - - builder.AddAutoComplete(option - => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) - .UseDefaultOperator(Operator.And)); - var serviceProvider = builder.Services.BuildServiceProvider(); - var autoCompleteClient = serviceProvider.GetRequiredService(); - await autoCompleteClient.SetAsync(new AutoCompleteDocument[] - { - new() - { - Text = "张三", - Value = 1 - }, - new() - { - Text = "李四", - Value = 2 - } - }); - - Thread.Sleep(1000); - - var getResponse = await autoCompleteClient.GetAsync("张三"); - Assert.IsTrue(getResponse.IsValid && getResponse.Total == 1); - - getResponse = await autoCompleteClient.GetAsync("李四"); - Assert.IsTrue(getResponse.IsValid && getResponse.Total == 1); - - var deleteMultiResponse = await autoCompleteClient.DeleteAsync(new List() { 1, 2, 3 }); - Assert.IsTrue(deleteMultiResponse.IsValid && - deleteMultiResponse.Data.Count == 3 && - deleteMultiResponse.Data.Count(r => r.IsValid) == 2); //todo: Masa.Utils.Data.Elasticsearch response information error - - Thread.Sleep(1000); - - getResponse = await autoCompleteClient.GetAsync("张三"); - Assert.IsTrue(getResponse.IsValid && getResponse.Total == 0); - } -} diff --git a/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj b/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj deleted file mode 100644 index d696677c2..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs b/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs deleted file mode 100644 index 252a2fc77..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.Model; - -public class Employee : AutoCompleteDocument -{ - public int Id { get; set; } - - public string Name { get; set; } - - public string Phone { get; set; } - - protected override string GetText() => Name; - - public override string GetDocumentId() => Id.ToString(); -} diff --git a/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs b/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs deleted file mode 100644 index 0c4931e22..000000000 --- a/src/Contrib/SearchEngine/AutoComplete/test/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.SearchEngine.AutoComplete; -global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; -global using Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.Model; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Nest; -global using System.Reflection; diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs deleted file mode 100644 index b8ec0057a..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.DaprClient; - -public static class CallerOptionsExtensions -{ - public static DefaultDaprClientBuilder UseDapr(this CallerOptions callerOptions, Func clientBuilder) - { - if (clientBuilder == null) - throw new ArgumentNullException(nameof(clientBuilder)); - - MasaDaprClientBuilder builder = clientBuilder.Invoke(); - if (clientBuilder == null) - throw new ArgumentNullException(nameof(clientBuilder)); - - callerOptions.Services.AddDaprClient(daprClientBuilder => - { - if (callerOptions.JsonSerializerOptions != null) - daprClientBuilder.UseJsonSerializationOptions(callerOptions.JsonSerializerOptions); - - builder.Configure?.Invoke(daprClientBuilder); - }); - - AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, - serviceProvider => new DaprCaller(serviceProvider, builder.Name, builder.AppId)); - return new DefaultDaprClientBuilder(callerOptions.Services, builder.Name); - } - - public static DefaultDaprClientBuilder UseDapr(this CallerOptions callerOptions, Action clientBuilder) - { - if (clientBuilder == null) - throw new ArgumentNullException(nameof(clientBuilder)); - - MasaDaprClientBuilder builder = new MasaDaprClientBuilder(); - clientBuilder.Invoke(builder); - - return callerOptions.UseDapr(() => builder); - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs deleted file mode 100644 index 41feb8b4f..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.DaprClient; - -public class DaprCaller : AbstractCaller -{ - private Dapr.Client.DaprClient? _daprClient; - private Dapr.Client.DaprClient DaprClient => _daprClient ??= ServiceProvider.GetRequiredService(); - private readonly CallerDaprClientOptions _callerDaprClientOptions; - protected readonly string AppId; - - public DaprCaller(IServiceProvider serviceProvider, string name, string appId) - : base(serviceProvider) - { - var optionsFactory = serviceProvider.GetRequiredService>(); - _callerDaprClientOptions = optionsFactory.Create(name); - AppId = appId; - } - - public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) - where TResponse : default - { - var response = await DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); - return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); - } - - public override async Task CreateRequestAsync(HttpMethod method, string? methodName) - { - var httpRequestMessage = - await RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName)); - - DealRequestMessage(Action); - - return httpRequestMessage; - - async void Action(IDaprRequestMessage requestMessage) - { - await requestMessage.ProcessHttpRequestMessageAsync(httpRequestMessage); - } - } - - public override async Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) - { - var httpRequestMessage = - await RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName), data); - - DealRequestMessage(Action); - - return httpRequestMessage; - - async void Action(IDaprRequestMessage requestMessage) - { - await requestMessage.ProcessHttpRequestMessageAsync(httpRequestMessage); - } - } - - private void DealRequestMessage(Action action) - { - foreach (var httpRequestMessageAction in _callerDaprClientOptions.HttpRequestMessageActions) - { - MasaHttpMessageHandlerBuilder masaHttpMessageHandlerBuilder = new MasaHttpMessageHandlerBuilder(ServiceProvider); - httpRequestMessageAction.Invoke(masaHttpMessageHandlerBuilder); - - foreach (var requestMessage in masaHttpMessageHandlerBuilder.RequestMessages) - { - action.Invoke(requestMessage); - } - } - } - - public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) - { - return await DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); - } - - public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) - => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); - - public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) - => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); - - public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) - => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, request, cancellationToken); - - public override Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs deleted file mode 100644 index 5c271fb4d..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.DaprClient; - -public abstract class DaprCallerBase : CallerBase -{ - protected abstract string AppId { get; set; } - - public virtual Action? Configure { get; set; } = null; - - protected DaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public override void UseCallerExtension() => UseDapr(); - - protected virtual DefaultDaprClientBuilder UseDapr() - { - CallerOptions.UseDapr(opt => - { - opt.Name = Name; - opt.AppId = AppId; - if (Configure != null) - { - opt.Configure = Configure; - } - }); - return new DefaultDaprClientBuilder(CallerOptions.Services, Name); - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs deleted file mode 100644 index 562cd81af..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.DaprClient; - -public class DefaultDaprClientBuilder -{ - public IServiceCollection Services { get; private set; } - - public string Name { get; private set; } - - public DefaultDaprClientBuilder(IServiceCollection services, string name) - { - Services = services; - Name = name; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs deleted file mode 100644 index 6f49049ad..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.DaprClient; - -public class MasaHttpMessageHandlerBuilder -{ - public IList RequestMessages { get; } = new List(); - - public virtual IServiceProvider ServiceProvider { get; } - - public MasaHttpMessageHandlerBuilder(IServiceProvider serviceProvider) - => ServiceProvider = serviceProvider; -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs deleted file mode 100644 index 2ebec9009..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.DaprClient; - -public interface IDaprRequestMessage -{ - Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage); -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj deleted file mode 100644 index 1cc584cf8..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs deleted file mode 100644 index e06b48a26..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.DaprClient; - -public class MasaDaprClientBuilder -{ - private string _appId = default!; - - public string AppId - { - get - { - return _appId; - } - set - { - if (string.IsNullOrEmpty(value)) - throw new ArgumentNullException(nameof(AppId)); - - _appId = value; - } - } - - private string _name = default!; - - public string Name - { - get - { - return _name; - } - set - { - if (value is null) - throw new ArgumentNullException(nameof(Name)); - - _name = value; - } - } - - public bool IsDefault { get; set; } = false; - - public Action? Configure { get; set; } - - internal MasaDaprClientBuilder() - { - this.Name = string.Empty; - } - - public MasaDaprClientBuilder(string appid) - : this(appid, "dapr") { } - - public MasaDaprClientBuilder(string appid, string name) - : this(appid, name, null) - { - } - - public MasaDaprClientBuilder(string appid, string name, Action? configure) : this(appid, name, configure, false) - { - } - - public MasaDaprClientBuilder(string appid, string name, Action? configure, bool isDefault) - { - AppId = appid; - Name = name; - Configure = configure; - IsDefault = isDefault; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs deleted file mode 100644 index ad91b3a03..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.DaprClient; - -public static class MasaDaprClientBuilderExtensions -{ - public static DefaultDaprClientBuilder AddHttpRequestMessage( - this DefaultDaprClientBuilder builder) - where TRequestMessage : class, IDaprRequestMessage - { - ArgumentNullException.ThrowIfNull(builder); - - builder.Services.TryAddEnumerable(new ServiceDescriptor( - typeof(IDaprRequestMessage), - typeof(TRequestMessage), - ServiceLifetime.Singleton)); - - builder.Services.Configure(builder.Name, option => - { - option.HttpRequestMessageActions.Add(b - => b.RequestMessages.Add( - b.ServiceProvider - .GetServices() - .FirstOrDefault(d => d.GetType() == typeof(TRequestMessage))!)); - }); - return builder; - } - - public static IHttpClientBuilder AddHttpRequestMessage( - this IHttpClientBuilder builder, - Func configureHandler) - where TRequestMessage : class, IDaprRequestMessage - { - ArgumentNullException.ThrowIfNull(nameof(builder)); - - ArgumentNullException.ThrowIfNull(configureHandler); - - builder.Services.TryAddEnumerable(new ServiceDescriptor(typeof(IDaprRequestMessage), configureHandler, ServiceLifetime.Singleton)); - - builder.Services.Configure(builder.Name, options => - { - options.HttpRequestMessageActions.Add(b => b.RequestMessages.Add(configureHandler.Invoke(b.ServiceProvider))); - }); - - return builder; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs deleted file mode 100644 index a8c890bbb..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.DaprClient.Options; - -public class CallerDaprClientOptions -{ - public IList> HttpRequestMessageActions { get; } = new List>(); -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.md deleted file mode 100644 index 8da3bdadf..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.md +++ /dev/null @@ -1,102 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Service.Caller.DaprClient - -## Example: - -````c# -Install-Package Masa.Contrib.Service.Caller -Install-Package Masa.Contrib.Service.Caller.DaprClient -```` - -### Basic usage: - -1. Modify `Program.cs` - - ```` C# - builder.Services.AddCaller(options => - { - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one Provider, you can not assign a value to Name - clientBuilder.AppId = "" ;//AppID of the callee dapr - }); - }); - ```` - -2. How to use: - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICaller userCaller, string name) - => userCaller.GetAsync($"/Hello", new { Name = name })); - ```` - - > The interface address of the complete request is: http://localhost:3500/v1.0/invoke//method/Hello?Name={name} - -3. When there are multiple DaprClients, modify `Program.cs` - - ```` C# - builder.Services.AddCaller(options => - { - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "UserCaller"; - clientBuilder.AppId = "" ;//AppID of the callee User service Dapr - }); - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "OrderCaller"; - clientBuilder.AppId = "" ;//AppID of the callee Order service Dapr - }); - }); - ```` - -4. How to use UserCaller or OrderCaller - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICaller userCaller, string name) - => userCaller.GetAsync($"/Hello", new { Name = name })); - - - app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => - { - var caller = callerFactory.CreateClient("OrderCaller"); - return caller.GetAsync($"/Hello", new { Name = name }); - }); - ```` - -> When multiple Callers are added, how to get the specified Caller? ->> Get the Caller of the specified alias through the `CreateClient` method of `CallerFactory` -> -> Why doesn't `userCaller` get the corresponding Caller through the `CreateClient` method of `CallerFactory`? ->> If no default ICaller is specified, the default Caller is the first one added in the `AddCaller` method - -### Recommended usage - -1. Modify `Program.cs` - - ```` C# - builder.Services.AddCaller(); - ```` - -2. Add a new class `UserCaller` - - ```` C# - public class UserCaller: DaprCallerBase - { - protected override string AppId { get; set; } = ""; - - public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public Task HelloAsync(string name) => Caller.GetStringAsync($"/Hello", new { Name = name }); - } - ```` - -3. How to use UserCaller - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) - => caller.HelloAsync(name)); - ```` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md deleted file mode 100644 index 2aa8663a6..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md +++ /dev/null @@ -1,102 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Service.Caller.DaprClient - -## 用例: - -```c# -Install-Package Masa.Contrib.Service.Caller -Install-Package Masa.Contrib.Service.Caller.DaprClient -``` - -### 基本用法: - -1. 修改`Program.cs` - - ``` C# - builder.Services.AddCaller(options => - { - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个Provider时,可以不对Name赋值 - clientBuilder.AppId = "" ;//被调用方dapr的AppID - }); - }); - ``` - -2. 如何使用: - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICaller userCaller, string name) - => userCaller.GetAsync($"/Hello", new { Name = name })); - ``` - - > 完整请求的接口地址是:http://localhost:3500/v1.0/invoke//method/Hello?Name={name} - -3. 当存在多个DaprClient时,则修改`Program.cs`为 - - ``` C# - builder.Services.AddCaller(options => - { - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "UserCaller"; - clientBuilder.AppId = "" ;//被调用方User服务Dapr的AppID - }); - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "OrderCaller"; - clientBuilder.AppId = "" ;//被调用方Order服务Dapr的AppID - }); - }); - ``` - -4. 如何使用UserCaller或OrderCaller - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICaller userCaller, string name) - => userCaller.GetAsync($"/Hello", new { Name = name })); - - - app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => - { - var caller = callerFactory.CreateClient("OrderCaller"); - return caller.GetAsync($"/Hello", new { Name = name }); - }); - ``` - -> 当多个Caller被添加时,如何获取指定的Caller? ->> 通过`CallerFactory`的`CreateClient`方法得到指定别名的Caller -> -> 为什么`userCaller`没有通过`CallerFactory`的`CreateClient`方法得到对应的Caller? ->> 如果未指定默认的ICaller,则在`AddCaller`方法中第一个被添加的就是默认的Caller - -### 推荐用法 - -1. 修改`Program.cs` - - ``` C# - builder.Services.AddCaller(); - ``` - -2. 新增加类`UserCaller` - - ``` C# - public class UserCaller: DaprCallerBase - { - protected override string AppId { get; set; } = ""; - - public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public Task HelloAsync(string name) => Caller.GetStringAsync($"/Hello", new { Name = name }); - } - ``` - -3. 如何使用UserCaller - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) - => caller.HelloAsync(name)); - ``` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs deleted file mode 100644 index 37d02e325..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Dapr.Client; -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.Service.Caller.DaprClient.Options; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Options; diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs deleted file mode 100644 index c06dd2997..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.HttpClient; - -public static class CallerOptionsExtensions -{ - public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Func? clientBuilder = null) - { - var builder = clientBuilder == null ? new MasaHttpClientBuilder() : clientBuilder.Invoke(); - var httpClientBuilder = callerOptions.Services.AddHttpClient(builder.Name, httpClient - => builder.ConfigureHttpClient(httpClient)); - - AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, serviceProvider - => new HttpClientCaller(serviceProvider, builder.Name, builder.Prefix)); - return httpClientBuilder; - } - - public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Action? clientBuilder) - { - MasaHttpClientBuilder builder = new MasaHttpClientBuilder(); - clientBuilder?.Invoke(builder); - - return callerOptions.UseHttpClient(() => builder); - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs deleted file mode 100644 index 474925301..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.HttpClient; - -public class HttpClientCaller : AbstractCaller -{ - private readonly System.Net.Http.HttpClient _httpClient; - private readonly string _prefix; - private readonly bool _prefixIsNullOrEmpty; - - public HttpClientCaller(IServiceProvider serviceProvider, string name, string prefix) - : base(serviceProvider) - { - _httpClient = serviceProvider.GetRequiredService().CreateClient(name); - _prefix = prefix; - _prefixIsNullOrEmpty = string.IsNullOrEmpty(_prefix); - } - - public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) - where TResponse : default - { - var response = await _httpClient.SendAsync(request, cancellationToken); - return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); - } - - public override Task CreateRequestAsync(HttpMethod method, string? methodName) - => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName))); - - public override Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) - => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName)), data); - - public override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) - { - return _httpClient.SendAsync(request, cancellationToken); - } - - public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override Task SendGrpcAsync(string methodName, TRequest request, - CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - protected virtual string GetRequestUri(string? methodName) - { - if (string.IsNullOrEmpty(methodName)) - return string.Empty; - - if (Uri.IsWellFormedUriString(methodName, UriKind.Absolute) || _prefixIsNullOrEmpty) - return methodName; - - if (_prefix.EndsWith("/")) - return $"{_prefix}{(methodName.StartsWith("/") ? methodName.Substring(1) : methodName)}"; - - return $"{_prefix}{(methodName.StartsWith("/") ? methodName : "/" + methodName)}"; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs deleted file mode 100644 index efec26b02..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.HttpClient; - -public abstract class HttpClientCallerBase : CallerBase -{ - protected abstract string BaseAddress { get; set; } - - protected virtual string Prefix { get; set; } = string.Empty; - - protected HttpClientCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public override void UseCallerExtension() => UseHttpClient(); - - protected virtual IHttpClientBuilder UseHttpClient() - { - return CallerOptions.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Name = Name; - httpClientBuilder.Prefix = Prefix; - httpClientBuilder.BaseAddress = BaseAddress; - httpClientBuilder.Configure = ConfigureHttpClient; - }); - } - - protected virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) - { - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj deleted file mode 100644 index 438935c9b..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs deleted file mode 100644 index 516d483c2..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.HttpClient; - -public class MasaHttpClientBuilder -{ - private string _name = default!; - - public string Name - { - get => _name; - set - { - if (value is null) - throw new ArgumentNullException(Name); - - _name = value; - } - } - - [Obsolete($"recommended to use {nameof(BaseAddress)}, {nameof(BaseApi)} has expired")] - public string BaseApi { get => BaseAddress; set => BaseAddress = value; } - - public string BaseAddress { get; set; } - - public string Prefix { get; set; } - - public bool IsDefault { get; set; } = false; - - public Action? Configure { get; set; } - - public MasaHttpClientBuilder() : this("http", null) - { - } - - public MasaHttpClientBuilder(string name, Action? configure) - : this(name, string.Empty, configure) - { - } - - public MasaHttpClientBuilder(string name, string baseAddress, Action? configure) - : this(name, baseAddress, string.Empty, configure) - { - } - - public MasaHttpClientBuilder(string name, string baseAddress, string prefix, Action? configure) - { - Name = name; - BaseAddress = baseAddress; - Prefix = prefix; - Configure = configure; - } - - public virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) - { - if (!string.IsNullOrEmpty(BaseAddress)) - httpClient.BaseAddress = new Uri(BaseAddress); - - Configure?.Invoke(httpClient); - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.md deleted file mode 100644 index 68e654fe2..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.md +++ /dev/null @@ -1,111 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Service.Caller.HttpClient - -## Example: - -````c# -Install-Package Masa.Contrib.Service.Caller -Install-Package Masa.Contrib.Service.Caller.HttpClient -```` - -### Basic usage: - -1. Modify `Program.cs` - - ```` C# - builder.Services.AddCaller(options => - { - options.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one HttpClient, you can not assign a value to Name - clientBuilder.BaseAddress = "http://localhost:5000" ; - }); - }); - ```` - -2. How to use: - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICaller caller, string name) - => caller.GetAsync($"/Hello", new { Name = name })); - ```` - - > The interface address of the complete request is: http://localhost:5000/Hello?Name={name} - -3. When there are multiple HttpClients, modify `Program.cs` - - ```` C# - builder.Services.AddCaller(options => - { - options.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "UserCaller"; - clientBuilder.BaseAddress = "http://localhost:5000" ; - }); - options.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "OrderCaller"; - clientBuilder.BaseAddress = "http://localhost:6000" ; - }); - }); - ```` - -4. How to use UserCaller or OrderCaller - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICaller caller, string name) - => caller.GetAsync($"/Hello", new { Name = name }));// Get UserCaller - - - app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => - { - var caller = callerFactory.Create("OrderCaller"); - return caller.GetAsync($"/Hello", new { Name = name }); - }); - ```` - -> When multiple Callers are added, how to get the specified Caller? ->> Get the Caller of the specified alias through the `Create` method of `CallerFactory` -> -> Why doesn't `caller` get the corresponding Caller through the `Create` method of `CallerFactory`? ->> If no default ICaller is specified, the default Caller is the first one added in the `AddCaller` method - -### Recommended usage - -1. Modify `Program.cs` - - ```` C# - builder.Services.AddCaller(); - ```` - -2. Add a new class `UserCaller` - - ```` C# - public class UserCaller: HttpClientCallerBase - { - protected override string BaseAddress { get; set; } = "http://localhost:5000"; - - public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public Task HelloAsync(string name) => Caller.GetStringAsync($"/Hello", new { Name = name }); - - /// - /// There is no need to overload by default, and it can be overloaded when there are special requirements for httpClient - /// - /// - protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) - { - httpClient.Timeout = TimeSpan.FromSeconds(5); - } - } - ```` - -3. How to use UserCaller - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) - => caller.HelloAsync(name)); - ```` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md deleted file mode 100644 index c65988999..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md +++ /dev/null @@ -1,111 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Service.Caller.HttpClient - -## 用例: - -```c# -Install-Package Masa.Contrib.Service.Caller -Install-Package Masa.Contrib.Service.Caller.HttpClient -``` - -### 基本用法: - -1. 修改`Program.cs` - - ``` C# - builder.Services.AddCaller(options => - { - options.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个HttpClient时,可以不对Name赋值 - clientBuilder.BaseAddress = "http://localhost:5000" ; - }); - }); - ``` - -2. 如何使用: - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICaller caller, string name) - => caller.GetAsync($"/Hello", new { Name = name })); - ``` - - > 完整请求的接口地址是:http://localhost:5000/Hello?Name={name} - -3. 当存在多个HttpClient时,则修改`Program.cs`为 - - ``` C# - builder.Services.AddCaller(options => - { - options.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "UserCaller"; - clientBuilder.BaseAddress = "http://localhost:5000" ; - }); - options.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "OrderCaller"; - clientBuilder.BaseAddress = "http://localhost:6000" ; - }); - }); - ``` - -4. 如何使用UserCaller或OrderCaller - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICaller caller, string name) - => caller.GetAsync($"/Hello", new { Name = name })); // 获取到的是UserCaller - - - app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => - { - var orderCaller = callerFactory.Create("OrderCaller"); - return orderCaller.GetAsync($"/Hello", new { Name = name }); - }); - ``` - -> 当多个Caller被添加时,如何获取指定的Caller? ->> 通过`CallerFactory`的`Create`方法得到指定别名的Caller -> -> 为什么`caller`没有通过`CallerFactory`的`Create`方法得到对应的Caller? ->> 如果未指定默认的ICallerProvider,则在`AddCaller`方法中第一个被添加的就是默认的Caller - -### 推荐用法 - -1. 修改`Program.cs` - - ``` C# - builder.Services.AddCaller(); - ``` - -2. 新增加类`UserCaller` - - ``` C# - public class UserCaller: HttpClientCallerBase - { - protected override string BaseAddress { get; set; } = "http://localhost:5000"; - - public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public Task HelloAsync(string name) => Caller.GetStringAsync($"/Hello", new { Name = name }); - - /// - /// 默认不需要重载,对httpClient有特殊需求时可重载 - /// - /// - protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) - { - httpClient.Timeout = TimeSpan.FromSeconds(5); - } - } - ``` - -3. 如何使用UserCaller - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) - => caller.HelloAsync(name)); - ``` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs deleted file mode 100644 index 9710f3e96..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs deleted file mode 100644 index b322c34fa..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller; - -internal class DefaultCallerFactory : ICallerFactory -{ - private readonly IServiceProvider _serviceProvider; - private readonly List _callers; - - public DefaultCallerFactory(IServiceProvider serviceProvider, IOptions options) - { - _serviceProvider = serviceProvider; - _callers = options.Value.Callers; - } - - public ICaller Create() - { - var caller = _callers.SingleOrDefault(c => c.IsDefault) ?? _callers.FirstOrDefault()!; - return caller.Func.Invoke(_serviceProvider); - } - - public ICaller Create(string name) - { - var caller = _callers.SingleOrDefault(c => c.Name == name); - if (caller == null) - throw new NotSupportedException($"Please make sure you have used [{name}] Caller"); - - return caller.Func.Invoke(_serviceProvider); - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs deleted file mode 100644 index 2d8c44fe6..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller; - -public abstract class DefaultRequestMessage -{ - protected readonly IServiceProvider ServiceProvider; - private readonly string _requestIdKey; - private readonly IHttpContextAccessor? _httpContextAccessor; - protected readonly CallerFactoryOptions? Options; - - public DefaultRequestMessage(IServiceProvider serviceProvider, - IOptions? options = null) - { - ServiceProvider = serviceProvider; - _httpContextAccessor = ServiceProvider.GetService(); - Options = options?.Value; - _requestIdKey = Options?.RequestIdKey ?? "Masa-Request-Id"; - } - - protected virtual void TrySetRequestId(HttpRequestMessage requestMessage) - { - var httpContext = _httpContextAccessor?.HttpContext; - if (httpContext == null) - return; - - if (!httpContext.Request.Headers.TryGetValue(_requestIdKey, out var requestId)) - requestId = Guid.NewGuid().ToString(); - - if (requestMessage.Headers.All(h => h.Key != _requestIdKey)) - requestMessage.Headers.Add(_requestIdKey, requestId.ToString()); - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs deleted file mode 100644 index 904125f57..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller; - -public class DefaultResponseMessage : IResponseMessage -{ - private readonly ILogger? _logger; - private readonly CallerFactoryOptions _options; - - public DefaultResponseMessage(IOptions options, ILogger? logger = null) - { - _options = options.Value; - _logger = logger; - } - - public async Task ProcessResponseAsync(HttpResponseMessage response, - CancellationToken cancellationToken = default) - { - if (response.IsSuccessStatusCode) - { - switch (response.StatusCode) - { - case HttpStatusCode.Accepted: - case HttpStatusCode.NoContent: - return default; - case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: - throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); - default: - if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - if (string.IsNullOrEmpty(content)) - return (TResponse)(object?)null!; - - return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); - } - if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - if (string.IsNullOrEmpty(content)) - return (TResponse)(object?)null!; - - return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); - } - if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - return (TResponse)Convert.ChangeType(content, typeof(TResponse)); - } - try - { - return await response.Content.ReadFromJsonAsync(_options.JsonSerializerOptions, cancellationToken) - ?? throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); - } - catch (Exception exception) - { - _logger?.LogWarning(exception, exception.Message); - ExceptionDispatchInfo.Capture(exception).Throw(); - return default; //This will never be executed, the previous line has already thrown an exception - } - } - } - - await ProcessResponseExceptionAsync(response, cancellationToken); - return default; //never executed - } - - public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) - { - if (response.IsSuccessStatusCode) - { - switch (response.StatusCode) - { - case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: - throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); - default: - return; - } - } - - await ProcessResponseExceptionAsync(response, cancellationToken); - } - - public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) - { - if (response.Content.Headers.ContentLength is > 0) - throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); - - throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs deleted file mode 100644 index 5d2d6e3ec..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller; - -public class DefaultTypeConvertor : ITypeConvertor -{ - private static readonly ConcurrentDictionary> Dictionary = new(); - - protected readonly List NotNeedSerializeTypes = new() - { - typeof(String), - typeof(Guid), - typeof(DateTime), - typeof(Decimal), - typeof(Guid?), - typeof(DateTime?), - typeof(Decimal?) - }; - - /// - /// Convert custom object to dictionary - /// - /// - /// Support classes, anonymous objects - /// - [Obsolete("Use ConvertToKeyValuePairs instead")] - public Dictionary ConvertToDictionary(TRequest request) where TRequest : class - => new(ConvertToKeyValuePairs(request)); - - /// - /// Convert custom object to dictionary - /// - /// - /// Support classes, anonymous objects - /// - public IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class - { - if (request.Equals(null)) - return Array.Empty>(); - - if (request is Dictionary response) - return response; - - if (request is IEnumerable> keyValuePairs) - return keyValuePairs; - - var requestType = request.GetType(); - if (!Dictionary.TryGetValue(requestType, out List? members)) - { - members = GetMembers(request.GetType().GetProperties()); - Dictionary.TryAdd(requestType, members); - } - List> data = new List>(); - foreach (var member in members) - { - if (member.TryGetValue(request, out string value)) - data.Add(new KeyValuePair(member.Name, value)); - } - return data; - } - - private List GetMembers(PropertyInfo[] properties) - { - List members = new(); - foreach (var property in properties) - { - if (IsSkip(property)) continue; - - string name = GetPropertyName(property); - - members.Add(new PropertyInfoMember(property, name, IsNeedSerialize(property))); - } - return members; - } - - protected bool IsSkip(PropertyInfo property) - => !property.CanRead || - !property.PropertyType.IsPublic || - property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonIgnoreAttribute)); - - protected string GetPropertyName(PropertyInfo property) - { - if (property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))) - { - var customAttributeData = - property.CustomAttributes.FirstOrDefault(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))!; - var customAttribute = customAttributeData.ConstructorArguments.FirstOrDefault(); - return customAttribute.Value?.ToString() ?? - throw new NotSupportedException( - $"Parameter name: {property.Name}, But the JsonPropertyNameAttribute assignment name is empty"); - } - return property.Name; - } - - protected bool IsNeedSerialize(PropertyInfo property) - => !property.PropertyType.IsPrimitive && !NotNeedSerializeTypes.Contains(property.PropertyType); -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs deleted file mode 100644 index 0cec9b42a..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Internal; - -/// -/// Caller dependency orchestration -/// -internal static class CallerDependExtensions -{ - /// - /// Caller dependency orchestration - /// - /// All Callers that inherit CallerBase - /// - /// - public static List Arrangement(this List callerTypes) - { - List types = GetCallerByNotDependCaller(callerTypes); - if (types.Count == 0) - throw new UserFriendlyException(ErrorMessages.CIRCULAR_DEPENDENCY); - - return callerTypes.CallersArrangement(types, 1); - } - - private static List CallersArrangement(this List allTypes, List existTypes, int executeTimes) - { - List types = existTypes; - var dependCallerTypes = allTypes.Except(existTypes); - foreach (var type in dependCallerTypes) - { - var constructorInfo = type.GetConstructors().MaxBy(con => con.GetParameters().Length)!; - bool isExist = true; - foreach (var parameter in constructorInfo.GetParameters()) - { - var parameterType = parameter.ParameterType; - if (typeof(CallerBase).IsAssignableFrom(parameterType) && !types.Contains(parameterType)) - { - isExist = false; - } - } - if (isExist) - types.Add(type); - } - - if (types.Count != allTypes.Count) - { - if (executeTimes >= allTypes.Count) - throw new UserFriendlyException(ErrorMessages.CIRCULAR_DEPENDENCY); - - return CallersArrangement(allTypes, types, ++executeTimes); - } - return types; - } - - /// - /// Get a Caller object that does not depend on other Callers - /// - /// - /// - private static List GetCallerByNotDependCaller(this List callerTypes) - { - List types = new(); - callerTypes.ForEach(type => - { - if (!type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).IsDependCaller()) - types.Add(type); - }); - return types; - } - - private static bool IsDependCaller(this ConstructorInfo[] constructorInfos) - { - var constructorInfo = constructorInfos.MaxBy(constructorInfo => constructorInfo.GetParameters().Length)!; - return constructorInfo.IsDependCaller(); - } - - private static bool IsDependCaller(this ConstructorInfo constructorInfo) - { - foreach (var parameter in constructorInfo.GetParameters()) - { - if (typeof(CallerBase).IsAssignableFrom(parameter.ParameterType)) - { - return true; - } - } - return false; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs deleted file mode 100644 index 37f82bb2b..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Internal; - -internal class ErrorMessages -{ - public const string CIRCULAR_DEPENDENCY = "Caller has a circular dependency, please check the constructor of Caller"; -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs deleted file mode 100644 index e7f3ecb7f..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Internal.Options; - -internal class PropertyInfoMember -{ - public PropertyInfo Property { get; } - - public string Name { get; } - - public bool NeedSerialize { get; } - - public PropertyInfoMember(PropertyInfo property, string name, bool needSerialize) - { - Property = property; - Name = name; - NeedSerialize = needSerialize; - } - - public bool TryGetValue(TRequest data, out string value) where TRequest : class - { - value = string.Empty; - var propertyValue = Property.GetValue(data); - if (propertyValue == null || (!NeedSerialize && propertyValue.ToString() == null)) - return false; - - value = !NeedSerialize ? propertyValue.ToString()! : JsonSerializer.Serialize(propertyValue); - return true; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs deleted file mode 100644 index 20f857473..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Internal; - -/// -/// Temporary use, later versions will be removed -/// -internal class XmlUtils -{ - public static string Serializer(object data) - { - MemoryStream ms = new MemoryStream(); - StreamWriter sw = new StreamWriter(ms, Encoding.UTF8); - XmlSerializer xz = new XmlSerializer(data.GetType()); - xz.Serialize(sw, data); - return Encoding.UTF8.GetString(ms.ToArray()); - } - - public static T Deserialize(string xml) - { - XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); - using MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml.ToCharArray())); - return (T)xmlSerializer.Deserialize(stream)!; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/JsonRequestMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/JsonRequestMessage.cs deleted file mode 100644 index 96545ebdf..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/JsonRequestMessage.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller; - -public class JsonRequestMessage : DefaultRequestMessage, IRequestMessage -{ - private readonly JsonSerializerOptions? _jsonSerializerOptions; - - public JsonRequestMessage( - IServiceProvider serviceProvider, - IOptions? options = null) - : base(serviceProvider, options) - { - _jsonSerializerOptions = Options?.JsonSerializerOptions; - } - - public virtual Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) - { - TrySetRequestId(requestMessage); - return Task.FromResult(requestMessage); - } - - public virtual async Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) - { - requestMessage = await ProcessHttpRequestMessageAsync(requestMessage); - requestMessage.Content = JsonContent.Create(data, options: _jsonSerializerOptions); - return requestMessage; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj deleted file mode 100644 index 317040b15..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.md deleted file mode 100644 index 720e5df92..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.md +++ /dev/null @@ -1,36 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Service.Caller - -Masa.Contrib.Service.Caller is the basic class library of Caller, which provides the abstraction of the following capabilities - -* `ICallerFactory`: Factory for creating `Caller` (Singleton) -* `ICaller`: Provides `Post`, `Delete`, `Patch`, `Put`, `Get`, `Send` capabilities (Scoped) -* `IRequestMessage`: Provides the ability to process request data (default implementation [`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) -* `IResponseMessage`: Provides the ability to handle response data (default implementation [`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) -* `ITypeConvertor`: Provides the ability to convert types, support for `Get` requests of `ICaller` (Singleton) - -## Summarize - -`Masa.Contrib.Service.Caller` is the basic class library of Caller, but it cannot be used alone. Currently, Caller supports two implementations: - -* Implementation based on HttpClient: [Masa.Contrib.Service.Caller.HttpClient](../Masa.Contrib.Service.Caller.HttpClient/README.md) -* Implementation based on DaprClient: [Masa.Contrib.Service.Caller.DaprClient](../Masa.Contrib.Service.Caller.DaprClient/README.md) - -> Q: What should I do if the callee uses xml instead of json? -> -> A: Rewrite IRequestMessage and add the custom RequestMessage to the IServiceCollection before calling AddCaller - - ```` C# - services.AddSingleton(); - services.AddCaller(); - ```` - -> Q: If you want to handle custom StatusCode and throw exception information -> -> A: Rewrite IResponseMessage, add custom ResponseMessage to IServiceCollection before calling AddCaller - - ```` C# - services.AddSingleton(); - services.AddCaller(); - ```` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.zh-CN.md b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.zh-CN.md deleted file mode 100644 index 3c0768b5f..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/README.zh-CN.md +++ /dev/null @@ -1,36 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Service.Caller - -Masa.Contrib.Service.Caller是Caller的基础类库,提供了以下能力的抽象 - -* `ICallerFactory`: 工厂,用于创建`Caller` (Singleton) -* `ICaller`: 提供`Post`、`Delete`、`Patch`、`Put`、`Get`、`Send`的能力 (Scoped) -* `IRequestMessage`: 提供对请求数据处理的能力 (默认实现[`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) -* `IResponseMessage`: 提供对响应数据处理的能力 (默认实现[`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) -* `ITypeConvertor`: 提供类型转换的能力,为`ICaller`的`Get`请求支撑 (Singleton) - -## 总结 - -`Masa.Contrib.Service.Caller`是Caller的基础类库,但不能单独使用,目前Caller支持了两种实现方式: - -* 基于HttpClient的实现: [Masa.Contrib.Service.Caller.HttpClient](../Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md) -* 基于DaprClient的实现: [Masa.Contrib.Service.Caller.DaprClient](../Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md) - -> Q: 如果被调用方使用的是数据格式为xml,而不是json,我应该怎么做? -> -> A: 重写IRequestMessage,在调用AddCaller之前先将自定义的RequestMessage添加到IServiceCollection中 - - ``` C# - services.AddSingleton(); - services.AddCaller(); - ``` - -> Q: 如果希望处理自定义的StatusCode,并抛出异常信息 -> -> A: 重写IResponseMessage,在调用AddCaller之前先将自定义的ResponseMessage添加到IServiceCollection中 - - ``` C# - services.AddSingleton(); - services.AddCaller(); - ``` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs deleted file mode 100644 index a3d5a051d..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddCaller(this IServiceCollection services) - => services.AddCaller(AppDomain.CurrentDomain.GetAssemblies()); - - public static IServiceCollection AddCaller(this IServiceCollection services, params Assembly[] assemblies) - => services.AddCaller(options => options.Assemblies = assemblies); - - private static IServiceCollection AddCaller(this IServiceCollection services, - ServiceLifetime lifetime = ServiceLifetime.Scoped, - params Assembly[] assemblies) - => services.AddCaller(options => - { - options.Assemblies = assemblies; - options.CallerLifetime = lifetime; - }); - - public static IServiceCollection AddCaller(this IServiceCollection services, Action options) - { - CallerOptions callerOption = new CallerOptions(services); - options.Invoke(callerOption); - - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddScoped(serviceProvider => serviceProvider.GetRequiredService().Create()); - - services.TryAddSingleton(); - services.AddAutomaticCaller(callerOption); - TryOrUpdate(services, callerOption); - return services; - } - - private static void AddAutomaticCaller(this IServiceCollection services, CallerOptions callerOptions) - { - var callerTypes = callerOptions.Assemblies.SelectMany(x => x.GetTypes()) - .Where(type => typeof(CallerBase).IsAssignableFrom(type) && !type.IsAbstract).ToList(); - - callerTypes = callerTypes.Except(services.Select(d => d.ServiceType)).ToList(); - - if (callerTypes.Count == 0) - return; - - callerTypes.Arrangement().ForEach(type => - { - ServiceDescriptor serviceDescriptor = new ServiceDescriptor(type, serviceProvider => - { - var constructorInfo = type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) - .MaxBy(constructor => constructor.GetParameters().Length)!; - List parameters = new(); - foreach (var parameter in constructorInfo.GetParameters()) - { - parameters.Add(serviceProvider.GetRequiredService(parameter.ParameterType)); - } - var callerBase = (constructorInfo.Invoke(parameters.ToArray()) as CallerBase)!; - callerBase.SetCallerOptions(callerOptions, type.FullName ?? type.Name); - return callerBase; - }, callerOptions.CallerLifetime); - services.TryAdd(serviceDescriptor); - }); - - var serviceProvider = services.BuildServiceProvider(); - callerTypes.ForEach(type => - { - var callerBase = (CallerBase)serviceProvider.GetRequiredService(type); - callerBase.UseCallerExtension(); - }); - } - - private static IServiceCollection TryOrUpdate(this IServiceCollection services, CallerOptions options) - { - services.Configure(callerOptions => - { - options.Callers.ForEach(caller => - { - if (callerOptions.Callers.Any(relation => relation.Name == caller.Name)) - throw new ArgumentException($"The caller name already exists, please change the name, the repeat name is [{caller.Name}]"); - - if (callerOptions.Callers.Any(relation => relation.IsDefault && caller.IsDefault)) - { - string errorCallerNames = string.Join("、", callerOptions.Callers - .Where(relation => relation.IsDefault) - .Select(relation => relation.Name) - .Concat(options.Callers.Where(relation => relation.IsDefault).Select(relation => relation.Name)) - .Distinct()); - throw new ArgumentException( - $"There can only be at most one default Caller Provider, and now the following Caller Providers are found to be default: {errorCallerNames}"); - } - - callerOptions.Callers.Add(caller); - }); - - if (callerOptions.JsonSerializerOptions == null && options.JsonSerializerOptions != null) - callerOptions.JsonSerializerOptions = options.JsonSerializerOptions; - - if (callerOptions.RequestIdKey != null && options.RequestIdKey != null) - callerOptions.RequestIdKey = options.RequestIdKey; - }); - - return services; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/XmlRequestMessage.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/XmlRequestMessage.cs deleted file mode 100644 index 5790aa200..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/XmlRequestMessage.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller; - -public class XmlRequestMessage : DefaultRequestMessage, IRequestMessage -{ - public XmlRequestMessage( - IServiceProvider serviceProvider, - IOptions? options = null) - : base(serviceProvider, options) - { - } - - public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) - { - TrySetRequestId(requestMessage); - return Task.FromResult(requestMessage); - } - - public async Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) - { - requestMessage = await ProcessHttpRequestMessageAsync(requestMessage); - requestMessage.Content = new StringContent(XmlUtils.Serializer(data!)); - return requestMessage; - } -} diff --git a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/_Imports.cs b/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/_Imports.cs deleted file mode 100644 index 8b5980904..000000000 --- a/src/Contrib/Service/Caller/src/Masa.Contrib.Service.Caller/_Imports.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.Service.Caller.Internal; -global using Masa.Contrib.Service.Caller.Internal.Options; -global using Masa.Utils.Exceptions; -global using Microsoft.AspNetCore.Http; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using System.Collections.Concurrent; -global using System.Net; -global using System.Net.Http.Json; -global using System.Reflection; -global using System.Runtime.ExceptionServices; -global using System.Text.Json; -global using System.Text.Json.Serialization; -global using System.Text; -global using System.Xml.Serialization; diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs deleted file mode 100644 index 621ac7bfd..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests; - -[TestClass] -public class AutomaticCallerTest -{ - private WebApplicationBuilder _builder = default!; - - [TestInitialize] - public void EdgeDriverInitialize() - { - _builder = WebApplication.CreateBuilder(); - } - - [TestMethod] - public async Task TestGetAsync() - { - _builder.Services.AddCaller(); - _ = _builder.Build(); - var serviceProvider = _builder.Services.BuildServiceProvider(); - var githubCaller = serviceProvider.GetRequiredService(); - Assert.IsTrue(await githubCaller.GetAsync()); - } - - [TestMethod] - public void TestDaprCallerReturnCallerProviderIsNotNull() - { - _builder.Services.AddCaller(); - _ = _builder.Build(); - var serviceProvider = _builder.Services.BuildServiceProvider(); - var caller = serviceProvider.GetRequiredService(); - Assert.IsTrue(caller.CallerProviderIsNotNull()); - } - - [TestMethod] - public void TestCustomDaprBaseReturnAppIdIsEqualUserService() - { - _builder.Services.AddCaller(); - _ = _builder.Build(); - var serviceProvider = _builder.Services.BuildServiceProvider(); - var roleCaller = serviceProvider.GetRequiredService(); - var userCaller = serviceProvider.GetRequiredService(); - Assert.IsTrue(roleCaller.GetAppId() == "User-Service" && userCaller.GetAppId() == "User-Service"); - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs deleted file mode 100644 index d06e3220e..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests; - -[TestClass] -public class CallerTest -{ - [TestMethod] - public void TestCallerProviderServiceLifetime() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "http"; - clientBuilder.IsDefault = true; - clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - var callerProvider1 = serviceProvider.GetRequiredService(); - var callerProvider2 = serviceProvider.GetRequiredService(); - Assert.IsTrue(callerProvider1 == callerProvider2); - } - - [TestMethod] - public void TestCaller() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "http"; - clientBuilder.IsDefault = true; - clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; - }); - opt.UseDapr(clientBuilder => - { - clientBuilder.Name = "dapr"; - clientBuilder.IsDefault = false; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - var caller = serviceProvider.GetRequiredService(); - Assert.IsNotNull(caller); - - caller = serviceProvider.GetRequiredService().Create(); - var daprCaller = serviceProvider.GetRequiredService().Create("dapr"); - var httpCaller = serviceProvider.GetRequiredService().Create("http"); - - Assert.IsTrue(caller.GetType().FullName != daprCaller.GetType().FullName); - Assert.IsTrue(caller.GetType().FullName == httpCaller.GetType().FullName); - } - - [TestMethod] - public void TestMultiDefaultCaller() - { - IServiceCollection services = new ServiceCollection(); - - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - opt.UseHttpClient(builder => - { - builder.Name = "gitee"; - builder.BaseAddress = "https://gitee.com/masastack"; - builder.IsDefault = true; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - Assert.ThrowsException(() => - { - var optionsFactory = serviceProvider.GetRequiredService>(); - optionsFactory.Create(Options.DefaultName); - }); - } - - [TestMethod] - public void TestMultiDefaultCaller2() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "gitee"; - builder.BaseAddress = "https://gitee.com/masastack"; - builder.IsDefault = true; - }); - }); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - Assert.ThrowsException(() => - { - var optionsFactory = serviceProvider.GetRequiredService>(); - optionsFactory.Create(Options.DefaultName); - }); - } - - [TestMethod] - public void TestRepeatCallerName() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestRepeatCallerName2() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - Assert.ThrowsException(() => - { - var optionsFactory = serviceProvider.GetRequiredService>(); - optionsFactory.Create(Options.DefaultName); - }); - } - - [TestMethod] - public void TestRepeatCallerName3() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = typeof(GithubCaller).FullName!; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestAddMultiCaller() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "masastack"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "masastack2"; - builder.BaseAddress = "https://github.com/masastack"; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetRequiredService().Create("masastack")); - Assert.IsNotNull(serviceProvider.GetRequiredService().Create("masastack2")); - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs deleted file mode 100644 index 81e897073..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; - -public class DaprCaller : DaprCallerBase -{ - public DaprCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - AppId = "DaprCaller"; - } - - protected override string AppId { get; set; } - - public bool CallerProviderIsNotNull() => Caller != null; -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs deleted file mode 100644 index be4b15673..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; - -public class GithubCaller : HttpClientCallerBase -{ - public GithubCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - BaseAddress = "https://github.com/masastack"; - } - - protected override string BaseAddress { get; set; } - - public async Task GetAsync() - { - var res = await Caller.GetAsync(""); - return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs deleted file mode 100644 index be679e60c..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; - -public class RoleCaller: UserDaprCallerBase -{ - public RoleCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs deleted file mode 100644 index 6bfbbd7ae..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; - -public class UserCaller : UserDaprCallerBase -{ - public UserCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs deleted file mode 100644 index 9bb72570a..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; - -public abstract class UserDaprCallerBase : DaprCallerBase -{ - protected override string AppId { get; set; } = "User-Service"; - - protected UserDaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public string GetAppId() => AppId; - - protected override DefaultDaprClientBuilder UseDapr() - { - return base.UseDapr().AddHttpRequestMessage(); - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs deleted file mode 100644 index 256586aa2..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests; - -public class DefaultDaprRequestMessage : IDaprRequestMessage -{ - public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) - { - requestMessage.Headers.Add("test", "test"); - return Task.FromResult(requestMessage); - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj deleted file mode 100644 index bb7511a63..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs deleted file mode 100644 index ffe46821b..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; -global using Masa.Contrib.Service.Caller.DaprClient; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System.Net; -global using DaprCaller = Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers.DaprCaller; diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CallerTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CallerTest.cs deleted file mode 100644 index 17a01e538..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CallerTest.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests; - -[TestClass] -public class CallerTest -{ - private WebApplicationBuilder _builder = default!; - - [TestInitialize] - public void EdgeDriverInitialize() - { - _builder = WebApplication.CreateBuilder(); - } - - [TestMethod] - public async Task TestGetAsync() - { - _builder.Services.AddCaller(callerOptions => - { - callerOptions.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Configure = builder => builder.Timeout = TimeSpan.FromSeconds(3); - httpClientBuilder.BaseAddress = "https://github.com/masastack"; - }); - }); - _ = _builder.Build(); - var serviceProvider = _builder.Services.BuildServiceProvider(); - var githubCaller = serviceProvider.GetRequiredService(); - Assert.IsTrue(await GetAsync(githubCaller)); - } - - private async Task GetAsync(ICaller caller) - { - var res = await caller.GetAsync(""); - return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; - } - - [TestMethod] - public void TestConvertToDictionaryByDynamic() - { - var provider = new DefaultTypeConvertor(); - var dictionary = new Dictionary - { - { "account", "jim" }, - { "age", "18" } - }; - var request = new - { - account = "jim", - age = 18 - }; - var result = provider.ConvertToDictionary(request); - Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); - } - - [TestMethod] - public void TestConvertToDictionaryByObject() - { - var provider = new DefaultTypeConvertor(); - var query = new UserListQuery("Jim"); - var dictionary = new Dictionary - { - { "name", query.Name } - }; - var result = provider.ConvertToDictionary(query); - Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); - } - - [TestMethod] - public void TestConvertToDictionaryByObject2() - { - var provider = new DefaultTypeConvertor(); - var query = new UserDetailQuery("Jim", "Music", "Game"); - var result = provider.ConvertToDictionary(query); - Assert.IsTrue(result.Count == 2); - Assert.IsTrue(result["name"] == query.Name); - Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() - { - "Music", - "Game" - })); - } - - [TestMethod] - public void TestConvertToDictionaryByObject3() - { - var provider = new DefaultTypeConvertor(); - - List tags = null!; - var query = new UserDetailQuery("Jim", tags); - var result = provider.ConvertToDictionary(query); - - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["name"] == query.Name); - } - - [TestMethod] - public void TestConvertToDictionaryByObject4() - { - var provider = new DefaultTypeConvertor(); - var query = new UserDetailQuery(null!, "Music", "Game"); - var result = provider.ConvertToDictionary(query); - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() - { - "Music", - "Game" - })); - } - - [TestMethod] - public void TestConvertToDictionaryByObject5() - { - var provider = new DefaultTypeConvertor(); - var dic = new Dictionary() - { - { "Account", "Jim" } - }; - var result = provider.ConvertToDictionary(dic); - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["Account"] == "Jim"); - } - - [TestMethod] - public void TestConvertToDictionaryByObject6() - { - var provider = new DefaultTypeConvertor(); - var dic = new List>() - { - new("Account", "Jim") - }; - var result = provider.ConvertToDictionary(dic); - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["Account"] == "Jim"); - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs deleted file mode 100644 index aeb1a890f..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests; - -public class CustomHttpClientCaller : HttpClientCaller -{ - public CustomHttpClientCaller(IServiceProvider serviceProvider, string name, string baseApi) - : base(serviceProvider, name, baseApi) - { - } - - public string GetResult(string? methodName) => base.GetRequestUri(methodName); -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs deleted file mode 100644 index 50876a30a..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests; - -public class DefaultXmlResponseMessage : IResponseMessage -{ - private readonly ILogger? _logger; - - public DefaultXmlResponseMessage(ILogger? logger = null) - { - _logger = logger; - } - - public async Task ProcessResponseAsync(HttpResponseMessage response, - CancellationToken cancellationToken = default) - { - if (response.IsSuccessStatusCode) - { - switch (response.StatusCode) - { - case HttpStatusCode.Accepted: - case HttpStatusCode.NoContent: - return default; - case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: - throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); - default: - if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - if (string.IsNullOrEmpty(content)) - return (TResponse)(object?)null!; - - return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); - } - if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - if (string.IsNullOrEmpty(content)) - return (TResponse)(object?)null!; - - return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); - } - if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - return (TResponse)Convert.ChangeType(content, typeof(TResponse)); - } - try - { - var res = await response.Content.ReadAsStringAsync(cancellationToken); - return XmlUtils.Deserialize(res) ?? - throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); - } - catch (Exception exception) - { - _logger?.LogWarning(exception, exception.Message); - ExceptionDispatchInfo.Capture(exception).Throw(); - return default; //This will never be executed, the previous line has already thrown an exception - } - } - } - - await ProcessResponseExceptionAsync(response, cancellationToken); - return default; //never executed - } - - public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) - { - if (response.IsSuccessStatusCode) - { - switch (response.StatusCode) - { - case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: - throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); - default: - return; - } - } - - await ProcessResponseExceptionAsync(response, cancellationToken); - } - - public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) - { - if (response.Content.Headers.ContentLength is > 0) - throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); - - throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs deleted file mode 100644 index e28b17156..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests; - -[TestClass] -public class HttpClientCallerTest -{ - [DataTestMethod] - [DataRow("https://github.com/", "/check/healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com", "/check/healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com", "check/healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com/check", "healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com/check/", "healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com/check/", "/healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com/check/", "/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("https://github.com/check/", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("https://github.com/check", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("https://github.com", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("https://github.com", "", "")] - [DataRow("http://github.com", "", "")] - [DataRow("/v1/check", "healthy", "/v1/check/healthy")] - [DataRow("/v1/check/", "healthy", "/v1/check/healthy")] - [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] - [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] - [DataRow("/v1/check/", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("", "healthy", "healthy")] - [DataRow("", "/healthy?id=1", "/healthy?id=1")] - public void TestGetRequestUri(string prefix, string methods, string result) - { - var services = new ServiceCollection(); - services.AddCaller(opt => opt.UseHttpClient()); - var serviceProvider = services.BuildServiceProvider(); - var caller = new CustomHttpClientCaller(serviceProvider, string.Empty, prefix); - Assert.IsTrue(caller.GetResult(methods) == result); - } - - [TestMethod] - public async Task TestRequestDataIsXmlAsync() - { - var services = new ServiceCollection(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - Mock httpClientFactory = new(); - var handlerMock = new Mock(); - var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) - { - BaseAddress = new Uri("http://localhost:5000") - }; - var response = new BaseResponse("success"); - handlerMock - .Protected() - .Setup>( - "SendAsync", - ItExpr.IsAny(), - ItExpr.IsAny() - ) - .ReturnsAsync(new HttpResponseMessage - { - StatusCode = HttpStatusCode.OK, - Content = new StringContent(XmlUtils.Serializer(response)) - }) - .Verifiable(); - - httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); - services.AddSingleton(httpClientFactory.Object); - var serviceProvider = services.BuildServiceProvider(); - string name = ""; - string prefix = ""; - var caller = new HttpClientCaller(serviceProvider, name, prefix); - - var res = await caller.PostAsync("Hello", new RegisterUser("Jim", "123456")); - Assert.IsNotNull(res); - Assert.IsTrue(res.Code == response.Code); - } - - [TestMethod] - public async Task TestRequestMessageReturnOnceAsync() - { - var services = new ServiceCollection(); - RegisterUser registerUser = new RegisterUser("Jim", "123456"); - - services.AddSingleton(); - Mock requestMessage = new(); - requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny())) - .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello")).Verifiable(); - requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello") - { - Content = JsonContent.Create(registerUser) - }).Verifiable(); - services.AddSingleton(_ => requestMessage.Object); - services.AddSingleton(); - Mock httpClientFactory = new(); - var handlerMock = new Mock(); - var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) - { - BaseAddress = new Uri("http://localhost:5000") - }; - var response = new BaseResponse("success"); - handlerMock - .Protected() - .Setup>( - "SendAsync", - ItExpr.IsAny(), - ItExpr.IsAny() - ) - .ReturnsAsync(new HttpResponseMessage - { - StatusCode = HttpStatusCode.OK, - Content = new StringContent(XmlUtils.Serializer(response)) - }) - .Verifiable(); - - httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); - services.AddSingleton(httpClientFactory.Object); - var serviceProvider = services.BuildServiceProvider(); - string name = ""; - string prefix = ""; - var caller = new HttpClientCaller(serviceProvider, name, prefix); - - var res = await caller.PostAsync("Hello", registerUser); - Assert.IsNotNull(res); - Assert.IsTrue(res.Code == response.Code); - requestMessage.Verify(r => r.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny()), Times.Once); - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj deleted file mode 100644 index 3c585031f..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs deleted file mode 100644 index e4bf3d726..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests.Queries; - -public class UserDetailQuery -{ - public Guid? Id { get; set; } - - [JsonPropertyName("name")] - public string? Name { get; set; } - - [JsonIgnore] - public int Age { get; set; } - - public DateTime? DelTime { get; set; } - - public List? Tags { get; set; } - - public UserDetailQuery() - { - this.Id = Guid.NewGuid(); - } - - public UserDetailQuery(string name, params string[] tags) : this(name, tags.ToList()) - { - } - - public UserDetailQuery(string name, List tags) - { - Name = name; - Tags = tags; - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs deleted file mode 100644 index 1d10b319d..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests.Queries; - -public class UserListQuery -{ - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonIgnore] - public int Age { get; set; } - - public UserListQuery(string name) - { - Name = name; - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs deleted file mode 100644 index c2797a77d..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests.Requesties; - -[XmlRoot] -public class RegisterUser -{ - [XmlElement] - public string Account { get; set; } = default!; - - [XmlElement] - public string Password { get; set; } = default!; - - public RegisterUser() { } - - public RegisterUser(string account, string password) : this() - { - Account = account; - Password = password; - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs deleted file mode 100644 index 9b51b19b2..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests.Response; - -[Serializable] -[XmlRoot] -public class BaseResponse -{ - [XmlElement] - public string Code { get; set; } = default!; - - public BaseResponse() { } - - public BaseResponse(string code) { Code = code; } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs deleted file mode 100644 index 8260181d5..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests; - -[TestClass] -public class TypeConvertTest -{ - [TestMethod] - public void TestConvertToKeyValuePairs() - { - var defaultTypeConvertProvider = new DefaultTypeConvertor(); - var result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new - { - id = 1, - name = "masa" - }).ToList(); - Assert.AreEqual(2, result.Count()); - Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "1")); - Assert.IsTrue(result.Any(x => x.Key == "name" && x.Value == "masa")); - - result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new - { - id = 2, - text = "masa" - }).ToList(); - Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "2")); - Assert.IsTrue(result.Any(x => x.Key == "text" && x.Value == "masa")); - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs deleted file mode 100644 index 497e57960..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.Caller.Tests; - -/// -/// Temporary use, later versions will be removed -/// -internal class XmlUtils -{ - public static string Serializer(object data) - { - MemoryStream ms = new MemoryStream(); - StreamWriter sw = new StreamWriter(ms, Encoding.UTF8); - XmlSerializer xz = new XmlSerializer(data.GetType()); - xz.Serialize(sw, data); - return Encoding.UTF8.GetString(ms.ToArray()); - } - - public static T Deserialize(string xml) - { - XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); - using MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml.ToCharArray())); - return (T)xmlSerializer.Deserialize(stream)!; - } -} diff --git a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/_Imports.cs b/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/_Imports.cs deleted file mode 100644 index a406d75ab..000000000 --- a/src/Contrib/Service/Caller/test/Masa.Contrib.Service.Caller.Tests/_Imports.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Masa.Contrib.Service.Caller.Tests.Queries; -global using Masa.Contrib.Service.Caller.Tests.Requesties; -global using Masa.Contrib.Service.Caller.Tests.Response; -global using Masa.Utils.Exceptions; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using Moq.Protected; -global using System.Net; -global using System.Net.Http.Json; -global using System.Runtime.ExceptionServices; -global using System.Text; -global using System.Text.Json.Serialization; -global using System.Xml.Serialization; diff --git a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj deleted file mode 100644 index 17ff4dcd3..000000000 --- a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - - - - - - - - - - - - - diff --git a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.md b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.md deleted file mode 100644 index 08c62d7ce..000000000 --- a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.md +++ /dev/null @@ -1,53 +0,0 @@ -[中](README.zh-CN.md) | EN - -## MinimalAPI - -Original usage: - -```C# -var builder = WebApplication.CreateBuilder(args); -var app = builder.Build(); -app.MapGet("/api/v1/helloworld", ()=>"Hello World"); -app.Run(); -``` - -Example: - -```c# -Install-Package Masa.Contrib.Service.MinimalAPIs -``` - -1. Add MinimalAPI - -```c# -var builder = WebApplication.CreateBuilder(args); -var app = builder.Services - .AddServices(builder); -``` - -2. Custom Service and inherit ServiceBase - -```c# -public class IntegrationEventService : ServiceBase -{ - public IntegrationEventService(IServiceCollection services) : base(services) - { - App.MapGet("/api/v1/payment/HelloWorld", HelloWorld); - } - - public string HelloWorld() - { - return "Hello World"; - } -} -``` - -> Tip: The service that inherits ServiceBase is registered in singleton mode, if you need to obtain it from DI - -```C# -public async Task DeleteBasketByIdAsync(string id, [FromServices] IBasketRepository repository) -{ - await repository.DeleteBasketAsync(id); -} -``` - diff --git a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md deleted file mode 100644 index 294d0cab0..000000000 --- a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md +++ /dev/null @@ -1,53 +0,0 @@ -中 | [EN](README.md) - -## MinimalAPI - -原始用法: - -```C# -var builder = WebApplication.CreateBuilder(args); -var app = builder.Build(); -app.MapGet("/api/v1/helloworld", ()=>"Hello World"); -app.Run(); -``` - -用例: - -```c# -Install-Package Masa.Contrib.Service.MinimalAPIs -``` - -1. 添加MinimalAPI - -```c# -var builder = WebApplication.CreateBuilder(args); -var app = builder.Services - .AddServices(builder); -``` - -2. 自定义Service并继承ServiceBase,如: - -```c# -public class IntegrationEventService : ServiceBase -{ - public IntegrationEventService(IServiceCollection services) : base(services) - { - App.MapGet("/api/v1/payment/HelloWorld", HelloWorld); - } - - public string HelloWorld() - { - return "Hello World"; - } -} -``` - -> 提示:继承ServiceBase的服务为单例模式注册,如果需要从DI获取获取 - -```C# -public async Task DeleteBasketByIdAsync(string id, [FromServices] IBasketRepository repository) -{ - await repository.DeleteBasketAsync(id); -} -``` - diff --git a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs deleted file mode 100644 index c60b80030..000000000 --- a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.MinimalAPIs; - -public abstract class ServiceBase : IService -{ - private ServiceProvider _serviceProvider = default!; - - public WebApplication App => _serviceProvider.GetRequiredService(); - - public string BaseUri { get; } - - public IServiceCollection Services { get; protected set; } - - public ServiceBase(IServiceCollection services) - { - Services = services; - _serviceProvider = services.BuildServiceProvider(); - } - - public ServiceBase(IServiceCollection services, string baseUri) - { - BaseUri = baseUri; - Services = services; - _serviceProvider = services.BuildServiceProvider(); - } - - public TService? GetService() => _serviceProvider.GetService(); - - public TService GetRequiredService() - where TService : notnull - => Services.BuildServiceProvider().GetRequiredService(); - - #region Map GET,POST,PUT,DELETE - - /// - /// Adds a to the that matches HTTP GET requests - /// for the specified pattern, a combination of and or name. - /// - /// The delegate executed when the endpoint is matched. It's name is a part of pattern if is null. - /// The custom uri. It is a part of pattern if it is not null. - /// Determines whether to remove the string 'Async' at the end. - /// A that can be used to further customize the endpoint. - protected RouteHandlerBuilder MapGet(Delegate handler, string? customUri = null, bool trimEndAsync = true) - { - customUri ??= FormatAction(handler.Method.Name, trimEndAsync); - - var pattern = CombineUris(BaseUri, customUri); - - return App.MapGet(pattern, handler); - } - - /// - /// Adds a to the that matches HTTP POST requests - /// for the specified pattern, a combination of and or name. - /// - /// The delegate executed when the endpoint is matched. It's name is a part of pattern if is null. - /// The custom uri. It is a part of pattern if it is not null. - /// Determines whether to remove the string 'Async' at the end. - /// A that can be used to further customize the endpoint. - protected RouteHandlerBuilder MapPost(Delegate handler, string? customUri = null, bool trimEndAsync = true) - { - customUri ??= FormatAction(handler.Method.Name, trimEndAsync); - - var pattern = CombineUris(BaseUri, customUri); - - return App.MapPost(pattern, handler); - } - - /// - /// Adds a to the that matches HTTP PUT requests - /// for the specified pattern, a combination of and or name. - /// - /// The delegate executed when the endpoint is matched. It's name is a part of pattern if is null. - /// The custom uri. It is a part of pattern if it is not null. - /// Determines whether to remove the string 'Async' at the end. - /// A that can be used to further customize the endpoint. - protected RouteHandlerBuilder MapPut(Delegate handler, string? customUri = null, bool trimEndAsync = true) - { - customUri ??= FormatAction(handler.Method.Name, trimEndAsync); - - var pattern = CombineUris(BaseUri, customUri); - - return App.MapPut(pattern, handler); - } - - /// - /// Adds a to the that matches HTTP DELETE requests - /// for the specified pattern, a combination of and or name. - /// - /// The delegate executed when the endpoint is matched. It's name is a part of pattern if is null. - /// The custom uri. It is a part of pattern if it is not null. - /// Determines whether to remove the string 'Async' at the end. - /// A that can be used to further customize the endpoint. - protected RouteHandlerBuilder MapDelete(Delegate handler, string? customUri = null, bool trimEndAsync = true) - { - customUri ??= FormatAction(handler.Method.Name, trimEndAsync); - - var pattern = CombineUris(BaseUri, customUri); - - return App.MapDelete(pattern, handler); - } - - private static string FormatAction(string action, bool trimEndAsync) - { - if (trimEndAsync && action.EndsWith("Async")) - { - var i = action.LastIndexOf("Async", StringComparison.Ordinal); - action = action[..i]; - } - - return action; - } - - private static string CombineUris(params string[] uris) - { - return string.Join("/", uris.Select(u => u.Trim('/'))); - } - - #endregion -} diff --git a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs deleted file mode 100644 index 0469952dd..000000000 --- a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - /// - /// Add all classes that inherit from ServiceBase to Microsoft.Extensions.DependencyInjection.IServiceCollection - /// Notice: this method must be last call. - /// - /// The Microsoft.AspNetCore.Builder.WebApplicationBuilder. - /// - public static WebApplication AddServices(this WebApplicationBuilder builder) - => builder.Services.AddServices(builder); - - /// - /// Add all classes that inherit from ServiceBase to Microsoft.Extensions.DependencyInjection.IServiceCollection - /// Notice: this method must be last call. - /// - /// The Microsoft.Extensions.DependencyInjection.IServiceCollection to add the service to. - /// The Microsoft.AspNetCore.Builder.WebApplicationBuilder. - /// - public static WebApplication AddServices(this IServiceCollection services, WebApplicationBuilder builder) - { - if (services.All(service => service.ImplementationType != typeof(MinimalApisMarkerService))) - { - services.AddSingleton(); - services.TryAddScoped(sp => services); - - services.AddSingleton(new Lazy(() => builder.Build(), LazyThreadSafetyMode.ExecutionAndPublication)) - .AddTransient(serviceProvider => serviceProvider.GetRequiredService>().Value); - - services.AddServices(true, AppDomain.CurrentDomain.GetAssemblies()); - } - - var serviceProvider = services.BuildServiceProvider(); - return serviceProvider.GetRequiredService(); - } - - private class MinimalApisMarkerService - { - - } -} diff --git a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/_Imports.cs b/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/_Imports.cs deleted file mode 100644 index 2f5e7b791..000000000 --- a/src/Contrib/Service/MinimalAPIs/src/Masa.Contrib.Service.MinimalAPIs/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Service.MinimalAPIs; -global using Masa.Contrib.Service.MinimalAPIs; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.AspNetCore.Routing; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using System; -global using System.Linq; -global using System.Threading; diff --git a/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj b/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj deleted file mode 100644 index ae5e2d409..000000000 --- a/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - diff --git a/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs b/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs deleted file mode 100644 index da53223af..000000000 --- a/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.MinimalAPIs.Tests; - -[TestClass] -public class MinimalAPITest -{ - private WebApplicationBuilder _builder; - - [TestInitialize] - public void Initialize() - { - _builder = WebApplication.CreateBuilder(); - } - - [TestMethod] - public void TestAddMultiServices() - { - _builder.Services.AddServices(_builder); - _builder.Services.AddServices(_builder); - var servicePrvider = _builder.Services.BuildServiceProvider(); - Assert.IsTrue(servicePrvider.GetServices>().Count() == 1); - } - - [TestMethod] - public void AddService() - { - var app = _builder.AddServices(); - Assert.IsTrue(_builder.Services.Any(service => service.ServiceType == typeof(CustomService) && service.Lifetime == ServiceLifetime.Scoped)); - - var servicePrvider = _builder.Services.BuildServiceProvider(); - var customService = servicePrvider.GetService(); - Assert.IsNotNull(customService); - - Assert.ReferenceEquals(customService.App, app); - - Assert.ReferenceEquals(customService.Services, _builder.Services); - - Assert.IsNotNull(customService.GetRequiredService()); - Assert.IsNotNull(customService.GetService()); - - Assert.IsTrue(customService.Test() == 1); - - var newCustomService = servicePrvider.CreateScope().ServiceProvider.GetService(); - Assert.IsNotNull(newCustomService); - - Assert.IsTrue(newCustomService.Test() == 1); - - } -} diff --git a/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs b/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs deleted file mode 100644 index 6b5750293..000000000 --- a/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Service.MinimalAPIs.Tests.Services; - -public class CustomService : ServiceBase -{ - private int _times = 0; - - public CustomService(IServiceCollection services) : base(services) - { - _times++; - } - - public int Test() => _times; -} diff --git a/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs b/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs deleted file mode 100644 index 627c06045..000000000 --- a/src/Contrib/Service/MinimalAPIs/test/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Contrib.Service.MinimalAPIs.Tests.Services; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/AuthClient.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/AuthClient.cs deleted file mode 100644 index 8e068c579..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/AuthClient.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Auth.Service; - -namespace Masa.Contrib.StackSdks.Auth; - -public class AuthClient : IAuthClient -{ - public AuthClient(ICaller caller, IMultiEnvironmentUserContext userContext) - { - UserService = new UserService(caller, userContext); - SubjectService = new SubjectService(caller); - TeamService = new TeamService(caller, userContext); - ProjectService = new ProjectService(caller, userContext); - PermissionService = new PermissionService(caller, userContext); - } - - public IUserService UserService { get; } - - public ISubjectService SubjectService { get; } - - public ITeamService TeamService { get; } - - public IPermissionService PermissionService { get; } - - public IProjectService ProjectService { get; } -} - diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Constants.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Constants.cs deleted file mode 100644 index 6ccb1b334..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Constants.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Auth; - -internal class Constants -{ - public const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.auth"; - - public const string ENVIRONMENT_KEY = "env_key"; -} - diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs deleted file mode 100644 index 16bcddfe1..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Auth; - -public class EnvironmentProvider : IEnvironmentProvider -{ - readonly IMultiEnvironmentUserContext _multiEnvironmentUserContext; - - public EnvironmentProvider(IMultiEnvironmentUserContext multiEnvironmentUserContext) - { - _multiEnvironmentUserContext = multiEnvironmentUserContext; - } - - public string GetEnvironment() - { - return _multiEnvironmentUserContext.Environment ?? ""; - } -} diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs deleted file mode 100644 index f3a585544..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Auth; - -public class HttpEnvironmentDelegatingHandler : DelegatingHandler -{ - readonly IHttpContextAccessor _httpContextAccessor; - readonly IEnvironmentProvider _environmentProvider; - - public HttpEnvironmentDelegatingHandler(IHttpContextAccessor httpContextAccessor, IEnvironmentProvider environmentProvider) - { - _httpContextAccessor = httpContextAccessor; - _environmentProvider = environmentProvider; - } - - protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - { - var envClaim = _httpContextAccessor.HttpContext?.User.Claims.FirstOrDefault(c => c.Type == "env"); - if (envClaim != null) - { - _httpContextAccessor.HttpContext?.Items.TryAdd(ENVIRONMENT_KEY, _environmentProvider.GetEnvironment()); - request.Headers.Add(ENVIRONMENT_KEY, _environmentProvider.GetEnvironment()); - } - return await base.SendAsync(request, cancellationToken); - } -} diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj deleted file mode 100644 index 364163876..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.md b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.md deleted file mode 100644 index 1002e93ed..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.md +++ /dev/null @@ -1,46 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.StackSdks.Auth - -Injecting IAuthClient interface,cal the service to obtain the capabilities provided by the auth SDK. -SDK need to get current user ID dependency Masa.Contrib.Identity.IdentityModel(../../Identity/Masa.Contrib.Identity.IdentityModel/README.zh,Therefore,the identitymodel service needs to be added before use. - -### Service Introduction - -```c# -IAuthClient -├── UserService -├── SubjectService -├── TeamService -├── PermissionService -└── ProjectService -``` - -### Use Introduction - -#### Install dependent package - -```C# -Install-Package Masa.Contrib.StackSdks.Auth -``` - -#### Register auth service - -```C# -builder.Services.AddAuthClient("http://authservice.com"); -``` - -> `http://authservice.com` is auth service address - -#### Dependency injection IAuthClient - -```c# -var app = builder.Build(); - -app.MapGet("/GetTeams", ([FromServices] IAuthClient authClient) => -{ - return authClient.TeamService.GetAllAsync(); -}); - -app.Run(); -``` diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.zh-CN.md b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.zh-CN.md deleted file mode 100644 index c96527330..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/README.zh-CN.md +++ /dev/null @@ -1,45 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.StackSdks.Auth - -通过注入IAuthClient接口,调用对应Service获取Auth SDK 提供的能力。 -SDK获取当前用户ID依赖Masa.Contrib.Identity.IdentityModel(../../Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.zh,所以使用前需添加IdentityModel服务。 - -### 服务介绍 -```c# -IAuthClient -├── UserService 用户服务 -├── SubjectService 全局搜索用户、角色、团队、组织架构 -├── TeamService 团队服务 -├── PermissionService 权限、菜单服务 -└── ProjectService 全局导航服务 -``` - -### 使用介绍 - -#### 安装依赖包 - -```C# -Install-Package Masa.Contrib.StackSdks.Auth -``` - -#### 注册相关服务 - -```C# -builder.Services.AddAuthClient("http://authservice.com"); -``` - -> `http://authservice.com` 为Auth后台服务地址 - -#### 依赖注入IAuthClient - -```c# -var app = builder.Build(); - -app.MapGet("/GetTeams", ([FromServices] IAuthClient authClient) => -{ - return authClient.TeamService.GetAllAsync(); -}); - -app.Run(); -``` diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs deleted file mode 100644 index d842e5337..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Auth.Service; - -public class PermissionService : IPermissionService -{ - readonly ICaller _caller; - readonly IUserContext _userContext; - - const string PART = "api/permission/"; - - public PermissionService(ICaller caller, IUserContext userContext) - { - _caller = caller; - _userContext = userContext; - } - - //todo remove userId param - public async Task AuthorizedAsync(string appId, string code) - { - var userId = _userContext.GetUserId(); - var requestUri = $"{PART}authorized?appId={appId}&code={code}&userId={userId}"; - return await _caller.GetAsync(requestUri); - } - - public async Task> GetMenusAsync(string appId) - { - var userId = _userContext.GetUserId(); - var requestUri = $"{PART}menus?appId={appId}&userId={userId}"; - return await _caller.GetAsync>(requestUri, default) ?? new(); - } - - public async Task> GetElementPermissionsAsync(string appId) - { - var userId = _userContext.GetUserId(); - var requestUri = $"{PART}element-permissions?appId={appId}&userId={userId}"; - return await _caller.GetAsync>(requestUri, default) ?? new(); - } - - public async Task AddFavoriteMenuAsync(Guid menuId) - { - try - { - var userId = _userContext.GetUserId(); - await _caller.PutAsync($"{PART}addFavoriteMenu?permissionId={menuId}&userId={userId}", null); - return true; - } - catch - { - return false; - } - } - - public async Task RemoveFavoriteMenuAsync(Guid menuId) - { - try - { - var userId = _userContext.GetUserId(); - await _caller.PutAsync($"{PART}removeFavoriteMenu?permissionId={menuId}&userId={userId}", null); - return true; - } - catch - { - return false; - } - } - - public async Task> GetFavoriteMenuListAsync() - { - var userId = _userContext.GetUserId(); - var requestUri = $"{PART}menu-favorite-list?userId={userId}"; - return await _caller.GetAsync>(requestUri, default) ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs deleted file mode 100644 index 56ad9f017..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Auth.Service; - -public class ProjectService : IProjectService -{ - readonly ICaller _caller; - readonly IMultiEnvironmentUserContext _multiEnvironmentUserContext; - - const string PARTY = "api/project/"; - - public ProjectService(ICaller caller, IMultiEnvironmentUserContext multiEnvironmentUserContext) - { - _caller = caller; - _multiEnvironmentUserContext = multiEnvironmentUserContext; - } - - public async Task> GetGlobalNavigations() - { - var userId = _multiEnvironmentUserContext.GetUserId(); - var environment = _multiEnvironmentUserContext.Environment ?? ""; - var requestUri = $"{PARTY}navigations?userId={userId}&environment={environment}"; - return await _caller.GetAsync>(requestUri) ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs deleted file mode 100644 index 951b1d275..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Auth.Service; - -public class SubjectService : ISubjectService -{ - readonly ICaller _caller; - - public SubjectService(ICaller caller) - { - _caller = caller; - } - - public async Task> GetListAsync(string filter) - { - var requestUri = $"api/subject/getList"; - return await _caller.GetAsync>(requestUri, new { filter }) ?? new(); - } -} - diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs deleted file mode 100644 index 0be09d4ef..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Auth.Service; - -public class TeamService : ITeamService -{ - readonly ICaller _caller; - readonly string _party = "api/team/"; - readonly IUserContext _userContext; - - public TeamService(ICaller caller, IUserContext userContext) - { - _caller = caller; - _userContext = userContext; - } - - public async Task GetDetailAsync(Guid id) - { - var requestUri = $"{_party}detail"; - return await _caller.GetAsync(requestUri, new { id }); - } - - public async Task> GetListAsync(Guid userId = default) - { - var requestUri = $"{_party}list"; - if (Guid.Empty != userId) - { - requestUri = $"{requestUri}?userId={userId}"; - } - return await _caller.GetAsync>(requestUri) ?? new(); - } - - public async Task> GetAllAsync() - { - var requestUri = $"{_party}list"; - return await _caller.GetAsync>(requestUri) ?? new(); - } - - public async Task> GetUserTeamsAsync() - { - var userId = _userContext.GetUserId(); - var requestUri = $"{_party}list?userId={userId}"; - return await _caller.GetAsync>(requestUri) ?? new(); - } -} - diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/UserService.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/UserService.cs deleted file mode 100644 index 04f804f52..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/Service/UserService.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Auth.Service; - -public class UserService : IUserService -{ - readonly ICaller _caller; - readonly IUserContext _userContext; - - public UserService(ICaller caller, IUserContext userContext) - { - _caller = caller; - _userContext = userContext; - } - - public async Task AddAsync(AddUserModel user) - { - var requestUri = $"api/user/addExternal"; - return await _caller.PostAsync(requestUri, user); - } - - public async Task UpsertAsync(UpsertUserModel user) - { - var requestUri = $"api/user/upsertExternal"; - return await _caller.PostAsync(requestUri, user); - } - - public async Task> GetListByDepartmentAsync(Guid departmentId) - { - var requestUri = $"api/staff/getListByDepartment"; - return await _caller.GetAsync>(requestUri, new { id = departmentId }) ?? new(); - } - - public async Task> GetListByRoleAsync(Guid roleId) - { - var requestUri = $"api/staff/getListByRole"; - return await _caller.GetAsync>(requestUri, new { id = roleId }) ?? new(); - } - - public async Task> GetListByTeamAsync(Guid teamId) - { - var requestUri = $"api/staff/getListByTeam"; - return await _caller.GetAsync>(requestUri, new { id = teamId }) ?? new(); - } - - public async Task GetTotalByDepartmentAsync(Guid departmentId) - { - var requestUri = $"api/staff/getTotalByDepartment"; - return await _caller.GetAsync(requestUri, new { id = departmentId }); - } - - public async Task GetTotalByRoleAsync(Guid roleId) - { - var requestUri = $"api/staff/getTotalByRole"; - return await _caller.GetAsync(requestUri, new { id = roleId }); - } - - public async Task GetTotalByTeamAsync(Guid teamId) - { - var requestUri = $"api/staff/getTotalByTeam"; - return await _caller.GetAsync(requestUri, new { id = teamId }); - } - - public async Task ValidateCredentialsByAccountAsync(string account, string password, bool isLdap = false) - { - var requestUri = $"api/user/validateByAccount"; - return await _caller.PostAsync(requestUri, new { account, password, isLdap }); - } - - public async Task FindByAccountAsync(string account) - { - var requestUri = $"api/user/findByAccount"; - return await _caller.GetAsync(requestUri, new { account }) ?? new(); - } - - public async Task FindByPhoneNumberAsync(string phoneNumber) - { - var requestUri = $"api/user/findByPhoneNumber"; - return await _caller.GetAsync(requestUri, new { phoneNumber }); - } - - public async Task FindByEmailAsync(string email) - { - var requestUri = $"api/user/findByEmail"; - return await _caller.GetAsync(requestUri, new { email }); - } - - public async Task GetCurrentUserAsync() - { - var id = _userContext.GetUserId(); - var requestUri = $"api/user/findById"; - return await _caller.GetAsync(requestUri, new { id }) ?? new(); - } - - public async Task GetCurrentStaffAsync() - { - var userId = _userContext.GetUserId(); - var requestUri = $"api/staff/getExternalByUserId"; - return await _caller.GetAsync(requestUri, new { userId }); - } - - public async Task VisitedAsync(string url) - { - var userId = _userContext.GetUserId(); - var requestUri = $"api/user/visit"; - await _caller.PostAsync(requestUri, new { UserId = userId, Url = url }, true); - } - - public async Task> GetVisitedListAsync() - { - var userId = _userContext.GetUserId(); - var requestUri = $"api/user/visitedList"; - return (await _caller.GetAsync>(requestUri, new { userId = userId })) ?? new(); - } - - public async Task UpdatePasswordAsync(UpdateUserPasswordModel user) - { - if (user.Id == Guid.Empty) - { - user.Id = _userContext.GetUserId(); - } - var requestUri = $"api/user/updatePassword"; - await _caller.PutAsync(requestUri, user); - } - - public async Task UpdateBasicInfoAsync(UpdateUserBasicInfoModel user) - { - if (user.Id == Guid.Empty) - { - user.Id = _userContext.GetUserId(); - } - var requestUri = $"api/user/updateBasicInfo"; - await _caller.PutAsync(requestUri, user); - } - - public async Task> GetUserPortraitsAsync(params Guid[] userIds) - { - var requestUri = $"api/user/portraits"; - return await _caller.PostAsync>(requestUri, userIds) ?? new(); - } - - public async Task SaveUserSystemDataAsync(string systemId, T data) - { - var userId = _userContext.GetUserId(); - var requestUri = $"api/user/UserSystemData"; - await _caller.PostAsync(requestUri, - new { UserId = userId, SystemId = systemId, Data = JsonSerializer.Serialize(data) }, - true); - } - - public async Task GetUserSystemDataAsync(string systemId) - { - var userId = _userContext.GetUserId(); - var requestUri = $"api/user/GetUserSystemData"; - var data = await _caller.GetAsync(requestUri, new { userId = userId, systemId = systemId }); - return JsonSerializer.Deserialize(data); - } - - public async Task DisableUserAsync(DisableUserModel user) - { - var requestUri = $"api/user/disable"; - return await _caller.PutAsync(requestUri, user); - } - - public async Task> GetListByAccountAsync(IEnumerable accounts) - { - var requestUri = $"api/user/GetListByAccount"; - return await _caller.GetAsync>(requestUri, new { accounts }) ?? new(); - } -} - diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs deleted file mode 100644 index 806af9775..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddAuthClient(this IServiceCollection services, string authServiceBaseAddress) - { - ArgumentNullException.ThrowIfNull(authServiceBaseAddress, nameof(authServiceBaseAddress)); - return services.AddAuthClient(callerOptions => - { - callerOptions.UseHttpClient(builder => - { - builder.Name = DEFAULT_CLIENT_NAME; - builder.Configure = opt => opt.BaseAddress = new Uri(authServiceBaseAddress); - }).AddHttpMessageHandler(); - }); - } - - public static IServiceCollection AddAuthClient(this IServiceCollection services, Action callerOptions) - { - ArgumentNullException.ThrowIfNull(callerOptions, nameof(callerOptions)); - - if (services.All(service => service.ServiceType != typeof(IMultiEnvironmentUserContext))) - throw new Exception("Please add IMultiEnvironmentUserContext first."); - - services.AddHttpContextAccessor(); - services.AddScoped(); - services.AddScoped(); - services.AddCaller(callerOptions); - - services.AddScoped(serviceProvider => - { - var userContext = serviceProvider.GetRequiredService(); - var callProvider = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); - var authClient = new AuthClient(callProvider, userContext); - return authClient; - }); - - return services; - } -} - diff --git a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/_Imports.cs b/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/_Imports.cs deleted file mode 100644 index 20f702dd3..000000000 --- a/src/Contrib/StackSdks/Auth/src/Masa.Contrib.StackSdks.Auth/_Imports.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Auth; -global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; -global using Masa.BuildingBlocks.StackSdks.Auth.Service; -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Masa.Contrib.StackSdks.Auth; -global using Microsoft.AspNetCore.Http; -global using System.Text.Json; -global using static Masa.Contrib.StackSdks.Auth.Constants; diff --git a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs deleted file mode 100644 index 2b27fb6b0..000000000 --- a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Auth.Tests; - -[TestClass] -public class AuthClientTest -{ - [TestMethod] - public void TestAddAuthClient() - { - var services = new ServiceCollection(); - services.AddMasaIdentityModel(IdentityType.MultiEnvironment); - services.AddAuthClient("https://localhost:18102"); - var authClient = services.BuildServiceProvider().GetRequiredService(); - - Assert.IsNotNull(authClient); - } - - [TestMethod] - public void TestAddAuthClientNoAddMasaIdentity() - { - var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddAuthClient("https://localhost:18102"), - "Please add IMultiEnvironmentUserContext first."); - } - - [TestMethod] - public void TestAddAuthClientShouldThrowArgumentNullException() - { - var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddAuthClient(authServiceBaseAddress: null!)); - } - - [TestMethod] - public void TestAddAuthClientShouldThrowArgumentNullException2() - { - var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddAuthClient(callerOptions: null!)); - } -} - diff --git a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj deleted file mode 100644 index c0713f3b5..000000000 --- a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - diff --git a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs deleted file mode 100644 index fcc459f0c..000000000 --- a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Auth.Service; - -namespace Masa.Contrib.StackSdks.Auth.Tests; - -[TestClass] -public class PermissionServiceTest -{ - [TestMethod] - [DataRow("app1")] - public async Task TestGetMenusAsync(string appId) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var data = new List(); - var requestUri = $"api/permission/menus?appId={appId}&userId={userId}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var permissionService = new PermissionService(caller.Object, userContext.Object); - var result = await permissionService.GetMenusAsync(appId); - userContext.Verify(user => user.GetUserId(), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - [DataRow("app1", "code")] - public async Task TestAuthorizedAsync(string appId, string code) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var data = false; - var requestUri = $"api/permission/authorized?code={code}&userId={userId}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var permissionService = new PermissionService(caller.Object, userContext.Object); - var result = await permissionService.AuthorizedAsync(appId, code); - caller.Verify(provider => provider.GetAsync(It.IsAny(), default), Times.Once); - } - - [TestMethod] - [DataRow("app1")] - public async Task TestGetElementPermissionsAsync(string appId) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var data = new List(); - var requestUri = $"api/permission/element-permissions?appId={appId}&userId={userId}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var permissionService = new PermissionService(caller.Object, userContext.Object); - var result = await permissionService.GetElementPermissionsAsync(appId); - caller.Verify(provider => provider.GetAsync>(It.IsAny(), default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - [DataRow("225082D3-CC88-48D2-3C27-08DA3ED8F4B7")] - public async Task TestGetFavoriteMenuListAsync(string menuId) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var data = new List(); - var requestUri = $"api/permission/menu-favorite-list?userId={userId}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var permissionService = new PermissionService(caller.Object, userContext.Object); - var result = await permissionService.GetFavoriteMenuListAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - [DataRow("225082D3-CC88-48D2-3C27-08DA3ED8F4B7")] - public async Task TestAddFavoriteMenuAsync(string menuId) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var requestUri = $"api/permission/addFavoriteMenu?permissionId={Guid.Parse(menuId)}&userId={userId}"; - var caller = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, null, true, default)).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var permissionService = new PermissionService(caller.Object, userContext.Object); - var result = await permissionService.AddFavoriteMenuAsync(Guid.Parse(menuId)); - caller.Verify(provider => provider.PutAsync(requestUri, null, true, default), Times.Once); - Assert.IsTrue(result); - } - - [TestMethod] - [DataRow("225082D3-CC88-48D2-3C27-08DA3ED8F4B7")] - public async Task TestRemoveFavoriteMenuAsync(string menuId) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var requestUri = $"api/permission/removeFavoriteMenu?permissionId={Guid.Parse(menuId)}&userId={userId}"; - var caller = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, null, true, default)).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var permissionService = new PermissionService(caller.Object, userContext.Object); - var result = await permissionService.RemoveFavoriteMenuAsync(Guid.Parse(menuId)); - caller.Verify(provider => provider.PutAsync(requestUri, null, true, default), Times.Once); - Assert.IsTrue(result); - } -} diff --git a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs deleted file mode 100644 index ef19e7308..000000000 --- a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Auth.Service; - -namespace Masa.Contrib.StackSdks.Auth.Tests; - -[TestClass] -public class ProjectServiceTest -{ - [TestMethod] - public async Task TestGetGlobalNavigationsAsync() - { - var data = new List() - { - new ProjectModel() - }; - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var requestUri = $"api/project/navigations?userId={userId}&environment=development"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - userContext.SetupGet(user => user.Environment).Returns("development"); - var projectService = new Mock(caller.Object, userContext.Object); - var result = await projectService.Object.GetGlobalNavigations(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - Assert.IsTrue(result.Count == 1); - } -} diff --git a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs deleted file mode 100644 index c510438ec..000000000 --- a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Auth.Service; - -namespace Masa.Contrib.StackSdks.Auth.Tests; - -[TestClass] -public class SubjectServiceTest -{ - [TestMethod] - public async Task TestGetListAsync() - { - var data = new List() - { - new SubjectModel() - }; - string filter = "test"; - var requestUri = $"api/subject/getList"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var subjectService = new Mock(caller.Object); - var result = await subjectService.Object.GetListAsync(filter); - caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result.Count == 1); - } -} - diff --git a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs deleted file mode 100644 index f5c8561f0..000000000 --- a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Auth.Service; - -namespace Masa.Contrib.StackSdks.Auth.Tests; - -[TestClass] -public class TeamServiceTest -{ - [TestMethod] - public async Task TestGetDetailAsync() - { - var data = new TeamDetailModel(); - Guid teamId = Guid.NewGuid(); - var requestUri = $"api/team/detail"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var teamService = new Mock(caller.Object, userContext.Object); - var result = await teamService.Object.GetDetailAsync(teamId); - caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestGetAllAsync() - { - var data = new List(); - var requestUri = $"api/team/list"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var teamService = new Mock(caller.Object, userContext.Object); - var result = await teamService.Object.GetAllAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestGetUserTeamsAsync() - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var data = new List(); - var requestUri = $"api/team/list?userId={userId}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var teamService = new Mock(caller.Object, userContext.Object); - var result = await teamService.Object.GetUserTeamsAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - Assert.IsTrue(result is not null); - } -} - diff --git a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs deleted file mode 100644 index 718c24c7d..000000000 --- a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs +++ /dev/null @@ -1,446 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Auth.Service; - -namespace Masa.Contrib.StackSdks.Auth.Tests; - -[TestClass] -public class UserServiceTest -{ - [TestMethod] - public async Task TestAddAsync() - { - var addUser = new AddUserModel(); - var user = new UserModel(); - var requestUri = $"api/user/addExternal"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, addUser, default)).ReturnsAsync(user).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.AddAsync(addUser); - caller.Verify(provider => provider.PostAsync(requestUri, addUser, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task UpsertAsync() - { - var upsertUser = new UpsertUserModel(); - var user = new UserModel(); - var requestUri = $"api/user/upsertExternal"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, upsertUser, default)).ReturnsAsync(user).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.UpsertAsync(upsertUser); - caller.Verify(provider => provider.PostAsync(requestUri, upsertUser, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestGetListByDepartmentAsync() - { - var data = new List() - { - new StaffModel() - }; - Guid departmentId = Guid.NewGuid(); - var requestUri = $"api/staff/getListByDepartment"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetListByDepartmentAsync(departmentId); - caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetListByTeamAsync() - { - var data = new List() - { - new StaffModel() - }; - Guid teamId = Guid.NewGuid(); - var requestUri = $"api/staff/getListByTeam"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetListByTeamAsync(teamId); - caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetListByRoleAsync() - { - var data = new List() - { - new StaffModel() - }; - Guid roleId = Guid.NewGuid(); - var requestUri = $"api/staff/getListByRole"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetListByRoleAsync(roleId); - caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetTotalByDepartmentAsync() - { - long data = 10; - Guid departmentId = Guid.NewGuid(); - var requestUri = $"api/staff/getTotalByDepartment"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetTotalByDepartmentAsync(departmentId); - caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result == data); - } - - [TestMethod] - public async Task TestGetTotalByByRoleAsync() - { - long data = 10; - Guid roleId = Guid.NewGuid(); - var requestUri = $"api/staff/getTotalByRole"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetTotalByRoleAsync(roleId); - caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result == data); - } - - [TestMethod] - public async Task TestGetTotalByTeamAsync() - { - long data = 10; - Guid teamId = Guid.NewGuid(); - var requestUri = $"api/staff/getTotalByTeam"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetTotalByTeamAsync(teamId); - caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result == data); - } - - [TestMethod] - [DataRow("account", "123456")] - public async Task TestValidateCredentialsByAccountAsync(string account, string password) - { - var data = false; - Guid departmentId = Guid.NewGuid(); - var requestUri = $"api/user/validateByAccount"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.ValidateCredentialsByAccountAsync(account, password); - caller.Verify(provider => provider.PostAsync(requestUri, It.IsAny(), default), Times.Once); - } - - [TestMethod] - [DataRow("authount")] - public async Task TestFindByAccountAsync(string account) - { - var data = new UserModel(); - var requestUri = $"api/user/findByAccount"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.FindByAccountAsync(account); - caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - [DataRow("15168440403")] - public async Task TestFindByPhoneNumberAsync(string phoneNumber) - { - var data = new UserModel() - { - PhoneNumber = phoneNumber - }; - var requestUri = $"api/user/findByPhoneNumber"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.FindByPhoneNumberAsync(phoneNumber); - caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result is not null && result.PhoneNumber == data.PhoneNumber); - } - - [TestMethod] - [DataRow("824255786@qq.com")] - public async Task TestFindByEmailAsync(string email) - { - var data = new UserModel(); - var requestUri = $"api/user/findByEmail"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.FindByEmailAsync(email); - caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result is not null && result.Email == data.Email); - } - - [TestMethod] - public async Task TestGetCurrentUserAsync() - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var data = new UserModel(); - var requestUri = $"api/user/findById"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetCurrentUserAsync(); - caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestGetCurrentStaffAsync() - { - var userId = Guid.NewGuid(); - var data = new StaffDetailModel(); - var requestUri = $"api/staff/getExternalByUserId"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetCurrentStaffAsync(); - caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - [DataRow("https://www.baidu.com/")] - public async Task TestVisitedAsync(string url) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var requestUri = $"api/user/visit"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, new { UserId = userId, Url = url }, true, default)).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var userService = new UserService(caller.Object, userContext.Object); - await userService.VisitedAsync(url); - caller.Verify(provider => provider.PostAsync(requestUri, It.IsAny(), true, default), Times.Once); - } - - [TestMethod] - public async Task TestGetVisitedListAsync() - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var data = new List() { - new UserVisitedModel - { - Name="baidu", - Url = "https://www.baidu.com/" - } - }; - var requestUri = $"api/user/visitedList"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetVisitedListAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestUpdatePasswordAsync() - { - var user = new UpdateUserPasswordModel - { - Id = Guid.NewGuid(), - NewPassword = "masa123", - OldPassword = "masa123" - }; - var requestUri = $"api/user/updatePassword"; - var caller = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, user, true, default)).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - await userService.UpdatePasswordAsync(user); - caller.Verify(provider => provider.PutAsync(requestUri, user, true, default), Times.Once); - } - - [TestMethod] - public async Task TestDisableUserAsync() - { - var user = new DisableUserModel("account"); - var requestUri = $"api/user/disable"; - var caller = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, user, default)).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - await userService.DisableUserAsync(user); - caller.Verify(provider => provider.PutAsync(requestUri, user, default), Times.Once); - } - - [TestMethod] - public async Task TestUpdateBasicInfoAsync() - { - var user = new UpdateUserBasicInfoModel - { - Id = Guid.NewGuid(), - DisplayName = "test", - Gender = GenderTypes.Male, - PhoneNumber = "15168440403" - }; - var requestUri = $"api/user/updateBasicInfo"; - var caller = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, user, true, default)).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - await userService.UpdateBasicInfoAsync(user); - caller.Verify(provider => provider.PutAsync(requestUri, user, true, default), Times.Once); - } - - [TestMethod] - public async Task GetUserPortraitsAsync() - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var userPortraits = new List { - new UserPortraitModel - { - Id = Guid.NewGuid(), - DisplayName = "DisplayName", - Account = "Account", - Name = "Name", - Avatar = "Avatar" - } - }; - var requestUri = $"api/user/portraits"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync>(requestUri, new Guid[] { userId }, default)) - .ReturnsAsync(userPortraits).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var data = await userService.GetUserPortraitsAsync(userId); - caller.Verify(provider => provider.PostAsync>(requestUri, new Guid[] { userId }, default), Times.Once); - Assert.IsTrue(data.Count == 1); - } - - [TestMethod] - [DataRow("masa-auth")] - public async Task TestIntGetUserSystemDataAsync(string systemId) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var data = 1; - var requestUri = $"api/user/GetUserSystemData"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)) - .ReturnsAsync(data.ToString()).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetUserSystemDataAsync(systemId); - Assert.IsTrue(result == 1); - } - - [TestMethod] - [DataRow("masa-auth")] - public async Task TestObjectGetUserSystemDataAsync(string systemId) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var data = new SystemData - { - Name = "name", - Value = "value" - }; - var requestUri = $"api/user/GetUserSystemData"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)) - .ReturnsAsync(JsonSerializer.Serialize(data)).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetUserSystemDataAsync(systemId); - Assert.IsTrue(result is not null); - } - - [TestMethod] - [DataRow("masa-auth")] - public async Task TestIntSaveUserSystemDataAsync(string systemId) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var requestUri = $"api/user/UserSystemData"; - var value = 1; - var data = new { UserId = userId, SystemId = systemId, Data = JsonSerializer.Serialize(value) }; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, data, true, default)).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var userService = new UserService(caller.Object, userContext.Object); - await userService.SaveUserSystemDataAsync(systemId, value); - caller.Verify(provider => provider.PostAsync(requestUri, It.IsAny(), true, default), Times.Once); - } - - [TestMethod] - [DataRow("masa-auth")] - public async Task TestObjectSaveUserSystemDataAsync(string systemId) - { - var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); - var requestUri = $"api/user/UserSystemData"; - var value = new SystemData - { - Name = "name", - Value = "value" - }; - var data = new { UserId = userId, SystemId = systemId, Data = JsonSerializer.Serialize(value) }; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, data, true, default)).Verifiable(); - var userContext = new Mock(); - userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); - var userService = new UserService(caller.Object, userContext.Object); - await userService.SaveUserSystemDataAsync(systemId, value); - caller.Verify(provider => provider.PostAsync(requestUri, It.IsAny(), true, default), Times.Once); - } - - [TestMethod] - public async Task TestGetListByAccountAsync() - { - var data = new List() - { - new UserSimpleModel(Guid.NewGuid(), "account", "displayName") - }; - var accounts = new List { "account" }; - var requestUri = $"api/user/GetListByAccount"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var userContext = new Mock(); - var userService = new UserService(caller.Object, userContext.Object); - var result = await userService.GetListByAccountAsync(accounts); - caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); - Assert.IsTrue(result.Count == 1); - } -} - -class SystemData -{ - public string Name { get; set; } - public string Value { get; set; } -} diff --git a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs b/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs deleted file mode 100644 index 76252fde4..000000000 --- a/src/Contrib/StackSdks/Auth/test/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Auth; -global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; -global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.BuildingBlocks.Service.Caller; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Text.Json; diff --git a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/DccClient.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/DccClient.cs deleted file mode 100644 index 51cb140f6..000000000 --- a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/DccClient.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Dcc.Service; - -namespace Masa.Contrib.StackSdks.Dcc; - -public class DccClient : IDccClient -{ - public DccClient(IDistributedCacheClient distributedCacheClient) - { - LabelService = new LabelService(distributedCacheClient); - } - - public ILabelService LabelService { get; } -} diff --git a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs deleted file mode 100644 index 34bd828b5..000000000 --- a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Dcc.Internal -{ - internal class Constants - { - internal const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.dcc"; - } -} diff --git a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj deleted file mode 100644 index 283f6feb1..000000000 --- a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - diff --git a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.md b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.md deleted file mode 100644 index 7761d2106..000000000 --- a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.md +++ /dev/null @@ -1,54 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.StackSdks.Dcc - -Effect: - -Obtain relevant data of Dcc service through DccClient,If you need to use the configuration related capabilities, please refer to the[document](../../Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md) - -```c# -IDccClient -├── LabelService Label service -``` - -Example: - -```C# -Install-Package Masa.Contrib.StackSdks.Dcc -``` - -appsettings.json - -```json -{ - "DccOptions": { - "RedisOptions": { - "Servers": [ - { - "Host": "localhost", - "Port": 8889 - } - ], - "DefaultDatabase": 0, - "Password": "" - } - } -} -``` - -```C# -builder.Services.AddDccClient(); -``` - -How to use: - -```c# -var app = builder.Build(); - -app.MapGet("/GetProjectTypes", ([FromServices] IDccClient dccClient, string typeCode) => -{ - return dccClient.LabelService.GetListByTypeCodeAsync(typeCode); -}); - -app.Run(); -``` diff --git a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md deleted file mode 100644 index aa18c6961..000000000 --- a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md +++ /dev/null @@ -1,54 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.StackSdks.Dcc - -作用: - -通过DccClient获取Dcc服务的相关数据,如需使用配置相关能力请查看[文档](../../Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md) - -```c# -IDccClient -├── LabelService 标签服务 -``` - -用例: - -```C# -Install-Package Masa.Contrib.StackSdks.Dcc -``` - -appsettings.json - -```json -{ - "DccOptions": { - "RedisOptions": { - "Servers": [ - { - "Host": "localhost", - "Port": 8889 - } - ], - "DefaultDatabase": 0, - "Password": "" - } - } -} -``` - -```C# -builder.Services.AddDccClient(); -``` - -如何使用: - -```c# -var app = builder.Build(); - -app.MapGet("/GetProjectTypes", ([FromServices] IDccClient dccClient, string typeCode) => -{ - return dccClient.LabelService.GetListByTypeCodeAsync(typeCode); -}); - -app.Run(); -``` diff --git a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs deleted file mode 100644 index 2027a94d8..000000000 --- a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Dcc.Service; - -public class LabelService : ILabelService -{ - private readonly IDistributedCacheClient _distributedCacheClient; - - public LabelService(IDistributedCacheClient distributedCacheClient) - { - _distributedCacheClient = distributedCacheClient; - } - - public async Task> GetListByTypeCodeAsync(string typeCode) - { - var result = await _distributedCacheClient.GetAsync>(typeCode); - - return result ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs deleted file mode 100644 index ed7d4fddf..000000000 --- a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static void AddDccClient(this IServiceCollection services) - { - var options = AppSettings.GetModel("DccOptions:RedisOptions"); - services.AddMasaRedisCache(DEFAULT_CLIENT_NAME, options); - - services.AddSingleton(serviceProvider => - { - var client = serviceProvider.GetRequiredService() - .CreateClient(DEFAULT_CLIENT_NAME); - - return new DccClient(client); - }); - } - - public static void AddDccClient(this IServiceCollection services, Action options) - { - services.AddMasaRedisCache(DEFAULT_CLIENT_NAME, options); - - services.AddSingleton(serviceProvider => - { - var client = serviceProvider.GetRequiredService() - .CreateClient(DEFAULT_CLIENT_NAME); - - return new DccClient(client); - }); - } - - public static void AddDccClient(this IServiceCollection services, RedisConfigurationOptions options) - { - services.AddMasaRedisCache(DEFAULT_CLIENT_NAME, options); - - services.AddSingleton(serviceProvider => - { - var client = serviceProvider.GetRequiredService() - .CreateClient(DEFAULT_CLIENT_NAME); - - return new DccClient(client); - }); - } -} diff --git a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/_Imports.cs b/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/_Imports.cs deleted file mode 100644 index d6da4100d..000000000 --- a/src/Contrib/StackSdks/Dcc/src/Masa.Contrib.StackSdks.Dcc/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Dcc; -global using Masa.BuildingBlocks.StackSdks.Dcc.Model; -global using Masa.BuildingBlocks.StackSdks.Dcc.Service; -global using Masa.Contrib.StackSdks.Dcc; -global using Masa.Utils.Caching.Core.Interfaces; -global using Masa.Utils.Caching.Redis.Models; -global using Masa.Utils.Configuration.Json; -global using static Masa.Contrib.StackSdks.Dcc.Internal.Constants; diff --git a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs deleted file mode 100644 index fe85d35f9..000000000 --- a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Dcc.Tests; - -[TestClass] -public class DccClientTest -{ - [TestMethod] - public void TestAddDccClient() - { - var services = new ServiceCollection(); - - services.AddDccClient(); - - var dccClient = services.BuildServiceProvider().GetRequiredService(); - Assert.IsNotNull(dccClient); - } - - [TestMethod] - public void TestAddDccClient2() - { - var services = new ServiceCollection(); - var options = AppSettings.GetModel("DccOptions:RedisOptions"); - - services.AddDccClient(options); - - var dccClient = services.BuildServiceProvider().GetRequiredService(); - Assert.IsNotNull(dccClient); - } - - [TestMethod] - public void TestAddDccClient3() - { - var services = new ServiceCollection(); - - services.AddDccClient(options => - { - options.Servers.Add(new RedisServerOptions("localhost", 8888)); - options.DefaultDatabase = 0; - options.Password = "xxxx"; - }); - - var dccClient = services.BuildServiceProvider().GetRequiredService(); - Assert.IsNotNull(dccClient); - } -} diff --git a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs deleted file mode 100644 index be35f83e3..000000000 --- a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Dcc.Tests; - -[TestClass] -public class LabelServiceTest -{ - [TestMethod] - [DataRow("status")] - public async Task TestGetListByTypeCodeAsync(string typeCode) - { - var data = new List - { - new LabelModel { Code = "normal" }, - new LabelModel { Code = "frozen" } - }; - - var distributedCacheClient = new Mock(); - distributedCacheClient.Setup(client => client.GetAsync>(typeCode)).ReturnsAsync(data).Verifiable(); - var dccClient = new DccClient(distributedCacheClient.Object); - - var result = await dccClient.LabelService.GetListByTypeCodeAsync(typeCode); - distributedCacheClient.Verify(client => client.GetAsync>(typeCode), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow("status")] - public async Task TestGetListByTypeCodeAsync2(string typeCode) - { - List? data = null; - - var distributedCacheClient = new Mock(); - distributedCacheClient.Setup(client => client.GetAsync>(It.IsAny())).ReturnsAsync(data).Verifiable(); - var dccClient = new DccClient(distributedCacheClient.Object); - - var result = await dccClient.LabelService.GetListByTypeCodeAsync(typeCode); - distributedCacheClient.Verify(client => client.GetAsync>(typeCode), Times.Once); - - Assert.IsFalse(result.Any()); - } -} diff --git a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj deleted file mode 100644 index 17709f2ee..000000000 --- a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - Always - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - diff --git a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs deleted file mode 100644 index 1bd727faa..000000000 --- a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Dcc; -global using Masa.BuildingBlocks.StackSdks.Dcc.Model; -global using Masa.Utils.Caching.Core.Interfaces; -global using Masa.Utils.Caching.Redis.Models; -global using Masa.Utils.Configuration.Json; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; diff --git a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json b/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json deleted file mode 100644 index c0f6fc8f9..000000000 --- a/src/Contrib/StackSdks/Dcc/test/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "DccOptions": { - "RedisOptions": { - "Servers": [ - { - "Host": "localhost", - "Port": 8888 - } - ], - "DefaultDatabase": 0, - "Password": "" - } - } -} \ No newline at end of file diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Constants.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Constants.cs deleted file mode 100644 index 303977772..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Constants.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc; - -internal class Constants -{ - public const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.mc"; -} - diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs deleted file mode 100644 index c332463de..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc; - -public class HttpClientAuthorizationDelegatingHandler : DelegatingHandler -{ - private readonly IHttpContextAccessor _httpContextAccessor; - - public HttpClientAuthorizationDelegatingHandler(IHttpContextAccessor httpContextAccessor) - { - _httpContextAccessor = httpContextAccessor; - } - - protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - { - if (_httpContextAccessor.HttpContext != null) - { - var accessToken = await _httpContextAccessor.HttpContext.GetTokenAsync("access_token"); - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken); - } - return await base.SendAsync(request, cancellationToken); - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs deleted file mode 100644 index 189f232c5..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc.Infrastructure.Extensions; - -/// -/// Extension methods for Dictionary. -/// -public static class DictionaryExtensions -{ - /// - /// This method is used to try to get a value in a dictionary if it does exists. - /// - /// Type of the value - /// The collection object - /// Key - /// Value of the key (or default value if key not exists) - /// True if key does exists in the dictionary - internal static bool TryGetValue(this IDictionary dictionary, string key, out T value) - { - object valueObj; - if (dictionary.TryGetValue(key, out valueObj) && valueObj is T) - { - value = (T)valueObj; - return true; - } - - value = default; - return false; - } - - /// - /// Gets a value from the dictionary with given key. Returns default value if can not find. - /// - /// Dictionary to check and get - /// Key to find the value - /// Type of the key - /// Type of the value - /// Value if found, default if can not found. - public static TValue? GetOrDefault(this IDictionary dictionary, TKey key) - { - return dictionary.TryGetValue(key, out var obj) ? obj : default; - } - - /// - /// Gets a value from the dictionary with given key. Returns default value if can not find. - /// - /// Dictionary to check and get - /// Key to find the value - /// Type of the key - /// Type of the value - /// Value if found, default if can not found. - public static TValue? GetOrDefault(this IReadOnlyDictionary dictionary, TKey key) - { - return dictionary.TryGetValue(key, out var obj) ? obj : default; - } - - /// - /// Gets a value from the dictionary with given key. Returns default value if can not find. - /// - /// Dictionary to check and get - /// Key to find the value - /// Type of the key - /// Type of the value - /// Value if found, default if can not found. - public static TValue? GetOrDefault(this ConcurrentDictionary dictionary, TKey key) - { - return dictionary.TryGetValue(key, out var obj) ? obj : default; - } - - /// - /// Gets a value from the dictionary with given key. Returns default value if can not find. - /// - /// Dictionary to check and get - /// Key to find the value - /// A factory method used to create the value if not found in the dictionary - /// Type of the key - /// Type of the value - /// Value if found, default if can not found. - public static TValue GetOrAdd(this IDictionary dictionary, [NotNull] TKey key, Func factory) - { - TValue obj; - if (dictionary.TryGetValue(key, out obj)) - { - return obj; - } - - return dictionary[key] = factory(key); - } - - /// - /// Gets a value from the dictionary with given key. Returns default value if can not find. - /// - /// Dictionary to check and get - /// Key to find the value - /// A factory method used to create the value if not found in the dictionary - /// Type of the key - /// Type of the value - /// Value if found, default if can not found. - public static TValue GetOrAdd(this IDictionary dictionary, [NotNull] TKey key, Func factory) - { - return dictionary.GetOrAdd(key, k => factory()); - } - - /// - /// Gets a value from the concurrent dictionary with given key. Returns default value if can not find. - /// - /// Concurrent dictionary to check and get - /// Key to find the value - /// A factory method used to create the value if not found in the dictionary - /// Type of the key - /// Type of the value - /// Value if found, default if can not found. - public static TValue GetOrAdd(this ConcurrentDictionary dictionary, [NotNull] TKey key, Func factory) - { - return dictionary.GetOrAdd(key, k => factory()); - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs deleted file mode 100644 index 0af3e10dd..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc.Infrastructure.Extensions; - -public static class ExtraPropertiesExtensions -{ - public static bool HasProperty(this ExtraPropertyDictionary source, string name) - { - return source.ContainsKey(name); - } - - public static object GetProperty(this ExtraPropertyDictionary source, string name, object defaultValue = null) - { - return source.GetOrDefault(name) - ?? defaultValue; - } - - public static TProperty GetProperty(this ExtraPropertyDictionary source, string name, TProperty defaultValue = default) - { - var value = source.GetProperty(name); - if (value == null) - { - return defaultValue; - } - - if (TypeHelper.IsPrimitiveExtended(typeof(TProperty), includeEnums: true)) - { - var conversionType = typeof(TProperty); - if (TypeHelper.IsNullable(conversionType)) - { - conversionType = conversionType.GetFirstGenericArgumentIfNullable(); - } - - if (conversionType == typeof(Guid)) - { - return (TProperty)TypeDescriptor.GetConverter(conversionType).ConvertFromInvariantString(value.ToString()); - } - - if (conversionType == typeof(DateTimeOffset)) - { - return (TProperty)TypeDescriptor.GetConverter(conversionType).ConvertFromInvariantString(value.ToString()); - } - - return (TProperty)Convert.ChangeType(value?.ToString(), conversionType, CultureInfo.InvariantCulture); - } - - throw new Exception("GetProperty does not support non-primitive types. Use non-generic GetProperty method and handle type casting manually."); - } - - public static TSource SetProperty( - this TSource source, - string name, - object value) - where TSource : ExtraPropertyDictionary - { - source[name] = value; - - return source; - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs deleted file mode 100644 index 9c62f2d6e..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc.Infrastructure.Helper; - -public static class TypeHelper -{ - private static readonly HashSet FloatingTypes = new HashSet - { - typeof(float), - typeof(double), - typeof(decimal) - }; - - private static readonly HashSet NonNullablePrimitiveTypes = new HashSet - { - typeof(byte), - typeof(short), - typeof(int), - typeof(long), - typeof(sbyte), - typeof(ushort), - typeof(uint), - typeof(ulong), - typeof(bool), - typeof(float), - typeof(decimal), - typeof(DateTime), - typeof(DateTimeOffset), - typeof(TimeSpan), - typeof(Guid) - }; - - public static bool IsNonNullablePrimitiveType(Type type) - { - return NonNullablePrimitiveTypes.Contains(type); - } - - public static bool IsFunc(object obj) - { - if (obj == null) - { - return false; - } - - var type = obj.GetType(); - if (!type.GetTypeInfo().IsGenericType) - { - return false; - } - - return type.GetGenericTypeDefinition() == typeof(Func<>); - } - - public static bool IsFunc(object obj) - { - return obj != null && obj.GetType() == typeof(Func); - } - - public static bool IsPrimitiveExtended(Type type, bool includeNullables = true, bool includeEnums = false) - { - if (IsPrimitiveExtendedInternal(type, includeEnums)) - { - return true; - } - - if (includeNullables && IsNullable(type) && type.GenericTypeArguments.Any()) - { - return IsPrimitiveExtendedInternal(type.GenericTypeArguments[0], includeEnums); - } - - return false; - } - - public static bool IsNullable(Type type) - { - return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); - } - - public static Type GetFirstGenericArgumentIfNullable(this Type t) - { - if (t.GetGenericArguments().Length > 0 && t.GetGenericTypeDefinition() == typeof(Nullable<>)) - { - return t.GetGenericArguments().FirstOrDefault(); - } - - return t; - } - - private static bool IsPrimitiveExtendedInternal(Type type, bool includeEnums) - { - if (type.IsPrimitive) - { - return true; - } - - if (includeEnums && type.IsEnum) - { - return true; - } - - return type == typeof(string) || - type == typeof(decimal) || - type == typeof(DateTimeOffset) || - type == typeof(DateTimeOffset) || - type == typeof(TimeSpan) || - type == typeof(Guid); - } - - public static T? GetDefaultValue() - { - return default; - } - - public static object? GetDefaultValue(Type type) - { - if (type.IsValueType) - { - return Activator.CreateInstance(type); - } - - return null; - } - - public static bool IsFloatingType(Type type, bool includeNullable = true) - { - if (FloatingTypes.Contains(type)) - { - return true; - } - - if (includeNullable && - IsNullable(type) && - FloatingTypes.Contains(type.GenericTypeArguments[0])) - { - return true; - } - - return false; - } - - public static object ConvertFrom(object value) - { - return ConvertFrom(typeof(TTargetType), value); - } - - public static object ConvertFrom(Type targetType, object value) - { - return TypeDescriptor - .GetConverter(targetType) - .ConvertFrom(value); - } - - public static Type StripNullable(Type type) - { - return IsNullable(type) - ? type.GenericTypeArguments[0] - : type; - } - - public static bool IsDefaultValue(object obj) - { - if (obj == null) - { - return true; - } - - return obj.Equals(GetDefaultValue(obj.GetType())); - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj deleted file mode 100644 index 74e5cd6f4..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/McClient.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/McClient.cs deleted file mode 100644 index fc89ba5c5..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/McClient.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Mc.Service; - -namespace Masa.Contrib.StackSdks.Mc; - -public class McClient: IMcClient -{ - public McClient(ICaller caller) - { - ChannelService = new ChannelService(caller); - MessageTaskService = new MessageTaskService(caller); - MessageTemplateService = new MessageTemplateService(caller); - ReceiverGroupService = new ReceiverGroupService(caller); - WebsiteMessageService = new WebsiteMessageService(caller); - } - - public IChannelService ChannelService { get; } - - public IMessageTaskService MessageTaskService { get; } - - public IMessageTemplateService MessageTemplateService { get; } - - public IReceiverGroupService ReceiverGroupService { get; } - - public IWebsiteMessageService WebsiteMessageService { get; } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs deleted file mode 100644 index b4698a133..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc.Service; - -public class ChannelService : IChannelService -{ - readonly ICaller _caller; - readonly string _party = "api/channel"; - - public ChannelService(ICaller caller) - { - _caller = caller; - } - - public async Task GetAsync(Guid id) - { - var requestUri = $"{_party}/{id}"; - return await _caller.GetAsync(requestUri); - } - - public async Task> GetListAsync(GetChannelModel options) - { - var requestUri = $"{_party}"; - return await _caller.GetAsync>(requestUri, options) ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs deleted file mode 100644 index d467c7041..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc.Service; - -public class MessageTaskService : IMessageTaskService -{ - readonly ICaller _caller; - readonly string _party = "api/message-task"; - - public MessageTaskService(ICaller caller) - { - _caller = caller; - } - - public async Task GetAsync(Guid id) - { - var requestUri = $"{_party}/{id}"; - return await _caller.GetAsync(requestUri); - } - - public async Task SendOrdinaryMessageAsync(SendOrdinaryMessageModel options) - { - var requestUri = $"{_party}/SendOrdinaryMessage"; - await _caller.PostAsync(requestUri, options); - } - - public async Task SendTemplateMessageAsync(SendTemplateMessageModel options) - { - var requestUri = $"{_party}/SendTemplateMessage"; - await _caller.PostAsync(requestUri, options); - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs deleted file mode 100644 index 514e10c31..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc.Service; - -public class MessageTemplateService : IMessageTemplateService -{ - readonly ICaller _caller; - readonly string _party = "api/message-template"; - - public MessageTemplateService(ICaller caller) - { - _caller = caller; - } - - public async Task GetAsync(Guid id) - { - var requestUri = $"{_party}/{id}"; - return await _caller.GetAsync(requestUri); - } - - public async Task> GetListAsync(GetMessageTemplateModel options) - { - var requestUri = $"{_party}"; - return await _caller.GetAsync>(requestUri, options) ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs deleted file mode 100644 index 500b1b8b2..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc.Service; - -public class ReceiverGroupService : IReceiverGroupService -{ - readonly ICaller _caller; - readonly string _party = "api/receiver-group"; - - public ReceiverGroupService(ICaller caller) - { - _caller = caller; - } - - public async Task GetAsync(Guid id) - { - var requestUri = $"{_party}/{id}"; - return await _caller.GetAsync(requestUri); - } - - public async Task> GetListAsync(GetReceiverGroupModel options) - { - var requestUri = $"{_party}"; - return await _caller.GetAsync>(requestUri, options) ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs deleted file mode 100644 index 50d900667..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs +++ /dev/null @@ -1,72 +0,0 @@ -namespace Masa.Contrib.StackSdks.Mc.Service; - -public class WebsiteMessageService : IWebsiteMessageService -{ - readonly ICaller _caller; - readonly string _party = "api/website-message"; - - public WebsiteMessageService(ICaller caller) - { - _caller = caller; - } - - public async Task CheckAsync() - { - var requestUri = $"{_party}/Check"; - await _caller.PostAsync(requestUri, null); - } - - public async Task DeleteAsync(Guid id) - { - var requestUri = $"{_party}/{id}"; - await _caller.DeleteAsync(requestUri, null); - } - - public async Task GetAsync(Guid id) - { - var requestUri = $"{_party}/{id}"; - return await _caller.GetAsync(requestUri); - } - - public async Task> GetChannelListAsync() - { - var requestUri = $"{_party}/GetChannelList"; - return await _caller.GetAsync>(requestUri)??new(); - } - - public async Task> GetListAsync(GetWebsiteMessageModel options) - { - var requestUri = $"{_party}"; - return await _caller.GetAsync>(requestUri, options) ?? new(); - } - - public async Task> GetNoticeListAsync(GetNoticeListModel options) - { - var requestUri = $"{_party}/GetNoticeList"; - return await _caller.GetAsync>(requestUri, options) ?? new(); - } - - public async Task ReadAsync(ReadWebsiteMessageModel options) - { - var requestUri = $"{_party}/Read"; - await _caller.PostAsync(requestUri, options); - } - - public async Task SetAllReadAsync(ReadAllWebsiteMessageModel options) - { - var requestUri = $"{_party}/SetAllRead"; - await _caller.PostAsync(requestUri, options); - } - - public async Task SendCheckNotificationAsync() - { - var requestUri = $"{_party}/SendCheckNotification"; - await _caller.PostAsync(requestUri, null); - } - - public async Task SendGetNotificationAsync(List userIds) - { - var requestUri = $"{_party}/SendGetNotification"; - await _caller.PostAsync(requestUri, userIds); - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs deleted file mode 100644 index 6d039e5eb..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddMcClient(this IServiceCollection services, string mcServiceBaseAddress) - { - if (string.IsNullOrWhiteSpace(mcServiceBaseAddress)) - { - throw new ArgumentNullException(nameof(mcServiceBaseAddress)); - } - - return services.AddMcClient(callerOptions => - { - callerOptions.UseHttpClient(builder => - { - builder.Name = DEFAULT_CLIENT_NAME; - builder.Configure = opt => opt.BaseAddress = new Uri(mcServiceBaseAddress); - }).AddHttpMessageHandler(); - }); - } - - public static IServiceCollection AddMcClient(this IServiceCollection services, Action callerOptions) - { - ArgumentNullException.ThrowIfNull(callerOptions, nameof(callerOptions)); - - if (services.Any(service => service.ServiceType == typeof(IMcClient))) - return services; - - services.AddHttpContextAccessor(); - services.AddScoped(); - services.AddCaller(callerOptions); - - services.AddScoped(serviceProvider => - { - var callProvider = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); - var mcCaching = new McClient(callProvider); - return mcCaching; - }); - - return services; - } -} diff --git a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/_Imports.cs b/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/_Imports.cs deleted file mode 100644 index 5d3a074ce..000000000 --- a/src/Contrib/StackSdks/Mc/src/Masa.Contrib.StackSdks.Mc/_Imports.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Mc; -global using Masa.BuildingBlocks.StackSdks.Mc.Model; -global using Masa.BuildingBlocks.StackSdks.Mc.Service; -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Masa.Contrib.StackSdks.Mc; -global using Masa.Contrib.StackSdks.Mc.Infrastructure.Helper; -global using Microsoft.AspNetCore.Authentication; -global using Microsoft.AspNetCore.Http; -global using System.Collections.Concurrent; -global using System.ComponentModel; -global using System.Diagnostics.CodeAnalysis; -global using System.Globalization; -global using System.Reflection; -global using static Masa.Contrib.StackSdks.Mc.Constants; diff --git a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs deleted file mode 100644 index f3770e583..000000000 --- a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Mc.Service; - -namespace Masa.Contrib.StackSdks.Mc.Tests; - -[TestClass] -public class ChannelServiceTest -{ - [TestMethod] - public async Task TestGetAsync() - { - var data = new ChannelModel(); - Guid channelId = Guid.NewGuid(); - var requestUri = $"api/channel/{channelId}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var channelService = new Mock(caller.Object); - var result = await channelService.Object.GetAsync(channelId); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestGetListAsync() - { - var options = new GetChannelModel(); - var data = new PaginatedListModel(); - var requestUri = $"api/channel"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); - var channelService = new Mock(caller.Object); - var result = await channelService.Object.GetListAsync(options); - caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); - Assert.IsTrue(result is not null); - } -} diff --git a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj deleted file mode 100644 index a006ab3dd..000000000 --- a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net6.0 - enable - false - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - diff --git a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs deleted file mode 100644 index 7add33b0f..000000000 --- a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Mc.Tests; - -[TestClass] -public class McClientTest -{ - [TestMethod] - public void TestAddMcClient() - { - var services = new ServiceCollection(); - services.AddMcClient("https://localhost:18102"); - var mcClient = services.BuildServiceProvider().GetRequiredService(); - - Assert.IsNotNull(mcClient); - } - - [TestMethod] - public void TestAddMcClientShouldThrowArgumentNullException() - { - var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddMcClient(mcServiceBaseAddress: null!)); - } - - [TestMethod] - public void TestAddMcClientShouldThrowArgumentNullException2() - { - var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddMcClient(callerOptions: null!)); - } -} diff --git a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs deleted file mode 100644 index 3b10fcf88..000000000 --- a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Mc.Service; - -namespace Masa.Contrib.StackSdks.Mc.Tests; - -[TestClass] -public class MessageTaskServiceTest -{ - [TestMethod] - public async Task TestGetAsync() - { - var data = new MessageTaskModel(); - Guid id = Guid.NewGuid(); - var requestUri = $"api/message-task/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var messageTaskService = new Mock(caller.Object); - var result = await messageTaskService.Object.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestSendOrdinaryMessageAsync() - { - var options = new SendOrdinaryMessageModel(); - var requestUri = $"api/message-task/SendOrdinaryMessage"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, options, true, default)).Verifiable(); - var messageTaskService = new Mock(caller.Object); - await messageTaskService.Object.SendOrdinaryMessageAsync(options); - caller.Verify(provider => provider.PostAsync(requestUri, options, true, default), Times.Once); - } - - [TestMethod] - public async Task TestSendTemplateMessageAsync() - { - var options = new SendTemplateMessageModel(); - var requestUri = $"api/message-task/SendTemplateMessage"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, options, true, default)).Verifiable(); - var messageTaskService = new Mock(caller.Object); - await messageTaskService.Object.SendTemplateMessageAsync(options); - caller.Verify(provider => provider.PostAsync(requestUri, options, true, default), Times.Once); - } -} diff --git a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs deleted file mode 100644 index bf36d9c4f..000000000 --- a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Mc.Service; - -namespace Masa.Contrib.StackSdks.Mc.Tests; - -[TestClass] -public class MessageTemplateServiceTest -{ - [TestMethod] - public async Task TestGetAsync() - { - var data = new MessageTemplateModel(); - Guid id = Guid.NewGuid(); - var requestUri = $"api/message-template/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var messageTemplateService = new Mock(caller.Object); - var result = await messageTemplateService.Object.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestGetListAsync() - { - var options = new GetMessageTemplateModel(); - var data = new PaginatedListModel(); - var requestUri = $"api/message-template"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); - var messageTemplateService = new Mock(caller.Object); - var result = await messageTemplateService.Object.GetListAsync(options); - caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); - Assert.IsTrue(result is not null); - } -} diff --git a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs deleted file mode 100644 index d4837f198..000000000 --- a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Mc.Service; - -namespace Masa.Contrib.StackSdks.Mc.Tests; - -[TestClass] -public class ReceiverGroupServiceTest -{ - [TestMethod] - public async Task TestGetAsync() - { - var data = new ReceiverGroupModel(); - Guid id = Guid.NewGuid(); - var requestUri = $"api/receiver-group/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var receiverGroupService = new Mock(caller.Object); - var result = await receiverGroupService.Object.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestGetListAsync() - { - var options = new GetReceiverGroupModel(); - var data = new PaginatedListModel(); - var requestUri = $"api/receiver-group"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); - var receiverGroupService = new Mock(caller.Object); - var result = await receiverGroupService.Object.GetListAsync(options); - caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); - Assert.IsTrue(result is not null); - } -} diff --git a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs deleted file mode 100644 index 3b46137aa..000000000 --- a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Mc.Service; - -namespace Masa.Contrib.StackSdks.Mc.Tests; - -[TestClass] -public class WebsiteMessageServiceTest -{ - [TestMethod] - public async Task TestGetAsync() - { - var data = new WebsiteMessageModel(); - Guid id = Guid.NewGuid(); - var requestUri = $"api/website-message/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var websiteMessageService = new Mock(caller.Object); - var result = await websiteMessageService.Object.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestGetListAsync() - { - var options = new GetWebsiteMessageModel(); - var data = new PaginatedListModel(); - var requestUri = $"api/website-message"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); - var websiteMessageService = new Mock(caller.Object); - var result = await websiteMessageService.Object.GetListAsync(options); - caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestCheckAsync() - { - var requestUri = $"api/website-message/Check"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, null, true, default)).Verifiable(); - var websiteMessageService = new Mock(caller.Object); - await websiteMessageService.Object.CheckAsync(); - caller.Verify(provider => provider.PostAsync(requestUri, null, true, default), Times.Once); - } - - [TestMethod] - public async Task TestDeleteAsync() - { - Guid id = Guid.NewGuid(); - var requestUri = $"api/website-message/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.DeleteAsync(requestUri, null, true, default)).Verifiable(); - var websiteMessageService = new Mock(caller.Object); - await websiteMessageService.Object.DeleteAsync(id); - caller.Verify(provider => provider.DeleteAsync(requestUri, null, true, default), Times.Once); - } - - [TestMethod] - public async Task TestGetChannelListAsync() - { - var data = new List(); - var requestUri = $"api/website-message/GetChannelList"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var websiteMessageService = new Mock(caller.Object); - var result = await websiteMessageService.Object.GetChannelListAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestGetNoticeListAsync() - { - var options = new GetNoticeListModel(); - var data = new List(); - var requestUri = $"api/website-message/GetNoticeList"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); - var websiteMessageService = new Mock(caller.Object); - var result = await websiteMessageService.Object.GetNoticeListAsync(options); - caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); - Assert.IsTrue(result is not null); - } - - [TestMethod] - public async Task TestReadAsync() - { - var options = new ReadWebsiteMessageModel(); - var requestUri = $"api/website-message/Read"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, options, true, default)).Verifiable(); - var websiteMessageService = new Mock(caller.Object); - await websiteMessageService.Object.ReadAsync(options); - caller.Verify(provider => provider.PostAsync(requestUri, options, true, default), Times.Once); - } - - [TestMethod] - public async Task TestSetAllReadAsync() - { - var options = new ReadAllWebsiteMessageModel(); - var requestUri = $"api/website-message/SetAllRead"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, options, true, default)).Verifiable(); - var websiteMessageService = new Mock(caller.Object); - await websiteMessageService.Object.SetAllReadAsync(options); - caller.Verify(provider => provider.PostAsync(requestUri, options, true, default), Times.Once); - } -} diff --git a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs b/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs deleted file mode 100644 index d8723b800..000000000 --- a/src/Contrib/StackSdks/Mc/test/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Mc; -global using Masa.BuildingBlocks.StackSdks.Mc.Model; -global using Masa.BuildingBlocks.Service.Caller; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System; -global using System.Collections.Generic; -global using System.Threading.Tasks; diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Constants.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Constants.cs deleted file mode 100644 index 38ebfe1e9..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Constants.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Pm; - -public class Constants -{ - internal const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.pm"; -} diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj deleted file mode 100644 index f6f9a3d68..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/PmClient.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/PmClient.cs deleted file mode 100644 index 2c90caf79..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/PmClient.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm; -using Masa.BuildingBlocks.StackSdks.Pm.Service; -using Masa.Contrib.StackSdks.Pm.Service; - -namespace Masa.Contrib.StackSdks.Pm; - -public class PmClient : IPmClient -{ - public PmClient(ICaller caller) - { - EnvironmentService = new EnvironmentService(caller); - ClusterService = new ClusterService(caller); - ProjectService = new ProjectService(caller); - AppService = new AppService(caller); - } - - public IProjectService ProjectService { get; init; } - - public IEnvironmentService EnvironmentService { get; init; } - - public IClusterService ClusterService { get; init; } - - public IAppService AppService { get; init; } -} diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.md b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.md deleted file mode 100644 index 65f5356d1..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.md +++ /dev/null @@ -1,38 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.StackSdks.Pm - -Effect: - -Obtain relevant data of Pm service through pmclient - -```c# -IPmClient -├── EnvironmentService Environment service -├── ClusterService Cluster service -├── ProjectService Project service -├── AppService App service -``` - -Example: - -```C# -Install-Package Masa.Contrib.StackSdks.Pm -``` - -```C# -builder.Services.AddPmClient("Pm service address"); -``` - -How to use: - -```c# -var app = builder.Build(); - -app.MapGet("/GetProjectApps", ([FromServices] IPmClient pmClient) => -{ - return pmClient.ProjectService.GetProjectAppsAsync("development"); -}); - -app.Run(); -``` diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.zh-CN.md b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.zh-CN.md deleted file mode 100644 index d0d654591..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/README.zh-CN.md +++ /dev/null @@ -1,38 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.StackSdks.Pm - -作用: - -通过PmClient获取Pm服务的相关数据 - -```c# -IPmClient -├── EnvironmentService 环境服务 -├── ClusterService 集群服务 -├── ProjectService 项目服务 -├── AppService 应用服务 -``` - -用例: - -```C# -Install-Package Masa.Contrib.StackSdks.Pm -``` - -```C# -builder.Services.AddPmClient("Pm服务地址"); -``` - -如何使用: - -```c# -var app = builder.Build(); - -app.MapGet("/GetProjectApps", ([FromServices] IPmClient pmClient) => -{ - return pmClient.ProjectService.GetProjectAppsAsync("development"); -}); - -app.Run(); -``` diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/AppService.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/AppService.cs deleted file mode 100644 index 43bbd29ac..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/AppService.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; -using Masa.BuildingBlocks.StackSdks.Pm.Service; - -namespace Masa.Contrib.StackSdks.Pm.Service; - -public class AppService : IAppService -{ - private readonly ICaller _caller; - - public AppService(ICaller caller) - { - _caller = caller; - } - - public async Task GetAsync(int id) - { - var requestUri = $"api/v1/app/{id}"; - var result = await _caller.GetAsync(requestUri); - - return result ?? new(); - } - - public async Task GetByIdentityAsync(string identity) - { - var requestUri = $"open-api/app/{identity}"; - var result = await _caller.GetAsync(requestUri); - - return result ?? new(); - } - - public async Task> GetListAsync() - { - var requestUri = $"api/v1/app"; - var result = await _caller.GetAsync>(requestUri); - - return result ?? new(); - } - - public async Task> GetListByProjectIdsAsync(List projectIds) - { - var requestUri = $"api/v1/projects/app"; - var result = await _caller.PostAsync, List>(requestUri, projectIds); - - return result ?? new(); - } - - public async Task GetWithEnvironmentClusterAsync(int id) - { - var requestUri = $"api/v1/appWhitEnvCluster/{id}"; - var result = await _caller.GetAsync(requestUri); - - return result ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs deleted file mode 100644 index 0f967212d..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; -using Masa.BuildingBlocks.StackSdks.Pm.Service; - -namespace Masa.Contrib.StackSdks.Pm.Service; - -public class ClusterService : IClusterService -{ - private readonly ICaller _caller; - - public ClusterService(ICaller caller) - { - _caller = caller; - } - - public async Task GetAsync(int id) - { - var requestUri = $"api/v1/cluster/{id}"; - var result = await _caller.GetAsync(requestUri); - - return result ?? new(); - } - - public async Task> GetEnvironmentClustersAsync() - { - var requestUri = $"api/v1/envClusters"; - var result = await _caller.GetAsync>(requestUri); - - return result ?? new(); - } - - public async Task> GetListAsync() - { - var requestUri = $"api/v1/cluster"; - var result = await _caller.GetAsync>(requestUri); - - return result ?? new(); - } - - public async Task> GetListByEnvIdAsync(int envId) - { - var requestUri = $"api/v1/{envId}/cluster"; - var result = await _caller.GetAsync>(requestUri); - - return result ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs deleted file mode 100644 index c84048516..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; -using Masa.BuildingBlocks.StackSdks.Pm.Service; - -namespace Masa.Contrib.StackSdks.Pm.Service; - -public class EnvironmentService : IEnvironmentService -{ - private readonly ICaller _caller; - - public EnvironmentService(ICaller caller) - { - _caller = caller; - } - - public async Task GetAsync(int id) - { - var requestUri = $"api/v1/env/{id}"; - var result = await _caller.GetAsync(requestUri); - - return result ?? new(); - } - - public async Task> GetListAsync() - { - var requestUri = $"api/v1/env"; - var result = await _caller.GetAsync>(requestUri); - - return result ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs deleted file mode 100644 index 32602236d..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; -using Masa.BuildingBlocks.StackSdks.Pm.Service; - -namespace Masa.Contrib.StackSdks.Pm.Service; - -public class ProjectService : IProjectService -{ - private readonly ICaller _caller; - - public ProjectService(ICaller caller) - { - _caller = caller; - } - - public async Task> GetProjectAppsAsync(string envName) - { - var requestUri = $"api/v1/projectwithapps/{envName}"; - var result = await _caller.GetAsync>(requestUri); - - return result ?? new(); - } - - public async Task GetAsync(int id) - { - var requestUri = $"api/v1/project/{id}"; - var result = await _caller.GetAsync(requestUri); - - return result ?? new(); - } - - public async Task GetByIdentityAsync(string identity) - { - var requestUri = $"open-api/project/{identity}"; - var result = await _caller.GetAsync(requestUri); - - return result ?? new(); - } - - public async Task> GetListByEnvironmentClusterIdAsync(int envClusterId) - { - var requestUri = $"api/v1/{envClusterId}/project"; - var result = await _caller.GetAsync>(requestUri); - - return result ?? new(); - } - - public async Task> GetListByTeamIdsAsync(List teamIds) - { - var requestUri = $"api/v1/project/teamProjects"; - var result = await _caller.PostAsync>(requestUri, teamIds); - - return result ?? new(); - } - - public async Task> GetProjectTypesAsync() - { - var requestUri = $"api/v1/project/projectType"; - var result = await _caller.GetAsync>(requestUri); - - return result ?? new(); - } -} diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs deleted file mode 100644 index c516b59e2..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm; - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddPmClient(this IServiceCollection services, string pmServiceBaseAddress) - { - if (string.IsNullOrWhiteSpace(pmServiceBaseAddress)) - { - throw new ArgumentNullException(nameof(pmServiceBaseAddress)); - } - - return services.AddPmClient(callerOptions => - { - callerOptions.UseHttpClient(builder => - { - builder.Name = DEFAULT_CLIENT_NAME; - builder.Configure = opt => opt.BaseAddress = new Uri(pmServiceBaseAddress); - }); - }); - } - - public static IServiceCollection AddPmClient(this IServiceCollection services, Action callerOptions) - { - ArgumentNullException.ThrowIfNull(callerOptions, nameof(callerOptions)); - - if (services.Any(service => service.ServiceType == typeof(IPmClient))) - return services; - - services.AddCaller(callerOptions.Invoke); - - services.AddSingleton(serviceProvider => - { - var callProvider = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); - var pmCaching = new PmClient(callProvider); - return pmCaching; - }); - - return services; - } -} diff --git a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/_Imports.cs b/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/_Imports.cs deleted file mode 100644 index 65e519dcd..000000000 --- a/src/Contrib/StackSdks/Pm/src/Masa.Contrib.StackSdks.Pm/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Masa.Contrib.StackSdks.Pm; -global using static Masa.Contrib.StackSdks.Pm.Constants; diff --git a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs deleted file mode 100644 index a362f262c..000000000 --- a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; - -namespace Masa.Contrib.StackSdks.Pm.Tests; - -[TestClass] -public class AppServiceTest -{ - [TestMethod] - [DataRow(1)] - public async Task TestGetAsync(int id) - { - var data = new AppDetailModel(); - - var requestUri = $"api/v1/app/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGet1Async(int id) - { - AppDetailModel? data = null; - - var requestUri = $"api/v1/app/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow("identity")] - public async Task TestGetByIdentityAsync(string identity) - { - var data = new AppDetailModel(); - - var requestUri = $"open-api/app/{identity}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetByIdentityAsync(identity); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow("identity")] - public async Task TestGetByIdentity1Async(string identity) - { - AppDetailModel? data = null; - - var requestUri = $"open-api/app/{identity}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetByIdentityAsync(identity); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - public async Task TestGetListAsync() - { - var data = new List - { - new AppDetailModel() - }; - - var requestUri = $"api/v1/app"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetListAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetList1Async() - { - List? data = null; - - var requestUri = $"api/v1/app"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetListAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } - - [TestMethod] - public async Task TestGetListByProjectIdsAsync() - { - var data = new List - { - new AppDetailModel() - }; - var projectIds = new List { 1 }; - - var requestUri = $"api/v1/projects/app"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync, List>(requestUri, projectIds, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetListByProjectIdsAsync(projectIds); - caller.Verify(provider => provider.PostAsync, List>(requestUri, projectIds, default), Times.Once); - - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetListByProjectIds1Async() - { - List? data = null; - var projectIds = new List { 1 }; - - var requestUri = $"api/v1/projects/app"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync, List>(It.IsAny(), projectIds, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetListByProjectIdsAsync(projectIds); - caller.Verify(provider => provider.PostAsync, List>(requestUri, projectIds, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGetWithEnvironmentClusterAsync(int id) - { - var data = new AppDetailModel(); - - var requestUri = $"api/v1/appWhitEnvCluster/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetWithEnvironmentClusterAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGetWithEnvironmentCluster1Async(int id) - { - AppDetailModel? data = null; - - var requestUri = $"api/v1/appWhitEnvCluster/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.AppService.GetWithEnvironmentClusterAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } -} diff --git a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs deleted file mode 100644 index b25ef71d7..000000000 --- a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; - -namespace Masa.Contrib.StackSdks.Pm.Tests; - -[TestClass] -public class ClusterServiceTest -{ - [TestMethod] - [DataRow(1)] - public async Task TestGetAsync(int id) - { - var data = new ClusterDetailModel(); - - var requestUri = $"api/v1/cluster/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ClusterService.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGetAsync1(int id) - { - ClusterDetailModel? data = null; - - var requestUri = $"api/v1/cluster/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ClusterService.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - public async Task TestGetEnvironmentClustersAsync() - { - var data = new List - { - new EnvironmentClusterModel { Id = 1 } - }; - - var requestUri = $"api/v1/envClusters"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ClusterService.GetEnvironmentClustersAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetEnvironmentClusters1Async() - { - List? data = null; - - var requestUri = $"api/v1/envClusters"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ClusterService.GetEnvironmentClustersAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } - - [TestMethod] - public async Task TestGetListAsync() - { - var data = new List - { - new ClusterModel { Id = 1 } - }; - - var requestUri = $"api/v1/cluster"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ClusterService.GetListAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetList1Async() - { - List? data = null; - - var requestUri = $"api/v1/cluster"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ClusterService.GetListAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGetListByEnvIdAsync(int envId) - { - var data = new List - { - new ClusterModel { Id = 1 } - }; - - var requestUri = $"api/v1/{envId}/cluster"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ClusterService.GetListByEnvIdAsync(envId); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGetListByEnvId1Async(int envId) - { - List? data = null; - - var requestUri = $"api/v1/{envId}/cluster"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ClusterService.GetListByEnvIdAsync(envId); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } -} diff --git a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs deleted file mode 100644 index dbfb3af8f..000000000 --- a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; - -namespace Masa.Contrib.StackSdks.Pm.Tests; - -[TestClass] -public class EnvironmentServiceTest -{ - [TestMethod] - [DataRow(1)] - public async Task TestGetAsync(int id) - { - var data = new EnvironmentDetailModel(); - - var requestUri = $"api/v1/env/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default).Result).Returns(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.EnvironmentService.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGet1Async(int id) - { - EnvironmentDetailModel? data = null; - - var requestUri = $"api/v1/env/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.EnvironmentService.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - public async Task TestGetListAsync() - { - var data = new List - { - new EnvironmentModel { Id=1, Color="", Name="" } - }; - - var requestUri = $"api/v1/env"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.EnvironmentService.GetListAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetList1Async() - { - List? data = null; - - var requestUri = $"api/v1/env"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.EnvironmentService.GetListAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } -} diff --git a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj deleted file mode 100644 index 72c90d70a..000000000 --- a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net6.0 - enable - false - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - diff --git a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs deleted file mode 100644 index 91340da45..000000000 --- a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm; - -namespace Masa.Contrib.StackSdks.Pm.Tests; - -[TestClass] -public class PmClientTest -{ - [TestMethod] - public void TestAddPmClient() - { - var services = new ServiceCollection(); - - services.AddPmClient(option => - { - option.UseHttpClient(builder => - { - builder.Name = "masa.contrib.basicability.pm"; - builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); - }); - }); - - var pmClient = services.BuildServiceProvider().GetRequiredService(); - Assert.IsNotNull(pmClient); - } - - [TestMethod] - public void TestAddPmClient1() - { - var services = new ServiceCollection(); - - services.AddPmClient("https://github.com"); - - var pmClient = services.BuildServiceProvider().GetRequiredService(); - Assert.IsNotNull(pmClient); - } - - [TestMethod] - public void TestAddPmClientShouldThrowArgumentNullException() - { - var services = new ServiceCollection(); - - Assert.ThrowsException(() => services.AddPmClient("")); - } - - [TestMethod] - public void TestAddMultiplePmClient() - { - var services = new ServiceCollection(); - - services.AddPmClient(option => - { - option.UseHttpClient(builder => - { - builder.Name = "masa.contrib.basicability.pm"; - builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); - }); - }); - - services.AddPmClient(option => - { - option.UseHttpClient(builder => - { - builder.Name = "masa.contrib.basicability.pm"; - builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); - }); - }); - - var pmClient = services.BuildServiceProvider().GetRequiredService(); - Assert.IsNotNull(pmClient); - } -} diff --git a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs deleted file mode 100644 index 704b28e30..000000000 --- a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Pm.Model; - -namespace Masa.Contrib.StackSdks.Pm.Tests; - -[TestClass] -public class ProjectServiceTest -{ - [TestMethod] - public async Task TestGetProjectAppsAsync() - { - var data = new List() - { - new ProjectAppsModel(1, "", "", "", Guid.NewGuid()) - }; - string env = "development"; - var requestUri = $"api/v1/projectwithapps/{env}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetProjectAppsAsync(env); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetProjectApps2Async() - { - List? data = null; - string env = "development"; - var requestUri = $"api/v1/projectwithapps/{env}"; - var caller = new Mock(); - caller.Setup(provider => (provider.GetAsync>(It.IsAny(), default))).ReturnsAsync(data) - .Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetProjectAppsAsync(env); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGetAsync(int Id) - { - var data = new ProjectDetailModel(); - - var requestUri = $"api/v1/project/{Id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetAsync(Id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGet1Async(int id) - { - ProjectDetailModel? data = null; - - var requestUri = $"api/v1/project/{id}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetAsync(id); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow("identity")] - public async Task TestGetByIdentityAsync(string identity) - { - var data = new ProjectDetailModel(); - - var requestUri = $"open-api/project/{identity}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetByIdentityAsync(identity); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow("identity")] - public async Task TestGetByIdentity1Async(string identity) - { - ProjectDetailModel? data = null; - - var requestUri = $"open-api/project/{identity}"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetByIdentityAsync(identity); - caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); - - Assert.IsNotNull(result); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGetListByEnvironmentClusterIdAsync(int envClusterId) - { - var data = new List() - { - new ProjectModel { Id = 1 } - }; - var requestUri = $"api/v1/{envClusterId}/project"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetListByEnvironmentClusterIdAsync(envClusterId); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - [DataRow(1)] - public async Task TestGetListByEnvironmentClusterId1Async(int envClusterId) - { - List? data = null; - var requestUri = $"api/v1/{envClusterId}/project"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetListByEnvironmentClusterIdAsync(envClusterId); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } - - [TestMethod] - public async Task TestGetListByTeamIdsAsync() - { - var data = new List() - { - new ProjectModel { Id = 1 } - }; - var teamIds = new List { Guid.NewGuid() }; - var requestUri = $"api/v1/project/teamProjects"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync>(requestUri, teamIds, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetListByTeamIdsAsync(teamIds); - caller.Verify(provider => provider.PostAsync>(requestUri, teamIds, default), Times.Once); - - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetListByTeamIds1Async() - { - List? data = null; - var teamIds = new List { Guid.NewGuid() }; - var requestUri = $"api/v1/project/teamProjects"; - var caller = new Mock(); - caller.Setup(provider => provider.PostAsync>(It.IsAny(), It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetListByTeamIdsAsync(teamIds); - caller.Verify(provider => provider.PostAsync>(requestUri, teamIds, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } - - [TestMethod] - public async Task TestGetProjectTypesAsync() - { - var data = new List() - { - new ProjectTypeModel { Id = 1 } - }; - var requestUri = $"api/v1/project/projectType"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetProjectTypesAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 1); - } - - [TestMethod] - public async Task TestGetProjectTypes1Async() - { - List? data = null; - var requestUri = $"api/v1/project/projectType"; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); - var pmCaching = new PmClient(caller.Object); - - var result = await pmCaching.ProjectService.GetProjectTypesAsync(); - caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); - - Assert.IsTrue(result.Count == 0); - } -} diff --git a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs b/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs deleted file mode 100644 index 5e7752b4e..000000000 --- a/src/Contrib/StackSdks/Pm/test/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System; -global using System.Collections.Generic; -global using System.Threading.Tasks; diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Constants.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Constants.cs deleted file mode 100644 index f1cca0b64..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Constants.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Scheduler; - -internal class Constants -{ - internal const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.scheduler"; - internal const string ENVIRONMENT_KEY = "env_key"; -} diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs deleted file mode 100644 index 07ca11efa..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Scheduler; - -public class HttpClientAuthorizationDelegatingHandler : DelegatingHandler -{ - readonly IHttpContextAccessor _httpContextAccessor; - - public HttpClientAuthorizationDelegatingHandler(IHttpContextAccessor httpContextAccessor) - { - _httpContextAccessor = httpContextAccessor; - } - - protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - { - if (_httpContextAccessor.HttpContext != null) - { - var accessToken = await _httpContextAccessor.HttpContext.GetTokenAsync("access_token"); - request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken); - } - return await base.SendAsync(request, cancellationToken); - } -} diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj deleted file mode 100644 index abc04194e..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.md b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.md deleted file mode 100644 index b89680e04..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.md +++ /dev/null @@ -1,41 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.StackSdks.Scheduler - -Effect: - -Operate API of scheduler service through scheduler client - -```c# -ISchedulerClient -├── SchedulerJobService Scheduler Job service -├── SchedulerTaskService Scheduler Task service -``` - -Example: - -```C# -Install-Package Masa.Contrib.StackSdks.Scheduler -``` - -```C# -builder.Services.AddSchedulerClient("Scheduler service address"); -``` - -How to use: - -```c# -var app = builder.Build(); - -app.MapGet("/startjob", ([FromServices] ISchedulerClient schedulerClient) => -{ - var request = new BaseSchedulerJobRequest() - { - JobId = new Guid("39351BF4-0E58-463F-5C96-08DA42DF67D6"), - OperatorId = new Guid("15905535-C90F-4BCA-467B-08DA42E0A2C0") - }; - return schedulerClient.SchedulerJobService.StartAsync(request); -}); - -app.Run(); -``` diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md deleted file mode 100644 index 85cff55be..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md +++ /dev/null @@ -1,41 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.StackSdks.Scheduler - -作用: - -通过Scheduler Client 操作Scheduler服务的API - -```c# -ISchedulerClient -├── SchedulerJobService Job服务 -├── SchedulerTaskService Task服务 -``` - -用例: - -```C# -Install-Package Masa.Contrib.StackSdks.Scheduler -``` - -```C# -builder.Services.AddSchedulerClient("Scheduler service address"); -``` - -如何使用: - -```c# -var app = builder.Build(); - -app.MapGet("/startjob", ([FromServices] ISchedulerClient schedulerClient) => -{ - var request = new BaseSchedulerJobRequest() - { - JobId = new Guid("39351BF4-0E58-463F-5C96-08DA42DF67D6"), - OperatorId = new Guid("15905535-C90F-4BCA-467B-08DA42E0A2C0") - }; - return schedulerClient.SchedulerJobService.StartAsync(request); -}); - -app.Run(); -``` diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs deleted file mode 100644 index 4d0da0a96..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Scheduler; -using Masa.BuildingBlocks.StackSdks.Scheduler.Service; - -namespace Masa.Contrib.StackSdks.Scheduler; - -public class SchedulerClient : ISchedulerClient -{ - public ISchedulerJobService SchedulerJobService { get; } - - public ISchedulerTaskService SchedulerTaskService { get; } - - public SchedulerClient(ICaller caller, ILoggerFactory? loggerFactory = null) - { - SchedulerJobService = new SchedulerJobService(caller, loggerFactory); - SchedulerTaskService = new SchedulerTaskService(caller, loggerFactory); - } -} diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs deleted file mode 100644 index 0f295327b..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Scheduler; - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddSchedulerClient(this IServiceCollection services, string schedulerServiceBaseAddress) - { - if (string.IsNullOrWhiteSpace(schedulerServiceBaseAddress)) - { - throw new ArgumentNullException(nameof(schedulerServiceBaseAddress)); - } - - return services.AddSchedulerClient(callerOptions => - { - callerOptions.UseHttpClient(builder => - { - builder.Name = DEFAULT_CLIENT_NAME; - builder.Configure = opt => opt.BaseAddress = new Uri(schedulerServiceBaseAddress); - }).AddHttpMessageHandler(); - }); - } - - public static IServiceCollection AddSchedulerClient(this IServiceCollection services, Action callerOptions) - { - ArgumentNullException.ThrowIfNull(callerOptions, nameof(callerOptions)); - - if (services.Any(service => service.ImplementationType == typeof(SchedulerProvider))) - return services; - - services.AddSingleton(); - services.AddScoped(); - services.AddHttpContextAccessor(); - services.AddCaller(callerOptions); - - services.AddScoped(serviceProvider => - { - var callProvider = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); - var loggerFactory = serviceProvider.GetService(); - var schedulerClient = new SchedulerClient(callProvider, loggerFactory); - return schedulerClient; - }); - - return services; - } - - private class SchedulerProvider - { - } -} diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs deleted file mode 100644 index d6f9953e8..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; -using Masa.BuildingBlocks.StackSdks.Scheduler.Request; -using Masa.BuildingBlocks.StackSdks.Scheduler.Service; - -namespace Masa.Contrib.StackSdks.Scheduler.Services; - -public class SchedulerJobService : ISchedulerJobService -{ - const string API = "/api/scheduler-job"; - - readonly ICaller _caller; - readonly ILogger? _logger; - - public SchedulerJobService(ICaller caller, ILoggerFactory? loggerFactory = null) - { - _caller = caller; - _logger = loggerFactory?.CreateLogger(); - } - - public async Task AddAsync(AddSchedulerJobRequest request) - { - if (string.IsNullOrWhiteSpace(request.ProjectIdentity)) - { - throw new ArgumentNullException(nameof(request.ProjectIdentity)); - } - - switch (request.JobType) - { - case JobTypes.JobApp: - ArgumentNullException.ThrowIfNull(request.JobAppConfig, nameof(request.JobAppConfig)); - break; - case JobTypes.Http: - ArgumentNullException.ThrowIfNull(request.HttpConfig, nameof(request.HttpConfig)); - break; - case JobTypes.DaprServiceInvocation: - ArgumentNullException.ThrowIfNull(request.DaprServiceInvocationConfig, nameof(request.DaprServiceInvocationConfig)); - break; - } - - try - { - var requestUri = $"{API}/addSchedulerJobBySdk"; - return await _caller.PostAsync(requestUri, request); - } - catch (Exception ex) - { - _logger?.LogError(ex, "AddSchedulerJobAsync Error"); - return Guid.Empty; - } - - } - - public async Task DisableAsync(BaseSchedulerJobRequest request) - { - try - { - var requestData = new ChangeEnabledStatusRequest() - { - JobId = request.JobId, - OperatorId = request.OperatorId, - Enabled = false - }; - var requestUri = $"{API}/changeEnableStatus"; - await _caller.PutAsync(requestUri, requestData); - return true; - } - catch (Exception ex) - { - _logger?.LogError(ex, "DisableSchedulerJob Error"); - return false; - } - } - - public async Task EnableAsync(BaseSchedulerJobRequest request) - { - try - { - var requestData = new ChangeEnabledStatusRequest() - { - JobId = request.JobId, - OperatorId = request.OperatorId, - Enabled = true - }; - var requestUri = $"{API}/changeEnableStatus"; - await _caller.PutAsync(requestUri, requestData); - return true; - } - catch (Exception ex) - { - _logger?.LogError(ex, "EnableSchedulerJob Error"); - return false; - } - } - - public async Task RemoveAsync(BaseSchedulerJobRequest request) - { - try - { - var requestUri = $"{API}"; - await _caller.DeleteAsync(requestUri, request); - return true; - } - catch (Exception ex) - { - _logger?.LogError(ex, "RemoveSchedulerJobAsync Error"); - return false; - } - } - - public async Task StartAsync(BaseSchedulerJobRequest request) - { - try - { - var requestUri = $"{API}/startJob"; - await _caller.PutAsync(requestUri, request); - return true; - } - catch (Exception ex) - { - _logger?.LogError(ex, "StartSchedulerJobAsync Error"); - return false; - } - } -} diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs deleted file mode 100644 index e7db74b1d..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Scheduler.Request; -using Masa.BuildingBlocks.StackSdks.Scheduler.Service; - -namespace Masa.Contrib.StackSdks.Scheduler.Services; - -public class SchedulerTaskService : ISchedulerTaskService -{ - const string API = "/api/scheduler-task"; - - readonly ICaller _caller; - readonly ILogger? _logger; - - public SchedulerTaskService(ICaller caller, ILoggerFactory? loggerFactory) - { - _caller = caller; - _logger = loggerFactory?.CreateLogger(); - } - - public async Task StopAsync(BaseSchedulerTaskRequest request) - { - try - { - var requestUri = $"{API}/stop"; - await _caller.PutAsync(requestUri, request); - return true; - } - catch (Exception ex) - { - _logger?.LogError(ex, "StopSchedulerTaskAsync Error"); - return false; - } - } - - public async Task StartAsync(BaseSchedulerTaskRequest request) - { - try - { - var requestData = new StartSchedulerTaskRequest() - { - TaskId = request.TaskId, - OperatorId = request.OperatorId, - IsManual = true - }; - - var requestUri = $"{API}/start"; - await _caller.PutAsync(requestUri, requestData); - return true; - } - catch (Exception ex) - { - _logger?.LogError(ex, "StopSchedulerTaskAsync Error"); - return false; - } - } -} diff --git a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/_Imports.cs b/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/_Imports.cs deleted file mode 100644 index 57d942dd5..000000000 --- a/src/Contrib/StackSdks/Scheduler/src/Masa.Contrib.StackSdks.Scheduler/_Imports.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.StackSdks.Scheduler; -global using Masa.Contrib.StackSdks.Scheduler.Services; -global using Masa.Contrib.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Microsoft.AspNetCore.Authentication; -global using Microsoft.AspNetCore.Http; -global using Microsoft.Extensions.Logging; -global using static Masa.Contrib.StackSdks.Scheduler.Constants; diff --git a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj deleted file mode 100644 index c98a289a3..000000000 --- a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - net6.0 - enable - false - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - diff --git a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs deleted file mode 100644 index 8bf68e47e..000000000 --- a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Scheduler; - -namespace Masa.Contrib.StackSdks.Scheduler.Tests; - -[TestClass] -public class SchedulerClientTest -{ - [TestMethod] - public void TestAddSchedulerClientByOptions() - { - var services = new ServiceCollection(); - - services.AddSchedulerClient(option => - { - option.UseHttpClient(builder => - { - builder.Name = "masa.contrib.basicability.scheduler"; - builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); - }); - }); - - var schedulerClient = services.BuildServiceProvider().GetService(); - Assert.IsNotNull(schedulerClient); - } - - [TestMethod] - public void TestAddSchedulerClient() - { - var services = new ServiceCollection(); - services.AddSchedulerClient("https://github.com"); - var schedulerClient = services.BuildServiceProvider().GetService(); - Assert.IsNotNull(schedulerClient); - } - - [TestMethod] - public void TestAddSchedulerClientShouldThrowArgumentNullException() - { - var services = new ServiceCollection(); - - Assert.ThrowsException(() => services.AddSchedulerClient("")); - } - - [TestMethod] - public void TestAddSchedulerClientShouldThrowArgumentNullException2() - { - var services = new ServiceCollection(); - - Assert.ThrowsException(() => services.AddSchedulerClient(callerOptions: null!)); - } - -} diff --git a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs deleted file mode 100644 index b13e932b5..000000000 --- a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; -using Masa.BuildingBlocks.StackSdks.Scheduler.Model; -using Masa.BuildingBlocks.StackSdks.Scheduler.Request; -using Masa.Contrib.StackSdks.Scheduler; - -namespace Masa.Contrib.StackSdks.Scheduler.Tests; - -[TestClass] -public class SchedulerJobServiceTest -{ - const string API = "/api/scheduler-job"; - - [TestMethod] - public async Task TestAddSchedulerHttpJobAsync() - { - var requestData = new AddSchedulerJobRequest() - { - Name = "TestJob", - JobType = JobTypes.Http, - ProjectIdentity = "MASA_MC", - CronExpression = "", - HttpConfig = new SchedulerJobHttpConfig() - { - RequestUrl = "www.baidu.com", - HttpVerifyType = HttpVerifyTypes.CustomStatusCode, - HttpBody = "", - HttpHeaders = new List>() - { - new KeyValuePair("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36") - }, - HttpMethod = HttpMethods.GET, - VerifyContent = "200", - HttpParameters = new List>() - { - new KeyValuePair("ie", "utf-8"), - } - }, - OperatorId = Guid.NewGuid(), - Description = "Test", - FailedRetryCount = 0, - FailedRetryInterval = 0, - IsAlertException = false, - RunTimeoutSecond = 30, - RunTimeoutStrategy = RunTimeoutStrategyTypes.IgnoreTimeout, - ScheduleBlockStrategy = ScheduleBlockStrategyTypes.Parallel, - ScheduleExpiredStrategy = ScheduleExpiredStrategyTypes.Ignore - }; - - var requestUri = $"{API}/addSchedulerJobBySdk"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - var result = await schedulerClient.SchedulerJobService.AddAsync(requestData); - caller.Verify(provider => provider.PostAsync(requestUri, requestData, default), Times.Once); - - Assert.AreNotEqual(Guid.Empty, result); - } - - [TestMethod] - public async Task TestAddSchedulerJobApp() - { - var requestData = new AddSchedulerJobRequest() - { - Name = "TestJob", - JobType = JobTypes.JobApp, - ProjectIdentity = "MASA_MC", - CronExpression = "", - JobAppConfig = new SchedulerJobAppConfig() - { - JobAppIdentity = "MASA_MC_SERVICE", - JobEntryAssembly = "Masa.Test.Job", - JobEntryClassName = "TestRunJob", - JobParams = "1;2;3", - Version = "" - }, - OperatorId = Guid.NewGuid(), - Description = "Test", - FailedRetryCount = 0, - FailedRetryInterval = 0, - IsAlertException = false, - RunTimeoutSecond = 30, - RunTimeoutStrategy = RunTimeoutStrategyTypes.IgnoreTimeout, - ScheduleBlockStrategy = ScheduleBlockStrategyTypes.Parallel, - ScheduleExpiredStrategy = ScheduleExpiredStrategyTypes.Ignore - }; - - var requestUri = $"{API}/addSchedulerJobBySdk"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - var result = await schedulerClient.SchedulerJobService.AddAsync(requestData); - caller.Verify(provider => provider.PostAsync(requestUri, requestData, default), Times.Once); - - Assert.AreNotEqual(Guid.Empty, result); - } - - [TestMethod] - public async Task TestAddSchedulerDaprServiceInvocationJob() - { - var requestData = new AddSchedulerJobRequest() - { - Name = "TestJob", - JobType = JobTypes.DaprServiceInvocation, - ProjectIdentity = "MASA_MC", - CronExpression = "", - DaprServiceInvocationConfig = new SchedulerJobDaprServiceInvocationConfig() - { - DaprServiceIdentity = "MASA_MC_DAPR_SERVICE", - Data = "Test", - HttpMethod = HttpMethods.POST, - MethodName = "TestMethod" - }, - OperatorId = Guid.NewGuid(), - Description = "Test", - FailedRetryCount = 0, - FailedRetryInterval = 0, - IsAlertException = false, - RunTimeoutSecond = 30, - RunTimeoutStrategy = RunTimeoutStrategyTypes.IgnoreTimeout, - ScheduleBlockStrategy = ScheduleBlockStrategyTypes.Parallel, - ScheduleExpiredStrategy = ScheduleExpiredStrategyTypes.Ignore - }; - - var requestUri = $"{API}/addSchedulerJobBySdk"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - var result = await schedulerClient.SchedulerJobService.AddAsync(requestData); - caller.Verify(provider => provider.PostAsync(requestUri, requestData, default), Times.Once); - - Assert.AreNotEqual(Guid.Empty, result); - } - - [TestMethod] - public async Task TestAddSchedulerJobArgumentNullException() - { - var requestData = new AddSchedulerJobRequest() - { - Name = "TestJob", - JobType = JobTypes.Http, - CronExpression = "", - HttpConfig = new SchedulerJobHttpConfig() - { - RequestUrl = "www.baidu.com", - HttpVerifyType = HttpVerifyTypes.CustomStatusCode, - HttpBody = "", - HttpHeaders = new List>() - { - new KeyValuePair("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36") - }, - HttpMethod = HttpMethods.GET, - VerifyContent = "200", - HttpParameters = new List>() - { - new KeyValuePair("ie", "utf-8"), - } - }, - OperatorId = Guid.NewGuid() - }; - - var requestUri = $"{API}/addSchedulerJobBySdk"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); - } - - [TestMethod] - public async Task TestAddSchedulerHttpJobArgumentNullException() - { - var requestData = new AddSchedulerJobRequest() - { - Name = "TestJob", - JobType = JobTypes.Http, - CronExpression = "", - OperatorId = Guid.NewGuid() - }; - - var requestUri = $"{API}/addSchedulerJobBySdk"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); - } - - [TestMethod] - public async Task TestAddSchedulerJobAppArgumentNullException() - { - var requestData = new AddSchedulerJobRequest() - { - Name = "TestJob", - JobType = JobTypes.JobApp, - CronExpression = "", - OperatorId = Guid.NewGuid() - }; - - var requestUri = $"{API}/addSchedulerJobBySdk"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); - } - - [TestMethod] - public async Task TestAddSchedulerDaprInvocationJobArgumentNullException() - { - var requestData = new AddSchedulerJobRequest() - { - Name = "TestJob", - JobType = JobTypes.DaprServiceInvocation, - CronExpression = "", - OperatorId = Guid.NewGuid() - }; - - var requestUri = $"{API}/addSchedulerJobBySdk"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); - } - - [TestMethod] - public async Task TestRemoveSchedulerJobAsync() - { - var requestData = new BaseSchedulerJobRequest() - { - JobId = Guid.NewGuid(), - OperatorId = Guid.NewGuid() - }; - - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.DeleteAsync(API, requestData, true, default)).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - var result = await schedulerClient.SchedulerJobService.RemoveAsync(requestData); - caller.Verify(provider => provider.DeleteAsync(API, requestData, true, default), Times.Once); - - Assert.IsTrue(result); - } - - [TestMethod] - public async Task TestStartSchedulerJobAsync() - { - var requestData = new BaseSchedulerJobRequest() - { - JobId = Guid.NewGuid(), - OperatorId = Guid.NewGuid() - }; - - var requestUri = $"{API}/startJob"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, requestData, true, default)).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - var result = await schedulerClient.SchedulerJobService.StartAsync(requestData); - caller.Verify(provider => provider.PutAsync(requestUri, requestData, true, default), Times.Once); - Assert.IsTrue(result); - } - - [TestMethod] - public async Task TestEnableSchedulerJob() - { - var requestData = new BaseSchedulerJobRequest() - { - JobId = Guid.NewGuid(), - OperatorId = Guid.NewGuid() - }; - - var requestUri = $"{API}/changeEnableStatus"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, It.IsAny(), true, default)).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - var result = await schedulerClient.SchedulerJobService.EnableAsync(requestData); - caller.Verify(provider => provider.PutAsync(requestUri, It.IsAny(), true, default), Times.Once); - Assert.IsTrue(result); - } - - [TestMethod] - public async Task TestDisableSchedulerJob() - { - var requestData = new BaseSchedulerJobRequest() - { - JobId = Guid.NewGuid(), - OperatorId = Guid.NewGuid() - }; - - var requestUri = $"{API}/changeEnableStatus"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, It.IsAny(), true, default)).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - var result = await schedulerClient.SchedulerJobService.DisableAsync(requestData); - caller.Verify(provider => provider.PutAsync(requestUri, It.IsAny(), true, default), Times.Once); - Assert.IsTrue(result); - } -} diff --git a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs deleted file mode 100644 index 3a640a9cc..000000000 --- a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.BuildingBlocks.StackSdks.Scheduler.Request; -using Masa.Contrib.StackSdks.Scheduler; - -namespace Masa.Contrib.StackSdks.Scheduler.Tests; - -[TestClass] -public class SchedulerTaskServiceTest -{ - const string API = "/api/scheduler-task"; - - [TestMethod] - public async Task TestStopSchedulerTaskAsync() - { - var requestData = new BaseSchedulerTaskRequest() - { - TaskId = Guid.NewGuid(), - OperatorId = Guid.NewGuid() - }; - - var requestUri = $"{API}/stop"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, requestData, true, default)).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - var result = await schedulerClient.SchedulerTaskService.StopAsync(requestData); - caller.Verify(provider => provider.PutAsync(requestUri, requestData, true, default), Times.Once); - Assert.IsTrue(result); - } - - [TestMethod] - public async Task TestStartSchedulerTaskAsync() - { - var request = new BaseSchedulerTaskRequest() - { - TaskId = Guid.NewGuid(), - OperatorId = Guid.NewGuid() - }; - - var requestUri = $"{API}/start"; - var caller = new Mock(); - var loggerFactory = new Mock(); - caller.Setup(provider => provider.PutAsync(requestUri, It.IsAny(), true, default)).Verifiable(); - var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); - var result = await schedulerClient.SchedulerTaskService.StartAsync(request); - caller.Verify(provider => provider.PutAsync(requestUri, It.IsAny(), true, default), Times.Once); - Assert.IsTrue(result); - } -} diff --git a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs b/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs deleted file mode 100644 index 1e55edbd1..000000000 --- a/src/Contrib/StackSdks/Scheduler/test/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System; -global using System.Collections.Generic; -global using System.Threading.Tasks; diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs deleted file mode 100644 index 9175c268c..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -[assembly: InternalsVisibleTo("Masa.Contrib.StackSdks.Tsc.Tests")] -namespace Masa.Contrib.Service.Caller; - -internal static class CallerProviderExtensions -{ - public static async Task GetByBodyAsync(this ICaller caller, string url, object? body) where TResult : class - { - var request = new HttpRequestMessage(HttpMethod.Get, url); - if (body is not null) - { - request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(body), Encoding.UTF8, "application/json"); - } - return (await caller.SendAsync(request))!; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs deleted file mode 100644 index 978cfe506..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -[assembly: InternalsVisibleTo("Masa.Contrib.StackSdks.Tsc.Tests")] -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceExtensions -{ - private const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.tsc"; - - public static IServiceCollection AddTscClient(this IServiceCollection services, string tscServiceBaseUri) - { - ArgumentNullException.ThrowIfNull(tscServiceBaseUri, nameof(tscServiceBaseUri)); - - if (services.Any(service => service.ServiceType == typeof(ITscClient))) - return services; - - services.AddCaller(builder => - { - builder.UseHttpClient(options => - { - options.BaseAddress = tscServiceBaseUri; - options.Name = DEFAULT_CLIENT_NAME; - }); - }); - - services.AddSingleton(serviceProvider => - { - var caller = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); - var pmCaching = new TscClient(caller); - return pmCaching; - }); - - return services; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs deleted file mode 100644 index b8d3a5fc5..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace System.IO; - -public static class StreamExtensions -{ - private static readonly Encoding _defaultEncoding = Encoding.UTF8; - - public static async Task ReadAsStringAsync(this Stream stream, Encoding? encoding = null) - { - if (stream == null) - return null; - - if (!stream.CanRead) - return "cann't read"; - - if (!stream.CanSeek) - return "cann't seek"; - - var start = (int)stream.Position; - List data = new(); - var buffer = new byte[1024]; - do - { - var count = await stream.ReadAsync(buffer, 0, buffer.Length); - if (count <= 0) - break; - if (buffer.Length - count == 0) - { - data.AddRange(buffer); - } - else - { - data.AddRange(buffer[0..count]); - break; - } - } while (true); - - if (data.Count > 0) - { - stream.Seek(start, SeekOrigin.Begin); - return (encoding ?? _defaultEncoding).GetString(data.ToArray()); - } - - return null; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs deleted file mode 100644 index 44b412f39..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.Logging; - -public static class OpenTelemetryLoggingExtensions -{ - public static ILoggingBuilder AddMasaOpenTelemetry(this ILoggingBuilder builder, Action configure) - { - builder.AddOpenTelemetry(options => - { - options.IncludeScopes = true; - options.IncludeFormattedMessage = true; - options.ParseStateValues = true; - if (configure != null) - configure.Invoke(options); - }); - - return builder; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj deleted file mode 100644 index 0fef69f87..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs deleted file mode 100644 index b97e729c6..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Tsc; - -public class MasaObservableOptions -{ - public string ProjectName { get; set; } - - public string ServiceName { get; set; } - - public string ServiceNameSpace { get; set; } - - public string ServiceInstanceId { get; set; } - - public string ServiceVersion { get; set; } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs deleted file mode 100644 index 36a3a25bb..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static partial class MasaServiceExtensions -{ - public static IServiceCollection AddMasaMetrics(this IServiceCollection services, Action? configure = null) - { - services.AddOpenTelemetryMetrics(builder => - { - if (configure != null) - configure.Invoke(builder); - - builder.AddRuntimeMetrics() - .AddAspNetCoreInstrumentation() - .AddHttpClientInstrumentation(); - }); - return services; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs deleted file mode 100644 index 0958eca3c..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Tsc; - -/// -/// Constants for semantic attribute names outlined by the OpenTelemetry specifications. -/// . -/// -internal sealed class OpenTelemetryAttributeName -{ - /// - /// Constants for deployment semantic attribute names outlined by the OpenTelemetry specifications. - /// . - /// - internal class Deployment - { - /// - /// The name of the deployment environment (aka deployment tier). - /// - /// staging; production. - public const string ENVIRONMENT = "deployment.environment"; - } - - /// - /// Constants for end user semantic attribute names outlined by the OpenTelemetry specifications. - /// . - /// - internal class EndUser - { - /// - /// Username or client_id extracted from the access token or Authorization header in the inbound request from outside the system. - /// - /// E.g. username. - public const string ID = "enduser.id"; - - /// - /// Actual/assumed role the client is making the request under extracted from token or application security context. - /// - /// E.g. admin. - public const string ROLE = "enduser.role"; - - /// - /// Scopes or granted authorities the client currently possesses extracted from token or application security context. - /// The value would come from the scope associated with an OAuth 2.0 Access Token or an attribute value in a SAML 2.0 Assertion. - /// - /// E.g. read:message,write:files. - public const string SCOPE = "enduser.scope"; - - /// - /// custom attr - /// - public const string USER_NICK_NAME = "enduser.nick_name"; - } - - /// - /// Constants for HTTP semantic attribute names outlined by the OpenTelemetry specifications. - /// . - /// - internal class Http - { - /// - /// The URI scheme identifying the used protocol. - /// - /// E.g. http or https. - public const string SCHEME = "http.scheme"; - - /// - /// Kind of HTTP protocol used. - /// - /// E.g. 1.0, 1.1, 2.0, SPDY or QUIC. - public const string FLAVOR = "http.flavor"; - - /// - /// The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). - /// - /// E.g. 83.164.160.102. - public const string CLIENT_IP = "http.client_ip"; - - /// - /// The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, - /// but not always, present as the Content-Length header. For requests using transport encoding, this should be the - /// compressed size. - /// - /// E.g. 3495. - public const string REQUEST_CONTENT_LENGTH = "http.request_content_length"; - - /// - /// custom attr - /// - public const string REQUEST_CONTENT_BODY = "http.request_content_body"; - - /// - /// The content type of the request body. - /// - /// E.g. application/json. - public const string REQUEST_CONTENT_TYPE = "http.request_content_type"; - - /// - /// The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, - /// but not always, present as the Content-Length header. For requests using transport encoding, this should be the - /// compressed size. - /// - /// E.g. 3495. - public const string RESPONSE_CONTENT_LENGTH = "http.response_content_length"; - - /// - /// The content type of the response body. - /// - /// E.g. application/json. - public const string RESPONSE_CONTENT_TYPE = "http.response_content_type"; - - /// - /// custom attr - /// - public const string RESPONSE_CONTENT_BODY = "http.response_content_body"; - } - - /// - /// Constants for host semantic attribute names outlined by the OpenTelemetry specifications. - /// . - /// - internal static class Host - { - /// - /// Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, - /// or another name specified by the user. - /// - /// E.g. opentelemetry-test. - public const string NAME = "host.name"; - } - - /// - /// Constants for service semantic attribute names outlined by the OpenTelemetry specifications. - /// . - /// - internal class Service - { - public const string NAME = "service.name"; - - /// - /// custom attr - /// - public const string PROJECT_NAME = "service.project.name"; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs deleted file mode 100644 index 23fff56c4..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace OpenTelemetry.Resources; - -public static class ResourceBuilderExtenstions -{ - public static ResourceBuilder AddMasaService( - this ResourceBuilder resourceBuilder, - MasaObservableOptions options, Action? action = null) - { - ArgumentNullException.ThrowIfNull(options, nameof(options)); - - resourceBuilder = resourceBuilder.AddService(options.ServiceName, options.ServiceNameSpace, options.ServiceVersion, true, options.ServiceInstanceId); - - if (!string.IsNullOrEmpty(options.ProjectName)) - resourceBuilder.AddAttributes(new Dictionary { { OpenTelemetryAttributeName.Service.PROJECT_NAME, options.ProjectName } }); - - resourceBuilder.AddTelemetrySdk(); - - if (action != null) - action.Invoke(resourceBuilder); - - return resourceBuilder; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.md b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.md deleted file mode 100644 index ec4fb286a..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.md +++ /dev/null @@ -1,56 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.StackSdks.Tsc - -effect: - -The tracking telemetry data adopts the Opentelemetry standard and integrates the OpenTelemetry SDK to report the telemetry tracking data to the OpenTelemetry-Collector collector, and then export and store the collected data Logging, Tracing, and Metrics through the Exporter - -Example: - - -```C# -Install-Package Masa.Contrib.StackSdks.Tsc -``` - -how to use: - - -```c# -// create and config ResourceBuilder instance -var resources = ResourceBuilder.CreateDefault(); -resources.AddMasaService(new MasaObservableOptions -{ - ServiceName = "example.api" -}); - -//metrics -builder.Services.AddMasaMetrics(builder => { - builder.SetResourceBuilder(resources); - builder.AddOtlpExporter(); -}); - -//trcaing -builder.Services.AddMasaTracing(options => -{ - //api exclude swagger and healthy request - options.AspNetCoreInstrumentationOptions.AppendDefaultFilter(options); - - //blazor exclude blazor resources request - //options.AspNetCoreInstrumentationOptions.AppendBlazorFilter(options); - - options.BuildTraceCallback = builder => - { - builder.SetResourceBuilder(resources); - builder.AddOtlpExporter(); - }; -}); - -//logging -builder.Logging.AddMasaOpenTelemetry(builder => -{ - builder.SetResourceBuilder(resources); - builder.AddOtlpExporter(); -}); - -``` diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md deleted file mode 100644 index 76f1c5a14..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md +++ /dev/null @@ -1,56 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.StackSdks.Tsc - -作用: - -追踪遥测数据采用Opentelemetry标准,并集成了OpenTelemetry SDK,将遥测追踪数据上报到OpenTelemetry-Collector采集器, -再将采集数据Logging、Tracing和Metrics经过Exporter导出存储 - -用例: - -```C# -Install-Package Masa.Contrib.StackSdks.Tsc -``` - -如何使用: - -```c# - -// create and config ResourceBuilder instance -var resources = ResourceBuilder.CreateDefault(); -resources.AddMasaService(new MasaObservableOptions -{ - ServiceName = "example.api" -}); - -//metrics -builder.Services.AddMasaMetrics(builder => { - builder.SetResourceBuilder(resources); - builder.AddOtlpExporter(); -}); - -//trcaing -builder.Services.AddMasaTracing(options => -{ - //api exclude swagger and healthy request - options.AspNetCoreInstrumentationOptions.AppendDefaultFilter(options); - - //blazor exclude blazor resources request - //options.AspNetCoreInstrumentationOptions.AppendBlazorFilter(options); - - options.BuildTraceCallback = builder => - { - builder.SetResourceBuilder(resources); - builder.AddOtlpExporter(); - }; -}); - -//logging -builder.Logging.AddMasaOpenTelemetry(builder => -{ - builder.SetResourceBuilder(resources); - builder.AddOtlpExporter(); -}); - -``` diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs deleted file mode 100644 index b8b9473ef..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Tsc.Service; - -public class LogService : ILogService -{ - private readonly ICaller _caller; - internal const string AGGREGATION_URI = "/api/log/aggregation"; - internal const string LATEST_URI = "/api/log/latest"; - internal const string FIELD_URI = "/api/log/field"; - - public LogService(ICaller caller) - { - _caller = caller; - } - - public async Task>> GetAggregationAsync(LogAggregationRequest query) - { - return (await _caller.GetAsync>>(AGGREGATION_URI, query))!; - } - - public async Task> GetFieldsAsync() - { - return (await _caller.GetAsync>(FIELD_URI))!; - } - - public async Task GetLatestAsync(LogLatestRequest query) - { - return (await _caller.GetAsync(LATEST_URI, query))!; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs deleted file mode 100644 index 85aff1e37..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Tsc.Service; - -internal class MetricService : IMetricService -{ - private readonly ICaller _caller; - internal const string RANGEVALUES_URL = "/api/metric/range-values"; - internal const string NAMES_URI = "/api/metric/names"; - internal const string LABELVALUES_URI = "/api/metric/label-values"; - - public MetricService(ICaller caller) - { - _caller = caller; - } - - public async Task> GetNamesAsync(IEnumerable? matches = default) - { - string param = default!; - if (matches != null && matches.Any()) - { - param = string.Join(',', matches); - } - return (await _caller.GetAsync>(NAMES_URI, new Dictionary { { "match", param } }))!; - } - - public async Task>> GetLabelValuesAsync(LableValuesRequest query) - { - var data = await _caller.GetByBodyAsync>>>(LABELVALUES_URI, query); - if (data == null || !data.ContainsKey(query.Match)) - return new Dictionary>(); - - return data[query.Match]; - } - - public async Task GetValuesAsync(ValuesRequest query) - { - if (query.Lables != null && !string.IsNullOrEmpty(query.Match)) - { - query.Match = $"{query.Match}{{{string.Join(',', query.Lables)}}}"; - } - - return (await _caller.GetByBodyAsync(RANGEVALUES_URL, query))!; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs deleted file mode 100644 index 0c6bcb0bc..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace System.Diagnostics; - -public static class ActivityExtension -{ - public static async Task AddMasaSupplement(this Activity activity, HttpRequest httpRequest) - { - if (activity is null) return null; - - activity.SetTag(OpenTelemetryAttributeName.Http.FLAVOR, httpRequest.Protocol); - activity.SetTag(OpenTelemetryAttributeName.Http.SCHEME, httpRequest.Scheme); - activity.SetTag(OpenTelemetryAttributeName.Http.CLIENT_IP, httpRequest.HttpContext?.Connection.RemoteIpAddress); - activity.SetTag(OpenTelemetryAttributeName.Http.REQUEST_CONTENT_LENGTH, httpRequest.ContentLength); - activity.SetTag(OpenTelemetryAttributeName.Http.REQUEST_CONTENT_TYPE, httpRequest.ContentType); - if (httpRequest.Body != null) - { - if (!httpRequest.Body.CanSeek) - httpRequest.EnableBuffering(); - activity.SetTag(OpenTelemetryAttributeName.Http.REQUEST_CONTENT_BODY, await httpRequest.Body.ReadAsStringAsync(GetHttpRequestEncoding(httpRequest))); - } - activity.SetTag(OpenTelemetryAttributeName.Host.NAME, Dns.GetHostName()); - - return activity; - } - - private static Encoding? GetHttpRequestEncoding(HttpRequest httpRequest) - { - if (httpRequest.Body != null) - { - var contentType = httpRequest.HttpContext.Request.ContentType; - if (!string.IsNullOrEmpty(contentType)) - { - var attr = MediaTypeHeaderValue.Parse(contentType); - if (attr != null && !string.IsNullOrEmpty(attr.CharSet)) - return Encoding.GetEncoding(attr.CharSet); - } - } - - return null; - } - - public static Activity? AddMasaSupplement(this Activity activity, HttpResponse httpResponse) - { - if (activity is null) return null; - - activity.SetTag(OpenTelemetryAttributeName.Http.RESPONSE_CONTENT_LENGTH, httpResponse.ContentLength); - activity.SetTag(OpenTelemetryAttributeName.Http.RESPONSE_CONTENT_TYPE, httpResponse.ContentType); - activity.SetTag(OpenTelemetryAttributeName.Host.NAME, Dns.GetHostName()); - - if ((httpResponse.HttpContext.User?.Claims.Count() ?? 0) > 0) - { - activity.AddTag(OpenTelemetryAttributeName.EndUser.ID, httpResponse.HttpContext.User?.FindFirst("sub")?.Value ?? string.Empty); - activity.AddTag(OpenTelemetryAttributeName.EndUser.USER_NICK_NAME, httpResponse.HttpContext.User?.FindFirst("https://masastack.com/security/authentication/MasaNickName")?.Value ?? string.Empty); - } - - return activity; - } - - public static async Task AddMasaSupplement(this Activity activity, HttpRequestMessage httpRequest) - { - if (activity is null) return null; - - activity.SetTag(OpenTelemetryAttributeName.Http.SCHEME, httpRequest.RequestUri?.Scheme); - activity.SetTag(OpenTelemetryAttributeName.Host.NAME, Dns.GetHostName()); - - if (httpRequest.Content is not null) - { - var st = await httpRequest.Content.ReadAsStreamAsync(); - activity.SetTag(OpenTelemetryAttributeName.Http.REQUEST_CONTENT_BODY, await st.ReadAsStringAsync(GetHttpRequestMessageEncoding(httpRequest))); - } - - return activity; - } - - private static Encoding? GetHttpRequestMessageEncoding(HttpRequestMessage httpRequest) - { - if (httpRequest.Content is not null) - { - var encodeStr = httpRequest.Content.Headers?.ContentType?.CharSet; - - if (!string.IsNullOrEmpty(encodeStr)) - { - return Encoding.GetEncoding(encodeStr); - } - } - - return null; - } - - public static Activity? AddMasaSupplement(this Activity activity, HttpResponseMessage httpResponse) - { - if (activity is null) return null; - - activity.SetTag(OpenTelemetryAttributeName.Host.NAME, Dns.GetHostName()); - - return activity; - } - -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs deleted file mode 100644 index 1cdf430d4..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class AspNetCoreInstrumentationOptionsExtensions -{ - private static List _lstDefaultFilterIgnorePrefix = new() - { - "/swagger", - "/healthz", - }; - - private static List _lstBlazorFilterIgnorePrefix = new() - { - "/swagger", - "/healthz", - "/_blazor", - "/_content", - }; - - private static List _lstBlazorFilterIgnoreSuffix = new() - { - ".js", - ".css", - "/negotiate", - ".ico", - ".png", - ".woff", - ".icon" - }; - - /// - /// The default filter ignore list includes swagger. - /// - /// - /// - public static void AppendDefaultFilter(this Action options, OpenTelemetryInstrumentationOptions openTelemetryInstrumentationOptions) - { - options += opt => - { - opt.Filter = httpContext => - { - return !_lstDefaultFilterIgnorePrefix.Any(prefix => !string.IsNullOrEmpty(httpContext.Request.Path.Value) && httpContext.Request.Path.Value.StartsWith(prefix)); - }; - }; - - openTelemetryInstrumentationOptions.AspNetCoreInstrumentationOptions = options; - } - - /// - /// The filter ignore list includes swagger and blazor and static files. - /// - /// - /// - public static void AppendBlazorFilter(this Action options, OpenTelemetryInstrumentationOptions openTelemetryInstrumentationOptions) - { - options += opt => - { - opt.Filter = httpContext => - { - if (_lstBlazorFilterIgnorePrefix.Any(prefix => !string.IsNullOrEmpty(httpContext.Request.Path.Value) && httpContext.Request.Path.Value.StartsWith(prefix))) - return false; - - if (_lstBlazorFilterIgnoreSuffix.Any(suffix => !string.IsNullOrEmpty(httpContext.Request.Path.Value) && httpContext.Request.Path.Value.EndsWith(suffix))) - return false; - - return true; - }; - }; - - openTelemetryInstrumentationOptions.AspNetCoreInstrumentationOptions = options; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs deleted file mode 100644 index b752e8606..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static partial class MasaServiceExtensions -{ - public static IServiceCollection AddMasaTracing(this IServiceCollection services, Action? configure = null) - { - services.AddOpenTelemetryTracing((builder) => - { - builder.SetSampler(new AlwaysOnSampler()); - var option = new OpenTelemetryInstrumentationOptions(); - if (configure != null) - configure.Invoke(option); - - if (option.AspNetCoreInstrumentationOptions != null) - builder.AddAspNetCoreInstrumentation(option.AspNetCoreInstrumentationOptions); - - if (option.HttpClientInstrumentationOptions != null) - builder.AddHttpClientInstrumentation(option.HttpClientInstrumentationOptions); - - if (option.EntityFrameworkInstrumentationOptions != null) - builder.AddEntityFrameworkCoreInstrumentation(option.EntityFrameworkInstrumentationOptions); - - if (option.ElasticsearchClientInstrumentationOptions != null) - builder.AddElasticsearchClientInstrumentation(option.ElasticsearchClientInstrumentationOptions); - - if (option.StackExchangeRedisCallsInstrumentationOptions != null && option.Connection != null) - builder.AddRedisInstrumentation(option.Connection, option.StackExchangeRedisCallsInstrumentationOptions); - - option.BuildTraceCallback?.Invoke(builder); - }); - - return services; - } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs deleted file mode 100644 index 2282257eb..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the Apache License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public class OpenTelemetryInstrumentationOptions -{ - /// - /// Default record all data. You can replace it or set null - /// - public Action AspNetCoreInstrumentationOptions { get; set; } = options => - { - options.Enrich = async (activity, eventName, rawObject) => - { - if (eventName.Equals("OnStartActivity")) - { - if (rawObject is HttpRequest httpRequest) - { - await activity.AddMasaSupplement(httpRequest); - } - else if (rawObject is HttpRequestMessage httpRequestMessage) - { - await activity.AddMasaSupplement(httpRequestMessage); - } - } - else if (eventName.Equals("OnStopActivity")) - { - if (rawObject is HttpResponse httpResponse) - { - activity.AddMasaSupplement(httpResponse); - } - } - else if (eventName.Equals("OnException")) - { - if (rawObject is Exception exception) - { - activity.SetTag("stackTrace", exception.StackTrace); - } - } - }; - }; - - /// - /// Default record all data. You can replace it or set null - /// - public Action HttpClientInstrumentationOptions { get; set; } = options => - { - options.Enrich = async (activity, eventName, rawObject) => - { - if (eventName.Equals("OnStartActivity")) - { - if (rawObject is HttpRequestMessage httpRequest) - { - await activity.AddMasaSupplement(httpRequest); - } - } - else if (eventName.Equals("OnStopActivity")) - { - if (rawObject is HttpResponseMessage httpResponse) - { - activity.AddMasaSupplement(httpResponse); - } - } - else if (eventName.Equals("OnException")) - { - if (rawObject is Exception exception) - { - activity.SetTag("stackTrace", exception.StackTrace); - } - } - }; - }; - - /// - /// Default record db statement for text. You can replace it or set null - /// - public Action EntityFrameworkInstrumentationOptions { get; set; } = options => - { - options.SetDbStatementForText = true; - }; - - public Action ElasticsearchClientInstrumentationOptions { get; set; } = options => - { - options.ParseAndFormatRequest = true; - }; - - public Action StackExchangeRedisCallsInstrumentationOptions { get; set; } - - public IConnectionMultiplexer Connection { get; set; } - - /// - /// Build trace callback, allow to supplement the build process - /// - public Action BuildTraceCallback { get; set; } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/TscClient.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/TscClient.cs deleted file mode 100644 index 24ad7afae..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/TscClient.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Tsc.Service; - -[assembly: InternalsVisibleTo("Masa.Contrib.StackSdks.Tsc.Tests")] -namespace Masa.Contrib.StackSdks.Tsc; - -internal class TscClient : ITscClient -{ - public TscClient(ICaller caller) - { - LogService = new LogService(caller); - MetricService = new MetricService(caller); - } - - public ILogService LogService { get; } - - public IMetricService MetricService { get; } -} diff --git a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/_Imports.cs b/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/_Imports.cs deleted file mode 100644 index c98d95f23..000000000 --- a/src/Contrib/StackSdks/Tsc/src/Masa.Contrib.StackSdks.Tsc/_Imports.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Tsc; -global using Masa.BuildingBlocks.StackSdks.Tsc.Model; -global using Masa.BuildingBlocks.StackSdks.Tsc.Service; -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.StackSdks.Tsc; -global using Masa.Contrib.Service.Caller; -global using Masa.Contrib.Service.Caller.HttpClient; -global using Microsoft.AspNetCore.Http; -global using Microsoft.Extensions.DependencyInjection; -global using OpenTelemetry.Contrib.Instrumentation.ElasticsearchClient; -global using OpenTelemetry.Contrib.Instrumentation.EntityFrameworkCore; -global using OpenTelemetry.Instrumentation.AspNetCore; -global using OpenTelemetry.Instrumentation.Http; -global using OpenTelemetry.Instrumentation.StackExchangeRedis; -global using OpenTelemetry.Logs; -global using OpenTelemetry.Metrics; -global using OpenTelemetry.Trace; -global using StackExchange.Redis; -global using System.Diagnostics; -global using System.Net; -global using System.Net.Http.Headers; -global using System.Runtime.CompilerServices; -global using System.Text; diff --git a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs deleted file mode 100644 index 69d64d3c6..000000000 --- a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.StackSdks.Tsc.Tests.Extensions; - -[TestClass] -public class CallerProviderExtensionsTests -{ - [TestMethod] - public async Task SendGetRequestWithBodyParameterAsyncTest() - { - var caller = new Mock(); - string url = "http://locahost:80/test"; - var param = new { name = "name" }; - var result = "ok"; - caller.Setup(provider => provider.SendAsync(It.IsAny(), default)).ReturnsAsync(result); - var str = await caller.Object.GetByBodyAsync(url, "name"); - Assert.IsNotNull(str); - Assert.AreEqual(result, str); - } -} diff --git a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj deleted file mode 100644 index 622f55c3c..000000000 --- a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - net6.0 - enable - false - - - - - - - - - - - - - - - - diff --git a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs deleted file mode 100644 index db1f238fd..000000000 --- a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Tsc; -using Masa.Contrib.StackSdks.Tsc.Service; - -namespace Masa.Contrib.StackSdks.Tsc.Tests.Service; - -[TestClass] -public class LogServiceTests -{ - [TestMethod] - public async Task GetMappingFieldsAsyncTest() - { - var caller = new Mock(); - - var time = DateTime.Now; - var query = new LableValuesRequest - { - Match = "up", - Start = time.AddMinutes(-15), - End = time - }; - var data = new string[] - { - "@timestamp", - "container.instance.id", - "container.instance.name", - "Id" - }; - caller.Setup(provider => provider.GetAsync>(LogService.FIELD_URI, default)).ReturnsAsync(data).Verifiable(); - var client = new TscClient(caller.Object); - var result = await client.LogService.GetFieldsAsync(); - Assert.IsNotNull(result); - } - - [TestMethod] - public async Task GetAggregationAsyncTest() - { - var caller = new Mock(); - - var time = DateTime.Now; - var query = new LogAggregationRequest - { - Start = time.AddMinutes(-15), - End = time, - FieldMaps = new FieldAggregationRequest[] - { - new FieldAggregationRequest{ - Name="container.instance.id", - AggregationType= AggregationTypes.Count, - Alias="count1" - }, - new FieldAggregationRequest{ - Name="container.instance.name", - AggregationType= AggregationTypes.Count, - Alias="count2" - } - } - }; - var data = new Dictionary - { - {"count1","0" }, - { "count2","0"} - }; - caller.Setup(provider => provider.GetAsync>>(LogService.FIELD_URI, query, default)).ReturnsAsync(data).Verifiable(); - var client = new TscClient(caller.Object); - - var result = await client.LogService.GetAggregationAsync(query); - Assert.IsNotNull(result); - } - - [TestMethod] - public async Task GetLatestAsyncTest() - { - var caller = new Mock(); - - var time = DateTime.Now; - var query = new LogLatestRequest - { - Start = time.AddMinutes(-15), - End = time, - IsDesc = true, - Query = "\"term\": {\"Resource.service.name\": \"masa.tsc.api\"}" - }; - - var str = "{\"@timestamp\":\"2022-06-15T09:09:05.972899500Z\",\"Attributes.ProcessorName\":\"Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Processor.RetryByDataProcessor\",\"Attributes.exception.message\":\"SQLite Error 1: 'no such table: IntegrationEventLog'.\",\"Attributes.exception.type\":\"SqliteException\",\"Attributes.{OriginalFormat}\":\"Processor '{ProcessorName}' failed\",\"Body\":\"Processor 'Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Processor.RetryByDataProcessor' failed\",\"Resource.service.instance.id\":\"5d9d00e3-5bb0-40bc-bbb8-ef0b210f739d\",\"Resource.service.name\":\"masa.tsc.api\",\"Resource.service.namespace\":\"Development\",\"Resource.service.version\":\"0.1.0\",\"Resource.telemetry.sdk.language\":\"dotnet\",\"Resource.telemetry.sdk.name\":\"opentelemetry\",\"Resource.telemetry.sdk.version\":\"1.3.0.470\",\"SeverityNumber\":13,\"SeverityText\":\"Warning\",\"TraceFlags\":0}"; - var options = new JsonSerializerOptions() - { - PropertyNameCaseInsensitive = true, - }; - options.Converters.Add(new JsonStringEnumConverter()); - var data = JsonSerializer.Deserialize(str, options); - caller.Setup(provider => provider.GetAsync(LogService.LATEST_URI, query, default)).ReturnsAsync(data).Verifiable(); - var client = new TscClient(caller.Object); - - var result = await client.LogService.GetLatestAsync(query); - Assert.IsNotNull(result); - } -} diff --git a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs deleted file mode 100644 index ad339c2bf..000000000 --- a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Contrib.StackSdks.Tsc; -using Masa.Contrib.StackSdks.Tsc.Service; - -namespace Masa.Contrib.StackSdks.Tsc.Tests.Service; - -[TestClass] -public class MetricServiceTests -{ - [TestMethod] - [DataRow(null)] - [DataRow(new string[] { "up", "prometheus_http_requests_total", "prometheus_http_request_duration_seconds_count" })] - [DataRow(new string[] { "not_exists_test" })] - public async Task GetNamesAsyncTest(IEnumerable match) - { - var data = new string[] { "up", "prometheus_http_requests_total", "prometheus_http_request_duration_seconds_count" }; - var caller = new Mock(); - caller.Setup(provider => provider.GetAsync?>(MetricService.NAMES_URI, It.Is>(dic => dic == null || dic.ContainsKey("match")), default)) - .ReturnsAsync((string? url, Dictionary param, CancellationToken token) => - { - if (param == null || !param.ContainsKey("match") || param["match"] is null || !param["match"].Contains("not_exists_test")) - return data; - return default; - }).Verifiable(); - var client = new TscClient(caller.Object); - var result = await client.MetricService.GetNamesAsync(match); - - if (match != null && match.Any(s => s == "not_exists_test")) - { - Assert.IsNull(result); - } - else - { - Assert.IsNotNull(result); - Assert.IsTrue(result.Any()); - } - } - - [TestMethod] - [DataRow("up", "2022-07-01T09:00:00.000Z", "2022-07-05T22:00:00.000Z")] - public async Task GetLabelValuesAsyncTest(string match, string start, string end) - { - var caller = new Mock(); - caller.Setup(provider => provider.SendAsync>>>(It.IsNotNull(), default)) - .ReturnsAsync(new Dictionary>> { - {"up",new Dictionary>{ - {"name",new List{"name1","name2"} } - } } - }); - var client = new TscClient(caller.Object); - - DateTime startDateTime = DateTime.Parse(start); - DateTime endDateTime = DateTime.Parse(end); - var result = await client.MetricService.GetLabelValuesAsync(new LableValuesRequest - { - Match = match, - Start = startDateTime, - End = endDateTime - }); - - Assert.IsNotNull(result); - Assert.IsTrue(result.Any()); - } - - [TestMethod] - [DataRow("up", null, "2022-07-01T09:00:00.000Z", "2022-07-05T22:00:00.000Z")] - public async Task GetValuesAsyncTest(string match, IEnumerable labels, string start, string end) - { - var caller = new Mock(); - caller.Setup(provider => provider.SendAsync(It.IsNotNull(), default)).ReturnsAsync("1.0"); - var client = new TscClient(caller.Object); - - DateTime startDateTime = DateTime.Parse(start); - DateTime endDateTime = DateTime.Parse(end); - var result = await client.MetricService.GetValuesAsync(new ValuesRequest - { - Match = match, - Lables = labels, - End = endDateTime, - Start = startDateTime - }); - Assert.IsNotNull(result); - } -} diff --git a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs b/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs deleted file mode 100644 index fc66f44d2..000000000 --- a/src/Contrib/StackSdks/Tsc/test/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.StackSdks.Tsc.Enums; -global using Masa.BuildingBlocks.StackSdks.Tsc.Model; -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.Service.Caller; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System; -global using System.Collections.Generic; -global using System.Linq; -global using System.Net.Http; -global using System.Text.Json; -global using System.Text.Json.Serialization; -global using System.Threading; -global using System.Threading.Tasks; diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs deleted file mode 100644 index aab4cb5c5..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; - -public abstract class BaseClient -{ - protected readonly ICredentialProvider CredentialProvider; - protected IAliyunStorageOptionProvider OptionProvider { get; } - protected AliyunStorageOptions Options => OptionProvider.GetOptions(); - - public BaseClient(ICredentialProvider credentialProvider, - IAliyunStorageOptionProvider optionProvider) - { - CredentialProvider = credentialProvider; - OptionProvider = optionProvider; - } - - public virtual IOss GetClient() - { - var credential = GetCredential(); - return new OssClient(Options.Endpoint, credential.AccessKeyId, credential.AccessKeySecret, credential.SecurityToken); - } - - public virtual (string AccessKeyId, string AccessKeySecret, string? SecurityToken) GetCredential() - { - if (OptionProvider.IncompleteStsOptions) - return new(Options.AccessKeyId, Options.AccessKeySecret, null); - - var securityToken = CredentialProvider.GetSecurityToken(); - return new(securityToken.AccessKeyId, securityToken.AccessKeySecret, securityToken.SessionToken); - } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs deleted file mode 100644 index 262861402..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; - -public class BucketNameProvider : IBucketNameProvider -{ - private readonly IOptionsMonitor _storageOptions; - - public BucketNameProvider(IOptionsMonitor storageOptions) - => _storageOptions = storageOptions; - - public string GetBucketName() - => _storageOptions.CurrentValue.BucketNames.DefaultBucketName; - - public string GetBucketName() where TContainer : class - => _storageOptions.CurrentValue.BucketNames.GetBucketName(BucketNameAttribute.GetName()); -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs deleted file mode 100644 index b0e386ca9..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; - -public class DefaultCredentialProvider : ICredentialProvider -{ - private readonly IOssClientFactory _ossClientFactory; - private readonly IAliyunStorageOptionProvider _optionProvider; - private readonly IMemoryCache _cache; - protected readonly ILogger? _logger; - - private AliyunStorageOptions Options => _optionProvider.GetOptions(); - - public DefaultCredentialProvider( - IOssClientFactory ossClientFactory, - IAliyunStorageOptionProvider optionProvider, - IMemoryCache cache, - ILogger? logger = null) - { - _ossClientFactory = ossClientFactory; - _optionProvider = optionProvider; - _cache = cache; - _logger = logger; - } - - /// - /// Obtain temporary authorization credentials through STS service - /// - /// - public virtual TemporaryCredentialsResponse GetSecurityToken() - { - if (!_cache.TryGetValue(Options.TemporaryCredentialsCacheKey, out TemporaryCredentialsResponse? temporaryCredentials)) - { - temporaryCredentials = GetTemporaryCredentials( - Options.Sts.RegionId!, - Options.AccessKeyId, - Options.AccessKeySecret, - Options.RoleArn, - Options.RoleSessionName, - Options.Policy, - Options.Sts.GetDurationSeconds()); - SetTemporaryCredentials(temporaryCredentials); - } - return temporaryCredentials!; - } - - public virtual TemporaryCredentialsResponse GetTemporaryCredentials( - string regionId, - string accessKeyId, - string accessKeySecret, - string roleArn, - string roleSessionName, - string policy, - long durationSeconds) - { - IAcsClient client = _ossClientFactory.GetAcsClient(accessKeyId, accessKeySecret, regionId); - var request = new AssumeRoleRequest - { - ContentType = AliyunFormatType.JSON, - RoleArn = roleArn, - RoleSessionName = roleSessionName, - DurationSeconds = durationSeconds - }; - if (!string.IsNullOrEmpty(policy)) - request.Policy = policy; - var response = client.GetAcsResponse(request); - // if (response.HttpResponse.isSuccess()) //todo: Get Sts response information is null, waiting for repair: https://github.com/aliyun/aliyun-openapi-net-sdk/pull/401 - // { - return new TemporaryCredentialsResponse( - response.Credentials.AccessKeyId, - response.Credentials.AccessKeySecret, - response.Credentials.SecurityToken, - DateTime.Parse(response.Credentials.Expiration)); - // } - - // string responseContent = Encoding.Default.GetString(response.HttpResponse.Content); - // string message = - // $"Aliyun.Client: Failed to obtain temporary credentials, RequestId: {response.RequestId}, Status: {response.HttpResponse.Status}, Message: {responseContent}"; - // _logger?.LogWarning( - // "Aliyun.Client: Failed to obtain temporary credentials, RequestId: {RequestId}, Status: {Status}, Message: {Message}", - // response.RequestId, response.HttpResponse.Status, responseContent); - // - // throw new Exception(message); - } - - public virtual void SetTemporaryCredentials(TemporaryCredentialsResponse credentials) - { - var timespan = (DateTime.UtcNow - credentials.Expiration!.Value).TotalSeconds - Options.Sts.GetEarlyExpires(); - if (timespan >= 0) _cache.Set(Options.TemporaryCredentialsCacheKey, credentials, TimeSpan.FromSeconds(timespan)); - } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs deleted file mode 100644 index fdcbb2036..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; - -public class DefaultOssClientFactory : IOssClientFactory -{ - public IOss GetClient(string accessKeyId, string accessKeySecret, string? securityToken, string endpoint) - => new OssClient(endpoint, accessKeyId, accessKeySecret, securityToken); - - public IAcsClient GetAcsClient(string accessKeyId, string accessKeySecret, string regionId) - { - IClientProfile profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret); - return new DefaultAcsClient(profile); - } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs deleted file mode 100644 index 00dc3b101..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; - -public class DefaultStorageClient : BaseClient, IClient -{ - private readonly ILogger? _logger; - - public DefaultStorageClient(ICredentialProvider credentialProvider, - IAliyunStorageOptionProvider optionProvider, - ILogger? logger = null) - : base(credentialProvider, optionProvider) => _logger = logger; - - /// - /// Obtain temporary authorization credentials through STS service - /// - /// - public TemporaryCredentialsResponse GetSecurityToken() - { - if (OptionProvider.IncompleteStsOptions) - throw new ArgumentException( - $"Sts options is imcomplete, {nameof(AliyunStsOptions.RegionId)} or {nameof(Options.RoleArn)} or {nameof(Options.RoleSessionName)} cannot be empty or null"); - - return CredentialProvider.GetSecurityToken(); - } - - /// - /// Obtain temporary request token through authorization service - /// Alibaba Cloud Oss does not support obtaining a temporary authorization token - /// - /// - public string GetToken() => throw new NotSupportedException("GetToken is not supported, please use GetSecurityToken"); - - public Task GetObjectAsync( - string bucketName, - string objectName, - Action callback, - CancellationToken cancellationToken = default) - { - var client = GetClient(); - var result = client.GetObject(bucketName, objectName); - callback.Invoke(result.Content); - return Task.CompletedTask; - } - - public Task GetObjectAsync( - string bucketName, - string objectName, - long offset, - long length, - Action callback, - CancellationToken cancellationToken = default) - { - if (length < 0 && length != -1) - throw new ArgumentOutOfRangeException(nameof(length), $"{length} should be greater than 0 or -1"); - - var client = GetClient(); - var request = new GetObjectRequest(bucketName, objectName); - request.SetRange(offset, length > 0 ? offset + length : length); - var result = client.GetObject(request); - callback.Invoke(result.Content); - return Task.CompletedTask; - } - - public Task PutObjectAsync( - string bucketName, - string objectName, - Stream data, - CancellationToken cancellationToken = default) - { - var client = GetClient(); - var objectMetadata = OptionProvider.SupportCallback ? BuildCallbackMetadata(Options.CallbackUrl, Options.CallbackBody) : null; - var result = !Options.EnableResumableUpload || Options.BigObjectContentLength > data.Length ? - client.PutObject(bucketName, objectName, data, objectMetadata) : - client.ResumableUploadObject(new UploadObjectRequest(bucketName, objectName, data) - { - PartSize = Options.PartSize, - Metadata = objectMetadata - }); - _logger?.LogDebug("----- Upload {ObjectName} from {BucketName} - ({Result})", - objectName, - bucketName, - new UploadObjectResponse(result)); - return Task.CompletedTask; - } - - protected virtual ObjectMetadata BuildCallbackMetadata(string callbackUrl, string callbackBody) - { - string callbackHeaderBuilder = new CallbackHeaderBuilder(callbackUrl, callbackBody).Build(); - var metadata = new ObjectMetadata(); - metadata.AddHeader(HttpHeaders.Callback, callbackHeaderBuilder); - return metadata; - } - - public Task ObjectExistsAsync( - string bucketName, - string objectName, - CancellationToken cancellationToken = default) - { - var client = GetClient(); - var exist = client.DoesObjectExist(bucketName, objectName); - return Task.FromResult(exist); - } - - public async Task DeleteObjectAsync( - string bucketName, - string objectName, - CancellationToken cancellationToken = default) - { - var client = GetClient(); - if (await ObjectExistsAsync(bucketName, objectName, cancellationToken) == false) - return; - - var result = client.DeleteObject(bucketName, objectName); - _logger?.LogDebug("----- Delete {ObjectName} from {BucketName} - ({Result})", - objectName, - bucketName, - result); - } - - public Task DeleteObjectAsync( - string bucketName, - IEnumerable objectNames, - CancellationToken cancellationToken = default) - { - var client = GetClient(); - var result = client.DeleteObjects(new DeleteObjectsRequest(bucketName, objectNames.ToList(), Options.Quiet)); - _logger?.LogDebug("----- Delete {ObjectNames} from {BucketName} - ({Result})", - objectNames, - bucketName, - result); - return Task.CompletedTask; - } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs deleted file mode 100644 index 34dfb9c7c..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; - -public interface IAliyunStorageOptionProvider -{ - bool SupportCallback { get; } - - bool IncompleteStsOptions { get; } - - AliyunStorageOptions GetOptions(); -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs deleted file mode 100644 index 55f292b62..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; - -/// -/// For internal use, structure may change at any time -/// -public interface ICredentialProvider -{ - TemporaryCredentialsResponse GetSecurityToken(); -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs deleted file mode 100644 index 4e6b1dac7..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; - -public interface IOssClientFactory -{ - IOss GetClient(string accessKeyId, string accessKeySecret, string? securityToken, string endpoint); - - IAcsClient GetAcsClient(string accessKeyId, string accessKeySecret, string regionId); -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs deleted file mode 100644 index 26f9e138e..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal; - -internal class Const -{ - public const string TEMPORARY_CREDENTIALS_CACHEKEY = "Aliyun.Storage.TemporaryCredentials"; - - public const string DEFAULT_SECTION = "Aliyun"; - - public const string INTERNAL_ENDPOINT_SUFFIX = "-internal.aliyuncs.com"; - - public const string PUBLIC_ENDPOINT_DOMAIN_SUFFIX = ".aliyuncs.com"; - - public const string ERROR_ENDPOINT_MESSAGE = "Unrecognized endpoint, failed to get RegionId"; - - public const int DEFAULT_DURATION_SECONDS = 3600; - - public const int DEFAULT_EARLY_EXPIRES = 10; -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs deleted file mode 100644 index f57f8fe5b..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal; - -internal class DefaultAliyunStorageOptionProvider : IAliyunStorageOptionProvider -{ - private AliyunStorageOptions _aliyunStorageOptions; - - public bool SupportCallback { get; private set; } - - public bool IncompleteStsOptions { get; private set; } - - public DefaultAliyunStorageOptionProvider(AliyunStorageOptions aliyunStorageOptions) - { - _aliyunStorageOptions = aliyunStorageOptions; - Refresh(); - } - - public DefaultAliyunStorageOptionProvider(IOptionsMonitor options) - : this(GetAliyunStorageOptions(options.CurrentValue)) - { - options.OnChange(aliyunStorageConfigureOptions => - { - _aliyunStorageOptions = GetAliyunStorageOptions(aliyunStorageConfigureOptions); - Refresh(); - }); - } - - public AliyunStorageOptions GetOptions() => _aliyunStorageOptions; - - private static AliyunStorageOptions GetAliyunStorageOptions(AliyunStorageConfigureOptions options) - { - AliyunStorageOptions aliyunStorageOptions = options.Storage; - aliyunStorageOptions.AccessKeyId = TryUpdate(options.Storage.AccessKeyId, options.AccessKeyId)!; - aliyunStorageOptions.AccessKeySecret = TryUpdate(options.Storage.AccessKeySecret, options.AccessKeySecret)!; - aliyunStorageOptions.Sts.RegionId = TryUpdate(options.Storage.Sts.RegionId, options.Sts.RegionId); - aliyunStorageOptions.Sts.DurationSeconds = TryUpdate(options.Storage.Sts.DurationSeconds, options.Sts.DurationSeconds) ?? - options.Sts.GetDurationSeconds(); - aliyunStorageOptions.Sts.EarlyExpires = - TryUpdate(options.Storage.Sts.EarlyExpires, options.Sts.EarlyExpires) ?? options.Sts.GetEarlyExpires(); - return aliyunStorageOptions; - } - - private static long? TryUpdate(long? source, long? destination) - { - if (source != null) - return source; - - return destination; - } - - private static string? TryUpdate(string? source, string? destination) - { - if (!string.IsNullOrWhiteSpace(source)) - return source; - - return destination; - } - - private void Refresh() - { - SupportCallback = !string.IsNullOrEmpty(_aliyunStorageOptions.CallbackBody) && - !string.IsNullOrEmpty(_aliyunStorageOptions.CallbackUrl); - - IncompleteStsOptions = string.IsNullOrEmpty(_aliyunStorageOptions.Sts.RegionId) || - string.IsNullOrEmpty(_aliyunStorageOptions.RoleArn) || - string.IsNullOrEmpty(_aliyunStorageOptions.RoleSessionName); - } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs deleted file mode 100644 index 3c2e261f4..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal; - -internal class ObjectStorageExtensions -{ - internal static string CheckNullOrEmptyAndReturnValue(string? parameter, string parameterName) - { - if (string.IsNullOrEmpty(parameter)) - throw new ArgumentException($"{parameterName} cannot be null and empty string"); - - return parameter; - } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs deleted file mode 100644 index 2874a5e71..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal.Response; - -internal class UploadObjectResponse -{ - public string ETag { get; set; } - - public string VersionId { get; set; } - - public string RequestId { get; set; } - - public HttpStatusCode HttpStatusCode { get; set; } - - public long ContentLength { get; set; } - - public string Response { get; set; } - - public IDictionary ResponseMetadata { get; set; } - - public UploadObjectResponse(PutObjectResult result) - { - ETag = result.ETag; - VersionId = result.VersionId; - HttpStatusCode = result.HttpStatusCode; - RequestId = result.RequestId; - ContentLength = result.ContentLength; - Response = GetCallbackResponse(result); - ResponseMetadata = result.ResponseMetadata; - } - - private string GetCallbackResponse(PutObjectResult putObjectResult) - { - using var stream = putObjectResult.ResponseStream; - if (stream == null) - return string.Empty; - - var buffer = new byte[4 * 1024]; - var bytesRead = stream.Read(buffer, 0, buffer.Length); - string callbackResponse = Encoding.Default.GetString(buffer, 0, bytesRead); - return callbackResponse; - } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj deleted file mode 100644 index 0a20fdd88..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs deleted file mode 100644 index bccda4777..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; - -public class AliyunOptions -{ - public string AccessKeyId { get; set; } - - public string AccessKeySecret { get; set; } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs deleted file mode 100644 index 5a0893230..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; - -public class AliyunStorageConfigureOptions : AliyunOptions -{ - public AliyunStorageOptions Storage { get; set; } = new(); - - public AliyunStsOptions Sts { get; set; } = new(); -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs deleted file mode 100644 index ea920f0b8..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; - -public class AliyunStorageOptions : AliyunOptions -{ - public AliyunStsOptions Sts { get; set; } = new(); - - private string _endpoint; - - public string Endpoint - { - get => _endpoint; - set => _endpoint = value?.Trim() ?? string.Empty; - } - - private string _temporaryCredentialsCacheKey = Const.TEMPORARY_CREDENTIALS_CACHEKEY; - - public string TemporaryCredentialsCacheKey - { - get => _temporaryCredentialsCacheKey; - set => _temporaryCredentialsCacheKey = - ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(value, nameof(TemporaryCredentialsCacheKey)); - } - - /// - /// If policy is empty, the user will get all permissions under this role - /// - public string Policy { get; set; } - - public string RoleArn { get; set; } - - public string RoleSessionName { get; set; } - - /// - /// The server address of the callback request - /// - public string CallbackUrl { get; set; } - - /// - /// The value of the request body when the callback is initiated - /// - public string CallbackBody { get; set; } - - /// - /// Large files enable resume after power failure - /// default: true - /// - public bool EnableResumableUpload { get; set; } - - /// - /// large file length - /// unit: Byte - /// default: 5GB - /// - public long BigObjectContentLength { get; set; } - - /// - /// Gets or sets the size of the part. - /// - /// The size of the part. - public long? PartSize { get; set; } - - /// - /// true: quiet mode; false: detail mode - /// default: true - /// - public bool Quiet { get; set; } - - public AliyunStorageOptions() - { - Quiet = true; - CallbackUrl = string.Empty; - CallbackBody = "bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}"; - EnableResumableUpload = true; - PartSize = null; - BigObjectContentLength = 5 * (long)Math.Pow(1024, 3); - } - - public AliyunStorageOptions(string accessKeyId, string accessKeySecret) : this() - { - AccessKeyId = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(accessKeyId, nameof(accessKeyId)); - AccessKeySecret = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(accessKeySecret, nameof(accessKeySecret)); - } - - public AliyunStorageOptions(string accessKeyId, string accessKeySecret, string endpoint) - : this(accessKeyId, accessKeySecret) - { - Endpoint = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(endpoint, nameof(endpoint)); - } - - public AliyunStorageOptions( - string accessKeyId, - string accessKeySecret, - string endpoint, - string roleArn, - string roleSessionName) - : this(accessKeyId, accessKeySecret, endpoint, roleArn, roleSessionName, null) - { - } - - public AliyunStorageOptions( - string accessKeyId, - string accessKeySecret, - string endpoint, - AliyunStsOptions? stsOptions) - : this(accessKeyId, accessKeySecret) - { - Sts = stsOptions ?? new(); - Endpoint = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(endpoint, nameof(endpoint)); - } - - public AliyunStorageOptions( - string accessKeyId, - string accessKeySecret, - string endpoint, - string roleArn, - string roleSessionName, - AliyunStsOptions? stsOptions) - : this(accessKeyId, accessKeySecret, endpoint, stsOptions) - { - RoleArn = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(roleArn, nameof(roleArn)); - RoleSessionName = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(roleSessionName, nameof(roleSessionName)); - } - - public AliyunStorageOptions SetPolicy(string policy) - { - Policy = policy; - return this; - } - - public AliyunStorageOptions SetTemporaryCredentialsCacheKey(string temporaryCredentialsCacheKey) - { - TemporaryCredentialsCacheKey = temporaryCredentialsCacheKey; - return this; - } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs deleted file mode 100644 index 3cdff636e..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; - -public class AliyunStsOptions -{ - /// - /// sts region id - /// If the RegionId is missing, the temporary Sts credential cannot be obtained. - /// https://help.aliyun.com/document_detail/371859.html - /// https://www.alibabacloud.com/help/en/resource-access-management/latest/endpoints#reference-sdg-3pv-xdb - /// - public string? RegionId { get; set; } - - private long? _durationSeconds = null; - - /// - /// Set the validity period of the temporary access credential, the minimum is 900, and the maximum is 43200. - /// default: 3600 - /// unit: second - /// - public long? DurationSeconds - { - get => _durationSeconds; - set - { - if (value < 900 || value > 43200) - throw new ArgumentOutOfRangeException(nameof(DurationSeconds), $"{nameof(DurationSeconds)} must be in range of 900-43200"); - - _durationSeconds = value; - } - } - - private long? _earlyExpires = null; - - /// - /// Voucher expires early - /// default: 10 - /// unit: second - /// - public long? EarlyExpires - { - get => _earlyExpires; - set - { - if (value < 0) - throw new ArgumentOutOfRangeException(nameof(EarlyExpires), $"{nameof(EarlyExpires)} must be Greater than 0"); - - _earlyExpires = value; - } - } - - public AliyunStsOptions(string? regionId = null) - { - RegionId = regionId; - } - - public long GetDurationSeconds() => DurationSeconds ?? Const.DEFAULT_DURATION_SECONDS; - - public long GetEarlyExpires() => EarlyExpires ?? Const.DEFAULT_EARLY_EXPIRES; -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md deleted file mode 100644 index 2e5998dbd..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md +++ /dev/null @@ -1,147 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Contrib.Storage.ObjectStorage.Aliyun - -Example: - -````C# -Install-Package Masa.Contrib.Storage.ObjectStorage.Aliyun -```` - -support: -* GetSecurityToken: Gets the security token(Sts RegionId and RoleArn and RoleSessionName are required) -* GetObjectAsync: Gets the stream of object data -* PutObjectAsync: Upload objects via Stream -* ObjectExistsAsync: Determine whether the object exists -* DeleteObjectAsync: Delete object - -### Usage 1: - -1. Configure appsettings.json -```` C# -{ - "Aliyun": { - "AccessKeyId": "Replace-With-Your-AccessKeyId", - "AccessKeySecret": "Replace-With-Your-AccessKeySecret", - "Sts": :{ - "RegionId": "Replace-With-Your-RegionId",//https://www.alibabacloud.com/help/en/resource-access-management/latest/endpoints#reference-sdg-3pv-xdb - "DurationSeconds": 3600,//Temporary certificate validity period, default: 3600s - "EarlyExpires": 10//default: 10s - }, - "Storage": { - "Endpoint": "Replace-With-Your-Endpoint",//https://www.alibabacloud.com/help/en/object-storage-service/latest/regions-and-endpoints#section-plb-2vy-5db - "RoleArn": "Replace-With-Your-RoleArn", - "RoleSessionName": "Replace-With-Your-RoleSessionName", - "TemporaryCredentialsCacheKey": "Aliyun.Storage.TemporaryCredentials",//optional, default: Aliyun.Storage.TemporaryCredentials - "Policy": "",//optional - "BucketNames" : { - "DefaultBucketName" : "" - } - } - } -} -```` - -2. Add Aliyun Storage Service - -````C# -builder.Services.AddAliyunStorage(); -```` - -3. Get `IClient` from DI - - ```` C# - //upload files - var fileStream = File.OpenRead("D://favicon.png");//Replace the local file path - await serviceProvider.GetService().PutObjectAsync("storage1-test", "1.png", fileStream); - ```` - -### Usage 2: - -1. Add Aliyun Storage Service - -````C# -var configuration = builder.Configuration; -var aliyunStorageOptions = new AliyunStorageOptions( - configuration["Aliyun:AccessKeyId"], - configuration["Aliyun:AccessKeySecret"], - configuration["Aliyun:Endpoint"], - configuration["Aliyun:RoleArn"], - configuration["Aliyun:RoleSessionName"]) -{ - Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]); -}; -builder.Services.AddAliyunStorage(aliyunStorageOptions); -```` - -2. Get `IClient` from DI and use the corresponding method - -### Usage 3: - -1. Add Aliyun Storage Service - -````C# -var configuration = builder.Configuration; -builder.Services.AddAliyunStorage(() => -{ - return new AliyunStorageOptions( - configuration["Aliyun:AccessKeyId"], - configuration["Aliyun:AccessKeySecret"], - configuration["Aliyun:Endpoint"], - configuration["Aliyun:RoleArn"], - configuration["Aliyun:RoleSessionName"]) - { - Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]) - }; -}); -```` - -2. Get `IClient` from DI and use the corresponding method - -> The difference from usage 2 is to defer getting the configuration - -### Usage 4: - -1. Add Aliyun Storage Service - - 1.1. Sync - - ``` C# - builder.Services.AddAliyunStorage((serviceProvider) => - { - var configuration = serviceProvider.GetRequiredService(); - return new AliyunStorageOptions( - configuration["Aliyun:AccessKeyId"], - configuration["Aliyun:AccessKeySecret"], - configuration["Aliyun:Endpoint"], - configuration["Aliyun:RoleArn"], - configuration["Aliyun:RoleSessionName"]) - { - Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]) - }; - }); - ``` - - 1.2. Async - - ``` C# - builder.Services.AddAliyunStorage(async serviceProvider => - { - var daprClient = serviceProvider.GetRequiredService(); - var accessId = (await daprClient.GetSecretAsync("localsecretstore", "access_id")).First().Value; - var accessSecret = (await daprClient.GetSecretAsync("localsecretstore", "access_secret")).First().Value; - var endpoint = (await daprClient.GetSecretAsync("localsecretstore", "endpoint")).First().Value; - var roleArn = (await daprClient.GetSecretAsync("localsecretstore", "roleArn")).First().Value; - return new AliyunStorageOptions(accessId, accessSecret, endpoint, roleArn, "SessionTest") { - Sts = new AliyunStsOptions() { - RegionId = "cn-hangzhou" - } - }; - }); - ``` - -2. Get `IClient` from DI and use the corresponding method - -> The difference from usage 3 is that the service required for configuration can be obtained through serviceProvider, and finally the configuration object is returned - -> If you do not need to use temporary credentials, you can not configure the parameters of Sts and RoleArn and RoleSessionName. \ No newline at end of file diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md deleted file mode 100644 index bb5c4079d..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md +++ /dev/null @@ -1,149 +0,0 @@ -中 | [EN](README.md) - -## Masa.Contrib.Storage.ObjectStorage.Aliyun - -用例: - -```C# -Install-Package Masa.Contrib.Storage.ObjectStorage.Aliyun -``` - -支持: - -* GetSecurityToken: 获取安全令牌 (Sts RegionId、RoleArn、RoleSessionName是必须的) -* GetObjectAsync: 获取对象数据的流 -* PutObjectAsync: 通过Stream上传对象 -* ObjectExistsAsync: 判断对象是否存在 -* DeleteObjectAsync: 删除对象 - -### 用法1: - -1. 配置appsettings.json - -``` C# -{ - "Aliyun": { - "AccessKeyId": "Replace-With-Your-AccessKeyId", - "AccessKeySecret": "Replace-With-Your-AccessKeySecret", - "Sts": :{ - "RegionId":"Replace-With-Your-Sts-RegionId",//https://help.aliyun.com/document_detail/371859.html - "DurationSeconds":3600,//临时证书有效期, default: 3600秒 - "EarlyExpires":10//default: 10秒 - }, - "Storage": { - "Endpoint": "Replace-With-Your-Endpoint",//https://help.aliyun.com/document_detail/31837.html - "RoleArn": "Replace-With-Your-RoleArn", - "RoleSessionName": "Replace-With-Your-RoleSessionName", - "TemporaryCredentialsCacheKey": "Aliyun.Storage.TemporaryCredentials",//选填、默认: Aliyun.Storage.TemporaryCredentials - "Policy": "",//选填 - "BucketNames" : { - "DefaultBucketName" : "" - } - } - } -} -``` - -2. 添加阿里云存储服务 - -```C# -builder.Services.AddAliyunStorage(); -``` - -3. 从DI获取`IClient` - - ``` C# - //上传文件 - var fileStream = File.OpenRead("D://favicon.png");//更换本地文件路径 - await serviceProvider.GetService().PutObjectAsync("storage1-test", "1.png", fileStream); - ``` - -### 用法2: - -1. 添加阿里云存储服务 - -```C# -var configuration = builder.Configuration; -var aliyunStorageOptions = new AliyunStorageOptions( - configuration["Aliyun:AccessKeyId"], - configuration["Aliyun:AccessKeySecret"], - configuration["Aliyun:Endpoint"], - configuration["Aliyun:RoleArn"], - configuration["Aliyun:RoleSessionName"]) -{ - Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]); -}; -builder.Services.AddAliyunStorage(aliyunStorageOptions); -``` - -2. 从DI获取`IClient`,并使用相应的方法 - -### 用法3: - -1. 添加阿里云存储服务 - -```C# -var configuration = builder.Configuration; -builder.Services.AddAliyunStorage(() => -{ - return new AliyunStorageOptions( - configuration["Aliyun:AccessKeyId"], - configuration["Aliyun:AccessKeySecret"], - configuration["Aliyun:Endpoint"], - configuration["Aliyun:RoleArn"], - configuration["Aliyun:RoleSessionName"]) - { - Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]) - }; -}); -``` - -2. 从DI获取`IClient`,并使用相应的方法 - -> 与用法2的区别在于延缓获取配置 - -### 用法4: - -1. 添加阿里云存储服务 - - 1.1. 同步 - - ``` C# - builder.Services.AddAliyunStorage((serviceProvider) => - { - var configuration = serviceProvider.GetRequiredService(); - return new AliyunStorageOptions( - configuration["Aliyun:AccessKeyId"], - configuration["Aliyun:AccessKeySecret"], - configuration["Aliyun:Endpoint"], - configuration["Aliyun:RoleArn"], - configuration["Aliyun:RoleSessionName"]) - { - Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]) - }; - }); - ``` - - 1.2. 异步 - - ``` C# - builder.Services.AddAliyunStorage(async serviceProvider => - { - var daprClient = serviceProvider.GetRequiredService(); - var accessId = (await daprClient.GetSecretAsync("localsecretstore", "access_id")).First().Value; - var accessSecret = (await daprClient.GetSecretAsync("localsecretstore", "access_secret")).First().Value; - var endpoint = (await daprClient.GetSecretAsync("localsecretstore", "endpoint")).First().Value; - var roleArn = (await daprClient.GetSecretAsync("localsecretstore", "roleArn")).First().Value; - return new AliyunStorageOptions(accessId, accessSecret, endpoint, roleArn, "SessionTest") { - Sts = new AliyunStsOptions() { - RegionId = "cn-hangzhou" - } - }; - }); - ``` - -2. 从DI获取`IClient`,并使用相应的方法 - -> 与用法3的区别在于可以通过serviceProvider获取配置所需要的服务,最后返回配置对象 - -> 如果不需要使用临时凭证,可不配置Sts、RoleArn、RoleSessionName参数 \ No newline at end of file diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs deleted file mode 100644 index 7a7ae5f87..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - /// - /// Add Alibaba Cloud Storage - /// Load configuration information according to the specified SectionName node - /// - /// - /// node name, defaults to Aliyun - /// - /// - public static IServiceCollection AddAliyunStorage( - this IServiceCollection services, - string sectionName = Const.DEFAULT_SECTION) - { - if (string.IsNullOrEmpty(sectionName)) - throw new ArgumentException(sectionName, nameof(sectionName)); - - services.TryAddConfigure($"{sectionName}{ConfigurationPath.KeyDelimiter}{nameof(AliyunStorageConfigureOptions.Storage)}"); - services.TryAddConfigure(sectionName); - services.TryAddSingleton(serviceProvider - => new DefaultAliyunStorageOptionProvider(GetAliyunStorageConfigurationOption(serviceProvider))); - services.TryAddSingleton(serviceProvider - => new DefaultClientContainer(serviceProvider.GetRequiredService(), - serviceProvider.GetRequiredService().GetBucketName())); - return services.AddAliyunStorageCore(); - } - - public static IServiceCollection AddAliyunStorage( - this IServiceCollection services, - AliyunStorageOptions options, - string? defaultBucketName = null) - { - ArgumentNullException.ThrowIfNull(options, nameof(options)); - CheckAliYunStorageOptions(options); - - return services.AddAliyunStorage(() => options, defaultBucketName); - } - - public static IServiceCollection AddAliyunStorage( - this IServiceCollection services, - Func func, - string? defaultBucketName = null) - { - ArgumentNullException.ThrowIfNull(func, nameof(func)); - - services.TryAddSingleton(serviceProvider - => new DefaultAliyunStorageOptionProvider(func.Invoke(serviceProvider))); - return services.AddAliyunStorageCore(defaultBucketName); - } - - public static IServiceCollection AddAliyunStorage( - this IServiceCollection services, - Func> func, - string? defaultBucketName = null) - { - ArgumentNullException.ThrowIfNull(func, nameof(func)); - - services.TryAddSingleton(serviceProvider - => new DefaultAliyunStorageOptionProvider(func.Invoke(serviceProvider).ConfigureAwait(false).GetAwaiter().GetResult())); - return services.AddAliyunStorageCore(defaultBucketName); - } - - public static IServiceCollection AddAliyunStorage( - this IServiceCollection services, - Func func, - string? defaultBucketName = null) - { - ArgumentNullException.ThrowIfNull(func, nameof(func)); - - return services.AddAliyunStorage(_ => func.Invoke(), defaultBucketName); - } - - private static IServiceCollection AddAliyunStorageCore(this IServiceCollection services, string? defaultBucketName = null) - { - services.AddMemoryCache(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - if (defaultBucketName != null) - { - services.Configure(option => - { - option.BucketNames = new BucketNames(new List>() - { - new(BucketNames.DEFAULT_BUCKET_NAME, defaultBucketName) - }); - }); - services.TryAddSingleton(serviceProvider - => new DefaultClientContainer(serviceProvider.GetRequiredService(), defaultBucketName)); - } - - - services.TryAddSingleton(); - services.TryAddSingleton(typeof(IClientContainer<>), typeof(DefaultClientContainer<>)); - services.TryAddSingleton(); - return services; - } - - private static IServiceCollection TryAddConfigure( - this IServiceCollection services, - string sectionName) - where TOptions : class - { - var serviceProvider = services.BuildServiceProvider(); - IConfiguration? configuration = serviceProvider.GetService()?.Local ?? - serviceProvider.GetService(); - - if (configuration == null) - return services; - - string name = Microsoft.Extensions.Options.Options.DefaultName; - services.AddOptions(); - var configurationSection = configuration.GetSection(sectionName); - services.TryAddSingleton>( - new ConfigurationChangeTokenSource(name, configurationSection)); - services.TryAddSingleton>(new NamedConfigureFromConfigurationOptions(name, - configurationSection, _ => - { - })); - return services; - } - - private static IOptionsMonitor GetAliyunStorageConfigurationOption(IServiceProvider serviceProvider) - => serviceProvider.GetRequiredService>(); - - private static IAliyunStorageOptionProvider GetAliyunStorageOptionProvider(IServiceProvider serviceProvider) - => serviceProvider.GetRequiredService(); - - - private static void CheckAliYunStorageOptions(AliyunStorageOptions options) - { - ArgumentNullException.ThrowIfNull(options, nameof(options)); - - if (options.AccessKeyId == null && options.AccessKeySecret == null) - throw new ArgumentException( - $"{nameof(options.AccessKeyId)}, {nameof(options.AccessKeySecret)} are required and cannot be empty"); - - ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(options.AccessKeyId, nameof(options.AccessKeyId)); - ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(options.AccessKeySecret, nameof(options.AccessKeySecret)); - } -} diff --git a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs b/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs deleted file mode 100644 index d66c10c4d..000000000 --- a/src/Contrib/Storage/ObjectStorage/src/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Aliyun.Acs.Core; -global using Aliyun.Acs.Core.Auth.Sts; -global using Aliyun.Acs.Core.Profile; -global using Aliyun.OSS; -global using Aliyun.OSS.Util; -global using Masa.BuildingBlocks.Configuration; -global using Masa.BuildingBlocks.Storage.ObjectStorage; -global using Masa.BuildingBlocks.Storage.ObjectStorage.Response; -global using Masa.Contrib.Storage.ObjectStorage.Aliyun; -global using Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal; -global using Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal.Response; -global using Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; -global using Microsoft.Extensions.Caching.Memory; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using System.Net; -global using System.Text; -global using AliyunFormatType = Aliyun.Acs.Core.Http.FormatType; diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs deleted file mode 100644 index a004463bf..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; - -[TestClass] -public class BaseTest -{ - protected AliyunStorageOptions _aLiYunStorageOptions; - protected const string HANG_ZHOUE_PUBLIC_ENDPOINT = "oss-cn-hangzhou.aliyuncs.com"; - - public BaseTest() - { - _aLiYunStorageOptions = new AliyunStorageOptions( - "AccessKeyId", - "AccessKeySecret", - HANG_ZHOUE_PUBLIC_ENDPOINT, - "RoleArn", - "RoleSessionName"); - } - - protected Mock MockOptionProvider(bool? incompleteStsOptions = null) - { - Mock optionProvider = new(); - if (incompleteStsOptions != null) - optionProvider.Setup(provider => provider.IncompleteStsOptions).Returns(incompleteStsOptions.Value); - optionProvider.Setup(provider => provider.GetOptions()).Returns(_aLiYunStorageOptions); - return optionProvider; - } -} diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs deleted file mode 100644 index a3990698d..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; - -public class CustomCredentialProvider : DefaultCredentialProvider -{ - public readonly TemporaryCredentialsResponse TemporaryCredentials = new( - "accessKeyId", - "secretAccessKey", - "sessionToken", - DateTime.UtcNow.AddHours(-1)); - - public CustomCredentialProvider(IOssClientFactory ossClientFactory, - IAliyunStorageOptionProvider optionProvider, - IMemoryCache cache, - ILogger? logger) - : base(ossClientFactory, optionProvider, cache, logger) - { - } - - public override TemporaryCredentialsResponse GetTemporaryCredentials( - string regionId, - string accessKeyId, - string accessKeySecret, - string roleArn, - string roleSessionName, - string policy, - long durationSeconds) => TemporaryCredentials; - - public TemporaryCredentialsResponse TestGetTemporaryCredentials(string regionId, - string accessKeyId, - string accessKeySecret, - string roleArn, - string roleSessionName, - string policy, - long durationSeconds) - => base.GetTemporaryCredentials(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy, durationSeconds); - - public void TestExpirationTimeLessThan10Second(int durationSeconds) - { - var expirationTime = DateTime.UtcNow.AddSeconds(-durationSeconds); - base.SetTemporaryCredentials(new TemporaryCredentialsResponse("accessKeyId", "secretAccessKey", "sessionToken", expirationTime)); - } -} diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs deleted file mode 100644 index 9d7b59734..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; - -public class CustomNullClient : DefaultCredentialProvider -{ - public string Message = "You are not authorized to do this action. You should be authorized by RAM."; - - public override TemporaryCredentialsResponse GetTemporaryCredentials( - string regionId, - string accessKeyId, - string accessKeySecret, - string roleArn, - string roleSessionName, - string policy, - long durationSeconds) => throw new Exception(Message); - - - public CustomNullClient(IOssClientFactory ossClientFactory, - IAliyunStorageOptionProvider optionProvider, - IMemoryCache cache, - ILogger? logger = null) - : base(ossClientFactory, optionProvider, cache, logger) - { - } -} diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs deleted file mode 100644 index d4ec8a68c..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; - -public class CustomClient : DefaultStorageClient -{ - public Mock? Oss; - - public CustomClient(ICredentialProvider credentialProvider, - IAliyunStorageOptionProvider optionProvider, - ILogger? logger) - : base(credentialProvider, optionProvider, logger) - { - } - - public override IOss GetClient() - { - if (Oss != null) - return Oss.Object; - - Oss = new(); - Oss.Setup(c => c.GetObject(It.IsAny(), It.IsAny())).Returns(GetOssObject()).Verifiable(); - Oss.Setup(c => c.GetObject(It.IsAny())).Returns(GetOssObject()).Verifiable(); - Oss.Setup(c => c.PutObject(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) - .Returns(GetPutObjectResult()).Verifiable(); - Oss.Setup(c => c.ResumableUploadObject(It.IsAny())).Returns(GetPutObjectResult()).Verifiable(); - Oss.Setup(c => c.DoesObjectExist(It.IsAny(), "1.jpg")).Returns(false).Verifiable(); - Oss.Setup(c => c.DoesObjectExist(It.IsAny(), "2.jpg")).Returns(true).Verifiable(); - Oss.Setup(c => c.DeleteObject(It.IsAny(), "1.jpg")).Returns(GetDeleteFail()).Verifiable(); - Oss.Setup(c => c.DeleteObject(It.IsAny(), "2.jpg")).Returns(GetDeleteSuccess()).Verifiable(); - Oss.Setup(c => c.DeleteObjects(It.IsAny())).Returns(GetDeleteObjectsResult()).Verifiable(); - return Oss.Object; - } - - private OssObject GetOssObject() - { - string objectName = string.Empty; - var constructor = typeof(OssObject).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, new[] { typeof(string) })!; - OssObject ossObject = (constructor.Invoke(new object[] { objectName }) as OssObject)!; - ossObject.ResponseStream = null; - return ossObject; - } - - private PutObjectResult GetPutObjectResult() - { - var constructor = typeof(PutObjectResult).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes)!; - var result = (constructor.Invoke(Array.Empty()) as PutObjectResult)!; - result.ResponseStream = new MemoryStream(Encoding.Default.GetBytes("test")); - return result; - } - - private DeleteObjectResult GetDeleteFail() - { - var constructor = typeof(DeleteObjectResult).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes)!; - var result = (constructor.Invoke(Array.Empty()) as DeleteObjectResult)!; - result.HttpStatusCode = HttpStatusCode.NotFound; - return result; - } - - private DeleteObjectResult GetDeleteSuccess() - { - var constructor = typeof(DeleteObjectResult).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes)!; - var result = (constructor.Invoke(Array.Empty()) as DeleteObjectResult)!; - result.HttpStatusCode = HttpStatusCode.OK; - return result; - } - - private DeleteObjectsResult GetDeleteObjectsResult() - { - var constructor = typeof(DeleteObjectsResult).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes)!; - var result = (constructor.Invoke(Array.Empty()) as DeleteObjectsResult)!; - result.HttpStatusCode = HttpStatusCode.OK; - return result; - } -} diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj deleted file mode 100644 index 1bafe0ed3..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - net6.0 - enable - false - enable - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - Always - - - - - - - - diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs deleted file mode 100644 index 511d0989a..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; - -[BucketName("test-bucket")] -public class StorageContainer -{ - -} diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs deleted file mode 100644 index 4861e61f6..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; - -[TestClass] -public class TestALiYunStorageOptions -{ - private const string HANG_ZHOUE_PUBLIC_ENDPOINT = "oss-cn-hangzhou.aliyuncs.com"; - private const string HANG_ZHOUE_INTERNAL_ENDPOINT = "oss-cn-hangzhou-internal.aliyuncs.com"; - private const string TEMPORARY_CREDENTIALS_CACHEKEY = "Aliyun.Storage.TemporaryCredentials"; - - [DataTestMethod] - [DataRow("", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName", "accessKeyId")] - [DataRow("AccessKeyId", "", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName", "accessKeySecret")] - [DataRow("AccessKeyId", "AccessKeySecret", "", "RoleArn", "RoleSessionName", "regionId")] - [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "", "RoleSessionName", "roleArn")] - [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "", "roleSessionName")] - public void TestErrorParameterThrowArgumentException( - string accessKeyId, - string accessKeySecret, - string regionId, - string roleArn, - string roleSessionName, - string parameterName) - { - Assert.ThrowsException(() => - new AliyunStorageOptions(accessKeyId, accessKeySecret, regionId, roleArn, roleSessionName), - $"{parameterName} cannot be empty"); - } - - [TestMethod] - public void TestDurationSecondsGreaterThan43200ReturnThrowArgumentOutOfRangeException() - { - var aliyunStsOptions = new AliyunStsOptions(); - Assert.ThrowsException(() => - aliyunStsOptions.DurationSeconds = 43201, - "DurationSeconds must be in range of 900-43200"); - } - - [TestMethod] - public void TestDurationSecondsLessThan900ReturnThrowArgumentOutOfRangeException() - { - var aliyunStsOptions = new AliyunStsOptions(); - Assert.ThrowsException(() => - aliyunStsOptions.DurationSeconds = 899, - "DurationSeconds must be in range of 900-43200"); - } - - [DataTestMethod] - [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName")] - [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_INTERNAL_ENDPOINT, "RoleArn", "RoleSessionName")] - public void TestSuccessParameterReturnInitializationSuccessful( - string accessKeyId, - string accessKeySecret, - string endpoint, - string roleArn, - string roleSessionName) - { - var options = new AliyunStorageOptions(accessKeyId, accessKeySecret, endpoint, roleArn, roleSessionName); - Assert.IsTrue(options.AccessKeyId == accessKeyId); - Assert.IsTrue(options.AccessKeySecret == accessKeySecret); - Assert.IsTrue(options.Sts.RegionId == null); - Assert.IsTrue(options.RoleArn == roleArn); - Assert.IsTrue(options.RoleSessionName == roleSessionName); - } - - [DataTestMethod] - [DataRow("", "temporaryCredentialsCacheKey")] - [DataRow(null, "temporaryCredentialsCacheKey")] - public void TestErrorTemporaryCredentialsCacheKeyReturnThrowArgumentException( - string temporaryCredentialsCacheKey, - string temporaryCredentialsCacheKeyName) - { - var options = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName"); - Assert.ThrowsException(() => - options.SetTemporaryCredentialsCacheKey(temporaryCredentialsCacheKey), - $"{temporaryCredentialsCacheKeyName} cannot be empty"); - } - - [DataTestMethod] - [DataRow("Aliyun.TemporaryCredentials")] - public void TestNotNullTemporaryCredentialsCacheKeyReturnSuccess(string temporaryCredentialsCacheKey) - { - var options = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName"); - options.SetTemporaryCredentialsCacheKey(temporaryCredentialsCacheKey); - Assert.IsTrue(options.TemporaryCredentialsCacheKey == temporaryCredentialsCacheKey); - } - - [DataTestMethod] - [DataRow("")] - [DataRow(null)] - [DataRow("Policy")] - public void TestSetPolicyReturnSuccess(string policy) - { - var options = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName"); - options.SetPolicy(policy); - Assert.IsTrue(options.Policy == policy); - } - - [DataTestMethod] - [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT)] - public void TestNullRoleArnAndSessionNameReturnSessionNameIsNull( - string accessKeyId, - string accessKeySecret, - string endpoint) - { - var options = new AliyunStorageOptions(accessKeyId, accessKeySecret, endpoint); - Assert.IsTrue(options.Endpoint == HANG_ZHOUE_PUBLIC_ENDPOINT); - Assert.IsTrue(options.TemporaryCredentialsCacheKey == TEMPORARY_CREDENTIALS_CACHEKEY); - Assert.IsTrue(options.Quiet); - Assert.IsNotNull(options.CallbackBody); - Assert.IsTrue(options.EnableResumableUpload); - Assert.IsTrue(options.BigObjectContentLength == 5 * 1024L * 1024 * 1024); - Assert.IsNull(options.RoleArn); - Assert.IsNull(options.RoleSessionName); - - - } - - [TestMethod] - public void TestAliyunStsOptionsDefaultReturnDurationSecondsIs3600() - { - AliyunStsOptions stsOptions = new AliyunStsOptions(); - Assert.IsTrue(stsOptions.RegionId == null); - Assert.IsTrue(stsOptions.GetEarlyExpires() == 10); - Assert.IsTrue(stsOptions.GetDurationSeconds() == 3600); - } - - [TestMethod] - public void TestEarlyExpireLessThanZeroReturnThrowArgumentOutOfRangeException() - { - var options = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT); - Assert.ThrowsException(() => options.Sts = new AliyunStsOptions() - { - EarlyExpires = -1 - }); - } -} diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs deleted file mode 100644 index 77f36058c..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; - -[TestClass] -public class TestClient : BaseTest -{ - private CustomClient _client; - - [TestInitialize] - public void Initialize() - { - Mock credentialProvider = new Mock(); - Mock optionProvider = MockOptionProvider(true); - _client = new CustomClient(credentialProvider.Object, optionProvider.Object, NullLogger.Instance); - } - - [TestMethod] - public void TestGetTokenAndNullLoggerReturnFalse() - { - Mock credentialProvider = new(); - var client = new DefaultStorageClient(credentialProvider.Object, MockOptionProvider(false).Object, null); - Assert.ThrowsException(() => client.GetToken(), "GetToken is not supported, please use GetSecurityToken"); - } - - [TestMethod] - public void TestGetTokenAndNotNullLoggerReturnFalse() - { - Mock credentialProvider = new(); - var client = new DefaultStorageClient(credentialProvider.Object, MockOptionProvider().Object, NullLogger.Instance); - Assert.ThrowsException(() => client.GetToken(), "GetToken is not supported, please use GetSecurityToken"); - } - - [TestMethod] - public void TestGetSecurityTokenByCacheReturnSuccess() - { - Mock credentialProvider = new(); - TemporaryCredentialsResponse temporaryCredentials = new( - "accessKeyId", - "secretAccessKey", - "sessionToken", - DateTime.UtcNow.AddHours(-1)); - credentialProvider.Setup(provider => provider.GetSecurityToken()).Returns(temporaryCredentials); - var client = new DefaultStorageClient(credentialProvider.Object, MockOptionProvider(false).Object, NullLogger.Instance); - var responseBase = client.GetSecurityToken(); - Assert.IsTrue(responseBase == temporaryCredentials); - } - - [TestMethod] - public void TestEmptyRoleArnGetSecurityTokenReturnThrowArgumentException() - { - Mock credentialProvider = new(); - _aLiYunStorageOptions = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT); - var client = new DefaultStorageClient(credentialProvider.Object, MockOptionProvider(true).Object, NullLogger.Instance); - Assert.ThrowsException(() => client.GetSecurityToken()); - } - - [TestMethod] - public async Task TestGetObjectAsyncReturnGetObjecVerifytOnce() - { - await _client.GetObjectAsync("bucketName", "objectName", stream => - { - Assert.IsTrue(stream == null); - }); - _client.Oss!.Verify(oss => oss.GetObject(It.IsAny(), It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestGetObjectAsyncByOffsetReturnGetObjecVerifytOnce() - { - await _client.GetObjectAsync("bucketName", "objectName", 1, 2, stream => - { - Assert.IsTrue(stream == null); - }); - _client.Oss!.Verify(oss => oss.GetObject(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestGetObjectAsyncByLengthLessThan0AndNotEqualMinus1ReturnThrowArgumentOutOfRangeException() - { - await Assert.ThrowsExceptionAsync(async () - => await _client.GetObjectAsync("bucketName", "objectName", 1, -2, null!)); - } - - [TestMethod] - public async Task TestPutObjectAsyncReturnPutObjectVerifytOnce() - { - string str = "JIm"; - await _client.PutObjectAsync("bucketName", "objectName", new MemoryStream(Encoding.Default.GetBytes(str))); - _client.Oss!.Verify(oss => oss.PutObject(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), - Times.Once); - } - - [TestMethod] - public async Task TestPutObjectAsyncReturnResumableUploadObjectVerifytOnce() - { - _aLiYunStorageOptions.BigObjectContentLength = 2; - string str = "JIm"; - await _client.PutObjectAsync("bucketName", "objectName", new MemoryStream(Encoding.Default.GetBytes(str))); - _client.Oss!.Verify(oss => oss.ResumableUploadObject(It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestObjectExistsAsyncReturnNotFound() - { - Assert.IsFalse(await _client.ObjectExistsAsync("bucketName", "1.jpg")); - } - - [TestMethod] - public async Task TestObjectExistsAsyncReturnExist() - { - Assert.IsTrue(await _client.ObjectExistsAsync("bucketName", "2.jpg")); - } - - [TestMethod] - public async Task TestDeleteObjectAsyncReturnVerifytNever() - { - await _client.DeleteObjectAsync("bucketName", "1.jpg"); - _client.Oss!.Verify(oss => oss.DeleteObject(It.IsAny(), It.IsAny()), Times.Never); - } - - [TestMethod] - public async Task TestDeleteObjectAsyncReturnVerifytOnce() - { - await _client.DeleteObjectAsync("bucketName", "2.jpg"); - _client.Oss!.Verify(oss => oss.DoesObjectExist(It.IsAny(), It.IsAny()), Times.Once); - _client.Oss!.Verify(oss => oss.DeleteObject(It.IsAny(), It.IsAny()), Times.Once); - } - - [TestMethod] - public async Task TestDeleteMultiObjectAsyncReturnVerifytOnce() - { - await _client.DeleteObjectAsync("bucketName", new[] { "2.jpg", "1.jpg" }); - _client.Oss!.Verify(oss => oss.DeleteObjects(It.IsAny()), Times.Once); - } -} diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs deleted file mode 100644 index e42235bfc..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; - -[TestClass] -public class TestCredentialProvider : BaseTest -{ - [TestMethod] - public void TestGetSecurityTokenByCacheNotFoundReturnSuccess() - { - var services = new ServiceCollection(); - services.AddMemoryCache(); - services.AddSingleton(); - var serviceProvider = services.BuildServiceProvider(); - var memoryCache = serviceProvider.GetRequiredService(); - - var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), - MockOptionProvider().Object, - memoryCache, - NullLogger.Instance); - var securityToken = client.GetSecurityToken(); - Assert.IsTrue(securityToken.Expiration == client.TemporaryCredentials.Expiration && - securityToken.AccessKeyId == client.TemporaryCredentials.AccessKeyId && - securityToken.AccessKeySecret == client.TemporaryCredentials.AccessKeySecret && - securityToken.SessionToken == client.TemporaryCredentials.SessionToken); - Assert.IsNotNull(memoryCache.Get(_aLiYunStorageOptions.TemporaryCredentialsCacheKey)); - } - - [TestMethod] - public void TestGetSecurityTokenByCacheNotFoundAndGetTemporaryCredentialsIsNullReturnError() - { - var services = new ServiceCollection(); - services.AddMemoryCache(); - services.AddSingleton(); - var serviceProvider = services.BuildServiceProvider(); - var memoryCache = serviceProvider.GetRequiredService(); - var client = new CustomNullClient(serviceProvider.GetRequiredService(), - MockOptionProvider().Object, - memoryCache, - NullLogger.Instance); - Assert.ThrowsException(() => client.GetSecurityToken(), client.Message); - Assert.IsNull(memoryCache.Get(_aLiYunStorageOptions.TemporaryCredentialsCacheKey)); - } - - [TestMethod] - public void TestSetTemporaryCredentialsAndExpirationLessThan10SecondsReturnSkip() - { - var services = new ServiceCollection(); - services.AddMemoryCache(); - services.AddSingleton(); - var serviceProvider = services.BuildServiceProvider(); - var memoryCache = serviceProvider.GetRequiredService(); - var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), - MockOptionProvider().Object, - memoryCache, - NullLogger.Instance); - client.TestExpirationTimeLessThan10Second(5); - Assert.IsNull(memoryCache.Get(_aLiYunStorageOptions.TemporaryCredentialsCacheKey)); - } - - [DataTestMethod] - [DataRow(15)] - [DataRow(20)] - public void TestSetTemporaryCredentialsAndExpirationGreatherThanOrEqual10SecondsReturnSkip(int durationSeconds) - { - var services = new ServiceCollection(); - services.AddMemoryCache(); - services.AddSingleton(); - var serviceProvider = services.BuildServiceProvider(); - var memoryCache = serviceProvider.GetRequiredService(); - var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), - MockOptionProvider().Object, - memoryCache, - NullLogger.Instance); - client.TestExpirationTimeLessThan10Second(durationSeconds); - var res = memoryCache.Get(_aLiYunStorageOptions.TemporaryCredentialsCacheKey); - Assert.IsNotNull(res); - } - - [TestMethod] - public void TestGetTemporaryCredentialsReturnNull() - { - var services = new ServiceCollection(); - services.AddMemoryCache(); - services.AddSingleton(); - var serviceProvider = services.BuildServiceProvider(); - var memoryCache = serviceProvider.GetRequiredService(); - var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), - MockOptionProvider().Object, - memoryCache, - NullLogger.Instance); - Assert.ThrowsException(() => client.TestGetTemporaryCredentials( - "cn-shanghai", - "accessKeyId", - "accessKeySecret", - "roleArn", - "roleSessionName", - string.Empty, - 3600)); - } - - [TestMethod] - public void TestGetTemporaryCredentialsAndNullLoggerReturnThrowException() - { - var services = new ServiceCollection(); - services.AddMemoryCache(); - services.AddSingleton(); - var serviceProvider = services.BuildServiceProvider(); - var memoryCache = serviceProvider.GetRequiredService(); - var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), - MockOptionProvider().Object, - memoryCache, - NullLogger.Instance); - Assert.ThrowsException(() => client.TestGetTemporaryCredentials( - "cn-shanghai", - "accessKeyId", - "accessKeySecret", - "roleArn", - "roleSessionName", - "policy", - 3600)); - } -} diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs deleted file mode 100644 index 6549c55dd..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; - -[TestClass] -public class TestStorage : BaseTest -{ - [TestMethod] - public void TestAddAliyunStorageAndNotAddConfigurationReturnClientIsNotNull() - { - IServiceCollection services = new ServiceCollection(); - services.AddAliyunStorage(); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService()); - } - - [TestMethod] - public void TestAddAliyunStorageByEmptySectionReturnThrowArgumentException() - { - var services = new ServiceCollection(); - Assert.ThrowsException(() => services.AddAliyunStorage(string.Empty)); - } - - [TestMethod] - public void TestAddAliyunStorageReturnClientIsNotNull() - { - var services = new ServiceCollection(); - var configurationRoot = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", true, true) - .Build(); - services.AddSingleton(configurationRoot); - services.AddAliyunStorage(); - var serviceProvider = services.BuildServiceProvider(); - var client = serviceProvider.GetService(); - Assert.IsNotNull(client); - - var bucketProvider = serviceProvider.GetService(); - Assert.IsNotNull(bucketProvider); - - Assert.IsTrue(bucketProvider.GetBucketName() == "test-storage"); - Assert.IsTrue(bucketProvider.GetBucketName() == "test-storage2"); - } - - [TestMethod] - public void TestAddAliyunStorageByJsonReturnGetOptions() - { - var services = new ServiceCollection(); - var configurationRoot = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", true, true) - .Build(); - services.AddSingleton(configurationRoot); - services.AddAliyunStorage(); - var serviceProvider = services.BuildServiceProvider(); - var optionProvider = serviceProvider.GetService(); - Assert.IsNotNull(optionProvider); - Assert.IsFalse(optionProvider.SupportCallback); - Assert.IsFalse(optionProvider.IncompleteStsOptions); - - var aliyunStorageOptions = optionProvider.GetOptions(); - Assert.IsNotNull(aliyunStorageOptions); - - Assert.IsTrue(aliyunStorageOptions.AccessKeyId == "Replace-With-Your-AccessKeyId"); - Assert.IsTrue(aliyunStorageOptions.AccessKeySecret == "Replace-With-Your-AccessKeySecret"); - Assert.IsNotNull(aliyunStorageOptions.Sts); - Assert.IsTrue(aliyunStorageOptions.Sts.RegionId == "cn-hangzhou"); - Assert.IsTrue(aliyunStorageOptions.Sts.DurationSeconds == 900); - Assert.IsTrue(aliyunStorageOptions.Endpoint == "oss-cn-hangzhou.aliyuncs.com"); - Assert.IsTrue(aliyunStorageOptions.TemporaryCredentialsCacheKey == "Aliyun.Storage.TemporaryCredentials"); - Assert.IsTrue(aliyunStorageOptions.Policy == "Policy"); - Assert.IsTrue(aliyunStorageOptions.RoleArn == "Replace-With-Your-RoleArn"); - Assert.IsTrue(aliyunStorageOptions.RoleSessionName == "Replace-With-Your-RoleSessionName"); - } - - [TestMethod] - public void TestAddAliyunStorageByOptions() - { - var services = new ServiceCollection(); - services.AddAliyunStorage(_aLiYunStorageOptions); - - var serviceProvider = services.BuildServiceProvider(); - var optionProvider = serviceProvider.GetService(); - - Assert.IsNotNull(optionProvider); - Assert.IsFalse(optionProvider.SupportCallback); - Assert.IsTrue(optionProvider.IncompleteStsOptions); - - var options = optionProvider.GetOptions(); - Assert.IsTrue(options.AccessKeyId == _aLiYunStorageOptions.AccessKeyId); - Assert.IsTrue(options.AccessKeySecret == _aLiYunStorageOptions.AccessKeySecret); - Assert.IsTrue(options.Endpoint == _aLiYunStorageOptions.Endpoint); - Assert.IsTrue(options.RoleArn == _aLiYunStorageOptions.RoleArn); - Assert.IsTrue(options.RoleSessionName == _aLiYunStorageOptions.RoleSessionName); - } - - [TestMethod] - public void TestAddAliyunStorage() - { - var services = new ServiceCollection(); - services.Configure(option => - { - option.AccessKeyId = "AccessKeyId"; - option.AccessKeySecret = "AccessKeySecret"; - option.Sts = new AliyunStsOptions("RegionId") - { - DurationSeconds = 900, - EarlyExpires = 10, - }; - option.Storage = new AliyunStorageOptions() - { - Endpoint = "Endpoint", - TemporaryCredentialsCacheKey = "TemporaryCredentialsCacheKey", - Policy = "Policy", - RoleArn = "RoleArn", - RoleSessionName = "RoleSessionName", - CallbackUrl = "CallbackUrl", - CallbackBody = "CallbackBody", - EnableResumableUpload = true, - BigObjectContentLength = 200, - PartSize = 10, - Quiet = true - }; - }); - services.AddAliyunStorage(); - - var serviceProvider = services.BuildServiceProvider(); - var optionProvider = serviceProvider.GetService(); - - Assert.IsNotNull(optionProvider); - Assert.IsTrue(optionProvider.SupportCallback); - Assert.IsFalse(optionProvider.IncompleteStsOptions); - - var options = optionProvider.GetOptions(); - Assert.IsTrue(options.Sts.DurationSeconds == 900); - Assert.IsTrue(options.Sts.EarlyExpires == 10); - Assert.IsTrue(options.Sts.RegionId == "RegionId"); - Assert.IsTrue(options.AccessKeyId == "AccessKeyId"); - Assert.IsTrue(options.AccessKeySecret == "AccessKeySecret"); - Assert.IsTrue(options.Endpoint == "Endpoint"); - Assert.IsTrue(options.RoleArn == "RoleArn"); - Assert.IsTrue(options.RoleSessionName == "RoleSessionName"); - Assert.IsTrue(options.TemporaryCredentialsCacheKey == "TemporaryCredentialsCacheKey"); - Assert.IsTrue(options.Policy == "Policy"); - Assert.IsTrue(options.CallbackUrl == "CallbackUrl"); - Assert.IsTrue(options.CallbackBody == "CallbackBody"); - Assert.IsTrue(options.EnableResumableUpload == true); - Assert.IsTrue(options.BigObjectContentLength == 200); - Assert.IsTrue(options.PartSize == 10); - Assert.IsTrue(options.Quiet); - } - - [TestMethod] - public void TestAddAliyunStorage2() - { - var services = new ServiceCollection(); - services.Configure(option => - { - option.AccessKeyId = "AccessKeyId"; - option.AccessKeySecret = "AccessKeySecret"; - option.Sts = new AliyunStsOptions("RegionId") - { - DurationSeconds = 900, - EarlyExpires = 10, - }; - option.Storage = new AliyunStorageOptions() - { - Sts = new AliyunStsOptions() - { - DurationSeconds = 1200, - EarlyExpires = 100, - RegionId = "RegionId2" - }, - AccessKeyId = "AccessKeyId2", - AccessKeySecret = "AccessKeySecret2", - Endpoint = "Endpoint", - TemporaryCredentialsCacheKey = "TemporaryCredentialsCacheKey", - Policy = "Policy", - RoleArn = "RoleArn", - RoleSessionName = "RoleSessionName", - CallbackUrl = "CallbackUrl", - CallbackBody = "CallbackBody", - EnableResumableUpload = true, - BigObjectContentLength = 200, - PartSize = 10, - Quiet = true - }; - }); - services.AddAliyunStorage(); - - var serviceProvider = services.BuildServiceProvider(); - var optionProvider = serviceProvider.GetService(); - - Assert.IsNotNull(optionProvider); - Assert.IsTrue(optionProvider.SupportCallback); - Assert.IsFalse(optionProvider.IncompleteStsOptions); - - var options = optionProvider.GetOptions(); - Assert.IsTrue(options.Sts.DurationSeconds == 1200); - Assert.IsTrue(options.Sts.EarlyExpires == 100); - Assert.IsTrue(options.Sts.RegionId == "RegionId2"); - Assert.IsTrue(options.AccessKeyId == "AccessKeyId2"); - Assert.IsTrue(options.AccessKeySecret == "AccessKeySecret2"); - Assert.IsTrue(options.Endpoint == "Endpoint"); - Assert.IsTrue(options.RoleArn == "RoleArn"); - Assert.IsTrue(options.RoleSessionName == "RoleSessionName"); - Assert.IsTrue(options.TemporaryCredentialsCacheKey == "TemporaryCredentialsCacheKey"); - Assert.IsTrue(options.Policy == "Policy"); - Assert.IsTrue(options.CallbackUrl == "CallbackUrl"); - Assert.IsTrue(options.CallbackBody == "CallbackBody"); - Assert.IsTrue(options.EnableResumableUpload == true); - Assert.IsTrue(options.BigObjectContentLength == 200); - Assert.IsTrue(options.PartSize == 10); - Assert.IsTrue(options.Quiet); - } - - [TestMethod] - public void TestAddAliyunStorageAndNullALiYunStorageOptionsReturnThrowArgumentNullException() - { - var services = new ServiceCollection(); - AliyunStorageOptions aLiYunStorageOptions = null!; - Assert.ThrowsException(() => services.AddAliyunStorage(aLiYunStorageOptions)); - } - - [TestMethod] - public void TestAddAliyunStorageByEmptyAccessKeyIdReturnThrowArgumentNullException() - { - Assert.ThrowsException(() => new AliyunStorageOptions(null!, null!, null!)); - } - - [TestMethod] - public void TestAddAliyunStorageByALiYunStorageOptionsReturnClientNotNull() - { - var services = new ServiceCollection(); - services.AddAliyunStorage(new AliyunStorageOptions("accessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "roleArn", - "roleSessionName")); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService()); - } - - [TestMethod] - public void TestAddMultiAliyunStorageReturnClientCountIs1() - { - var services = new ServiceCollection(); - AliyunStorageOptions options = - new AliyunStorageOptions("accessKeyId", "accessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "roleArn", "roleSessionName"); - services.AddAliyunStorage(options).AddAliyunStorage(options); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService()); - Assert.IsTrue(serviceProvider.GetServices().Count() == 1); - } - - [TestMethod] - public void TestAddAliyunStorageAndNullALiYunStorageOptionsFuncReturnThrowArgumentNullException() - { - var services = new ServiceCollection(); - Func func = null!; - Assert.ThrowsException(() => services.AddAliyunStorage(func)); - } - - [TestMethod] - public void TestDefaultBucketNameReturnDefaultBucketNameEqualTest() - { - var services = new ServiceCollection(); - services.AddAliyunStorage(_aLiYunStorageOptions, "Test"); - var serviceProvider = services.BuildServiceProvider(); - var bucketNameProvider = serviceProvider.GetService(); - Assert.IsNotNull(bucketNameProvider); - Assert.IsTrue(bucketNameProvider.GetBucketName() == "Test"); - } - - [TestMethod] - public void TestClientContainer() - { - var services = new ServiceCollection(); - services.AddAliyunStorage(_aLiYunStorageOptions); - services.Configure(option => - { - option.BucketNames = new BucketNames(new List>() - { - new("test-bucket", "test") - }); - }); - var serviceProvider = services.BuildServiceProvider(); - var defaultClientContainer = serviceProvider.GetService(); - Assert.IsNull(defaultClientContainer); - - var bucketNameProvider = serviceProvider.GetService(); - Assert.IsNotNull(bucketNameProvider); - Assert.IsTrue(bucketNameProvider.GetBucketName() == "test"); - } - - [TestMethod] - public void TestClientFactory() - { - var services = new ServiceCollection(); - services.AddAliyunStorage(_aLiYunStorageOptions); - var serviceProvider = services.BuildServiceProvider(); - var defaultClientContainer = serviceProvider.GetService(); - Assert.IsNull(defaultClientContainer); - - var clientFactory = serviceProvider.GetService(); - Assert.IsNotNull(clientFactory); - - var clientContainer = clientFactory.Create("test-bucket2"); - - var fieldInfo = - typeof(DefaultClientContainer).GetField("_bucketName", - BindingFlags.Instance | BindingFlags.NonPublic); - var bucketName = fieldInfo!.GetValue(clientContainer); - Assert.IsNotNull(bucketName); - Assert.IsTrue(bucketName.ToString() == "test-bucket2"); - } -} \ No newline at end of file diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs deleted file mode 100644 index e72fb8508..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Aliyun.Acs.Core.Exceptions; -global using Aliyun.OSS; -global using Masa.BuildingBlocks.Storage.ObjectStorage; -global using Masa.BuildingBlocks.Storage.ObjectStorage.Response; -global using Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; -global using Microsoft.Extensions.Caching.Memory; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Logging.Abstractions; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Net; -global using System.Reflection; -global using System.Text; diff --git a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json b/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json deleted file mode 100644 index 9e16ff57b..000000000 --- a/src/Contrib/Storage/ObjectStorage/test/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "Aliyun": { - "AccessKeyId": "Replace-With-Your-AccessKeyId", - "AccessKeySecret": "Replace-With-Your-AccessKeySecret", - "Sts": { - "RegionId": "cn-hangzhou", - "DurationSeconds": 900 - }, - "Storage": { - "RoleArn": "Replace-With-Your-RoleArn", - "RoleSessionName": "Replace-With-Your-RoleSessionName", - "TemporaryCredentialsCacheKey": "Aliyun.Storage.TemporaryCredentials", - "Policy": "Policy", - "Endpoint": "oss-cn-hangzhou.aliyuncs.com", - "BucketNames": { - "DefaultBucketName": "test-storage", - "test-bucket": "test-storage2" - } - } - } -} \ No newline at end of file diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs deleted file mode 100644 index b0584d3b7..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.DependencyInjection; - -public class CachingBuilder : ICachingBuilder -{ - /// - /// Initializes a new instance of the class. - /// - /// The to add services to. - /// - public CachingBuilder(IServiceCollection services, string name) - { - Services = services; - Name = name; - } - - /// - public IServiceCollection Services { get; private set; } - - /// - public string Name { get; private set; } -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs deleted file mode 100644 index 20fbe7413..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.DependencyInjection; - -/// -/// Extension methods for configuring an -/// -public static class DistributedCacheClientBuilderExtensions -{ - /// - /// Adds a delegate that will be used to configure a named . - /// - /// The . - /// A delegate that is used to configure an . - /// An that can be used to configure the client. - public static ICachingBuilder ConfigureDistributedCacheClient(this ICachingBuilder builder, Action configureOptions) - where TOptions : class - { - ArgumentNullException.ThrowIfNull(builder, nameof(builder)); - ArgumentNullException.ThrowIfNull(configureOptions, nameof(configureOptions)); - - builder.Services.Configure(builder.Name, configureOptions); - return builder; - } - - /// - /// Adds a delegate that will be used to configure a named . - /// - /// The . - /// - /// An that can be used to configure the client. - public static ICachingBuilder ConfigureDistributedCacheClient(this ICachingBuilder builder, IConfiguration configuration) - where TOptions : class - { - ArgumentNullException.ThrowIfNull(builder, nameof(builder)); - ArgumentNullException.ThrowIfNull(configuration, nameof(configuration)); - - builder.Services.Configure(builder.Name, configuration); - return builder; - } -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs deleted file mode 100644 index 2cb999456..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.DependencyInjection; - -/// -/// A builder for configuring named instances. -/// -public interface ICachingBuilder -{ - /// - /// Gets the application service collection. - /// - IServiceCollection Services { get; } - - /// - /// Gets the name of the client configured by this builder. - /// - string Name { get; } -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs deleted file mode 100644 index 40622509a..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core; - -public abstract class DistributedCacheClientFactory : IDistributedCacheClientFactory -{ - private readonly IOptionsMonitor _optionsMonitor; - - private readonly ConcurrentDictionary> _clients; - private readonly Func> _clientFactory; - - public DistributedCacheClientFactory(IOptionsMonitor optionsMonitor) - { - if (optionsMonitor == null) - { - throw new ArgumentNullException(nameof(optionsMonitor)); - } - - _optionsMonitor = optionsMonitor; - - _clients = new ConcurrentDictionary>(); - - _clientFactory = (name) => - { - return new Lazy(() => - { - return CreateClientHandler(name); - }); - }; - } - - // - public IDistributedCacheClient CreateClient(string name) - { - name ??= string.Empty; - - var client = _clients.GetOrAdd(name, _clientFactory); - - return client.Value; - } - - internal protected abstract IDistributedCacheClient CreateClientHandler(string name); - - protected TOptions GetOptions(string name) - { - return _optionsMonitor.Get(name); - } -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs deleted file mode 100644 index df29f9f34..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core; - -/// -/// Extension methods for . -/// -public static class DistributedCacheClientFactoryExtensions -{ - /// - /// Creates a new using the default configuration. - /// - /// The . - /// An configured using the default configuration. - public static IDistributedCacheClient CreateClient(this IDistributedCacheClientFactory factory) - { - if (factory == null) - { - throw new ArgumentNullException(nameof(factory)); - } - - return factory.CreateClient(string.Empty); - } -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs deleted file mode 100644 index 4deea1873..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.Helpers; - -/// -/// The subscribe helper. -/// -public static class SubscribeHelper -{ - /// - /// Formats the memory cache key. - /// - /// The key. - /// A string. - public static string FormatMemoryCacheKey(string key) - { - var type = typeof(T); - if (type.IsGenericType) - { - var dictType = typeof(Dictionary<,>); - if (type.GetGenericTypeDefinition() == dictType) - key += type.Name + "[" + type.GetGenericArguments()[1].Name + "]"; - else - key += type.Name + "[" + type.GetGenericArguments()[0].Name + "]"; - } - else - { - key += typeof(T).Name; - } - - return key; - } - - /// - /// Formats the subscribe channel. - /// - /// The key. - /// The type. - /// The prefix. - /// A string. - public static string FormatSubscribeChannel(string key, SubscribeKeyTypes type, string prefix = "") - { - var valueTypeFullName = typeof(T).FullName!; - switch (type) - { - case SubscribeKeyTypes.ValueTypeFullName: - return valueTypeFullName; - case SubscribeKeyTypes.ValueTypeFullNameAndKey: - return $"[{valueTypeFullName}]{key}"; - case SubscribeKeyTypes.SpecificPrefix: - return $"{prefix}{key}"; - default: - throw new NotImplementedException(); - } - } -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs deleted file mode 100644 index b09ed34ca..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.Interfaces; - -/// -/// The interface for cache client. -/// -public interface ICacheClient : IDisposable -{ - /// - /// Gets a value with given key. - /// - /// A string identifying the request value. - /// The located value or null. - T? Get(string key); - - /// - /// Gets a value with given key. - /// - /// A string identifying the request value. - /// The that represents the asynchronous opertion, containing the located value or null. - Task GetAsync(string key); - - /// - /// Gets or sets a value with given key. - /// - /// A string identifying the request value. - /// The setter. - /// The . - /// The located value. - T? GetOrSet(string key, Func setter, CombinedCacheEntryOptions? options = null); - - /// - /// Gets or sets a value with given key. - /// - /// A string identifying the request value. - /// The setter. - /// The . - /// The that represents the asynchronous opertion, containing the located value. - Task GetOrSetAsync(string key, Func setter, CombinedCacheEntryOptions? options = null); - - /// - /// Gets a list of values with given keys. - /// - /// A list of string identifying the request value. - /// The located values without . - IEnumerable GetList(string[] keys); - - /// - /// Gets a list of values with given keys. - /// - /// A list of string identifying the request value. - /// The that represents the asynchronous opertion, containing the located values with . - Task> GetListAsync(string[] keys); - - /// - /// Removes a list of values with given keys. - /// - /// A list of string identifying the requested value. - void Remove(params string[] keys); - - /// - /// Removes a list of values with given keys. - /// - /// A list of string identifying the requested value. - Task RemoveAsync(params string[] keys); - - /// - /// Sets a value with given key. - /// - /// A string identifying the requested value. - /// The value to set int the cache. - /// The cache options for the value. - void Set(string key, T value, CombinedCacheEntryOptions? options = null); - - /// - /// Sets a value with given key. - /// - /// A string identifying the requested value. - /// The value to set int the cache. - /// The cache options for the value. - /// The that represents the asynchronous operation. - Task SetAsync(string key, T value, CombinedCacheEntryOptions? options = null); - - /// - /// Sets a list of cahce items contains key and value. - /// - /// The contains the cache key and cache value. - /// The cache options for the value. - void SetList(Dictionary keyValues, CombinedCacheEntryOptions? options = null); - - /// - /// Sets a list of cahce items contains key and value. - /// - /// The contains the cache key and cache value. - /// The cache options for the value. - /// The that represents the asynchronous operation. - Task SetListAsync(Dictionary keyValues, CombinedCacheEntryOptions? options = null); -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs deleted file mode 100644 index 745f573b4..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.Interfaces; - -/// -/// A factory abstraction for a component that can create instances of type with custom -/// configuration for a given logical name. -/// -public interface ICacheClientFactory -{ - /// - /// Creates and configures an instance of type using the configuration that corresponds - /// to the logical name specified by . - /// - /// The logical name of the client to create. - /// A new instance of type. - TICacheClinet CreateClient(string name); -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs deleted file mode 100644 index c772d52d3..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.Interfaces; - -/// -/// The interface for distributed cache client. -/// -public interface IDistributedCacheClient : ICacheClient -{ - /// - /// Refreshes a value's expiration with given key. - /// - /// A string identifying the requested value. - void Refresh(string key); - - /// - /// Refreshes a value's expiration with given key. - /// - /// A string identifying the requested value. - /// The that represents the asynchronous operation. - Task RefreshAsync(string key); - - /// - /// Checks whether a value exists with given key. - /// - /// A string identifying the requested value. - /// if the value exists, otherwise . - bool Exists(string key); - - /// - /// Checks whether a value exists with given key. - /// - /// A string identifying the requested value. - /// The that represents the asynchronous operation, containing the value if the value exists, otherwise . - Task ExistsAsync(string key); - - /// - /// Subscribes to perform some operation when a change to the perferred/active node is broadcast. - /// - /// The channel to subscribe to. - /// The handler to invoke when a message is received on channel. - void Subscribe(string channel, Action> handler); - - /// - /// Subscribes to perform some operation when a change to the perferred/active node is broadcast. - /// - /// The channel to subscribe to. - /// The handler to invoke when a message is received on channel. - /// The that represents the asynchronous operation. - Task SubscribeAsync(string channel, Action> handler); - - /// - /// Posts a message to the given channel. - /// - /// The channel to publish to. - /// The setup action to configure the . - void Publish(string channel, Action> setup); - - /// - /// Posts a message to the given channel. - /// - /// The channel to publish to. - /// The setup action to configure the . - /// The that represents the asynchronous operation. - Task PublishAsync(string channel, Action> setup); - - /// - /// !Destructive support in caching - /// Increments the number stored at field in the hash stored at key by increment - /// - /// The key - /// The increment number - /// - Task HashIncrementAsync(string key, long value = 1L); - - /// - /// !Destructive support in caching - /// Decrements the number stored at field in the hash stored at key by decrement. return -1 if decrement failed, otherwise return the result. - /// - /// The key - /// The decrement number - /// - Task HashDecrementAsync(string key, long value = 1L); -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs deleted file mode 100644 index efdbffb52..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.Interfaces; - -/// -/// A factory abstraction for a component that create instances with custom configuration for a given logical name. -/// -public interface IDistributedCacheClientFactory : ICacheClientFactory -{ -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj deleted file mode 100644 index 13928df95..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs deleted file mode 100644 index 1172a3a6a..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.Models; - -/// -/// The combined cache entry options. -/// -public class CombinedCacheEntryOptions -{ - /// - /// Gets or sets the memory cache entry options. - /// - public MemoryCacheEntryOptions? MemoryCacheEntryOptions { get; set; } - - /// - /// Gets or sets the distributed cache entry options. - /// - public DistributedCacheEntryOptions? DistributedCacheEntryOptions { get; set; } - - public CombinedCacheEntryOptions() - { - } - - public CombinedCacheEntryOptions(MemoryCacheEntryOptions? memoryCacheEntryOptions, DistributedCacheEntryOptions? distributedCacheEntryOptions) - { - MemoryCacheEntryOptions = memoryCacheEntryOptions; - DistributedCacheEntryOptions = distributedCacheEntryOptions; - } -} - -/// -/// The combined cache entry options. -/// -public class CombinedCacheEntryOptions -{ - public Action? ValueChanged { get; set; } - - /// - /// Gets or sets the memory cache entry options. - /// - public MemoryCacheEntryOptions? MemoryCacheEntryOptions { get; set; } - - /// - /// Gets or sets the distributed cache entry options. - /// - public DistributedCacheEntryOptions? DistributedCacheEntryOptions { get; set; } - - /// - /// Determines whether to ignore subscribe. - /// - public bool IgnoreSubscribe { get; set; } - - public CombinedCacheEntryOptions Standard => new(MemoryCacheEntryOptions, DistributedCacheEntryOptions); -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs deleted file mode 100644 index 91a12b1de..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.Models; - -/// -/// The subscribe key type. -/// -public enum SubscribeKeyTypes -{ - ValueTypeFullName = 1, - - ValueTypeFullNameAndKey = 2, - - SpecificPrefix = 3 -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs deleted file mode 100644 index 768191aac..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.Models; - -/// -/// The subscribe operation. -/// -public enum SubscribeOperation -{ - Set = 1, - - Remove = 2 -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs deleted file mode 100644 index a572e4dde..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Core.Models; - -/// -/// The subscribe options. -/// -public class SubscribeOptions -{ - /// - /// Gets or sets the operation. - /// - public SubscribeOperation Operation { get; set; } - - /// - /// Gets or sets the key. - /// - public string Key { get; set; } = default!; - - /// - /// Gets or sets the value. - /// - public T? Value { get; set; } -} diff --git a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/_Imports.cs b/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/_Imports.cs deleted file mode 100644 index b3099d7a7..000000000 --- a/src/Utils/Caching/Caching/src/Masa.Utils.Caching.Core/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Caching.Core.Interfaces; -global using Masa.Utils.Caching.Core.Models; -global using Microsoft.Extensions.Caching.Distributed; -global using Microsoft.Extensions.Caching.Memory; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Options; -global using System.Collections.Concurrent; diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs deleted file mode 100644 index 40cdef83b..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -/// -/// Extensions methods to configure an for . -/// -public static class RedisCacheClientFactoryServiceCollectionExtensions -{ - /// - /// Adds the and related services to the . - /// - /// The . - /// A delegate that is used to configure an . - /// The . - public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, Action configureOptions) - { - services.TryAddSingleton(serviceProvider => - { - var factory = serviceProvider.GetRequiredService(); - return factory.CreateClient(string.Empty); - }); - - return services.AddMasaRedisCache(string.Empty, configureOptions); - } - - /// - /// Adds the and related services to the and configures a named . - /// - /// The . - /// The logical name of the to configure. - /// A delegate that is used to configure an . - /// The . - public static ICachingBuilder AddMasaRedisCache( - this IServiceCollection services, - string name, - Action configureOptions) - { - ArgumentNullException.ThrowIfNull(services, nameof(services)); - ArgumentNullException.ThrowIfNull(name, nameof(name)); - ArgumentNullException.ThrowIfNull(configureOptions, nameof(configureOptions)); - - services.TryAddSingleton(); - - var builder = new CachingBuilder(services, name); - - builder.ConfigureDistributedCacheClient(configureOptions); - - return builder; - } - - /// - /// Adds the and related services to the . - /// - /// The . - /// - /// The . - public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, IConfiguration configuration) - { - services.TryAddSingleton(serviceProvider => - { - var factory = serviceProvider.GetRequiredService(); - return factory.CreateClient(string.Empty); - }); - - return services.AddMasaRedisCache(string.Empty, configuration); - } - - /// - /// Adds the and related services to the and configures a named . - /// - /// The . - /// The logical name of the to configure. - /// - /// The . - public static ICachingBuilder AddMasaRedisCache( - this IServiceCollection services, - string name, - IConfiguration configuration) - { - ArgumentNullException.ThrowIfNull(services, nameof(services)); - ArgumentNullException.ThrowIfNull(name, nameof(name)); - ArgumentNullException.ThrowIfNull(configuration, nameof(configuration)); - - services.TryAddSingleton(); - - var builder = new CachingBuilder(services, name); - builder.ConfigureDistributedCacheClient(configuration); - return builder; - } - - /// - /// Adds the and related services to the . - /// - /// The . - /// The to configure an . - /// The . - public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, RedisConfigurationOptions options) - => services.AddMasaRedisCache(o => o.Initialize(options)); - - /// - /// Adds the and related services to the and configures a named . - /// - /// The . - /// The logical name of the to configure. - /// The to configure an . - /// The . - public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, string name, RedisConfigurationOptions options) - => services.AddMasaRedisCache(name, o => o.Initialize(options)); -} diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs deleted file mode 100644 index 081508623..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs +++ /dev/null @@ -1,558 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Redis.Extensions; - -/// -/// This class is intended as a sample for supporting the feature. -/// -/// -/// It requires a reference to the "System.Linq.Expressions" assembly. -/// -public static class JsonSerializerExtensions -{ - /// - /// Enable support for the feature. - /// Changes the default handling for types specified as from deserializing as - /// to instead deserializing as the one of the - /// -derived types including: - /// , - /// , - /// , - /// and - /// . - /// - /// - /// When deserializing , - /// is returned which implements . - /// When deserializing , - /// is returned which implements . - /// When deserializing , - /// is returned and supports an implicit cast to . - /// An explicit cast or assignment to other types, such as , - /// is supported provided there is a custom converter for that Type. - /// When deserializing , is returned. - /// An explicit cast or assignment is required to the appropriate number type, such as or . - /// When deserializing and , - /// is returned and supports an implicit cast to . - /// An explicit cast or assignment to other types is supported provided there is a custom converter for that type. - /// When deserializing , is returned. - /// - public static void EnableDynamicTypes(this JsonSerializerOptions options) - { - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - options.Converters.Add(new DynamicObjectConverter()); - } - - /// - /// The base class for all dynamic types supported by the serializer. - /// - public abstract class JsonDynamicType : DynamicObject - { - public JsonSerializerOptions Options { get; private set; } - - internal JsonDynamicType(JsonSerializerOptions options) - { - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - Options = options; - } - - public sealed override bool TryConvert(ConvertBinder binder, out object? result) - { - return TryConvert(binder.ReturnType, out result); - } - - public abstract T? GetValue(); - public abstract void SetValue(object value); - protected abstract bool TryConvert(Type returnType, out object? result); - - protected static bool TryConvertWithTypeConverter(object value, Type returnType, out object? result) - { - TypeConverter converter = TypeDescriptor.GetConverter(value.GetType()); - if (converter.CanConvertTo(returnType)) - { - result = converter.ConvertTo(value, returnType)!; - return true; - } - - converter = TypeDescriptor.GetConverter(returnType); - if (converter.CanConvertFrom(value.GetType())) - { - result = converter.ConvertFrom(value)!; - return true; - } - - result = null; - return false; - } - - internal abstract object Value { get; } - } - - /// - /// Supports dynamic strings. - /// - public sealed class JsonDynamicString : JsonDynamicType - { - private object _value; - private Type? _type; - - public JsonDynamicString(string value, JsonSerializerOptions options) : base(options) - { - _value = value; - _type = typeof(string); - } - - public override T? GetValue() where T : default - { - bool success = TryConvert(typeof(T), out object? result); - Debug.Assert(success); - return result is T ? (T) result : default; - } - - public override void SetValue(object value) - { - _value = value; - _type = value.GetType(); - } - - protected override bool TryConvert(Type returnType, out object? result) - { - if (returnType == _type) - { - result = _value; // Return cached value, such as a DateTime. - return true; - } - - if (TryConvertWithTypeConverter(_value, returnType, out result)) - { - return true; - } - - result = _value = JsonSerializer.Deserialize($"\"{_value}\"", returnType, Options)!; - _type = result.GetType(); - return true; - } - - internal override object Value => _value; - - public static implicit operator string(JsonDynamicString obj) - { - bool success = obj.TryConvert(typeof(string), out object? result); - Debug.Assert(success); - return (string) result!; - } - } - - /// - /// Supports dynamic numbers. - /// - public sealed class JsonDynamicNumber : JsonDynamicType - { - private Type? _type; - private object _value; - private object? _lastValue = null; - - public JsonDynamicNumber(object? value, JsonSerializerOptions options) : base(options) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - public override T? GetValue() where T : default - { - if (TryConvert(typeof(T), out object? result)) - { - return result is T ? (T) result : default; - } - - throw new InvalidOperationException($"Cannot change type {_value.GetType()} to {typeof(T)}."); - } - - public override void SetValue(object value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - _value = _lastValue = value; - _type = value.GetType(); - } - - protected override bool TryConvert(Type returnType, out object? result) - { - if (returnType == _type) - { - result = _lastValue; // Return cached value, such as a long or double. - return true; - } - - bool success = false; - result = null; - - if (!(_value is JsonElement jsonElement)) - { - return TryConvertWithTypeConverter(_value, returnType, out result); - } - - if (returnType == typeof(long)) - { - success = jsonElement.TryGetInt64(out long value); - result = value; - } - else if (returnType == typeof(double)) - { - success = jsonElement.TryGetDouble(out double value); - result = value; - } - else if (returnType == typeof(int)) - { - success = jsonElement.TryGetInt32(out int value); - result = value; - } - else if (returnType == typeof(short)) - { - success = jsonElement.TryGetInt16(out short value); - result = value; - } - else if (returnType == typeof(decimal)) - { - success = jsonElement.TryGetDecimal(out decimal value); - result = value; - } - else if (returnType == typeof(byte)) - { - success = jsonElement.TryGetByte(out byte value); - result = value; - } - else if (returnType == typeof(float)) - { - success = jsonElement.TryGetSingle(out float value); - result = value; - } - else if (returnType == typeof(uint)) - { - success = jsonElement.TryGetUInt32(out uint value); - result = value; - } - else if (returnType == typeof(ushort)) - { - success = jsonElement.TryGetUInt16(out ushort value); - result = value; - } - else if (returnType == typeof(ulong)) - { - success = jsonElement.TryGetUInt64(out ulong value); - result = value; - } - else if (returnType == typeof(sbyte)) - { - success = jsonElement.TryGetSByte(out sbyte value); - result = value; - } - - if (!success) - { - // Use the raw test which may be recognized by converters such as the Enum converter than can process numbers. - string rawText = jsonElement.GetRawText(); - result = JsonSerializer.Deserialize($"{rawText}", returnType, Options)!; - } - - _lastValue = result!; - _type = result!.GetType(); - return true; - } - - internal override object Value => _value; - } - - /// - /// Supports dynamic booleans. - /// - public sealed class JsonDynamicBoolean : JsonDynamicType - { - private object _value; - private Type? _type; - - public JsonDynamicBoolean(bool value, JsonSerializerOptions options) : base(options) - { - _value = value; - _type = typeof(bool); - } - - public override T? GetValue() where T : default - { - bool success = TryConvert(typeof(T), out object? result); - Debug.Assert(success); - return (T) result!; - } - - public override void SetValue(object value) - { - _value = value; - _type = value.GetType(); - } - - protected override bool TryConvert(Type returnType, out object? result) - { - if (returnType == _value!.GetType()) - { - result = _value; // Return cached value. - return true; - } - - if (TryConvertWithTypeConverter(_value, returnType, out result)) - { - return true; - } - - result = _value = JsonSerializer.Deserialize($"\"{Value}\"", returnType, Options)!; - _type = result?.GetType()!; - return true; - } - - internal override object Value => _value; - - public static implicit operator bool(JsonDynamicBoolean obj) - { - bool success = obj.TryConvert(typeof(bool), out object? result); - Debug.Assert(success); - return (bool) result!; - } - } - - /// - /// Supports dynamic objects. - /// - public sealed class JsonDynamicObject : JsonDynamicType, IDictionary - { - private IDictionary _value; - - public JsonDynamicObject(JsonSerializerOptions options) - : base(options) - { - _value = new Dictionary(options.PropertyNameCaseInsensitive - ? StringComparer.OrdinalIgnoreCase - : StringComparer.Ordinal); - } - - public override bool TryGetMember(GetMemberBinder binder, out object? result) - { - if (_value.TryGetValue(binder.Name, out result)) - { - JsonDynamicObject? dynamicObj = result as JsonDynamicObject; - if (dynamicObj != null) - { - return dynamicObj.TryConvert(binder.ReturnType, out result); - } - - return true; - } - - // Return null for missing properties. - result = null; - return true; - } - - protected override bool TryConvert(Type returnType, out object? result) - { - if (returnType.IsAssignableFrom(typeof(IDictionary))) - { - result = this; - return true; - } - - result = null; - return false; - } - - public override bool TrySetMember(SetMemberBinder binder, object? value) - { - _value[binder.Name] = value!; - return true; - } - - internal override object Value => _value; - - public override T? GetValue() where T : default => throw new NotSupportedException(); - public override void SetValue(object value) => throw new NotSupportedException(); - - // IDictionary members. - public void Add(string key, object value) => _value.Add(key, value!); - void ICollection>.Add(KeyValuePair item) => _value.Add(item!); - public void Clear() => _value.Clear(); - bool ICollection>.Contains(KeyValuePair item) => _value.Contains(item); - public bool ContainsKey(string key) => _value.ContainsKey(key); - - void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) - => _value.CopyTo(array, arrayIndex); - - public IEnumerator> GetEnumerator() => _value.GetEnumerator(); - public bool Remove(string key) => _value.Remove(key); - bool ICollection>.Remove(KeyValuePair item) => _value.Remove(item); - - public object this[string key] - { - get => _value[key]; - set => _value[key] = value!; - } - - ICollection IDictionary.Keys => _value.Keys; - ICollection IDictionary.Values => _value.Values; - public int Count => _value.Count; - bool ICollection>.IsReadOnly => _value.IsReadOnly; - IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable) _value).GetEnumerator(); - public bool TryGetValue(string key, out object value) => _value.TryGetValue(key, out value!); - } - - /// - /// Supports dynamic arrays. - /// - public sealed class JsonDynamicArray : JsonDynamicType, IList - { - private IList _value; - - public JsonDynamicArray(JsonSerializerOptions options) : base(options) - { - _value = new List(); - } - - protected override bool TryConvert(Type returnType, out object? result) - { - if (returnType.IsAssignableFrom(typeof(IList))) - { - result = _value; - return true; - } - - result = null; - return false; - } - - internal override object Value => _value; - - public override T? GetValue() where T : default => throw new NotSupportedException(); - public override void SetValue(object value) => throw new NotSupportedException(); - - // IList members. - public object this[int index] - { - get => _value[index]; - set => _value[index] = value; - } - - public int Count => _value.Count; - bool ICollection.IsReadOnly => _value.IsReadOnly; - public void Add(object item) => _value.Add(item); - public void Clear() => _value.Clear(); - public bool Contains(object item) => _value.Contains(item); - void ICollection.CopyTo(object[] array, int arrayIndex) => _value.CopyTo(array, arrayIndex); - public IEnumerator GetEnumerator() => _value.GetEnumerator(); - public int IndexOf(object item) => _value.IndexOf(item); - public void Insert(int index, object item) => _value.Insert(index, item); - public bool Remove(object item) => _value.Remove(item); - public void RemoveAt(int index) => _value.RemoveAt(index); - IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable) _value).GetEnumerator(); - } - - /// - /// Supports deserialization of all -declared types, supporting . - /// supports serialization of all -derived types. - /// - private sealed class DynamicObjectConverter : JsonConverter - { - public override bool CanConvert(Type typeToConvert) - { - // For simplicity in adding the converter, we use a single converter instead of two. - return typeToConvert == typeof(object) || - typeof(JsonDynamicType).IsAssignableFrom(typeToConvert); - } - - public sealed override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case JsonTokenType.String: - return new JsonDynamicString(reader.GetString() ?? string.Empty, options); - case JsonTokenType.StartArray: - var dynamicArray = new JsonDynamicArray(options); - ReadList(dynamicArray, ref reader, options); - return dynamicArray; - case JsonTokenType.StartObject: - var dynamicObject = new JsonDynamicObject(options); - ReadObject(dynamicObject, ref reader, options); - return dynamicObject; - case JsonTokenType.False: - return new JsonDynamicBoolean(false, options); - case JsonTokenType.True: - return new JsonDynamicBoolean(true, options); - case JsonTokenType.Number: - JsonElement jsonElement = JsonElement.ParseValue(ref reader); - return new JsonDynamicNumber(jsonElement, options); - case JsonTokenType.Null: - throw new NotSupportedException(nameof(reader.TokenType)); - default: - throw new JsonException("Unexpected token type."); - } - } - - public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions? options) - { - if (value is JsonDynamicType dynamicType) - { - value = dynamicType.Value; - } - - JsonSerializer.Serialize(writer, value, options); - } - - private void ReadList(JsonDynamicArray dynamicArray, ref Utf8JsonReader reader, JsonSerializerOptions options) - { - while (true) - { - reader.Read(); - if (reader.TokenType == JsonTokenType.EndArray) - { - break; - } - - object value = Read(ref reader, typeof(object), options); - dynamicArray.Add(value); - } - } - - private void ReadObject(JsonDynamicObject dynamicObject, ref Utf8JsonReader reader, JsonSerializerOptions options) - { - while (true) - { - reader.Read(); - if (reader.TokenType == JsonTokenType.EndObject) - { - break; - } - - if (reader.TokenType != JsonTokenType.PropertyName) - { - throw new JsonException(); - } - - string key = reader.GetString() ?? string.Empty; - - reader.Read(); - object? value = Read(ref reader, typeof(object), options); - dynamicObject.Add(key, value); - } - } - } -} diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs deleted file mode 100644 index 6024cfecd..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs +++ /dev/null @@ -1,38 +0,0 @@ -using StackExchange.Redis; - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Redis.Extensions; - -/// -/// Reference from https://github.com/dotnet/aspnetcore/blob/3c79366674/src/Caching/StackExchangeRedis/src/RedisExtensions.cs -/// -internal static class RedisExtensions -{ - internal static RedisValue[] HashMemberGet(this IDatabase cache, string key, params string[] members) - { - // TODO: Error checking? - return cache.HashGet(key, GetRedisMembers(members)); - } - - internal static async Task HashMemberGetAsync( - this IDatabase cache, - string key, - params string[] members) - { - // TODO: Error checking? - return await cache.HashGetAsync(key, GetRedisMembers(members)).ConfigureAwait(false); - } - - private static RedisValue[] GetRedisMembers(params string[] members) - { - var redisMembers = new RedisValue[members.Length]; - for (int i = 0; i < members.Length; i++) - { - redisMembers[i] = members[i]; - } - - return redisMembers; - } -} diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs deleted file mode 100644 index d03c716ad..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Utils.Caching.Redis.Internal.Enum; - -namespace Masa.Utils.Caching.Redis.Helpers; - -public static class RedisHelper -{ - public static T? ConvertToValue(RedisValue redisValue) - { - var type = typeof(T); - var compressMode = GetCompressMode(type); - - if (compressMode == CompressMode.None) - return (T?)Convert.ChangeType(redisValue, type); - - var byteValue = (byte[])redisValue; - if (byteValue == null || byteValue.Length == 0) - return default; - - var value = Decompress(byteValue); - - if (compressMode == CompressMode.Compress) - { - var valueString = Encoding.UTF8.GetString(value); - return (dynamic)valueString; - } - - var options = new JsonSerializerOptions(); - options.EnableDynamicTypes(); - - return JsonSerializer.Deserialize(value, options); - } - - public static RedisValue ConvertFromValue(T value) - { - var type = typeof(T); - dynamic redisValue; - switch (GetCompressMode(type)) - { - case CompressMode.None: - redisValue = value!; - break; - case CompressMode.Compress: - redisValue = Compress(Encoding.UTF8.GetBytes(value?.ToString() ?? string.Empty)); - break; - default: - var options = new JsonSerializerOptions(); - options.EnableDynamicTypes(); - - var jsonString = JsonSerializer.Serialize(value, options); - redisValue = Compress(Encoding.UTF8.GetBytes(jsonString)); - break; - } - return ConvertToRedisValue(type, redisValue); - } - - private static RedisValue ConvertToRedisValue(Type type, dynamic value) - { - if (type == typeof(byte) || type == typeof(ushort)) - return (long)value; - - if (type == typeof(decimal)) - return new RedisValue(value.ToString()); - - return value; - } - - public static byte[] Compress(byte[] data) - { - using (MemoryStream msGZip = new MemoryStream()) - using (GZipStream stream = new GZipStream(msGZip, CompressionMode.Compress, true)) - { - stream.Write(data, 0, data.Length); - stream.Close(); - return msGZip.ToArray(); - } - } - - public static byte[] Decompress(byte[] data) - { - using (MemoryStream ms = new MemoryStream(data)) - using (GZipStream stream = new GZipStream(ms, CompressionMode.Decompress)) - using (MemoryStream outBuffer = new MemoryStream()) - { - byte[] block = new byte[1024]; - while (true) - { - int bytesRead = stream.Read(block, 0, block.Length); - if (bytesRead <= 0) - break; - else - outBuffer.Write(block, 0, bytesRead); - } - return outBuffer.ToArray(); - } - } - - private static CompressMode GetCompressMode(this Type type) - { - switch (Type.GetTypeCode(type)) - { - case TypeCode.Byte: - case TypeCode.SByte: - case TypeCode.UInt16: - case TypeCode.UInt32: - case TypeCode.UInt64: - case TypeCode.Int16: - case TypeCode.Int32: - case TypeCode.Int64: - case TypeCode.Double: - case TypeCode.Single: - case TypeCode.Decimal: - return CompressMode.None; - case TypeCode.String: - return CompressMode.Compress; - default: - return CompressMode.SerializeAndCompress; - } - } -} diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs deleted file mode 100644 index cb73be51d..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Masa.Utils.Caching.Redis.Internal.Enum; - -internal enum CompressMode -{ - /// - /// no compression - /// - None = 1, - - /// - /// Compress but not deserialize - /// - Compress, - - /// - /// serialize and compress - /// - SerializeAndCompress, -} diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj deleted file mode 100644 index 6a3dc888c..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs deleted file mode 100644 index 59b8dc550..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Redis.Models; - -/// -/// The redis configuration options. -/// -public class RedisConfigurationOptions : DistributedCacheEntryOptions -{ - /// - /// Gets the servers. - /// - public List Servers { get; set; } = new(); - - /// - /// Gets or sets whether connect/configuration timeouts should be explicitly notified via a TimeoutException. - /// - public bool AbortOnConnectFail { get; set; } - - /// - /// Indicates whether admin operations should be allowed. - /// - public bool AllowAdmin { get; set; } - - /// - /// The client name to use for all connections - /// - public string ClientName { get; set; } = default!; - - /// - /// Automatically encodes and decodes channels. - /// - public string ChannelPrefix { get; set; } = default!; - - /// - /// The number of times to repeat the initial connect cycle if no servers respond promptly. - /// - public int ConnectRetry { get; set; } = 3; - - /// - /// Specifies the time in milliseconds that should be allowed for connection (defaults to 5 seconds unless SyncTimeout is higher) - /// - public int ConnectTimeout { get; set; } = 5000; - - /// - /// Specifies the default database to be used when calling ConnectionMultiplexer.GetDatabase() without any parameters. - /// - public int DefaultDatabase { get; set; } - - /// - /// The password to use to authenticate with the server. - /// - public string Password { get; set; }= default!; - - /// - /// Type of proxy to use (if any); for example Proxy.Twemproxy. - /// - public Proxy Proxy { get; set; } = Proxy.None; - - /// - /// Indicates whether the connection should be encrypted. - /// - public bool Ssl { get; set; } - - /// - /// Specifies the time in milliseconds that the system should allow for synchronous operations (defaults to 5 seconds) - /// - public int SyncTimeout { get; set; } = 1000; - - public void Initialize(RedisConfigurationOptions options) - { - Servers = options.Servers; - ClientName = options.ClientName; - ChannelPrefix = options.ChannelPrefix; - ConnectRetry = options.ConnectRetry; - ConnectTimeout = options.ConnectTimeout; - DefaultDatabase = options.DefaultDatabase; - Password = options.Password; - Proxy = options.Proxy; - Ssl = options.Ssl; - SyncTimeout = options.SyncTimeout; - AbsoluteExpiration = options.AbsoluteExpiration; - AbsoluteExpirationRelativeToNow = options.AbsoluteExpirationRelativeToNow; - SlidingExpiration = options.SlidingExpiration; - } -} diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs deleted file mode 100644 index 3f2204471..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Redis.Models; - -/// -/// The redis configuration. -/// -public class RedisServerOptions -{ - private const int DEFAULT_REDIS_PORT = 6379; - - /// - /// Gets the host. - /// - public string Host { get; set; } = default!; - - /// - /// Gets the port. - /// - public int Port { get; set; } - - /// - /// Initializes a new instance of the class. - /// - public RedisServerOptions() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The host. - public RedisServerOptions(string host) - { - if (string.IsNullOrWhiteSpace(host)) - { - throw new ArgumentNullException(nameof(host)); - } - - var lastIndex = host.LastIndexOf(':'); - if (lastIndex > 0 && host.Length > lastIndex + 1) - { - if (int.TryParse(host.Substring(lastIndex + 1), out var port)) - { - Host = host.Substring(0, lastIndex); - Port = port; - } - } - - if (string.IsNullOrEmpty(Host)) - { - Host = host; - Port = DEFAULT_REDIS_PORT; - } - } - - /// - /// Initializes a new instance of the class. - /// - /// The host. - /// The port. - public RedisServerOptions(string host, int port) - { - if (string.IsNullOrWhiteSpace(host)) - { - throw new ArgumentNullException(nameof(host)); - } - - Host = host; - Port = port; - } -} diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClient.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClient.cs deleted file mode 100644 index 51abdb6a1..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClient.cs +++ /dev/null @@ -1,576 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Redis; - -/// -/// The redis cache client. -/// -public class RedisCacheClient : IDistributedCacheClient -{ - // Reference from https://github.com/dotnet/aspnetcore/blob/3c793666742cfc4c389292f3378d15e32f860dc9/src/Caching/StackExchangeRedis/src/RedisCache.cs#L372 - // KEYS[1] = = key - // ARGV[1] = absolute-expiration - ticks as long (-1 for none) - // ARGV[2] = sliding-expiration - ticks as long (-1 for none) - // ARGV[3] = relative-expiration (long, in seconds, -1 for none) - Min(absolute-expiration - Now, sliding-expiration) - // ARGV[4] = data - byte[] - // this order should not change LUA script depends on it - private const string SET_SCRIPT = @" - redis.call('HSET', KEYS[1], 'absexp', ARGV[1], 'sldexp', ARGV[2], 'data', ARGV[4]) - if ARGV[3] ~= '-1' then - redis.call('EXPIRE', KEYS[1], ARGV[3]) - end - return 1"; - - private const string SET_MULTIPLE_SCRIPT = @" - local count = 0 - for i, key in ipairs(KEYS) do - redis.call('HSET', key, 'absexp', ARGV[1], 'sldexp', ARGV[2], 'data', ARGV[i+3]) - if ARGV[3] ~= '-1' then - redis.call('EXPIRE', key, ARGV[3]) - end - count = count + 1 - end - return count"; - - private const string ABSOLUTE_EXPIRATION_KEY = "absexp"; - private const string SLIDING_EXPIRATION_KEY = "sldexp"; - private const string DATA_KEY = "data"; - private const long NOT_PRESENT = -1; - - internal static readonly RedisConfigurationOptions RedisConfiguration = new(); - - private readonly IConnectionMultiplexer? _connection; - private readonly IDatabase _db; - private readonly ISubscriber _subscriber; - - public RedisCacheClient(ConfigurationOptions options) - { - _connection = ConnectionMultiplexer.Connect(options); - _db = _connection.GetDatabase(); - _subscriber = _connection.GetSubscriber(); - } - - /// - public T? Get(string key) - { - var redisValue = GetAndRefresh(key, getData: true); - if (redisValue.HasValue && !redisValue.IsNullOrEmpty) - { - return ConvertToValue(redisValue); - } - - return default; - } - - /// - public async Task GetAsync(string key) - { - var redisValue = await GetAndRefreshAsync(key, getData: true); - if (redisValue.HasValue && !redisValue.IsNullOrEmpty) - { - return ConvertToValue(redisValue); - } - - return default; - } - - /// - public T? GetOrSet(string key, Func setter, CombinedCacheEntryOptions? options = null) - { - if (string.IsNullOrWhiteSpace(key)) - throw new ArgumentNullException(nameof(key)); - - if (setter == null) - throw new ArgumentNullException(nameof(setter)); - - T? value; - - var redisValue = GetAndRefresh(key, true); - - if (redisValue.HasValue && !redisValue.IsNullOrEmpty) - { - value = ConvertToValue(redisValue); - } - else - { - value = setter(); - - Set(key, value, options); - } - - return value; - } - - /// - public async Task GetOrSetAsync(string key, Func setter, CombinedCacheEntryOptions? options = null) - { - if (string.IsNullOrWhiteSpace(key)) - throw new ArgumentNullException(nameof(key)); - - if (setter == null) - throw new ArgumentNullException(nameof(setter)); - - T? value; - - var redisValue = await GetAndRefreshAsync(key, getData: true); - - if (redisValue.HasValue && !redisValue.IsNullOrEmpty) - { - value = ConvertToValue(redisValue); - } - else - { - value = setter(); - - await SetAsync(key, value, options); - } - - return value; - } - - /// - public IEnumerable GetList(string[] keys) - { - if (keys == null) - throw new ArgumentNullException(nameof(keys)); - - // TODO: whether need to check keys.length - - var redisValues = keys.Select(key => GetAndRefresh(key, getData: true)); - - return redisValues - .Where(v => v.HasValue && !v.IsNullOrEmpty) - .Select(ConvertToValue); - } - - /// - public async Task> GetListAsync(string[] keys) - { - if (keys == null) - throw new ArgumentNullException(nameof(keys)); - - // TODO: whether need to check keys.length - - var redisValues = await Task.WhenAll(keys.Select(key => GetAndRefreshAsync(key, getData: true))); - - return redisValues - .Where(v => v.HasValue && !v.IsNullOrEmpty) - .Select(ConvertToValue); - } - - /// - public void Remove(params string[] keys) - { - if (keys == null) - throw new ArgumentNullException(nameof(keys)); - - _db.KeyDelete(keys.Select(key => (RedisKey)key).ToArray()); - } - - /// - public async Task RemoveAsync(params string[] keys) - { - if (keys == null) - throw new ArgumentNullException(nameof(keys)); - - await _db.KeyDeleteAsync(keys.Select(key => (RedisKey)key).ToArray()); - } - - /// - public void Set(string key, T value, CombinedCacheEntryOptions? options = null) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - if (value == null) - throw new ArgumentNullException(nameof(value)); - - if (options == null) - options = new CombinedCacheEntryOptions(); - - var distributedCacheEntryOptions = options.DistributedCacheEntryOptions; - - var bytesValue = ConvertFromValue(value); - - var creationTime = DateTimeOffset.UtcNow; - var absoluteExpiration = GetAbsoluteExpiration(creationTime, distributedCacheEntryOptions); - - var redisKeys = new RedisKey[] { key }; - var redisValues = new RedisValue[] - { - absoluteExpiration?.Ticks ?? NOT_PRESENT, - distributedCacheEntryOptions?.SlidingExpiration?.Ticks ?? NOT_PRESENT, - GetExpirationInSeconds(creationTime, absoluteExpiration, distributedCacheEntryOptions) ?? NOT_PRESENT, - bytesValue - }; - - _db.ScriptEvaluate(SET_SCRIPT, redisKeys, redisValues); - } - - /// - public async Task SetAsync(string key, T value, CombinedCacheEntryOptions? options = null) - { - ArgumentNullException.ThrowIfNull(key, nameof(key)); - - ArgumentNullException.ThrowIfNull(value, nameof(value)); - - options ??= new CombinedCacheEntryOptions(); - - var bytesValue = ConvertFromValue(value); - - await _db.ScriptEvaluateAsync( - SET_SCRIPT, - new RedisKey[] { key }, - GetRedisValues(options.DistributedCacheEntryOptions, () => new[] { (RedisValue)bytesValue }) - ).ConfigureAwait(false); - } - - /// - public void SetList(Dictionary keyValues, CombinedCacheEntryOptions? options = null) - { - ArgumentNullException.ThrowIfNull(keyValues, nameof(keyValues)); - - options ??= new CombinedCacheEntryOptions(); - - var redisKeys = keyValues.Select(item => (RedisKey)item.Key).ToArray(); - var redisValues = keyValues.Select(item => ConvertFromValue(item.Value)).ToArray(); - - _db.ScriptEvaluate( - SET_MULTIPLE_SCRIPT, - redisKeys, - GetRedisValues(options.DistributedCacheEntryOptions, () => redisValues) - ); - } - - /// - public async Task SetListAsync(Dictionary keyValues, CombinedCacheEntryOptions? options = null) - { - if (keyValues == null) - throw new ArgumentNullException(nameof(keyValues)); - - options ??= new CombinedCacheEntryOptions(); - - var keys = keyValues.Select(item => (RedisKey)item.Key).ToArray(); - var redisValues = keyValues.Select(item => ConvertFromValue(item.Value)).ToArray(); - - await _db.ScriptEvaluateAsync( - SET_MULTIPLE_SCRIPT, - keys, - GetRedisValues(options.DistributedCacheEntryOptions, () => redisValues) - ).ConfigureAwait(false); - } - - private RedisValue[] GetRedisValues(DistributedCacheEntryOptions? distributedCacheEntryOptions, Func? func = null) - { - var creationTime = DateTimeOffset.UtcNow; - var absoluteExpiration = GetAbsoluteExpiration(creationTime, distributedCacheEntryOptions); - List redisValues = new() - { - absoluteExpiration?.Ticks ?? NOT_PRESENT, - distributedCacheEntryOptions?.SlidingExpiration?.Ticks ?? NOT_PRESENT, - GetExpirationInSeconds(creationTime, absoluteExpiration, distributedCacheEntryOptions) ?? NOT_PRESENT, - }; - if (func != null) - { - redisValues.AddRange(func.Invoke()); - } - return redisValues.ToArray(); - } - - /// - public bool Exists(string key) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - return _db.KeyExists(key); - } - - /// - public async Task ExistsAsync(string key) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - return await _db.KeyExistsAsync(key); - } - - /// - public void Refresh(string key) - { - GetAndRefresh(key, getData: false); - } - - /// - public async Task RefreshAsync(string key) - { - await GetAndRefreshAsync(key, getData: false); - } - - /// - public void Subscribe(string channel, Action> handler) - { - _subscriber.Subscribe(channel, (_, message) => - { - var options = JsonSerializer.Deserialize>(message); - handler(options!); - }); - } - - /// - public async Task SubscribeAsync(string channel, Action> handler) - { - await _subscriber.SubscribeAsync(channel, (_, message) => - { - var options = JsonSerializer.Deserialize>(message); - handler(options!); - }); - } - - /// - public void Publish(string channel, Action> setup) - { - if (channel == null) - throw new ArgumentNullException(nameof(channel)); - - if (setup == null) - throw new ArgumentNullException(nameof(setup)); - - var options = new SubscribeOptions(); - setup.Invoke(options); - - if (string.IsNullOrWhiteSpace(options.Key)) - throw new ArgumentNullException(nameof(options.Key)); - - var message = JsonSerializer.Serialize(options); - - _subscriber.Publish(channel, message); - } - - /// - public async Task PublishAsync(string channel, Action> setup) - { - if (channel == null) - throw new ArgumentNullException(nameof(channel)); - - if (setup == null) - throw new ArgumentNullException(nameof(setup)); - - var options = new SubscribeOptions(); - setup.Invoke(options); - - if (string.IsNullOrWhiteSpace(options.Key)) - throw new ArgumentNullException(nameof(options.Key)); - - var message = JsonSerializer.Serialize(options); - - await _subscriber.PublishAsync(channel, message); - } - - public async Task HashIncrementAsync(string key, long value = 1L) - { - return await _db.HashIncrementAsync(key, DATA_KEY, value); - } - - public async Task HashDecrementAsync(string key, long value = 1L) - { - var script = $@" -local result = redis.call('HGET', KEYS[1], KEYS[2]) -if tonumber(result) >= {value} then - result = redis.call('HINCRBY', KEYS[1], KEYS[2], {0 - value}) - return result -else - return -1 -end"; - var result = (long)await _db.ScriptEvaluateAsync(script, new RedisKey[] { key, DATA_KEY }); - - return result; - } - - private RedisValue GetAndRefresh(string key, bool getData) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - RedisValue[] results; - if (getData) - { - results = _db.HashMemberGet(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY, DATA_KEY); - } - else - { - results = _db.HashMemberGet(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY); - } - - if (results.Length >= 2) - { - MapMetadata(results, out DateTimeOffset? absExpr, out TimeSpan? sldExpr); - Refresh(key, absExpr, sldExpr); - } - - if (results.Length >= 3 && results[2].HasValue) - { - return results[2]; - } - - return RedisValue.Null; - } - - private async Task GetAndRefreshAsync(string key, bool getData) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - RedisValue[] results; - if (getData) - { - results = await _db.HashMemberGetAsync(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY, DATA_KEY).ConfigureAwait(false); - } - else - { - results = await _db.HashMemberGetAsync(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY).ConfigureAwait(false); - } - - // TODO: Error handling - if (results.Length >= 2) - { - MapMetadata(results, out DateTimeOffset? absExpr, out TimeSpan? sldExpr); - await RefreshAsync(key, absExpr, sldExpr).ConfigureAwait(false); - } - - if (results.Length >= 3 && results[2].HasValue) - { - return results[2]; - } - - return RedisValue.Null; - } - - private void Refresh(string key, DateTimeOffset? absExpr, TimeSpan? sldExpr) - { - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - // Note Refresh has no effect if there is just an absolute expiration (or neither). - if (sldExpr.HasValue) - { - TimeSpan? expr; - if (absExpr.HasValue) - { - var relExpr = absExpr.Value - DateTimeOffset.Now; - expr = relExpr <= sldExpr.Value ? relExpr : sldExpr; - } - else - { - expr = sldExpr; - } - - _db.KeyExpire(key, expr); - // TODO: Error handling - } - } - - private async Task RefreshAsync(string key, DateTimeOffset? absExpr, TimeSpan? sldExpr, CancellationToken token = default) - { - if (key == null) - { - throw new ArgumentNullException(nameof(key)); - } - - token.ThrowIfCancellationRequested(); - - // Note Refresh has no effect if there is just an absolute expiration (or neither). - if (sldExpr.HasValue) - { - TimeSpan? expr; - if (absExpr.HasValue) - { - var relExpr = absExpr.Value - DateTimeOffset.Now; - expr = relExpr <= sldExpr.Value ? relExpr : sldExpr; - } - else - { - expr = sldExpr; - } - - await _db.KeyExpireAsync(key, expr).ConfigureAwait(false); - // TODO: Error handling - } - } - - private static void MapMetadata(RedisValue[] results, out DateTimeOffset? absoluteExpiration, out TimeSpan? slidingExpiration) - { - absoluteExpiration = null; - slidingExpiration = null; - var absoluteExpirationTicks = (long?)results[0]; - if (absoluteExpirationTicks.HasValue && absoluteExpirationTicks.Value != NOT_PRESENT) - { - absoluteExpiration = new DateTimeOffset(absoluteExpirationTicks.Value, TimeSpan.Zero); - } - - var slidingExpirationTicks = (long?)results[1]; - if (slidingExpirationTicks.HasValue && slidingExpirationTicks.Value != NOT_PRESENT) - { - slidingExpiration = new TimeSpan(slidingExpirationTicks.Value); - } - } - - private static long? GetExpirationInSeconds( - DateTimeOffset creationTime, - DateTimeOffset? absoluteExpiration, - DistributedCacheEntryOptions? options) - { - if (options == null) - return null; - - if (absoluteExpiration.HasValue && options.SlidingExpiration.HasValue) - { - return (long)Math.Min( - (absoluteExpiration.Value - creationTime).TotalSeconds, - options.SlidingExpiration.Value.TotalSeconds); - } - - if (absoluteExpiration.HasValue) - { - return (long)(absoluteExpiration.Value - creationTime).TotalSeconds; - } - - if (options is { SlidingExpiration: { } }) - { - return (long)options.SlidingExpiration.Value.TotalSeconds; - } - - return null; - } - - private static DateTimeOffset? GetAbsoluteExpiration(DateTimeOffset creationTime, DistributedCacheEntryOptions? options) - { - if (options == null) - return null; - - if (options.AbsoluteExpiration.HasValue && options.AbsoluteExpiration <= creationTime) - { - throw new ArgumentOutOfRangeException( - nameof(DistributedCacheEntryOptions.AbsoluteExpiration), - options.AbsoluteExpiration.Value, - "The absolute expiration value must be in the future."); - } - - if (options.AbsoluteExpirationRelativeToNow.HasValue) - { - return creationTime + options.AbsoluteExpirationRelativeToNow; - } - - return options.AbsoluteExpiration; - } - - /// - public void Dispose() - { - if (_connection != null) - _connection.Dispose(); - } -} diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs deleted file mode 100644 index 3bd8918d5..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Redis; - -public class RedisCacheClientFactory : DistributedCacheClientFactory -{ - public RedisCacheClientFactory(IOptionsMonitor optionsMonitor) : base(optionsMonitor) - { - - } - - protected override IDistributedCacheClient CreateClientHandler(string name) - { - var options = GetOptions(name); - - if (options == null) - { - throw new ArgumentException("No matching client found!"); - } - - var configurationOptions = new ConfigurationOptions - { - AbortOnConnectFail = options.AbortOnConnectFail, - AllowAdmin = options.AllowAdmin, - ChannelPrefix = options.ChannelPrefix, - ClientName = options.ClientName, - ConnectRetry = options.ConnectRetry, - ConnectTimeout = options.ConnectTimeout, - DefaultDatabase = options.DefaultDatabase, - Password = options.Password, - Proxy = options.Proxy, - Ssl = options.Ssl, - SyncTimeout = options.SyncTimeout - }; - - foreach (var server in options.Servers) - { - configurationOptions.EndPoints.Add(server.Host, server.Port); - } - - return new RedisCacheClient(configurationOptions); - } -} diff --git a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/_Imports.cs b/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/_Imports.cs deleted file mode 100644 index b6b6321b1..000000000 --- a/src/Utils/Caching/Distributed/src/Masa.Utils.Caching.Redis/_Imports.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Caching.Core; -global using Masa.Utils.Caching.Core.DependencyInjection; -global using Masa.Utils.Caching.Core.Interfaces; -global using Masa.Utils.Caching.Core.Models; -global using Masa.Utils.Caching.Redis; -global using Masa.Utils.Caching.Redis.Extensions; -global using Masa.Utils.Caching.Redis.Models; -global using Microsoft.Extensions.Caching.Distributed; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Options; -global using StackExchange.Redis; -global using System.Collections; -global using System.ComponentModel; -global using System.Diagnostics; -global using System.Dynamic; -global using System.IO.Compression; -global using System.Text; -global using System.Text.Json; -global using System.Text.Json.Serialization; -global using static Masa.Utils.Caching.Redis.Helpers.RedisHelper; diff --git a/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs b/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs deleted file mode 100644 index f4b844ca7..000000000 --- a/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Redis.Tests; - -[TestClass] -public class ConvertToValueTest -{ - [TestMethod] - public void TestConvertByGuid() - { - Guid id = Guid.NewGuid(); - RedisValue obj = RedisHelper.ConvertFromValue(id); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); - } - - [TestMethod] - public void TestConvertByByte() - { - byte id = 1; - RedisValue obj = RedisHelper.ConvertFromValue(id); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); - } - - [TestMethod] - public void TestConvertBySByte() - { - sbyte id = 1; - RedisValue obj = RedisHelper.ConvertFromValue(id); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); - } - - [TestMethod] - public void TestConvertByUShort() - { - ushort id = 1; - RedisValue obj = RedisHelper.ConvertFromValue(id); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); - } - - [TestMethod] - public void TestConvertByUInt() - { - uint id = 1; - RedisValue obj = RedisHelper.ConvertFromValue(id); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); - } - - [TestMethod] - public void TestConvertByULong() - { - ulong id = 1; - RedisValue obj = RedisHelper.ConvertFromValue(id); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); - } - - [TestMethod] - public void TestConvertByShort() - { - short id = 1; - RedisValue obj = RedisHelper.ConvertFromValue(id); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); - } - - [TestMethod] - public void TestConvertByInt() - { - int id = 1; - RedisValue obj = RedisHelper.ConvertFromValue(id); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); - } - - [TestMethod] - public void TestConvertByLong() - { - long id = 1; - RedisValue obj = RedisHelper.ConvertFromValue(id); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); - } - - [TestMethod] - public void TestConvertByDouble() - { - double score = 1.1d; - RedisValue obj = RedisHelper.ConvertFromValue(score); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == score); - } - - [TestMethod] - public void TestConvertByFloat() - { - float score = 1.1f; - RedisValue obj = RedisHelper.ConvertFromValue(score); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == score); - } - - [TestMethod] - public void TestConvertByDecimal() - { - decimal score = 1.1m; - dynamic obj = RedisHelper.ConvertFromValue(score); - Assert.IsTrue(RedisHelper.ConvertToValue(obj) == score); - } - - [TestMethod] - public void TestConvertByDynamic() - { - dynamic user = new - { - Name = "Jim" - }; - RedisValue obj = RedisHelper.ConvertFromValue(user)!; - Assert.IsTrue(RedisHelper.ConvertToValue(obj)!.Name == user.Name); - } -} diff --git a/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj b/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj deleted file mode 100644 index 6b68ea9e7..000000000 --- a/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs b/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs deleted file mode 100644 index fe0e0105a..000000000 --- a/src/Utils/Caching/Distributed/test/Masa.Utils.Caching.Redis.Tests/_Imports.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Caching.Redis.Helpers; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using StackExchange.Redis; -global using System; diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs deleted file mode 100644 index 948dfbbc5..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.DistributedMemory.DependencyInjection; - -/// -/// Extension methods for configuring an -/// -public static class MemoryCacheClientBuilderExtensions -{ - /// - /// Adds a delegate that will be used to configure a named . - /// - /// The . - /// A delegate that is used to configure an . - /// An that can be used to configure the client. - public static ICachingBuilder ConfigureMemoryCacheClient(this ICachingBuilder builder, Action configureOptions) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (configureOptions == null) - { - throw new ArgumentNullException(nameof(configureOptions)); - } - - builder.Services.Configure(builder.Name, configureOptions); - - return builder; - } -} diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs deleted file mode 100644 index a40aa6928..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.DistributedMemory.DependencyInjection; - -/// -/// Extension methods to configure an for . -/// -public static class MemoryCacheClientFactoryCachingBuilderExtensions -{ - /// - /// Adds the and related services to the . - /// - /// The . - /// The . - public static ICachingBuilder AddMasaMemoryCache(this ICachingBuilder builder) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - var name = builder.Name; - - builder.Services.TryAddSingleton(); - - builder.Services.TryAddSingleton(serviceProvider => - { - var factory = serviceProvider.GetRequiredService(); - - return factory.CreateClient(name); - }); - - return builder; - } - - /// - /// Adds the and related services to the . - /// - /// The . - /// A delegate that is used to configure an . - /// The . - public static ICachingBuilder AddMasaMemoryCache(this ICachingBuilder builder, Action configureOptions) - { - if (configureOptions == null) - { - throw new ArgumentNullException(nameof(configureOptions)); - } - - builder.AddMasaMemoryCache(); - - builder.ConfigureMemoryCacheClient(configureOptions); - - return builder; - } -} diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs deleted file mode 100644 index 0654a9381..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.DistributedMemory.Interfaces; - -/// -/// The the interface memory cache client. -/// -public interface IMemoryCacheClient : ICacheClient -{ - /// - /// Gets a value with given key. - /// - /// A string identifying the request value. - /// The handler to invoke when the request value changed. - /// The located value or null. - T? Get(string key, Action valueChanged); - - /// - /// Gets a value with given key. - /// - /// A string identifying the request value. - /// The handler to invoke when the request value changed. - /// The that represents the asynchronous opertion, containing the located value or null. - Task GetAsync(string key, Action valueChanged); -} diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs deleted file mode 100644 index a17f0c43f..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.DistributedMemory.Interfaces; - -/// -/// A factory abstraction for a component that create instances with custom configuration for a given logical name. -/// -public interface IMemoryCacheClientFactory : ICacheClientFactory -{ -} diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj deleted file mode 100644 index f1af3e2fc..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs deleted file mode 100644 index 0aea93ee5..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.DistributedMemory; - -public class MemoryCacheClient : IMemoryCacheClient -{ - private readonly IMemoryCache _cache; - private readonly IDistributedCacheClient _distributedClient; - - private readonly SubscribeKeyTypes _subscribeKeyType; - private readonly string _subscribeKeyPrefix; - - private readonly object _locker = new(); - private readonly IList _subscribeChannels = new List(); - - /// - /// Initializes a new instance of the class. - /// - /// The cache. - /// The distributed client. - /// The type of subscribe key. - /// The prefix of subscribe key. - public MemoryCacheClient(IMemoryCache cache, IDistributedCacheClient distributedClient, SubscribeKeyTypes subscribeKeyType, - string subscribeKeyPrefix = "") - { - _cache = cache; - _distributedClient = distributedClient; - - _subscribeKeyType = subscribeKeyType; - _subscribeKeyPrefix = subscribeKeyPrefix; - } - - /// - public T? Get(string key) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - var formattedKey = FormatMemoryCacheKey(key); - - if (!_cache.TryGetValue(formattedKey, out T? value)) - { - value = _distributedClient.Get(key); - - _cache.Set(formattedKey, value); - - var channel = FormatSubscribeChannel(key); - - Subscribe(channel); - } - - return value; - } - - /// - public async Task GetAsync(string key) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - var formattedKey = FormatMemoryCacheKey(key); - - if (!_cache.TryGetValue(formattedKey, out T? value)) - { - value = await _distributedClient.GetAsync(key); - - _cache.Set(formattedKey, value); - - var channel = FormatSubscribeChannel(key); - - Subscribe(channel); - } - - return value; - } - - /// - public T? Get(string key, Action valueChanged) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - var formattedKey = FormatMemoryCacheKey(key); - - if (!_cache.TryGetValue(formattedKey, out T? value)) - { - value = _distributedClient.Get(key); - - _cache.Set(formattedKey, value); - - var channel = FormatSubscribeChannel(key); - - Subscribe(channel, new CombinedCacheEntryOptions - { - ValueChanged = valueChanged - }); - } - - return value; - } - - /// - public async Task GetAsync(string key, Action valueChanged) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - var formattedKey = FormatMemoryCacheKey(key); - - if (!_cache.TryGetValue(formattedKey, out T? value)) - { - value = await _distributedClient.GetAsync(key); - - _cache.Set(formattedKey, value); - - var channel = FormatSubscribeChannel(key); - - Subscribe(channel, new CombinedCacheEntryOptions - { - ValueChanged = valueChanged - }); - } - - return value; - } - - /// - public IEnumerable GetList(string[] keys) - { - if (keys == null) - throw new ArgumentNullException(nameof(keys)); - - // TODO: whether need to check keys.length - - return keys - .Where(k => !string.IsNullOrWhiteSpace(k)) - .Select(Get); - } - - /// - public async Task> GetListAsync(string[] keys) - { - if (keys == null) - throw new ArgumentNullException(nameof(keys)); - - return - await Task.WhenAll(keys - .Where(key => !string.IsNullOrWhiteSpace(key)) - .Select(GetAsync)); - } - - /// - public T? GetOrSet(string key, Func setter, CombinedCacheEntryOptions? options = null) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - if (setter == null) - throw new ArgumentNullException(nameof(setter)); - - var formattedKey = FormatMemoryCacheKey(key); - - if (!_cache.TryGetValue(formattedKey, out T? value)) - { - value = _distributedClient.GetOrSet(key, setter, options); - - if (options == null) - { - _cache.Set(formattedKey, value); - } - else - { - _cache.Set(formattedKey, value, options.MemoryCacheEntryOptions); - } - - PubSub(key, SubscribeOperation.Set, value, options); - } - - return value; - } - - /// - public async Task GetOrSetAsync(string key, Func setter, CombinedCacheEntryOptions? options = null) - { - ArgumentNullException.ThrowIfNull(key, nameof(key)); - - ArgumentNullException.ThrowIfNull(setter, nameof(setter)); - - var formattedKey = FormatMemoryCacheKey(key); - - if (!_cache.TryGetValue(key, out T? value)) - { - value = await _distributedClient.GetOrSetAsync(key, setter, options); - - if (options == null) - { - _cache.Set(formattedKey, value); - } - else - { - _cache.Set(formattedKey, value, options.MemoryCacheEntryOptions); - } - - await PubSubAsync(key, SubscribeOperation.Set, value, options); - } - - return value; - } - - /// - public void Remove(params string[] keys) - { - if (keys == null) - throw new ArgumentNullException(nameof(keys)); - - Parallel.ForEach(keys, RemoveOne); - } - - /// - public Task RemoveAsync(params string[] keys) - { - if (keys == null) - throw new ArgumentNullException(nameof(keys)); - - return Task.WhenAll(keys.Select(RemoveOneAsync)); - } - - /// - public void Set(string key, T value, CombinedCacheEntryOptions? options = null) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - if (value == null) - throw new ArgumentNullException(nameof(value)); - - _distributedClient.Set(key, value, options); - - Set(key, value, options?.MemoryCacheEntryOptions); - - PubSub(key, SubscribeOperation.Set, value, options); - } - - /// - public async Task SetAsync(string key, T value, CombinedCacheEntryOptions? options = null) - { - if (key == null) - throw new ArgumentNullException(nameof(key)); - - if (value == null) - throw new ArgumentNullException(nameof(value)); - - await _distributedClient.SetAsync(key, value, options); - - Set(key, value, options?.MemoryCacheEntryOptions); - - await PubSubAsync(key, SubscribeOperation.Set, value, options); - } - - /// - public void SetList(Dictionary keyValues, CombinedCacheEntryOptions? options = null) - { - if (keyValues == null) - throw new ArgumentNullException(nameof(keyValues)); - - _distributedClient.SetList(keyValues, options); - - Parallel.ForEach(keyValues, item => PubSub(item.Key, SubscribeOperation.Set, item.Value, options)); - } - - /// - public async Task SetListAsync(Dictionary keyValues, CombinedCacheEntryOptions? options = null) - { - if (keyValues == null) - throw new ArgumentNullException(nameof(keyValues)); - - await _distributedClient.SetListAsync(keyValues, options); - - await Task.WhenAll(keyValues.Select(item => PubSubAsync(item.Key, SubscribeOperation.Set, item.Value, options))); - } - - private void RemoveOne(string key) - { - _distributedClient.Remove(key); - - Publish(key, SubscribeOperation.Remove); - } - - private async Task RemoveOneAsync(string key) - { - await _distributedClient.RemoveAsync(key); - - await PublishAsync(key, SubscribeOperation.Remove); - } - - private void Subscribe(string channel, CombinedCacheEntryOptions? options = null) - { - if (!_subscribeChannels.Contains(channel)) - { - lock (_locker) - { - if (!_subscribeChannels.Contains(channel)) - { - _distributedClient.Subscribe(channel, (subscribeOptions) => - { - switch (subscribeOptions.Operation) - { - case SubscribeOperation.Set: - options ??= new CombinedCacheEntryOptions(); - _cache.Set(subscribeOptions.Key, subscribeOptions.Value, options.MemoryCacheEntryOptions); - break; - case SubscribeOperation.Remove: - _cache.Remove(subscribeOptions.Key); - break; - default: - throw new NotImplementedException(); - } - - options?.ValueChanged?.Invoke(subscribeOptions.Value); - }); - - _subscribeChannels.Add(channel); - } - } - } - } - - private void Publish(string key, SubscribeOperation operation, T? value = default) - { - var channel = FormatSubscribeChannel(key); - _distributedClient.Publish(channel, subscribeOptions => - { - subscribeOptions.Key = FormatMemoryCacheKey(key); - subscribeOptions.Operation = operation; - subscribeOptions.Value = value; - }); - } - - private async Task PublishAsync(string key, SubscribeOperation operation, T? value = default) - { - var channel = FormatSubscribeChannel(key); - await _distributedClient.PublishAsync(channel, subscribeOptions => - { - subscribeOptions.Key = FormatMemoryCacheKey(key); - subscribeOptions.Operation = operation; - subscribeOptions.Value = value; - }); - } - - private void PubSub(string key, SubscribeOperation operation, T? value, CombinedCacheEntryOptions? options = null) - { - var channel = FormatSubscribeChannel(key); - - if (!options?.IgnoreSubscribe ?? true) - { - Subscribe(channel, options); - } - - _distributedClient.Publish(channel, subscribeOptions => - { - subscribeOptions.Key = FormatMemoryCacheKey(key); - subscribeOptions.Operation = operation; - subscribeOptions.Value = value; - }); - } - - private async Task PubSubAsync(string key, SubscribeOperation operation, T? value=default, - CombinedCacheEntryOptions? options = null) - { - var channel = FormatSubscribeChannel(key); - - Subscribe(channel, options); - - await _distributedClient.PublishAsync(channel, subscribeOptions => - { - subscribeOptions.Key = FormatMemoryCacheKey(key); - subscribeOptions.Operation = operation; - subscribeOptions.Value = value; - }); - } - - private string FormatMemoryCacheKey(string key) => SubscribeHelper.FormatMemoryCacheKey(key); - - private string FormatSubscribeChannel(string key) => - SubscribeHelper.FormatSubscribeChannel(key, _subscribeKeyType, _subscribeKeyPrefix); - - private void Set(string key, T value, MemoryCacheEntryOptions? options = null) - { - var formattedKey = FormatMemoryCacheKey(key); - if (options == null) - { - _cache.Set(formattedKey, value); - } - else - { - _cache.Set(formattedKey, value, options); - } - } - - /// - public void Dispose() - { - _cache.Dispose(); - _distributedClient.Dispose(); - } -} diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs deleted file mode 100644 index 981b2e2ea..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.DistributedMemory; - -public class MemoryCacheClientFactory : IMemoryCacheClientFactory -{ - private readonly IServiceProvider _services; - - private readonly IOptionsMonitor _optionsMonitor; - - private readonly ConcurrentDictionary> _clients; - - private readonly Func> _clientFactory; - - public MemoryCacheClientFactory(IServiceProvider services, IOptionsMonitor optionsMonitor) - { - ArgumentNullException.ThrowIfNull(services); - - ArgumentNullException.ThrowIfNull(optionsMonitor); - - _services = services; - - _optionsMonitor = optionsMonitor; - - _clients = new ConcurrentDictionary>(); - - _clientFactory = (name) => - { - return new Lazy(() => - { - return CreateClientHandler(name); - }); - }; - } - - public MemoryCacheClient CreateClient(string name) - { - ArgumentNullException.ThrowIfNull(name); - - var client = _clients.GetOrAdd(name, _clientFactory); - - return client.Value; - } - - internal MemoryCacheClient CreateClientHandler(string name) - { - var options = _optionsMonitor.Get(name); - - if (options == null) - { - throw new ArgumentException("No matching client found!"); - } - - var memoryCache = new MemoryCache(Options.Create(options)); - - var factory = _services.GetRequiredService(); - - var distributedCacheClient = factory.CreateClient(name); - - return new MemoryCacheClient(memoryCache, distributedCacheClient, options.SubscribeKeyType, options.SubscribeKeyPrefix); - } -} diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs deleted file mode 100644 index 864754853..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.DistributedMemory; - -/// -/// Extension methods for . -/// -public static class MemoryCacheClientFactoryExtensions -{ - /// - /// Creates a new using the default configuration. - /// - /// The . - /// An configured using the default configuration. - public static IMemoryCacheClient CreateClient(this IMemoryCacheClientFactory factory) - { - if (factory == null) - { - throw new ArgumentNullException(nameof(factory)); - } - - return factory.CreateClient(string.Empty); - } -} diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs deleted file mode 100644 index c645980ee..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.DistributedMemory.Models; - -/// -/// The MASA memory cache options. -/// -public class MasaMemoryCacheOptions : MemoryCacheOptions -{ - /// - /// Gets or sets the . - /// - public SubscribeKeyTypes SubscribeKeyType { get; set; } = SubscribeKeyTypes.ValueTypeFullNameAndKey; - - /// - /// Gets or sets the prefix of subscribe key. - /// - public string SubscribeKeyPrefix { get; set; } = string.Empty; -} diff --git a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/_Imports.cs b/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/_Imports.cs deleted file mode 100644 index 8b254372c..000000000 --- a/src/Utils/Caching/DistributedMemory/src/Masa.Utils.Caching.DistributedMemory/_Imports.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Caching.Core.DependencyInjection; -global using Masa.Utils.Caching.Core.Helpers; -global using Masa.Utils.Caching.Core.Interfaces; -global using Masa.Utils.Caching.Core.Models; -global using Masa.Utils.Caching.DistributedMemory.Interfaces; -global using Masa.Utils.Caching.DistributedMemory.Models; -global using Microsoft.Extensions.Caching.Distributed; -global using Microsoft.Extensions.Caching.Memory; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Options; -global using System.Collections.Concurrent; diff --git a/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj b/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/MemoryCache.cs b/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/MemoryCache.cs deleted file mode 100644 index 015e66240..000000000 --- a/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/MemoryCache.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caching.Memory; - -public class MemoryCache : IDisposable where TKey : notnull -{ - private ConcurrentDictionary> _dicCache = new(); - - public TKey[] Keys - { - get - { - return _dicCache.Keys.ToArray(); - } - } - - public TValue[] Values - { - get - { - return _dicCache.Values.Select(value => value.Value).ToArray(); - } - } - - public bool Get(TKey key, out TValue? value) - { - bool result = _dicCache.TryGetValue(key, out var lazyValue); - value = lazyValue == null ? default : lazyValue.Value; - - return result; - } - - public bool TryGet(TKey key, out TValue? value) - { - var result = _dicCache.TryGetValue(key, out var lazyValue); - - if (result) - { - value = lazyValue == null ? default :lazyValue.Value; - } - else - { - value = default; - } - - return result; - } - - public bool TryAdd(TKey key, Func valueFactory) - { - return _dicCache.TryAdd(key, new Lazy(() => valueFactory(key), LazyThreadSafetyMode.ExecutionAndPublication)); - } - - public TValue GetOrAdd(TKey key, Func valueFactory) - { - if (!_dicCache.TryGetValue(key, out var lazyValue)) - { - lazyValue = _dicCache.GetOrAdd(key, k => new Lazy(() => valueFactory(k), LazyThreadSafetyMode.ExecutionAndPublication)); - } - - return lazyValue.Value; - } - - /// - /// Updates the value associated with key to newValue if the existing value with key is equal to comparisonValue. - /// - /// The key of the value that is compared with comparisonValue and possibly replaced. - /// The value that replaces the value of the element that has the specified key if the comparison results in equality. - /// The value that is compared with the value of the element that has the specified key. - /// true if the value with key was equal to comparisonValue and was replaced with newValue; otherwise, false. - public bool TryUpdate(TKey key, Func valueFactory, TValue comparisonValue) - { - return _dicCache.TryUpdate( - key, - new Lazy(() => valueFactory(key), LazyThreadSafetyMode.ExecutionAndPublication), - new Lazy(() => comparisonValue, LazyThreadSafetyMode.ExecutionAndPublication) - ); - } - - public TValue AddOrUpdate(TKey key, Func valueFactory) - { - return _dicCache.AddOrUpdate - ( - key, - k => new Lazy(() => valueFactory(k), LazyThreadSafetyMode.ExecutionAndPublication), - (oldkey, _) => new Lazy(() => valueFactory(oldkey), LazyThreadSafetyMode.ExecutionAndPublication) - ).Value; - } - - public bool Remove(TKey key) - { - return _dicCache.TryRemove(key, out _); - } - - public bool ContainsKey(TKey key) - { - return _dicCache.ContainsKey(key); - } - - public void Clear() - { - _dicCache.Clear(); - } - - public void Dispose() - { - _dicCache.Clear(); - } -} diff --git a/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/_Imports.cs b/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/_Imports.cs deleted file mode 100644 index 5b736fb9c..000000000 --- a/src/Utils/Caching/Memory/src/Masa.Utils.Caching.Memory/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using System.Collections.Concurrent; diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/AbstractCallerProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/AbstractCallerProvider.cs deleted file mode 100644 index abf252544..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/AbstractCallerProvider.cs +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public abstract class AbstractCallerProvider : ICallerProvider -{ - private readonly ITypeConvertProvider _typeConvertProvider; - public readonly IServiceProvider ServiceProvider; - - private IRequestMessage? _requestMessage; - private IResponseMessage? _responseMessage; - protected IRequestMessage RequestMessage => _requestMessage ??= ServiceProvider.GetRequiredService(); - protected IResponseMessage ResponseMessage => _responseMessage ??= ServiceProvider.GetRequiredService(); - - public AbstractCallerProvider(IServiceProvider serviceProvider) - { - _typeConvertProvider = serviceProvider.GetRequiredService(); - ServiceProvider = serviceProvider; - } - - public virtual async Task SendAsync( - HttpRequestMessage request, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var response = await SendAsync(request, cancellationToken); - if (autoThrowUserFriendlyException) - await ResponseMessage.ProcessResponseAsync(response, cancellationToken); - - return response; - } - - public abstract Task SendAsync( - HttpRequestMessage request, - CancellationToken cancellationToken = default); - - public abstract Task CreateRequestAsync( - HttpMethod method, - string? methodName); - - public abstract Task CreateRequestAsync( - HttpMethod method, - string? methodName, - TRequest data); - - public abstract Task SendAsync( - HttpRequestMessage request, - CancellationToken cancellationToken = default); - - public virtual async Task SendAsync( - HttpMethod method, - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(method, methodName); - request.Content = content; - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task SendAsync( - HttpMethod method, - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task SendAsync( - HttpMethod method, - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public abstract Task SendGrpcAsync( - string methodName, - CancellationToken cancellationToken = default); - - public abstract Task SendGrpcAsync( - string methodName, - CancellationToken cancellationToken = default) - where TResponse : IMessage, new(); - - public abstract Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - where TRequest : IMessage; - - public abstract Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - where TRequest : IMessage - where TResponse : IMessage, new(); - - public virtual async Task GetStringAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); - HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - return await content.Content.ReadAsStringAsync(cancellationToken); - } - - public virtual Task GetStringAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class - => GetStringAsync( - GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data)), - autoThrowUserFriendlyException, - cancellationToken); - - public virtual Task GetStringAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => GetStringAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task GetByteArrayAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); - HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - return await content.Content.ReadAsByteArrayAsync(cancellationToken); - } - - public virtual Task GetByteArrayAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class - => GetByteArrayAsync( - GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data)), - autoThrowUserFriendlyException, - cancellationToken); - - public virtual Task GetByteArrayAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => GetByteArrayAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task GetStreamAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); - HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - return await content.Content.ReadAsStreamAsync(cancellationToken); - } - - public virtual Task GetStreamAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class - => GetStreamAsync( - GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data)), - autoThrowUserFriendlyException, - cancellationToken); - - public virtual Task GetStreamAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => GetStreamAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); - - public virtual Task GetAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Get, methodName, null, autoThrowUserFriendlyException, cancellationToken); - - public virtual Task GetAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => GetAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task GetAsync( - string? methodName, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task GetAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) where TRequest : class - { - HttpRequestMessage request = - await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data))); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task GetAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = - await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data))); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task GetAsync( - string? methodName, - Dictionary data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, data)); - return await SendAsync(request, cancellationToken); - } - - protected virtual string GetUrl(string? url, IEnumerable> properties) - { - url ??= string.Empty; - foreach (var property in properties) - { - string value = property.Value; - - url = !url.Contains("?") ? - $"{url}?{property.Key}={value}" : - $"{url}&{property.Key}={value}"; - } - - return url; - } - - public virtual Task PostAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Post, methodName, content, autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task PostAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task PostAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task PostAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual Task PatchAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Patch, methodName, content, autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task PatchAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Patch, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task PatchAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task PatchAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual Task PutAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Put, methodName, content, autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task PutAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task PutAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task PutAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual Task DeleteAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - => SendAsync(HttpMethod.Delete, methodName, content, autoThrowUserFriendlyException, cancellationToken); - - public virtual async Task DeleteAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); - return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); - } - - public virtual async Task DeleteAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); - return await SendAsync(request, cancellationToken); - } - - public virtual async Task DeleteAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default) - { - var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); - return await SendAsync(request, cancellationToken); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/AddCallerExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/AddCallerExtensions.cs deleted file mode 100644 index 11d8d1a36..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/AddCallerExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public class AddCallerExtensions -{ - public static void AddCaller(CallerOptions callerOptions, string name, bool isDefault, Func func) - { - if (callerOptions.Callers.Any(c => c.Name == name)) - throw new ArgumentException($"The caller name already exists, please change the name, the repeat name is {name}"); - - callerOptions.Callers.Add(new CallerRelations(name, isDefault, func)); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerBase.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerBase.cs deleted file mode 100644 index d09453db8..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerBase.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public abstract class CallerBase -{ - public virtual string Name { get; set; } = string.Empty; - - protected CallerOptions CallerOptions { get; private set; } = default!; - - private ICallerProvider? _callerProvider; - - protected ICallerProvider CallerProvider => _callerProvider ??= ServiceProvider.GetRequiredService().CreateClient(Name); - - private IServiceProvider ServiceProvider { get; } - - protected CallerBase(IServiceProvider serviceProvider) - { - ServiceProvider = serviceProvider; - } - - public abstract void UseCallerExtension(); - - public void SetCallerOptions(CallerOptions options, string name) - { - CallerOptions = options; - if (string.IsNullOrEmpty(Name)) - Name = name; - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerOptions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerOptions.cs deleted file mode 100644 index 61ccb5535..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/CallerOptions.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public class CallerOptions -{ - internal readonly List Callers = new(); - - public IServiceCollection Services { get; } - - private Assembly[] _assemblies = AppDomain.CurrentDomain.GetAssemblies(); - - public Assembly[] Assemblies - { - get => _assemblies; - set - { - ArgumentNullException.ThrowIfNull(value, nameof(Assemblies)); - - _assemblies = value; - } - } - - public ServiceLifetime CallerLifetime { get; set; } - - public JsonSerializerOptions? JsonSerializerOptions { get; set; } - - public string RequestIdKey { get; set; } = "Masa-Request-Id"; - - public CallerOptions(IServiceCollection services) - { - Services = services; - CallerLifetime = ServiceLifetime.Scoped; - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultCallerFactory.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultCallerFactory.cs deleted file mode 100644 index 2f8c1a3c2..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultCallerFactory.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -internal class DefaultCallerFactory : ICallerFactory -{ - private readonly IServiceProvider _serviceProvider; - private readonly List _callers; - - public DefaultCallerFactory(IServiceProvider serviceProvider, CallerOptions options) - { - _serviceProvider = serviceProvider; - _callers = options.Callers; - } - - public ICallerProvider CreateClient() - { - var caller = _callers.SingleOrDefault(c => c.IsDefault) ?? _callers.FirstOrDefault()!; - return caller.Func.Invoke(_serviceProvider); - } - - public ICallerProvider CreateClient(string name) - { - var caller = _callers.SingleOrDefault(c => c.Name == name); - if (caller == null) - throw new NotSupportedException($"Please make sure you have used [{name}] Caller"); - - return caller.Func.Invoke(_serviceProvider); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs deleted file mode 100644 index cc232ed08..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public class DefaultRequestIdGenerator : IRequestIdGenerator -{ - public string NewId() => Guid.NewGuid().ToString(); -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestMessage.cs deleted file mode 100644 index 300462c30..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultRequestMessage.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public abstract class DefaultRequestMessage -{ - private readonly string _requestIdKey; - private readonly IRequestIdGenerator _requestIdGenerator; - private readonly IHttpContextAccessor? _httpContextAccessor; - - public DefaultRequestMessage(string requestIdKey, IRequestIdGenerator requestIdGenerator, - IHttpContextAccessor? httpContextAccessor = null) - { - _requestIdKey = requestIdKey; - _requestIdGenerator = requestIdGenerator; - _httpContextAccessor = httpContextAccessor; - } - - protected void TrySetRequestId(HttpRequestMessage requestMessage) - { - var httpContext = _httpContextAccessor?.HttpContext; - if (httpContext == null) - return; - - if (!httpContext.Request.Headers.TryGetValue(_requestIdKey, out var requestId)) - requestId = _requestIdGenerator.NewId(); - - if (requestMessage.Headers.All(h => h.Key != _requestIdKey)) - requestMessage.Headers.Add(_requestIdKey, requestId.ToString()); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultResponseMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultResponseMessage.cs deleted file mode 100644 index 7f50faa39..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultResponseMessage.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public class DefaultResponseMessage : IResponseMessage -{ - private readonly ILogger? _logger; - private readonly CallerOptions _callerOptions; - - public DefaultResponseMessage(CallerOptions callerOptions, ILogger? logger = null) - { - _callerOptions = callerOptions; - _logger = logger; - } - - public async Task ProcessResponseAsync(HttpResponseMessage response, - CancellationToken cancellationToken = default) - { - if (response.IsSuccessStatusCode) - { - switch (response.StatusCode) - { - case HttpStatusCode.Accepted: - case HttpStatusCode.NoContent: - return default; - case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: - throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); - default: - if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - if (string.IsNullOrEmpty(content)) - return (TResponse)(object?)null!; - - return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); - } - if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - if (string.IsNullOrEmpty(content)) - return (TResponse)(object?)null!; - - return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); - } - if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - return (TResponse)Convert.ChangeType(content, typeof(TResponse)); - } - try - { - return await response.Content.ReadFromJsonAsync(_callerOptions.JsonSerializerOptions, cancellationToken) - ?? throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); - } - catch (Exception exception) - { - _logger?.LogWarning(exception, exception.Message); - ExceptionDispatchInfo.Capture(exception).Throw(); - return default; //This will never be executed, the previous line has already thrown an exception - } - } - } - - await ProcessResponseExceptionAsync(response, cancellationToken); - return default; //never executed - } - - public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) - { - if (response.IsSuccessStatusCode) - { - switch (response.StatusCode) - { - case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: - throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); - default: - return; - } - } - - await ProcessResponseExceptionAsync(response, cancellationToken); - } - - public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) - { - if (response.Content.Headers.ContentLength is > 0) - throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); - - throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs deleted file mode 100644 index 39a57bb2c..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public class DefaultTypeConvertProvider : ITypeConvertProvider -{ - private static readonly ConcurrentDictionary> Dictionary = new(); - - protected readonly List NotNeedSerializeTypes = new() - { - typeof(String), - typeof(Guid), - typeof(DateTime), - typeof(Decimal), - typeof(Guid?), - typeof(DateTime?), - typeof(Decimal?) - }; - - /// - /// Convert custom object to dictionary - /// - /// - /// Support classes, anonymous objects - /// - [Obsolete("Use ConvertToKeyValuePairs instead")] - public Dictionary ConvertToDictionary(TRequest request) where TRequest : class - => new(ConvertToKeyValuePairs(request)); - - /// - /// Convert custom object to dictionary - /// - /// - /// Support classes, anonymous objects - /// - public IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class - { - if (request.Equals(null)) - return Array.Empty>(); - - if (request is Dictionary response) - return response; - - if (request is IEnumerable> keyValuePairs) - return keyValuePairs; - - var requestType = request.GetType(); - if (!Dictionary.TryGetValue(requestType, out List? members)) - { - members = GetMembers(request.GetType().GetProperties()); - Dictionary.TryAdd(requestType, members); - } - List> data = new List>(); - foreach (var member in members) - { - if (member.TryGetValue(request, out string value)) - data.Add(new KeyValuePair(member.Name, value)); - } - return data; - } - - private List GetMembers(PropertyInfo[] properties) - { - List members = new(); - foreach (var property in properties) - { - if (IsSkip(property)) continue; - - string name = GetPropertyName(property); - - members.Add(new PropertyInfoMember(property, name, IsNeedSerialize(property))); - } - return members; - } - - protected bool IsSkip(PropertyInfo property) - => !property.CanRead || - !property.PropertyType.IsPublic || - property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonIgnoreAttribute)); - - protected string GetPropertyName(PropertyInfo property) - { - if (property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))) - { - var customAttributeData = - property.CustomAttributes.FirstOrDefault(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))!; - var customAttribute = customAttributeData.ConstructorArguments.FirstOrDefault(); - return customAttribute.Value?.ToString() ?? - throw new NotSupportedException( - $"Parameter name: {property.Name}, But the JsonPropertyNameAttribute assignment name is empty"); - } - return property.Name; - } - - protected bool IsNeedSerialize(PropertyInfo property) - => !property.PropertyType.IsPrimitive && !NotNeedSerializeTypes.Contains(property.PropertyType); -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerFactory.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerFactory.cs deleted file mode 100644 index 12013c0a1..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public interface ICallerFactory -{ - ICallerProvider CreateClient(); - - ICallerProvider CreateClient(string name); -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerProvider.cs deleted file mode 100644 index a77a3df09..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/ICallerProvider.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public interface ICallerProvider -{ - Task SendAsync( - HttpRequestMessage request, - CancellationToken cancellationToken = default); - - Task SendAsync( - HttpRequestMessage request, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task SendAsync( - HttpMethod method, - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task SendAsync( - HttpMethod method, - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task SendAsync( - HttpMethod method, - string? methodName, - TRequest data, - CancellationToken cancellationToken = default); - - Task SendGrpcAsync( - string methodName, - CancellationToken cancellationToken = default); - - Task SendGrpcAsync( - string methodName, - CancellationToken cancellationToken = default) - where TResponse : IMessage, new(); - - Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - where TRequest : IMessage; - - Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - where TRequest : IMessage - where TResponse : IMessage, new(); - - Task GetStringAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetStringAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class; - - Task GetStringAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetByteArrayAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetByteArrayAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class; - - Task GetByteArrayAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetStreamAsync(string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetStreamAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default) where TRequest : class; - - Task GetStreamAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetAsync( - string? methodName, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetAsync( - string? methodName, - Dictionary data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task GetAsync( - string? methodName, - CancellationToken cancellationToken = default); - - Task GetAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default) - where TRequest : class; - - Task GetAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default); - - Task GetAsync(string? methodName, Dictionary data, - CancellationToken cancellationToken = default); - - Task PostAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PostAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PostAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default); - - Task PostAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default); - - Task PatchAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PatchAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PatchAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default); - - Task PatchAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default); - - Task PutAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PutAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task PutAsync( - string? methodName, - TRequest data, - CancellationToken cancellationToken = default); - - Task PutAsync( - string? methodName, - object data, - CancellationToken cancellationToken = default); - - Task DeleteAsync( - string? methodName, - HttpContent? content, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task DeleteAsync( - string? methodName, - TRequest data, - bool autoThrowUserFriendlyException = true, - CancellationToken cancellationToken = default); - - Task DeleteAsync(string? methodName, TRequest data, CancellationToken cancellationToken = default); - - Task DeleteAsync(string? methodName, object data, CancellationToken cancellationToken = default); -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestIdGenerator.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestIdGenerator.cs deleted file mode 100644 index d542a95b7..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestIdGenerator.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public interface IRequestIdGenerator -{ - string NewId(); -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestMessage.cs deleted file mode 100644 index 2686fef7d..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/IRequestMessage.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public interface IRequestMessage -{ - Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage); - - Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data); -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/IResponseMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/IResponseMessage.cs deleted file mode 100644 index 183320451..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/IResponseMessage.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public interface IResponseMessage -{ - Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); - - Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/ITypeConvertProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/ITypeConvertProvider.cs deleted file mode 100644 index 25fc03873..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/ITypeConvertProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public interface ITypeConvertProvider -{ - /// - /// Convert custom object to dictionary - /// - /// - /// Support classes, anonymous objects - /// - [Obsolete("Use ConvertToKeyValuePairs instead")] - Dictionary ConvertToDictionary(TRequest request) where TRequest : class; - - /// - /// Convert custom object to dictionary - /// - /// - /// Support classes, anonymous objects - /// - IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class; -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs deleted file mode 100644 index 0e9c441c0..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core.Internal; - -/// -/// Caller dependency orchestration -/// -internal static class CallerDependExtensions -{ - /// - /// Caller dependency orchestration - /// - /// All Callers that inherit CallerBase - /// - /// - public static List Arrangement(this List callerTypes) - { - List types = GetCallerByNotDependCaller(callerTypes); - if (types.Count == 0) - throw new UserFriendlyException(Const.CIRCULAR_DEPENDENCY); - - return callerTypes.CallersArrangement(types, 1); - } - - private static List CallersArrangement(this List allTypes, List existTypes, int executeTimes) - { - List types = existTypes; - var dependCallerTypes = allTypes.Except(existTypes); - foreach (var type in dependCallerTypes) - { - var constructorInfo = type.GetConstructors().MaxBy(con => con.GetParameters().Length)!; - bool isExist = true; - foreach (var parameter in constructorInfo.GetParameters()) - { - var parameterType = parameter.ParameterType; - if (typeof(CallerBase).IsAssignableFrom(parameterType) && !types.Contains(parameterType)) - { - isExist = false; - } - } - if (isExist) - types.Add(type); - } - - if (types.Count != allTypes.Count) - { - if (executeTimes >= allTypes.Count) - throw new UserFriendlyException(Const.CIRCULAR_DEPENDENCY); - - return CallersArrangement(allTypes, types, ++executeTimes); - } - return types; - } - - /// - /// Get a Caller object that does not depend on other Callers - /// - /// - /// - private static List GetCallerByNotDependCaller(this List callerTypes) - { - List types = new(); - callerTypes.ForEach(type => - { - if (!type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).IsDependCaller()) - types.Add(type); - }); - return types; - } - - private static bool IsDependCaller(this ConstructorInfo[] constructorInfos) - { - var constructorInfo = constructorInfos.MaxBy(constructorInfo => constructorInfo.GetParameters().Length)!; - return constructorInfo.IsDependCaller(); - } - - private static bool IsDependCaller(this ConstructorInfo constructorInfo) - { - foreach (var parameter in constructorInfo.GetParameters()) - { - if (typeof(CallerBase).IsAssignableFrom(parameter.ParameterType)) - { - return true; - } - } - return false; - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerRelations.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerRelations.cs deleted file mode 100644 index 1724865fe..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/CallerRelations.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core.Internal; - -internal class CallerRelations -{ - public string Name { get; } = default!; - - public bool IsDefault { get; } - - public Func Func { get; } = default!; - - public CallerRelations(string name, bool isDefault, Func func) - { - Name = name; - IsDefault = isDefault; - Func = func; - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Const.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Const.cs deleted file mode 100644 index 191ba6c15..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Const.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core.Internal; - -internal class Const -{ - public const string CIRCULAR_DEPENDENCY = "Caller has a circular dependency, please check the constructor of Caller"; -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs deleted file mode 100644 index 3958e6f4d..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core.Internal.Options; - -internal class PropertyInfoMember -{ - public PropertyInfo Property { get; } - - public string Name { get; } - - public bool NeedSerialize { get; } - - public PropertyInfoMember(PropertyInfo property, string name, bool needSerialize) - { - Property = property; - Name = name; - NeedSerialize = needSerialize; - } - - public bool TryGetValue(TRequest data, out string value) where TRequest : class - { - value = string.Empty; - var propertyValue = Property.GetValue(data); - if (propertyValue == null || (!NeedSerialize && propertyValue.ToString() == null)) - return false; - - value = !NeedSerialize ? propertyValue.ToString()! : JsonSerializer.Serialize(propertyValue); - return true; - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/JsonRequestMessage.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/JsonRequestMessage.cs deleted file mode 100644 index 004c4e081..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/JsonRequestMessage.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Core; - -public class JsonRequestMessage : DefaultRequestMessage, IRequestMessage -{ - private readonly JsonSerializerOptions? _jsonSerializerOptions; - - public JsonRequestMessage( - CallerOptions callerOptions, - IRequestIdGenerator requestIdGenerator, - IHttpContextAccessor? httpContextAccessor = null) - : base(callerOptions.RequestIdKey, requestIdGenerator, httpContextAccessor) - => _jsonSerializerOptions = callerOptions.JsonSerializerOptions; - - public virtual Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) - { - TrySetRequestId(requestMessage); - return Task.FromResult(requestMessage); - } - - public virtual async Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) - { - requestMessage = await ProcessHttpRequestMessageAsync(requestMessage); - requestMessage.Content = JsonContent.Create(data, options: _jsonSerializerOptions); - return requestMessage; - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj b/src/Utils/Caller/src/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj deleted file mode 100644 index ca9b278bf..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/README.md b/src/Utils/Caller/src/Masa.Utils.Caller.Core/README.md deleted file mode 100644 index 3b35bcdb2..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/README.md +++ /dev/null @@ -1,36 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Utils.Caller.Core - -Masa.Utils.Caller.Core is the basic class library of Caller, which provides the abstraction of the following capabilities - -* `ICallerFactory`: Factory for creating `CallerProvider` (Singleton) -* `ICallerProvider`: Provides `Post`, `Delete`, `Patch`, `Put`, `Get`, `Send` capabilities (Scoped) -* `IRequestMessage`: Provides the ability to process request data (default implementation [`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) -* `IResponseMessage`: Provides the ability to handle response data (default implementation [`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) -* `ITypeConvertProvider`: Provides the ability to convert types, support for `Get` requests of `ICallerProvider` (Singleton) - -## Summarize - -`Masa.Utils.Caller.Core` is the basic class library of Caller, but it cannot be used alone. Currently, Caller supports two implementations: - -* Implementation based on HttpClient: [Masa.Utils.Caller.HttpClient](../Masa.Utils.Caller.HttpClient/README.md) -* Implementation based on DaprClient: [Masa.Utils.Caller.DaprClient](../Masa.Utils.Caller.DaprClient/README.md) - -> Q: What should I do if the callee uses xml instead of json? -> -> A: Rewrite IRequestMessage and add the custom RequestMessage to the IServiceCollection before calling AddCaller - - ```` C# - services.AddSingleton(); - services.AddCaller(); - ```` - -> Q: If you want to handle custom StatusCode and throw exception information -> -> A: Rewrite IResponseMessage, add custom ResponseMessage to IServiceCollection before calling AddCaller - - ```` C# - services.AddSingleton(); - services.AddCaller(); - ```` \ No newline at end of file diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/README.zh-CN.md b/src/Utils/Caller/src/Masa.Utils.Caller.Core/README.zh-CN.md deleted file mode 100644 index e4148a140..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/README.zh-CN.md +++ /dev/null @@ -1,36 +0,0 @@ -中 | [EN](README.md) - -## Masa.Utils.Caller.Core - -Masa.Utils.Caller.Core是Caller的基础类库,提供了以下能力的抽象 - -* `ICallerFactory`: 工厂,用于创建`CallerProvider` (Singleton) -* `ICallerProvider`: 提供`Post`、`Delete`、`Patch`、`Put`、`Get`、`Send`的能力 (Scoped) -* `IRequestMessage`: 提供对请求数据处理的能力 (默认实现[`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) -* `IResponseMessage`: 提供对响应数据处理的能力 (默认实现[`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) -* `ITypeConvertProvider`: 提供类型转换的能力,为`ICallerProvider`的`Get`请求支撑 (Singleton) - -## 总结 - -`Masa.Utils.Caller.Core`是Caller的基础类库,但不能单独使用,目前Caller支持了两种实现方式: - -* 基于HttpClient的实现: [Masa.Utils.Caller.HttpClient](../Masa.Utils.Caller.HttpClient/README.zh-CN.md) -* 基于DaprClient的实现: [Masa.Utils.Caller.DaprClient](../Masa.Utils.Caller.DaprClient/README.zh-CN.md) - -> Q: 如果被调用方使用的是数据格式为xml,而不是json,我应该怎么做? -> -> A: 重写IRequestMessage,在调用AddCaller之前先将自定义的RequestMessage添加到IServiceCollection中 - - ``` C# - services.AddSingleton(); - services.AddCaller(); - ``` - -> Q: 如果希望处理自定义的StatusCode,并抛出异常信息 -> -> A: 重写IResponseMessage,在调用AddCaller之前先将自定义的ResponseMessage添加到IServiceCollection中 - - ``` C# - services.AddSingleton(); - services.AddCaller(); - ``` \ No newline at end of file diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs deleted file mode 100644 index fa23ee27c..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddCaller(this IServiceCollection services) - => services.AddCaller(AppDomain.CurrentDomain.GetAssemblies()); - - public static IServiceCollection AddCaller(this IServiceCollection services, params Assembly[] assemblies) - => services.AddCaller(options => options.Assemblies = assemblies); - - private static IServiceCollection AddCaller(this IServiceCollection services, - ServiceLifetime lifetime = ServiceLifetime.Scoped, - params Assembly[] assemblies) - => services.AddCaller(options => - { - options.Assemblies = assemblies; - options.CallerLifetime = lifetime; - }); - - public static IServiceCollection AddCaller(this IServiceCollection services, Action options) - { - CallerOptions callerOption = new CallerOptions(services); - options.Invoke(callerOption); - - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - services.TryAddScoped(serviceProvider => serviceProvider.GetRequiredService().CreateClient()); - - services.TryAddSingleton(); - services.AddAutomaticCaller(callerOption); - TryOrUpdateCallerOptions(services, callerOption); - return services; - } - - private static IServiceCollection TryOrUpdateCallerOptions(this IServiceCollection services, CallerOptions options) - { - services.TryAddSingleton(new CallerOptions(options.Services)); - var serviceProvider = services.BuildServiceProvider(); - var callerOptions = serviceProvider.GetRequiredService(); - - options.Callers.ForEach(caller => - { - if (callerOptions.Callers.Any(relation => relation.Name == caller.Name)) - throw new ArgumentException( - $"The caller name already exists, please change the name, the repeat name is [{caller.Name}]"); - - if (callerOptions.Callers.Any(relation => relation.IsDefault && caller.IsDefault)) - { - string errorCallerNames = string.Join("、", callerOptions.Callers - .Where(relation => relation.IsDefault) - .Select(relation => relation.Name) - .Concat(options.Callers.Where(relation => relation.IsDefault).Select(relation => relation.Name)) - .Distinct()); - throw new ArgumentException( - $"There can only be at most one default Caller Provider, and now the following Caller Providers are found to be default: {errorCallerNames}"); - } - - callerOptions.Callers.Add(caller); - }); - - return services; - } - - private static void AddAutomaticCaller(this IServiceCollection services, CallerOptions callerOptions) - { - var callerTypes = callerOptions.Assemblies.SelectMany(x => x.GetTypes()) - .Where(type => typeof(CallerBase).IsAssignableFrom(type) && !type.IsAbstract).ToList(); - - callerTypes = callerTypes.Except(services.Select(d => d.ServiceType)).ToList(); - - if (callerTypes.Count == 0) - return; - - - callerTypes.Arrangement().ForEach(type => - { - ServiceDescriptor serviceDescriptor = new ServiceDescriptor(type, serviceProvider => - { - var constructorInfo = type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) - .MaxBy(constructor => constructor.GetParameters().Length)!; - List parameters = new(); - foreach (var parameter in constructorInfo.GetParameters()) - { - parameters.Add(serviceProvider.GetRequiredService(parameter.ParameterType)); - } - var callerBase = (constructorInfo.Invoke(parameters.ToArray()) as CallerBase)!; - callerBase.SetCallerOptions(callerOptions, type.FullName ?? type.Name); - return callerBase; - }, callerOptions.CallerLifetime); - services.TryAdd(serviceDescriptor); - }); - - var serviceProvider = services.BuildServiceProvider(); - callerTypes.ForEach(type => - { - var callerBase = (CallerBase)serviceProvider.GetRequiredService(type); - callerBase.UseCallerExtension(); - }); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.Core/_Imports.cs b/src/Utils/Caller/src/Masa.Utils.Caller.Core/_Imports.cs deleted file mode 100644 index 95fdf3d27..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.Core/_Imports.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Google.Protobuf; -global using Masa.Utils.Caller.Core; -global using Masa.Utils.Caller.Core.Internal; -global using Masa.Utils.Caller.Core.Internal.Options; -global using Masa.Utils.Exceptions; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using System.Collections.Concurrent; -global using System.Net; -global using System.Net.Http.Json; -global using System.Reflection; -global using System.Runtime.ExceptionServices; -global using System.Text.Json; -global using System.Text.Json.Serialization; -global using Microsoft.AspNetCore.Http; diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs deleted file mode 100644 index 561c8a73c..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.DaprClient; - -public static class CallerOptionsExtensions -{ - public static CallerOptions UseDapr(this CallerOptions callerOptions, Func clientBuilder) - { - if (clientBuilder == null) - throw new ArgumentNullException(nameof(clientBuilder)); - - MasaDaprClientBuilder builder = clientBuilder.Invoke(); - if (clientBuilder == null) - throw new ArgumentNullException(nameof(clientBuilder)); - - callerOptions.Services.AddDaprClient(daprClientBuilder => - { - if (callerOptions.JsonSerializerOptions != null) - daprClientBuilder.UseJsonSerializationOptions(callerOptions.JsonSerializerOptions); - - builder.Configure?.Invoke(daprClientBuilder); - }); - - AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, - serviceProvider => new DaprCallerProvider(serviceProvider, builder.AppId)); - return callerOptions; - } - - public static CallerOptions UseDapr(this CallerOptions callerOptions, Action clientBuilder) - { - if (clientBuilder == null) - throw new ArgumentNullException(nameof(clientBuilder)); - - MasaDaprClientBuilder builder = new MasaDaprClientBuilder(); - clientBuilder.Invoke(builder); - - return callerOptions.UseDapr(() => builder); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs deleted file mode 100644 index b882ec689..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.DaprClient; - -public abstract class DaprCallerBase : CallerBase -{ - protected abstract string AppId { get; set; } - - public virtual Action? Configure { get; set; } = null; - - protected DaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public override void UseCallerExtension() => UseDapr(); - - protected virtual void UseDapr() - { - CallerOptions.UseDapr(opt => - { - opt.Name = Name; - opt.AppId = AppId; - if (Configure != null) - { - opt.Configure = Configure; - } - }); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs deleted file mode 100644 index 246ea8c8a..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.DaprClient; - -public class DaprCallerProvider : AbstractCallerProvider -{ - private readonly string AppId; - private Dapr.Client.DaprClient? _daprClient; - private Dapr.Client.DaprClient DaprClient => _daprClient ??= ServiceProvider.GetRequiredService(); - - public DaprCallerProvider(IServiceProvider serviceProvider, string appId) - : base(serviceProvider) - => AppId = appId; - - public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) - where TResponse : default - { - var response = await DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); - return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); - } - - public override Task CreateRequestAsync(HttpMethod method, string? methodName) - => RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName)); - - public override Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) - => RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName), data); - - public override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) - => DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); - - public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) - => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); - - public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) - => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); - - public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) - => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, request, cancellationToken); - - public override Task SendGrpcAsync( - string methodName, - TRequest request, - CancellationToken cancellationToken = default) - => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj deleted file mode 100644 index a8e99bc03..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs deleted file mode 100644 index eeaf95d33..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.DaprClient; - -public class MasaDaprClientBuilder -{ - private string _appId = default!; - - public string AppId - { - get - { - return _appId; - } - set - { - if (string.IsNullOrEmpty(value)) - throw new ArgumentNullException(nameof(AppId)); - - _appId = value; - } - } - - private string _name = default!; - - public string Name - { - get - { - return _name; - } - set - { - if (value is null) - throw new ArgumentNullException(nameof(Name)); - - _name = value; - } - } - - public bool IsDefault { get; set; } = false; - - public Action? Configure { get; set; } - - internal MasaDaprClientBuilder() - { - this.Name = string.Empty; - } - - public MasaDaprClientBuilder(string appid) - : this(appid, "dapr") { } - - public MasaDaprClientBuilder(string appid, string name) - : this(appid, name, null) - { - } - - public MasaDaprClientBuilder(string appid, string name, Action? configure) : this(appid, name, configure, false) - { - } - - public MasaDaprClientBuilder(string appid, string name, Action? configure, bool isDefault) - { - AppId = appid; - Name = name; - Configure = configure; - IsDefault = isDefault; - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.md b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.md deleted file mode 100644 index 0a4543e05..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.md +++ /dev/null @@ -1,101 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Utils.Caller.DaprClient - -## Example: - -````c# -Install-Package Masa.Utils.Caller.DaprClient -```` - -### Basic usage: - -1. Modify `Program.cs` - - ```` C# - builder.Services.AddCaller(options => - { - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one Provider, you can not assign a value to Name - clientBuilder.AppId = "" ;//AppID of the callee dapr - }); - }); - ```` - -2. How to use: - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) - => userCallerProvider.GetAsync($"/Hello", new { Name = name })); - ```` - - > The interface address of the complete request is: http://localhost:3500/v1.0/invoke//method/Hello?Name={name} - -3. When there are multiple DaprClients, modify `Program.cs` - - ```` C# - builder.Services.AddCaller(options => - { - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "UserCaller"; - clientBuilder.AppId = "" ;//AppID of the callee User service Dapr - }); - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "OrderCaller"; - clientBuilder.AppId = "" ;//AppID of the callee Order service Dapr - }); - }); - ```` - -4. How to use UserCaller or OrderCaller - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) - => userCallerProvider.GetAsync($"/Hello", new { Name = name })); - - - app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => - { - var callerProvider = callerFactory.CreateClient("OrderCaller"); - return callerProvider.GetAsync($"/Hello", new { Name = name }); - }); - ```` - -> When multiple Callers are added, how to get the specified Caller? ->> Get the CallerProvider of the specified alias through the `CreateClient` method of `CallerFactory` -> -> Why doesn't `userCallerProvider` get the corresponding Caller through the `CreateClient` method of `CallerFactory`? ->> If no default ICallerProvider is specified, the default CallerProvider is the first one added in the `AddCaller` method - -### Recommended usage - -1. Modify `Program.cs` - - ```` C# - builder.Services.AddCaller(); - ```` - -2. Add a new class `UserCaller` - - ```` C# - public class UserCaller: DaprCallerBase - { - protected override string AppId { get; set; } = ""; - - public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); - } - ```` - -3. How to use UserCaller - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) - => caller.HelloAsync(name)); - ```` \ No newline at end of file diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.zh-CN.md b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.zh-CN.md deleted file mode 100644 index 4a0fd6ff8..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/README.zh-CN.md +++ /dev/null @@ -1,101 +0,0 @@ -中 | [EN](README.md) - -## Masa.Utils.Caller.DaprClient - -## 用例: - -```c# -Install-Package Masa.Utils.Caller.DaprClient -``` - -### 基本用法: - -1. 修改`Program.cs` - - ``` C# - builder.Services.AddCaller(options => - { - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个Provider时,可以不对Name赋值 - clientBuilder.AppId = "" ;//被调用方dapr的AppID - }); - }); - ``` - -2. 如何使用: - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) - => userCallerProvider.GetAsync($"/Hello", new { Name = name })); - ``` - - > 完整请求的接口地址是:http://localhost:3500/v1.0/invoke//method/Hello?Name={name} - -3. 当存在多个DaprClient时,则修改`Program.cs`为 - - ``` C# - builder.Services.AddCaller(options => - { - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "UserCaller"; - clientBuilder.AppId = "" ;//被调用方User服务Dapr的AppID - }); - options.UseDapr(clientBuilder => - { - clientBuilder.Name = "OrderCaller"; - clientBuilder.AppId = "" ;//被调用方Order服务Dapr的AppID - }); - }); - ``` - -4. 如何使用UserCaller或OrderCaller - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) - => userCallerProvider.GetAsync($"/Hello", new { Name = name })); - - - app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => - { - var callerProvider = callerFactory.CreateClient("OrderCaller"); - return callerProvider.GetAsync($"/Hello", new { Name = name }); - }); - ``` - -> 当多个Caller被添加时,如何获取指定的Caller? ->> 通过`CallerFactory`的`CreateClient`方法得到指定别名的CallerProvider -> -> 为什么`userCallerProvider`没有通过`CallerFactory`的`CreateClient`方法得到对应的Caller? ->> 如果未指定默认的ICallerProvider,则在`AddCaller`方法中第一个被添加的就是默认的CallerProvider - -### 推荐用法 - -1. 修改`Program.cs` - - ``` C# - builder.Services.AddCaller(); - ``` - -2. 新增加类`UserCaller` - - ``` C# - public class UserCaller: DaprCallerBase - { - protected override string AppId { get; set; } = ""; - - public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); - } - ``` - -3. 如何使用UserCaller - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) - => caller.HelloAsync(name)); - ``` \ No newline at end of file diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/_Imports.cs b/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/_Imports.cs deleted file mode 100644 index 2290a94b0..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.DaprClient/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Dapr.Client; -global using Masa.Utils.Caller.Core; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs deleted file mode 100644 index 68e578d4b..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.HttpClient; - -public static class CallerOptionsExtensions -{ - public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Func? clientBuilder = null) - { - var builder = clientBuilder == null ? new MasaHttpClientBuilder() : clientBuilder.Invoke(); - var httpClientBuilder = callerOptions.Services.AddHttpClient(builder.Name, httpClient - => builder.ConfigureHttpClient(httpClient)); - - AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, serviceProvider - => new HttpClientCallerProvider(serviceProvider, builder.Name, builder.Prefix)); - return httpClientBuilder; - } - - public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Action? clientBuilder) - { - MasaHttpClientBuilder builder = new MasaHttpClientBuilder(); - clientBuilder?.Invoke(builder); - - return callerOptions.UseHttpClient(() => builder); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs deleted file mode 100644 index 6666f9b9b..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.HttpClient; - -public abstract class HttpClientCallerBase : CallerBase -{ - protected abstract string BaseAddress { get; set; } - - protected virtual string Prefix { get; set; } = string.Empty; - - protected HttpClientCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public override void UseCallerExtension() => UseHttpClient(); - - protected virtual IHttpClientBuilder UseHttpClient() - { - return CallerOptions.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Name = Name; - httpClientBuilder.Prefix = Prefix; - httpClientBuilder.BaseAddress = BaseAddress; - httpClientBuilder.Configure = ConfigureHttpClient; - }); - } - - protected virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) - { - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs deleted file mode 100644 index bd353c3b4..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.HttpClient; - -public class HttpClientCallerProvider : AbstractCallerProvider -{ - private readonly System.Net.Http.HttpClient _httpClient; - private readonly string _prefix; - private readonly bool _prefixIsNullOrEmpty; - - public HttpClientCallerProvider(IServiceProvider serviceProvider, string name, string prefix) - : base(serviceProvider) - { - _httpClient = serviceProvider.GetRequiredService().CreateClient(name); - _prefix = prefix; - _prefixIsNullOrEmpty = string.IsNullOrEmpty(_prefix); - } - - public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) - where TResponse : default - { - var response = await _httpClient.SendAsync(request, cancellationToken); - return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); - } - - public override Task CreateRequestAsync(HttpMethod method, string? methodName) - => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName))); - - public override Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) - => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName)), data); - - public override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) - { - return _httpClient.SendAsync(request, cancellationToken); - } - - public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - public override Task SendGrpcAsync(string methodName, TRequest request, - CancellationToken cancellationToken = default) - { - throw new NotImplementedException(); - } - - protected virtual string GetRequestUri(string? methodName) - { - if (string.IsNullOrEmpty(methodName)) - return string.Empty; - - if (Uri.IsWellFormedUriString(methodName, UriKind.Absolute) || _prefixIsNullOrEmpty) - return methodName; - - if (_prefix.EndsWith("/")) - return $"{_prefix}{(methodName.StartsWith("/") ? methodName.Substring(1) : methodName)}"; - - return $"{_prefix}{(methodName.StartsWith("/") ? methodName : "/" + methodName)}"; - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj deleted file mode 100644 index 40c6c2d3e..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs deleted file mode 100644 index 8b7345dd0..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.HttpClient; - -public class MasaHttpClientBuilder -{ - private string _name = default!; - - public string Name - { - get => _name; - set - { - if (value is null) - throw new ArgumentNullException(Name); - - _name = value; - } - } - - [Obsolete($"recommended to use {nameof(BaseAddress)}, {nameof(BaseApi)} has expired")] - public string BaseApi { get => BaseAddress; set => BaseAddress = value; } - - public string BaseAddress { get; set; } - - public string Prefix { get; set; } - - public bool IsDefault { get; set; } = false; - - public Action? Configure { get; set; } - - public MasaHttpClientBuilder() : this("http", null) - { - } - - public MasaHttpClientBuilder(string name, Action? configure) - : this(name, string.Empty, configure) - { - } - - public MasaHttpClientBuilder(string name, string baseAddress, Action? configure) - : this(name, baseAddress, string.Empty, configure) - { - } - - public MasaHttpClientBuilder(string name, string baseAddress, string prefix, Action? configure) - { - Name = name; - BaseAddress = baseAddress; - Prefix = prefix; - Configure = configure; - } - - public virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) - { - if (!string.IsNullOrEmpty(BaseAddress)) - httpClient.BaseAddress = new Uri(BaseAddress); - - Configure?.Invoke(httpClient); - } -} diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.md b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.md deleted file mode 100644 index 7ad9fe3f6..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.md +++ /dev/null @@ -1,110 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Utils.Caller.HttpClient - -## Example: - -````c# -Install-Package Masa.Utils.Caller.HttpClient -```` - -### Basic usage: - -1. Modify `Program.cs` - - ```` C# - builder.Services.AddCaller(options => - { - options.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one HttpClient, you can not assign a value to Name - httpClientBuilder.BaseAddress = "http://localhost:5000" ; - }); - }); - ```` - -2. How to use: - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) - => userCallerProvider.GetAsync($"/Hello", new { Name = name })); - ```` - - > The interface address of the complete request is: http://localhost:5000/Hello?Name={name} - -3. When there are multiple HttpClients, modify `Program.cs` - - ```` C# - builder.Services.AddCaller(options => - { - options.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Name = "UserCaller"; - httpClientBuilder.BaseAddress = "http://localhost:5000" ; - }); - options.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Name = "OrderCaller"; - httpClientBuilder.BaseAddress = "http://localhost:6000" ; - }); - }); - ```` - -4. How to use UserCaller or OrderCaller - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) - => userCallerProvider.GetAsync($"/Hello", new { Name = name })); - - - app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => - { - var callerProvider = callerFactory.CreateClient("OrderCaller"); - return callerProvider.GetAsync($"/Hello", new { Name = name }); - }); - ```` - -> When multiple Callers are added, how to get the specified Caller? ->> Get the CallerProvider of the specified alias through the `CreateClient` method of `CallerFactory` -> -> Why doesn't `userCallerProvider` get the corresponding Caller through the `CreateClient` method of `CallerFactory`? ->> If no default ICallerProvider is specified, the default CallerProvider is the first one added in the `AddCaller` method - -### Recommended usage - -1. Modify `Program.cs` - - ```` C# - builder.Services.AddCaller(); - ```` - -2. Add a new class `UserCaller` - - ```` C# - public class UserCaller: HttpClientCallerBase - { - protected override string BaseAddress { get; set; } = "http://localhost:5000"; - - public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); - - /// - /// There is no need to overload by default, and it can be overloaded when there are special requirements for httpClient - /// - /// - protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) - { - httpClient.Timeout = TimeSpan.FromSeconds(5); - } - } - ```` - -3. How to use UserCaller - - ```` C# - app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) - => caller.HelloAsync(name)); - ```` \ No newline at end of file diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.zh-CN.md b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.zh-CN.md deleted file mode 100644 index 5b3fac3ab..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/README.zh-CN.md +++ /dev/null @@ -1,110 +0,0 @@ -中 | [EN](README.md) - -## Masa.Utils.Caller.HttpClient - -## 用例: - -```c# -Install-Package Masa.Utils.Caller.HttpClient -``` - -### 基本用法: - -1. 修改`Program.cs` - - ``` C# - builder.Services.AddCaller(options => - { - options.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个HttpClient时,可以不对Name赋值 - httpClientBuilder.BaseAddress = "http://localhost:5000" ; - }); - }); - ``` - -2. 如何使用: - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) - => userCallerProvider.GetAsync($"/Hello", new { Name = name })); - ``` - - > 完整请求的接口地址是:http://localhost:5000/Hello?Name={name} - -3. 当存在多个HttpClient时,则修改`Program.cs`为 - - ``` C# - builder.Services.AddCaller(options => - { - options.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Name = "UserCaller"; - httpClientBuilder.BaseAddress = "http://localhost:5000" ; - }); - options.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Name = "OrderCaller"; - httpClientBuilder.BaseAddress = "http://localhost:6000" ; - }); - }); - ``` - -4. 如何使用UserCaller或OrderCaller - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) - => userCallerProvider.GetAsync($"/Hello", new { Name = name })); - - - app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => - { - var callerProvider = callerFactory.CreateClient("OrderCaller"); - return callerProvider.GetAsync($"/Hello", new { Name = name }); - }); - ``` - -> 当多个Caller被添加时,如何获取指定的Caller? ->> 通过`CallerFactory`的`CreateClient`方法得到指定别名的CallerProvider -> -> 为什么`userCallerProvider`没有通过`CallerFactory`的`CreateClient`方法得到对应的Caller? ->> 如果未指定默认的ICallerProvider,则在`AddCaller`方法中第一个被添加的就是默认的CallerProvider - -### 推荐用法 - -1. 修改`Program.cs` - - ``` C# - builder.Services.AddCaller(); - ``` - -2. 新增加类`UserCaller` - - ``` C# - public class UserCaller: HttpClientCallerBase - { - protected override string BaseAddress { get; set; } = "http://localhost:5000"; - - public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); - - /// - /// 默认不需要重载,对httpClient有特殊需求时可重载 - /// - /// - protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) - { - httpClient.Timeout = TimeSpan.FromSeconds(5); - } - } - ``` - -3. 如何使用UserCaller - - ``` C# - app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) - => caller.HelloAsync(name)); - ``` \ No newline at end of file diff --git a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/_Imports.cs b/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/_Imports.cs deleted file mode 100644 index 454fdb09c..000000000 --- a/src/Utils/Caller/src/Masa.Utils.Caller.HttpClient/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Caller.Core; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs deleted file mode 100644 index 33f0fece9..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Application; - -public class CustomHttpClientCallerProvider : HttpClientCallerProvider -{ - public CustomHttpClientCallerProvider(IServiceProvider serviceProvider, string name, string baseApi) - : base(serviceProvider, name, baseApi) - { - } - - public string GetResult(string? methodName) => base.GetRequestUri(methodName); -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs deleted file mode 100644 index af0eb4647..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Application.Queries; - -public class UserDetailQury -{ - public Guid? Id { get; set; } - - [JsonPropertyName("name")] - public string? Name { get; set; } - - [JsonIgnore] - public int Age { get; set; } - - public DateTime? DelTime { get; set; } - - public List? Tags { get; set; } - - public UserDetailQury() - { - this.Id = Guid.NewGuid(); - } - - public UserDetailQury(string name, params string[] tags) : this(name, tags.ToList()) - { - } - - public UserDetailQury(string name, List tags) - { - Name = name; - Tags = tags; - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs deleted file mode 100644 index c495925aa..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Application.Queries; - -public class UserListQury -{ - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonIgnore] - public int Age { get; set; } - - public UserListQury(string name) - { - Name = name; - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs deleted file mode 100644 index e23908161..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Application.Requesties; - -[XmlRoot] -public class RegisterUser -{ - [XmlElement] - public string Account { get; set; } = default!; - - [XmlElement] - public string Password { get; set; } = default!; - - public RegisterUser() { } - - public RegisterUser(string account, string password) : this() - { - Account = account; - Password = password; - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs deleted file mode 100644 index a0e7c009a..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Application.Response; - -[Serializable] -[XmlRoot] -public class BaseResponse -{ - [XmlElement] - public string Code { get; set; } = default!; - - public BaseResponse() { } - - public BaseResponse(string code) { Code = code; } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs deleted file mode 100644 index 034c60d20..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests; - -[TestClass] -public class AutomaticCallerTest -{ - private WebApplicationBuilder _builder = default!; - - [TestInitialize] - public void EdgeDriverInitialize() - { - _builder = WebApplication.CreateBuilder(); - } - - [TestMethod] - public async Task TestGetAsync() - { - _builder.Services.AddCaller(); - _ = _builder.Build(); - var serviceProvider = _builder.Services.BuildServiceProvider(); - var githubCaller = serviceProvider.GetRequiredService(); - Assert.IsTrue(await githubCaller.GetAsync()); - } - - [TestMethod] - public void TestDaprCallerReturnCallerProviderIsNotNull() - { - _builder.Services.AddCaller(); - _ = _builder.Build(); - var serviceProvider = _builder.Services.BuildServiceProvider(); - var caller = serviceProvider.GetRequiredService(); - Assert.IsTrue(caller.CallerProviderIsNotNull()); - } - - [TestMethod] - public void TestCustomDaprBaseReturnAppIdIsEqualUserService() - { - _builder.Services.AddCaller(); - _ = _builder.Build(); - var serviceProvider = _builder.Services.BuildServiceProvider(); - var roleCaller = serviceProvider.GetRequiredService(); - var userCaller = serviceProvider.GetRequiredService(); - Assert.IsTrue(roleCaller.GetAppId() == "User-Service" && userCaller.GetAppId() == "User-Service"); - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/CallerTest.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/CallerTest.cs deleted file mode 100644 index 209a7e84d..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/CallerTest.cs +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests; - -[TestClass] -public class CallerTest -{ - private WebApplicationBuilder _builder = default!; - - [TestInitialize] - public void EdgeDriverInitialize() - { - _builder = WebApplication.CreateBuilder(); - } - - [TestMethod] - public async Task TestGetAsync() - { - _builder.Services.AddCaller(callerOptions => - { - callerOptions.UseHttpClient(httpClientBuilder => - { - httpClientBuilder.Configure = builder => builder.Timeout = TimeSpan.FromSeconds(3); - httpClientBuilder.BaseAddress = "https://github.com/masastack"; - }); - }); - _ = _builder.Build(); - var serviceProvider = _builder.Services.BuildServiceProvider(); - var githubCaller = serviceProvider.GetRequiredService(); - Assert.IsTrue(await GetAsync(githubCaller)); - } - - [TestMethod] - public void TestCallerProviderServiceLifetime() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "http"; - clientBuilder.IsDefault = true; - clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - var callerProvider1 = serviceProvider.GetRequiredService(); - var callerProvider2 = serviceProvider.GetRequiredService(); - Assert.IsTrue(callerProvider1 == callerProvider2); - } - - [TestMethod] - public void TestCaller() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(clientBuilder => - { - clientBuilder.Name = "http"; - clientBuilder.IsDefault = true; - clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; - }); - opt.UseDapr(clientBuilder => - { - clientBuilder.Name = "dapr"; - clientBuilder.IsDefault = false; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - var callerProvider = serviceProvider.GetRequiredService(); - Assert.IsNotNull(callerProvider); - - var caller = serviceProvider.GetRequiredService().CreateClient(); - var daprCaller = serviceProvider.GetRequiredService().CreateClient("dapr"); - var httpCaller = serviceProvider.GetRequiredService().CreateClient("http"); - - Assert.IsTrue(caller.GetType().FullName != daprCaller.GetType().FullName); - Assert.IsTrue(caller.GetType().FullName == httpCaller.GetType().FullName); - } - - [TestMethod] - public void TestMultiDefaultCaller() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - opt.UseHttpClient(builder => - { - builder.Name = "gitee"; - builder.BaseAddress = "https://gitee.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestMultiDefaultCaller2() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "gitee"; - builder.BaseAddress = "https://gitee.com/masastack"; - builder.IsDefault = true; - }); - }); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestRepeatCallerName() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestRepeatCallerName2() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "github"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestRepeatCallerName3() - { - IServiceCollection services = new ServiceCollection(); - Assert.ThrowsException(() => - { - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = typeof(GithubCaller).FullName!; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - }); - } - - [TestMethod] - public void TestAddMultiCaller() - { - IServiceCollection services = new ServiceCollection(); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "masastack"; - builder.BaseAddress = "https://github.com/masastack"; - builder.IsDefault = true; - }); - }); - services.AddCaller(opt => - { - opt.UseHttpClient(builder => - { - builder.Name = "masastack2"; - builder.BaseAddress = "https://github.com/masastack"; - }); - }); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack")); - Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack2")); - } - - private async Task GetAsync(ICallerProvider callerProvider) - { - var res = await callerProvider.GetAsync(""); - return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs deleted file mode 100644 index b775e3adf..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests; - -[TestClass] -public class HttpClientCallerTest -{ - [DataTestMethod] - [DataRow("https://github.com/", "/check/healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com", "/check/healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com", "check/healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com/check", "healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com/check/", "healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com/check/", "/healthy", "https://github.com/check/healthy")] - [DataRow("https://github.com/check/", "/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("https://github.com/check/", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("https://github.com/check", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("https://github.com", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("https://github.com", "", "")] - [DataRow("http://github.com", "", "")] - [DataRow("/v1/check", "healthy", "/v1/check/healthy")] - [DataRow("/v1/check/", "healthy", "/v1/check/healthy")] - [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] - [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] - [DataRow("/v1/check/", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] - [DataRow("", "healthy", "healthy")] - [DataRow("", "/healthy?id=1", "/healthy?id=1")] - public void TestGetRequestUri(string prefix, string methods, string result) - { - var services = new ServiceCollection(); - services.AddCaller(opt => opt.UseHttpClient()); - var serviceProvider = services.BuildServiceProvider(); - var provider = new CustomHttpClientCallerProvider(serviceProvider, string.Empty, prefix); - Assert.IsTrue(provider.GetResult(methods) == result); - } - - [TestMethod] - public async Task TestRequestDataIsXmlAsync() - { - var services = new ServiceCollection(); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - Mock httpClientFactory = new(); - var handlerMock = new Mock(); - var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) - { - BaseAddress = new Uri("http://localhost:5000") - }; - var response = new BaseResponse("success"); - handlerMock - .Protected() - .Setup>( - "SendAsync", - ItExpr.IsAny(), - ItExpr.IsAny() - ) - .ReturnsAsync(new HttpResponseMessage - { - StatusCode = HttpStatusCode.OK, - Content = new StringContent(XmlUtils.Serializer(response)) - }) - .Verifiable(); - - httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); - services.AddSingleton(httpClientFactory.Object); - var serviceProvider = services.BuildServiceProvider(); - string name = ""; - string prefix = ""; - var httpClientCallerProvider = new HttpClientCallerProvider(serviceProvider, name, prefix); - - var res = await httpClientCallerProvider.PostAsync("Hello", new RegisterUser("Jim", "123456")); - Assert.IsNotNull(res); - Assert.IsTrue(res.Code == response.Code); - } - - [TestMethod] - public async Task TestRequestMessageReturnOnceAsync() - { - var services = new ServiceCollection(); - RegisterUser registerUser = new RegisterUser("Jim", "123456"); - - services.AddSingleton(); - Mock requestMessage = new(); - requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny())) - .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello")).Verifiable(); - requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny())) - .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello") - { - Content = JsonContent.Create(registerUser) - }).Verifiable(); - services.AddSingleton(_ => requestMessage.Object); - services.AddSingleton(); - Mock httpClientFactory = new(); - var handlerMock = new Mock(); - var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) - { - BaseAddress = new Uri("http://localhost:5000") - }; - var response = new BaseResponse("success"); - handlerMock - .Protected() - .Setup>( - "SendAsync", - ItExpr.IsAny(), - ItExpr.IsAny() - ) - .ReturnsAsync(new HttpResponseMessage - { - StatusCode = HttpStatusCode.OK, - Content = new StringContent(XmlUtils.Serializer(response)) - }) - .Verifiable(); - - httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); - services.AddSingleton(httpClientFactory.Object); - var serviceProvider = services.BuildServiceProvider(); - string name = ""; - string prefix = ""; - var httpClientCallerProvider = new HttpClientCallerProvider(serviceProvider, name, prefix); - - var res = await httpClientCallerProvider.PostAsync("Hello", registerUser); - Assert.IsNotNull(res); - Assert.IsTrue(res.Code == response.Code); - requestMessage.Verify(r => r.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny()), Times.Once); - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs deleted file mode 100644 index ca9efb69c..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; - -public class DaprCaller : DaprCallerBase -{ - protected override string AppId { get; set; } = "DaprCaller"; - - public DaprCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public bool CallerProviderIsNotNull() => CallerProvider != null; -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs deleted file mode 100644 index b663f2d11..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; - -public class GithubCaller : HttpClientCallerBase -{ - protected override string BaseAddress { get; set; } = "https://github.com/masastack"; - - public GithubCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public async Task GetAsync() - { - var res = await CallerProvider.GetAsync(""); - return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs deleted file mode 100644 index e961ef0cf..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; - -public class RoleCaller: UserDaprCallerBase -{ - public RoleCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs deleted file mode 100644 index 6186c323c..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; - -public class UserCaller : UserDaprCallerBase -{ - public UserCaller(IServiceProvider serviceProvider) : base(serviceProvider) - { - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs deleted file mode 100644 index 6f46b6f3a..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; - -public abstract class UserDaprCallerBase : DaprCallerBase -{ - protected override string AppId { get; set; }= "User-Service"; - - protected UserDaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) - { - } - - public string GetAppId() => AppId; -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs deleted file mode 100644 index b52af2eae..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Utils.Caller.Tests.Infrastructure.Utils; - -namespace Masa.Utils.Caller.Tests.Infrastructure; - -public class DefaultXmlResponseMessage : IResponseMessage -{ - private readonly ILogger? _logger; - - public DefaultXmlResponseMessage(ILogger? logger = null) - { - _logger = logger; - } - - public async Task ProcessResponseAsync(HttpResponseMessage response, - CancellationToken cancellationToken = default) - { - if (response.IsSuccessStatusCode) - { - switch (response.StatusCode) - { - case HttpStatusCode.Accepted: - case HttpStatusCode.NoContent: - return default; - case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: - throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); - default: - if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - if (string.IsNullOrEmpty(content)) - return (TResponse)(object?)null!; - - return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); - } - if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - if (string.IsNullOrEmpty(content)) - return (TResponse)(object?)null!; - - return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); - } - if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) - { - var content = await response.Content.ReadAsStringAsync(cancellationToken); - return (TResponse)Convert.ChangeType(content, typeof(TResponse)); - } - try - { - var res = await response.Content.ReadAsStringAsync(cancellationToken); - return XmlUtils.Deserialize(res) ?? - throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); - } - catch (Exception exception) - { - _logger?.LogWarning(exception, exception.Message); - ExceptionDispatchInfo.Capture(exception).Throw(); - return default; //This will never be executed, the previous line has already thrown an exception - } - } - } - - await ProcessResponseExceptionAsync(response, cancellationToken); - return default; //never executed - } - - public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) - { - if (response.IsSuccessStatusCode) - { - switch (response.StatusCode) - { - case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: - throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); - default: - return; - } - } - - await ProcessResponseExceptionAsync(response, cancellationToken); - } - - public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) - { - if (response.Content.Headers.ContentLength is > 0) - throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); - - throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs deleted file mode 100644 index e277a9828..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests.Infrastructure.Utils; - -public class XmlUtils -{ - public static string Serializer(object data) - { - MemoryStream ms = new MemoryStream(); - StreamWriter sw = new StreamWriter(ms, Encoding.UTF8); - XmlSerializer xz = new XmlSerializer(data.GetType()); - xz.Serialize(sw, data); - return Encoding.UTF8.GetString(ms.ToArray()); - } - - public static T Deserialize(string xml) - { - XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); - using MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml.ToCharArray())); - return (T)xmlSerializer.Deserialize(stream)!; - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs deleted file mode 100644 index 04d178945..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Utils.Caller.Tests.Infrastructure.Utils; - -namespace Masa.Utils.Caller.Tests.Infrastructure; - -public class XmlRequestMessage : IRequestMessage -{ - public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) - => Task.FromResult(requestMessage); - - public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) - { - var xmlContent = XmlUtils.Serializer(data!); - requestMessage.Content = new StringContent(xmlContent); - return Task.FromResult(requestMessage); - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj deleted file mode 100644 index 127f43e13..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - - - - diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs deleted file mode 100644 index cf898eef8..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/TypeConvertTest.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Caller.Tests; - -[TestClass] -public class TypeConvertTest -{ - [TestMethod] - public void TestConvertToKeyValuePairs() - { - var defaultTypeConvertProvider = new DefaultTypeConvertProvider(); - var result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new - { - id = 1, - name = "masa" - }).ToList(); - Assert.AreEqual(2, result.Count()); - Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "1")); - Assert.IsTrue(result.Any(x => x.Key == "name" && x.Value == "masa")); - - result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new - { - id = 2, - text = "masa" - }).ToList(); - Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "2")); - Assert.IsTrue(result.Any(x => x.Key == "text" && x.Value == "masa")); - } - - [TestMethod] - public void TestConvertToDictionaryByDynamic() - { - var provider = new DefaultTypeConvertProvider(); - var dictionary = new Dictionary - { - { "account", "jim" }, - { "age", "18" } - }; - var request = new - { - account = "jim", - age = 18 - }; - var result = provider.ConvertToDictionary(request); - Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); - } - - [TestMethod] - public void TestConvertToDictionaryByObject() - { - var provider = new DefaultTypeConvertProvider(); - var query = new UserListQury("Jim"); - var dictionary = new Dictionary - { - { "name", query.Name } - }; - var result = provider.ConvertToDictionary(query); - Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); - } - - [TestMethod] - public void TestConvertToDictionaryByObject2() - { - var provider = new DefaultTypeConvertProvider(); - var query = new UserDetailQury("Jim", "Music", "Game"); - var result = provider.ConvertToDictionary(query); - Assert.IsTrue(result.Count == 2); - Assert.IsTrue(result["name"] == query.Name); - Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() - { - "Music", - "Game" - })); - } - - [TestMethod] - public void TestConvertToDictionaryByObject3() - { - var provider = new DefaultTypeConvertProvider(); - - List tags = null!; - var query = new UserDetailQury("Jim", tags); - var result = provider.ConvertToDictionary(query); - - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["name"] == query.Name); - } - - [TestMethod] - public void TestConvertToDictionaryByObject4() - { - var provider = new DefaultTypeConvertProvider(); - var query = new UserDetailQury(null!, "Music", "Game"); - var result = provider.ConvertToDictionary(query); - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() - { - "Music", - "Game" - })); - } - - [TestMethod] - public void TestConvertToDictionaryByObject5() - { - var provider = new DefaultTypeConvertProvider(); - var dic = new Dictionary() - { - { "Account", "Jim" } - }; - var result = provider.ConvertToDictionary(dic); - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["Account"] == "Jim"); - } - - [TestMethod] - public void TestConvertToDictionaryByObject6() - { - var provider = new DefaultTypeConvertProvider(); - var dic = new List>() - { - new("Account", "Jim") - }; - var result = provider.ConvertToDictionary(dic); - Assert.IsTrue(result.Count == 1); - Assert.IsTrue(result["Account"] == "Jim"); - } -} diff --git a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/_Imports.cs b/src/Utils/Caller/test/Masa.Utils.Caller.Tests/_Imports.cs deleted file mode 100644 index 610dc2069..000000000 --- a/src/Utils/Caller/test/Masa.Utils.Caller.Tests/_Imports.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Caller.Core; -global using Masa.Utils.Caller.HttpClient; -global using Masa.Utils.Exceptions; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using Moq.Protected; -global using System.Net; -global using System.Runtime.ExceptionServices; -global using System.Text; -global using System.Text.Json.Serialization; -global using System.Xml.Serialization; -global using System.Net.Http.Json; -global using Masa.Utils.Caller.Tests.Application; -global using Masa.Utils.Caller.Tests.Application.Requesties; -global using Masa.Utils.Caller.Tests.Application.Response; -global using Masa.Utils.Caller.Tests.Infrastructure; -global using Masa.Utils.Caller.Tests.Infrastructure.Utils; -global using Masa.Utils.Caller.Tests.Application.Queries; -global using Masa.Utils.Caller.DaprClient; -global using Masa.Utils.Caller.Tests.Infrastructure.Callers; diff --git a/src/Utils/Configuration/src/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj b/src/Utils/Configuration/src/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/Utils/Configuration/src/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/AppSettings.cs b/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/AppSettings.cs deleted file mode 100644 index 03e89ed37..000000000 --- a/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/AppSettings.cs +++ /dev/null @@ -1,102 +0,0 @@ -using Microsoft.Extensions.Configuration; - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Configuration.Json -{ - public class AppSettings - { - private static JsonConfiguration? _config; - - public static bool Initialized => _config != null; - - public static IConfiguration Configuration - { - get - { - InitializeIfNot(); - - return _config!.Configuration; - } - } - - private static void InitializeIfNot() - { - if (!Initialized) - { - var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); - Initialize(environment); - } - } - - /// - /// Initialize configuration with appsettings.json - /// - public static void Initialize() - { - Initialize(string.Empty); - } - - /// - /// Initialize configuration with appsettings.json & appsettings.{environmentName}.json - /// - /// - public static void Initialize(string? environmentName) - { - if (Initialized) - { - return; - } - - var optionsList = new List - { - new JsonFileOptions - { - FileName = "appsettings.json", - Optional = false, - ReloadOnChange = true - } - }; - - if (!string.IsNullOrEmpty(environmentName)) - { - optionsList.Add(new JsonFileOptions - { - FileName = $"appsettings.{environmentName}.json", - Optional = true, - ReloadOnChange = true - }); - } - - _config = new JsonConfiguration(optionsList); - } - - /// - /// Get configuration section - /// - /// - /// - /// - public static string Get(string key, Action? onChange = null) - { - InitializeIfNot(); - - return _config!.Get(key, onChange); - } - - /// - /// Bind a model with configuration section - /// - /// - /// - /// - /// - public static TModel GetModel(string key, Action? onChange = null) - { - InitializeIfNot(); - - return _config!.GetModel(key, onChange); - } - } -} diff --git a/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonConfiguration.cs b/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonConfiguration.cs deleted file mode 100644 index 125893fe1..000000000 --- a/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonConfiguration.cs +++ /dev/null @@ -1,118 +0,0 @@ -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Primitives; - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Configuration.Json -{ - public class JsonConfiguration - { - public IConfiguration Configuration { get; } - - public JsonConfiguration(string fileName) - : this(Directory.GetCurrentDirectory(), fileName) - { - } - - public JsonConfiguration(string basePath, string fileName) - { - Configuration = new ConfigurationBuilder() - .SetBasePath(basePath) - .AddJsonFile(fileName, optional: false, reloadOnChange: true) - .Build(); - } - - public JsonConfiguration(JsonFileOptions options) - : this(Directory.GetCurrentDirectory(), options) - { - } - - public JsonConfiguration(string basePath, JsonFileOptions options) - { - Configuration = new ConfigurationBuilder() - .SetBasePath(basePath) - .AddJsonFile(options.FileName, options.Optional, options.ReloadOnChange) - .Build(); - } - - public JsonConfiguration(List optionsList) - : this(Directory.GetCurrentDirectory(), optionsList) - { - } - - public JsonConfiguration(string basePath, List optionsList) - { - var builder = new ConfigurationBuilder() - .SetBasePath(basePath); - - foreach (var options in optionsList) - { - builder.AddJsonFile(options.FileName, options.Optional, options.ReloadOnChange); - } - - Configuration = builder.Build(); - } - - /// - /// Get configuration section - /// - public string Get(string key, Action? onChange = null) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException(nameof(key)); - } - - var model = Get(key); - - if (onChange != null) - { - ChangeToken.OnChange(() => Configuration.GetReloadToken(), () => - { - onChange(Get(key)); - }); - } - - return model; - } - - /// - /// Bind a model with configuration section - /// - public TModel GetModel(string key, Action? onChange = null) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException(nameof(key)); - } - - var model = Get(key); - - if (onChange != null) - { - ChangeToken.OnChange(() => Configuration.GetReloadToken(), () => - { - onChange(Get(key)); - }); - } - - return model; - } - - private string Get(string key) - { - var options = Configuration.GetSection(key).Value; - return options; - } - - /// - /// Bind a model with configuration section - /// - private TModel Get(string key) - { - var options = Configuration.GetSection(key).Get(); - return options; - } - } -} diff --git a/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonFileOptions.cs b/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonFileOptions.cs deleted file mode 100644 index 72e54a3c1..000000000 --- a/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/JsonFileOptions.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Configuration.Json -{ - public class JsonFileOptions - { - /// - /// Path relative to the base path stored in Microsoft.Extensions.Configuration.IConfigurationBuilder.Properties of builder. - /// - public string FileName { get; set; } = null!; - - /// - /// Whether the file is optional. - /// - public bool Optional { get; set; } - - /// - /// Whether the configuration should be reloaded if the file changes. - /// - public bool ReloadOnChange { get; set; } - } -} diff --git a/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj b/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj deleted file mode 100644 index 0662243e5..000000000 --- a/src/Utils/Configuration/src/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs b/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs deleted file mode 100644 index 870a18104..000000000 --- a/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System.ComponentModel.DataAnnotations; - -public class MinCountAttribute : ValidationAttribute -{ - private const string DEFAULT_ERROR_MESSAGE = "The field {0} must be a list type with a minimum count of '{1}'."; - - public MinCountAttribute(int count) : base(DEFAULT_ERROR_MESSAGE) - { - Count = count; - } - - public int Count { get; } - - public override bool IsValid(object? value) - { - // Check the lengths for legality - EnsureLegalLengths(); - - int count; - - if (value == null) - { - return true; - } - - if (value is IList list) - { - count = list.Count; - } - else - { - throw new InvalidCastException($"The field of type {value.GetType()} must be a list type."); - } - - return count >= Count; - } - - public override string FormatErrorMessage(string name) - { - return string.Format(ErrorMessageString, name, Count); - } - - /// - /// Checks that Length has a legal value. - /// - /// Length is less than zero. - private void EnsureLegalLengths() - { - if (Count < 0) - { - throw new InvalidOperationException($"{nameof(MinCountAttribute)} must have a Count value that is zero or greater."); - } - } -} diff --git a/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs b/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs deleted file mode 100644 index 9043bce26..000000000 --- a/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System.ComponentModel.DataAnnotations -{ - public class NonDefaultAttribute : ValidationAttribute - { - private const string DEFAULT_ERROR_MESSAGE = "The field {0} must be a non-default value."; - - private static ConcurrentDictionary defaultInstancesCache = new(); - - public NonDefaultAttribute() : base(DEFAULT_ERROR_MESSAGE) - { - } - - public override bool IsValid(object? value) - { - if (value is null) - return true; - - var type = value.GetType(); - - if (!defaultInstancesCache.TryGetValue(type.FullName!, out var defaultInstance)) - { - defaultInstance = Activator.CreateInstance(Nullable.GetUnderlyingType(type) ?? type); - defaultInstancesCache[type.FullName!] = defaultInstance!; - } - - return !Equals(value, defaultInstance); - } - } -} diff --git a/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj b/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/_Imports.cs b/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/_Imports.cs deleted file mode 100644 index 24bbb34f0..000000000 --- a/src/Utils/Data/DataAnnotations/src/Masa.Utils.Data.DataAnnotations/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using System.Collections; -global using System.Collections.Concurrent; diff --git a/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj b/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj deleted file mode 100644 index 59fc3e53d..000000000 --- a/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs b/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs deleted file mode 100644 index 95c116d78..000000000 --- a/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.ComponentModel.DataAnnotations; - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.DataAnnotations.Tests -{ - [TestClass] - public class MinCountAttributeTests - { - [TestMethod] - public void EmptyListWithMinCount1Test() - { - var user = new User - { - Name = "name", - Favorites = new List() - }; - - var results = ValidateModel(user); - - Assert.IsTrue(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); - } - - [TestMethod] - public void NullValueWithMinCount1Test() - { - var user = new User - { - Name = "name", - }; - - var results = ValidateModel(user); - - Assert.IsFalse(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); - } - - [TestMethod] - public void Count1WithMinCount1Test() - { - var user = new User - { - Name = "name", - Favorites = new List() { "A" } - }; - - var results = ValidateModel(user); - - Assert.IsFalse(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); - } - - [TestMethod] - public void Count2WithMinCount1Test() - { - var user = new User - { - Name = "name", - Favorites = new List() { "A", "B" } - }; - - var results = ValidateModel(user); - - Assert.IsFalse(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); - } - - private IList ValidateModel(object model) - { - var validateResults = new List(); - var ctx = new ValidationContext(model); - Validator.TryValidateObject(model, ctx, validateResults, true); - return validateResults; - } - - public class User - { - [Required] - public string Name { get; set; } = default!; - - [MinCount(1)] - public List Favorites { get; set; } = default!; - } - } -} diff --git a/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs b/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs deleted file mode 100644 index a229708dd..000000000 --- a/src/Utils/Data/DataAnnotations/test/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.DataAnnotations.Tests -{ - [TestClass] - public class NonDefualtAttributeTests - { - [TestMethod] - public void DefaultTest() - { - var user = new User - { - Name = "name", - NullableId = Guid.Empty - }; - - var results = ValidateModel(user); - - var isIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Id))); - var isNullableIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.NullableId))); - var isAgeInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Age))); - var isFavroiteInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Favroite))); - - Assert.IsTrue(isIdInvalid && isNullableIdInvalid && isAgeInvalid && isFavroiteInvalid); - } - - [TestMethod] - public void NonDefaultTest() - { - var user = new User - { - Id = Guid.NewGuid(), - NullableId = Guid.NewGuid(), - Age = 20, - Favroite = Favorites.Basketball, - Name = "name" - }; - - var results = ValidateModel(user); - - var isIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Id))); - var isNullableIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.NullableId))); - var isAgeInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Age))); - var isFavroiteInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Favroite))); - - Assert.IsTrue(!isIdInvalid && !isNullableIdInvalid && !isAgeInvalid && !isFavroiteInvalid); - } - - private IList ValidateModel(object model) - { - var validateResults = new List(); - var ctx = new ValidationContext(model); - Validator.TryValidateObject(model, ctx, validateResults, true); - return validateResults; - } - - public class User - { - [NonDefault] - public Guid Id { get; set; } - - [NonDefault] - public Guid? NullableId { get; set; } - - [Required] - public string Name { get; set; } = default!; - - [NonDefault] - public int Age { get; set; } - - [NonDefault] - public Favorites Favroite { get; set; } - } - - public enum Favorites { None, Basketball, Football } - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs deleted file mode 100644 index 26705a01b..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Analysis.TokenFilters; - -public interface IPinYinTokenFilter : ITokenFilter -{ - /// - /// when this option enabled, eg: 刘德华>ldh - /// - [DataMember(Name = "keep_first_letter")] - bool KeepFirstLetter { get; set; } - - /// - /// when this option enabled, will keep first letters separately - /// eg: 刘德华>l,d,h, default: false - /// NOTE: query result maybe too fuzziness due to term too frequency - /// - [DataMember(Name = "keep_separate_first_letter")] - bool KeepSeparateFirstLetter { get; set; } - - /// - /// set max length of the first_letter result - /// - [DataMember(Name = "limit_first_letter_length")] - int LimitFirstLetterLength { get; set; } - - /// - /// when this option enabled, eg: 刘德华> [liu,de,hua] - /// - [DataMember(Name = "keep_full_pinyin")] - bool KeepFullPinyin { get; set; } - - /// - /// when this option enabled, eg: 刘德华> [liudehua] - /// - [DataMember(Name = "keep_joined_full_pinyin")] - bool KeepJoinedFullPinyin { get; set; } - - /// - /// keep non chinese letter or number in result - /// - [DataMember(Name = "keep_none_chinese")] - bool KeepNoneChinese { get; set; } - - /// - /// keep non chinese letter together - /// eg: DJ音乐家 -> DJ,yin,yue,jia - /// when set to false, eg: DJ音乐家 -> D,J,yin,yue,jia - /// NOTE: keep_none_chinese should be enabled first - /// - [DataMember(Name = "keep_none_chinese_together")] - bool KeepNoneChineseTogether { get; set; } - - /// - /// keep non Chinese letters in first letter, eg: 刘德华AT2016->ldhat2016 - /// - [DataMember(Name = "keep_none_chinese_in_first_letter")] - bool KeepNoneChineseInFirstLetter { get; set; } - - /// - /// keep non Chinese letters in joined full pinyin, eg: 刘德华2016->liudehua2016 - /// - [DataMember(Name = "keep_none_chinese_in_joined_full_pinyin")] - bool KeepNoneChineseInJoinedFullPinyin { get; set; } - - /// - /// break non chinese letters into separate pinyin term if they are pinyin - /// eg: liudehuaalibaba13zhuanghan -> liu,de,hua,a,li,ba,ba,13,zhuang,han - /// NOTE: keep_none_chinese and keep_none_chinese_together should be enabled first - /// - [DataMember(Name = "none_chinese_pinyin_tokenize")] - bool NoneChinesePinyinTokenize { get; set; } - - /// - /// when this option enabled, will keep original input as well - /// - [DataMember(Name = "keep_original")] - bool KeepOriginal { get; set; } - - /// - /// lowercase non Chinese letters - /// - [DataMember(Name = "lowercase")] - bool Lowercase { get; set; } - - [DataMember(Name = "trim_whitespace")] - bool TrimWhitespace { get; set; } - - /// - /// when this option enabled, duplicated term will be removed to save index, eg: de的>de - /// NOTE: position related query maybe influenced - /// - [DataMember(Name = "remove_duplicated_term")] - bool RemoveDuplicatedTerm { get; set; } - - /// - /// after 6.0, offset is strictly constrained, overlapped tokens are not allowed - /// with this parameter, overlapped token will allowed by ignore offset - /// please note, all position related query or highlight will become incorrect - /// you should use multi fields and specify different settings for different query purpose - /// if you need offset, please set it to false - /// - [DataMember(Name = "ignore_pinyin_offset")] - bool IgnorePinyinOffset { get; set; } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs deleted file mode 100644 index 67d87fc23..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Analysis.TokenFilters; - -public class PinYinTokenFilterDescriptor - : TokenFilterDescriptorBase, IPinYinTokenFilter -{ - protected override string Type => "pinyin"; - - /// - /// when this option enabled, eg: 刘德华>ldh - /// - [DataMember(Name = "keep_first_letter")] - public bool KeepFirstLetter { get; set; } - - /// - /// when this option enabled, will keep first letters separately - /// eg: 刘德华>l,d,h, default: false - /// NOTE: query result maybe too fuzziness due to term too frequency - /// - [DataMember(Name = "keep_separate_first_letter")] - public bool KeepSeparateFirstLetter { get; set; } - - /// - /// set max length of the first_letter result - /// - [DataMember(Name = "limit_first_letter_length")] - public int LimitFirstLetterLength { get; set; } - - /// - /// when this option enabled, eg: 刘德华> [liu,de,hua] - /// - [DataMember(Name = "keep_full_pinyin")] - public bool KeepFullPinyin { get; set; } - - /// - /// when this option enabled, eg: 刘德华> [liudehua] - /// - [DataMember(Name = "keep_joined_full_pinyin")] - public bool KeepJoinedFullPinyin { get; set; } - - /// - /// keep non chinese letter or number in result - /// - [DataMember(Name = "keep_none_chinese")] - public bool KeepNoneChinese { get; set; } - - /// - /// keep non chinese letter together - /// eg: DJ音乐家 -> DJ,yin,yue,jia - /// when set to false, eg: DJ音乐家 -> D,J,yin,yue,jia - /// NOTE: keep_none_chinese should be enabled first - /// - [DataMember(Name = "keep_none_chinese_together")] - public bool KeepNoneChineseTogether { get; set; } - - /// - /// keep non Chinese letters in first letter, eg: 刘德华AT2016->ldhat2016 - /// - [DataMember(Name = "keep_none_chinese_in_first_letter")] - public bool KeepNoneChineseInFirstLetter { get; set; } - - /// - /// keep non Chinese letters in joined full pinyin, eg: 刘德华2016->liudehua2016 - /// - [DataMember(Name = "keep_none_chinese_in_joined_full_pinyin")] - public bool KeepNoneChineseInJoinedFullPinyin { get; set; } - - /// - /// break non chinese letters into separate pinyin term if they are pinyin - /// eg: liudehuaalibaba13zhuanghan -> liu,de,hua,a,li,ba,ba,13,zhuang,han - /// NOTE: keep_none_chinese and keep_none_chinese_together should be enabled first - /// - [DataMember(Name = "none_chinese_pinyin_tokenize")] - public bool NoneChinesePinyinTokenize { get; set; } - - /// - /// when this option enabled, will keep original input as well - /// - [DataMember(Name = "keep_original")] - public bool KeepOriginal { get; set; } - - /// - /// lowercase non Chinese letters - /// - [DataMember(Name = "lowercase")] - public bool Lowercase { get; set; } - - [DataMember(Name = "trim_whitespace")] - public bool TrimWhitespace { get; set; } - - /// - /// when this option enabled, duplicated term will be removed to save index, eg: de的>de - /// NOTE: position related query maybe influenced - /// - [DataMember(Name = "remove_duplicated_term")] - public bool RemoveDuplicatedTerm { get; set; } - - /// - /// after 6.0, offset is strictly constrained, overlapped tokens are not allowed - /// with this parameter, overlapped token will allowed by ignore offset - /// please note, all position related query or highlight will become incorrect - /// you should use multi fields and specify different settings for different query purpose - /// if you need offset, please set it to false - /// - [DataMember(Name = "ignore_pinyin_offset")] - public bool IgnorePinyinOffset { get; set; } - - public PinYinTokenFilterDescriptor() - { - KeepFirstLetter = true; - KeepFullPinyin = true; - KeepNoneChinese = true; - KeepNoneChineseInFirstLetter = true; - KeepNoneChineseTogether = true; - KeepJoinedFullPinyin = true; - NoneChinesePinyinTokenize = true; - KeepOriginal = true; - LimitFirstLetterLength = 50; - Lowercase = true; - RemoveDuplicatedTerm = true; - KeepNoneChineseInJoinedFullPinyin = true; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Const.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Const.cs deleted file mode 100644 index ee01403a9..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Const.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch; - -public class Const -{ - public const string DEFAULT_CLIENT_NAME = "es"; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs deleted file mode 100644 index 2423a175c..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch; - -public class DefaultElasticsearchFactory : IElasticsearchFactory -{ - private readonly Dictionary _relations; - private readonly ConcurrentDictionary _elasticClients; - - public DefaultElasticsearchFactory(ElasticsearchRelationsOptions options) - { - _relations = options.Relations; - _elasticClients = new(); - } - - public IMasaElasticClient CreateClient() - { - return new DefaultMasaElasticClient(CreateElasticClient()); - } - - public IMasaElasticClient CreateClient(string name) - { - return new DefaultMasaElasticClient(CreateElasticClient(name)); - } - - public IElasticClient CreateElasticClient() - { - var elasticsearchRelation = _relations.Values.SingleOrDefault(r => r.IsDefault) ?? _relations.Values.FirstOrDefault(); - - if (elasticsearchRelation == null) - throw new Exception("The default ElasticClient is not found, please check if Elasticsearch is added"); - - return GetOrAddElasticClient(elasticsearchRelation.Name); - } - - public IElasticClient CreateElasticClient(string name) - { - if (!_relations.ContainsKey(name)) - throw new NotSupportedException($"The ElasticClient whose name is {name} is not found"); - - return GetOrAddElasticClient(name); - } - - private IElasticClient GetOrAddElasticClient(string name) - => _elasticClients.GetOrAdd(name, name => Create(name)); - - private IElasticClient Create(string name) - { - var relation = _relations[name]; - - var settings = relation.UseConnectionPool - ? GetConnectionSettingsConnectionPool(relation) - : GetConnectionSettingsBySingleNode(relation); - - return new ElasticClient(settings); - } - - private ConnectionSettings GetConnectionSettingsBySingleNode(ElasticsearchRelations relation) - { - var connectionSetting = new ConnectionSettings(relation.Nodes[0]) - .EnableApiVersioningHeader(); - relation.Action?.Invoke(connectionSetting); - return connectionSetting; - } - - private ConnectionSettings GetConnectionSettingsConnectionPool(ElasticsearchRelations relation) - { - var pool = new StaticConnectionPool( - relation.Nodes, - relation.StaticConnectionPoolOptions?.Randomize ?? true, - relation.StaticConnectionPoolOptions?.DateTimeProvider); - - var settings = new ConnectionSettings( - pool, - relation.ConnectionSettingsOptions?.Connection, - relation.ConnectionSettingsOptions?.SourceSerializerFactory, - relation.ConnectionSettingsOptions?.PropertyMappingProvider) - .EnableApiVersioningHeader(); - - relation.Action?.Invoke(settings); - return settings; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs deleted file mode 100644 index 39cb3e471..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch; - -public class DefaultMasaElasticClient : IMasaElasticClient -{ - private readonly IElasticClient _elasticClient; - - public DefaultMasaElasticClient(IElasticClient elasticClient) - => _elasticClient = elasticClient; - - #region index manage - - public async Task IndexExistAsync( - string indexName, - CancellationToken cancellationToken = default) - { - IIndexExistsRequest request = new IndexExistsRequest(indexName); - return new Response.ExistsResponse(await _elasticClient.Indices.ExistsAsync(request, cancellationToken)); - } - - public async Task CreateIndexAsync( - string indexName, - CreateIndexOptions? options = null, - CancellationToken cancellationToken = default) - { - ICreateIndexRequest request = new CreateIndexRequest(indexName); - if (options != null) - { - request.Settings = options.IndexSettings; - request.Aliases = options.Aliases; - request.Mappings = options.Mappings; - } - - return new Response.Index.CreateIndexResponse(await _elasticClient.Indices.CreateAsync(request, cancellationToken)); - } - - public async Task DeleteIndexAsync( - string indexName, - CancellationToken cancellationToken = default) - { - IDeleteIndexRequest request = new DeleteIndexRequest(indexName); - return new Response.Index.DeleteIndexResponse(await _elasticClient.Indices.DeleteAsync(request, cancellationToken)); - } - - public async Task DeleteMultiIndexAsync( - IEnumerable indexNames, - CancellationToken cancellationToken = default) - { - BulkAliasDescriptor request = new BulkAliasDescriptor(); - foreach (var indexName in indexNames) - request.RemoveIndex(opt => opt.Index(indexName)); - - return new Response.Index.DeleteIndexResponse(await _elasticClient.Indices.BulkAliasAsync(request, cancellationToken)); - } - - public async Task DeleteIndexByAliasAsync( - string alias, - CancellationToken cancellationToken = default) - { - var response = await GetIndexByAliasAsync(alias, cancellationToken); - if (response.IsValid) - return await DeleteMultiIndexAsync(response.IndexNames, cancellationToken); - - return new(response.Message); - } - - public async Task GetAllIndexAsync(CancellationToken cancellationToken = default) - { - ICatIndicesRequest request = new CatIndicesRequest(); - var response = await _elasticClient.Cat.IndicesAsync(request, cancellationToken); - return new Response.Index.GetIndexResponse(response); - } - - public async Task GetIndexByAliasAsync(string alias, CancellationToken cancellationToken = default) - { - ICatIndicesRequest request = new CatIndicesRequest(alias); - var response = await _elasticClient.Cat.IndicesAsync(request, cancellationToken); - return new Response.Index.GetIndexByAliasResponse(response); - } - - #endregion - - #region alias manage - - public async Task GetAllAliasAsync(CancellationToken cancellationToken = default) - { - Func? selector = null; - var response = await _elasticClient.Cat.AliasesAsync(selector, cancellationToken); - return new MASAGetAliasResponse(response); - } - - public async Task GetAliasByIndexAsync( - string indexName, - CancellationToken cancellationToken = default) - { - IGetAliasRequest request = new GetAliasRequest((Indices)indexName); - var response = await _elasticClient.Indices.GetAliasAsync(request, cancellationToken); - return new MASAGetAliasResponse(response); - } - - public async Task BindAliasAsync( - BindAliasIndexOptions options, - CancellationToken cancellationToken = default) - { - BulkAliasDescriptor request = new BulkAliasDescriptor(); - foreach (var indexName in options.IndexNames) - request.Add(opt => opt.Aliases(options.Alias).Index(indexName)); - - var response = await _elasticClient.Indices.BulkAliasAsync(request, cancellationToken); - return new MASABulkAliasResponse(response); - } - - public async Task UnBindAliasAsync( - UnBindAliasIndexOptions options, - CancellationToken cancellationToken = default) - { - BulkAliasDescriptor request = new BulkAliasDescriptor(); - foreach (var indexName in options.IndexNames) - request.Remove(opt => opt.Aliases(options.Alias).Index(indexName)); - - var response = await _elasticClient.Indices.BulkAliasAsync(request, cancellationToken); - return new MASABulkAliasResponse(response); - } - - #endregion - - #region document manage - - public async Task DocumentExistsAsync( - ExistDocumentRequest request, - CancellationToken cancellationToken = default) - { - var documentExistsRequest = new DocumentExistsRequest(request.IndexName, request.DocumentId); - return new Response.ExistsResponse(await _elasticClient.DocumentExistsAsync(documentExistsRequest, cancellationToken)); - } - - public async Task DocumentCountAsync(CountDocumentRequest request, CancellationToken cancellationToken = default) - { - var countRequest = new CountRequest(request.IndexName) - { - ExpandWildcards = ExpandWildcards.All - }; - return new CountDocumentResponse(await _elasticClient.CountAsync(countRequest, cancellationToken)); - } - - /// - /// Add a new document - /// only when the document does not exist - /// - /// - /// - /// - /// - public async Task CreateDocumentAsync( - CreateDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class - { - ICreateRequest createRequest = new CreateRequest(request.IndexName, new Id(request.Request.DocumentId)); - createRequest.Document = request.Request.Document; - return new Response.CreateResponse(await _elasticClient.CreateAsync(createRequest, cancellationToken)); - } - - /// - /// Add new documents in batches - /// only when the documents do not exist - /// - /// - /// - /// - /// - public async Task CreateMultiDocumentAsync( - CreateMultiDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class - { - BulkDescriptor descriptor = new BulkDescriptor(request.IndexName); - foreach (var item in request.Items) - { - descriptor - .Create(opt => opt.Document(item.Document) - .Index(request.IndexName) - .Id(item.DocumentId)); - } - - var response = await _elasticClient.BulkAsync(descriptor, cancellationToken); - return new CreateMultiResponse(response); - } - - /// - /// Update or insert document - /// Overwrite if it exists, add new if it does not exist - /// - /// - /// - /// - /// - public async Task SetDocumentAsync( - SetDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class - { - BulkDescriptor descriptor = new BulkDescriptor(request.IndexName); - foreach (var item in request.Items) - { - descriptor - .Index(opt => opt.Document(item.Document) - .Index(request.IndexName) - .Id(item.DocumentId)); - } - - var response = await _elasticClient.BulkAsync(descriptor, cancellationToken); - return new SetResponse(response); - } - - public async Task DeleteDocumentAsync( - DeleteDocumentRequest request, - CancellationToken cancellationToken = default) - { - IDeleteRequest deleteRequest = new DeleteRequest(request.IndexName, new Id(request.DocumentId)); - return new Response.DeleteResponse(await _elasticClient.DeleteAsync(deleteRequest, cancellationToken)); - } - - public async Task DeleteMultiDocumentAsync( - DeleteMultiDocumentRequest request, - CancellationToken cancellationToken = default) - { - var response = await Internal.DeleteMultiExtensions.DeleteManyAsync(_elasticClient, request.DocumentIds, request.IndexName, cancellationToken); - return new DeleteMultiResponse(response); - } - - public async Task ClearDocumentAsync(string indexNameOrAlias, CancellationToken cancellationToken = default) - { - var deleteByQueryRequest = new DeleteByQueryRequest(indexNameOrAlias) - { - Query = new QueryContainer(new MatchAllQuery()) - }; - return new(await _elasticClient.DeleteByQueryAsync(deleteByQueryRequest, cancellationToken)); - } - - /// - /// Update the document - /// only if the document exists - /// - /// - /// - /// - /// - /// - public async Task UpdateDocumentAsync( - UpdateDocumentRequest request, - CancellationToken cancellationToken = default) - where TDocument : class - { - if (request.Request.Document != null) - { - var response = await _elasticClient.UpdateAsync( - request.Request.DocumentId, - opt => opt.Doc(request.Request.Document).Index(request.IndexName), - cancellationToken); - return new UpdateResponse(response); - } - - IUpdateRequest updateRequest = - new UpdateRequest(request.IndexName, request.Request.DocumentId) - { - Doc = request.Request.PartialDocument! - }; - return new UpdateResponse(await _elasticClient.UpdateAsync(updateRequest, cancellationToken)); - } - - /// - /// Update documents in batches - /// only when the documents exist - /// - /// - /// - /// - /// - public async Task UpdateMultiDocumentAsync( - UpdateMultiDocumentRequest request, - CancellationToken cancellationToken = default) - where TDocument : class - { - BulkDescriptor descriptor = new BulkDescriptor(request.IndexName); - foreach (var item in request.Items) - { - if (item.Document != null) - { - descriptor - .Update(opt => opt.Doc(item.Document) - .Index(request.IndexName) - .Id(item.DocumentId)); - } - else - { - descriptor - .Update(opt => opt.Doc(item.PartialDocument!) - .Index(request.IndexName) - .Id(item.DocumentId)); - } - } - - var response = await _elasticClient.BulkAsync(descriptor, cancellationToken); - return new UpdateMultiResponse(response); - } - - public async Task> GetAsync( - GetDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class - { - IGetRequest getRequest = new GetRequest(request.IndexName, request.Id); - return new Response.GetResponse(await _elasticClient.GetAsync(getRequest, cancellationToken)); - } - - public async Task> GetMultiAsync( - GetMultiDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class - { - var response = (await - _elasticClient.GetManyAsync(request.Ids, request.IndexName, cancellationToken) - )?.ToList() ?? new List>(); - - if (response.Count == request.Ids.Count()) - return new GetMultiResponse(true, "success", response); - - return new GetMultiResponse(false, "Failed to get document"); - } - - public async Task> GetListAsync( - QueryOptions options, - CancellationToken cancellationToken = default) where TDocument : class - { - var response = await QueryString( - options.IndexName, - options.Skip, - options.Take, - options, - cancellationToken); - return new Response.SearchResponse(response); - } - - public async Task> GetPaginatedListAsync( - PaginatedOptions options, - CancellationToken cancellationToken = default) where TDocument : class - { - var response = await QueryString( - options.IndexName, - (options.Page - 1) * options.PageSize, - options.PageSize, - options, - cancellationToken); - return new SearchPaginatedResponse(options.PageSize, response); - } - - private Task> QueryString( - string? indexName, - int skip, - int take, - QueryBaseOptions queryBaseOptions, - CancellationToken cancellationToken = default) - where TDocument : class - { - return _elasticClient.SearchAsync(s => s - .Index(indexName) - .From(skip) - .Size(take) - .Query(q => q - .QueryString(qs => GetQueryDescriptor(qs, queryBaseOptions)) - ), cancellationToken); - } - - private static QueryStringQueryDescriptor GetQueryDescriptor( - QueryStringQueryDescriptor queryDescriptor, - QueryBaseOptions queryBaseOptions) - where TDocument : class - { - queryDescriptor = queryDescriptor.Query(queryBaseOptions.Query); - queryDescriptor = queryDescriptor.DefaultOperator(queryBaseOptions.Operator); - if (!string.IsNullOrEmpty(queryBaseOptions.DefaultField)) - queryDescriptor.DefaultField(queryBaseOptions.DefaultField); - - if (queryBaseOptions.Fields.Any()) - queryDescriptor.Fields(queryBaseOptions.Fields.ToArray()); - - queryBaseOptions.Action?.Invoke(queryDescriptor); - - return queryDescriptor; - } - - #endregion -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs deleted file mode 100644 index b51e57a0a..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch; - -public class ElasticsearchOptions -{ - public bool IsDefault { get; set; } - - public bool UseConnectionPool { get; private set; } - - internal string[] Nodes { get; private set; } - - internal StaticConnectionPoolOptions StaticConnectionPoolOptions { get; } - - internal ConnectionSettingsOptions ConnectionSettingsOptions { get; } - - internal Action? Action { get; private set; } - - public ElasticsearchOptions(params string[] nodes) - { - if (nodes.Length == 0) - throw new ArgumentException("Please specify the Elasticsearch node address"); - - IsDefault = false; - Nodes = nodes; - UseConnectionPool = nodes.Length > 1; - ConnectionSettingsOptions = new(); - StaticConnectionPoolOptions = new(); - Action = null; - } - - public ElasticsearchOptions UseDefault() - { - IsDefault = true; - return this; - } - - public ElasticsearchOptions UseNodes(params string[] nodes) - { - if (nodes == null || nodes.Length == 0) - throw new ArgumentException("Please enter the Elasticsearch node address"); - - Nodes = nodes; - UseConnectionPool = nodes.Length > 1; - return this; - } - - public ElasticsearchOptions UseRandomize(bool randomize) - { - StaticConnectionPoolOptions.UseRandomize(randomize); - return this; - } - - public ElasticsearchOptions UseDateTimeProvider(IDateTimeProvider dateTimeProvider) - { - StaticConnectionPoolOptions.UseDateTimeProvider(dateTimeProvider); - return this; - } - - public ElasticsearchOptions UseConnectionSettings(Action action) - { - Action = action; - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs deleted file mode 100644 index 8927fa4a1..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch; - -public class ElasticsearchRelations -{ - public bool IsDefault { get; private set; } - - public string Name { get; } - - public Uri[] Nodes { get; } - - public bool UseConnectionPool { get; } - - internal StaticConnectionPoolOptions? StaticConnectionPoolOptions { get; private set; } - - internal ConnectionSettingsOptions? ConnectionSettingsOptions { get; private set; } - - internal Action? Action { get; private set; } - - public ElasticsearchRelations(string name, bool useConnectionPool, Uri[] nodes) - { - Name = name; - IsDefault = false; - UseConnectionPool = useConnectionPool; - Nodes = nodes; - Action = null; - StaticConnectionPoolOptions = null; - ConnectionSettingsOptions = null; - } - - public ElasticsearchRelations UseDefault() - { - IsDefault = true; - return this; - } - - public ElasticsearchRelations UseStaticConnectionPoolOptions(StaticConnectionPoolOptions staticConnectionPoolOptions) - { - StaticConnectionPoolOptions = staticConnectionPoolOptions; - return this; - } - - public ElasticsearchRelations UseConnectionSettingsOptions(ConnectionSettingsOptions connectionSettingsOptions) - { - ConnectionSettingsOptions = connectionSettingsOptions; - return this; - } - - public ElasticsearchRelations UseConnectionSettings(Action? action) - { - Action = action; - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs deleted file mode 100644 index 0ad3b3cdb..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch; - -public interface IElasticsearchFactory -{ - IMasaElasticClient CreateClient(); - - IMasaElasticClient CreateClient(string name); - - IElasticClient CreateElasticClient(); - - IElasticClient CreateElasticClient(string name); -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs deleted file mode 100644 index a418e5fcb..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch; - -public interface IMasaElasticClient -{ - #region index manage - - Task IndexExistAsync( - string indexName, - CancellationToken cancellationToken = default); - - Task CreateIndexAsync( - string indexName, - CreateIndexOptions? options = null, - CancellationToken cancellationToken = default); - - Task DeleteIndexAsync(string indexName, - CancellationToken cancellationToken = default); - - Task DeleteMultiIndexAsync( - IEnumerable indexNames, - CancellationToken cancellationToken = default); - - Task DeleteIndexByAliasAsync( - string alias, - CancellationToken cancellationToken = default); - - Task GetAllIndexAsync(CancellationToken cancellationToken = default); - - Task GetIndexByAliasAsync( - string alias, - CancellationToken cancellationToken = default); - - #endregion - - #region alias manage - - Task GetAllAliasAsync(CancellationToken cancellationToken = default); - - Task GetAliasByIndexAsync( - string indexName, - CancellationToken cancellationToken = default); - - Task BindAliasAsync( - BindAliasIndexOptions options, - CancellationToken cancellationToken = default); - - Task UnBindAliasAsync( - UnBindAliasIndexOptions options, - CancellationToken cancellationToken = default); - - #endregion - - #region document manage - - Task DocumentExistsAsync( - ExistDocumentRequest request, - CancellationToken cancellationToken = default); - - Task DocumentCountAsync(CountDocumentRequest request, CancellationToken cancellationToken = default); - - /// - /// Add a new document - /// only when the document does not exist - /// - /// - /// - /// - /// - Task CreateDocumentAsync( - CreateDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class; - - /// - /// Add new documents in batches - /// only when the documents do not exist - /// - /// - /// - /// - /// - Task CreateMultiDocumentAsync( - CreateMultiDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class; - - /// - /// Update or insert document - /// Overwrite if it exists, add new if it does not exist - /// - /// - /// - /// - /// - Task SetDocumentAsync( - SetDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class; - - Task DeleteDocumentAsync( - DeleteDocumentRequest request, - CancellationToken cancellationToken = default); - - Task DeleteMultiDocumentAsync( - DeleteMultiDocumentRequest request, - CancellationToken cancellationToken = default); - - Task ClearDocumentAsync(string indexNameOrAlias, CancellationToken cancellationToken = default); - - /// - /// Update the document - /// only if the document exists - /// - /// - /// - /// - /// - Task UpdateDocumentAsync( - UpdateDocumentRequest request, - CancellationToken cancellationToken = default) - where TDocument : class; - - /// - /// Update documents in batches - /// only when the documents exist - /// - /// - /// - /// - /// - Task UpdateMultiDocumentAsync( - UpdateMultiDocumentRequest request, - CancellationToken cancellationToken = default) - where TDocument : class; - - Task> GetAsync( - GetDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class; - - Task> GetMultiAsync( - GetMultiDocumentRequest request, - CancellationToken cancellationToken = default) where TDocument : class; - - Task> GetListAsync( - QueryOptions options, - CancellationToken cancellationToken = default) where TDocument : class; - - Task> GetPaginatedListAsync( - PaginatedOptions options, - CancellationToken cancellationToken = default) where TDocument : class; - - #endregion -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs deleted file mode 100644 index 3c49a012d..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Internal.BulkOperation; - -public class BulkDeleteOperation : BulkOperationBase -{ - public BulkDeleteOperation(Id id) => Id = id; - - protected override object GetBody() => null!; - - protected override Type ClrType { get; } = default!; - - protected override string Operation => "delete"; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs deleted file mode 100644 index 899427d51..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Internal; - -internal static class DeleteMultiExtensions -{ - public static Task DeleteManyAsync( - this IElasticClient client, - IEnumerable documentIds, - IndexName index, - CancellationToken cancellationToken = default ) - { - var bulkRequest = CreateDeleteBulkRequest(documentIds, index); - return client.BulkAsync(bulkRequest, cancellationToken); - } - - private static BulkRequest CreateDeleteBulkRequest(IEnumerable documentIds, IndexName index) - { - ArgumentNullException.ThrowIfNull(documentIds, nameof(documentIds)); - var bulkRequest = new BulkRequest(index); - var deletes = documentIds - .Select(id => new BulkDeleteOperation(new Id(id))) - .Cast() - .ToList(); - - bulkRequest.Operations = new BulkOperationsCollection(deletes); - return bulkRequest; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj deleted file mode 100644 index 1ad8a42e0..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs deleted file mode 100644 index 63fc923bb..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch; - -public class MasaElasticsearchBuilder -{ - public IServiceCollection Services { get; } - - public IElasticClient ElasticClient { get; } - - public IMasaElasticClient Client { get; } - - public MasaElasticsearchBuilder(IServiceCollection services, IElasticClient elasticClient) - { - Services = services; - ElasticClient = elasticClient; - Client = new DefaultMasaElasticClient(elasticClient); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs deleted file mode 100644 index a9385d3aa..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Alias; - -public class BindAliasIndexOptions -{ - public IEnumerable IndexNames { get; } = default!; - - public string Alias { get; } - - private BindAliasIndexOptions(string alias) => Alias = alias; - - public BindAliasIndexOptions(string alias, string indexName) : this(alias) - { - if (string.IsNullOrEmpty(indexName)) - throw new ArgumentException("indexName cannot be empty", nameof(indexName)); - - IndexNames = new[] { indexName }; - } - - public BindAliasIndexOptions(string alias, IEnumerable indexNames) : this(alias) - { - ArgumentNullException.ThrowIfNull(nameof(indexNames)); - IndexNames = indexNames; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs deleted file mode 100644 index ea787ffd4..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Alias; - -public class UnBindAliasIndexOptions -{ - public IEnumerable IndexNames { get; } = default!; - - public string Alias { get; } - - private UnBindAliasIndexOptions(string alias) => Alias = alias; - - public UnBindAliasIndexOptions(string alias, string indexName) : this(alias) - { - if (string.IsNullOrEmpty(indexName)) - throw new ArgumentException("indexName cannot be empty", nameof(indexName)); - - IndexNames = new[] { indexName }; - } - - public UnBindAliasIndexOptions(string alias, IEnumerable indexNames) : this(alias) - { - ArgumentNullException.ThrowIfNull(nameof(indexNames)); - IndexNames = indexNames; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs deleted file mode 100644 index bf5909f09..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options; - -public class ConnectionSettingsOptions -{ - internal IConnection? Connection { get; set; } - - internal ConnectionSettings.SourceSerializerFactory? SourceSerializerFactory { get; set; } - - internal IPropertyMappingProvider? PropertyMappingProvider { get; set; } - - public ConnectionSettingsOptions() - { - Connection = null; - SourceSerializerFactory = null; - PropertyMappingProvider = null; - } - - public ConnectionSettingsOptions UseConnection(IConnection? connection) - { - Connection = connection; - return this; - } - - public ConnectionSettingsOptions UseSourceSerializerFactory(ConnectionSettings.SourceSerializerFactory? sourceSerializerFactory) - { - SourceSerializerFactory = sourceSerializerFactory; - return this; - } - - public ConnectionSettingsOptions UsePropertyMappingProvider(IPropertyMappingProvider? propertyMappingProvider) - { - PropertyMappingProvider = propertyMappingProvider; - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs deleted file mode 100644 index 200f1fcfa..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Count; - -public class CountDocumentRequest : DocumentOptions -{ - public CountDocumentRequest(string indexNameOrAlias) : base(indexNameOrAlias) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs deleted file mode 100644 index fe9ec9b91..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Create; - -public class CreateDocumentItemRequest : SingleDocumentBaseRequest - where TDocument : class -{ - public CreateDocumentItemRequest(TDocument document, string? documentId) : base(document, documentId) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs deleted file mode 100644 index ba8ef25b0..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Create; - -public class CreateDocumentRequest : DocumentOptions where TDocument : class -{ - public SingleDocumentBaseRequest Request { get; } - - public CreateDocumentRequest(string indexName, TDocument document, string? documentId) : base(indexName) - => Request = new SingleDocumentBaseRequest(document, documentId); -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs deleted file mode 100644 index a9bbca495..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Create; - -public class CreateMultiDocumentRequest : DocumentOptions where TDocument : class -{ - public List> Items { get; set; } - - public CreateMultiDocumentRequest(string indexName) : base(indexName) => Items = new(); - - public CreateMultiDocumentRequest(string indexName, TDocument document, string? documentId = null) : this(indexName) - => AddDocument(document, documentId); - - public CreateMultiDocumentRequest(string indexName, IEnumerable> datas) : this(indexName) - { - ArgumentNullException.ThrowIfNull(datas, nameof(datas)); - - foreach (var data in datas) AddDocument(data.Document, data.DocumentId); - } - - public CreateMultiDocumentRequest AddDocument(TDocument document, string? documentId = null) - => AddDocument(new SingleDocumentBaseRequest(document, documentId)); - - public CreateMultiDocumentRequest AddDocument(SingleDocumentBaseRequest item) - { - Items.Add(item); - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs deleted file mode 100644 index eb7707b9d..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Delete; - -public class DeleteDocumentRequest : DocumentOptions -{ - public string DocumentId { get; } - - public DeleteDocumentRequest(string indexName, string documentId) : base(indexName) => DocumentId = documentId; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs deleted file mode 100644 index cb3bde72c..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Delete; - -public class DeleteMultiDocumentRequest : DocumentOptions -{ - public IEnumerable DocumentIds { get; } - - public DeleteMultiDocumentRequest(string indexName, params string[] documentIds) : base(indexName) - => DocumentIds = documentIds; - - public DeleteMultiDocumentRequest(string indexName, IEnumerable documentIds) : base(indexName) - => DocumentIds = documentIds; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs deleted file mode 100644 index 9242b3303..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document; - -public class DocumentOptions -{ - public string IndexName { get; } - - public DocumentOptions(string indexName) - { - if (string.IsNullOrEmpty(indexName)) - throw new ArgumentException("indexName cannot be empty",nameof(indexName)); - - IndexName = indexName; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs deleted file mode 100644 index 6d55d93e2..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Exist; - -public class ExistDocumentRequest : DocumentOptions -{ - public string DocumentId { get; set; } - - public ExistDocumentRequest(string indexName, string documentId) : base(indexName) - => DocumentId = documentId; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs deleted file mode 100644 index 2c03ac347..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Get; - -public class GetDocumentRequest : DocumentOptions -{ - public string Id { get; } - - public GetDocumentRequest(string indexName, string id) : base(indexName) => Id = id; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs deleted file mode 100644 index d175c5cab..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Get; - -public class GetMultiDocumentRequest : DocumentOptions -{ - public IEnumerable Ids { get; } - - public GetMultiDocumentRequest(string indexName,params string[] ids) : base(indexName) - => Ids = ids; - - public GetMultiDocumentRequest(string indexName, IEnumerable ids) : base(indexName) - => Ids = ids; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs deleted file mode 100644 index ded6c7b3a..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Query; - -public class PaginatedOptions : QueryBaseOptions - where TDocument : class -{ - public int Page { get; } - - public int PageSize { get; } - - public PaginatedOptions( - string indexName, - string query, - string defaultField, - int page, - int pageSize, - Operator @operator = Operator.Or) - : base(indexName, query, defaultField, @operator) - { - Page = page; - PageSize = pageSize; - } - - public PaginatedOptions( - string indexName, - string query, - IEnumerable fields, - int page, - int pageSize, - Operator @operator = Operator.Or) - : base(indexName, query, fields, @operator) - { - Page = page; - PageSize = pageSize; - } - - public new PaginatedOptions UseFields(params string[] fields) - { - base.UseFields(fields); - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs deleted file mode 100644 index 42e1cb00f..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Query; - -public class QueryBaseOptions : DocumentOptions - where TDocument : class -{ - public string? DefaultField { get; } - - public IEnumerable Fields { get; private set; } - - public string Query { get; } - - public Operator Operator { get; set; } - - public Action>? Action { get; set; } - - public QueryBaseOptions(string indexName, string query, string? defaultField = null, Operator @operator = Operator.Or) - : base(indexName) - { - DefaultField = defaultField; - Fields = Array.Empty(); - Query = query; - Operator = @operator; - } - - public QueryBaseOptions(string indexName, string query, IEnumerable? fields = null, Operator @operator = Operator.Or) - : base(indexName) - { - DefaultField = string.Empty; - Fields = fields ?? Array.Empty(); - Query = query; - Operator = @operator; - } - - public QueryBaseOptions UseFields(params string[] fields) - { - if (string.IsNullOrEmpty(DefaultField)) - throw new NotSupportedException("Does not support the assignment of DefaultField and Fields at the same time"); - - Fields = fields; - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs deleted file mode 100644 index 5817949a9..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Query; - -public class QueryOptions : QueryBaseOptions - where TDocument : class -{ - public int Skip { get; } - - public int Take { get; } - - public QueryOptions(string indexName, string query, string defaultField, int skip, int take, Operator @operator = Operator.Or) - : base(indexName, query, defaultField, @operator) - { - Skip = skip; - Take = take; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs deleted file mode 100644 index 42c90e9a7..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Set; - -public class SetDocumentItemBaseRequest : SingleDocumentBaseRequest - where TDocument : class -{ - public SetDocumentItemBaseRequest(TDocument document, string? documentId) : base(document, documentId) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs deleted file mode 100644 index 004723124..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Set; - -public class SetDocumentRequest : DocumentOptions where TDocument : class -{ - public List> Items { get; set; } - - public SetDocumentRequest(string indexName) : base(indexName) => Items = new(); - - public SetDocumentRequest(string indexName, TDocument document, string? documentId = null) : this(indexName) - => AddDocument(document, documentId); - - public SetDocumentRequest(string indexName, IEnumerable> datas) : this(indexName) - { - ArgumentNullException.ThrowIfNull(datas, nameof(datas)); - - foreach (var data in datas) AddDocument(data.Document, data.DocumentId); - } - - public SetDocumentRequest AddDocument(TDocument document, string? documentId = null) - => AddDocument(new SingleDocumentBaseRequest(document, documentId)); - - public SetDocumentRequest AddDocument(SingleDocumentBaseRequest item) - { - Items.Add(item); - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs deleted file mode 100644 index 7a3ee84a6..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document; - -public class SingleDocumentBaseRequest where TDocument : class -{ - public TDocument Document { get; } - - public string? DocumentId { get; } - - public SingleDocumentBaseRequest(TDocument document, string? documentId) - { - Document = document; - DocumentId = documentId ?? Guid.NewGuid().ToString(); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs deleted file mode 100644 index ba6c060d5..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Update; - -public class UpdateDocumentBaseRequest where TDocument : class -{ - public TDocument? Document { get; } - - public object? PartialDocument { get; } - - public string? DocumentId { get; } - - public UpdateDocumentBaseRequest(TDocument document, string? documentId = null) - { - Document = document; - DocumentId = documentId; - } - - public UpdateDocumentBaseRequest(object partialDocument, string? documentId = null) - { - PartialDocument = partialDocument; - DocumentId = documentId; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs deleted file mode 100644 index ddaf95607..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Update; - -public class UpdateDocumentRequest : DocumentOptions where TDocument : class -{ - public UpdateDocumentBaseRequest Request { get; } - - public UpdateDocumentRequest(string indexName, TDocument document, string? documentId = null) : base(indexName) - => Request = new UpdateDocumentBaseRequest(document, documentId); - - public UpdateDocumentRequest(string indexName, object partialDocument, string? documentId = null) : base(indexName) - => Request = new UpdateDocumentBaseRequest(partialDocument, documentId); -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs deleted file mode 100644 index bba9db635..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Document.Update; - -public class UpdateMultiDocumentRequest : DocumentOptions where TDocument : class -{ - public List> Items { get; set; } - - public UpdateMultiDocumentRequest(string indexName) : base(indexName) - => Items = new(); - - public UpdateMultiDocumentRequest AddDocument(UpdateDocumentBaseRequest item) - { - Items.Add(item); - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs deleted file mode 100644 index 6697a7975..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options; - -public class ElasticsearchRelationsOptions -{ - internal readonly Dictionary Relations = new(); - - public ElasticsearchRelationsOptions AddRelation(string name, ElasticsearchOptions options) - { - Uri[] nodes = options.Nodes.Select(uriString => new Uri(uriString)).ToArray(); - ElasticsearchRelations relation = new ElasticsearchRelations(name, options.UseConnectionPool, nodes) - .UseStaticConnectionPoolOptions(options.StaticConnectionPoolOptions) - .UseConnectionSettingsOptions(options.ConnectionSettingsOptions) - .UseConnectionSettings(options.Action); - Relations.Add(name, relation); - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs deleted file mode 100644 index 3fc7ffbd6..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Index; - -public class CreateIndexOptions -{ - public IIndexSettings? IndexSettings { get; set; } = null; - - public IAliases? Aliases { get; set; } = null; - - public ITypeMapping? Mappings { get; set; } = null; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs deleted file mode 100644 index 520278d63..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options.Index; - -public class DeleteIndexOptions -{ - public string Alias { get; set; } = default!; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs deleted file mode 100644 index f11083ec7..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Options; - -public class StaticConnectionPoolOptions -{ - internal bool Randomize { get; set; } - - internal IDateTimeProvider? DateTimeProvider { get; set; } - - public StaticConnectionPoolOptions() - { - Randomize = true; - DateTimeProvider = null; - } - - internal StaticConnectionPoolOptions UseRandomize(bool randomize) - { - Randomize = randomize; - return this; - } - - internal StaticConnectionPoolOptions UseDateTimeProvider(IDateTimeProvider dateTimeProvider) - { - DateTimeProvider = dateTimeProvider; - return this; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.md b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.md deleted file mode 100644 index 13b285e74..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.md +++ /dev/null @@ -1,89 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Utils.Data.Elasticsearch - -## Example: - -```c# -Install-Package Masa.Utils.Data.Elasticsearch -``` - -#### Basic usage: - -Using Elasticsearch - -```` C# -builder.Services.AddElasticsearch("es", "http://localhost:9200"); // or builder.Services.AddElasticsearchClient("es", "http://localhost:9200"); -```` - -#### Create index: - -```` C# -public async Task CreateIndexAsync([FromServices] IMasaElasticClient client) -{ - string indexName = "user_index_1"; - await client.CreateIndexAsync(indexName); -} -```` - -#### Delete index: - -```` C# -public async Task DeleteIndexAsync([FromServices] IMasaElasticClient client) -{ - string indexName = "user_index_1"; - await client.DeleteIndexAsync(indexName); -} -```` - -#### Remove indexes based on aliases: - -```` C# -public async Task DeleteIndexByAliasAsync([FromServices] IMasaElasticClient client) -{ - string alias = "userIndex"; - await client.DeleteIndexByAliasAsync(alias); -} -```` - -### bind alias - -```` C# -public async Task BindAliasAsync([FromServices] IMasaElasticClient client) -{ - string indexName = "user_index_1"; - string indexName2 = "user_index_2"; - string alias = "userIndex"; - await client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 }); -} -```` - -### Unbind aliases - -```` C# -public async Task BindAliasAsync([FromServices] IMasaElasticClient client) -{ - string indexName = "user_index_1"; - string indexName2 = "user_index_2"; - string alias = "userIndex"; - await client.UnBindAliasAsync(new UnBindAliasIndexOptions(alias, new[] { indexName, indexName2 })); -} -```` - -> For more methods, please see [IMasaElasticClient](./IMasaElasticClient.cs) - -## FAQ - -1. The error message is: `"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` - - We enable the compatibility mode by default, namely `EnableApiVersioningHeader(true)`, which supports the 8.* version very well, but will cause errors in some 7.*, in this case, you need to manually turn off the compatibility mode, that is, `EnableApiVersioningHeader(false)`. - - ```` C# - service.AddElasticsearchClient("es", option => - { - option.UseNodes("http://localhost:9200") - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); - }); - ```` - -[Why turn on compatibility mode? ](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.zh-CN.md b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.zh-CN.md deleted file mode 100644 index 18a101942..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/README.zh-CN.md +++ /dev/null @@ -1,89 +0,0 @@ -中 | [EN](README.md) - -## Masa.Utils.Data.Elasticsearch - -## 用例: - -```c# -Install-Package Masa.Utils.Data.Elasticsearch -``` - -#### 基本用法: - -使用Elasticsearch - -``` C# -builder.Services.AddElasticsearch("es", "http://localhost:9200"); // 或者builder.Services.AddElasticsearchClient("es", "http://localhost:9200"); -``` - -#### 创建索引: - -``` C# -public async Task CreateIndexAsync([FromServices] IMasaElasticClient client) -{ - string indexName = "user_index_1"; - await client.CreateIndexAsync(indexName); -} -``` - -#### 删除索引: - -``` C# -public async Task DeleteIndexAsync([FromServices] IMasaElasticClient client) -{ - string indexName = "user_index_1"; - await client.DeleteIndexAsync(indexName); -} -``` - -#### 根据别名删除索引: - -``` C# -public async Task DeleteIndexByAliasAsync([FromServices] IMasaElasticClient client) -{ - string alias = "userIndex"; - await client.DeleteIndexByAliasAsync(alias); -} -``` - -### 绑定别名 - -``` C# -public async Task BindAliasAsync([FromServices] IMasaElasticClient client) -{ - string indexName = "user_index_1"; - string indexName2 = "user_index_2"; - string alias = "userIndex"; - await client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 }); -} -``` - -### 解除别名绑定 - -``` C# -public async Task BindAliasAsync([FromServices] IMasaElasticClient client) -{ - string indexName = "user_index_1"; - string indexName2 = "user_index_2"; - string alias = "userIndex"; - await client.UnBindAliasAsync(new UnBindAliasIndexOptions(alias, new[] { indexName, indexName2 })); -} -``` - -> 更多方法请查看[IMasaElasticClient](./IMasaElasticClient.cs) - -## 常见问题 - -1. 出错提示为:`"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` - - 我们默认启用兼容模式,即`EnableApiVersioningHeader(true)`,这样对8.*版本支持很好,但在部分7.*会导致错误,此时需要手动关闭兼容模式,即`EnableApiVersioningHeader(false)`。 - - ``` C# - service.AddElasticsearchClient("es", option => - { - option.UseNodes("http://localhost:9200") - .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); - }); - ``` - -[为何开启兼容模式?](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs deleted file mode 100644 index 8e97da026..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response.Alias; - -public class BulkAliasResponse : ResponseBase -{ - public BulkAliasResponse(Nest.BulkAliasResponse bulkAliasResponse) : base(bulkAliasResponse) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs deleted file mode 100644 index 28b5846b8..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response.Alias; - -public class GetAliasResponse : ResponseBase -{ - public IEnumerable Aliases { get; } - - public GetAliasResponse(CatResponse catResponse) : base(catResponse) - => Aliases = catResponse.IsValid ? catResponse.Records.Select(r => r.Alias).ToArray() : Array.Empty(); - - public GetAliasResponse(Nest.GetAliasResponse getAliasResponse) : base(getAliasResponse) - { - Aliases = getAliasResponse.IsValid - ? getAliasResponse.Indices - .Select(item => item.Value) - .SelectMany(indexAlias => indexAlias.Aliases) - .Select(alias => alias.Key).Distinct().ToArray() - : Array.Empty(); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs deleted file mode 100644 index 0a01a010f..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class BulkResponse : ResponseBase -{ - public List Items { get; set; } - - public BulkResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) - { - Items = bulkResponse.Items.Select(item => new BulkResponseItems(item.Id, item.IsValid, item.Error?.ToString() ?? string.Empty)).ToList(); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs deleted file mode 100644 index 2fd7bacae..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class BulkResponseItems -{ - /// - /// The id of the document for the bulk operation - /// - public string Id { get; } - - public bool IsValid { get; } - - public string Message { get; } - - public BulkResponseItems(string id, bool isValid, string message) - { - Id = id; - IsValid = isValid; - Message = message; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs deleted file mode 100644 index b2f60e8d3..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class CreateMultiResponse : BulkResponse -{ - public CreateMultiResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs deleted file mode 100644 index ad50cf6f3..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class CreateResponse : ResponseBase -{ - public CreateResponse(Nest.CreateResponse createResponse) : base(createResponse) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs deleted file mode 100644 index 6fc2570e4..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class DeleteMultiResponse : ResponseBase -{ - public List Data { get; set; } - - public DeleteMultiResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) - { - Data = bulkResponse.Items.Select(item => - new DeleteRangeResponseItems(item.Id, - item.IsValid && item.Status == 200, - !string.IsNullOrEmpty(item.Result) ? item.Result : item.Error?.ToString() ?? string.Empty)).ToList(); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs deleted file mode 100644 index 785d24796..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class DeleteRangeResponseItems -{ - public string Id { get; } - - public bool IsValid { get; } - - public string Message { get; } - - public DeleteRangeResponseItems(string id, bool isValid, string message) - { - Id = id; - IsValid = isValid; - Message = message; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs deleted file mode 100644 index ab6a99db6..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class DeleteResponse : ResponseBase -{ - public DeleteResponse(Nest.DeleteResponse deleteResponse) : base(deleteResponse) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs deleted file mode 100644 index 9b13a2fbd..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response.Document; - -public class ClearDocumentResponse : ResponseBase -{ - public ClearDocumentResponse(DeleteByQueryResponse response) : base(response) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs deleted file mode 100644 index ef46ae530..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response.Document; - -public class CountDocumentResponse : ResponseBase -{ - public long Count { get; } - - public CountDocumentResponse(CountResponse response) : base(response) => Count = response.Count; -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs deleted file mode 100644 index 6436bf54f..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class ExistsResponse : ResponseBase -{ - public bool Exists { get; } - - public ExistsResponse(Nest.ExistsResponse existsResponse) : base( - existsResponse.IsValid || existsResponse.ApiCall.HttpStatusCode == 404, - existsResponse.IsValid || existsResponse.ApiCall.HttpStatusCode == 404 ? "success" : existsResponse.ServerError?.ToString() ?? string.Empty) - { - Exists = existsResponse.Exists; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs deleted file mode 100644 index d22106c0e..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class GetMultiResponse : ResponseBase - where TDocument : class -{ - public List> Data { get; set; } - - public GetMultiResponse(bool isValid, string message, List>? multiGetHits = null) : base(isValid, message) - { - Data = multiGetHits?.Select(res => new GetMultiResponseItems(res.Id, res.Source)).ToList() ?? new(); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs deleted file mode 100644 index 2a023fbc9..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class GetMultiResponseItems - where TDocument : class -{ - public string Id { get; } - - public TDocument Document { get; } - - public GetMultiResponseItems(string id, TDocument document) - { - Id = id; - Document = document; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs deleted file mode 100644 index 15333ce89..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class GetResponse : ResponseBase - where TDocument : class -{ - public TDocument Document { get; set; } - - public GetResponse(IGetResponse getResponse) : base(getResponse) - { - Document = getResponse.Source; - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs deleted file mode 100644 index dcf7915c4..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response.Index; - -public class CreateIndexResponse : ResponseBase -{ - public CreateIndexResponse(Nest.CreateIndexResponse createIndexResponse) : base(createIndexResponse) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs deleted file mode 100644 index 4059fef64..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response.Index; - -public class DeleteIndexResponse : ResponseBase -{ - public DeleteIndexResponse(Nest.DeleteIndexResponse deleteIndexResponse) : base(deleteIndexResponse) - { - } - - public DeleteIndexResponse(BulkAliasResponse bulkAliasResponse) : base(bulkAliasResponse) - { - } - - public DeleteIndexResponse(string message) : base(false, message) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs deleted file mode 100644 index d045eb27b..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response.Index; - -public class GetIndexByAliasResponse : ResponseBase -{ - public string[] IndexNames { get; } - - public GetIndexByAliasResponse(CatResponse catResponse) : base(catResponse) - { - IndexNames = catResponse.IsValid ? catResponse.Records.Select(r => r.Index).ToArray() : Array.Empty(); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs deleted file mode 100644 index d7a4feb05..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response.Index; - -public class GetIndexResponse : ResponseBase -{ - public string[] IndexNames { get; set; } - - public GetIndexResponse(CatResponse catResponse) : base(catResponse) - { - IndexNames = catResponse.IsValid ? catResponse.Records.Select(r => r.Index).ToArray() : Array.Empty(); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs deleted file mode 100644 index 1e7ea5b55..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class ResponseBase -{ - public bool IsValid { get; } - - public string Message { get; } - - protected ResponseBase(bool isValid, string message) - { - IsValid = isValid; - Message = message; - } - - public ResponseBase(IResponse response) : this(response.IsValid, response.IsValid ? "success" : response.ServerError?.ToString() ?? string.Empty) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs deleted file mode 100644 index da4843bb7..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class SearchPaginatedResponse : SearchResponse - where TDocument : class -{ - public long Total { get; set; } - - public int TotalPages { get; set; } - - public SearchPaginatedResponse(ISearchResponse searchResponse) : base(searchResponse) - { - Total = searchResponse.Hits.Count; - } - - public SearchPaginatedResponse(int pageSize, ISearchResponse searchResponse) : this(searchResponse) - { - TotalPages = (int)Math.Ceiling(Total / (decimal)pageSize); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs deleted file mode 100644 index 309f8f424..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class SearchResponse : ResponseBase - where TDocument : class -{ - public List Data { get; } - - public SearchResponse(ISearchResponse searchResponse) : base(searchResponse) - { - Data = searchResponse.Hits.Select(hit => hit.Source).ToList(); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs deleted file mode 100644 index 76e03529e..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class SetResponse : BulkResponse -{ - public SetResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs deleted file mode 100644 index 039be8e1e..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class UpdateMultiResponse : BulkResponse -{ - public UpdateMultiResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs deleted file mode 100644 index 75763fcaa..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Response; - -public class UpdateResponse : ResponseBase -{ - public UpdateResponse(IUpdateResponse updateResponse) : base(updateResponse) - { - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs deleted file mode 100644 index 0a3912065..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static partial class ServiceCollectionExtensions -{ - private static MasaElasticsearchBuilder CreateElasticsearchClient(this IServiceCollection services, string name) - { - var elasticClient = services.BuildServiceProvider().GetRequiredService().CreateElasticClient(name); - return new MasaElasticsearchBuilder(services, elasticClient); - } - - public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services) - => services.AddElasticsearch().CreateElasticsearchClient(Const.DEFAULT_CLIENT_NAME); - - public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string[]? nodes) - => services - .AddElasticsearch(Const.DEFAULT_CLIENT_NAME, nodes == null || nodes.Length == 0 ? new[] {"http://localhost:9200"} : nodes) - .CreateElasticsearchClient(Const.DEFAULT_CLIENT_NAME); - - public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string name, params string[] nodes) - => services.AddElasticsearch(name, nodes).CreateElasticsearchClient(name); - - public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string name, Action action) - => services.AddElasticsearch(name, action).CreateElasticsearchClient(name); - - public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string name, Func func) - => services.AddElasticsearch(name, func).CreateElasticsearchClient(name); -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs deleted file mode 100644 index feba8bd2c..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static partial class ServiceCollectionExtensions -{ - public static IServiceCollection AddElasticsearch(this IServiceCollection services, string[]? nodes = null) - { - if (nodes == null || nodes.Length == 0) - { - nodes = new[] {"http://localhost:9200"}; - } - - return services.AddElasticsearch(Const.DEFAULT_CLIENT_NAME, nodes); - } - - public static IServiceCollection AddElasticsearch(this IServiceCollection services, string name, params string[] nodes) - => services.AddElasticsearch(name, options => options.UseNodes(nodes)); - - public static IServiceCollection AddElasticsearch(this IServiceCollection services, string name, Action action) - { - return services.AddElasticsearch(name, () => - { - ElasticsearchOptions options = new("http://localhost:9200"); - action.Invoke(options); - return options; - }); - } - - public static IServiceCollection AddElasticsearch(this IServiceCollection services, string name, Func func) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentNullException(nameof(name)); - } - - AddElasticsearchCore(services); - - services.TryAddOrUpdateElasticsearchRelation(name, func.Invoke()); - - return services; - } - - private static IServiceCollection AddElasticsearchCore(this IServiceCollection services) - { - ArgumentNullException.ThrowIfNull(services); - - services.TryAddSingleton(); - - services.TryAddSingleton(serviceProvider => - serviceProvider.GetRequiredService().CreateElasticClient()); - - services.TryAddSingleton(serviceProvider => - new DefaultMasaElasticClient(serviceProvider.GetRequiredService())); - - services.TryAddSingleton(new ElasticsearchRelationsOptions()); - - return services; - } - - private static void TryAddOrUpdateElasticsearchRelation(this IServiceCollection services, string name, ElasticsearchOptions options) - { - var serviceProvider = services.BuildServiceProvider(); - var relationsOptions = serviceProvider.GetRequiredService(); - - if (relationsOptions.Relations.ContainsKey(name)) - throw new ArgumentException($"The ElasticClient whose name is {name} is exist"); - - if (options.IsDefault && relationsOptions.Relations.Values.Any(r => r.IsDefault)) - throw new ArgumentNullException(nameof(ElasticsearchRelations.IsDefault), "ElasticClient can only have one default"); - - relationsOptions.AddRelation(name, options); - } -} diff --git a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/_Imports.cs b/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/_Imports.cs deleted file mode 100644 index 7a55080cd..000000000 --- a/src/Utils/Data/Elasticsearch/src/Masa.Utils.Data.Elasticsearch/_Imports.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Elasticsearch.Net; -global using Masa.Utils.Data.Elasticsearch; -global using Masa.Utils.Data.Elasticsearch.Internal.BulkOperation; -global using Masa.Utils.Data.Elasticsearch.Options; -global using Masa.Utils.Data.Elasticsearch.Options.Alias; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Count; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Create; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Delete; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Exist; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Get; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Query; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Set; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Update; -global using Masa.Utils.Data.Elasticsearch.Options.Index; -global using Masa.Utils.Data.Elasticsearch.Response; -global using Masa.Utils.Data.Elasticsearch.Response.Document; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Nest; -global using System.Collections.Concurrent; -global using System.Runtime.Serialization; -global using MASABulkAliasResponse = Masa.Utils.Data.Elasticsearch.Response.Alias.BulkAliasResponse; -global using MASAGetAliasResponse = Masa.Utils.Data.Elasticsearch.Response.Alias.GetAliasResponse; diff --git a/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs b/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs deleted file mode 100644 index 882ec3695..000000000 --- a/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs +++ /dev/null @@ -1,571 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Tests; - -[TestClass] -public class DefaultMasaElasticClientTests -{ - private MasaElasticsearchBuilder _builder = default!; - - [TestInitialize] - public void Initialize() - { - IServiceCollection service = new ServiceCollection(); - _builder = service.AddElasticsearchClient("es", "http://localhost:9200"); - } - - [TestMethod] - public async Task TestCreateIndexAsyncReturnIndexIsExist() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - var indexResponse = await _builder.Client.CreateIndexAsync(indexName); - Assert.IsTrue(indexResponse.IsValid); - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestIndexExistAsyncReturnIndexIsExist() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - await _builder.Client.CreateIndexAsync(indexName); - - var existResponse = await _builder.Client.IndexExistAsync(indexName); - Assert.IsTrue(existResponse.IsValid && existResponse.Exists); - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestCreateDocumentAsyncReturnCountIs1() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); - Assert.IsTrue(!countResponse.IsValid); - - var createResponse = await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new - { - id = Guid.NewGuid() - }, Guid.NewGuid().ToString())); - Assert.IsTrue(createResponse.IsValid); - - Thread.Sleep(1000); - countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestDeleteMultiIndexAsyncReturnCountIs0() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - var indexResponse = await _builder.Client.CreateIndexAsync(userIndexName); - Assert.IsTrue(indexResponse.IsValid); - - string personIndexName = $"person_index_{Guid.NewGuid()}"; - indexResponse = await _builder.Client.CreateIndexAsync(personIndexName); - Assert.IsTrue(indexResponse.IsValid); - - var response = await _builder.Client.DeleteMultiIndexAsync(new[] { userIndexName, personIndexName }); - Assert.IsTrue(response.IsValid); - - Thread.Sleep(1000); - Assert.IsTrue(!(await _builder.Client.IndexExistAsync(userIndexName)).Exists && - !(await _builder.Client.IndexExistAsync(personIndexName)).Exists); - } - - [TestMethod] - public async Task TestIndexByAliasAsync() - { - string userIndex1Name = $"user_index_{Guid.NewGuid()}"; - string userIndex2Name = $"user_index_{Guid.NewGuid()}"; - string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; - - IAliases aliases = new Aliases(); - aliases.Add(aliasIndexName, new Alias()); - var indexResponse = await _builder.Client.CreateIndexAsync(userIndex1Name, new CreateIndexOptions() - { - Aliases = aliases - }); - indexResponse = await _builder.Client.CreateIndexAsync(userIndex2Name, new CreateIndexOptions() - { - Aliases = aliases - }); - - Thread.Sleep(1000); - - var getIndexResponse = await _builder.Client.GetAllIndexAsync(); - Assert.IsTrue(getIndexResponse.IsValid && getIndexResponse.IndexNames.Contains(userIndex1Name) && - getIndexResponse.IndexNames.Contains(userIndex2Name)); - - var getIndexByAliasResponse = await _builder.Client.GetIndexByAliasAsync(aliasIndexName); - Assert.IsTrue(getIndexByAliasResponse.IsValid && getIndexByAliasResponse.IndexNames.Length == 2 && - getIndexByAliasResponse.IndexNames.Contains(userIndex1Name) && - getIndexByAliasResponse.IndexNames.Contains(userIndex2Name)); - - var deleteIndexResponse = await _builder.Client.DeleteIndexByAliasAsync(aliasIndexName); - Assert.IsTrue(deleteIndexResponse.IsValid); - } - - [TestMethod] - public async Task TestGetAllAliasAsyncReturnAliasCountIs1() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; - - var aliasResponse = await _builder.Client.GetAllAliasAsync(); - Assert.IsTrue(aliasResponse.IsValid); - - var oldAliasesCount = aliasResponse.Aliases.Count(); - IAliases aliases = new Aliases(); - aliases.Add(aliasIndexName, new Alias()); - await _builder.Client.CreateIndexAsync(userIndexName, new CreateIndexOptions() - { - Aliases = aliases - }); - - Thread.Sleep(1000); - aliasResponse = await _builder.Client.GetAllAliasAsync(); - Assert.IsTrue(aliasResponse.IsValid && aliasResponse.Aliases.Count() == oldAliasesCount + 1); - - await _builder.Client.DeleteIndexByAliasAsync(aliasIndexName); - } - - [TestMethod] - public async Task TestGetAliasByIndexAsyncReturnAliasIsUserIndexAlias() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; - - IAliases aliases = new Aliases(); - aliases.Add(aliasIndexName, new Alias()); - await _builder.Client.CreateIndexAsync(userIndexName, new CreateIndexOptions() - { - Aliases = aliases - }); - - Thread.Sleep(1000); - var aliasResponse = await _builder.Client.GetAliasByIndexAsync(userIndexName); - Assert.IsTrue(aliasResponse.IsValid && aliasResponse.Aliases.Count() == 1 && aliasResponse.Aliases.Contains(aliasIndexName)); - - await _builder.Client.DeleteIndexByAliasAsync(aliasIndexName); - } - - [TestMethod] - public async Task TestUnBindAliasAsyncReturnIndexIsExist() - { - string userIndexName = $"user_index_{Guid.NewGuid()}"; - string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; - - IAliases aliases = new Aliases(); - aliases.Add(aliasIndexName, new Alias()); - await _builder.Client.CreateIndexAsync(userIndexName, new CreateIndexOptions() - { - Aliases = aliases - }); - - Thread.Sleep(1000); - - var bulkAliasResponse = await _builder.Client.UnBindAliasAsync(new UnBindAliasIndexOptions(aliasIndexName, userIndexName)); - Assert.IsTrue(bulkAliasResponse.IsValid); - - Thread.Sleep(1000); - var existsResponse = await _builder.Client.IndexExistAsync(userIndexName); - Assert.IsTrue(existsResponse.IsValid && existsResponse.Exists); - } - - [TestMethod] - public async Task TestCreateMultiDocumentAsyncReturnCountIs2() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - await _builder.Client.DeleteIndexAsync(indexName); - - string id = Guid.NewGuid().ToString(); - string id2 = Guid.NewGuid().ToString(); - var createMultiResponse = await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) - { - Items = new List>() - { - new(new - { - Id = Guid.NewGuid() - }, id), - new(new - { - Id = Guid.NewGuid() - }, id2) - } - }); - Assert.IsTrue(createMultiResponse.IsValid && - createMultiResponse.Items.Count == 2 && - createMultiResponse.Items.Count(r => r.IsValid) == 2); - - Thread.Sleep(1000); - var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestDocumentExistsAsyncReturnIsExist() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - var id = Guid.NewGuid(); - var createResponse = await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new - { - id = id - }, id.ToString())); - Assert.IsTrue(createResponse.IsValid); - Thread.Sleep(1000); - - var existsResponse = await _builder.Client.DocumentExistsAsync(new ExistDocumentRequest(indexName, id.ToString())); - Assert.IsTrue(existsResponse.IsValid && existsResponse.Exists); - - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestDeleteDocumentAsyncReturnCountIs0() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - var id = Guid.NewGuid(); - var createResponse = await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new - { - id = id - }, id.ToString())); - Assert.IsTrue(createResponse.IsValid); - - var deleteResponse = await _builder.Client.DeleteDocumentAsync(new DeleteDocumentRequest(indexName, id.ToString())); - Assert.IsTrue(deleteResponse.IsValid); - - Thread.Sleep(1000); - var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 0); - - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestDeleteMultiDocumentAsyncReturnDeleteCountIs2() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - string id = Guid.NewGuid().ToString(); - string id2 = Guid.NewGuid().ToString(); - await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) - { - Items = new List>() - { - new(new - { - Id = Guid.NewGuid() - }, id), - new(new - { - Id = Guid.NewGuid() - }, id2) - } - }); - - var deleteResponse = - await _builder.Client.DeleteMultiDocumentAsync(new DeleteMultiDocumentRequest(indexName, id, id2)); - Assert.IsTrue(deleteResponse.IsValid && deleteResponse.Data.Count == 2 && deleteResponse.Data.Count(r => r.IsValid) == 2); - - Thread.Sleep(1000); - var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 0); - - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestDeleteMultiDocumentAsyncReturnDeleteCountSuccessIs2() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - string id = Guid.NewGuid().ToString(); - string id2 = Guid.NewGuid().ToString(); - await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) - { - Items = new List>() - { - new(new - { - Id = Guid.NewGuid() - }, id), - new(new - { - Id = Guid.NewGuid() - }, id2) - } - }); - - var deleteResponse = - await _builder.Client.DeleteMultiDocumentAsync(new DeleteMultiDocumentRequest(indexName, id, id2, Guid.NewGuid().ToString())); - Assert.IsTrue(deleteResponse.IsValid && deleteResponse.Data.Count == 3 && deleteResponse.Data.Count(r => r.IsValid) == 2); - - Thread.Sleep(1000); - var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 0); - - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestSetDocumentAsyncReturnCountIs3() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - Guid id = Guid.NewGuid(); - Guid id2 = Guid.NewGuid(); - await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) - { - Items = new List>() - { - new(new - { - Id = id - }, id.ToString()), - new(new - { - Id = id2 - }, id2.ToString()) - } - }); - Guid id3 = Guid.NewGuid(); - var setResponse = await _builder.Client.SetDocumentAsync(new SetDocumentRequest(indexName) - { - Items = new List>() - { - new(new - { - Id = Guid.NewGuid() - }, id.ToString()), - new(new - { - Id = id3 - }, id3.ToString()) - } - }); - Assert.IsTrue(setResponse.IsValid && setResponse.Items.Count == 2 && setResponse.Items.Count(item => item.IsValid) == 2); - - Thread.Sleep(1000); - - var multiResponse = await _builder.Client.GetMultiAsync( - new GetMultiDocumentRequest(indexName, id.ToString(), id2.ToString(), id3.ToString())); - Assert.IsTrue(multiResponse.IsValid && multiResponse.Data.Count == 3); - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestUpdateDocumentAsyncReturnIdEqual1() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - dynamic expandoObject = new ExpandoObject(); - expandoObject.Id = Guid.NewGuid(); - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, expandoObject, "1")); - - expandoObject.Id = "1"; - var updateDocumentResponse = - await _builder.Client.UpdateDocumentAsync(new UpdateDocumentRequest(indexName, expandoObject, "1")); - Assert.IsTrue(updateDocumentResponse.IsValid); - - Thread.Sleep(1000); - var response = await _builder.Client.GetAsync(new GetDocumentRequest(indexName, "1")); - Assert.IsTrue(response.IsValid && ((dynamic)(response.Document)).Id == "1"); - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestUpdateMultiDocumentAsyncReturnId1Equeal1AndId2Equal2() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - dynamic expandoObject = new ExpandoObject(); - dynamic expandoObject2 = new ExpandoObject(); - expandoObject.Id = Guid.NewGuid(); - expandoObject2.Id = Guid.NewGuid(); - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, expandoObject, "1")); - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, expandoObject2, "2")); - - expandoObject.Id = "1"; - expandoObject2.Id = "2"; - var updateDocumentResponse = - await _builder.Client.UpdateMultiDocumentAsync(new UpdateMultiDocumentRequest(indexName) - { - Items = new List>() - { - new UpdateDocumentBaseRequest(expandoObject, "1"), - new((object)expandoObject2, "2"), - } - }); - Assert.IsTrue(updateDocumentResponse.IsValid); - - Thread.Sleep(1000); - var response = await _builder.Client.GetAsync(new GetDocumentRequest(indexName, "1")); - Assert.IsTrue(response.IsValid && ((dynamic)(response.Document)).Id == "1"); - response = await _builder.Client.GetAsync(new GetDocumentRequest(indexName, "2")); - Assert.IsTrue(response.IsValid && ((dynamic)(response.Document)).Id == "2"); - - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestGetListAsync() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new { name = "jim" }, "1")); - - Thread.Sleep(1000); - var response = await _builder.Client.GetListAsync(new QueryOptions(indexName, "jim", "name", 0, 10)); - Assert.IsTrue(response.IsValid && response.Data.Count == 1); - - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task TestGetPaginatedListAsync() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new { id = "1", name = "jim" }, "1")); - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new { id = "2", name = "tom" }, "2")); - - Thread.Sleep(1000); - var response = - await _builder.Client.GetPaginatedListAsync(new PaginatedOptions(indexName, "jim", "name", 1, 1)); - Assert.IsTrue(response.IsValid && response.Data.Count == 1); - response = await _builder.Client.GetPaginatedListAsync(new PaginatedOptions(indexName, "jim or 2", - new List { "id", "name" }, 1, 2)); - Assert.IsTrue(response.IsValid && response.Data.Count == 2); - - await _builder.Client.DeleteIndexAsync(indexName); - } - - [TestMethod] - public async Task BindAliasAsync() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - string indexName2 = $"user_index_{Guid.NewGuid()}"; - string alias = $"userIndex_{Guid.NewGuid()}"; - - await _builder.Client.CreateIndexAsync(indexName); - await _builder.Client.CreateIndexAsync(indexName2); - - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new - { - id = Guid.NewGuid() - }, Guid.NewGuid().ToString())); - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName2, new - { - id = Guid.NewGuid() - }, Guid.NewGuid().ToString())); - - Thread.Sleep(1000); - var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); - countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName2)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); - - await _builder.Client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 })); - countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); - - await _builder.Client.DeleteIndexAsync(indexName); - await _builder.Client.DeleteIndexAsync(indexName2); - } - - [TestMethod] - public async Task DeleteIndexByAliasAsync() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - string indexName2 = $"user_index_{Guid.NewGuid()}"; - string alias = $"user_index_{Guid.NewGuid()}"; - - await _builder.Client.CreateIndexAsync(indexName); - await _builder.Client.CreateIndexAsync(indexName2); - - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new - { - id = Guid.NewGuid() - }, Guid.NewGuid().ToString())); - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName2, new - { - id = Guid.NewGuid() - }, Guid.NewGuid().ToString())); - - Thread.Sleep(1000); - var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); - countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName2)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); - - await _builder.Client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 })); - countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); - - await _builder.Client.DeleteIndexByAliasAsync(alias); - countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); - Assert.IsTrue(!countResponse.IsValid); - } - - [TestMethod] - public async Task ClearDocumentAsync() - { - string indexName = $"user_index_{Guid.NewGuid()}"; - string indexName2 = $"user_index_{Guid.NewGuid()}"; - string alias = $"user_index_{Guid.NewGuid()}"; - - await _builder.Client.CreateIndexAsync(indexName); - await _builder.Client.CreateIndexAsync(indexName2); - - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new - { - id = Guid.NewGuid() - }, Guid.NewGuid().ToString())); - await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName2, new - { - id = Guid.NewGuid() - }, Guid.NewGuid().ToString())); - - Thread.Sleep(1000); - var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); - countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName2)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); - - await _builder.Client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 })); - countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); - Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); - - await _builder.Client.ClearDocumentAsync(alias); - countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); - Assert.IsTrue(countResponse.IsValid); - - await _builder.Client.DeleteIndexByAliasAsync(alias); - } - - [TestMethod] - public async Task TestAsync() - { - string userIndexName = $"user_index"; - - IServiceCollection service = new ServiceCollection(); - var builder = service.AddElasticsearchClient("es", "http://localhost:9200"); - await builder.Client.DeleteIndexAsync(userIndexName); - var serviceProvider = builder.Services.BuildServiceProvider(); - var client = serviceProvider.GetRequiredService(); - - var list = new AutoCompleteDocument[] - { - new() - { - Text = "999999999@qq.com", - Value = 1 - } - }; - var request = new SetDocumentRequest>(userIndexName); - foreach (var document in list) - request.AddDocument(document, document.Id); - - var response = await client.SetDocumentAsync(request, default); - Assert.IsTrue(response.IsValid); - await builder.Client.DeleteIndexAsync(userIndexName); - } -} diff --git a/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj b/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj deleted file mode 100644 index 4cef9dacb..000000000 --- a/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs b/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs deleted file mode 100644 index 18c4209d6..000000000 --- a/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Elasticsearch.Tests.Models; - -public class AutoCompleteDocument where TValue : notnull -{ - public string Id { get; set; } - - public string Text { get; set; } - - public TValue? Value { get; set; } - - public AutoCompleteDocument() - { - } - - public AutoCompleteDocument(string text, TValue? value) - : this(value?.ToString() ?? throw new ArgumentException($"{value} cannot be empty", nameof(value)), text, value) - { - } - - public AutoCompleteDocument(string id, string text, TValue? value) : this() - { - Id = id; - Text = text; - Value = value; - } -} - diff --git a/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs b/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs deleted file mode 100644 index 4448cf478..000000000 --- a/src/Utils/Data/Elasticsearch/test/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Data.Elasticsearch.Options.Alias; -global using Masa.Utils.Data.Elasticsearch.Options.Document; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Count; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Create; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Delete; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Exist; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Get; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Query; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Set; -global using Masa.Utils.Data.Elasticsearch.Options.Document.Update; -global using Masa.Utils.Data.Elasticsearch.Options.Index; -global using Masa.Utils.Data.Elasticsearch.Tests.Models; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Nest; -global using System.Dynamic; diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs deleted file mode 100644 index b4f33b1db..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Enums; - -public enum ResultStatuses -{ - Success = 1, - Error -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs deleted file mode 100644 index 35391ffc0..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Enums; - -/// -/// reference https://prometheus.io/docs/prometheus/latest/querying/api/#expression-query-result-formats -/// -public enum ResultTypes -{ - Matrix = 1, - Vector, - Scalar, - String -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs deleted file mode 100644 index 32c446a66..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -[assembly: InternalsVisibleTo("Masa.Utils.Data.Prometheus.Test")] -namespace Masa.Utils.Caller.Core; - -internal static class CallerProviderExtensions -{ - public static async Task GetAsync(this ICallerProvider caller, string url, object data) - { - var request = new HttpRequestMessage(HttpMethod.Get, $"{url}?{data.ToUrlParam()}"); - var response = await caller.SendAsync(request, autoThrowUserFriendlyException: false); - return await response.Content.ReadAsStringAsync(); - } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs deleted file mode 100644 index 040a87648..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public static class ObjectExtensions -{ - /// - /// Currently supported types: class, struct and types implementing the IEnumerable interface, - /// struct and class use public get properties and fields by default, - /// The IEnumerable type is directly converted to: key[]=value1&key[]=value2 - /// enum uses strings by default. If you need to use numeric values, please set isEnumString=false - /// - /// - /// - /// - /// - /// - public static string? ToUrlParam(this object? obj, bool isEnumString = true, bool isCamelCase = true, bool isUrlEncode = true) - { - return GetValue(obj, string.Empty, isEnumString, isCamelCase, isUrlEncode); - } - - private static string? GetValue(object? obj, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) - { - if (obj == null) return null; - var type = obj.GetType(); - if (type == typeof(string)) - { - var str = (string)obj; - return AppendValue(preStr, str, "=", isUrlEncode); - } - - if (type.IsValueType) - { - if (type.IsEnum) - { - var str = isEnumString ? obj.ToString() : Convert.ToInt32(obj).ToString(); - return AppendValue(preStr, str, "=", isUrlEncode); - } - - //sample value - if (type.IsPrimitive) - { - var str = obj.ToString(); - return AppendValue(preStr, str, "=", isUrlEncode); - } - - //struct - return GetObjValue(type, obj, preStr, isEnumString, isCamelCase, isUrlEncode); - } - - if (type.IsArray || type.GetInterfaces().Any(t => t.Name.IndexOf("IEnumerable") == 0)) - return GetEnumerableValue(obj, preStr, isEnumString, isCamelCase, isUrlEncode); - - if (type.IsClass) - return GetObjValue(type, obj, preStr, isEnumString, isCamelCase, isUrlEncode); - - //current type not suport - return null; - } - - private static string GetObjValue(Type type, object obj, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) - { - var properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty); - var fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetField); - var list = new List(); - - foreach (var item in properties) - { - var str = GetMemerInfoValue(item, item.GetValue(obj), preStr, isEnumString, isCamelCase, isUrlEncode); - if (string.IsNullOrEmpty(str)) - continue; - list.Add(str); - } - - foreach (var item in fields) - { - var str = GetMemerInfoValue(item, item.GetValue(obj), preStr, isEnumString, isCamelCase, isUrlEncode); - if (string.IsNullOrEmpty(str)) - continue; - list.Add(str); - } - - if (!list.Any()) - return default!; - - list.Sort(); - return string.Join('&', list); - } - - private static string? GetMemerInfoValue(MemberInfo info, object? value, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) - { - if (value == null) - return null; - - var name = info.Name; - if (isCamelCase) - name = name.ToCamelCase(); - - return GetValue(value, AppendValue(preStr, name, ".", isUrlEncode) ?? default!, isEnumString, isCamelCase, isUrlEncode); - } - - private static string? GetEnumerableValue(object obj, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) - { - var list = new List(); - foreach (var item in (IEnumerable)obj) - { - if (item is KeyValuePair keyValue) - { - var name = keyValue.Key; - if (isCamelCase) - name = name.ToCamelCase(); - var str = GetValue(keyValue.Value, AppendValue(preStr, name, ".", isUrlEncode) ?? default!, isEnumString, isCamelCase, isUrlEncode); - if (!string.IsNullOrEmpty(str)) - list.Add(str); - } - else - { - var str = GetValue(item, $"{preStr}{(isUrlEncode ? HttpUtility.UrlEncode("[]", Encoding.UTF8) : "[]")}", isEnumString, isCamelCase, isUrlEncode); - if (!string.IsNullOrEmpty(str)) - list.Add(str); - } - } - if (!list.Any()) - return default!; - - list.Sort(); - return string.Join('&', list); - } - - private static string? AppendValue(string preStr, string? value, string splitChar, bool isUrlEncode) - { - if (string.IsNullOrEmpty(preStr) || string.IsNullOrEmpty(value)) - return value; - - if (isUrlEncode) - return $"{preStr}{splitChar}{HttpUtility.UrlEncode(value, Encoding.UTF8)}"; - else - return $"{preStr}{splitChar}{value}"; - } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs deleted file mode 100644 index a484b7fb1..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -internal static class StringExtensions -{ - public static string ToCamelCase(this string str) - { - if (string.IsNullOrEmpty(str)) - return default!; - - var span = new ReadOnlySpan(str.ToArray()); - var c = span[0]; - if (c - 'A' >= 0 && c - 'Z' <= 0) - return $"{(char)(c + 32)}{span[1..]}"; - - return str; - } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs deleted file mode 100644 index cc8c5d508..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus; - -public interface IMasaPrometheusClient -{ - Task QueryAsync(QueryRequest query); - - Task QueryRangeAsync(QueryRangeRequest query); - - Task SeriesQueryAsync(MetaDataQueryRequest query); - - Task LabelsQueryAsync(MetaDataQueryRequest query); - - Task LabelValuesQueryAsync(LableValueQueryRequest query); - - Task ExemplarQueryAsync(QueryExemplarRequest query); -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj deleted file mode 100644 index c972af60c..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs deleted file mode 100644 index e243e99a2..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -[assembly: InternalsVisibleTo("Masa.Utils.Data.Prometheus.Test")] -namespace Masa.Utils.Data.Prometheus; - -internal class MasaPrometheusClient : IMasaPrometheusClient -{ - private readonly ICallerProvider _caller; - private readonly JsonSerializerOptions _jsonSerializerOptions; - - public MasaPrometheusClient(ICallerProvider caller, JsonSerializerOptions jsonSerializerOptions) - { - _caller = caller; - _jsonSerializerOptions = jsonSerializerOptions; - } - - public async Task ExemplarQueryAsync(QueryExemplarRequest query) - { - return await QueryDataAsync("/api/v1/query_exemplars", query); - } - - public async Task LabelsQueryAsync(MetaDataQueryRequest query) - { - return await QueryDataAsync("/api/v1/labels", query); - } - - public async Task LabelValuesQueryAsync(LableValueQueryRequest query) - { - var name = query.Lable; - query.Lable = null; - return await QueryDataAsync($"/api/v1/label/{name}/values", query); - } - - public async Task QueryAsync(QueryRequest query) - { - return await QueryDataAsync("/api/v1/query", query); - } - - public async Task QueryRangeAsync(QueryRangeRequest query) - { - return await QueryDataAsync("/api/v1/query_range", query); - } - - public async Task SeriesQueryAsync(MetaDataQueryRequest query) - { - return await QueryDataAsync("/api/v1/series", query); - } - - private async Task QueryDataAsync(string url, object data) where T : ResultBaseResponse - { - var str = await _caller.GetAsync(url, data); - if (string.IsNullOrEmpty(str)) - return default!; - - var baseResult = JsonSerializer.Deserialize(str, _jsonSerializerOptions); - - if (baseResult == null || baseResult.Status != ResultStatuses.Success) - { - return baseResult ?? default!; - } - - if (typeof(T) == typeof(QueryResultCommonResponse)) - { - var result = baseResult as QueryResultCommonResponse; - if (result == null || result.Data == null) - return baseResult; - switch (result.Data.ResultType) - { - case ResultTypes.Matrix: - { - var temp = JsonSerializer.Serialize(result.Data.Result, _jsonSerializerOptions); - result.Data.Result = JsonSerializer.Deserialize(temp, _jsonSerializerOptions); - if (result.Data.Result != null && result.Data.Result.Any()) - { - foreach (QueryResultMatrixRangeResponse item in result.Data.Result) - { - if (item.Values == null || !item.Values.Any()) - continue; - var array = item.Values.ToArray(); - int i = 0, max = array.Length - 1; - do - { - array[i] = ConvertJsonToObjValue(array[i]); - i++; - } - while (max - i >= 0); - item.Values = array; - } - } - return result as T ?? default!; - } - case ResultTypes.Vector: - { - var temp = JsonSerializer.Serialize(result.Data.Result, _jsonSerializerOptions); - result.Data.Result = JsonSerializer.Deserialize(temp, _jsonSerializerOptions); - if (result.Data.Result != null && result.Data.Result.Any()) - { - foreach (QueryResultInstantVectorResponse item in result.Data.Result) - { - item.Value = ConvertJsonToObjValue(item.Value); - } - } - return result as T ?? default!; - } - default: - { - if (result.Data.Result != null && result.Data.Result.Any()) - { - result.Data.Result = ConvertJsonToObjValue(result.Data.Result); - } - } - break; - } - } - - return baseResult; - } - - private static object[] ConvertJsonToObjValue(object[]? values) - { - if (values == null || values.Length - 2 < 0) - return default!; - - return new object[] { ((JsonElement)values[0]).GetDouble(), ((JsonElement)values[1]).GetString() ?? default! }; - } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs deleted file mode 100644 index 2777b076a..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class ExemplarModel -{ - public IDictionary? Labels { get; set; } - - public string? Value { get; set; } - - public float TimeStamp { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs deleted file mode 100644 index 84ff5c61e..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class ExemplarDataModel -{ - public IDictionary? SeriesLabels { get; set; } - - public IEnumerable? Exemplars { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs deleted file mode 100644 index c03e8eee1..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class ExemplarResultResponse : ResultBaseResponse -{ - public IEnumerable? Data { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs deleted file mode 100644 index a20a25ca2..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class LabelResultResponse : ResultBaseResponse -{ - public IEnumerable? Data { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs deleted file mode 100644 index 6422449c5..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class SeriesResultResponse : ResultBaseResponse -{ - public IEnumerable>? Data { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs deleted file mode 100644 index 1859c35b5..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class QueryResultCommonResponse: ResultBaseResponse -{ - public QueryResultDataResponse? Data { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs deleted file mode 100644 index 209f6d573..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class QueryResultDataResponse -{ - public ResultTypes ResultType { get; set; } - - public object[]? Result { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs deleted file mode 100644 index 976986e28..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class QueryResultInstantVectorResponse -{ - public IDictionary? Metric { get; set; } - - public object[]? Value { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs deleted file mode 100644 index 810473d12..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class QueryResultMatrixRangeResponse -{ - public IDictionary? Metric { get; set; } - - public IEnumerable? Values { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs deleted file mode 100644 index 33381e613..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class ResultBaseResponse -{ - public ResultStatuses Status { get; set; } - - public string? Error { get; set; } - - public string? ErrorType { get; set; } - - public IEnumerable? Warnings { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs deleted file mode 100644 index b1089a15d..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class LableValueQueryRequest: MetaDataQueryRequest -{ - public string Lable { get; set; } = "__name__"; -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs deleted file mode 100644 index 00c3af561..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class MetaDataQueryRequest -{ - public IEnumerable? Match { get; set; } - - public string? Start { get; set; } - - public string? End { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs deleted file mode 100644 index b6b9a4be7..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class QueryExemplarRequest -{ - public string? Query { get; set; } - - public string? Start { get; set; } - - public string? End { get; set; } -} - diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs deleted file mode 100644 index 9d4926191..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class QueryRangeRequest -{ - public string? Query { get; set; } - - public string? Start { get; set; } - - public string? End { get; set; } - - public string? Step { get; set; } - - public string? TimeOut { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs deleted file mode 100644 index b1779587c..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Model; - -public class QueryRequest -{ - public string? Query { get; set; } - - public string? Time { get; set; } - - public string? TimeOut { get; set; } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.md b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.md deleted file mode 100644 index 94ad400db..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.md +++ /dev/null @@ -1,75 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Utils.Data.Prometheus - -[Prometheus Http Api](https://www.prometheus.io/docs/prometheus/latest/querying/api/) Client Library - -## Install: -```c# -Install-Package Masa.Utils.Data.Prometheus -``` - -### Example: - -1. Inject - -```` C# -builder.Services.AddPrometheusClient("http://127.0.0.1:9090"); -```` - -2. Query Example - -```C# -public class SampleService -{ - - private IMasaPrometheusClient _client; - - public SampleService(IMasaPrometheusClient client) - { - _client=client; - } - - public async Task QueryAsync() - { - var query= new QueryRequest { - Query = "up", //metric name - Time = "2022-06-01T09:00:00.000Z" //standard time format or unix timestamp, such as: 1654045200 or 1654045200.000 - }; - var result = await _client.QueryAsync(query); - if(result.Status == ResultStatuses.Success) - { - switch(result.Data.ResultType) - { - case ResultTypes.Vector: - { - var data=result.Data.Result as QueryResultInstantVectorResponse[]; - ... - } - break; - case ResultTypes.Matrix: - { - var data=result.Data.Result as QueryResultMatrixRangeResponse[]; - ... - } - break; - default: - { - var timeSpan=(double)result.Data.Result[0]; - var value=(string)result.Data.Result[1]; - } - break; - } - } - } -} -``` - -### Current suports: - -- [query](https://www.prometheus.io/docs/prometheus/latest/querying/api/#instant-queries) -- [query_range](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-queries) -- [series](https://www.prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers) -- [lables](https://www.prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names) -- [lable value](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values) -- [exemplars](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-exemplars) diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.zh-CN.md b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.zh-CN.md deleted file mode 100644 index b8c14ab1f..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/README.zh-CN.md +++ /dev/null @@ -1,75 +0,0 @@ -[EN](README.md) | 中 - -## Masa.Utils.Data.Prometheus - -[Prometheus Http Api](https://www.prometheus.io/docs/prometheus/latest/querying/api/) 客户端类库 - -## 安装: -```c# -Install-Package Masa.Utils.Data.Prometheus -``` - -### 示例: - -1. 注册 - -```` C# -builder.Services.AddPrometheusClient("http://127.0.0.1:9090"); -```` - -2. 查询样例 - -```C# -public class SampleService -{ - - private IMasaPrometheusClient _client; - - public SampleService(IMasaPrometheusClient client) - { - _client=client; - } - - public async Task QueryAsync() - { - var query= new QueryRequest { - Query = "up", //metric name - Time = "2022-06-01T09:00:00.000Z" //标准时间格式或unix时间戳,如:1654045200或1654045200.000 - }; - var result = await _client.QueryAsync(query); - if(result.Status == ResultStatuses.Success) - { - switch(result.Data.ResultType) - { - case ResultTypes.Vector: - { - var data=result.Data.Result as QueryResultInstantVectorResponse[]; - ... - } - break; - case ResultTypes.Matrix: - { - var data=result.Data.Result as QueryResultMatrixRangeResponse[]; - ... - } - break; - default: - { - var timeSpan=(double)result.Data.Result[0]; - var value=(string)result.Data.Result[1]; - } - break; - } - } - } -} -``` - -### 目前只支持以下api: - -- [query](https://www.prometheus.io/docs/prometheus/latest/querying/api/#instant-queries) -- [query_range](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-queries) -- [series](https://www.prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers) -- [lables](https://www.prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names) -- [lable value](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values) -- [exemplars](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-exemplars) diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs deleted file mode 100644 index 3b1ca0556..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus; - -public static class ServiceCollectionExtensions -{ - private const string PROMETHEUS_HTTP_CLIENT_NAME = "prometheus_client_name"; - - public static IServiceCollection AddPrometheusClient(this IServiceCollection services, string url) - { - ArgumentNullException.ThrowIfNull(url, nameof(url)); - - if (services.Any(service => service.GetType() == typeof(IMasaPrometheusClient))) - return services; - - services.AddCaller(builder => - { - builder.UseHttpClient(options => - { - options.BaseAddress = url; - options.Name = PROMETHEUS_HTTP_CLIENT_NAME; - }); - }); - - var jsonOptions = new JsonSerializerOptions - { - PropertyNameCaseInsensitive = true - }; - jsonOptions.Converters.Add(new JsonStringEnumConverter()); - - services.AddScoped(ServiceProvider => - { - var caller = ServiceProvider.GetRequiredService().CreateClient(PROMETHEUS_HTTP_CLIENT_NAME); - return new MasaPrometheusClient(caller, jsonOptions); - }); - return services; - } -} diff --git a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/_Imports.cs b/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/_Imports.cs deleted file mode 100644 index 0d8a7ec8a..000000000 --- a/src/Utils/Data/Prometheus/src/Masa.Utils.Data.Prometheus/_Imports.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Caller.Core; -global using Masa.Utils.Caller.HttpClient; -global using Masa.Utils.Data.Prometheus.Enums; -global using Masa.Utils.Data.Prometheus.Model; -global using Microsoft.Extensions.DependencyInjection; -global using System.Collections; -global using System.Reflection; -global using System.Runtime.CompilerServices; -global using System.Text; -global using System.Text.Json; -global using System.Text.Json.Serialization; -global using System.Web; diff --git a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs deleted file mode 100644 index 988a782e5..000000000 --- a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Test; - -[TestClass] -public class ObjectExtensionsTests -{ - [TestMethod] - [DataRow(1)] - [DataRow((byte)1)] - [DataRow((char)2)] - [DataRow((uint)3)] - [DataRow((long)4)] - [DataRow((float)5.6789)] - [DataRow(5.6789)] - [DataRow("string")] - public void SampleValueTest(object value) - { - var result = value.ToUrlParam(); - var str = value.ToString(); - Assert.AreEqual(str, result); - } - - [TestMethod] - public void StructTest() - { - var user = new UserStruct - { - Name = "Bob", - Age = 30, - Gender = "Male" - }; - - var result = user.ToUrlParam(); - var str = $"age={user.Age}&gender={user.Gender}&name={user.Name}"; - Assert.AreEqual(str, result); - - user.Name = "王占山"; - str = $"age={user.Age}&gender={user.Gender}&name={System.Web.HttpUtility.UrlEncode(user.Name, Encoding.UTF8)}"; - result = user.ToUrlParam(); - Assert.AreEqual(str, result); - } - - [TestMethod] - public void ClassTest() - { - var obj = new - { - a = "test", - d = (float)34.56, - ch = "中文说明", - t = ResultTypes.Scalar - }; - - var result = obj.ToUrlParam(isEnumString: true); - var str = $"a={obj.a}&ch={System.Web.HttpUtility.UrlEncode(obj.ch, Encoding.UTF8)}&d={obj.d}&t={obj.t}"; - Assert.AreEqual(str, result); - - result = obj.ToUrlParam(isEnumString: false); - str = $"a={obj.a}&ch={System.Web.HttpUtility.UrlEncode(obj.ch, Encoding.UTF8)}&d={obj.d}&t={(int)obj.t}"; - Assert.AreEqual(str, result); - - result = obj.ToUrlParam(isEnumString: false, isUrlEncode: false); - str = $"a={obj.a}&ch={obj.ch}&d={obj.d}&t={(int)obj.t}"; - Assert.AreEqual(str, result); - } - - [TestMethod] - public void ArrayTest() - { - var array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; - var result = array.ToUrlParam(isUrlEncode: false); - var str = string.Join("&[]=", array); - str = $"[]={str}"; - Assert.AreEqual(str, result); - } - - [TestMethod] - public void ObjArrayTest() - { - var array = new QueryRequest[] { - new QueryRequest{ - Query="where1", - Time="2021-01-02", - TimeOut="5s" - }, - new QueryRequest{ - Query="where2", - Time="2021-01-01", - TimeOut="5s" - } - }; - - var result = array.ToUrlParam(isUrlEncode: false); - var str = $"[].query={array[0].Query}&[].time={array[0].Time}&[].timeOut={array[0].TimeOut}"; - str += $"&[].query={array[1].Query}&[].time={array[1].Time}&[].timeOut={array[1].TimeOut}"; - Assert.AreEqual(str, result); - - var obj = new - { - Values = array - }; - result = obj.ToUrlParam(isUrlEncode: false); - str = $"values[].query={array[0].Query}&values[].time={array[0].Time}&values[].timeOut={array[0].TimeOut}"; - str += $"&values[].query={array[1].Query}&values[].time={array[1].Time}&values[].timeOut={array[1].TimeOut}"; - Assert.AreEqual(str, result); - } - - [TestMethod] - public void IEnumberTest() - { - var list = new List { 1, 2, 3, 4, 5, 6, 7, 8 }; - var result = list.ToUrlParam(isUrlEncode: false); - var str = string.Join("&[]=", list); - str = $"[]={str}"; - Assert.AreEqual(str, result); - } - - [TestMethod] - public void ObjListTest() - { - var array = new List { - new QueryRequest{ - Query="where1", - Time="2021-01-02", - TimeOut="5s" - }, - new QueryRequest{ - Query="where2", - Time="2021-01-01", - TimeOut="5s" - } - }; - - var result = array.ToUrlParam(isUrlEncode: false); - var str = $"[].query={array[0].Query}&[].time={array[0].Time}&[].timeOut={array[0].TimeOut}"; - str += $"&[].query={array[1].Query}&[].time={array[1].Time}&[].timeOut={array[1].TimeOut}"; - Assert.AreEqual(str, result); - - var obj = new - { - Values = array - }; - result = obj.ToUrlParam(isUrlEncode: false); - str = $"values[].query={array[0].Query}&values[].time={array[0].Time}&values[].timeOut={array[0].TimeOut}"; - str += $"&values[].query={array[1].Query}&values[].time={array[1].Time}&values[].timeOut={array[1].TimeOut}"; - Assert.AreEqual(str, result); - } - - [TestMethod] - public void KeyValueTest() - { - var dic = new Dictionary { - { "Name","David"}, - {"Age",30 }, - {"Sex","Male" } - }; - - var result = dic.ToUrlParam(); - var builder = new StringBuilder(); - var keys = dic.Keys.ToList(); - keys.Sort(); - foreach (var key in keys) - { - builder.Append($"&{key.ToCamelCase()}={dic[key]}"); - } - builder.Remove(0, 1); - Assert.AreEqual(builder.ToString(), result); - } -} diff --git a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs deleted file mode 100644 index 6c167dca3..000000000 --- a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Test; - -[TestClass] -public class StringExtensionsTests -{ - [TestMethod] - [DataRow(null)] - [DataRow("")] - [DataRow("name")] - [DataRow("Name")] - [DataRow("N")] - [DataRow("FirstName")] - public void CamelCaseTest(string str) - { - var result = str.ToCamelCase(); - if (string.IsNullOrEmpty(str)) - { - Assert.IsNull(result); - } - else - { - var camelStr = $"{str[0].ToString().ToLower()}{(str.Length - 1 > 0 ? str[1..] : "")}"; - Assert.AreEqual(camelStr, result); - } - - } -} diff --git a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj deleted file mode 100644 index fe19dfc2d..000000000 --- a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - net6.0 - enable - - false - - - - - - - - - - - - - - - diff --git a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs deleted file mode 100644 index 4dbea1025..000000000 --- a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Test; - -[TestClass] -public class MasaPrometheusClientTests -{ - private IMasaPrometheusClient _client; - - public MasaPrometheusClientTests() - { - IServiceCollection service = new ServiceCollection(); - service.AddPrometheusClient("http://localhost:9090"); - _client = service.BuildServiceProvider().GetService() ?? default!; - } - - [TestMethod] - [DataRow(null)] - [DataRow("up")] - [DataRow("not_exists")] - [DataRow("error data")] - public async Task TestQueryAsync(string query) - { - var result = await _client.QueryAsync(new QueryRequest - { - Query = query - }); - - Assert.IsNotNull(result); - if (string.IsNullOrEmpty(query) || query.Contains(' ')) - { - Assert.AreEqual(result.Status, ResultStatuses.Error); - } - else - { - if (query == "not_exists") - { - Assert.IsFalse(result.Data?.Result?.Any()); - } - else - { - Assert.IsTrue(result.Data?.Result?.Any()); - } - } - } - - [TestMethod] - public async Task TestQueryVectorAsync() - { - var result = await _client.QueryAsync(new QueryRequest - { - Query = "up" - }); - - if (result != null && result.Data != null && result.Data.Result != null) - { - var data = result.Data.Result as QueryResultInstantVectorResponse[]; - - Assert.IsNotNull(data); - Assert.IsNotNull(data[0].Metric); - Assert.IsNotNull(data[0].Value); - Assert.IsNotNull(data[0].Metric.Keys); - Assert.AreEqual(2, data[0].Value.Length); - } - } - - [TestMethod] - public async Task TestQueryRangeAsync() - { - var result = await _client.QueryRangeAsync(new QueryRangeRequest - { - Query = "up", - Start = "2022-06-17T02:00:00.000Z", - End = "2022-06-17T02:30:00.000Z", - Step = "300s", - }); - Assert.IsNotNull(result); - Assert.AreEqual(result.Status, ResultStatuses.Success); - Assert.IsNotNull(result.Data); - if (result.Data.ResultType == ResultTypes.Matrix) - { - var data = result.Data.Result as QueryResultMatrixRangeResponse[]; - Assert.IsNotNull(data); - Assert.IsNotNull(data[0].Metric); - Assert.IsNotNull(data[0].Values); - } - } - - [TestMethod] - public async Task TestSeriesQueryAsync() - { - var result = await _client.SeriesQueryAsync(new MetaDataQueryRequest - { - Match = new string[] { "up" }, - Start = "2022-06-17T02:00:00.000Z", - End = "2022-06-17T02:30:00.000Z" - }); - Assert.IsNotNull(result); - Assert.AreEqual(result.Status, ResultStatuses.Success); - } - - [TestMethod] - [DataRow(null)] - [DataRow(new string[] { "up" })] - [DataRow(new string[] { "not_exists" })] - [DataRow(new string[] { "error data" })] - public async Task TestLabelsQueryAsync(IEnumerable matches) - { - if (matches != null && matches.Any(s => s.Contains(' '))) - { - var result = await _client.LabelsQueryAsync(new MetaDataQueryRequest { Match = matches }); - Assert.AreEqual(result.Status, ResultStatuses.Error); - Assert.IsNotNull(result.Error); - } - else - { - var result = await _client.LabelsQueryAsync(default!); - Assert.IsNotNull(result); - Assert.AreEqual(result.Status, ResultStatuses.Success); - if (matches == null || matches.Any(s => s == "up")) - { - Assert.IsTrue(result.Data?.Any()); - } - else - { - Assert.IsFalse(result.Data?.Any()); - } - } - } - - [TestMethod] - public async Task TestLabelValuesQueryAsync() - { - var result = await _client.LabelValuesQueryAsync(new LableValueQueryRequest()); - Assert.IsNotNull(result); - Assert.AreEqual(result.Status, ResultStatuses.Success); - } - - [TestMethod] - [DataRow()] - public async Task TestExemplarQueryAsync() - { - var param = new QueryExemplarRequest - { - Query = "up", - Start = "2022-06-17T02:00:00.000Z", - End = "2022-06-17T02:30:00.000Z" - }; - var result = await _client.ExemplarQueryAsync(param); - Assert.IsNotNull(result); - Assert.AreEqual(result.Status, ResultStatuses.Success); - } -} diff --git a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs deleted file mode 100644 index a1ea1f6ea..000000000 --- a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/UserStruct.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Data.Prometheus.Test; - -public struct UserStruct -{ - public string Name { get; set; } - - public int Age { get; set; } - - public string Gender { get; set; } -} diff --git a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs b/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs deleted file mode 100644 index 3b98df19e..000000000 --- a/src/Utils/Data/Prometheus/test/Masa.Utils.Data.Prometheus.Test/_Imports.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Data.Prometheus.Enums; -global using Masa.Utils.Data.Prometheus.Model; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System; -global using System.Collections.Generic; -global using System.Linq; -global using System.Text; -global using System.Threading.Tasks; diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs deleted file mode 100644 index e29c63771..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.AspNetCore; - -public class DaprBackgroundService : BackgroundService -{ - private readonly IAppPortProvider _appPortProvider; - private readonly IDaprProcess _daprProcess; - private readonly DaprOptions _options; - private readonly IHostApplicationLifetime _hostApplicationLifetime; - private readonly ILogger? _logger; - - public DaprBackgroundService( - IAppPortProvider appPortProvider, - IDaprProcess daprProcess, - IOptionsMonitor options, - IHostApplicationLifetime hostApplicationLifetime, - ILogger? logger) - { - _appPortProvider = appPortProvider; - _daprProcess = daprProcess; - _options = options.CurrentValue; - options.OnChange(daprOptions => - { - daprOptions.AppPort ??= _appPortProvider.GetAppPort(daprOptions.EnableSsl); - _daprProcess.Refresh(daprOptions); - }); - _hostApplicationLifetime = hostApplicationLifetime; - _logger = logger; - } - - protected override async Task ExecuteAsync(CancellationToken stoppingToken) - { - if (!await WaitForAppStartup(_hostApplicationLifetime, stoppingToken)) - return; - - // if cancellation was requested, stop - if (stoppingToken.IsCancellationRequested) - { - _logger?.LogInformation("{Name} is Stopping...", nameof(DaprBackgroundService)); - _daprProcess.Stop(stoppingToken); - } - else - { - _logger?.LogInformation("{Name} is Starting ...", nameof(DaprBackgroundService)); - _options.AppPort ??= _appPortProvider.GetAppPort(_options.EnableSsl); - _daprProcess.Start(_options, stoppingToken); - } - } - - static async Task WaitForAppStartup(IHostApplicationLifetime hostApplicationLifetime, CancellationToken stoppingToken) - { - var startedSource = new TaskCompletionSource(); - var cancelledSource = new TaskCompletionSource(); - - await using var startedCancellationTokenRegistration = - hostApplicationLifetime.ApplicationStarted.Register(() => startedSource.SetResult()); - await using var cancellationTokenRegistration = stoppingToken.Register(() => cancelledSource.SetResult()); - - Task completedTask = await Task.WhenAny(startedSource.Task, cancelledSource.Task).ConfigureAwait(false); - - // If the completed tasks was the "app started" task, return true, otherwise false - return completedTask == startedSource.Task; - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs deleted file mode 100644 index fed607320..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.AspNetCore; - -public class DefaultAppPortProvider : IAppPortProvider -{ - private readonly IServer _server; - - public DefaultAppPortProvider(IServer server) => _server = server; - - public ushort GetAppPort(bool? enableSsl) - { - var addresses = _server.Features.Get()?.Addresses; - if (addresses is { IsReadOnly: false, Count: 0 }) - throw new Exception("Failed to get the startup port, please specify the port manually"); - - var ports = addresses! - .Select(address => new Uri(address)) - .Where(address - => (enableSsl is true && address.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)) - || address.Scheme.Equals(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase)) - .Select(address => new - { - address.Scheme, - address.Port - }).ToList(); - - if (enableSsl is true) - { - return ports - .Where(p => p.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)) - .Select(p => (ushort)p.Port) - .FirstOrDefault(); - } - - return ports - .Where(p => p.Scheme.Equals(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase)) - .Select(p => (ushort)p.Port) - .FirstOrDefault(); - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs deleted file mode 100644 index 8dc3e765d..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.AspNetCore; - -public interface IAppPortProvider -{ - ushort GetAppPort(bool? enableSsl); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj deleted file mode 100644 index 5774c7add..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.md b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.md deleted file mode 100644 index 70baec004..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.md +++ /dev/null @@ -1,59 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Utils.Development.Dapr.AspNetCore - -Responsibilities: - -Assist in managing the dapr process to reduce the dependency on docker compose during development - -### Basic usage: - -1. Install Masa.Utils.Development.Dapr.AspNetCore -``` C# -Install-Package Masa.Utils.Development.Dapr.AspNetCore -``` - -2. Add DaprStarter to assist in managing the dapr process (recommended to be used in the development environment) - -``` C# -builder.Services.AddDaprStarter(); -``` - -### Advanced usage: - -1. Specify the configuration in the code - -``` C# -builder.Services.AddDaprStarter(opt => -{ - opt.AppId = "masa-dapr-test"; - opt.AppPort = 5001; - opt.AppIdSuffix = ""; - opt.DaprHttpPort = 8080; - opt.DaprGrpcPort = 8081; -}); -``` - -2. The configuration file specifies the configuration - -First step: - -``` appsettings.json -{ - "DaprOptions": { - "AppId": "masa-dapr-test", - "AppPort": 5001, - "AppIdSuffix": "", - "DaprHttpPort": 8080, - "DaprGrpcPort": 8081 - } -} -``` - -Step 2: - -``` C# -builder.Services.AddDaprStarter(builder.Configuration.GetSection("DaprOptions"); -``` - -Advantages: After the configuration is changed, the dapr process is restarted and updated, and the project does not need to be restarted diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md deleted file mode 100644 index 0f87ee42c..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md +++ /dev/null @@ -1,59 +0,0 @@ -中 | [EN](README.md) - -## Masa.Utils.Development.Dapr.AspNetCore - -职责: - -协助管理dapr进程,用于开发时减少对docker compose的依赖 - -### 基本用法: - -1. 安装Masa.Utils.Development.Dapr.AspNetCore -```C# -Install-Package Masa.Utils.Development.Dapr.AspNetCore -``` - -2. 添加DaprStarter协助管理dapr进程(建议在开发环境使用) - -```C# -builder.Services.AddDaprStarter(); -``` - -### 高级用法: - -1. 代码中指定配置 - -```C# -builder.Services.AddDaprStarter(opt => -{ - opt.AppId = "masa-dapr-test"; - opt.AppPort = 5001; - opt.AppIdSuffix = ""; - opt.DaprHttpPort = 8080; - opt.DaprGrpcPort = 8081; -}); -``` - -2. 配置文件指定配置 - -第一步: - -``` appsettings.json -{ - "DaprOptions": { - "AppId": "masa-dapr-test", - "AppPort": 5001, - "AppIdSuffix": "", - "DaprHttpPort": 8080, - "DaprGrpcPort": 8081 - } -} -``` - -第二步: - -``` C# -builder.Services.AddDaprStarter(builder.Configuration.GetSection("DaprOptions")); -``` - -优势:支持配置变更后,dapr 进程重启更新,项目无需重新启动 diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs deleted file mode 100644 index 8c8cb20dc..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddDaprStarter(this IServiceCollection services) - => services.AddDaprStarter(_ => - { - }); - - public static IServiceCollection AddDaprStarter( - this IServiceCollection services, - Action daprOptionAction, - bool isDelay = true) - { - ArgumentNullException.ThrowIfNull(daprOptionAction, nameof(daprOptionAction)); - - return services.AddDaprStarter(() => - { - services.AddDaprStarterCore(daprOptionAction); - }, isDelay); - } - - public static IServiceCollection AddDaprStarter( - this IServiceCollection services, - IConfiguration configuration, - bool isDelay = true) - { - return services.AddDaprStarter(() => - { - services.AddDaprStarterCore(configuration); - }, isDelay); - } - - private static IServiceCollection AddDaprStarter(this IServiceCollection services, Action action, bool isDelay = true) - { - if (services.Any(service => service.ImplementationType == typeof(DaprService))) - return services; - - services.AddSingleton(); - - services.AddSingleton(); - action.Invoke(); - if (isDelay) - return services.AddHostedService(); - - var serviceProvider = services.BuildServiceProvider(); - var options = serviceProvider.GetRequiredService>(); - - ArgumentNullException.ThrowIfNull(options.CurrentValue.AppPort, nameof(options.CurrentValue.AppPort)); - var daprProcess = serviceProvider.GetRequiredService(); - options.OnChange(daprOptions => - { - daprProcess.Refresh(daprOptions); - }); - daprProcess.Start(options.CurrentValue); - CompleteDaprEnvironment(options.CurrentValue.DaprHttpPort, options.CurrentValue.DaprGrpcPort); - return services; - } - - private static void CompleteDaprEnvironment(ushort? daprHttpPort, ushort? daprGrpcPort) - { - if (daprHttpPort == null || daprGrpcPort == null) - return; - - EnvironmentExtensions.TryAdd("DAPR_GRPC_PORT", daprGrpcPort.ToString, out _); - EnvironmentExtensions.TryAdd("DAPR_HTTP_PORT", daprHttpPort.ToString, out _); - } - - private class DaprService - { - - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs deleted file mode 100644 index 5509a71e7..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Development.Dapr; -global using Masa.Utils.Development.Dapr.AspNetCore; -global using Microsoft.AspNetCore.Hosting.Server; -global using Microsoft.AspNetCore.Hosting.Server.Features; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.Hosting; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/CommandLineBuilder.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/CommandLineBuilder.cs deleted file mode 100644 index f6eda87fe..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/CommandLineBuilder.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -public class CommandLineBuilder -{ - public string Prefix { get; } - - public List Arguments { get; set; } - - public CommandLineBuilder(string prefix) - { - Prefix = prefix; - Arguments = new(); - } - - public CommandLineBuilder Add(string name, string value, bool isSkip = false) - { - if (!isSkip) - { - Arguments.Add($"{Prefix}{name} {value}"); - } - - return this; - } - - public override string ToString() => string.Join(' ', Arguments); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs deleted file mode 100644 index 4eb49996d..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Configurations; - -public class DaprRuntimeOptions -{ - [JsonPropertyName("appId")] - public string AppId { get; set; } = default!; - - [JsonPropertyName("httpPort")] - public ushort HttpPort { get; set; } = default!; - - [JsonPropertyName("grpcPort")] - public ushort GrpcPort { get; set; } = default!; - - [JsonPropertyName("appPort")] - public ushort AppPort { get; set; } = default!; - - [JsonPropertyName("metricsEnabled")] - public bool MetricsEnabled { get; set; } = default!; - - [JsonPropertyName("command")] - public string Command { get; set; } = default!; - - [JsonPropertyName("pid")] - public int PId { get; set; } = default!; -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprExtensions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprExtensions.cs deleted file mode 100644 index 248d977db..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprExtensions.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -public static class DaprExtensions -{ - public static string DefaultAppId => ((Assembly.GetEntryAssembly() ?? Assembly.GetCallingAssembly()).GetName().Name ?? - throw new NotSupportedException("dapr appid is not empty")).Replace(".", Const.DEFAULT_APPID_DELIMITER); - - /// - /// Appid suffix, the default is the current MAC address - /// - public static readonly string DefaultAppidSuffix = NetworkUtils.GetPhysicalAddress(); - - /// - /// Get dapr AppId by appid and suffix - /// - /// custom appId - /// appid suffix, When appidSuffix is empty, Dapr appId is custom appId, When appidSuffix is null, appidSuffix is MAC address, default: null - /// separator used to splice custom appId and appIdSuffix, default: - - /// - /// - public static string GetAppId(string appId, string? appidSuffix = null, string appIdDelimiter = Const.DEFAULT_APPID_DELIMITER) - { - ArgumentNullException.ThrowIfNull(appIdDelimiter, nameof(appIdDelimiter)); - - if (appidSuffix == null) - appidSuffix = DefaultAppidSuffix; - else if (appidSuffix.Trim() == string.Empty) - return appId; - - return GetAppIdCore(appId, appidSuffix, appIdDelimiter); - } - - private static string GetAppIdCore(string appId, string appidSuffix, string appIdDelimiter) - { - if (appIdDelimiter == ".") - throw new NotSupportedException("AppIdDelimiter is not supported as ."); - - return $"{appId}{appIdDelimiter}{appidSuffix}"; - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprOptions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprOptions.cs deleted file mode 100644 index 903ec4e5a..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprOptions.cs +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -/// -/// dapr startup configuration information -/// When the specified attribute is configured as null, the default value of the parameter is subject to the default value of dapr of the current version -/// -public class DaprOptions -{ - private string _appid = DaprExtensions.DefaultAppId; - - /// - /// The id for your application, used for service discovery - /// Required, no blanks allowed - /// - public string AppId - { - get => _appid; - set - { - ArgumentNullException.ThrowIfNull(value, nameof(AppId)); - - _appid = value; - } - } - - private string _appIdDelimiter = Const.DEFAULT_APPID_DELIMITER; - - /// - /// Separator used to splice AppId and AppIdSuffix - /// default:- , AppIdDelimiter not support . - /// - public string AppIdDelimiter - { - get => _appIdDelimiter; - set - { - if (value == ".") - { - throw new NotSupportedException("AppIdDelimiter is not supported as ."); - } - - _appIdDelimiter = value; - } - } - - private string _appIdSuffix = DaprExtensions.DefaultAppidSuffix; - - /// - /// Appid suffix - /// optional. the default is the current MAC address - /// - public string AppIdSuffix - { - get => _appIdSuffix; - set - { - if (value == ".") - { - throw new NotSupportedException("AppIdSuffix is not supported as ."); - } - - _appIdSuffix = value; - } - } - - private int? _maxConcurrency; - - /// - /// The concurrency level of the application, otherwise is unlimited - /// - public int? MaxConcurrency - { - get => _maxConcurrency; - set - { - if (value is <= 0) - { - throw new NotSupportedException($"{nameof(MaxConcurrency)} must be greater than 0 ."); - } - - _maxConcurrency = value; - } - } - - private ushort? _appPort; - - /// - /// The port your application is listening on - /// - public ushort? AppPort - { - get => _appPort; - set - { - if (value is <= 0) - throw new NotSupportedException($"{nameof(AppPort)} must be greater than 0 ."); - - _appPort = value; - } - } - - /// - /// The protocol (gRPC or HTTP) Dapr uses to talk to the application. Valid values are: http or grpc - /// - public Protocol? AppProtocol { get; set; } - - /// - /// Enable https when Dapr invokes the application - /// - public bool? EnableSsl { get; set; } - - /// - /// Dapr configuration file - /// default: - /// Linux & Mac: $HOME/.dapr/config.yaml - /// Windows: %USERPROFILE%\.dapr\config.yaml - /// - public string? Config { get; set; } - - /// - /// The path for components directory - /// default: - /// Linux & Mac: $HOME/.dapr/components - /// Windows: %USERPROFILE%\.dapr\components - /// - public string? ComponentPath { get; set; } - - private ushort? _daprGrpcPort; - - /// - /// The gRPC port for Dapr to listen on - /// - public ushort? DaprGrpcPort - { - get => _daprGrpcPort; - set - { - if (value is <= 0) - throw new NotSupportedException($"{nameof(DaprGrpcPort)} must be greater than 0 ."); - - _daprGrpcPort = value; - } - } - - private ushort? _daprHttpPort; - - /// - /// The HTTP port for Dapr to listen on - /// - public ushort? DaprHttpPort - { - get => _daprHttpPort; - set - { - if (value is <= 0) - throw new NotSupportedException($"{nameof(DaprHttpPort)} must be greater than 0 ."); - - _daprHttpPort = value; - } - } - - /// - /// Enable pprof profiling via an HTTP endpoint - /// - public bool? EnableProfiling { get; set; } - - /// - /// The image to build the code in. Input is: repository/image - /// - public string? Image { get; set; } - - /// - /// The log verbosity. Valid values are: debug, info, warn, error, fatal, or panic - /// default: info - /// - public LogLevel? LogLevel { get; set; } - - /// - /// default: localhost - /// - public string? PlacementHostAddress { get; set; } - - /// - /// Address for the Sentry CA service - /// - public string? SentryAddress { get; set; } - - private ushort? _metricsPort; - - /// - /// The port that Dapr sends its metrics information to - /// - public ushort? MetricsPort - { - get => _metricsPort; - set - { - if (value is <= 0) - throw new NotSupportedException($"{nameof(MetricsPort)} must be greater than 0 ."); - - _metricsPort = value; - } - } - - private ushort? _profilePort; - - /// - /// The port for the profile server to listen on - /// - public ushort? ProfilePort - { - get => _profilePort; - set - { - if (value is <= 0) - throw new NotSupportedException($"{nameof(ProfilePort)} must be greater than 0 ."); - - _profilePort = value; - } - } - - /// - /// Path to a unix domain socket dir mount. If specified - /// communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports - /// Not available on Windows OS - /// - public string? UnixDomainSocket { get; set; } - - private int? _daprMaxRequestSize; - - /// - /// Max size of request body in MB. - /// - public int? DaprMaxRequestSize - { - get => _daprMaxRequestSize; - set - { - if (value is <= 0) - throw new NotSupportedException($"{nameof(DaprMaxRequestSize)} must be greater than 0 ."); - - _daprMaxRequestSize = value; - } - } - - private int _heartBeatInterval = Const.DEFAULT_HEARTBEAT_INTERVAL; - - /// - /// Heartbeat detection interval, used to detect dapr status - /// default: 5000 ms - /// - public int? HeartBeatInterval - { - get => _heartBeatInterval; - set - { - if (value < 0) - throw new NotSupportedException($"{nameof(DaprMaxRequestSize)} must be greater than or equal to 0 ."); - - _heartBeatInterval = value ?? Const.DEFAULT_HEARTBEAT_INTERVAL; - } - } - - /// - /// Start the heartbeat check to ensure that the dapr program is active. - /// When the heartbeat check is turned off, dapr will not start automatically after it exits abnormally. - /// - public bool EnableHeartBeat { get; set; } = true; - - public bool CreateNoWindow { get; set; } = true; - - public string GetAppId() => DaprExtensions.GetAppId(AppId, AppIdSuffix, AppIdDelimiter); - - public ushort GetAppPort() => - AppPort ?? throw new ArgumentNullException(nameof(AppPort)); - - public event DaprEventHandler? OutputDataReceived; - - public void Output(string type, string data) => OutputDataReceived?.Invoke(type, data); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProcess.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProcess.cs deleted file mode 100644 index 7545b752b..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProcess.cs +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -public class DaprProcess : IDaprProcess -{ - private readonly object _lock = new(); - - private readonly IDaprProvider _daprProvider; - private readonly IProcessProvider _processProvider; - private readonly ILoggerFactory? _loggerFactory; - private readonly ILogger? _logger; - private IProcess? _process; - private DaprProcessStatus Status { get; set; } - private System.Timers.Timer? _heartBeatTimer; - private DaprCoreOptions? _successDaprOptions; - private int _retryTime; - - /// - /// record whether dapr is initialized for the first time - /// - private bool _isFirst = true; - - public DaprProcess(IDaprProvider daprProvider, IProcessProvider processProvider, ILoggerFactory? loggerFactory) - { - _daprProvider = daprProvider; - _processProvider = processProvider; - _loggerFactory = loggerFactory; - _logger = _loggerFactory?.CreateLogger(); - } - - public void Start(DaprOptions options, CancellationToken cancellationToken = default) - { - lock (_lock) - { - StartCore(GetDaprOptions(options), cancellationToken); - } - } - - private void StartCore(DaprCoreOptions options, CancellationToken cancellationToken = default) - { - UpdateStatus(DaprProcessStatus.Starting); - var commandLineBuilder = Initialize(options, cancellationToken); - StopCore(_successDaprOptions, cancellationToken); - - var utils = new ProcessUtils(_loggerFactory); - - utils.OutputDataReceived += delegate(object? sender, DataReceivedEventArgs args) - { - if (_isFirst) - { - CompleteDaprOptions(options, () => _isFirst = false); - } - DaprProcess_OutputDataReceived(sender, args); - }; - utils.ErrorDataReceived += DaprProcess_ErrorDataReceived; - utils.Exit += delegate - { - UpdateStatus(DaprProcessStatus.Stopped); - _logger?.LogDebug("{Name} process has exited", Const.DEFAULT_FILE_NAME); - }; - _retryTime = 0; - var process = utils.Run(Const.DEFAULT_FILE_NAME, $"run {commandLineBuilder}", options.CreateNoWindow); - _process = new SystemProcess(process); - if (_heartBeatTimer == null && options.EnableHeartBeat) - { - _heartBeatTimer = new System.Timers.Timer - { - AutoReset = true, - Interval = options.HeartBeatInterval - }; - _heartBeatTimer.Elapsed += (sender, args) => HeartBeat(cancellationToken); - _heartBeatTimer.Start(); - } - } - - private static void DaprProcess_OutputDataReceived(object? sender, DataReceivedEventArgs e) - { - if (e.Data == null) return; - - var dataSpan = e.Data.AsSpan(); - var levelStartIndex = e.Data.IndexOf("level=", StringComparison.Ordinal) + 6; - var level = "information"; - if (levelStartIndex > 5) - { - var levelLength = dataSpan.Slice(levelStartIndex).IndexOf(' '); - level = dataSpan.Slice(levelStartIndex, levelLength).ToString(); - } - - var color = Console.ForegroundColor; - switch (level) - { - case "warning": - Console.ForegroundColor = ConsoleColor.Yellow; - break; - case "error": - case "critical": - case "fatal": - Console.ForegroundColor = ConsoleColor.Red; - break; - default: - break; - } - - Console.WriteLine(e.Data); - Console.ForegroundColor = color; - } - - private static void DaprProcess_ErrorDataReceived(object? sender, DataReceivedEventArgs e) - { - if (e.Data == null) return; - - var color = Console.ForegroundColor; - Console.ForegroundColor = ConsoleColor.Red; - Console.WriteLine(e.Data); - Console.ForegroundColor = color; - } - - public void Stop(CancellationToken cancellationToken = default) - { - lock (_lock) - { - StopCore(_successDaprOptions, cancellationToken); - } - } - - private void StopCore(DaprCoreOptions? options, CancellationToken cancellationToken = default) - { - _process?.Kill(); - if (options != null) - { - List daprList = _daprProvider.GetDaprList(options.AppId); - if (daprList.Any()) - { - foreach (var dapr in daprList) - { - _process = _processProvider.GetProcess(dapr.PId); - _process.Kill(); - } - } - if (options.DaprHttpPort != null) - CheckPortAndKill(options.DaprHttpPort.Value); - if (options.DaprGrpcPort != null) - CheckPortAndKill(options.DaprGrpcPort.Value); - } - } - - /// - /// Refresh the dapr configuration, the source dapr process will be killed and the new dapr process will be restarted - /// todo: At present, there are no restrictions on HttpPort and GrpcPort, but if the configuration update changes HttpPort and GrpcPort, the port obtained by DaprClient will be inconsistent with the actual operation, which needs to be adjusted later. - /// - /// - /// - public void Refresh(DaprOptions options, CancellationToken cancellationToken = default) - { - lock (_lock) - { - _logger?.LogDebug("Dapr configuration refresh, appid is {appid}, please wait...", _successDaprOptions!.AppId); - - if (_successDaprOptions != null) - { - UpdateStatus(DaprProcessStatus.Restarting); - _logger?.LogDebug("Dapr configuration refresh, appid is {appid}, closing dapr, please wait...", - _successDaprOptions!.AppId); - StopCore(_successDaprOptions, cancellationToken); - } - - _isFirst = true; - _successDaprOptions = null; - _process = null; - _logger?.LogDebug("Dapr configuration refresh, appid is {appid}, restarting dapr, please wait...", options.AppId); - StartCore(GetDaprOptions(options), cancellationToken); - } - } - - private void CheckPortAndKill(ushort port) - { - if (!_processProvider.IsAvailablePorts(port)) - { - var pIdList = _processProvider.GetPidByPort(port); - foreach (var pId in pIdList) - { - var process = _processProvider.GetProcess(pId); - _logger?.LogWarning("Port {Port} is used, PId: {PId}, PName: {PName} , Process has been killed by {Name}", - port, - pId, - process.Name, - nameof(Dapr)); - process.Kill(); - } - } - } - - private void HeartBeat(CancellationToken cancellationToken) - { - lock (_lock) - { - if (!_daprProvider.IsExist(_successDaprOptions!.AppId)) - { - if (Status == DaprProcessStatus.Started || Status == DaprProcessStatus.Stopped) - { - _logger?.LogWarning("Dapr stopped, restarting, please wait..."); - StartCore(_successDaprOptions, cancellationToken); - } - else if (Status == DaprProcessStatus.Starting) - { - if (_retryTime < Const.DEFAULT_RETRY_TIME) - { - _retryTime++; - _logger?.LogDebug("Dapr is not started: The {retries}th heartbeat check. AppId is {AppId}", - _retryTime, - _successDaprOptions.AppId); - } - else - { - _logger?.LogWarning( - "Dapr is not started: The {retries}th heartbeat check. Dapr stopped, restarting, please wait...", - _retryTime + 1); - StartCore(_successDaprOptions, cancellationToken); - } - } - else - { - _logger?.LogWarning("Dapr is restarting, the current state is {State}, please wait...", Status); - } - } - else - { - _retryTime = 0; - UpdateStatus(DaprProcessStatus.Started); - } - } - } - - private DaprCoreOptions GetDaprOptions(DaprOptions options) - { - string appId = options.GetAppId(); - ushort appPort = options.GetAppPort(); - DaprCoreOptions dataOptions = new( - appId, - appPort, - options.AppProtocol, - options.EnableSsl, - options.DaprGrpcPort, - options.DaprHttpPort, - options.EnableHeartBeat, - options.HeartBeatInterval!.Value, - options.CreateNoWindow) - { - MaxConcurrency = options.MaxConcurrency, - Config = options.Config, - ComponentPath = options.ComponentPath, - EnableProfiling = options.EnableProfiling, - Image = options.Image, - LogLevel = options.LogLevel, - PlacementHostAddress = options.PlacementHostAddress, - SentryAddress = options.PlacementHostAddress, - MetricsPort = options.MetricsPort, - ProfilePort = options.ProfilePort, - UnixDomainSocket = options.UnixDomainSocket, - DaprMaxRequestSize = options.DaprMaxRequestSize - }; - dataOptions.OutputDataReceived += options.Output; - return dataOptions; - } - - private CommandLineBuilder Initialize(DaprCoreOptions options, CancellationToken cancellationToken) - { - var commandLineBuilder = new CommandLineBuilder(Const.DEFAULT_ARGUMENT_PREFIX); - commandLineBuilder - .Add("app-id", options.AppId) - .Add("app-port", options.AppPort.ToString()) - .Add("app-protocol", options.AppProtocol?.ToString().ToLower() ?? string.Empty, options.AppProtocol == null) - .Add("app-ssl", options.EnableSsl?.ToString().ToLower() ?? "", options.EnableSsl == null) - .Add("components-path", options.ComponentPath ?? string.Empty, options.ComponentPath == null) - .Add("app-max-concurrency", options.MaxConcurrency?.ToString() ?? string.Empty, options.MaxConcurrency == null) - .Add("config", options.Config ?? string.Empty, options.Config == null) - .Add("dapr-grpc-port", options.DaprGrpcPort?.ToString() ?? string.Empty, options.DaprGrpcPort == null) - .Add("dapr-http-port", options.DaprHttpPort?.ToString() ?? string.Empty, options.DaprHttpPort == null) - .Add("enable-profiling", options.EnableProfiling?.ToString().ToLower() ?? string.Empty, options.EnableProfiling == null) - .Add("image", options.Image ?? string.Empty, options.Image == null) - .Add("log-level", options.LogLevel?.ToString().ToLower() ?? string.Empty, options.LogLevel == null) - .Add("placement-host-address", options.PlacementHostAddress ?? string.Empty, options.PlacementHostAddress == null) - .Add("sentry-address", options.SentryAddress ?? string.Empty, options.SentryAddress == null) - .Add("metrics-port", options.MetricsPort?.ToString() ?? string.Empty, options.MetricsPort == null) - .Add("profile-port", options.ProfilePort?.ToString() ?? string.Empty, options.ProfilePort == null) - .Add("unix-domain-socket", options.UnixDomainSocket ?? string.Empty, options.UnixDomainSocket == null) - .Add("dapr-http-max-request-size", options.DaprMaxRequestSize?.ToString() ?? string.Empty, options.DaprMaxRequestSize == null); - - _successDaprOptions ??= options; - return commandLineBuilder; - } - - /// - /// Improve the information of HttpPort and GrpcPort successfully configured. - /// When Port is specified or Dapr is closed for other reasons after startup, the HttpPort and GrpcPort are the same as the Port assigned at the first startup. - /// - private void CompleteDaprOptions(DaprCoreOptions options, Action action) - { - int retry = 0; - if (_successDaprOptions!.DaprHttpPort == null || _successDaprOptions.DaprGrpcPort == null) - { - again: - var daprList = _daprProvider.GetDaprList(_successDaprOptions.AppId); - if (daprList.Any()) - { - var currentDapr = daprList.FirstOrDefault()!; - _successDaprOptions.SetPort(currentDapr.HttpPort, currentDapr.GrpcPort); - } - else - { - if (retry < 3) - { - retry++; - goto again; - } - _logger?.LogWarning("Dapr failed to start, appid is {Appid}", _successDaprOptions!.AppId); - return; - } - } - - string daprHttpPort = _successDaprOptions.DaprHttpPort.ToString()!; - string daprGrpcPort = _successDaprOptions.DaprGrpcPort.ToString()!; - CompleteDaprEnvironment(daprHttpPort, daprGrpcPort, out bool isChange); - action.Invoke(); - if (isChange) - { - options.Output(Const.CHANGE_DAPR_ENVIRONMENT_VARIABLE, - $"update environment variables, DaprHttpPort: {daprHttpPort}, DAPR_GRPC_PORT: {daprGrpcPort}"); - } - } - - private void UpdateStatus(DaprProcessStatus status) - { - if (status != Status) - { - _logger?.LogDebug($"Dapr Process Status Change: {Status} -> {status}"); - Status = status; - } - } - - private static void CompleteDaprEnvironment(string daprHttpPort, string daprGrpcPort, out bool isChange) - { - EnvironmentExtensions.TryAdd("DAPR_GRPC_PORT", () => daprGrpcPort, out bool gRpcPortIsExist); - EnvironmentExtensions.TryAdd("DAPR_HTTP_PORT", () => daprHttpPort, out bool httpPortIsExist); - isChange = !gRpcPortIsExist || !httpPortIsExist; - } - - public void Dispose() => Stop(); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProvider.cs deleted file mode 100644 index dffa9f5ce..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/DaprProvider.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -public class DaprProvider : IDaprProvider -{ - private readonly ILogger? _logger; - private ProcessUtils _processUtils; - - public DaprProvider(ILoggerFactory? loggerFactory) - { - _logger = loggerFactory?.CreateLogger(); - _processUtils = new ProcessUtils(loggerFactory); - } - - public List GetDaprList(string appId) - { - _processUtils.Exit += delegate - { - _logger?.LogDebug("{Name} process has exited", Const.DEFAULT_FILE_NAME); - }; - _processUtils.Run(Const.DEFAULT_FILE_NAME, "list -o json", out string response, true, true); - List daprList = new(); - try - { - if (response.StartsWith("[")) - { - daprList = System.Text.Json.JsonSerializer.Deserialize>(response) ?? new(); - } - else if (response.StartsWith("{")) - { - var option = System.Text.Json.JsonSerializer.Deserialize(response); - if (option != null) - { - daprList.Add(option); - } - } - else - { - _logger?.LogWarning("----- Failed to get currently running dapr"); - } - } - catch (Exception exception) - { - _logger?.LogWarning(exception, "----- Error getting list of running dapr, response message is {response}", response); - return new List(); - } - return daprList.Where(dapr => dapr.AppId == appId).ToList(); - } - - public bool IsExist(string appId) - { - return GetDaprList(appId).Any(); - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs deleted file mode 100644 index 80b10cccf..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -public static class EnvironmentExtensions -{ - public static void TryAdd(string environment, Func func, out bool isExist) - { - var value = Environment.GetEnvironmentVariable(environment); - isExist = value == null; - if (isExist) - { - Environment.SetEnvironmentVariable(environment, func.Invoke()); - } - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProcess.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProcess.cs deleted file mode 100644 index 8f54fe5b2..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProcess.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -public interface IDaprProcess : IDisposable -{ - void Start(DaprOptions options, CancellationToken cancellationToken = default); - - void Stop(CancellationToken cancellationToken = default); - - /// - /// Refresh the dapr configuration, the source dapr process will be killed and the new dapr process will be restarted - /// - /// - /// - void Refresh(DaprOptions options, CancellationToken cancellationToken = default); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProvider.cs deleted file mode 100644 index e7d2a1e2f..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/IDaprProvider.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -public interface IDaprProvider -{ - List GetDaprList(string appId); - - bool IsExist(string appId); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs deleted file mode 100644 index 5ce5e4294..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Internal; - -public class CommandArgumentBuilder -{ - private const string DEFAULT_ARGUMENT_SEPARATOR = " "; - private const string DEFAULT_ARGUMENT_PREFIX = "--"; - - private Dictionary _arguments = new(); - - public string ArgumemtPrefix { get; } - - private string _argumentSeparator = default!; - - public string ArgumentSeparator - { - get => _argumentSeparator; - set => _argumentSeparator = string.IsNullOrEmpty(value) ? DEFAULT_ARGUMENT_SEPARATOR : value; - } - - public CommandArgumentBuilder(string? argumentPrefix = null) - { - ArgumemtPrefix = string.IsNullOrEmpty(argumentPrefix) ? DEFAULT_ARGUMENT_PREFIX : argumentPrefix; - ArgumentSeparator = DEFAULT_ARGUMENT_SEPARATOR; - } - - public CommandArgumentBuilder Add(string name, object? value = null) - { - if (value == null || string.IsNullOrEmpty(name)) - { - return this; - } - - if (_arguments.ContainsKey(name)) - { - _arguments.Remove(name); - } - - _arguments.Add(name, value.ToString() ?? ""); - return this; - } - - public override string ToString() - { - StringBuilder stringBuilder = new StringBuilder(); - foreach (var item in _arguments) - { - stringBuilder.Append($"{ArgumentSeparator}{ArgumemtPrefix}{item.Key}{ArgumentSeparator}{item.Value}"); - } - - return stringBuilder.ToString(); - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/Const.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/Const.cs deleted file mode 100644 index f6c7e5376..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/Const.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Internal; - -internal class Const -{ - public const string DEFAULT_APPID_DELIMITER = "-"; - - public const string DEFAULT_FILE_NAME = "dapr"; - - public const string DEFAULT_ARGUMENT_PREFIX = "--"; - - /// - /// Heartbeat detection interval, used to detect dapr status - /// - public const int DEFAULT_HEARTBEAT_INTERVAL = 5000; - - /// - /// Default number of retries - /// - public const int DEFAULT_RETRY_TIME = 10; - - /// - /// Change the dapr environment variable - /// - public const string CHANGE_DAPR_ENVIRONMENT_VARIABLE = "DAPR_CHANGE_ENVIRONMENT_VARIABLE"; -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs deleted file mode 100644 index 74e9fcc83..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Internal; - -internal class DaprCoreOptions -{ - /// - /// The id for your application, used for service discovery - /// Required, no blanks allowed - /// - public string AppId { get; } - - /// - /// The port your application is listening on - /// - public ushort AppPort { get; } - - /// - /// The protocol (gRPC or HTTP) Dapr uses to talk to the application. Valid values are: http or grpc - /// - public Protocol? AppProtocol { get; } - - /// - /// Enable https when Dapr invokes the application - /// - public bool? EnableSsl { get; } - - /// - /// The gRPC port for Dapr to listen on - /// - public ushort? DaprGrpcPort { get; private set; } - - /// - /// The HTTP port for Dapr to listen on - /// - public ushort? DaprHttpPort { get; private set; } - - public bool EnableHeartBeat { get; private set; } - - public int HeartBeatInterval { get; } - - public bool CreateNoWindow { get; } = true; - - /// - /// The concurrency level of the application, otherwise is unlimited - /// - public int? MaxConcurrency { get; set; } - - /// - /// Dapr configuration file - /// default: - /// Linux & Mac: $HOME/.dapr/config.yaml - /// Windows: %USERPROFILE%\.dapr\config.yaml - /// - public string? Config { get; set; } - - /// - /// The path for components directory - /// default: - /// Linux & Mac: $HOME/.dapr/components - /// Windows: %USERPROFILE%\.dapr\components - /// - public string? ComponentPath { get; set; } - - /// - /// Enable pprof profiling via an HTTP endpoint - /// - public bool? EnableProfiling { get; set; } - - /// - /// The image to build the code in. Input is: repository/image - /// - public string? Image { get; set; } - - /// - /// The log verbosity. Valid values are: debug, info, warn, error, fatal, or panic - /// default: info - /// - public LogLevel? LogLevel { get; set; } - - /// - /// default: localhost - /// - public string? PlacementHostAddress { get; set; } - - /// - /// Address for the Sentry CA service - /// - public string? SentryAddress { get; set; } - - /// - /// The port that Dapr sends its metrics information to - /// - public ushort? MetricsPort { get; set; } - - /// - /// The port for the profile server to listen on - /// - public ushort? ProfilePort { get; set; } - - /// - /// Path to a unix domain socket dir mount. If specified - /// communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports - /// Not available on Windows OS - /// - public string? UnixDomainSocket { get; set; } - - /// - /// Max size of request body in MB. - /// - public int? DaprMaxRequestSize { get; set; } - - public event DaprEventHandler? OutputDataReceived; - - public DaprCoreOptions( - string appId, - ushort appPort, - Protocol? appProtocol, - bool? enableSsl, - ushort? daprGrpcPort, - ushort? daprHttpPort, - bool enableHeartBeat, - int heartBeatInterval, - bool createNoWindow) - { - AppId = appId; - AppPort = appPort; - AppProtocol = appProtocol; - EnableSsl = enableSsl; - DaprGrpcPort = daprGrpcPort; - DaprHttpPort = daprHttpPort; - EnableHeartBeat = enableHeartBeat; - HeartBeatInterval = heartBeatInterval; - CreateNoWindow = createNoWindow; - } - - public void SetPort(ushort httpPort, ushort rpcPort) - { - DaprHttpPort ??= httpPort; - DaprGrpcPort ??= rpcPort; - } - - public void Output(string type, string data) => OutputDataReceived?.Invoke(type, data); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs deleted file mode 100644 index c4f29c0d0..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Internal; - -public enum DaprProcessStatus -{ - Starting = 1, - Started, - Stopping, - Stopped, - Restarting -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs deleted file mode 100644 index 0442234cd..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Internal; - -internal class NetworkUtils -{ - public static string GetPhysicalAddress() - { - var firstMacAddress = NetworkInterface - .GetAllNetworkInterfaces() - .Where(nic => nic.OperationalStatus == OperationalStatus.Up && nic.NetworkInterfaceType != NetworkInterfaceType.Loopback) - .Select(nic => nic.GetPhysicalAddress().ToString()) - .FirstOrDefault(); - - return firstMacAddress ?? string.Empty; - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs deleted file mode 100644 index 200341906..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Internal; - -internal class ProcessUtils -{ - private readonly ILogger? _logger; - - public ProcessUtils(ILoggerFactory? loggerFactory = null) - { - _logger = loggerFactory?.CreateLogger(); - } - - public System.Diagnostics.Process Run( - string fileName, - string arguments, - bool createNoWindow = true, - bool isWait = false) - => Run(fileName, arguments, out string _, createNoWindow, isWait); - - public System.Diagnostics.Process Run( - string fileName, - string arguments, - out string response, - bool createNoWindow = true, - bool isWait = false) - { - _logger?.LogDebug("FileName: {FileName}, Arguments: {Arguments}", fileName, arguments); - var processStartInfo = new ProcessStartInfo - { - FileName = fileName, - Arguments = arguments, - UseShellExecute = !createNoWindow, - CreateNoWindow = createNoWindow - }; - var daprProcess = new System.Diagnostics.Process() - { - StartInfo = processStartInfo, - }; - if (createNoWindow) - { - processStartInfo.RedirectStandardInput = true; - processStartInfo.RedirectStandardError = true; - processStartInfo.RedirectStandardOutput = true; - - if (!isWait) - { - daprProcess.OutputDataReceived += (_, args) => OnOutputDataReceived(args); - daprProcess.ErrorDataReceived += (_, args) => OnErrorDataReceived(args); - } - } - daprProcess.Start(); - if (createNoWindow && !isWait) - { - daprProcess.BeginOutputReadLine(); - daprProcess.BeginErrorReadLine(); - } - daprProcess.Exited += (_, _) => OnExited(); - string command = $"{fileName} {arguments}"; - _logger?.LogDebug("Process: {ProcessName}, Command: {Command}, PID: {ProcessId} executed successfully", fileName, - command, daprProcess.Id); - - if (isWait) - { - response = daprProcess.StandardOutput.ReadToEnd(); - daprProcess.WaitForExit(); - } - else - { - response = string.Empty; - } - return daprProcess; - } - - public event EventHandler OutputDataReceived = default!; - - public event EventHandler? ErrorDataReceived; - - public event EventHandler Exit = default!; - - protected virtual void OnOutputDataReceived(DataReceivedEventArgs args) - { - try - { - OutputDataReceived(this, args); - } - catch (Exception ex) - { - _logger?.LogError("ProcessUtils: error in output information ", ex); - } - } - - protected virtual void OnErrorDataReceived(DataReceivedEventArgs args) - { - try - { - ErrorDataReceived?.Invoke(this, args); - } - catch (Exception ex) - { - _logger?.LogError("execution error", ex); - } - } - - protected virtual void OnExited() => Exit(this, EventArgs.Empty); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/LogLevel.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/LogLevel.cs deleted file mode 100644 index a47b5c2e0..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/LogLevel.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -public enum LogLevel -{ - Debug = 1, - Info, - Warn, - Error, - Fatal, - Panic -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj deleted file mode 100644 index 4fd57bf4d..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcess.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcess.cs deleted file mode 100644 index b0ace3f57..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcess.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Process; - -public interface IProcess -{ - int PId { get; } - - public string Name { get; } - - void Kill(); - - bool Start(); - - void WaitForExit(int? milliseconds = null); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs deleted file mode 100644 index 779ba3995..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Process; - -public interface IProcessProvider -{ - /// - /// Get process collection based on process name - /// - /// - /// Process collection - IEnumerable GetProcesses(string processName); - - IProcess GetProcess(int pId); - - /// - /// get available ports - /// - /// Minimum port (includes minimum port), default: 0 - /// Maximum ports (including maximum ports), default: 65535 - /// - int GetAvailablePorts(ushort? minPort = null, ushort? maxPort = null); - - /// - /// Is the port available - /// - /// - /// - bool IsAvailablePorts(ushort port); - - List GetPidByPort(ushort port); -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs deleted file mode 100644 index 8acca69f4..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Process; - -public class ProcessProvider : IProcessProvider -{ - private readonly ILogger? _logger; - - public ProcessProvider(ILoggerFactory loggerFactory) - { - _logger = loggerFactory.CreateLogger(); - } - - /// - /// Get process collection based on process name - /// - /// - /// - public IEnumerable GetProcesses(string processName) - => System.Diagnostics.Process.GetProcessesByName(processName).Select(process => new SystemProcess(process)); - - public IProcess GetProcess(int pId) - => new SystemProcess(System.Diagnostics.Process.GetProcessById(pId)); - - /// - /// get available ports - /// - /// Minimum port (includes minimum port), default: 0 - /// Maximum ports (including maximum ports), default: 65535 - /// - public int GetAvailablePorts(ushort? minPort = null, ushort? maxPort = null) - { - minPort ??= ushort.MinValue; - maxPort ??= ushort.MaxValue; - var usePorts = GetPortsByUsed(); - - var effectivePorts = Enumerable.Range(minPort.Value, maxPort.Value).Except(usePorts).ToList(); - if (effectivePorts.Count == 0) - throw new Exception("... No port available exception"); - - return effectivePorts.FirstOrDefault(); - } - - /// - /// Is the port available - /// - /// - /// - public bool IsAvailablePorts(ushort port) - => !GetPortsByUsed().Contains(port); - - public List GetPidByPort(ushort port) - { - List pIdList = new(); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - List output = GetResponse("netstat", $"-a -n -o", "\r\n"); - - foreach (var line in output) - { - if (line.Trim().StartsWith("Proto") || line.Trim().StartsWith("协议")) - continue; - - var parts = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - - var len = parts.Length; - if (len > 2) - { - var pId = int.Parse(parts[len - 1].Split('/')[0]); - if (int.Parse(parts[1].Split(':').Last()) == port && !pIdList.Contains(pId)) - { - pIdList.Add(pId); - } - } - } - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - List output = GetResponse("netstat", $"-tunlp", "\n"); - - Console.WriteLine("result: " + output.Count); - Console.WriteLine("result2: " + System.Text.Json.JsonSerializer.Serialize(output)); - foreach (var line in output) - { - Console.WriteLine("line: " + line); - if (!line.Trim().StartsWith("tcp", StringComparison.OrdinalIgnoreCase) && - !line.Trim().StartsWith("udp", StringComparison.OrdinalIgnoreCase)) - continue; - - var parts = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - - var len = parts.Length; - if (len > 2) - { - var pId = int.Parse(parts[GetIndex(parts, "LISTEN") + 1].Split('/')[0]); - if (int.Parse(parts[3].Split(':').Last()) == port && !pIdList.Contains(pId)) - { - pIdList.Add(pId); - } - } - } - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - List output = GetResponse("lsof", $"-nP -iTCP -sTCP:LISTEN", "\n"); - - Console.WriteLine("result: " + output.Count); - Console.WriteLine("result2: " + System.Text.Json.JsonSerializer.Serialize(output)); - foreach (var line in output) - { - Console.WriteLine("line: " + line); - if (line.Trim().StartsWith("COMMAND", StringComparison.OrdinalIgnoreCase)) - continue; - - var parts = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - - var len = parts.Length; - if (len > 2) - { - var pId = int.Parse(parts[1]); - if (int.Parse(parts[parts.Length - 2].Split(':').Last()) == port && !pIdList.Contains(pId)) - { - pIdList.Add(pId); - } - } - } - } - else - { - _logger?.LogError("unsupported operating system"); - } - return pIdList.Where(pid => pid > 0).ToList(); - } - - private int GetIndex(string[] array, string content) - { - for (var index = 0; index < array.Length; index++) - { - if (array[index].Equals(content, StringComparison.OrdinalIgnoreCase)) - return index; - } - return 0; - } - - private List GetResponse(string fileName, string arguments, string pattern) - { - var process = new System.Diagnostics.Process() - { - StartInfo = new ProcessStartInfo - { - FileName = fileName, - Arguments = arguments, - UseShellExecute = false, - RedirectStandardInput = true, - RedirectStandardOutput = true, - RedirectStandardError = true - } - }; - process.Start(); - - var output = process.StandardOutput.ReadToEnd(); - return Regex.Split(output, pattern).ToList(); - } - - /// - /// get the currently used port - /// - /// Port set that has been used - private IEnumerable GetPortsByUsed() - { - var ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); - var connectionEndPoints = ipGlobalProperties.GetActiveTcpConnections().Select(information => information.LocalEndPoint); - var tcpListenerEndPoints = ipGlobalProperties.GetActiveTcpListeners(); - var udpListenerEndPoints = ipGlobalProperties.GetActiveUdpListeners(); - return connectionEndPoints - .Concat(tcpListenerEndPoints) - .Concat(udpListenerEndPoints) - .Select(endPoint => endPoint.Port); - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/SystemProcess.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/SystemProcess.cs deleted file mode 100644 index afea10ba9..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Process/SystemProcess.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr.Process; - -public class SystemProcess : IProcess -{ - private readonly System.Diagnostics.Process _process; - - public SystemProcess(System.Diagnostics.Process process) - { - _process = process; - } - - public int PId => IsRun ? _process.Id : 0; - - public string Name => IsRun ? _process.ProcessName : string.Empty; - - public bool IsRun => !_process.HasExited; - - public void Kill() - { - if (IsRun) _process.Kill(); - } - - public bool Start() => _process.Start(); - - public void WaitForExit(int? milliseconds = null) - { - if (milliseconds is > 0) - { - _process.WaitForExit(milliseconds.Value); - } - else if (IsRun) - { - _process.Kill(); - } - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Protocol.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Protocol.cs deleted file mode 100644 index 7c4cba425..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/Protocol.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Development.Dapr; - -public enum Protocol -{ - Http = 1, - GRpc -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.md b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.md deleted file mode 100644 index 630e687a5..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.md +++ /dev/null @@ -1,95 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Utils.Development.Dapr - -Dapr Starter Core Library - -Responsibilities: - -Provide core support for Masa.Utils.Development.Dapr.AspNetCore - -The start, stop, refresh, and dapr daemon of the dapr process are provided by such libraries - -### Usage: - -1. Install Masa.Utils.Development.Dapr.AspNetCore -``` C# -Install-Package Masa.Utils.Development.Dapr.AspNetCore -``` - -2. Add DaprStarter to assist in managing the dapr process (recommended to be used in the development environment) - -``` C# -builder.Services.AddDaprStarterCore(); -``` - -3. Inject IDaprProcess at the specified location as needed, and then call the Start method to start the dapr process or hand it over to Masa.Utils.Development.Dapr.AspNetCore to manage the dapr process. Related documents can be found at [View](../Masa.Utils.Development.Dapr.AspNetCore/README.md) - -Example: - -New DaprController - -``` C# DaprController.cs -public class DaprController : ControllerBase -{ - private readonly IDaprProcess _daprProcess; - - private readonly DaprOptions _options; - - public DaprController(IDaprProcess daprProcess, IOptions options) - { - _daprProcess = daprProcess; - _options = options.Value; - } - - [HttpGet(Name = "Start")] - public string Start() - { - _daprProcess.Start(_options); - return "start success"; - } - - [HttpGet(Name = "Stop")] - public string Stop() - { - _daprProcess.Stop(); - return "stop success"; - } -} -``` - -## Notice - -1. The netstat command is used in the library, please make sure the netstat command is available - -> Windows system supports netstat command by default without special installation -> -> Linux and OSX need to confirm by themselves whether netstat is installed on the computer - -Open a terminal and enter the following command to confirm that the computer supports the netstat command: - -```` -netstat -h -```` - -Example: ubuntu: - -```` -apt-get install net-tools -```` - -2. AppId, AppIdSuffix strongly recommend not to enter a string containing ., otherwise it will cause problems with the dapr call. It is recommended to use - - 1. Dapr AppID follows the FQDN format, which includes the target namespace - 2. FQDN is spliced with the symbol . - -### Rule - -dapr AppId naming rules default: - -AppId + "-" + AppIdSuffix - -AppId default: Appid.Replace(".","-") - -AppIdSuffix default: network card address - -When AppIdSuffix is empty, the appid of dapr is equal to AppId diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.zh-CN.md b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.zh-CN.md deleted file mode 100644 index 022edfaf8..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/README.zh-CN.md +++ /dev/null @@ -1,95 +0,0 @@ -中 | [EN](README.md) - -## Masa.Utils.Development.Dapr - -Dapr Starter核心库 - -职责: - -为Masa.Utils.Development.Dapr.AspNetCore 提供核心支撑,支持windows、linux、OSX - -dapr进程的启动、停止、刷新、dapr守护进程均由此类库提供 - -### 用法: - -1. 安装Masa.Utils.Development.Dapr.AspNetCore -```C# -Install-Package Masa.Utils.Development.Dapr.AspNetCore -``` - -2. 添加DaprStarter协助管理dapr进程(建议在开发环境使用) - -```C# -builder.Services.AddDaprStarterCore(); -``` - -3. 根据需要在指定位置注入IDaprProcess, 之后调用Start方法即可启动dapr进程或者交由Masa.Utils.Development.Dapr.AspNetCore管理dapr进程,相关文档可[查看](../Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md) - -例如: - -新建DaprController - -``` C# DaprController.cs -public class DaprController : ControllerBase -{ - private readonly IDaprProcess _daprProcess; - - private readonly DaprOptions _options; - - public DaprController(IDaprProcess daprProcess, IOptions options) - { - _daprProcess = daprProcess; - _options = options.Value; - } - - [HttpGet(Name = "Start")] - public string Start() - { - _daprProcess.Start(_options); - return "start success"; - } - - [HttpGet(Name = "Stop")] - public string Stop() - { - _daprProcess.Stop(); - return "stop success"; - } -} -``` - -## 注意 - -1. 库中有使用到netstat命令,请确保netstat命令是可用的 - -> Windows系统默认支持netstat命令无需特殊安装 -> -> Linux与OSX需要自行确认确认电脑是否安装netstat - -打开终端输入以下命令确认电脑支持netstat命令: - -``` -netstat -h -``` - -例:ubuntu: - -``` -apt-get install net-tools -``` - -2. AppId、AppIdSuffix强烈建议不要输入含.的字符串,否则会导致dapr调用出现问题,推荐使用- - 1. Dapr AppID遵循FQDN格式,其中包括目标命名空间 - 2. FQDN是通过符号.来拼接域名的 - -### 规则 - -dapr AppId命名规则默认: - -AppId + "-" + AppIdSuffix - -AppId默认:Appid.Replace(".","-") - -AppIdSuffix默认:网卡地址 - -当AppIdSuffix为空时,dapr的appid等于AppId \ No newline at end of file diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs deleted file mode 100644 index cc4ba23a5..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public delegate void DaprEventHandler(string type, string data); - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddDaprStarterCore(this IServiceCollection services, Action? action = null) - { - if (action != null) - services.Configure(action); - else - services.Configure(_ => - { - }); - return services.AddDaprStarter(); - } - - public static IServiceCollection AddDaprStarterCore(this IServiceCollection services, IConfiguration configuration) - { - services.Configure(configuration); - return services.AddDaprStarter(); - } - - private static IServiceCollection AddDaprStarter(this IServiceCollection services) - { - if (services.Any(service => service.ImplementationType == typeof(DaprService))) - return services; - - services.AddSingleton(); - - services.TryAddSingleton(typeof(IDaprProcess), typeof(DaprProcess)); - services.TryAddSingleton(typeof(IDaprProvider), typeof(DaprProvider)); - services.TryAddSingleton(typeof(IProcessProvider), typeof(ProcessProvider)); - return services; - } - - private class DaprService - { - - } -} diff --git a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/_Imports.cs b/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/_Imports.cs deleted file mode 100644 index c666c7d32..000000000 --- a/src/Utils/Development/Dapr/src/Masa.Utils.Development.Dapr/_Imports.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Development.Dapr; -global using Masa.Utils.Development.Dapr.Configurations; -global using Masa.Utils.Development.Dapr.Internal; -global using Masa.Utils.Development.Dapr.Process; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using System.Diagnostics; -global using System.Net.NetworkInformation; -global using System.Reflection; -global using System.Runtime.InteropServices; -global using System.Text; -global using System.Text.Json.Serialization; -global using System.Text.RegularExpressions; diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs deleted file mode 100644 index 54e78d887..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Utils.Exceptions.Handlers; - -namespace Microsoft.AspNetCore.Builder; - -public static class ApplicationBuilderExtensions -{ - /// - /// Use localizable - /// - /// - /// - /// - [Obsolete("UseMasaExceptionHandler is recommended to use instead.")] - public static IApplicationBuilder UseMasaExceptionHandling( - this IApplicationBuilder app, - Action? exceptionHandlingOptions = null) - { - return app.UseMasaExceptionHandling(_ => - { - }, exceptionHandlingOptions); - } - - /// - /// Use localizable - /// - /// - /// - /// - /// - [Obsolete("UseMasaExceptionHandler is recommended to use instead.")] - public static IApplicationBuilder UseMasaExceptionHandling( - this IApplicationBuilder app, - Action action, - Action? exceptionHandlingOptions) - { - var option = new MasaExceptionHandlingOptions(); - exceptionHandlingOptions?.Invoke(option); - - app.UseMiddleware(Options.Create(option)); - app.UseRequestLocalization(action); - return app; - } - - /// - /// Use localizable - /// - /// - /// - /// - public static IApplicationBuilder UseMasaExceptionHandler( - this IApplicationBuilder app, - Action? exceptionHandlingOptions = null) - { - return app.UseMasaExceptionHandler(_ => - { - }, exceptionHandlingOptions); - } - - /// - /// Use localizable - /// - /// - /// - /// - /// - public static IApplicationBuilder UseMasaExceptionHandler( - this IApplicationBuilder app, - Action action, - Action? exceptionHandlingOptions) - { - var option = new MasaExceptionHandlerOptions(); - exceptionHandlingOptions?.Invoke(option); - - app.UseMiddleware(Options.Create(option)); - app.UseRequestLocalization(action); - return app; - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs deleted file mode 100644 index 98ad0fcb1..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class MvcBuilderExtensions -{ - public static IMvcBuilder AddMasaExceptionHandler(this IMvcBuilder builder) - { - return builder.AddMasaExceptionHandler(_ => { }); - } - - public static IMvcBuilder AddMasaExceptionHandler(this IMvcBuilder builder, Action action) - { - builder.Services.AddLocalization(); - - builder.Services.Configure(options => { options.Filters.Add(); }); - - builder.Services.Configure(action); - - return builder; - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs deleted file mode 100644 index 14a133503..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions.Handlers; - -public class ExceptionHandlerMiddleware -{ - private readonly RequestDelegate _next; - private readonly IMasaExceptionHandler? _masaExceptionHandler; - private readonly MasaExceptionHandlerOptions _options; - private readonly MasaExceptionLogRelationOptions _logRelationOptions; - private readonly ILogger? _logger; - - public ExceptionHandlerMiddleware( - RequestDelegate next, - IServiceProvider serviceProvider, - IOptions options, - IOptions logRelationOptions, - ILogger? logger = null) - { - _next = next; - _options = options.Value; - _masaExceptionHandler = ExceptionHandlerExtensions.GetMasaExceptionHandler(serviceProvider, _options.MasaExceptionHandlerType); - _logRelationOptions = logRelationOptions.Value; - _logger = logger; - } - - public async Task InvokeAsync(HttpContext httpContext) - { - try - { - await _next(httpContext); - } - catch (Exception exception) - { - var masaExceptionContext = new MasaExceptionContext(exception, httpContext); - if (_options.ExceptionHandler != null) - { - _options.ExceptionHandler.Invoke(masaExceptionContext); - } - else if (_masaExceptionHandler != null) - { - _masaExceptionHandler.OnException(masaExceptionContext); - } - - if (httpContext.Response.HasStarted) - return; - - if (masaExceptionContext.ExceptionHandled) - { - await httpContext.Response.WriteTextAsync( - masaExceptionContext.StatusCode, - masaExceptionContext.Message ?? masaExceptionContext.Exception.Message, - masaExceptionContext.ContentType); - return; - } - - _logger?.WriteLog(masaExceptionContext.Exception, - masaExceptionContext.Exception is UserFriendlyException ? LogLevel.Information : LogLevel.Error, - _logRelationOptions); - - if (masaExceptionContext.Exception is UserFriendlyException) - { - await httpContext.Response.WriteTextAsync((int)MasaHttpStatusCode.UserFriendlyException, - masaExceptionContext.Exception.Message); - } - else if (masaExceptionContext.Exception is MasaException || _options.CatchAllException) - { - var message = Constant.DEFAULT_EXCEPTION_MESSAGE; - await httpContext.Response.WriteTextAsync((int)HttpStatusCode.InternalServerError, message); - } - else - { - throw; - } - } - } - - -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs deleted file mode 100644 index d5ef315a7..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions.Handlers; - -public class ExceptionHandlingMiddleware -{ - private readonly RequestDelegate _next; - private readonly ILogger _logger; - private readonly MasaExceptionHandlingOptions _options; - - public ExceptionHandlingMiddleware( - RequestDelegate next, - ILogger logger, - IOptions options) - { - _next = next; - _logger = logger; - _options = options.Value; - } - - public async Task InvokeAsync(HttpContext httpContext) - { - try - { - await _next(httpContext); - } - catch (Exception exception) - { - if (_options.CustomExceptionHandler is not null) - { - var handlerResult = _options.CustomExceptionHandler.Invoke(exception); - - if (handlerResult.ExceptionHandled) return; - - if (handlerResult.OverrideException is not null) exception = handlerResult.OverrideException; - } - if (exception is UserFriendlyException) - { - var message = exception.Message; - _logger.LogError(exception, message); - await httpContext.Response.WriteTextAsync((int)MasaHttpStatusCode.UserFriendlyException, message); - } - else if (exception is MasaException || _options.CatchAllException) - { - var message = Constant.DEFAULT_EXCEPTION_MESSAGE; - _logger.LogError(exception, message); - await httpContext.Response.WriteTextAsync((int)HttpStatusCode.InternalServerError, message); - } - else - { - throw; - } - } - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs deleted file mode 100644 index c24e03139..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions.Handlers; - -/// -/// Mvc pipeline exception filter to catch global exception -/// -public class MvcGlobalExcetionFilter : IExceptionFilter -{ - private readonly IMasaExceptionHandler? _masaExceptionHandler; - private readonly MasaExceptionHandlerOptions _options; - private readonly MasaExceptionLogRelationOptions _logRelationOptions; - private readonly ILogger? _logger; - - public MvcGlobalExcetionFilter(IServiceProvider serviceProvider, - IOptions options, - IOptions logRelationOptions, - ILogger? logger = null) - { - _options = options.Value; - _masaExceptionHandler = ExceptionHandlerExtensions.GetMasaExceptionHandler(serviceProvider, _options.MasaExceptionHandlerType); - _logRelationOptions = logRelationOptions.Value; - _logger = logger; - } - - public void OnException(ExceptionContext context) - { - var masaExceptionContext = new MasaExceptionContext(context.Exception, context.HttpContext); - if (_options.ExceptionHandler != null) - { - _options.ExceptionHandler.Invoke(masaExceptionContext); - } - else - { - _masaExceptionHandler?.OnException(masaExceptionContext); - } - - if (masaExceptionContext.HttpContext.Response.HasStarted) - return; - - if (masaExceptionContext.ExceptionHandled) - { - context.ExceptionHandled = true; - context.Result = new DefaultExceptionResult( - masaExceptionContext.Message, - masaExceptionContext.StatusCode, - masaExceptionContext.ContentType); - return; - } - - _logger?.WriteLog(masaExceptionContext.Exception, - masaExceptionContext.Exception is UserFriendlyException ? LogLevel.Information : LogLevel.Error, - _logRelationOptions); - - if (masaExceptionContext.Exception is UserFriendlyException userFriendlyException) - { - context.ExceptionHandled = true; - context.Result = new UserFriendlyExceptionResult(userFriendlyException.Message); - return; - } - if (masaExceptionContext.Exception is MasaException || _options.CatchAllException) - { - context.ExceptionHandled = true; - context.Result = new InternalServerErrorObjectResult(Constant.DEFAULT_EXCEPTION_MESSAGE); - return; - } - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs deleted file mode 100644 index 0b9d57ebc..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/IMasaExceptionHandler.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions; - -public interface IMasaExceptionHandler -{ - void OnException(MasaExceptionContext context); -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/Constant.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/Constant.cs deleted file mode 100644 index e6c59bcf6..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/Constant.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions.Internal; - -internal class Constant -{ - public const string DEFAULT_HTTP_CONTENT_TYPE = "text/plain; charset=utf-8"; - - public const string DEFAULT_EXCEPTION_MESSAGE = "An error occur in masa framework."; -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs deleted file mode 100644 index ff05ff2a7..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -internal static class ExceptionExtensions -{ - public static void WriteLog( - this ILogger logger, - Exception exception, - LogLevel defaultLogLevel, - MasaExceptionLogRelationOptions logRelationOptions, - string? message = null) - { - var logLevel = logRelationOptions.GetLogLevel(exception, defaultLogLevel); - logger.Log(logLevel, exception, message ?? exception.Message); - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs deleted file mode 100644 index 7d409a73f..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions.Internal; - -internal static class ExceptionHandlerExtensions -{ - public static IMasaExceptionHandler? GetMasaExceptionHandler(IServiceProvider serviceProvider, Type? masaExceptionHandlerType) - { - var exceptionHandler = serviceProvider.GetService(); - if (exceptionHandler != null) - return exceptionHandler; - - if (masaExceptionHandlerType == null) - return null; - - var constructor = masaExceptionHandlerType.GetConstructors(BindingFlags.Instance | BindingFlags.Public) - .MaxBy(c => c.GetParameters().Length); - List parameters = new(); - if (constructor != null) - { - foreach (var parameterInfo in constructor.GetParameters()) - parameters.Add(serviceProvider.GetService(parameterInfo.ParameterType)); - } - var instance = Activator.CreateInstance(masaExceptionHandlerType, parameters.ToArray()); - if (instance != null) - return instance as IMasaExceptionHandler; - - return null; - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs deleted file mode 100644 index 8909aab1c..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions.Internal; - -internal static class HttpResponseExtensions -{ - /// - /// Write response with text/plain - /// - /// - /// - /// - /// - /// - public static async Task WriteTextAsync( - this HttpResponse httpResponse, - int statusCode, - string text, - string contentType = "text/plain; charset=utf-8") - { - httpResponse.StatusCode = statusCode; - httpResponse.ContentType = contentType; - await httpResponse.WriteAsync(text, Encoding.UTF8); - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj deleted file mode 100644 index b73295abb..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - \ No newline at end of file diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaException.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaException.cs deleted file mode 100644 index c7f0135c1..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaException.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public class MasaException : Exception -{ - public string? ErrorCode { get; set; } - - public MasaException() - { - } - - public MasaException(string message) - : base(message) - { - } - - public MasaException(string message, Exception innerException) - : base(message, innerException) - { - } - - public MasaException(SerializationInfo serializationInfo, StreamingContext context) - : base(serializationInfo, context) - { - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaExceptionContext.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaExceptionContext.cs deleted file mode 100644 index fd08374ea..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaExceptionContext.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public class MasaExceptionContext -{ - public Exception Exception { get; set; } - - public HttpContext HttpContext { get; } - - public bool ExceptionHandled { get; set; } - - /// - /// Http status code - /// - public int StatusCode { get; set; } - - /// - /// Error code to provide support for subsequent I18n - /// - public string? ErrorCode { get; set; } - - public string? Message { get; set; } - - public string ContentType { get; set; } - - internal MasaExceptionContext(Exception exception, HttpContext httpContext) - { - Exception = exception; - HttpContext = httpContext; - StatusCode = (int)MasaHttpStatusCode.UserFriendlyException; - ExceptionHandled = false; - ContentType = Constant.DEFAULT_HTTP_CONTENT_TYPE; - } - - public void ToResult( - string message, - int statusCode = (int)MasaHttpStatusCode.UserFriendlyException, - string contentType = Constant.DEFAULT_HTTP_CONTENT_TYPE) - { - Message = message; - StatusCode = statusCode; - ExceptionHandled = true; - ContentType = contentType; - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs deleted file mode 100644 index 9570e1afc..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/MasaHttpStatusCode.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions; - -public enum MasaHttpStatusCode -{ - UserFriendlyException = 299 -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs deleted file mode 100644 index 33179c4ec..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions; - -public class MasaExceptionHandlerOptions -{ - public bool CatchAllException { get; set; } = true; - - public Action? ExceptionHandler { get; set; } - - internal Type? MasaExceptionHandlerType { get; private set; } - - public void UseExceptionHanlder() where TExceptionHanlder : IMasaExceptionHandler - { - MasaExceptionHandlerType = typeof(TExceptionHanlder); - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs deleted file mode 100644 index aab8c08cc..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Exceptions; - -public class MasaExceptionHandlingOptions -{ - public bool CatchAllException { get; set; } = true; - - public Func? CustomExceptionHandler { get; set; } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs deleted file mode 100644 index 06b7d4d1f..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public class MasaExceptionLogRelationOptions -{ - internal Dictionary Mappings { get; } = new(); - - public MasaExceptionLogRelationOptions MapLogLevel(LogLevel logLevel) where TException : Exception - { - Mappings[typeof(TException)] = logLevel; - return this; - } - - internal LogLevel GetLogLevel(Exception exception, LogLevel defaultLogLevel) - { - if (!Mappings.TryGetValue(exception.GetType(), out var logLevel)) - logLevel = defaultLogLevel; - - return logLevel; - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.md b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.md deleted file mode 100644 index 69fe60819..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.md +++ /dev/null @@ -1,130 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Utils.Exceptions - -Provides a model for handling web application exceptions - -* Support custom handling exceptions for handling exceptions not provided by Masa -* Take over the `UserFriendlyException` exception and respond with a status code of 299 and return a friendly error message -* Handle all exceptions by default, and output `An error occur in masa framework` externally - -## Example: - -``` C# -Install-Package Masa.Utils.Exceptions -``` - -1. Modify `Program.cs` - -``` C# -app.UseMasaExceptionHandler(); -``` - -2. How to use? - -``` C# -app.MapGet("/Test", () -{ - throw new UserFriendlyException("This method is deprecated"); -} -``` - -3. Error response message, where Http status code is 299 - -``` js -axios - .get('/Test') - .then(response => { - if (response.status === 299) { - alert(response.data); - } - }) -``` - -## How to customize exception handling? - -1. By specifying `ExceptionHandler` - - ```` C# - app.UseMasaExceptionHandler(option => - { - option.CatchAllException = true;//Whether to catch all exceptions, the default is true, the default output of caught exceptions: An error occur in masa framework - - // Custom handling exceptions, similar to ExceptionFilter, can handle exception information according to the exception type, and output the response result through the ToResult method - option.ExceptionHandler = context => - { - if (context.Exception is ArgumentNullException argumentNullException) - { - context.ExceptionHandled = true; - context.Message = "Parameter cannot be empty"; - // or abbreviated as: context.ToResult("Parameter cannot be empty"); - } - }; - }); - ```` - -2. Implement the `IExceptionHandler` interface and register it with the service - - ```` C# - public class ExceptionHandler : IMasaExceptionHandler - { - private readonly ILogger _logger; - - public ExceptionHandler(ILogger logger) - { - _logger = logger; - } - - public void OnException(MasaExceptionContext context) - { - if (context.Exception is ArgumentNullException) - { - _logger.LogWarning(context.Message); - context.ToResult(context.Exception.Message); - } - } - } - builder.Services.AddSingleton(); - - app.UseMasaExceptionHandler(); - ```` - -3. Implement the `IExceptionHandler` interface and specify the use of Handler - - ```` C# - public class ExceptionHandler : IMasaExceptionHandler - { - private readonly ILogger _logger; - - public ExceptionHandler(ILogger logger) - { - _logger = logger; - } - - public void OnException(MasaExceptionContext context) - { - if (context.Exception is ArgumentNullException) - { - _logger.LogWarning(context.Message); - context.ToResult(context.Exception.Message); - } - } - } - app.UseMasaExceptionHandler(option => - { - option.UseExceptionHanlder(); - }); - ```` - -## Common problem - -The default log level of `UserFriendlyException` is `Information`, other types of exceptions are `Error` - -1. How to modify the log level of UserFriendlyException? - - ```` C# - builder.Services.Configure(options => - { - options.MapLogLevel(LogLevel.None); - }); - ```` \ No newline at end of file diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.zh-CN.md b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.zh-CN.md deleted file mode 100644 index 2c1364aa3..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/README.zh-CN.md +++ /dev/null @@ -1,130 +0,0 @@ -中 | [EN](README.md) - -## Masa.Utils.Exceptions - -提供了用于处理Web应用程序异常的模型 - -* 支持自定义处理异常,用于处理非Masa提供的异常 -* 接管`UserFriendlyException`异常,并响应状态码为299,返回友好的错误信息 -* 默认处理所有异常,并对外输出`An error occur in masa framework` - -## 用例: - -``` C# -Install-Package Masa.Utils.Exceptions -``` - -1. 修改`Program.cs` - -``` C# -app.UseMasaExceptionHandler(); -``` - -2. 如何使用? - -``` C# -app.MapGet("/Test", () -{ - throw new UserFriendlyException("This method is deprecated"); -} -``` - -3. 错误响应消息,其中Http状态码为299 - -``` js -axios - .get('/Test') - .then(response => { - if (response.status === 299) { - alert(response.data); - } - }) -``` - -## 如何自定义异常处理? - -1. 通过指定`ExceptionHandler` - - ``` C# - app.UseMasaExceptionHandler(option => - { - option.CatchAllException = true;//是否捕获所有异常,默认为true,捕获到的异常默认输出:An error occur in masa framework - - // 自定义处理异常,与ExceptionFilter类似,可根据异常类型处理异常信息,并通过ToResult方法输出响应结果 - option.ExceptionHandler = context => - { - if (context.Exception is ArgumentNullException argumentNullException) - { - context.ExceptionHandled = true; - context.Message = "参数不能为空"; - // 或者简写为context.ToResult("参数不能为空"); - } - }; - }); - ``` - -2. 实现`IExceptionHandler`接口,并注册到服务中 - - ``` C# - public class ExceptionHandler : IMasaExceptionHandler - { - private readonly ILogger _logger; - - public ExceptionHandler(ILogger logger) - { - _logger = logger; - } - - public void OnException(MasaExceptionContext context) - { - if (context.Exception is ArgumentNullException) - { - _logger.LogWarning(context.Message); - context.ToResult(context.Exception.Message); - } - } - } - builder.Services.AddSingleton(); - - app.UseMasaExceptionHandler(); - ``` - -3. 实现`IExceptionHandler`接口,并指定使用Handler - - ``` C# - public class ExceptionHandler : IMasaExceptionHandler - { - private readonly ILogger _logger; - - public ExceptionHandler(ILogger logger) - { - _logger = logger; - } - - public void OnException(MasaExceptionContext context) - { - if (context.Exception is ArgumentNullException) - { - _logger.LogWarning(context.Message); - context.ToResult(context.Exception.Message); - } - } - } - app.UseMasaExceptionHandler(option => - { - option.UseExceptionHanlder(); - }); - ``` - -## 常见问题 - -默认`UserFriendlyException`的日志等级为`Information`, 其它类型异常为`Error` - -1. 如何修改UserFriendlyException的日志等级? - -``` C# -builder.Services.Configure(options => -{ - options.MapLogLevel(LogLevel.None); -}); -``` \ No newline at end of file diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs deleted file mode 100644 index 06999a1eb..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Mvc; - -public class DefaultExceptionResult : IActionResult -{ - public string? Message { get; set; } - - public int StatusCode { get; set; } - - public string ContentType { get; set; } - - public DefaultExceptionResult(string? message, int statusCode, string contentType) - { - Message = message; - StatusCode = statusCode; - ContentType = contentType; - } - - public async Task ExecuteResultAsync(ActionContext context) - { - await context.HttpContext.Response.WriteTextAsync(StatusCode, Message ?? Constant.DEFAULT_EXCEPTION_MESSAGE, ContentType); - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs deleted file mode 100644 index 3540a1ef0..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Mvc; - -public class InternalServerErrorObjectResult : ObjectResult -{ - public InternalServerErrorObjectResult(object obj) - : base(obj) - { - StatusCode = (int)HttpStatusCode.InternalServerError; - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs deleted file mode 100644 index 20429d2ab..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.AspNetCore.Mvc; - -public class UserFriendlyExceptionResult : IActionResult -{ - public string Message { get; set; } - - public UserFriendlyExceptionResult(string message) - { - Message = message; - } - - public async Task ExecuteResultAsync(ActionContext context) - { - await context.HttpContext.Response.WriteTextAsync((int)MasaHttpStatusCode.UserFriendlyException, Message); - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/UserFriendlyException.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/UserFriendlyException.cs deleted file mode 100644 index 5c2ba7787..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/UserFriendlyException.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public class UserFriendlyException : MasaException -{ - public UserFriendlyException(string message) - : base(message) - { - } -} diff --git a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/_Imports.cs b/src/Utils/Exceptions/src/Masa.Utils.Exceptions/_Imports.cs deleted file mode 100644 index 0f98ed432..000000000 --- a/src/Utils/Exceptions/src/Masa.Utils.Exceptions/_Imports.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Exceptions; -global using Masa.Utils.Exceptions.Handlers; -global using Masa.Utils.Exceptions.Internal; -global using Microsoft.AspNetCore.Http; -global using Microsoft.AspNetCore.Mvc; -global using Microsoft.AspNetCore.Mvc.Filters; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using System.Net; -global using System.Reflection; -global using System.Runtime.Serialization; -global using System.Text; diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs deleted file mode 100644 index def4eca3c..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public abstract class BaseTypeProvider : ITypeProvider -{ - public virtual bool IsAssignableFrom(Type type, Type targetType) - { - if (type.IsGenericType && - type.GetTypeInfo().GenericTypeParameters.Length > 0 && - targetType.IsGenericType && - targetType.GetTypeInfo().GenericTypeParameters.Length > 0) - return targetType.GetInterfaces().Any(t => t.IsGenericType && t.GetGenericTypeDefinition() == type); - - return type.IsAssignableFrom(targetType); - } - - public virtual bool IsAssignableTo(Type type, Type targetType) - => IsAssignableFrom(targetType, type); - - public virtual List GetAllTypes() => GetAllTypes(AppDomain.CurrentDomain.GetAssemblies()); - - public virtual List GetAllTypes(IEnumerable assemblies) - => assemblies.SelectMany(assembly => assembly.GetTypes()).ToList(); - - public abstract List GetServiceDescriptors(List types); -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs deleted file mode 100644 index 87974ab8b..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public class DefaultServiceRegister : IServiceRegister -{ - public void Add(IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime) - { - var dependency = implementationType.GetCustomAttribute(); - var descriptor = services.FirstOrDefault(d => d.ServiceType == serviceType); - if (dependency != null) - { - if (descriptor != null) - { - var preDependency = descriptor.ImplementationType?.GetCustomAttribute(); - if (preDependency is { ReplaceServices: true }) - return; - - if (dependency.ReplaceServices || preDependency is { TryRegister: true }) - services.Remove(descriptor); - else if (dependency.TryRegister) - return; - } - } - else - { - if (descriptor != null) - { - var preDependency = descriptor.ImplementationType?.GetCustomAttribute(); - if (preDependency is { ReplaceServices: true }) - return; - - if (preDependency is { TryRegister: true }) - services.Remove(descriptor); - } - } - - services.Add(new ServiceDescriptor(serviceType, implementationType, lifetime)); - } -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs deleted file mode 100644 index a715c77cf..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public class DefaultTypeProvider : BaseTypeProvider -{ - public override List GetServiceDescriptors(List types) - => GetServiceDescriptorCore(types, typeof(ISingletonDependency), ServiceLifetime.Singleton) - .Concat(GetServiceDescriptorCore(types, typeof(IScopedDependency), ServiceLifetime.Scoped)) - .Concat(GetServiceDescriptorCore(types, typeof(ITransientDependency), ServiceLifetime.Transient)).ToList(); - - public virtual List GetServiceDescriptorCore(List types, Type type, ServiceLifetime lifetime) - { - List descriptors = new(); - var serviceTypes = GetServiceTypes(types, type); - foreach (var serviceType in serviceTypes) - { - var implementationTypes = GetImplementationTypes(types, serviceType); - foreach (var implementationType in implementationTypes) - { - if (serviceType.IsGenericType && - implementationType.IsGenericType && - serviceType.GetTypeInfo().GenericTypeParameters.Length != implementationType.GetTypeInfo().GenericTypeParameters.Length) - continue; - - descriptors.Add(new ServiceDescriptorOptions(serviceType, implementationType, lifetime, AutoFire(serviceType))); - } - } - - return descriptors; - } - - public virtual bool AutoFire(Type serviceType) - => IsAssignableFrom(typeof(IAutoFireDependency), serviceType); - - public virtual List GetImplementationTypes(List types, Type serviceType) - { - if (serviceType.IsInterface) - return types.Where(t => !t.IsAbstract && t.IsClass && IsAssignableFrom(serviceType, t)).ToList(); - - return new List - { - serviceType - }; - } - - public virtual List GetServiceTypes(List types, Type interfaceType) - { - var interfaceServiceTypes = types.Where(t => t.IsInterface && t != interfaceType && interfaceType.IsAssignableFrom(t)); - return types.Where(type - => IsAssignableFrom(interfaceType, type) && !type.GetInterfaces().Any(t => interfaceServiceTypes.Contains(t)) && - !IsSkip(type)) - .Concat(interfaceServiceTypes) - .ToList(); - } - - public virtual bool IsSkip(Type type) - { - if (type.IsAbstract) - return true; - - var ignoreInjection = type.GetCustomAttribute(); - if (ignoreInjection == null) - return false; - - var inheritIgnoreInjection = type.GetCustomAttribute(false); - if (inheritIgnoreInjection != null) - return true; - - return ignoreInjection.Cascade; - } -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs deleted file mode 100644 index 422fae267..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -[AttributeUsage(AttributeTargets.Class)] -public class DependencyAttribute : Attribute -{ - /// - /// Attempt to register only if not registered - /// - public virtual bool TryRegister { get; set; } = false; - - /// - /// If the original service is already registered, replace the service registration, if not, register the service to DI - /// - public virtual bool ReplaceServices { get; set; } -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs deleted file mode 100644 index b55247fcb..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -/// -/// Automatic trigger injection, After the service is added, it will be obtained once -/// Need to be used with ISingletonDependency, IScopedDependency, ISingletonDependency -/// -public interface IAutoFireDependency -{ -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs deleted file mode 100644 index 75d0c6b21..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public interface IScopedDependency -{ -} - - -public interface ITestService : IScopedDependency - where T : class -{ - -} - -public class TestSerice : ITestService - where T : class -{ - -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs deleted file mode 100644 index 0161f094d..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public interface IServiceRegister -{ - void Add(IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime); -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs deleted file mode 100644 index a995b1f6c..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public interface ISingletonDependency -{ -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs deleted file mode 100644 index 8d894bd06..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public interface ITransientDependency -{ -} - diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs deleted file mode 100644 index 4aa29c856..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public interface ITypeProvider -{ - bool IsAssignableFrom(Type type, Type targetType); - - bool IsAssignableTo(Type type, Type targetType); - - List GetAllTypes(); - - List GetAllTypes(IEnumerable assemblies); - - List GetServiceDescriptors(List types); -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs deleted file mode 100644 index ab6df6e3b..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] -public class IgnoreInjectionAttribute : Attribute -{ - public bool Cascade { get; set; } - - public IgnoreInjectionAttribute(bool cascade = false) - { - Cascade = cascade; - } -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj deleted file mode 100644 index 63130ab81..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net6.0 - enable - enable - Microsoft.Extensions.DependencyInjection - - - - - - - diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs deleted file mode 100644 index 59d4b6f8a..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection.Options; - -public class ServiceDescriptorOptions -{ - public Type ServiceType { get; } - - public Type ImplementationType { get; } - - public ServiceLifetime Lifetime { get; } - - public bool AutoFire { get; } - - public ServiceDescriptorOptions(Type serviceType, Type implementationType, ServiceLifetime lifetime, bool autoFire) - { - ServiceType = serviceType; - ImplementationType = implementationType; - Lifetime = lifetime; - AutoFire = autoFire; - } -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.md b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.md deleted file mode 100644 index 6ce88603a..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.md +++ /dev/null @@ -1,117 +0,0 @@ -[中](README.zh-CN.md) | EN - -## Masa.Utils.Extensions.DependencyInjection - -### Reference package: - -````c# -Install-Package Masa.Utils.Extensions.DependencyInjection -```` -### Usage: - -````C# -services.AddAutoInject(); -```` - -## Dependent interface: - -* ISingletonDependency: registers a service whose lifecycle is Singleton -* IScopedDependency: registers a service whose lifecycle is Scoped -* ITransientDependency: registers services whose lifecycle is Transient -* IAutoFireDependency: is automatically triggered (used in combination with ISingletonDependency, IScopedDependency, and ITransientDependency to trigger a service acquisition operation after the service is automatically registered, only inheriting IAutoFireDependency does not work) - -Example: - -````c# -public interface IRepository : IScopedDependency - where TEntity : class -{ - -} -```` - -> Because IRepository inherits IScopedDependency, the life cycle of IRepository will be Scoped - -## Rule: - -Scan the interfaces and classes that inherit ISingletonDependency, IScopedDependency, and ITransientDependency in the assembly, and automatically register services for them - -* When inheriting an interface, its ServiceType is the current interface, and its ImplementationType is the implementation class of the current interface - * If the current interface has multiple implementation classes, it will be added multiple times - - ```` C# - public interface IUserService : IScopedDependency - { - - } - - public class UserService : IUserService - { - - } - ```` - > Equivalent to service.AddScoped(); - - * If you want the interface to have only one implementation class, add [Dependency(ReplaceServices = true)] above the implementation class - - ```` C# - public interface IUserService : IScopedDependency - { - - } - - public class UserService : IUserService - { - - } - - [Dependency(ReplaceServices = true)] - public class UserService2 : IUserService - { - - } - ```` - > Equivalent to service.AddScoped(); - -* When the inherited class is not an interface, its ServiceType is the current class, and its ImplementationType is also the current class - * By default, the cascade scan registration service is supported, and subclasses of the current class will also be registered - - ```` C# - public class BaseRepository : ISingletonDependency - { - - } - - /// - /// Abstract classes are not automatically registered - /// - public abstract class CustomizeBaseRepository : ISingletonDependency - { - - } - - public class UserRepository : BaseRepository - { - - } - ```` - - > Equivalent to: `service.AddSingleton();service.AddSingleton();` - -## Features: - -* IgnoreInjection: Ignore injection, used to exclude not being injected automatically -* Dependency: - * TryRegister: Set true to be registered only when the service is not registered, similar to TryAdd of IServiceCollection... extension method - * ReplaceServices: Set true to replace previously registered services, similar to the Replace... extension method of IServiceCollection. - -## Methods: - -* Extend IServiceCollection -* GetInstance(): Get the instance of service T - * Any(): Whether there is a service TService, does not support generic services - * Any(): Whether there is a service whose interface is TService and whose implementation class is TImplementation - * Any(ServiceLifetime.Singleton): Whether there is a service TService with a life cycle of Singleton (generic services are not supported) - * Any(ServiceLifetime.Singleton): Is there an interface whose life cycle is Singleton as TService and is implemented as a TImplementation service (generic services are not supported) - * Replace(typeof(TImplementation), ServiceLifetime.Singleton): Remove the first service with the same service type in the service collection, and add typeof(TImplementation) to the collection, the life cycle is a singleton - * ReplaceAll(typeof(TImplementation), ServiceLifetime.Singleton): Remove all services with the same service type in the service collection, and add typeof(TImplementation) to the collection, the life cycle is a singleton \ No newline at end of file diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md deleted file mode 100644 index e8a324b02..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md +++ /dev/null @@ -1,117 +0,0 @@ -中 | [EN](README.md) - -## Masa.Utils.Extensions.DependencyInjection - -### 引用包: - -```c# -Install-Package Masa.Utils.Extensions.DependencyInjection -``` -### 用法: - -```C# -services.AddAutoInject(); -``` - -## 依赖接口: - -* ISingletonDependency: 注册生命周期为Singleton的服务 -* IScopedDependency: 注册生命周期为Scoped的服务 -* ITransientDependency: 注册生命周期为Transient的服务 -* IAutoFireDependency: 自动触发(与ISingletonDependency、IScopedDependency、ITransientDependency结合使用,在服务自动注册结束后触发一次获取服务操作,仅继承IAutoFireDependency不起作用) - -示例: - -```c# -public interface IRepository : IScopedDependency - where TEntity : class -{ - -} -``` - -> 因IRepository继承IScopedDependency,所以会将IRepository的生命周期为Scoped - -## 规则: - -扫描程序集中继承ISingletonDependency、IScopedDependency、ITransientDependency的接口以及类,并为其自动注册服务 - -* 当继承的是接口时,其ServiceType是当前接口,其ImplementationType是当前接口的实现类 - * 如果当前接口有多个实现类,会被多次添加 - - ``` C# - public interface IUserService : IScopedDependency - { - - } - - public class UserService : IUserService - { - - } - ``` - > 等价于 service.AddScoped(); - - * 如果希望接口只有一个实现类,则在实现类上方增加[Dependency(ReplaceServices = true)]即可 - - ``` C# - public interface IUserService : IScopedDependency - { - - } - - public class UserService : IUserService - { - - } - - [Dependency(ReplaceServices = true)] - public class UserService2 : IUserService - { - - } - ``` - > 等价于 service.AddScoped(); - -* 当继承的类不是接口时,其ServiceType是当前类,其ImplementationType也是当前类 - * 默认支持级联扫描注册服务,当前类的子类也会被注册 - - ``` C# - public class BaseRepository : ISingletonDependency - { - - } - - /// - /// 抽象类不会被自动注册 - /// - public abstract class CustomizeBaseRepository : ISingletonDependency - { - - } - - public class UserRepository : BaseRepository - { - - } - ``` - - > 等价于: `service.AddSingleton();service.AddSingleton();` - -## 特性: - -* IgnoreInjection: 忽略注入,用于排除不被自动注入 -* Dependency: - * TryRegister: 设置true则仅当服务未注册时才会被注册,类似IServiceCollection的TryAdd ... 扩展方法 - * ReplaceServices: 设置true则替换之前已经注册过的服务,类似IServiceCollection的Replace ... 扩展方法. - -## 方法: - -* 扩展IServiceCollection - * GetInstance(): 获取服务T的实例 - * Any(): 是否存在服务TService,不支持泛型服务 - * Any(): 是否存在接口为TService、且实现类为TImplementation的服务 - * Any(ServiceLifetime.Singleton): 是否存在一个生命周期为Singleton的服务TService(不支持泛型服务) - * Any(ServiceLifetime.Singleton): 是否存在一个生命周期为Singleton的接口为TService,实现为TImplementation的服务(不支持泛型服务) - * Replace(typeof(TImplementation), ServiceLifetime.Singleton): 移除服务集合中具有相同服务类型的第一个服务,并将 typeof(TImplementation) 添加到集合中,生命周期为单例 - * ReplaceAll(typeof(TImplementation), ServiceLifetime.Singleton): 移除服务集合中具有相同服务类型的所有服务,并将 typeof(TImplementation) 添加到集合中,生命周期为单例 \ No newline at end of file diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs deleted file mode 100644 index 54f88a654..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionDescriptorExtensions -{ - public static TService GetInstance(this IServiceCollection services, bool isCreateScope = false) - where TService : class - { - if (isCreateScope) - { - using var scope = services.BuildServiceProvider().CreateScope(); - return scope.ServiceProvider.GetInstance(); - } - - return services.BuildServiceProvider().GetInstance(); - } - - private static TService GetInstance(this IServiceProvider serviceProvider) - where TService : class - { - if (typeof(TService) == typeof(IServiceProvider)) - return (TService)serviceProvider; - - return serviceProvider.GetRequiredService(); - } - - /// - /// Returns whether the specified ServiceType exists in the service collection - /// - /// - /// - /// - public static bool Any(this IServiceCollection services) - => services.Any(d => d.ServiceType == typeof(TService)); - - /// - /// Returns whether the specified ServiceType and ImplementationType exist in the service collection - /// - /// - /// - /// - /// - public static bool Any(this IServiceCollection services) - => services.Any(d => d.ServiceType == typeof(TService) && d.ImplementationType == typeof(TImplementation)); - - /// - /// Returns whether the specified ServiceType exists in the service collection, and the life cycle is the life cycle. - /// - /// - /// - /// - /// - public static bool Any(this IServiceCollection services, ServiceLifetime lifetime) - => services.Any(d => d.ServiceType == typeof(TService) && d.Lifetime == lifetime); - - /// - /// Returns the specified ServiceType, ImplementationType, and whether the life cycle is lifetime exists in the service collection - /// - /// - /// - /// - /// - /// - public static bool Any(this IServiceCollection services, ServiceLifetime lifetime) - => services.Any(d => d.ServiceType == typeof(TService) && d.ImplementationType == typeof(TImplementation) && d.Lifetime == lifetime); - - /// - /// Remove the first service in the service collection with the same service type and add the implementationType to the collection. - /// - /// - /// - /// - /// - /// - public static IServiceCollection Replace(this IServiceCollection services, Type implementationType, ServiceLifetime lifetime) - { - if (services.Any()) - { - int count = services.Count; - for (int i = 0; i < count; i++) - { - if (services[i].ServiceType == typeof(TService)) - { - services.RemoveAt(i); - break; - } - } - } - - services.Add(new ServiceDescriptor(typeof(TService), implementationType, lifetime)); - return services; - } - - /// - /// Removes all services with the same service type in the services collection and adds implementationType to the collection. - /// - /// - /// - /// - /// - /// - public static IServiceCollection ReplaceAll(this IServiceCollection services, Type implementationType, ServiceLifetime lifetime) - { - if (services.Any()) - { - int count = services.Count; - for (int i = 0; i < count; i++) - { - if (services[i].ServiceType == typeof(TService)) - { - services.RemoveAt(i); - break; - } - } - } - - services.Add(new ServiceDescriptor(typeof(TService), implementationType, lifetime)); - return services; - } -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs deleted file mode 100644 index fd2b8ae39..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddAutoInject(this IServiceCollection services) - => services.AddAutoInject(AppDomain.CurrentDomain.GetAssemblies()); - - public static IServiceCollection AddAutoInject(this IServiceCollection services, IEnumerable assemblies) - => services.AddAutoInjectCore(assemblies); - - public static IServiceCollection AddAutoInject(this IServiceCollection services, params Assembly[] assemblies) - => services.AddAutoInjectCore(assemblies); - - /// - /// Automatic registration from an assembly containing the specified type - /// - /// - /// - /// - public static IServiceCollection AddAutoInject(this IServiceCollection services, IEnumerable handlerAssemblyMarkerTypes) - => services.AddAutoInjectCore(handlerAssemblyMarkerTypes.Select(t => t.GetTypeInfo().Assembly).Distinct().ToArray()); - - /// - /// Automatic registration from an assembly containing the specified type - /// - /// - /// - /// - public static IServiceCollection AddAutoInject(this IServiceCollection services, params Type[] handlerAssemblyMarkerTypes) - => services.AddAutoInjectCore(handlerAssemblyMarkerTypes.Select(t => t.GetTypeInfo().Assembly).Distinct().ToArray()); - - private static IServiceCollection AddAutoInjectCore(this IServiceCollection services, IEnumerable assemblies) - { - if (services.Any()) - return services; - - services.AddSingleton(); - services.TryAddSingleton(); - services.TryAddSingleton(); - var typeProvider = services.GetInstance(); - var serviceDescriptors = typeProvider.GetServiceDescriptors(typeProvider.GetAllTypes(assemblies)); - - var registrar = services.GetInstance(); - foreach (var descriptor in serviceDescriptors) - registrar.Add(services, descriptor.ServiceType, descriptor.ImplementationType, descriptor.Lifetime); - - if (!serviceDescriptors.Any(d => d.AutoFire)) - return services; - - var serviceProvider = services.BuildServiceProvider(); - foreach (var descriptor in serviceDescriptors.Where(d => d.AutoFire)) - serviceProvider.GetService(descriptor.ServiceType); - - return services; - } - - /// - /// Auto add all service to IoC, lifecycle is scoped - /// - /// - /// default is Service - /// - public static IServiceCollection AddServices(this IServiceCollection services, string suffix, bool autoFire) - => services.AddServices(suffix, autoFire, Assembly.GetEntryAssembly()!); - - /// - /// Auto add all service to IoC, lifecycle is scoped - /// - /// - /// default is Service - /// - /// - /// - public static IServiceCollection AddServices(this IServiceCollection services, string suffix, bool autoFire, - params Assembly[] assemblies) - => (from type in assemblies.SelectMany(assembly => assembly.GetTypes()) - where !type.IsAbstract && type.Name.EndsWith(suffix) - select type).AddScoped(services, autoFire); - - /// - /// Auto add all service to IoC, lifecycle is scoped - /// - /// - /// - /// - /// - public static IServiceCollection AddServices(this IServiceCollection services, bool autoFire) - => services.AddServices(autoFire, Assembly.GetEntryAssembly()!); - - /// - /// Auto add all service to IoC, lifecycle is scoped - /// - /// - /// - /// - /// - /// - public static IServiceCollection AddServices(this IServiceCollection services, bool autoFire, params Assembly[] assemblies) - => (from type in assemblies.SelectMany(assembly => assembly.GetTypes()) - where !type.IsAbstract && BaseOf(type) - select type).AddScoped(services, autoFire); - - private static IServiceCollection AddScoped(this IEnumerable serviceTypes, IServiceCollection services, bool autoFire) - { - foreach (var serviceType in serviceTypes) - { - services.AddScoped(serviceType); - } - - if (autoFire) - { - foreach (var serviceType in serviceTypes) - { - services.BuildServiceProvider().GetService(serviceType); - } - } - - return services; - } - - private static bool BaseOf(Type type) - { - if (type.BaseType == typeof(T)) return true; - - return type.BaseType != null && BaseOf(type.BaseType); - } - - private class DependencyInjectionService - { - - } -} diff --git a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/_Imports.cs b/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/_Imports.cs deleted file mode 100644 index 7e42c75d0..000000000 --- a/src/Utils/Extensions/DependencyInjection/src/Masa.Utils.Extensions.DependencyInjection/_Imports.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.DependencyInjection.Options; -global using System.Reflection; diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs deleted file mode 100644 index b5a8f6f04..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Models; - -namespace Masa.Utils.Extensions.DependencyInjection.Tests; - -[TestClass] -public class DependencyInjectionTest -{ - private DefaultTypeProvider _typeProvider = default!; - private IEnumerable _allTypes = default!; - - [TestInitialize] - public void Initialize() - { - _typeProvider = new DefaultTypeProvider(); - _allTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(assembly => assembly.GetTypes()); - } - - [TestMethod] - public void TestSkip() - { - Assert.IsFalse(_typeProvider.IsSkip(typeof(BaseService))); - Assert.IsTrue(_typeProvider.IsSkip(typeof(GoodsBaseService))); - Assert.IsFalse(_typeProvider.IsSkip(typeof(GoodsService))); - Assert.IsFalse(_typeProvider.IsSkip(typeof(NullCalculateProviderService))); - Assert.IsTrue(_typeProvider.IsSkip(typeof(OrderBaseService))); - Assert.IsTrue(_typeProvider.IsSkip(typeof(OrderService))); - Assert.IsTrue(_typeProvider.IsSkip(typeof(UserBaseService))); - Assert.IsFalse(_typeProvider.IsSkip(typeof(UserService))); - } - - [TestMethod] - public void TestGetServiceTypesReturnCountIs5() - { - var serviceTypes = _typeProvider.GetServiceTypes(_allTypes.ToList(), typeof(ISingletonDependency)); - Assert.IsTrue(serviceTypes.Count == 5); - } - - [TestMethod] - public void TestGetImplementationTypesReturnCountIs1() - { - var implementationTypes = _typeProvider.GetImplementationTypes(_allTypes.ToList(), typeof(ICalculateProviderService)); - Assert.IsTrue(implementationTypes.Count == 1); - - implementationTypes = _typeProvider.GetImplementationTypes(_allTypes.ToList(), typeof(BaseService)); - Assert.IsTrue(implementationTypes.Count == 1); - } - - [TestMethod] - public void TestAssignableFrom() - { - Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(ICalculateProviderService), typeof(NullCalculateProviderService))); - Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(ISingletonDependency), typeof(ICalculateProviderService))); - - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(NullCalculateProviderService), typeof(ICalculateProviderService))); - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(ICalculateProviderService), typeof(ISingletonDependency))); - - Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(BaseService), typeof(UserBaseService))); - Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(BaseService), typeof(UserService))); - Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(UserBaseService), typeof(UserService))); - - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserBaseService), typeof(BaseService))); - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserService), typeof(BaseService))); - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserService), typeof(UserBaseService))); - - Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository<>), typeof(BaseRepository<>))); - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(IRepository<>), typeof(BaseRepository))); - Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository), typeof(BaseRepository))); - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(BaseRepository<>), typeof(IRepository<>))); - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(BaseRepository), typeof(IRepository))); - - Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository<,>), typeof(UserRepository<>))); - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(IRepository), typeof(UserRepository<>))); - Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserRepository<>), typeof(IRepository<,>))); - Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository), typeof(UserRepository))); - } - - [TestMethod] - public void TestAssignableTo() - { - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(ICalculateProviderService), typeof(NullCalculateProviderService))); - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(ISingletonDependency), typeof(ICalculateProviderService))); - - Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(NullCalculateProviderService), typeof(ICalculateProviderService))); - Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(ICalculateProviderService), typeof(ISingletonDependency))); - - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(BaseService), typeof(UserBaseService))); - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(BaseService), typeof(UserService))); - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(UserBaseService), typeof(UserService))); - - Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserBaseService), typeof(BaseService))); - Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserService), typeof(BaseService))); - Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserService), typeof(UserBaseService))); - - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository<>), typeof(BaseRepository<>))); - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository<>), typeof(BaseRepository))); - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository), typeof(BaseRepository))); - Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(BaseRepository<>), typeof(IRepository<>))); - Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(BaseRepository), typeof(IRepository))); - - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository<,>), typeof(UserRepository<>))); - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository), typeof(UserRepository<>))); - Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserRepository<>), typeof(IRepository<,>))); - Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository), typeof(UserRepository))); - } - - [TestMethod] - public void TestAddAutoInject() - { - var services = new ServiceCollection(); - services.AddAutoInject(); - var serviceProvider = services.BuildServiceProvider(); - var calculateProviderService = serviceProvider.GetService(); - Assert.IsNotNull(calculateProviderService); - Assert.IsNull(serviceProvider.GetService()); - - Assert.IsTrue(BaseService.Count == 1); - var serviceBase = serviceProvider.GetService(); - Assert.IsNotNull(serviceBase); - - var userBaseService = serviceProvider.GetService(); - Assert.IsNull(userBaseService); - - Assert.IsTrue(UserService.UserCount == 1); - var userService = serviceProvider.GetService(); - Assert.IsNotNull(userService); - - var goodsBaseService = serviceProvider.GetService(); - Assert.IsNull(goodsBaseService); - - Assert.IsTrue(GoodsService.GoodsCount == 1); - var goodsService = serviceProvider.GetService(); - Assert.IsNotNull(goodsService); - - var orderBaseService = serviceProvider.GetService(); - Assert.IsNull(orderBaseService); - - var orderService = serviceProvider.GetService(); - Assert.IsNull(orderService); - } - - [TestMethod] - public void TestAddAutoInjectAndEmptyAssemblyReturnServiceIsNull() - { - var services = new ServiceCollection(); - services.AddAutoInject(Array.Empty()); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNull(serviceProvider.GetService>()); - Assert.IsNull(serviceProvider.GetService()); - } - - [TestMethod] - public void TestAddAutoInjectMultiReturnCountIs1() - { - var services = new ServiceCollection(); - services - .AddAutoInject(typeof(IRepository<>).Assembly) - .AddAutoInject(typeof(IRepository<>).Assembly); - var serviceProvider = services.BuildServiceProvider(); - Assert.IsNotNull(serviceProvider.GetService>()); - Assert.IsTrue(serviceProvider.GetServices>().Count() == 1); - } - - [TestMethod] - public void TestAny() - { - var services = new ServiceCollection(); - Assert.IsFalse(services.Any()); - Assert.IsFalse(services.Any(ServiceLifetime.Singleton)); - services.AddScoped(); - Assert.IsTrue(services.Any()); - Assert.IsFalse(services.Any(ServiceLifetime.Singleton)); - Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); - Assert.IsFalse(services.Any(ServiceLifetime.Transient)); - } - - [TestMethod] - public void TestDependencyReturnProviderServiceIs1() - { - var services = new ServiceCollection(); - services.AddAutoInject(); - var serviceProvider = services.BuildServiceProvider(); - var factories = serviceProvider.GetServices().ToList(); - Assert.IsTrue(factories.Count == 1); - - Assert.IsTrue(factories[0].GetClientName() == nameof(CustomizeClientFactory)); - } -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs deleted file mode 100644 index 4af51dc42..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Models; - -public class User -{ - public Guid Id { get; set; } - - public string Name { get; set; } = default!; -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs deleted file mode 100644 index d363a2f37..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Repositories; - -public interface IRepository : IScopedDependency - where TEntity : class -{ - -} - -public interface IRepository : IScopedDependency - where TEntity : class - where TDbContext : class -{ - -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs deleted file mode 100644 index ddac42e82..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; - -public interface ICalculateProviderService : ISingletonDependency -{ - string Name { get; } -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs deleted file mode 100644 index 1838c2b90..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; - -public interface IClientFactory : ISingletonDependency -{ - string GetClientName(); -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs deleted file mode 100644 index 71e1049fb..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Repositories; - -public abstract class BaseRepository : IRepository - where TEntity : class -{ - -} - -public class Repository : BaseRepository - where TEntity : class -{ - -} - -public class UserRepository : IRepository - where TEntity : class -{ - -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs deleted file mode 100644 index 6970d36a4..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -public class BaseService : ISingletonDependency, IAutoFireDependency -{ - public static int Count { get; set; } = 0; - - public BaseService() - { - Count++; - } - - public BaseService(bool isChildren) - { - - } -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs deleted file mode 100644 index 3cafaac57..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -[Dependency(ReplaceServices = true)] -public class CustomizeClientFactory : IClientFactory -{ - public string GetClientName() => nameof(CustomizeClientFactory); -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs deleted file mode 100644 index 71f985d86..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -public class EmptyClientFactory : IClientFactory -{ - public string GetClientName() => nameof(EmptyClientFactory); -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs deleted file mode 100644 index 12bc32ea4..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -[IgnoreInjection] -public class GoodsBaseService : BaseService -{ - public GoodsBaseService() : base(true) - { - } -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs deleted file mode 100644 index 7e37ed57a..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -public class GoodsService : GoodsBaseService -{ - public static int GoodsCount { get; set; } = 0; - - public GoodsService() - { - GoodsCount++; - } -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs deleted file mode 100644 index 969a46ac6..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -public class NullCalculateProviderService : ICalculateProviderService -{ - public string Name => string.Empty; -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs deleted file mode 100644 index 3122560e1..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -[IgnoreInjection(true)] -public class OrderBaseService : BaseService -{ - public OrderBaseService() : base(true) - { - } -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs deleted file mode 100644 index 3c36039d8..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -public class OrderService : OrderBaseService -{ -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs deleted file mode 100644 index d6bf617fc..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -public abstract class UserBaseService : BaseService -{ - public UserBaseService() : base(true) - { - } -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs deleted file mode 100644 index ae22aec6c..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; - -public class UserService : UserBaseService -{ - public static int UserCount { get; set; } = 0; - - public UserService() - { - UserCount++; - } -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs deleted file mode 100644 index bbd222358..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure; - -public class UserDbContext -{ - -} diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj deleted file mode 100644 index d77d5f13c..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net6.0 - enable - enable - false - - - - - - - - - - - - - - diff --git a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs b/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs deleted file mode 100644 index 15641777d..000000000 --- a/src/Utils/Extensions/DependencyInjection/test/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Repositories; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System.Reflection; -global using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; -global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure; -global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Repositories; -global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; diff --git a/src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj b/src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/TypeExtensions.cs b/src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/TypeExtensions.cs deleted file mode 100644 index 6d6373546..000000000 --- a/src/Utils/Extensions/DotNet/src/Masa.Utils.Extensions.DotNet/TypeExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public static class TypeExtensions -{ - public static string GetGenericTypeName(this Type type) - { - string typeName; - - if (type.IsGenericType) - { - var genericTypes = string.Join(",", type.GetGenericArguments().Select(t => t.Name).ToArray()); - typeName = $"{type.Name.Remove(type.Name.IndexOf('`'))}<{genericTypes}>"; - } - else - { - typeName = type.Name; - } - - return typeName; - } - - public static string GetGenericTypeName(this object @object) - => @object.GetType().GetGenericTypeName(); -} diff --git a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumExtensions.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumExtensions.cs deleted file mode 100644 index 21882d7ae..000000000 --- a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public static class EnumExtensions -{ - public static DescriptionAttribute GetDescription(this Enum enumSubitem) - { - string value = enumSubitem.ToString(); - - var fieldInfo = enumSubitem.GetType().GetField(value); - - if (fieldInfo != null) - { - var attributes = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false); - - if (attributes == null || attributes.Length == 0) - { - return new DescriptionAttribute(value); - } - else - { - return (DescriptionAttribute)attributes[0]; - } - } - else - { - return new DescriptionAttribute(); - } - } - - public static T? GetAttribute(this Enum enumSubitem) - where T : Attribute, new() - => EnumUtil.GetSubitemAttribute(enumSubitem); -} diff --git a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumUtil.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumUtil.cs deleted file mode 100644 index fd2004b22..000000000 --- a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/EnumUtil.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public class EnumUtil -{ - public static T? GetSubitemAttribute(object enumSubitem) - where T : Attribute, new() - { - if (enumSubitem == null) - return null; - - string value = enumSubitem.ToString() ?? ""; - - var fieldInfo = enumSubitem.GetType().GetField(value); - - if (fieldInfo != null) - { - var attributes = fieldInfo.GetCustomAttributes(typeof(T), false); - - if (attributes == null || attributes.Length == 0) - { - return new T(); - } - else - { - return attributes[0] as T; - } - } - else - { - return new T(); - } - } -} diff --git a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Model/EnumObject.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Model/EnumObject.cs deleted file mode 100644 index 88ae47fe1..000000000 --- a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/Model/EnumObject.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public class EnumObject -{ - public string Name { get; set; } = default!; - - public TValue Value { get; set; } = default!; -} diff --git a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Enum.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Enum.cs deleted file mode 100644 index c25637d33..000000000 --- a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Enum.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System; - -public class Enum - where TEnum : Enum -{ - public static List GetAttributes() - where TAttribute : Attribute, new() - { - var enumType = typeof(TEnum); - var names = Enum.GetNames(enumType); - var result = names.Select(name => EnumUtil.GetSubitemAttribute(Enum.Parse(enumType, name))!).ToList(); - - return result; - } - - public static Dictionary GetDictionary() - where TAttribute : Attribute, new() - { - var enumType = typeof(TEnum); - - return Enum.GetNames(enumType) - .Select(name => (TEnum)Enum.Parse(enumType, name)) - .ToDictionary(@enum => @enum, @enum => EnumUtil.GetSubitemAttribute(@enum)!); - } - - public static List GetItems() - { - var enumType = typeof(TEnum); - - return Enum.GetNames(enumType) - .Select(name => (TEnum)Enum.Parse(enumType, name)).ToList(); - } - - public static List> GetEnumObjectList(bool withAll = false, string allName = "所有", int allValue = 0) - => GetEnumObjectList(withAll, allName, allValue); - - public static List> GetEnumObjectList(bool withAll = false, string allName = "所有", TValue? allValue = default) - { - var enumType = typeof(TEnum); - - var lstResult = Enum.GetNames(enumType).Select(name => - { - var fieldInfo = enumType.GetField(name); - if (fieldInfo != null) - { - var attribute = fieldInfo.GetCustomAttribute(false); - if (attribute == null) - { - return new EnumObject() - { - Name = name, - Value = (TValue)Enum.Parse(enumType, name) - }; - } - else - { - return new EnumObject() - { - Name = attribute.Description, - Value = (TValue)Enum.Parse(enumType, name) - }; - } - } - else - { - return new EnumObject() - { - Name = name, - Value = (TValue)Enum.Parse(enumType, name) - }; - } - }).Where(p => p != null).ToList(); - - if (withAll) - { - lstResult.Insert(0, new EnumObject - { - Name = allName, - Value = (TValue)Enum.Parse(enumType, allValue?.ToString() ?? string.Empty) - }); - } - - return lstResult; - } - - public static Dictionary GetEnumObjectDictionary(bool withAll = false, string allName = "所有", int allValue = 0) - { - return GetEnumObjectDictionary(withAll, allName, allValue); - } - - public static Dictionary GetEnumObjectDictionary(bool withAll = false, string allName = "所有", TValue allValue = default!) - where TValue : notnull - { - Dictionary keyValues = new Dictionary(); - var enumType = typeof(TEnum); - - if (withAll) - { - keyValues.Add(allValue, allName); - } - - foreach (var value in Enum.GetValues(enumType)) - { - string val = value?.ToString() ?? string.Empty; - var fieldInfo = enumType.GetField(val); - var attribute = fieldInfo!.GetCustomAttribute(false); - - keyValues.Add((TValue)Enum.Parse(enumType, val), attribute?.Description ?? val); - } - - return keyValues; - } -} diff --git a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Imports.cs b/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Imports.cs deleted file mode 100644 index f0a35bd38..000000000 --- a/src/Utils/Extensions/Enums/src/Masa.Utils.Extensions.Enums/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using System.ComponentModel; -global using System.Reflection; diff --git a/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs b/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs deleted file mode 100644 index f7d0c888d..000000000 --- a/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace System.Linq.Expressions; - -public static class ExpressionExtensions -{ - public static Expression> And(this Expression> first, Expression> second) - { - return first.Compose(second, Expression.And); - } - - public static Expression> And(this Expression> first, bool isCompose, Expression>? second) - { - if (isCompose && second != null) - return first.Compose(second, Expression.And); - - return first; - } - - public static Expression> Or(this Expression> first, Expression> second) - { - return first.Compose(second, Expression.Or); - } - - public static Expression> Or(this Expression> first, bool isCompose, Expression>? second) - { - if (isCompose && second != null) - return first.Compose(second, Expression.Or); - - return first; - } - - public static Expression Compose(this Expression first, Expression second, Func merge) - { - var parameterMap = first.Parameters.Select((f, i) => new { f, s = second.Parameters[i] }).ToDictionary(p => p.s, p => p.f); - - var secondBody = ParameterRebinder.ReplaceParameters(parameterMap, second.Body); - - return Expression.Lambda(merge(first.Body, secondBody), first.Parameters); - } - - #region GetMemberName - - public static List GetMemberName(this Expression expression) - where T : BinaryExpression - { - var result = new List(); - var expressionBody = expression.Body; - if (expressionBody is BinaryExpression) - { - result.AddRange(ParseBinaryExpression(expressionBody)); - } - - return result; - } - - private static List ParseBinaryExpression(Expression expression) - { - var result = new List(); - var binaryExpression = expression as BinaryExpression; - - if (binaryExpression!.Left != null) - result.AddRange(ParseUnitExpression(binaryExpression.Left)); - - if (binaryExpression.Right != null) - result.AddRange(ParseUnitExpression(binaryExpression.Right)); - - return result; - } - - private static List ParseUnitExpression(Expression unitExpression) - { - var result = new List(); - - if (unitExpression is BinaryExpression) - { - result.AddRange(ParseBinaryExpression((unitExpression as BinaryExpression)!)); - } - else if (unitExpression is MemberExpression) - { - var memberExpression = unitExpression as MemberExpression; - var pi = memberExpression!.Member as PropertyInfo; - result.Add(pi!.Name); - } - - return result; - } - - #endregion - -} - -public class ParameterRebinder : ExpressionVisitor -{ - private readonly Dictionary map; - - public ParameterRebinder(Dictionary map) - { - this.map = map ?? new Dictionary(); - } - - public static Expression ReplaceParameters(Dictionary map, Expression exp) - { - return new ParameterRebinder(map).Visit(exp); - } - - protected override Expression VisitParameter(ParameterExpression p) - { - ParameterExpression replacement; - if (map.TryGetValue(p, out replacement!)) - { - p = replacement; - } - return base.VisitParameter(p); - } -} diff --git a/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj b/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj deleted file mode 100644 index ea64c3225..000000000 --- a/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - net6.0 - enable - enable - System.Linq.Expressions - - - diff --git a/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/_Imports.cs b/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/_Imports.cs deleted file mode 100644 index da9630c2d..000000000 --- a/src/Utils/Extensions/Expressions/src/Masa.Utils.Extensions.Expressions/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using System.Reflection; diff --git a/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs b/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs deleted file mode 100644 index 7a3c4fe5f..000000000 --- a/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace FluentValidation; - -public static class FluentValidationExtensions -{ - public static IRuleBuilderOptions Chinese(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.CHINESE) - .WithMessage("Can only input chinese of {PropertyName}"); - } - - public static IRuleBuilderOptions Number(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.NUMBER) - .WithMessage("Can only input number of {PropertyName}"); - } - - public static IRuleBuilderOptions Letter(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.LETTER) - .WithMessage("Can only input letter of {PropertyName}"); - } - - public static IRuleBuilderOptions LowerLetter(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.LOWER_LETTER) - .WithMessage("Can only input lower letter of {PropertyName}"); - } - - public static IRuleBuilderOptions UpperLetter(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.UPPER_LETTER) - .WithMessage("Can only input upper letter of {PropertyName}"); - } - - public static IRuleBuilderOptions LetterNumber(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.LETTER_NUMBER) - .WithMessage("Can only input upper letter and number of {PropertyName}"); - } - - public static IRuleBuilderOptions ChineseLetter(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.CHINESE_LETTER) - .WithMessage("Can only input upper chinese and letter of {PropertyName}"); - } - - public static IRuleBuilderOptions ChineseLetterNumber(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.CHINESE_LETTER_NUMBER) - .WithMessage("Can only input upper chinese and letter and number of {PropertyName}"); - } - - public static IRuleBuilderOptions Phone(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.PHONE) - .WithMessage("{PropertyName} format is incorrect"); - } - - public static IRuleBuilderOptions Email(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.EMAIL) - .WithMessage("{PropertyName} format is incorrect"); - } - - public static IRuleBuilderOptions IdCard(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.IDCARD) - .WithMessage("{PropertyName} format is incorrect"); - } - - public static IRuleBuilderOptions Url(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.URL) - .WithMessage("{PropertyName} format is incorrect"); - } - - public static IRuleBuilderOptions MinLength(this IRuleBuilder ruleBuilder, int minimumLength) - { - return ruleBuilder.MinimumLength(minimumLength) - .WithMessage("Please enter a number greater than {MinLength} of {PropertyName}"); - } - - public static IRuleBuilderOptions MaxLength(this IRuleBuilder ruleBuilder, int maximumLength) - { - return ruleBuilder.MaximumLength(maximumLength) - .WithMessage("Please enter a number less than {MaxLength} of {PropertyName}"); - } - - public static IRuleBuilderOptions Port(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.Matches(RegularHelper.PORT) - .WithMessage("Is not a valid port {PropertyName}"); - } - - public static IRuleBuilderOptions Required(this IRuleBuilder ruleBuilder) - { - return ruleBuilder.NotNull() - .NotEmpty() - .WithMessage("{PropertyName} is required"); - } -} diff --git a/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj b/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj deleted file mode 100644 index acea0bb77..000000000 --- a/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - diff --git a/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs b/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs deleted file mode 100644 index ccfcbe16e..000000000 --- a/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Extensions.Validations.FluentValidation; - -internal static class RegularHelper -{ - internal const string CHINESE = "^\\s{0}$|^[\u4e00-\u9fa5]+$"; - internal const string NUMBER = "^\\s{0}$|^[0-9]+$"; - internal const string LETTER = "^\\s{0}$|^[a-zA-Z]+$"; - internal const string LOWER_LETTER = "^\\s{0}$|^[a-z]+$"; - internal const string UPPER_LETTER = "^\\s{0}$|^[A-Z]+$"; - internal const string LETTER_NUMBER = "^\\s{0}$|^[a-zA-Z0-9]+$"; - internal const string CHINESE_LETTER_NUMBER = "^\\s{0}$|^[\u4e00-\u9fa5_a-zA-Z0-9]+$"; - internal const string CHINESE_LETTER = "^\\s{0}$|^[\u4e00-\u9fa5_a-zA-Z]+$"; - internal const string PHONE = @"^\s{0}$|^((\+86)|(86))?(1[3-9][0-9])\d{8}$"; - internal const string IDCARD = "^\\s{0}$|(^\\d{15}$)|(^\\d{17}([0-9]|X|x)$)"; - internal const string EMAIL = @"^\s{0}$|^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"; - internal const string URL = "^\\s{0}$|[a-zA-z]+://[^s]*"; - internal const string PORT = "^\\s{0}$|^([1-9]|[1-9]\\d|[1-9]\\d{2}|[1-9]\\d{3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$"; -} diff --git a/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs b/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs deleted file mode 100644 index 53b8299c9..000000000 --- a/src/Utils/Extensions/Validations/src/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Extensions.Validations.FluentValidation; diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs deleted file mode 100644 index 246974047..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Ldap.Novell.Entries; - -public class LdapAddress -{ - public string Street { get; set; } = string.Empty; - - public string PostalCode { get; set; } = string.Empty; - - public string City { get; set; } = string.Empty; - - public string StateName { get; set; } = string.Empty; - - public string CountryName { get; set; } = string.Empty; - - public string CountryCode { get; set; } = string.Empty; -} diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs deleted file mode 100644 index 39657d1ef..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Ldap.Novell.Entries; - -public class LdapUser -{ - /// - /// ObjectSID contains the value for the Security Identifier (SID) of the entry. - /// - public string ObjectSid { get; set; } = string.Empty; - - /// - /// ObjectGUID is an Attribute-Names which represents a Universally Unique Identifier as used in Microsoft Active Directory. - /// - public string ObjectGuid { get; set; } = string.Empty; - - public string ObjectCategory { get; set; } = string.Empty; - - public string ObjectClass { get; set; } = string.Empty; - - public string Name { get; set; } = string.Empty; - - public string CommonName { get; set; } = string.Empty; - - public string DistinguishedName { get; set; } = string.Empty; - - public string SamAccountName { get; set; } = string.Empty; - - public int SamAccountType { get; set; } - - public string[] MemberOf { get; set; } = Array.Empty(); - - public bool IsDomainAdmin { get; set; } - - public string UserPrincipalName { get; set; } = string.Empty; - - public string DisplayName { get; set; } = string.Empty; - - public string FirstName { get; set; } = string.Empty; - - public string LastName { get; set; } = string.Empty; - - public string FullName => $"{FirstName} {LastName}"; - - public string EmailAddress { get; set; } = string.Empty; - - public string Description { get; set; } = string.Empty; - - public string Phone { get; set; } = string.Empty; - - public LdapAddress Address { get; set; } = new(); -} diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs deleted file mode 100644 index ca6c1fb47..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Ldap.Novell.Extensions; - -public static class LdapAttributeSetExtensions -{ - public static void AddAttribute(this LdapAttributeSet ldapAttributes, string name, string value) - { - if (!string.IsNullOrEmpty(value)) - { - ldapAttributes.Add(new LdapAttribute(name, value)); - } - } - - public static string GetString(this LdapAttributeSet ldapAttributes, string name) - { - ldapAttributes.TryGetValue(name, out var value); - return value?.StringValue ?? ""; - } - - public static string[] GetStringArray(this LdapAttributeSet ldapAttributes, string name) - { - ldapAttributes.TryGetValue(name, out var value); - return value?.StringValueArray ?? new string[] { }; - } -} diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs deleted file mode 100644 index 0e5efa08f..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - private static IServiceCollection AddLadpContext(this IServiceCollection services, Action optionsAction) - { - services.Configure(optionsAction); - services.AddSingleton(typeof(ILdapProvider), typeof(LdapProvider)); - return services; - } - - public static IServiceCollection AddLadpContext(this IServiceCollection services, IConfiguration configuration) - { - services.Configure(configuration); - services.AddSingleton(typeof(ILdapProvider), typeof(LdapProvider)); - return services; - } - - public static IServiceCollection AddLadpContext(this IServiceCollection services) - { - services.AddSingleton(typeof(ILdapFactory), typeof(LdapFactory)); - return services; - } -} diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapFactory.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapFactory.cs deleted file mode 100644 index a3e0963ba..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapFactory.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Ldap.Novell; - -public interface ILdapFactory -{ - ILdapProvider CreateProvider(LdapOptions ldapOptions); -} diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapProvider.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapProvider.cs deleted file mode 100644 index b85bbca1a..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/ILdapProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Ldap.Novell; - -public interface ILdapProvider -{ - Task GetGroupAsync(string groupName); - - IAsyncEnumerable GetUsersInGroupAsync(string groupName); - - Task GetUsersByEmailAddressAsync(string emailAddress); - - Task GetUserByUserNameAsync(string userName); - - IAsyncEnumerable GetAllUserAsync(); - - Task> GetPagingUserAsync(int pageSize); - - Task AddUserAsync(LdapUser user, string password); - - Task DeleteUserAsync(string distinguishedName); - - Task AuthenticateAsync(string distinguishedName, string password); -} diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapFactory.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapFactory.cs deleted file mode 100644 index 679bd4e14..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapFactory.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Ldap.Novell; - -public class LdapFactory : ILdapFactory -{ - public ILdapProvider CreateProvider(LdapOptions ldapOptions) - { - return new LdapProvider(ldapOptions); - } -} diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapOptions.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapOptions.cs deleted file mode 100644 index 93b255cc9..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapOptions.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Ldap.Novell; - -public class LdapOptions -{ - public string ServerAddress { get; set; } = null!; - - public int ServerPort { get; set; } - - public int ServerPortSsl { get; set; } - - public string BaseDn { get; set; } = null!; - - private string _userSearchBaseDn = string.Empty; - - public string UserSearchBaseDn - { - get - { - if (string.IsNullOrEmpty(_userSearchBaseDn)) - { - return BaseDn; - } - return _userSearchBaseDn; - } - set { _userSearchBaseDn = value; } - } - - private string _groupSearchBaseDn = string.Empty; - - public string GroupSearchBaseDn - { - get - { - if (string.IsNullOrEmpty(_groupSearchBaseDn)) - { - return BaseDn; - } - return _groupSearchBaseDn; - } - set { _groupSearchBaseDn = value; } - } - - public string RootUserDn { get; set; } = null!; - - public string RootUserPassword { get; set; } = null!; -} diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapProvider.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapProvider.cs deleted file mode 100644 index 40231b016..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/LdapProvider.cs +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Ldap.Novell; - -public class LdapProvider : ILdapProvider, IDisposable -{ - ILdapConnection ldapConnection = null!; - LdapOptions _ldapOptions; - - private readonly string[] _attributes = - { - "objectSid", "objectGUID", "objectCategory", "objectClass", "memberOf", "name", "cn", "distinguishedName", - "sAMAccountName", "userPrincipalName", "displayName", "givenName", "sn", "description", - "telephoneNumber", "mail", "streetAddress", "postalCode", "l", "st", "co", "c" - }; - - internal LdapProvider(LdapOptions options) - { - _ldapOptions = options; - } - - public LdapProvider(IOptionsSnapshot options) - { - _ldapOptions = options.Value; - } - - private async Task GetConnectionAsync() - { - if (ldapConnection != null && ldapConnection.Connected) - { - return ldapConnection; - } - ldapConnection = new LdapConnection() { SecureSocketLayer = _ldapOptions.ServerPortSsl != 0 }; - //Connect function will create a socket connection to the server - Port 389 for insecure and 3269 for secure - await ldapConnection.ConnectAsync(_ldapOptions.ServerAddress, - _ldapOptions.ServerPortSsl != 0 ? _ldapOptions.ServerPortSsl : _ldapOptions.ServerPort); - //Bind function with null user dn and password value will perform anonymous bind to LDAP server - await ldapConnection.BindAsync(_ldapOptions.RootUserDn, _ldapOptions.RootUserPassword); - - return ldapConnection; - } - - public async Task AuthenticateAsync(string distinguishedName, string password) - { - using var ldapConnection = new LdapConnection() { SecureSocketLayer = _ldapOptions.ServerPortSsl != 0 }; - await ldapConnection.ConnectAsync(_ldapOptions.ServerAddress, - ldapConnection.SecureSocketLayer ? _ldapOptions.ServerPortSsl : _ldapOptions.ServerPort); - try - { - await ldapConnection.BindAsync(distinguishedName, password); - return true; - } - catch (Exception) - { - return false; - } - } - - public async Task DeleteUserAsync(string distinguishedName) - { - using (var ldapConnection = await GetConnectionAsync()) - { - await ldapConnection.DeleteAsync(distinguishedName); - } - } - - public async Task AddUserAsync(LdapUser user, string password) - { - var dn = $"CN={user.FirstName} {user.LastName},{_ldapOptions.UserSearchBaseDn}"; - - var attributeSet = new LdapAttributeSet - { - new LdapAttribute("instanceType", "4"), - new LdapAttribute("objectCategory", $"CN=Users,{_ldapOptions.UserSearchBaseDn}"), - new LdapAttribute("objectClass", new[] {"top", "person", "organizationalPerson", "user"}), - new LdapAttribute("name", user.Name), - new LdapAttribute("cn", $"{user.FirstName} {user.LastName}"), - new LdapAttribute("sAMAccountName", user.SamAccountName), - new LdapAttribute("userPrincipalName", user.UserPrincipalName), - new LdapAttribute("unicodePwd", Convert.ToBase64String(Encoding.Unicode.GetBytes($"\"{password}\""))), - new LdapAttribute("userAccountControl", "512"), - new LdapAttribute("givenName", user.FirstName), - new LdapAttribute("sn", user.LastName), - new LdapAttribute("mail", user.EmailAddress) - }; - - attributeSet.AddAttribute("displayName", user.DisplayName); - attributeSet.AddAttribute("description", user.Description); - attributeSet.AddAttribute("telephoneNumber", user.Phone); - attributeSet.AddAttribute("streetAddress", user.Address.Street); - attributeSet.AddAttribute("l", user.Address.City); - attributeSet.AddAttribute("postalCode", user.Address.PostalCode); - attributeSet.AddAttribute("st", user.Address.StateName); - attributeSet.AddAttribute("co", user.Address.CountryName); - attributeSet.AddAttribute("c", user.Address.CountryCode); - - var newEntry = new LdapEntry(dn, attributeSet); - - using var ldapConnection = await GetConnectionAsync(); - await ldapConnection.AddAsync(newEntry); - } - - public async IAsyncEnumerable GetAllUserAsync() - { - var filter = $"(&(objectCategory=person)(objectClass=user))"; - var users = GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter); - await foreach (var user in users) - { - yield return CreateUser(user.Dn, user.GetAttributeSet()); - } - } - - public async Task> GetPagingUserAsync(int pageSize) - { - using var ldapConnection = await GetConnectionAsync(); - return await ldapConnection.SearchUsingSimplePagingAsync(new SearchOptions( - _ldapOptions.UserSearchBaseDn, - LdapConnection.ScopeSub, - "(&(objectCategory=person)(objectClass=user))", - _attributes), - pageSize); - } - - public async Task GetUserByUserNameAsync(string userName) - { - var filter = $"(&(objectClass=user)(sAMAccountName={userName}))"; - var user = await GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter).FirstOrDefaultAsync(); - return user == null ? null : CreateUser(user.Dn, user.GetAttributeSet()); - } - - public async Task GetUsersByEmailAddressAsync(string emailAddress) - { - var filter = $"(&(objectClass=user)(mail={emailAddress}))"; - var user = await GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter).FirstOrDefaultAsync(); - return user == null ? null : CreateUser(user.Dn, user.GetAttributeSet()); - } - - private async IAsyncEnumerable GetFilterLdapEntryAsync(string baseDn, string filter) - { - using var ldapConnection = await GetConnectionAsync(); - var searchResults = await ldapConnection.SearchAsync( - baseDn, - LdapConnection.ScopeSub, - filter, - _attributes, - false); - await foreach (var searchResult in searchResults) - { - yield return searchResult; - } - } - - public async IAsyncEnumerable GetUsersInGroupAsync(string groupName) - { - var group = await GetGroupAsync(groupName); - if (group == null) - { - yield break; - } - var filter = $"(&(objectCategory=person)(objectClass=user)(memberOf={group.Dn}))"; - var users = GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter); - - await foreach (var user in users) - { - yield return CreateUser(user.Dn, user.GetAttributeSet()); - } - } - - public async Task GetGroupAsync(string groupName) - { - var filter = $"(&(objectCategory=group)(objectClass=group)(cn={groupName}))"; - return await GetFilterLdapEntryAsync(_ldapOptions.GroupSearchBaseDn, filter) - .FirstOrDefaultAsync(); - } - - public void Dispose() - { - if (ldapConnection.Connected) - { - ldapConnection.Disconnect(); - } - if (ldapConnection != null) - { - ldapConnection.Dispose(); - } - } - - private LdapUser CreateUser(string distinguishedName, LdapAttributeSet attributeSet) - { - var ldapUser = new LdapUser(); - - ldapUser.ObjectSid = ObjectSidToString(attributeSet.GetAttribute("objectSid").ByteValue); - ldapUser.ObjectGuid = ObjectGuidToString(attributeSet.GetAttribute("objectGUID").ByteValue); - ldapUser.ObjectCategory = attributeSet.GetString("objectCategory"); - ldapUser.ObjectClass = attributeSet.GetString("objectClass"); - ldapUser.MemberOf = attributeSet.GetStringArray("memberOf"); - ldapUser.CommonName = attributeSet.GetString("cn"); - ldapUser.SamAccountName = attributeSet.GetString("sAMAccountName"); - ldapUser.UserPrincipalName = attributeSet.GetString("userPrincipalName"); - ldapUser.Name = attributeSet.GetString("name"); - ldapUser.DistinguishedName = attributeSet.GetString("distinguishedName"); - ldapUser.DisplayName = attributeSet.GetString("displayName"); - ldapUser.FirstName = attributeSet.GetString("givenName"); - ldapUser.LastName = attributeSet.GetString("sn"); - ldapUser.Description = attributeSet.GetString("description"); - ldapUser.Phone = attributeSet.GetString("telephoneNumber"); - ldapUser.EmailAddress = attributeSet.GetString("mail"); - ldapUser.Address = new LdapAddress - { - Street = attributeSet.GetString("streetAddress"), - City = attributeSet.GetString("l"), - PostalCode = attributeSet.GetString("postalCode"), - StateName = attributeSet.GetString("st"), - CountryName = attributeSet.GetString("co"), - CountryCode = attributeSet.GetString("c") - }; - attributeSet.TryGetValue("sAMAccountType", out var sAMAccountType); - ldapUser.SamAccountType = int.Parse(sAMAccountType?.StringValue ?? "0"); - - ldapUser.IsDomainAdmin = ldapUser.MemberOf.Contains("CN=Domain Admins," + _ldapOptions.BaseDn); - - return ldapUser; - } - - private string ObjectGuidToString(byte[] bytes) - { - var strGUID = ""; - strGUID += AddLeadingZero(bytes[3] & 0xFF); - strGUID += AddLeadingZero(bytes[2] & 0xFF); - strGUID += AddLeadingZero(bytes[1] & 0xFF); - strGUID += AddLeadingZero(bytes[0] & 0xFF); - strGUID += "-"; - strGUID += AddLeadingZero(bytes[5] & 0xFF); - strGUID += AddLeadingZero(bytes[4] & 0xFF); - strGUID += "-"; - strGUID += AddLeadingZero(bytes[7] & 0xFF); - strGUID += AddLeadingZero(bytes[6] & 0xFF); - strGUID += "-"; - strGUID += AddLeadingZero(bytes[8] & 0xFF); - strGUID += AddLeadingZero(bytes[9] & 0xFF); - strGUID += "-"; - strGUID += AddLeadingZero(bytes[10] & 0xFF); - strGUID += AddLeadingZero(bytes[11] & 0xFF); - strGUID += AddLeadingZero(bytes[12] & 0xFF); - strGUID += AddLeadingZero(bytes[13] & 0xFF); - strGUID += AddLeadingZero(bytes[14] & 0xFF); - strGUID += AddLeadingZero(bytes[15] & 0xFF); - - return strGUID; - } - - private string ObjectSidToString(byte[] bytes) - { - StringBuilder strSID = new StringBuilder("S-"); - strSID.Append(bytes[0]).Append('-'); - // bytes[2..7] : - StringBuilder tmpBuff = new StringBuilder(); - for (int t = 2; t <= 7; t++) - { - //var hexString = (bytes[t] & 0xFF).ToString("X"); - //tmpBuff.Append(hexString); - tmpBuff.Append(AddLeadingZero((int)bytes[t] & 0xFF)); - } - strSID.Append(Convert.ToInt64(tmpBuff.ToString(), 16)); - // bytes[1] : the sub authorities count - int count = bytes[1]; - for (int i = 0; i < count; i++) - { - int currSubAuthOffset = i * 4; - tmpBuff.Length = 0; - tmpBuff.Append(string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", - (bytes[11 + currSubAuthOffset] & 0xFF), - (bytes[10 + currSubAuthOffset] & 0xFF), - (bytes[9 + currSubAuthOffset] & 0xFF), - (bytes[8 + currSubAuthOffset] & 0xFF))); - - strSID.Append('-').Append(Convert.ToInt64(tmpBuff.ToString(), 16)); - } - return strSID.ToString(); - } - - string AddLeadingZero(int k) - { - return (k <= 0xF) ? "0" + Int2String(k) : Int2String(k); - } - - string Int2String(int kb) - { - byte[] bytes = new byte[1]; - bytes[0] = (byte)(kb & 0xFF); - return Convert.ToHexString(bytes); - } -} diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj deleted file mode 100644 index 895ce1cf9..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/_Imports.cs b/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/_Imports.cs deleted file mode 100644 index a8f040a3f..000000000 --- a/src/Utils/Ldap/Novell/src/Masa.Utils.Ldap.Novell/_Imports.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Ldap.Novell; -global using Masa.Utils.Ldap.Novell.Entries; -global using Masa.Utils.Ldap.Novell.Extensions; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.Options; -global using Novell.Directory.Ldap; -global using System.Text; diff --git a/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs b/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs deleted file mode 100644 index 993db77aa..000000000 --- a/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Ldap.Novell.Tests; - -[TestClass] -public class LdapTest -{ - readonly IServiceCollection Services; - readonly ILdapProvider ldapProvider; - readonly ILdapFactory ldapFactory; - - public LdapTest() - { - Services = new ServiceCollection(); - var mockLdapOptions = new Mock(); - - var configurationBuilder = new ConfigurationBuilder().AddJsonFile("appsettings.json"); - var configuration = configurationBuilder.Build(); - var ldapConfigurationSection = configuration.GetSection(nameof(LdapOptions)); - Services.AddLadpContext(ldapConfigurationSection); - Services.AddLadpContext(); - var serviceProvider = Services.BuildServiceProvider(); - ldapProvider = serviceProvider.GetRequiredService(); - ldapFactory = serviceProvider.GetRequiredService(); - } - - [TestInitialize] - public void EdgeDriverInitialize() - { - - } - - [TestMethod] - public void CreateLdapProvider() - { - var ldapProvider = ldapFactory.CreateProvider(new LdapOptions - { - - }); - Assert.IsNotNull(ldapProvider); - } - - [TestMethod] - public async Task GetAllUser() - { - var allUsers = await ldapProvider.GetAllUserAsync().ToListAsync(); ; - Assert.IsTrue(allUsers.Count > 0); - } - - [TestMethod] - public async Task GetPagingUser() - { - var pagingUsers = await ldapProvider.GetPagingUserAsync(1); - Assert.IsTrue(pagingUsers.Count > 0); - } - - [TestMethod] - public async Task GetUserByUserName() - { - var user = await ldapProvider.GetUserByUserNameAsync("mayue"); - Assert.IsNotNull(user); - } - - [TestMethod] - public async Task GetUserByUserEmail() - { - var user = await ldapProvider.GetUsersByEmailAddressAsync("mayue@masastack.com"); - Assert.IsNotNull(user); - } - - [TestMethod] - public async Task GetGroupAsync() - { - var group = await ldapProvider.GetGroupAsync("杭州产品研发部"); - Assert.IsNotNull(group); - } - - [TestMethod] - public async Task GetUsersInGroupAsync() - { - var users = await ldapProvider.GetUsersInGroupAsync("杭州产品研发部").ToListAsync(); - Assert.IsTrue(users.Count > 0); - } -} diff --git a/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj b/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj deleted file mode 100644 index 52e14643e..000000000 --- a/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - net6.0 - enable - - false - - - - - - - - - - - - - - - - - - - Always - - - - diff --git a/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs b/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs deleted file mode 100644 index 30674ecea..000000000 --- a/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Ldap.Novell.Extensions; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using Moq; -global using System.Linq; -global using System.Threading.Tasks; diff --git a/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json b/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json deleted file mode 100644 index 5a64f707c..000000000 --- a/src/Utils/Ldap/Novell/test/Masa.Utils.Ldap.Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "LdapOptions": { - "ServerAddress": "localhost", - "ServerPort": 5389, - "ServerPortSsl": 5636, - "BaseDn": "dc=example,dc=com", - "UserSearchBaseDn": "OU=XXXX,dc=example,dc=com", - "GroupSearchBaseDn": "", - "RootUserDn": "cn=admin,dc=example,dc=com", - "RootUserPassword": "password" - } -} \ No newline at end of file diff --git a/src/Utils/Models/Config/src/Masa.Utils.Models.Config/AppConfig.cs b/src/Utils/Models/Config/src/Masa.Utils.Models.Config/AppConfig.cs deleted file mode 100644 index c5443c2eb..000000000 --- a/src/Utils/Models/Config/src/Masa.Utils.Models.Config/AppConfig.cs +++ /dev/null @@ -1,9 +0,0 @@ - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Models.Config; -public class AppConfig -{ - public string AppId { get; set; } = string.Empty; -} diff --git a/src/Utils/Models/Config/src/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj b/src/Utils/Models/Config/src/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/Utils/Models/Config/src/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs deleted file mode 100644 index 3ddbea269..000000000 --- a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Authentication.Attributes; - -[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] -public class MasaAuthorizeAttribute : AuthorizeAttribute -{ - public string[] Permissions { get; set; } - - public MasaAuthorizeAttribute(params string[] permissions) - { - Permissions = permissions; - } -} diff --git a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs deleted file mode 100644 index 8aa79822b..000000000 --- a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Authentication.Constants; - -public struct MasaClaimTypes -{ - public const string USER_NAME = ClaimTypes.Name; - - public const string NAME = ClaimTypes.GivenName; - - public const string USER_ID = ClaimTypes.NameIdentifier; - - public const string ROLE = ClaimTypes.Role; - - public const string EMAIL = ClaimTypes.Email; - - public const string PHONE_NUMBER = ClaimTypes.MobilePhone; - - public const string EMAIL_VERIFIED = "https://masastack.com/security/authentication/email_verified"; - - public const string PHONE_NUMBER_VERIFIED = "https://masastack.com/security/authentication/phone_number_verified"; - - public const string ENVIRONMENT = "https://masastack.com/security/authentication/environment"; - - public const string TENANT = "https://masastack.com/security/authentication/tenant"; -} diff --git a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs deleted file mode 100644 index a5d0e186a..000000000 --- a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Authentication.Extensions; - -public static class ClaimsIdentityExtensions -{ - public static string? FindClaimValue(this ClaimsPrincipal claimsPrincipal, string claimType) - => claimsPrincipal.Claims.FirstOrDefault(c => c.Type == claimType)?.Value; - - public static Guid? FindUserId(this ClaimsPrincipal principal) - { - var userIdOrNull = principal.Claims?.FirstOrDefault(c => c.Type == MasaClaimTypes.USER_ID); - if (userIdOrNull == null || string.IsNullOrWhiteSpace(userIdOrNull.Value)) - { - return null; - } - - if (Guid.TryParse(userIdOrNull.Value, out Guid guid)) - { - return guid; - } - - return null; - } - - public static Guid? FindTenantId(this ClaimsPrincipal principal) - { - var tenantIdOrNull = principal.Claims?.FirstOrDefault(c => c.Type == MasaClaimTypes.TENANT); - if (tenantIdOrNull == null || string.IsNullOrWhiteSpace(tenantIdOrNull.Value)) - { - return null; - } - - if (Guid.TryParse(tenantIdOrNull.Value, out var guid)) - { - return guid; - } - - return null; - } - - public static string FindEnvironment(this ClaimsPrincipal principal) - { - var evironmentOrNull = principal.Claims?.FirstOrDefault(c => c.Type == MasaClaimTypes.ENVIRONMENT); - if (evironmentOrNull == null || string.IsNullOrWhiteSpace(evironmentOrNull.Value)) - { - return string.Empty; - } - - return evironmentOrNull.Value; - } -} diff --git a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs deleted file mode 100644 index 810bf600f..000000000 --- a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Authentication; - -public interface ICurrentPrincipalAccessor -{ - ClaimsPrincipal? Principal { get; } -} diff --git a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj deleted file mode 100644 index 0febb3378..000000000 --- a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - diff --git a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/MasaUser.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/MasaUser.cs deleted file mode 100644 index 5a33e302c..000000000 --- a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/MasaUser.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Authentication; - -public class MasaUser -{ - readonly ICurrentPrincipalAccessor _principalAccessor; - - public MasaUser(ICurrentPrincipalAccessor principalAccessor) - { - _principalAccessor = principalAccessor; - } - - public virtual Claim? FindClaim(string claimType) - { - return _principalAccessor.Principal?.Claims.FirstOrDefault(c => c.Type == claimType); - } - - public virtual Claim[] FindClaims(string claimType) - { - return _principalAccessor.Principal?.Claims.Where(c => c.Type == claimType).ToArray() ?? new Claim[0]; - } - - public virtual Claim[] GetAllClaims() - { - return _principalAccessor.Principal?.Claims.ToArray() ?? new Claim[0]; - } - - public Guid? UserId => _principalAccessor.Principal?.FindUserId(); - - public string UserName => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.USER_NAME) ?? ""; - - public string Name => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.NAME) ?? ""; - - public string PhoneNumber => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.PHONE_NUMBER) ?? ""; - - public bool PhoneNumberVerified => string.Equals(_principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.PHONE_NUMBER_VERIFIED), "true", StringComparison.InvariantCultureIgnoreCase); - - public string Email => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.EMAIL) ?? ""; - - public bool EmailVerified => string.Equals(_principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.EMAIL_VERIFIED), "true", StringComparison.InvariantCultureIgnoreCase); - - public Guid? TenantId => _principalAccessor.Principal?.FindTenantId(); - - public string Environment => _principalAccessor.Principal?.FindEnvironment() ?? string.Empty; -} diff --git a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs deleted file mode 100644 index 5d9526d37..000000000 --- a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Authentication; - -internal class ThreadCurrentPrincipalAccessor : ICurrentPrincipalAccessor, ISingletonDependency -{ - public ClaimsPrincipal? Principal => Thread.CurrentPrincipal as ClaimsPrincipal; -} diff --git a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/_Imports.cs b/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/_Imports.cs deleted file mode 100644 index acf0cb66f..000000000 --- a/src/Utils/Security/Authentication/Authentication/src/Masa.Utils.Security.Authentication/_Imports.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Security.Authentication.Constants; -global using Masa.Utils.Security.Authentication.Extensions; -global using Microsoft.AspNetCore.Authorization; -global using Microsoft.Extensions.DependencyInjection; -global using System.Security.Claims; diff --git a/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj b/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj deleted file mode 100644 index 80809863a..000000000 --- a/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - diff --git a/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs b/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs deleted file mode 100644 index a215f9a9e..000000000 --- a/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Authentication.OpenIdConnect; - -public class MasaOpenIdConnectOptions -{ - public string Authority { get; set; } = string.Empty; - - public string ClientId { get; set; } = string.Empty; - - public string ClientSecret { get; set; } = string.Empty; - - public List Scopes { get; set; } = new List(); -} diff --git a/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs b/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs deleted file mode 100644 index d85f09d98..000000000 --- a/src/Utils/Security/Authentication/OpenIdConnect/src/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -using Masa.Utils.Security.Authentication.OpenIdConnect; -using Microsoft.AspNetCore.Authentication.Cookies; -using Microsoft.AspNetCore.Authentication.OpenIdConnect; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Configuration; -using Microsoft.IdentityModel.Protocols.OpenIdConnect; -using System.IdentityModel.Tokens.Jwt; - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddMasaOpenIdConnect( - this IServiceCollection services, - IConfiguration configuration) - { - return services.AddMasaOpenIdConnect(configuration.GetSection("oidc").Get()); - } - - public static IServiceCollection AddMasaOpenIdConnect( - this IServiceCollection services, - MasaOpenIdConnectOptions masaOpenIdConnectOptions) - { - return services.AddMasaOpenIdConnect(masaOpenIdConnectOptions.Authority, masaOpenIdConnectOptions.ClientId, - masaOpenIdConnectOptions.ClientSecret, masaOpenIdConnectOptions.Scopes.ToArray()); - } - - public static IServiceCollection AddMasaOpenIdConnect( - this IServiceCollection services, - string authority, - string clinetId, - string clientSecret, - params string[] scopes) - { - services.AddHttpContextAccessor(); - - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); - services.AddAuthentication(options => - { - options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; - options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme; - options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; - }) - .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options => - { - options.ExpireTimeSpan = TimeSpan.FromSeconds(3600); - }) - .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options => - { - options.Authority = authority; - options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; - options.SignOutScheme = OpenIdConnectDefaults.AuthenticationScheme; - options.RequireHttpsMetadata = false; - options.ClientId = clinetId; - options.ClientSecret = clientSecret; - options.ResponseType = OpenIdConnectResponseType.Code; - - foreach (var scope in scopes) - { - options.Scope.Add(scope); - } - - options.SaveTokens = true; - options.GetClaimsFromUserInfoEndpoint = true; - options.UseTokenLifetime = true; - - options.TokenValidationParameters.RequireExpirationTime = true; - options.TokenValidationParameters.ValidateLifetime = true; - - options.NonceCookie.SameSite = SameSiteMode.Unspecified; - options.CorrelationCookie.SameSite = SameSiteMode.Unspecified; - - options.Events = new OpenIdConnectEvents - { - OnAccessDenied = context => - { - context.HandleResponse(); - context.Response.Redirect("/"); - return Task.CompletedTask; - } - }; - }); - - services.AddAuthorization(options => - { - // By default, all incoming requests will be authorized according to the default policy - options.FallbackPolicy = options.DefaultPolicy; - }); - - return services; - } -} - diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/AesUtils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/AesUtils.cs deleted file mode 100644 index 8a23e7d78..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/AesUtils.cs +++ /dev/null @@ -1,529 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -public class AesUtils : EncryptBase -{ - private static readonly byte[] DefaultIv = - { - 0x41, - 0x72, - 0x65, - 0x79, - 0x6F, - 0x75, - 0x6D, - 0x79, - 0x53, - 0x6E, - 0x6F, - 0x77, - 0x6D, - 0x61, - 0x6E, - 0x3F - }; - - /// - /// Generate a key that complies with AES encryption rules - /// - /// - /// - public static string GenerateKey(int length) - { - var crypto = Aes.Create(); - crypto.KeySize = length; - crypto.BlockSize = 128; - crypto.GenerateKey(); - return Convert.ToBase64String(crypto.Key); - } - - /// - /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) - /// - /// String to be encrypted - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt( - string content, - char fillCharacter = ' ', - Encoding? encoding = null) - => Encrypt(content, GlobalConfigurationUtils.DefaultEncryKey, FillType.Right, fillCharacter, encoding); - - /// - /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) - /// - /// String to be encrypted - /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt( - string content, - string key, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - => Encrypt(content, key, DefaultIv, fillType, fillCharacter, encoding); - - /// - /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) - /// - /// String to be encrypted - /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length key or complement by fillType to calculate an 16-bit string - /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt( - string content, - string key, - string iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - var ivBuffer = GetSafeEncoding(encoding).GetBytes(GetSpecifiedLengthString( - iv, - 16, - () => throw new ArgumentException(nameof(key), - $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - - return Encrypt(content, - key, - ivBuffer, - fillType, - fillCharacter, - encoding); - } - - /// - /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) - /// - /// String to be encrypted - /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length or complement by fillType to calculate an 16-bit string - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt( - string content, - string key, - byte[] iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - var currentEncoding = GetSafeEncoding(encoding); - key = GetSpecifiedLengthString( - key, - 32, - () => throw new ArgumentException(nameof(key), - $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter); - using var aes = Aes.Create(); - aes.Key = currentEncoding.GetBytes(key); - aes.IV = iv; - using ICryptoTransform cryptoTransform = aes.CreateEncryptor(); - byte[] buffers = currentEncoding.GetBytes(content); - byte[] encryptedData = cryptoTransform.TransformFinalBlock(buffers, 0, buffers.Length); - return Convert.ToBase64String(encryptedData); - } - - /// - /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string - /// - /// String to be decrypted - /// character for complement - /// Encoding format, default UTF-8 - /// If the decryption succeeds, the decrypted string will be returned, and if it fails, the source string will be returned. - public static string Decrypt( - string content, - char fillCharacter = ' ', - Encoding? encoding = null) - => Decrypt(content, GlobalConfigurationUtils.DefaultEncryKey, FillType.Right, fillCharacter, encoding); - - /// - /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string - /// - /// String to be decrypted - /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// Decryption success returns the decrypted string, failure returns empty - public static string Decrypt( - string content, - string key, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - => Decrypt(content, key, DefaultIv, fillType, fillCharacter, encoding); - - /// - /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string - /// - /// String to be decrypted - /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length or complement by fillType to calculate an 16-bit string - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// Decryption success returns the decrypted string, failure returns empty - public static string Decrypt( - string content, - string key, - string iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - var ivBuffer = GetSafeEncoding(encoding).GetBytes(GetSpecifiedLengthString( - iv, - 16, - () => throw new ArgumentException(nameof(key), - $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - - return Decrypt(content, - key, - ivBuffer, - fillType, - fillCharacter, - encoding); - } - - /// - /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string - /// - /// String to be decrypted - /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length. 16-bit length key or complement by fillType to calculate an 16-bit string - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// Decryption success returns the decrypted string, failure returns empty - public static string Decrypt( - string content, - string key, - byte[] iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - var currentEncoding = GetSafeEncoding(encoding); - key = GetSpecifiedLengthString( - key, - 32, - () => throw new ArgumentException(nameof(key), - $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter); - using var aes = Aes.Create(); - aes.Key = currentEncoding.GetBytes(key); - aes.IV = iv; - using ICryptoTransform rijndaelDecrypt = aes.CreateDecryptor(); - byte[] buffers = Convert.FromBase64String(content); - byte[] decryptedData = rijndaelDecrypt.TransformFinalBlock(buffers, 0, buffers.Length); - return currentEncoding.GetString(decryptedData); - } - - /// - /// encrypted file stream - /// - /// File streams that require encryption - /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted stream result - public static CryptoStream Encrypt( - FileStream fileStream, - string key, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - => Encrypt(fileStream, key, key, fillType, fillCharacter, encoding); - - /// - /// encrypted file stream - /// - /// File streams that require encryption - /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length. 16-bit length key or complement by fillType to calculate an 16-bit string - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted stream result - public static CryptoStream Encrypt( - FileStream fileStream, - string key, - string iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - var currentEncoding = GetSafeEncoding(encoding); - - var ivBuffer = currentEncoding.GetBytes(GetSpecifiedLengthString(iv, - 16, - () => throw new ArgumentException(nameof(iv), - $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - - return Encrypt(fileStream, key, ivBuffer, fillType, fillCharacter, encoding); - } - - /// - /// encrypted file stream - /// - /// File streams that require encryption - /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted stream result - public static CryptoStream Encrypt( - FileStream fileStream, - string key, - byte[] iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - if (iv.Length != 16) - { - throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 16 bits!"); - } - - var currentEncoding = GetSafeEncoding(encoding); - key = GetSpecifiedLengthString(key, - 32, - () => throw new ArgumentException(nameof(key), - $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter); - - using var aes = Aes.Create(); - aes.Key = currentEncoding.GetBytes(key); - aes.IV = iv; - using var cryptoTransform = aes.CreateEncryptor(); - return new CryptoStream(fileStream, cryptoTransform, CryptoStreamMode.Write); - } - - /// - /// Decrypt the file stream - /// - /// file stream to be decrypted - /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// Decrypt the stream result - public static CryptoStream Decrypt( - FileStream fileStream, - string key, - string iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - var currentEncoding = GetSafeEncoding(encoding); - - var ivBuffer = currentEncoding.GetBytes(GetSpecifiedLengthString(iv, - 16, - () => throw new ArgumentException(nameof(iv), - $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - - return Decrypt(fileStream, key, ivBuffer, fillType, fillCharacter, encoding); - } - - /// - /// Decrypt the file stream - /// - /// file stream to be decrypted - /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length - /// Whether to complement the key? default: no fill(Only supports 32-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// Decrypt the stream result - public static CryptoStream Decrypt( - FileStream fileStream, - string key, - byte[] iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - if (iv.Length != 16) - { - throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 16 bits!"); - } - - key = GetSpecifiedLengthString(key, - 32, - () => throw new ArgumentException(nameof(key), - $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter); - - var currentEncoding = GetSafeEncoding(encoding); - using var aes = Aes.Create(); - aes.Key = currentEncoding.GetBytes(key); - aes.IV = iv; - using var cryptoTransform = aes.CreateDecryptor(); - return new CryptoStream(fileStream, cryptoTransform, CryptoStreamMode.Read); - } - - /// - /// Encrypt the specified stream with AES and output a file - /// - /// file stream to be encrypted - /// output file path - /// character for complement - /// Encoding format, default UTF-8 - public static void EncryptFile( - FileStream fileStream, - string outputPath, - char fillCharacter = ' ', - Encoding? encoding = null) - => EncryptFile(fileStream, - GlobalConfigurationUtils.DefaultEncryKey, - outputPath, - FillType.Right, - fillCharacter, - encoding); - - /// - /// Encrypt the specified stream with AES and output a file - /// - /// file stream to be encrypted - /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string - /// output file path - /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) - /// character for complement - /// Encoding format, default UTF-8 - public static void EncryptFile( - FileStream fileStream, - string key, - string outputPath, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - => EncryptFile(fileStream, key, key, outputPath, fillType, fillCharacter, encoding); - - /// - /// Encrypt the specified stream with AES and output a file - /// - /// file stream to be encrypted - /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length or complement by fillType to calculate an 16-bit string - /// output file path - /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) - /// character for complement - /// Encoding format, default UTF-8 - public static void EncryptFile( - FileStream fileStream, - string key, - string iv, - string outputPath, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - using var fileStreamOut = new FileStream(outputPath, FileMode.Create); - using var cryptoStream = Encrypt(fileStream, key, iv, fillType, fillCharacter, encoding); - byte[] buffers = new byte[1024]; - while (true) - { - var count = cryptoStream.Read(buffers, 0, buffers.Length); - fileStreamOut.Write(buffers, 0, count); - if (count < buffers.Length) - { - break; - } - } - } - - /// - /// AES decrypt the specified file stream and output the file - /// - /// file stream to be decrypted - /// output file path - /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) - /// character for complement - /// Encoding format, default UTF-8 - public static void DecryptFile( - FileStream fileStream, - string outputPath, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - => DecryptFile(fileStream, GlobalConfigurationUtils.DefaultEncryKey, outputPath, fillType, fillCharacter, encoding); - - /// - /// AES decrypt the specified file stream and output the file - /// - /// file stream to be decrypted - /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string - /// output file path - /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) - /// character for complement - /// Encoding format, default UTF-8 - public static void DecryptFile( - FileStream fileStream, - string key, - string outputPath, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - => DecryptFile(fileStream, key, key, outputPath, fillType, fillCharacter, encoding); - - /// - /// AES decrypt the specified file stream and output the file - /// - /// file stream to be decrypted - /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string - /// 16-bit length or complement by fillType to calculate an 16-bit string - /// output file path - /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) - /// character for complement - /// Encoding format, default UTF-8 - public static void DecryptFile( - FileStream fileStream, - string key, - string iv, - string outputPath, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - using FileStream fileStreamOut = new(outputPath, FileMode.Create); - using CryptoStream cryptoStream = Decrypt(fileStream, key, iv, fillType, fillCharacter, encoding); - byte[] buffers = new byte[1024]; - while (true) - { - var count = cryptoStream.Read(buffers, 0, buffers.Length); - fileStreamOut.Write(buffers, 0, count); - if (count < buffers.Length) - { - break; - } - } - } -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Base64Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Base64Utils.cs deleted file mode 100644 index 5db13331a..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Base64Utils.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -/// -/// Base64 encryption and decryption -/// -public class Base64Utils : EncryptBase -{ - /// - /// Base64 encryption - /// - /// String to be encrypted - /// Encoding format, default UTF-8 - /// encrypted data - public static string Encrypt(string content, Encoding? encoding = null) - { - byte[] buffers = GetSafeEncoding(encoding).GetBytes(content); - return Convert.ToBase64String(buffers); - } - - /// - /// Base64 decryption - /// - /// String to decrypt - /// Encoding format, default UTF-8 - /// decrypted data - public static string Decrypt(string content, Encoding? encoding = null) - { - byte[] buffers = Convert.FromBase64String(content); - return GetSafeEncoding(encoding).GetString(buffers); - } -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DESEncryType.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DESEncryType.cs deleted file mode 100644 index 2890c91a9..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DESEncryType.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -public enum DESEncryType -{ - /// - /// original DES encryption - /// - Normal, - - /// - /// Easy to transfer in browser - /// - Improved -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DesUtils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DesUtils.cs deleted file mode 100644 index 17e80496f..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/DesUtils.cs +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -/// -/// DES symmetric encryption and decryption -/// -public class DesUtils : EncryptBase -{ - /// - /// Default encryption key - /// - private static readonly string DefaultEncryptKey = MD5Utils.EncryptRepeat(GlobalConfigurationUtils.DefaultEncryKey, 2); - - /// - /// 使用默认加密 - /// - /// 被加密的字符串 - /// Des encryption method, default: improved (easy to transmit) - /// Whether to convert the encrypted string to lowercase - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt( - string content, - DESEncryType desEncryType = DESEncryType.Improved, - bool isToLower = true, - char fillCharacter = ' ', - Encoding? encoding = null) - => Encrypt(content, DefaultEncryptKey, desEncryType, isToLower, FillType.Right, fillCharacter, encoding); - - /// - /// Des encrypted string - /// - /// String to be encrypted - /// 8-bit length key or complement by fillType to calculate an 8-bit string - /// Des encryption method, default: improved (easy to transmit) - /// Whether to convert the encrypted string to lowercase - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt( - string content, - string key, - DESEncryType desEncryType = DESEncryType.Improved, - bool isToLower = true, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - => Encrypt(content, key, key, desEncryType, isToLower, fillType, fillCharacter, encoding); - - /// - /// Des encrypted string - /// - /// String to be encrypted - /// 8-bit length key or complement by fillType to calculate an 8-bit string - /// 8-bit length key or complement by fillType to calculate an 8-bit string - /// Des encryption method, default: improved (easy to transmit) - /// Whether to convert the encrypted string to lowercase - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt( - string content, - string key, - string iv, - DESEncryType desEncryType = DESEncryType.Improved, - bool isToLower = true, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - var currentEncoding = GetSafeEncoding(encoding); - var des = DES.Create(); - des.Key = currentEncoding.GetBytes( - GetSpecifiedLengthString(key, - 8, - () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - des.IV = currentEncoding.GetBytes( - GetSpecifiedLengthString(iv, - 8, - () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - - using MemoryStream memoryStream = new MemoryStream(); - byte[] buffer = currentEncoding.GetBytes(content); - using CryptoStream cs = new CryptoStream(memoryStream, des.CreateEncryptor(), CryptoStreamMode.Write); - cs.Write(buffer, 0, buffer.Length); - cs.FlushFinalBlock(); - if (desEncryType == DESEncryType.Normal) - return Convert.ToBase64String(memoryStream.ToArray()); - - StringBuilder stringBuilder = new(); - foreach (byte b in memoryStream.ToArray()) - { - stringBuilder.AppendFormat(isToLower ? $"{b:x2}" : $"{b:X2}"); - } - - return stringBuilder.ToString(); - } - - /// - /// DES decryption with default key - /// - /// String to be decrypted - /// Des encryption method, default: improved (easy to transmit) - /// character for complement - /// Encoding format, default UTF-8 - /// decrypted result - public static string Decrypt(string content, - DESEncryType desEncryType = DESEncryType.Improved, - char fillCharacter = ' ', - Encoding? encoding = null) - => Decrypt(content, DefaultEncryptKey, desEncryType, FillType.Right, fillCharacter, encoding); - - /// - /// DES decryption - /// - /// String to be decrypted - /// 8-bit length key - /// Des encryption method, default: improved (easy to transmit) - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// decrypted result - public static string Decrypt( - string content, - string key, - DESEncryType desEncryType = DESEncryType.Improved, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - => Decrypt(content, key, key, desEncryType, fillType, fillCharacter, encoding); - - /// - /// DES decryption - /// - /// String to be decrypted - /// 8-bit length key or complement by fillType to calculate an 8-bit string - /// 8-bit length key or complement by fillType to calculate an 8-bit string - /// Des encryption method, default: improved (easy to transmit) - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - /// decrypted result - public static string Decrypt( - string content, - string key, - string iv, - DESEncryType desEncryType = DESEncryType.Improved, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - using var memoryStream = new MemoryStream(); - using var des = DES.Create(); - var currentEncoding = GetSafeEncoding(encoding); - des.Key = currentEncoding.GetBytes( - GetSpecifiedLengthString(key, - 8, - () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - des.IV = currentEncoding.GetBytes( - GetSpecifiedLengthString(iv, - 8, - () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - - using (MemoryStream ms = new MemoryStream()) - { - byte[] buffers = desEncryType == DESEncryType.Improved ? new byte[content.Length / 2] : Convert.FromBase64String(content); - if (desEncryType == DESEncryType.Improved) - { - for (int x = 0; x < content.Length / 2; x++) - { - int i = Convert.ToInt32(content.Substring(x * 2, 2), 16); - buffers[x] = (byte) i; - } - } - - using (CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write)) - { - cs.Write(buffers, 0, buffers.Length); - cs.FlushFinalBlock(); - } - - return currentEncoding.GetString(ms.ToArray()); - } - } - - /// - /// DES encrypts the file stream and outputs the encrypted file - /// - /// file input stream - /// file output path - /// 8-bit length key or complement by fillType to calculate an 8-bit string - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - public static void EncryptFile( - FileStream fileStream, - string outFilePath, - string key, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - byte[] iv = - { - 0x12, - 0x34, - 0x56, - 0x78, - 0x90, - 0xAB, - 0xCD, - 0xEF - }; - EncryptFile(fileStream, outFilePath, key, iv, fillType, fillCharacter, encoding); - } - - /// - /// DES encrypts the file stream and outputs the encrypted file - /// - /// file input stream - /// file output path - /// 8-bit length key or complement by fillType to calculate an 8-bit string - /// 8-bit length key or complement by fillType to calculate an 8-bit string - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - public static void EncryptFile( - FileStream fileStream, - string outFilePath, - string key, - string iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - var currentEncoding = GetSafeEncoding(encoding); - var ivBuffer = currentEncoding.GetBytes( - GetSpecifiedLengthString(iv, - 8, - () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - EncryptFile(fileStream, outFilePath, key, ivBuffer, fillType, fillCharacter, encoding); - } - - /// - /// DES encrypts the file stream and outputs the encrypted file - /// - /// file input stream - /// file output path - /// 8-bit length key - /// 8-bit length key - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - public static void EncryptFile( - FileStream fileStream, - string outFilePath, - string key, - byte[] iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - if (iv.Length != 8) - { - throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 8 bits!"); - } - - var currentEncoding = GetSafeEncoding(encoding); - using var fileStreamOut = new FileStream(outFilePath, FileMode.OpenOrCreate, FileAccess.Write); - fileStreamOut.SetLength(0); - byte[] buffers = new byte[100]; - long readLength = 0; - using var des = DES.Create(); - des.Key = currentEncoding.GetBytes( - GetSpecifiedLengthString(key, - 8, - () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - des.IV = iv; - - using var cryptoStream = new CryptoStream(fileStreamOut, des.CreateEncryptor(), - CryptoStreamMode.Write); - while (readLength < fileStream.Length) - { - var length = fileStream.Read(buffers, 0, 100); - cryptoStream.Write(buffers, 0, length); - readLength += length; - } - } - - /// - /// DES decrypts the file stream and outputs the source file - /// - /// input file stream to be decrypted - /// file output path - /// decryption key or complement by fillType to calculate an 8-bit string - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - public static void DecryptFile( - FileStream fileStream, - string outFilePath, - string key, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - byte[] iv = - { - 0x12, - 0x34, - 0x56, - 0x78, - 0x90, - 0xAB, - 0xCD, - 0xEF - }; - DecryptFile(fileStream, outFilePath, key, iv, fillType, fillCharacter, encoding); - } - - /// - /// DES decrypts the file stream and outputs the source file - /// - /// input file stream to be decrypted - /// file output path - /// decryption key or complement by fillType to calculate an 8-bit string - /// 8-bit length key or complement by fillType to calculate an 8-bit string - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - public static void DecryptFile( - FileStream fileStream, - string outFilePath, - string key, - string iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - var currentEncoding = GetSafeEncoding(encoding); - - var ivBuffer = currentEncoding.GetBytes( - GetSpecifiedLengthString(iv, - 8, - () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - - DecryptFile(fileStream, outFilePath, key, ivBuffer, fillType, fillCharacter, currentEncoding); - } - - /// - /// DES decrypts the file stream and outputs the source file - /// - /// input file stream to be decrypted - /// file output path - /// decryption key or complement by fillType to calculate an 8-bit string - /// - /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) - /// character for complement - /// Encoding format, default UTF-8 - public static void DecryptFile( - FileStream fileStream, - string outFilePath, - string key, - byte[] iv, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ', - Encoding? encoding = null) - { - if (iv.Length != 8) - { - throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 8 bits!"); - } - - var currentEncoding = GetSafeEncoding(encoding); - using var fileStreamOut = new FileStream(outFilePath, FileMode.OpenOrCreate, FileAccess.Write); - fileStreamOut.SetLength(0); - byte[] buffers = new byte[100]; - long readLength = 0; - using var des = DES.Create(); - des.Key = currentEncoding.GetBytes( - GetSpecifiedLengthString(key, - 8, - () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), - fillType, - fillCharacter)); - des.IV = iv; - using var cryptoStream = new CryptoStream(fileStreamOut, des.CreateDecryptor(), - CryptoStreamMode.Write); - while (readLength < fileStream.Length) - { - var length = fileStream.Read(buffers, 0, 100); - cryptoStream.Write(buffers, 0, length); - readLength += length; - } - } -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptBase.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptBase.cs deleted file mode 100644 index e64c337d6..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptBase.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -public class EncryptBase -{ - protected static string GetSpecifiedLengthString( - string key, - int length, - Func func, - FillType fillType = FillType.NoFile, - char fillCharacter = ' ') - { - if (fillType == FillType.NoFile && key.Length < length) - { - throw func.Invoke(); - } - - if (key.Length >= length) - { - return key.Substring(0, length); - } - - if (fillType == FillType.Left) - { - return key.PadLeft(length, fillCharacter); - } - - if (fillType == FillType.Right) - { - return key.PadRight(length, fillCharacter); - } - - throw new NotSupportedException($"... Unsupported {nameof(fillType)}"); - } - - protected static Encoding GetSafeEncoding(Encoding? encoding = null) - => GetSafeEncoding(() => Encoding.UTF8, encoding); - - protected static Encoding GetSafeEncoding(Func func, Encoding? encoding = null) - => encoding ?? func.Invoke(); -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptType.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptType.cs deleted file mode 100644 index 30658e7e2..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/EncryptType.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -public enum EncryptType -{ - Md5, - Sha1, - Sha256, - Sha384, - Sha512 -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/FillType.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/FillType.cs deleted file mode 100644 index 2709d93ce..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/FillType.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -public enum FillType -{ - NoFile = 1, - /// - /// left fill - /// - Left = 2, - /// - /// right fill - /// - Right = 3 -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs deleted file mode 100644 index ffc41192b..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -public class GlobalConfigurationUtils -{ - private static string _defaultEncryKey = "masastack.com"; - - public static string DefaultEncryKey - { - get => _defaultEncryKey; - set - { - if (string.IsNullOrWhiteSpace(value)) - throw new ArgumentException($"{nameof(DefaultEncryKey)} cannot be empty", nameof(DefaultEncryKey)); - - _defaultEncryKey = value; - } - } -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs deleted file mode 100644 index 7ce6d52fe..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -public class HashAlgorithmBase : EncryptBase -{ - /// - /// encryption - /// - /// - /// String to be encrypted - /// Whether to convert the encrypted string to lowercase - /// - /// - public static string Encrypt(EncryptType encryptType, string content, bool isToLower = false, Encoding? encoding = null) - { - using (var hashAlgorithm = HashAlgorithm.Create(encryptType.ToString())) - { - if (hashAlgorithm == null) - throw new NotSupportedException("Unsupported encryptType"); - - byte[] buffer = GetSafeEncoding(encoding).GetBytes(content); - buffer = hashAlgorithm.ComputeHash(buffer); - return Encrypt(encryptType, buffer, hashAlgorithm, isToLower); - } - } - - protected static string Encrypt(EncryptType encryptType, byte[] buffer, HashAlgorithm? hashAlgorithm = null, bool isToLower = false) - { - using (hashAlgorithm ??= HashAlgorithm.Create(encryptType.ToString())) - { - if (hashAlgorithm == null) - throw new NotSupportedException("Unsupported encryptType"); - - hashAlgorithm.Clear(); - - StringBuilder stringBuilder = new StringBuilder(); - foreach (byte b in buffer) - { - stringBuilder.AppendFormat("{0:x2}", b); - } - - var result = BitConverter.ToString(buffer).Replace("-", ""); - return isToLower ? result.ToLower() : result; - } - } -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/MD5Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/MD5Utils.cs deleted file mode 100644 index 5a771a70d..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/MD5Utils.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -/// -/// MD5加密算法 -/// -public class MD5Utils : HashAlgorithmBase -{ - /// - /// MD5 encryption of string - /// - /// String to be encrypted - /// Whether to convert the encrypted string to lowercase - /// Encoding format, default UTF-8 - /// - private static string Encrypt( - string content, - bool isToLower = true, - Encoding? encoding = null) - => Encrypt(content, string.Empty, isToLower, encoding); - - /// - /// MD5 multiple encryption - /// - /// String to be encrypted - /// Encryption times,default: 1 - /// Whether to convert the encrypted string to lowercase - /// Encoding format, default UTF-8 - /// encrypted result - public static string EncryptRepeat( - string content, - int encryptTimes = 1, - bool isToLower = true, - Encoding? encoding = null) - => EncryptRepeat(content, string.Empty, encryptTimes, false, isToLower, encoding); - - /// - /// MD5 salt-encrypted string - /// - /// String to be encrypted - /// - /// Whether to convert the encrypted string to lowercase - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt( - string content, - string salt, - bool isToLower = true, - Encoding? encoding = null) - => Encrypt(EncryptType.Md5, content + salt, isToLower, encoding); - - /// - /// MD5 multiple encryption - /// - /// String to be encrypted - /// - /// - /// When the number of executions is greater than 1, is it necessary to add salt and then encrypt after the second time? default: false (Salt encryption only for the first time) - /// Whether to convert the encrypted string to lowercase - /// Encoding format, default UTF-8 - /// encrypted result - public static string EncryptRepeat( - string content, - string salt, - int encryptTimes, - bool isNeedSalt = false, - bool isToLower = true, - Encoding? encoding = null) - { - if (encryptTimes < 1) - throw new ArgumentException($"{nameof(encryptTimes)} must be greater than or equal to 1", nameof(encryptTimes)); - - int times = 1; - string result = Encrypt(content + salt, isToLower, encoding); - while (times < encryptTimes) - { - result = isNeedSalt ? result + salt : result; - result = Encrypt(result, isToLower, encoding); - times++; - } - - return result; - } - - /// - /// Get the MD5 value of the file - /// - /// absolute path to the file - /// Whether to convert the encrypted string to lowercase - /// encrypted result - public static string EncryptFile(string fileName, bool isToLower = true) - { - using var fileStream = File.Open(fileName, FileMode.Open, FileAccess.Read); - return EncryptStream(fileStream, isToLower); - } - - /// - /// Get the MD5 value of the data stream - /// - /// - /// Whether to convert the encrypted string to lowercase - /// encrypted result - public static string EncryptStream(Stream stream, bool isToLower = true) - { - stream.Position = 0; - byte[] buffers = new byte[stream.Length]; - stream.Read(buffers, 0, buffers.Length); - stream.Seek(0, SeekOrigin.Begin); - using var md5 = MD5.Create(); - byte[] bytes = md5.ComputeHash(buffers); - var encryptedContent = Encrypt(EncryptType.Md5, bytes, null, isToLower); - stream.Position = 0; - return encryptedContent; - } -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj deleted file mode 100644 index 132c02c59..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - net6.0 - enable - enable - - - diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA1Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA1Utils.cs deleted file mode 100644 index b71f70354..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA1Utils.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -/// -/// Hash algorithm encryption SHA1 -/// -public class SHA1Utils : HashAlgorithmBase -{ - /// - /// Encrypt string with SHA1 - /// - /// String to be encrypted - /// Whether to convert the encrypted string to lowercase - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) - => Encrypt(EncryptType.Sha1, content, isToLower, encoding); -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA256Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA256Utils.cs deleted file mode 100644 index d3567d057..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA256Utils.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -/// -/// Hash algorithm encryption SHA256 -/// -public class SHA256Utils : HashAlgorithmBase -{ - /// - /// Encrypt string with SHA256 - /// - /// String to be encrypted - /// Whether to convert the encrypted string to lowercase - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) - => Encrypt(EncryptType.Sha256, content, isToLower, encoding); -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA384Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA384Utils.cs deleted file mode 100644 index fb4bdfe4a..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA384Utils.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -/// -/// Hash algorithm encryption SHA384 -/// -public class SHA384Utils : HashAlgorithmBase -{ - /// - /// Encrypt string with SHA384 - /// - /// String to be encrypted - /// Whether to convert the encrypted string to lowercase - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) - => Encrypt(EncryptType.Sha384, content, isToLower, encoding); -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA512Utils.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA512Utils.cs deleted file mode 100644 index 383547368..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/SHA512Utils.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography; - -/// -/// Hash algorithm encryption SHA512 -/// -public class SHA512Utils : HashAlgorithmBase -{ - /// - /// Encrypt string with SHA512 - /// - /// String to be encrypted - /// Whether to convert the encrypted string to lowercase - /// Encoding format, default UTF-8 - /// encrypted result - public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) - => Encrypt(EncryptType.Sha512, content, isToLower, encoding); -} diff --git a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/_Imports.cs b/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/_Imports.cs deleted file mode 100644 index c813f8c2c..000000000 --- a/src/Utils/Security/Cryptography/src/Masa.Utils.Security.Cryptography/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using System.Security.Cryptography; -global using System.Text; diff --git a/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs b/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs deleted file mode 100644 index dc39e8e7f..000000000 --- a/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/AesTest.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography.Tests; - -[TestClass] -public class AesTest -{ - [TestMethod] - public void EncryptAndDecrypt() - { - string str = "Hello MASA Stack"; - string key = "12345678901234567890123456789021"; - var source = AesUtils.Decrypt(AesUtils.Encrypt(str, key), key); - Assert.IsTrue(str == source); - - var source2 = AesUtils.Decrypt(AesUtils.Encrypt(str)); - Assert.IsTrue(str == source2); - - var source3 = AesUtils.Decrypt(AesUtils.Encrypt(str, key, "123", FillType.Right), key, "123", FillType.Right); - Assert.IsTrue(str == source3); - - Assert.ThrowsException(() => AesUtils.Encrypt(str, key, "123", FillType.NoFile)); - - string encryptResult = AesUtils.Encrypt(str, key, "123", FillType.Right); - Assert.ThrowsException(() => AesUtils.Decrypt(encryptResult, key, "123", FillType.NoFile)); - } -} diff --git a/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs b/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs deleted file mode 100644 index a33c2bc5b..000000000 --- a/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/DesTest.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; - -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Cryptography.Tests -{ - [TestClass] - public class DesTest - { - [TestMethod] - public void EncryptAndDecrypt() - { - for (int i = 0; i < 10000; i++) - { - string str = new Random().Next(0, 1000000000).ToString(); - string key = "masastac"; - string iv = "masastack"; - var source = DesUtils.Decrypt(DesUtils.Encrypt(str, key), key); - var source2 = DesUtils.Decrypt(DesUtils.Encrypt(str, key, iv), key, iv); - var source3 = DesUtils.Decrypt(DesUtils.Encrypt(str, DESEncryType.Normal), DESEncryType.Normal); - - Assert.IsTrue(str == source); - Assert.IsTrue(str == source2); - Assert.IsTrue(str == source3); - } - } - } -} diff --git a/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj b/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj deleted file mode 100644 index 161d25c3a..000000000 --- a/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - net6.0 - enable - - false - - - - - - - - - - - - - - - diff --git a/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs b/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs deleted file mode 100644 index 1109a8e81..000000000 --- a/src/Utils/Security/Cryptography/test/Masa.Utils.Security.Cryptography.Tests/_Imports.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/DefaultJwtProvider.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/DefaultJwtProvider.cs deleted file mode 100644 index a8a18c930..000000000 --- a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/DefaultJwtProvider.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Token; - -public class DefaultJwtProvider : IJwtProvider -{ - private readonly JwtConfigurationOptions _options; - private readonly ILogger? _logger; - - public DefaultJwtProvider(IOptionsSnapshot options, ILogger? logger = null) - { - _options = options.Value; - _logger = logger; - } - - public string CreateToken(string value, TimeSpan timeout) - => CreateToken(new[] - { - new Claim(ClaimTypes.Sid, value), - }, timeout); - - public string CreateToken(Claim[] claims, TimeSpan timeout) - { - DateTime notBefore = DateTime.UtcNow; - DateTime expires = notBefore.Add(timeout); - var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_options.SecurityKey)); - var credentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); - var token = new JwtSecurityToken( - _options.Issuer, - _options.Audience, - claims, - notBefore, - expires, - credentials); - var tokenHandler = new JwtSecurityTokenHandler(); - return tokenHandler.WriteToken(token); - } - - public bool IsValid(string token, string value, Action? action = null) - { - var isValid = IsValid(token, out _, - out ClaimsPrincipal? claimsPrincipal, action); - - return isValid && claimsPrincipal != null && claimsPrincipal.HasClaim(ClaimTypes.Sid, value); - } - - public bool IsValid( - string token, - out SecurityToken? securityToken, - out ClaimsPrincipal? claimsPrincipal, - Action? action = null) - { - securityToken = null; - claimsPrincipal = null; - - try - { - var handler = new JwtSecurityTokenHandler(); - var validationParameters = new TokenValidationParameters() - { - ValidateIssuer = true, - ValidateAudience = true, - ValidateLifetime = true, - ValidateIssuerSigningKey = true, - ValidIssuer = _options.Issuer, - ValidAudience = _options.Audience, - IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_options.SecurityKey)), - }; - action?.Invoke(validationParameters); - claimsPrincipal = handler.ValidateToken(token, validationParameters, out securityToken); - return securityToken != null; - } - catch (SecurityTokenException ex) - { - _logger?.LogError("... IsValid Failed on SecurityTokenException", ex); - return false; - } - catch (Exception ex) - { - _logger?.LogError("... IsValid Failed", ex); - return false; - } - } -} diff --git a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/IJwtProvider.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/IJwtProvider.cs deleted file mode 100644 index 80e9b41e2..000000000 --- a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/IJwtProvider.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Token; - -public interface IJwtProvider -{ - string CreateToken(string value, TimeSpan timeout); - - string CreateToken(Claim[] claims, TimeSpan timeout); - - bool IsValid( - string token, - string value, - Action? action = null); - - bool IsValid( - string token, - out SecurityToken? securityToken, - out ClaimsPrincipal? claimsPrincipal, - Action? action = null); -} diff --git a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/JwtUtils.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/JwtUtils.cs deleted file mode 100644 index 0868b912e..000000000 --- a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/JwtUtils.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Token; - -public class JwtUtils -{ - private static IServiceProvider? _serviceProvider; - - public JwtUtils(IServiceCollection services) - { - _serviceProvider ??= services.BuildServiceProvider(); - } - - private static IServiceProvider GetServiceProvider() => _serviceProvider!.CreateScope().ServiceProvider; - - private static IJwtProvider GetJwtProvider() => GetServiceProvider().GetRequiredService(); - - - public static string CreateToken(string value, TimeSpan timeout) - => GetJwtProvider().CreateToken(value, timeout); - - public static string CreateToken(Claim[] claims, TimeSpan timeout) - => GetJwtProvider().CreateToken(claims, timeout); - - public static bool IsValid(string token, string value) - => GetJwtProvider().IsValid(token, value); - - public static bool IsValid(string token, out SecurityToken? securityToken, out ClaimsPrincipal? claimsPrincipal) - => GetJwtProvider().IsValid(token, out securityToken, out claimsPrincipal); -} diff --git a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj deleted file mode 100644 index 55615dc4e..000000000 --- a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - - - - diff --git a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs deleted file mode 100644 index eedfd42bb..000000000 --- a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Masa.Utils.Security.Token.Model; - -public class JwtConfigurationOptions -{ - public string Issuer { get; set; } = default!; - - public string Audience { get; set; } = default!; - - public string SecurityKey { get; set; } = default!; -} diff --git a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs deleted file mode 100644 index 972fb39f0..000000000 --- a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -namespace Microsoft.Extensions.DependencyInjection; - -public static class ServiceCollectionExtensions -{ - public static IServiceCollection AddJwt(this IServiceCollection services, Action options) - { - services.Configure(options); - services.TryAddScoped(); - new JwtUtils(services); - return services; - } -} diff --git a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/_Imports.cs b/src/Utils/Security/Token/src/Masa.Utils.Security.Token/_Imports.cs deleted file mode 100644 index 418c9db5c..000000000 --- a/src/Utils/Security/Token/src/Masa.Utils.Security.Token/_Imports.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.Utils.Security.Token; -global using Masa.Utils.Security.Token.Model; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.Extensions.Logging; -global using Microsoft.Extensions.Options; -global using Microsoft.IdentityModel.Tokens; -global using System.IdentityModel.Tokens.Jwt; -global using System.Security.Claims; -global using System.Text; diff --git a/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj index 9b02fb8cf..aded19b0e 100644 --- a/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj +++ b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj @@ -20,14 +20,14 @@ - - - - - - - - + + + + + + + + From 7f654937d75b20fb735c2d934b6989bd3a7d9c74 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 17:20:53 +0800 Subject: [PATCH 12/29] refactor: Refactor repo structure --- Masa.Framework.sln | 33 ++++++++++++------- ...ingBlocks.Authentication.Oidc.Cache.csproj | 14 ++++++++ ...ngBlocks.Authentication.Oidc.Domain.csproj | 14 ++++++++ 3 files changed, 50 insertions(+), 11 deletions(-) create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 9af354ef3..ce00f48ab 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -87,8 +87,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authent EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{E50AD1BC-69B0-4E51-94CB-72AB10761710}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{36BEA079-EDCD-44F7-8BD5-C06671DF4875}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{0D395B3E-D603-49C3-AD80-B53979EDF9E1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\Authentication\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{249E8BD4-C358-4358-93FA-78320D335014}" @@ -533,6 +531,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4231AB12 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests", "src\Contrib\Storage\ObjectStorage\Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj", "{C65638DC-2418-4453-917F-9FA8D068594E}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -669,14 +671,6 @@ Global {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Release|Any CPU.Build.0 = Release|Any CPU {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Release|x64.ActiveCfg = Release|Any CPU {E50AD1BC-69B0-4E51-94CB-72AB10761710}.Release|x64.Build.0 = Release|Any CPU - {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Debug|x64.ActiveCfg = Debug|Any CPU - {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Debug|x64.Build.0 = Debug|Any CPU - {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Release|Any CPU.Build.0 = Release|Any CPU - {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Release|x64.ActiveCfg = Release|Any CPU - {36BEA079-EDCD-44F7-8BD5-C06671DF4875}.Release|x64.Build.0 = Release|Any CPU {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Debug|Any CPU.Build.0 = Debug|Any CPU {0D395B3E-D603-49C3-AD80-B53979EDF9E1}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1877,6 +1871,22 @@ Global {C65638DC-2418-4453-917F-9FA8D068594E}.Release|Any CPU.Build.0 = Release|Any CPU {C65638DC-2418-4453-917F-9FA8D068594E}.Release|x64.ActiveCfg = Release|Any CPU {C65638DC-2418-4453-917F-9FA8D068594E}.Release|x64.Build.0 = Release|Any CPU + {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Debug|x64.ActiveCfg = Debug|Any CPU + {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Debug|x64.Build.0 = Debug|Any CPU + {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Release|Any CPU.Build.0 = Release|Any CPU + {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Release|x64.ActiveCfg = Release|Any CPU + {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Release|x64.Build.0 = Release|Any CPU + {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Debug|x64.ActiveCfg = Debug|Any CPU + {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Debug|x64.Build.0 = Debug|Any CPU + {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|Any CPU.Build.0 = Release|Any CPU + {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|x64.ActiveCfg = Release|Any CPU + {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1916,7 +1926,6 @@ Global {412A5797-7D42-4F7C-96AB-4F784872ED08} = {1987405B-2304-4FB0-8D20-F2101617D614} {2730D483-5E03-43EA-B8AA-D9EB1BAC77C4} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} {E50AD1BC-69B0-4E51-94CB-72AB10761710} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} - {36BEA079-EDCD-44F7-8BD5-C06671DF4875} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} {0D395B3E-D603-49C3-AD80-B53979EDF9E1} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} {249E8BD4-C358-4358-93FA-78320D335014} = {585B9627-45AA-42C3-965D-03359F25786C} {BB008555-DDF4-4A1F-B784-F3B7F34CDFDC} = {87BBAEC2-1A18-4E5D-BDB3-91BF1CF3231B} @@ -2139,6 +2148,8 @@ Global {1B2FF31A-187A-4D36-AD81-1ABD9BCF9044} = {62E888C1-9FCD-413D-91CB-1F2DD3D356E3} {4231AB12-3FB7-408E-B7C2-9CC0FFB710B1} = {1B2FF31A-187A-4D36-AD81-1ABD9BCF9044} {C65638DC-2418-4453-917F-9FA8D068594E} = {4231AB12-3FB7-408E-B7C2-9CC0FFB710B1} + {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} + {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj new file mode 100644 index 000000000..060949ec2 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj new file mode 100644 index 000000000..26768b3ee --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain + + + + + + + From 2ea82e558e7ed4a10b7fea05d1d17fae773e759e Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 17:21:33 +0800 Subject: [PATCH 13/29] refactor: Refactor repo structure --- .../DefaultTypeConvertProvider.cs | 15 + .../Entities/IIdentityUser.cs | 13 + .../Entities/IdentityRole.cs | 11 + .../Entities/IdentityUser.cs | 13 + .../Isolation/IIsolatedIdentityUser.cs | 8 + .../IMultiEnvironmentIdentityUser.cs | 9 + .../Isolation/IMultiTenantIdentityUser.cs | 9 + .../Isolation/IsolatedIdentityUser.cs | 9 + .../Isolation/MultiEnvironmentIdentityUser.cs | 9 + .../Isolation/MultiTenantIdentityUser.cs | 9 + .../Enum/IdentityType.cs | 23 + .../IIsolatedUserContext.cs | 10 + .../IMultiEnvironmentUserContext.cs | 9 + .../IMultiTenantUserContext.cs | 11 + .../ITypeConvertProvider.cs | 9 + .../IUserContext.cs | 19 + .../IUserSetter.cs | 9 + .../Internal/DisposeAction.cs | 17 + ...ildingBlocks.Identity.IdentityModel.csproj | 9 + .../UserContext.cs | 56 ++ .../_Imports.cs | 5 + .../Caches/IApiResourceCache.cs | 19 + .../Caches/IApiScopeCache.cs | 19 + .../Caches/IClientCache.cs | 19 + .../Caches/IIdentityResourceCache.cs | 19 + .../_Imports.cs | 5 + .../Constants/GrantTypeConsts.cs | 37 + .../Constants/GrantTypes.cs | 19 + .../Entities/Abstract/Property.cs | 11 + .../Entities/Abstract/Secret.cs | 15 + .../Entities/ApiResource.cs | 78 ++ .../Entities/ApiResourceClaim.cs | 21 + .../Entities/ApiResourceProperty.cs | 18 + .../Entities/ApiResourceScope.cs | 21 + .../Entities/ApiResourceSecret.cs | 12 + .../Entities/ApiScope.cs | 66 ++ .../Entities/ApiScopeClaim.cs | 20 + .../Entities/ApiScopeProperty.cs | 17 + .../Entities/Client.cs | 161 ++++ .../Entities/ClientClaim.cs | 15 + .../Entities/ClientCorsOrigin.cs | 13 + .../Entities/ClientGrantType.cs | 19 + .../Entities/ClientIdPRestriction.cs | 13 + .../Entities/ClientPostLogoutRedirectUri.cs | 18 + .../Entities/ClientProperty.cs | 17 + .../Entities/ClientRedirectUri.cs | 19 + .../Entities/ClientScope.cs | 18 + .../Entities/ClientSecret.cs | 11 + .../Entities/DeviceFlowCodes.cs | 71 ++ .../Entities/IdentityResource.cs | 66 ++ .../Entities/IdentityResourceClaim.cs | 21 + .../Entities/IdentityResourceProperty.cs | 18 + .../Entities/PersistedGrant.cs | 25 + .../Entities/UserClaim.cs | 22 + .../Enums/ClientTypes.cs | 13 + .../Enums/TokenExpiration.cs | 20 + .../Enums/TokenUsage.cs | 20 + .../Repositories/IApiResourceRepository.cs | 8 + .../Repositories/IApiScopeRepository.cs | 8 + .../Repositories/IClientRepository.cs | 8 + .../IIdentityResourceRepository.cs | 9 + .../Repositories/IRepositoryBase.cs | 24 + .../Repositories/IUserClaimRepository.cs | 9 + .../_Imports.cs | 11 + .../Constans/GrantType.cs | 19 + .../Constans/GrantTypes.cs | 37 + .../Constans/StandardIdentityResources.cs | 104 +++ .../Constans/StandardUserClaims.cs | 78 ++ .../Enums/AccessTokenType.cs | 13 + .../Enums/TokenExpiration.cs | 13 + .../Enums/TokenUsage.cs | 13 + ...ngBlocks.Authentication.Oidc.Models.csproj | 9 + .../Models/ApiResourceModel.cs | 50 ++ .../Models/ApiScopeModel.cs | 46 + .../Models/ClientClaimModel.cs | 59 ++ .../Models/ClientModel.cs | 227 +++++ .../Models/DeviceCodeModel.cs | 113 +++ .../Models/GrantType.cs | 22 + .../Models/IdentityResourceModel.cs | 48 + .../Models/PersistedGrantFilter.cs | 44 + .../Models/PersistedGrantModel.cs | 114 +++ .../Models/ResourceModel.cs | 23 + .../Models/ResourcesModel.cs | 45 + .../Models/SecretModel.cs | 40 + .../_Imports.cs | 9 + ...gBlocks.Authentication.Oidc.Storage.csproj | 16 + .../Stores/IClientStore.cs | 14 + .../Stores/IDeviceFlowStore.cs | 45 + .../Stores/IPersistedGrantStore.cs | 45 + .../Stores/IResourceStore.cs | 42 + .../_Imports.cs | 4 + ....BuildingBlocks.Configuration.Tests.csproj | 21 + .../TestProperties.cs | 66 ++ .../_Imports.cs | 4 + .../AbstractConfigurationRepository.cs | 42 + .../ConfigurationTypes.cs | 12 + .../IConfigurationApi.cs | 9 + .../IConfigurationApiClient.cs | 19 + .../IConfigurationApiManage.cs | 19 + .../IConfigurationRepository.cs | 15 + .../IMasaConfiguration.cs | 11 + .../IMasaConfigurationBuilder.cs | 15 + .../IRepositoryChangeListener.cs | 9 + .../Masa.BuildingBlocks.Configuration.csproj | 15 + .../Options/ConfigurationRelationOptions.cs | 18 + .../Options/IMasaConfigurationOptions.cs | 28 + .../Options/MasaConfigurationOptions.cs | 21 + .../Properties.cs | 73 ++ .../SectionTypes.cs | 10 + .../_Imports.cs | 9 + .../IMapping.cs | 13 + .../Mapper.cs | 22 + .../Masa.BuildingBlocks.Data.Mapping.csproj | 13 + .../Options/Enum/MapMode.cs | 16 + .../Options/MapOptions.cs | 9 + .../_Imports.cs | 6 + ...ildingBlocks.Data.MappingExtensions.csproj | 13 + .../ObjectExtensions.cs | 19 + .../_Imports.cs | 5 + .../DataFiltering/IDataFilter.cs | 13 + .../DataFiltering/ISoftDelete.cs | 9 + .../Masa.BuildingBlocks.Data.Contracts.csproj | 13 + .../Paginated/BasePaginatedList.cs | 14 + .../_Imports.cs | 5 + .../CommitState.cs | 16 + .../EntityState.cs | 10 + .../ITransaction.cs | 10 + .../IUnitOfWork.cs | 43 + .../IUnitOfWorkAccessor.cs | 12 + .../IUnitOfWorkManager.cs | 17 + .../Masa.BuildingBlocks.Data.UoW.csproj | 13 + .../Masa.BuildingBlocks.Data.UoW/_Imports.cs | 6 + .../BaseDbConnectionStringProvider.cs | 13 + .../DefaultConcurrencyStampProvider.cs | 9 + .../Concurrency/IConcurrencyStampProvider.cs | 9 + .../Concurrency/IHasConcurrencyStamp.cs | 9 + .../ConnectionStringNameAttribute.cs | 24 + .../ConnectionStrings.cs | 29 + .../Enum/SequentialGuidType.cs | 26 + .../Enum/TimestampType.cs | 10 + .../IConnectionStringProvider.cs | 21 + .../IDbConnectionStringProvider.cs | 9 + .../IDistributedLock.cs | 11 + .../IMasaDbContext.cs | 8 + .../IdGenerator/IGuidGenerator.cs | 8 + .../IdGenerator/IIdGenerator.cs | 11 + .../IdGenerator/ISequentialGuidGenerator.cs | 9 + .../IdGenerator/ISnowflakeGenerator.cs | 8 + .../IdGenerator/IdGeneratorFactory.cs | 36 + .../Masa.BuildingBlocks.Data.csproj | 13 + .../Options/MasaDbConnectionOptions.cs | 21 + .../MasaDbContextConfigurationOptions.cs | 11 + .../System/SequentialGuid.cs | 9 + .../System/Snowflake.cs | 9 + .../Data/Masa.BuildingBlocks.Data/_Imports.cs | 5 + ...asa.BuildingBlocks.Ddd.Domain.Tests.csproj | 21 + .../TestEntity.cs | 64 ++ .../TestValueObject.cs | 52 ++ .../_Imports.cs | 5 + .../Entities/AggregateRoot.cs | 80 ++ .../Entities/Auditing/AuditAggregateRoot.cs | 54 ++ .../Entities/Auditing/AuditEntity.cs | 54 ++ .../Entities/Auditing/IAuditAggregateRoot.cs | 14 + .../Entities/Auditing/IAuditEntity.cs | 19 + .../Entities/Entity.cs | 78 ++ .../Entities/Full/FullAggregateRoot.cs | 24 + .../Entities/Full/FullEntity.cs | 24 + .../Entities/Full/IFullAggregateRoot.cs | 14 + .../Entities/Full/IFullEntity.cs | 14 + .../Entities/IAggregateRoot.cs | 14 + .../Entities/IEntity.cs | 14 + .../Entities/IGenerateDomainEvents.cs | 11 + .../Events/DomainCommand.cs | 29 + .../Events/DomainEvent.cs | 29 + .../Events/DomainQuery.cs | 36 + .../Events/IDomainCommand.cs | 9 + .../Events/IDomainEvent.cs | 9 + .../Events/IDomainEventBus.cs | 14 + .../Events/IDomainQuery.cs | 10 + .../Events/IIntegrationDomainEvent.cs | 9 + .../Events/IntegrationDomainEvent.cs | 12 + .../Masa.BuildingBlocks.Ddd.Domain.csproj | 17 + .../Repositories/BaseRepository.cs | 163 ++++ .../Repositories/IRepository.cs | 132 +++ .../Repositories/PaginatedList.cs | 9 + .../Repositories/PaginatedOptions.cs | 36 + .../SeedWork/Enumeration.cs | 72 ++ .../Services/IDomainService.cs | 9 + .../Specifications/BaseSpecification.cs | 30 + .../Specifications/ISpecification.cs | 20 + .../Values/ValueObject.cs | 38 + .../_Imports.cs | 16 + .../Event.cs | 26 + .../IDispatcherOptions.cs | 11 + .../IEvent.cs | 21 + .../IEventBus.cs | 14 + .../IEventBusBuilder.cs | 11 + .../IEventHandler.cs | 10 + .../IMiddleware.cs | 21 + .../ISagaEventHandler.cs | 10 + ...sa.BuildingBlocks.Dispatcher.Events.csproj | 13 + .../Middleware.cs | 11 + .../_Imports.cs | 5 + .../IDistributedDispatcherOptions.cs | 8 + .../IIntegrationEvent.cs | 8 + .../IIntegrationEventBus.cs | 9 + .../ITopic.cs | 9 + .../IntegrationEvent.cs | 32 + .../IntegrationEventStates.cs | 12 + .../Logs/IIntegrationEventLogService.cs | 33 + .../Logs/IntegrationEventLog.cs | 72 ++ ...Blocks.Dispatcher.IntegrationEvents.csproj | 14 + .../_Imports.cs | 9 + .../Environment/IEnvironmentContext.cs | 9 + .../Environment/IEnvironmentSetter.cs | 9 + .../Environment/IMultiEnvironment.cs | 12 + .../IConvertProvider.cs | 9 + .../IIsolation.cs | 13 + .../IIsolationBuilder.cs | 9 + .../IParserProvider.cs | 11 + .../Masa.BuildingBlocks.Isolation.csproj | 18 + .../Middleware/IIsolationMiddleware.cs | 9 + .../MultiTenant/IMultiTenant.cs | 16 + .../MultiTenant/ITenantContext.cs | 9 + .../MultiTenant/ITenantSetter.cs | 9 + .../MultiTenant/Tenant.cs | 21 + .../Options/IsolationDbConnectionOptions.cs | 9 + .../Options/IsolationOptions.cs | 20 + .../Parser/CookieParserProvider.cs | 25 + .../EnvironmentVariablesParserProvider.cs | 20 + .../Parser/FormParserProvider.cs | 27 + .../Parser/HeaderParserProvider.cs | 25 + .../Parser/HttpContextItemParserProvider.cs | 25 + .../Parser/QueryStringParserProvider.cs | 24 + .../Parser/RouteParserProvider.cs | 22 + .../Masa.BuildingBlocks.Isolation/_Imports.cs | 9 + .../Commands/Command.cs | 29 + .../Commands/ICommand.cs | 8 + .../Commands/ICommandHandler.cs | 9 + ...ildingBlocks.ReadWriteSpliting.Cqrs.csproj | 14 + .../Queries/IQuery.cs | 9 + .../Queries/IQueryHandler.cs | 9 + .../Queries/Query.cs | 29 + .../_Imports.cs | 6 + ...cks.ReadWriteSpliting.EventSourcing.csproj | 9 + .../AutoCompleteDocument.cs | 80 ++ .../BaseAutoCompleteClient.cs | 96 ++ .../IAutoCompleteClient.cs | 80 ++ .../IAutoCompleteFactory.cs | 11 + ...ingBlocks.SearchEngine.AutoComplete.csproj | 9 + .../Options/AutoCompleteOptions.cs | 47 + .../Options/SetOptions.cs | 14 + .../Response/DeleteMultiResponse.cs | 20 + .../Response/DeleteRangeResponseItems.cs | 20 + .../Response/DeleteResponse.cs | 11 + .../Response/GetResponse.cs | 25 + .../Response/ResponseBase.cs | 17 + .../Response/SetResponse.cs | 13 + .../Response/SetResponseItems.cs | 20 + .../SearchType.cs | 10 + .../_Imports.cs | 6 + .../CustomAutoCompleteClient.cs | 28 + ...cks.SearchEngine.AutoComplete.Tests.csproj | 21 + .../TestAutoCompleteClient.cs | 28 + .../_Imports.cs | 6 + .../AbstractCaller.cs | 391 ++++++++ .../AddCallerExtensions.cs | 15 + .../CallerBase.cs | 31 + .../ICaller.cs | 219 +++++ .../ICallerFactory.cs | 11 + .../IRequestMessage.cs | 11 + .../IResponseMessage.cs | 11 + .../ITypeConvertor.cs | 24 + .../Masa.BuildingBlocks.Service.Caller.csproj | 14 + .../Options/CallerFactoryOptions.cs | 13 + .../Options/CallerOptions.cs | 36 + .../Options/CallerRelationOptions.cs | 20 + .../_Imports.cs | 8 + .../BaseMessage.cs | 14 + .../BaseRequest.cs | 8 + .../BaseResponse.cs | 30 + ...sa.BuildingBlocks.Service.Contracts.csproj | 9 + .../IService.cs | 15 + ....BuildingBlocks.Service.MinimalAPIs.csproj | 14 + .../_Imports.cs | 5 + .../Enum/GenderTypes.cs | 10 + .../Enum/StaffTypes.cs | 10 + .../Enum/SubjectTypes.cs | 12 + .../Enum/TeamTypes.cs | 9 + ...dingBlocks.StackSdks.Auth.Contracts.csproj | 9 + .../Model/AddUserModel.cs | 38 + .../Model/AddressValueModel.cs | 33 + .../Model/AppModel.cs | 19 + .../Model/CollectMenuModel.cs | 11 + .../Model/DisableUserModel.cs | 14 + .../Model/MenuModel.cs | 19 + .../Model/NavModel.cs | 17 + .../Model/ProjectModel.cs | 15 + .../Model/RoleModel.cs | 11 + .../Model/StaffDetailModel.cs | 16 + .../Model/StaffModel.cs | 80 ++ .../Model/SubjectModel.cs | 45 + .../Model/TeamDetailModel.cs | 49 + .../Model/TeamModel.cs | 19 + .../Model/TeamPersonnelModel.cs | 20 + .../Model/UpdateUserBasicInfoModel.cs | 19 + .../Model/UpdateUserPasswordModel.cs | 13 + .../Model/UpsertUserModel.cs | 38 + .../Model/UserModel.cs | 73 ++ .../Model/UserPortraitModel.cs | 17 + .../Model/UserSimpleModel.cs | 20 + .../Model/UserVisitedModel.cs | 11 + .../_Imports.cs | 4 + .../IAuthClient.cs | 18 + .../IEnvironmentProvider.cs | 9 + .../Masa.BuildingBlocks.StackSdks.Auth.csproj | 13 + .../Service/IPermissionService.cs | 29 + .../Service/IProjectService.cs | 9 + .../Service/ISubjectService.cs | 10 + .../Service/ITeamService.cs | 14 + .../Service/IUserService.cs | 52 ++ .../_Imports.cs | 5 + .../Enums/AggregationTypes.cs | 11 + .../ITscClient.cs | 11 + .../Masa.BuildingBlocks.StackSdks.Tsc.csproj | 9 + .../Model/Log/FieldAggregationRequest.cs | 13 + .../Model/Log/LogAggregationRequest.cs | 15 + .../Model/Log/LogLatestRequest.cs | 15 + .../Model/Metric/LableValuesRequest.cs | 27 + .../Model/Metric/ValuesRequest.cs | 20 + .../Service/ILogService.cs | 13 + .../Service/IMetricService.cs | 13 + .../_Imports.cs | 7 + .../IDccClient.cs | 9 + .../Masa.BuildingBlocks.StackSdks.Dcc.csproj | 9 + .../Model/LabelModel.cs | 20 + .../Service/ILabelService.cs | 9 + .../_Imports.cs | 5 + .../Enum/ChannelTypes.cs | 11 + .../Enum/MessageTaskReceiverTypes.cs | 13 + .../Enum/MessageTaskSelectReceiverTypes.cs | 10 + .../Enum/MessageTaskSources.cs | 10 + .../Enum/MessageTaskStatuses.cs | 14 + .../Enum/MessageTemplateAuditStatuses.cs | 11 + .../Enum/MessageTemplateStates.cs | 10 + .../Enum/MessageTypes.cs | 10 + .../Enum/ReceiverGroupItemTypes.cs | 12 + .../Enum/SendTargets.cs | 10 + .../Enum/WebsiteMessageFilterType.cs | 10 + .../IMcClient.cs | 17 + .../ExtraPropertyDictionary.cs | 18 + .../Masa.BuildingBlocks.StackSdks.Mc.csproj | 13 + .../Model/AuditEntityModel.cs | 15 + .../Model/ChannelModel.cs | 17 + .../Model/EntityModel.cs | 9 + .../Model/GetChannelModel.cs | 13 + .../Model/GetMessageTemplateModel.cs | 23 + .../Model/GetNoticeListModel.cs | 9 + .../Model/GetReceiverGroupModel.cs | 9 + .../Model/GetWebsiteMessageModel.cs | 15 + .../Model/MessageInfoModel.cs | 17 + .../Model/MessageInfoUpsertModel.cs | 17 + .../Model/MessageTaskModel.cs | 43 + .../Model/MessageTaskReceiverModel.cs | 21 + .../Model/MessageTemplateItemModel.cs | 15 + .../Model/MessageTemplateModel.cs | 50 ++ .../Model/PaginatedListModel.cs | 25 + .../Model/PaginatedOptionsModel.cs | 20 + .../Model/ReadAllWebsiteMessageModel.cs | 8 + .../Model/ReadWebsiteMessageModel.cs | 9 + .../Model/ReceiverGroupItemModel.cs | 21 + .../Model/ReceiverGroupModel.cs | 15 + .../Model/SendOrdinaryMessageModel.cs | 23 + .../Model/SendRuleModel.cs | 13 + .../Model/SendTemplateMessageModel.cs | 25 + .../Model/WebsiteMessageChannelModel.cs | 9 + .../Model/WebsiteMessageModel.cs | 31 + .../Service/IChannelService.cs | 11 + .../Service/IMessageTaskService.cs | 13 + .../Service/IMessageTemplateService.cs | 11 + .../Service/IReceiverGroupService.cs | 11 + .../Service/IWebsiteMessageService.cs | 27 + .../_Imports.cs | 8 + .../Enum/AppTypes.cs | 16 + .../Enum/ServiceTypes.cs | 13 + .../IPmClient.cs | 17 + .../Masa.BuildingBlocks.StackSdks.Pm.csproj | 9 + .../Model/AppDetailModel.cs | 27 + .../Model/AppModel.cs | 31 + .../Model/BaseModel.cs | 15 + .../Model/ClusterDetailModel.cs | 15 + .../Model/ClusterModel.cs | 13 + .../Model/EnvironmentClusterModel.cs | 23 + .../Model/EnvironmentDetailModel.cs | 17 + .../Model/EnvironmentModel.cs | 13 + .../Model/ProjectAppsModel.cs | 28 + .../Model/ProjectDetailModel.cs | 21 + .../Model/ProjectModel.cs | 23 + .../Model/ProjectTypeModel.cs | 11 + .../Service/IAppService.cs | 19 + .../Service/IClusterService.cs | 17 + .../Service/IEnvironmentService.cs | 13 + .../Service/IProjectService.cs | 21 + .../_Imports.cs | 7 + .../Enum/HttpMethods.cs | 13 + .../Enum/HttpVerifyTypes.cs | 12 + .../Enum/JobTypes.cs | 11 + .../Enum/RunTimeoutStrategyTypes.cs | 10 + .../Enum/ScheduleBlockStrategyTypes.cs | 12 + .../Enum/ScheduleExpiredStrategyTypes.cs | 11 + .../ISchedulerClient.cs | 11 + .../ISchedulerJob.cs | 13 + ....BuildingBlocks.StackSdks.Scheduler.csproj | 9 + .../Model/JobContext.cs | 19 + .../Model/SchedulerJobAppConfig.cs | 17 + ...SchedulerJobDaprServiceInvocationConfig.cs | 15 + .../Model/SchedulerJobHttpConfig.cs | 21 + .../Request/AddSchedulerJobRequest.cs | 48 + .../Request/BaseSchedulerJobRequest.cs | 11 + .../Request/BaseSchedulerTaskRequest.cs | 11 + .../Request/ChangeEnabledStatusRequest.cs | 9 + .../Request/StartSchedulerTaskRequest.cs | 9 + .../Service/ISchedulerJobService.cs | 17 + .../Service/ISchedulerTaskService.cs | 11 + .../_Imports.cs | 7 + .../BucketNameAttribute.cs | 24 + .../BucketNames.cs | 26 + .../DefaultClientContainer.cs | 51 ++ .../DefaultClientFactory.cs | 19 + .../IBucketNameProvider.cs | 11 + .../IClient.cs | 54 ++ .../IClientContainer.cs | 53 ++ .../IClientFactory.cs | 9 + ...uildingBlocks.Storage.ObjectStorage.csproj | 13 + .../Response/TemporaryCredentialsResponse.cs | 23 + .../StorageOptions.cs | 19 + .../_Imports.cs | 6 + .../ClaimExtensions.cs | 10 + .../Const/ClaimType.cs | 19 + .../DefaultIsolatedUserContext.cs | 50 ++ .../DefaultMultiEnvironmentUserContext.cs | 38 + .../DefaultMultiTenantUserContext.cs | 47 + .../DefaultUserContext.cs | 56 ++ .../HttpContextCurrentPrincipalAccessor.cs | 14 + .../ICurrentPrincipalAccessor.cs | 9 + .../IdentityClaimOptions.cs | 26 + ...Masa.Contrib.Identity.IdentityModel.csproj | 18 + .../README.md | 49 + .../README.zh-CN.md | 49 + .../ServiceCollectionExtensions.cs | 100 +++ .../ThreadCurrentPrincipalAccessor.cs | 9 + .../_Imports.cs | 12 + ...b.Authentication.Oidc.Cache.Storage.csproj | 17 + .../README.md | 47 + .../README.zh-CN.md | 47 + .../ServiceCollectionExtensions.cs | 18 + .../Stores/ClientStore.cs | 22 + .../Stores/DeviceFlowStore.cs | 32 + .../Stores/PersistedGrantStore.cs | 32 + .../Stores/ResourceStore.cs | 58 ++ .../_Imports.cs | 9 + .../Caches/ApiResourceCache.cs | 78 ++ .../Caches/ApiScopeCache.cs | 78 ++ .../Caches/ClientCache.cs | 58 ++ .../Caches/IdentityResourceCache.cs | 78 ++ ...a.Contrib.Authentication.Oidc.Cache.csproj | 15 + .../Models/CacheKeyConstants.cs | 12 + .../Models/Mapper.cs | 106 +++ .../README.md | 49 + .../README.zh-CN.md | 49 + .../ServiceCollectionExtensions.cs | 18 + .../Utils/CollectionExtensions.cs | 52 ++ .../_Imports.cs | 14 + .../Caches/SyncCache.cs | 111 +++ .../DbContexts/OidcDbContext.cs | 19 + ...ApiResourceClaimEntityTypeConfiguration.cs | 12 + .../ApiResourceEntityTypeConfiguration.cs | 20 + ...ResourcePropertyEntityTypeConfiguration.cs | 13 + ...ApiResourceScopeEntityTypeConfiguration.cs | 12 + ...piResourceSecretEntityTypeConfiguration.cs | 14 + .../ApiScopeClaimEntityTypeConfiguration.cs | 12 + .../ApiScopeEntityTypeConfiguration.cs | 18 + ...ApiScopePropertyEntityTypeConfiguration.cs | 13 + .../ClientClaimEntityTypeConfiguration.cs | 13 + ...ClientCorsOriginEntityTypeConfiguration.cs | 12 + .../ClientEntityTypeConfiguration.cs | 35 + .../ClientGrantTypeEntityTypeConfiguration.cs | 12 + ...ntIdPRestrictionEntityTypeConfiguration.cs | 12 + ...ogoutRedirectUriEntityTypeConfiguration.cs | 12 + .../ClientPropertyEntityTypeConfiguration.cs | 13 + ...lientRedirectUriEntityTypeConfiguration.cs | 12 + .../ClientScopeEntityTypeConfiguration.cs | 12 + .../ClientSecretEntityTypeConfiguration.cs | 14 + .../DeviceFlowCodesEntityTypeConfiguration.cs | 27 + ...ityResourceClaimEntityTypeConfiguration.cs | 12 + ...IdentityResourceEntityTypeConfiguration.cs | 18 + ...ResourcePropertyEntityTypeConfiguration.cs | 13 + .../PersistedGrantEntityTypeConfiguration.cs | 27 + .../UserClaimEntityTypeConfiguration.cs | 14 + ...entication.Oidc.EntityFrameworkCore.csproj | 19 + .../Options/OidcDbContextOptions.cs | 41 + .../README.md | 39 + .../README.zh-CN.md | 39 + .../Repositories/ApiResourceRepository.cs | 91 ++ .../Repositories/ApiScopeRepository.cs | 89 ++ .../Repositories/ClientRepository.cs | 92 ++ .../IdentityResourceRepository.cs | 114 +++ .../Repositories/UserClaimRepository.cs | 97 ++ .../ServiceCollectionExtensions.cs | 36 + .../_Imports.cs | 16 + ...ontrib.Identity.IdentityModel.Tests.csproj | 30 + .../TestIdentity.cs | 238 +++++ .../_Imports.cs | 10 + .../ConfigurationApiClient.cs | 212 +++++ .../ConfigurationApiExtensions.cs | 18 + .../ConfigurationApiManage.cs | 45 + .../Internal/ConfigFormats.cs | 13 + .../Internal/ConfigurationApiBase.cs | 40 + .../Internal/Constants.cs | 15 + .../Internal/DccConfigurationRepository.cs | 95 ++ .../Internal/DccFactory.cs | 23 + .../Internal/Model/Property.cs | 11 + .../Internal/Model/PublishRelease.cs | 34 + .../Internal/Model/StaticConfig.cs | 11 + .../Internal/Options/DccOptions.cs | 20 + .../Parser/JsonConfigurationParser.cs | 104 +++ .../Parser/PropertyConfigurationParser.cs | 10 + .../Internal/Parser/XmlConfigurationParser.cs | 83 ++ ....Configuration.ConfigurationApi.Dcc.csproj | 24 + .../MasaConfigurationExtensions.cs | 217 +++++ ...onfigurationApiMasaConfigurationOptions.cs | 29 + .../Options/DccConfigurationOptions.cs | 16 + .../Options/DccExpandSectionOptions.cs | 12 + .../Options/DccSectionOptions.cs | 27 + .../README.md | 174 ++++ .../README.zh-CN.md | 165 ++++ .../_Imports.cs | 31 + .../CustomMemoryCacheClientFactory.cs | 13 + .../DccClientTest.cs | 464 ++++++++++ .../DccManageTest.cs | 219 +++++ .../DccTest.cs | 842 ++++++++++++++++++ .../Internal/Common/SerializeCommon.cs | 10 + .../Internal/Config/Property.cs | 11 + .../Internal/Config/PublishRelease.cs | 13 + .../Internal/CustomConfigurationApiClient.cs | 25 + .../Internal/CustomTrigger.cs | 29 + .../Internal/Enum/ConfigFormats.cs | 13 + .../Internal/Model/Brands.cs | 17 + ...guration.ConfigurationApi.Dcc.Tests.csproj | 41 + .../_Imports.cs | 32 + .../appsettings.json | 23 + .../expandSections.json | 32 + .../ConfigurationOptions.cs | 20 + .../DefaultConfigurationApi.cs | 19 + .../DefaultMasaConfiguration.cs | 21 + .../DefaultMasaConfigurationSourceProvider.cs | 79 ++ .../IMasaConfigurationSourceProvider.cs | 12 + .../Internal/ConfigurationExtensions.cs | 31 + .../LocalMasaConfigurationOptions.cs | 16 + .../LocalMasaConfigurationRepository.cs | 61 ++ .../Masa.Contrib.Configuration.csproj | 17 + .../MasaConfigurationBuilder.cs | 39 + .../MasaConfigurationExtensions.cs | 47 + .../MasaConfigurationProvider.cs | 67 ++ .../MasaConfigurationSource.cs | 18 + .../MasaRelationOptions.cs | 54 ++ .../Masa.Contrib.Configuration/README.md | 125 +++ .../README.zh-CN.md | 131 +++ .../ServiceCollectionExtensions.cs | 120 +++ .../WebApplicationBuilderExtensions.cs | 60 ++ .../Masa.Contrib.Configuration/_Imports.cs | 24 + .../Config/MountSectionRedisOptions.cs | 9 + .../Config/RabbitMqOptions.cs | 23 + .../Config/RedisOptions.cs | 13 + .../Config/SystemOptions.cs | 9 + .../ConfigurationTest.cs | 296 ++++++ .../Masa.Contrib.Configuration.Tests.csproj | 50 ++ .../_Imports.cs | 13 + .../appsettings.json | 14 + .../customAppConfig.json | 7 + .../rabbitMq.json | 9 + .../redis.json | 7 + .../EsOptions.cs | 14 + ...AutoMap.NoArgumentConstructor.Tests.csproj | 15 + .../KafkaOptions.cs | 11 + ...Contrib.Configuration.AutoMap.Tests.csproj | 14 + .../DataFiltering/DataFilter.cs | 71 ++ .../SoftDeleteSaveChangesFilter.cs | 93 ++ .../Internal/DataFilterState.cs | 14 + .../Internal/DisposeAction.cs | 13 + .../Internal/InstanceBuilder.cs | 27 + .../Internal/NullDisposable.cs | 13 + .../Masa.Contrib.Data.Contracts.EF.csproj | 18 + .../MasaDbContextOptionsBuilderExtensions.cs | 68 ++ .../Options/FilterOptions.cs | 15 + .../_Imports.cs | 19 + .../DataFilterTest.cs | 47 + ...asa.Contrib.Data.Contracts.EF.Tests.csproj | 29 + .../_Imports.cs | 7 + .../DefaultLocalDistributedLock.cs | 39 + .../ArgumentNullOrWhiteSpaceException.cs | 15 + .../Internal/DisposeAction.cs | 19 + ....Contrib.Data.DistributedLock.Local.csproj | 15 + .../README.md | 28 + .../README.zh-CN.md | 28 + .../ServiceCollectionExtensions.cs | 16 + .../_Imports.cs | 8 + ...ata.DistributedLock.Medallion.Azure.csproj | 17 + .../MedallionBuilderExtensions.cs | 28 + .../README.md | 31 + .../README.zh-CN.md | 32 + .../_Imports.cs | 7 + ...istributedLock.Medallion.FileSystem.csproj | 17 + .../MedallionBuilderExtensions.cs | 16 + .../README.md | 31 + .../README.zh-CN.md | 32 + .../_Imports.cs | 6 + ...ata.DistributedLock.Medallion.MySql.csproj | 18 + .../MedallionBuilderExtensions.cs | 35 + .../README.md | 31 + .../README.zh-CN.md | 32 + .../_Imports.cs | 8 + ...ta.DistributedLock.Medallion.Oracle.csproj | 18 + .../MedallionBuilderExtensions.cs | 35 + .../README.md | 31 + .../README.zh-CN.md | 32 + .../_Imports.cs | 8 + ...istributedLock.Medallion.PostgreSql.csproj | 18 + .../MedallionBuilderExtensions.cs | 35 + .../README.md | 31 + .../README.zh-CN.md | 32 + .../_Imports.cs | 8 + .../ConfigurationOptionsExtensions.cs | 31 + ...ata.DistributedLock.Medallion.Redis.csproj | 18 + .../MedallionBuilderExtensions.cs | 47 + .../README.md | 31 + .../README.zh-CN.md | 32 + .../_Imports.cs | 10 + ...DistributedLock.Medallion.SqlServer.csproj | 19 + .../MedallionBuilderExtensions.cs | 34 + .../README.md | 31 + .../README.zh-CN.md | 32 + .../_Imports.cs | 8 + .../DefaultMedallionDistributedLockTest.cs | 38 + ...ata.DistributedLock.Medallion.Tests.csproj | 21 + .../_Imports.cs | 6 + ...stributedLock.Medallion.WaitHandles.csproj | 18 + .../MedallionBuilderExtensions.cs | 19 + .../README.md | 33 + .../README.zh-CN.md | 33 + .../_Imports.cs | 6 + ...DistributedLock.Medallion.ZooKeeper.csproj | 17 + .../MedallionBuilderExtensions.cs | 24 + .../README.md | 31 + .../README.zh-CN.md | 32 + .../_Imports.cs | 6 + .../DefaultMedallionDistributedLock.cs | 32 + .../ArgumentNullOrWhiteSpaceException.cs | 15 + .../Internal/DisposeAction.cs | 19 + ...trib.Data.DistributedLock.Medallion.csproj | 18 + .../MedallionBuilder.cs | 11 + .../README.md | 46 + .../README.zh-CN.md | 47 + .../ServiceCollectionExtensions.cs | 23 + .../_Imports.cs | 9 + .../LocalDistributedLockTest.cs | 32 + ...ib.Data.DistributedLock.Local.Tests.csproj | 21 + .../_Imports.cs | 6 + ...Contrib.Data.IdGenerator.NormalGuid.csproj | 17 + .../NormalGuidGenerator.cs | 11 + .../README.md | 26 + .../README.zh-CN.md | 26 + .../ServiceCollectionExtensions.cs | 15 + .../_Imports.cs | 6 + ...ta.IdGenerator.SequentialGuid.Tests.csproj | 20 + .../SequentialGuidGeneratorTest.cs | 20 + .../_Imports.cs | 8 + ...rib.Data.IdGenerator.SequentialGuid.csproj | 17 + .../README.md | 26 + .../README.zh-CN.md | 26 + .../SequentialGuidGenerator.cs | 71 ++ .../ServiceCollectionExtensions.cs | 19 + .../_Imports.cs | 7 + .../BaseRedis.cs | 43 + .../DistributedIdGeneratorOptions.cs | 31 + .../DistributedWorkerProvider.cs | 185 ++++ .../IdGeneratorOptionsExtensions.cs | 44 + .../Internal/SnowflakeExtensions.cs | 21 + .../MachineClockIdGenerator.cs | 42 + ...nerator.Snowflake.Distributed.Redis.csproj | 14 + .../README.md | 38 + .../README.zh-CN.md | 37 + .../_Imports.cs | 14 + .../BaseIdGenerator.cs | 109 +++ .../DefaultWorkerProvider.cs | 20 + .../IWorkerProvider.cs | 24 + .../IdGeneratorOptions.cs | 66 ++ .../Internal/Const.cs | 26 + .../Internal/EnironmentExtensions.cs | 16 + .../Internal/SnowflakeExtensions.cs | 21 + .../Internal/SnowflakeIdGenerator.cs | 21 + .../Internal/WorkerIdBackgroundServices.cs | 74 ++ .../MachineClockIdGenerator.cs | 29 + ....Contrib.Data.IdGenerator.Snowflake.csproj | 19 + .../README.md | 113 +++ .../README.zh-CN.md | 115 +++ .../ServiceCollectionExtensions.cs | 75 ++ .../_Imports.cs | 10 + .../Benchmarks.cs | 59 ++ ...ta.IdGenerator.Snowflake.Benchmarks.csproj | 22 + .../Program.cs | 16 + .../_Imports.cs | 11 + .../DistributedBenchmarks.cs | 45 + ...wflake.Distributed.Redis.Benchmarks.csproj | 24 + .../Program.cs | 16 + .../_Imports.cs | 13 + .../CustomDistributedWorkerProvider.cs | 20 + .../IdGeneratorTest.cs | 353 ++++++++ ...ib.Data.IdGenerator.Snowflake.Tests.csproj | 20 + .../_Imports.cs | 17 + .../DefaultMapper.cs | 34 + .../DefaultMappingConfigProvider.cs | 187 ++++ .../IMappingConfigProvider.cs | 9 + .../Internal/InvokeBuilder.cs | 40 + .../Internal/Options/MapTypeOptions.cs | 19 + .../Internal/TypeAdapterSetterExpand.cs | 15 + .../Masa.Contrib.Data.Mapping.Mapster.csproj | 19 + .../README.md | 85 ++ .../README.zh-CN.md | 86 ++ .../ServiceCollectionExtensions.cs | 46 + .../_Imports.cs | 15 + .../BaseMappingTest.cs | 20 + .../Domain/Aggregates/Orders/Order.cs | 36 + .../Domain/Aggregates/Orders/OrderItem.cs | 25 + .../Domain/Aggregates/Users/User.cs | 41 + .../Domain/ValueObjects/AddressItem.cs | 25 + .../MappingExtensionsTest.cs | 198 ++++ .../MappingFormTest.cs | 28 + .../MappingTest.cs | 191 ++++ ....Contrib.Data.Mapping.Mapster.Tests.csproj | 23 + .../Requests/AddressItemRequest.cs | 13 + .../Requests/Orders/OrderItemRequest.cs | 13 + .../Requests/Orders/OrderMultiRequest.cs | 13 + .../Requests/Orders/OrderRequest.cs | 11 + .../Requests/Users/CreateFullUserRequest.cs | 15 + .../Requests/Users/CreateUserRequest.cs | 9 + .../_Imports.cs | 16 + .../Internal/Parser.cs | 26 + ...rib.Data.EntityFrameworkCore.Cosmos.csproj | 17 + .../MasaDbContextBuilderExtensions.cs | 105 +++ .../MasaDbContextOptionsBuilderExtensions.cs | 28 + .../README.md | 34 + .../README.zh-CN.md | 34 + .../_Imports.cs | 9 + ...b.Data.EntityFrameworkCore.InMemory.csproj | 17 + .../MasaDbContextBuilderExtensions.cs | 59 ++ .../MasaDbContextOptionsBuilderExtensions.cs | 16 + .../README.md | 33 + .../README.zh-CN.md | 33 + .../_Imports.cs | 8 + ...trib.Data.EntityFrameworkCore.MySql.csproj | 17 + .../MasaDbContextBuilderExtensions.cs | 81 ++ .../MasaDbContextOptionsBuilderExtensions.cs | 25 + .../README.md | 33 + .../README.zh-CN.md | 33 + .../_Imports.cs | 9 + ...rib.Data.EntityFrameworkCore.Oracle.csproj | 17 + .../MasaDbContextBuilderExtensions.cs | 81 ++ .../MasaDbContextOptionsBuilderExtensions.cs | 25 + .../README.md | 33 + .../README.zh-CN.md | 33 + .../_Imports.cs | 9 + ...ta.EntityFrameworkCore.Pomelo.MySql.csproj | 17 + .../MasaDbContextBuilderExtensions.cs | 89 ++ .../MasaDbContextOptionsBuilderExtensions.cs | 27 + .../README.md | 33 + .../README.zh-CN.md | 33 + .../_Imports.cs | 9 + ...Data.EntityFrameworkCore.PostgreSql.csproj | 17 + .../MasaDbContextBuilderExtensions.cs | 81 ++ .../MasaDbContextOptionsBuilderExtensions.cs | 25 + .../README.md | 33 + .../README.zh-CN.md | 33 + .../_Imports.cs | 9 + ....Data.EntityFrameworkCore.SqlServer.csproj | 17 + .../MasaDbContextBuilderExtensions.cs | 81 ++ .../MasaDbContextOptionsBuilderExtensions.cs | 25 + .../README.md | 33 + .../README.zh-CN.md | 33 + .../_Imports.cs | 9 + ...rib.Data.EntityFrameworkCore.Sqlite.csproj | 17 + .../MasaDbContextBuilderExtensions.cs | 81 ++ .../MasaDbContextOptionsBuilderExtensions.cs | 25 + .../README.md | 33 + .../README.zh-CN.md | 33 + .../_Imports.cs | 9 + .../CustomDbContext.cs | 18 + .../DbContextTest.cs | 219 +++++ .../DefaultConnectionStringProviderTest.cs | 44 + .../Internal/PaginatedOptions.cs | 11 + .../Internal/Repository.cs | 35 + ...trib.Data.EntityFrameworkCore.Tests.csproj | 25 + .../Models/Address.cs | 11 + .../Models/Hobby.cs | 18 + .../Models/Student.cs | 19 + .../TestBase.cs | 34 + .../_Imports.cs | 14 + .../DbConnectionStringProvider.cs | 14 + .../DefaultConnectionStringProvider.cs | 21 + .../EntityTypeBuilderExtensions.cs | 28 + .../Filters/ISaveChangesFilter.cs | 9 + .../Filters/SaveChangeFilter.cs | 56 ++ .../IModelCreatingProvider.cs | 13 + ...sa.Contrib.Data.EntityFrameworkCore.csproj | 24 + .../MasaDbContext.cs | 251 ++++++ .../MasaDbContextBuilder.cs | 28 + .../MasaDbContextOptions.cs | 24 + .../MasaDbContextOptionsBuilder.cs | 20 + .../MasaDbContextOptionsBuilder`.cs | 22 + .../MasaDbContextOptions`.cs | 71 ++ .../README.md | 47 + .../README.zh-CN.md | 48 + .../ServiceCollectionExtensions.cs | 123 +++ .../_Imports.cs | 24 + .../DefaultConnectionStringProvider.cs | 37 + .../DispatcherOptionsExtensions.cs | 84 ++ .../Internal/Const.cs | 9 + .../Masa.Contrib.Data.UoW.EF.csproj | 20 + .../UoW/Masa.Contrib.Data.UoW.EF/README.md | 25 + .../Masa.Contrib.Data.UoW.EF/README.zh-CN.md | 25 + .../Masa.Contrib.Data.UoW.EF/Transaction.cs | 12 + .../Masa.Contrib.Data.UoW.EF/UnitOfWork.cs | 109 +++ .../UnitOfWorkAccessor.cs | 9 + .../UnitOfWorkManager.cs | 39 + .../UoW/Masa.Contrib.Data.UoW.EF/_Imports.cs | 18 + .../CustomDbContext.cs | 42 + .../Masa.Contrib.Data.UoW.EF.Tests.csproj | 45 + .../TestBase.cs | 21 + .../TestUnitOfWork.cs | 279 ++++++ .../_Imports.cs | 19 + .../appsettings.json | 5 + .../DispatcherOptionsExtensions.cs | 31 + .../Internal/LinqExtensions.cs | 96 ++ .../ServiceCollectionRepositoryExtensions.cs | 73 ++ .../Internal/TypeExtensions.cs | 13 + ...sa.Contrib.Ddd.Domain.Repository.EF.csproj | 18 + .../README.md | 71 ++ .../README.zh-CN.md | 71 ++ .../Repository.cs | 227 +++++ .../_Imports.cs | 17 + .../Masa.Contrib.Ddd.Domain/DomainEventBus.cs | 79 ++ .../Masa.Contrib.Ddd.Domain/DomainService.cs | 11 + .../Masa.Contrib.Ddd.Domain.csproj | 18 + .../Options/DispatcherOptions.cs | 40 + .../Domain/Masa.Contrib.Ddd.Domain/README.md | 125 +++ .../Masa.Contrib.Ddd.Domain/README.zh-CN.md | 125 +++ .../ServiceCollectionExtensions.cs | 64 ++ .../Masa.Contrib.Ddd.Domain/_Imports.cs | 17 + .../Domain/Entities/Address.cs | 26 + .../Domain/Entities/OrderItem.cs | 19 + .../Domain/Entities/Orders.cs | 38 + ...trib.Ddd.Domain.Repository.EF.Tests.csproj | 25 + .../RepositoryTest.cs | 232 +++++ .../_Imports.cs | 16 + .../DispatcherOptionsExtensions.cs | 56 ++ ...b.Dispatcher.IntegrationEvents.Dapr.csproj | 20 + .../Options/DispatcherOptions.cs | 43 + .../Publisher.cs | 23 + .../README.md | 71 ++ .../README.zh-CN.md | 71 ++ .../ServiceCollectionExtensions.cs | 55 ++ .../_Imports.cs | 13 + .../DispatcherOptionsExtensions.cs | 38 + .../IntegrationEventLogContext.cs | 13 + ...egrationEventLogEntityTypeConfiguration.cs | 44 + ...ntegrationEventLogModelCreatingProvider.cs | 13 + .../IntegrationEventLogService.cs | 166 ++++ ...cher.IntegrationEvents.EventLogs.EF.csproj | 20 + .../README.md | 24 + .../README.zh-CN.md | 24 + .../_Imports.cs | 18 + .../DispatcherOptionsExtensions.cs | 29 + .../IProcessingServer.cs | 9 + .../IProcessor.cs | 16 + .../IPublisher.cs | 9 + .../IntegrationEventBus.cs | 107 +++ .../IntegrationEventHostedService.cs | 25 + .../Internal/IntegrationEventLogItem.cs | 34 + .../Internal/LocalQueueProcessor.cs | 63 ++ ...ontrib.Dispatcher.IntegrationEvents.csproj | 19 + .../Options/DispatcherOptions.cs | 212 +++++ .../DeleteLocalQueueExpiresProcessor.cs | 25 + .../DeletePublishedExpireEventProcessor.cs | 29 + .../Processor/InfiniteLoopProcessor.cs | 40 + .../Processor/ProcessorBase.cs | 46 + .../Processor/RetryByDataProcessor.cs | 72 ++ .../Processor/RetryByLocalQueueProcessor.cs | 71 ++ .../README.md | 119 +++ .../README.zh-CN.md | 119 +++ .../Servers/DefaultHostedService.cs | 26 + .../ServiceCollectionExtensions.cs | 90 ++ .../_Imports.cs | 20 + .../DispatcherOptionTest.cs | 55 ++ .../IntegrationEventBusTest.cs | 142 +++ ...atcher.IntegrationEvents.Dapr.Tests.csproj | 32 + .../ProcessorTest.cs | 128 +++ .../_Imports.cs | 18 + .../Domain/Entities/User.cs | 11 + .../Events/IntegrationEvent.cs | 32 + .../OrderPaymentSucceededIntegrationEvent.cs | 13 + .../Infrastructure/CustomDbContext.cs | 13 + .../IntegrationEventLogContextTest.cs | 61 ++ .../IntegrationEventLogServiceTest.cs | 296 ++++++ ...ntegrationEvents.EventLogs.EF.Tests.csproj | 31 + .../TestBase.cs | 30 + .../_Imports.cs | 20 + .../BackgroundServiceTest.cs | 37 + .../DispatcherOptionTest.cs | 125 +++ .../Events/CreateUserEvent.cs | 32 + .../Events/PaySuccessedIntegrationEvent.cs | 16 + .../Events/RegisterUserIntegrationEvent.cs | 13 + .../CustomIntegrationEventHostedService.cs | 18 + .../CustomIntegrationEventLogService.cs | 40 + .../Infrastructure/CustomProcessor.cs | 21 + .../IntegrationEventBusTest.cs | 394 ++++++++ ....Dispatcher.IntegrationEvents.Tests.csproj | 29 + .../ProcessorTest.cs | 398 +++++++++ .../_Imports.cs | 23 + .../DefaultExceptionStrategyProvider.cs | 28 + .../DispatcherOptionsExtensions.cs | 32 + .../Enums/FailureLevels.cs | 13 + .../EventBus.cs | 71 ++ .../EventBusBuilder.cs | 21 + .../EventHandlerAttribute.cs | 165 ++++ .../IExceptionStrategyProvider.cs | 11 + .../IInitializeServiceProvider.cs | 25 + .../Dispatch/DispatchRelationNetwork.cs | 102 +++ .../Internal/Dispatch/Dispatcher.cs | 72 ++ .../Internal/Dispatch/DispatcherBase.cs | 127 +++ .../Internal/Dispatch/SagaDispatcher.cs | 112 +++ .../Internal/DispatcherExtensions.cs | 42 + .../Internal/Expressions/InvokeBuilder.cs | 59 ++ .../Internal/InitializeServiceProvider.cs | 26 + .../Middleware/TransactionMiddleware.cs | 46 + .../Masa.Contrib.Dispatcher.Events.csproj | 23 + .../Options/DispatchRelationOptions.cs | 24 + .../Options/DispatcherOptions.cs | 34 + .../Masa.Contrib.Dispatcher.Events/README.md | 218 +++++ .../README.zh-CN.md | 217 +++++ .../ServiceCollectionExtensions.cs | 76 ++ .../Strategies/ExecutionStrategy.cs | 70 ++ .../Strategies/IExecutionStrategy.cs | 10 + .../Strategies/StrategyOptions.cs | 22 + .../_Imports.cs | 22 + .../Benchmarks.cs | 64 ++ .../AddShoppingCartEventHandler.cs | 16 + .../Extensions/EventHandlers/CouponHandler.cs | 55 ++ .../Extensions/Events/AddShoppingCartEvent.cs | 11 + .../Extensions/Events/RegisterUserEvent.cs | 11 + .../Middleware/LoggingMiddleware.cs | 18 + ...ontrib.Dispatcher.Events.Benchmarks.csproj | 23 + .../Program.cs | 17 + .../_Imports.cs | 18 + .../AssemblyResolutionTests.cs | 108 +++ .../ChoreTest.cs | 105 +++ .../ChangePasswordEventHandler.cs | 42 + .../EventHandlers/MarketingEventHandler.cs | 27 + .../OrderPaymentSucceededEventHandler.cs | 26 + .../EventHandlers/RegisterUserEventHandler.cs | 14 + .../EventHandlers/ShipOrderEventHandler.cs | 58 ++ .../EventHandlers/ShoppingCardEventHandler.cs | 17 + .../EventHandlers/TransferEventHandler.cs | 83 ++ .../Events/AddShoppingCartEvent.cs | 11 + .../Events/AddUserEvent.cs | 18 + .../Events/ChangePasswordEvent.cs | 23 + .../Events/ComputeEvent.cs | 29 + .../Events/DeductionMoneyEvent.cs | 15 + .../Events/IncreaseMoneyEvent.cs | 15 + .../OrderPaymentFailedIntegrationEvent.cs | 33 + .../Events/OrderPaymentSucceededEvent.cs | 11 + .../Events/RegisterUserEvent.cs | 8 + .../Events/SendCouponEvent.cs | 9 + .../Events/ShipOrderEvent.cs | 13 + .../Events/TransferEvent.cs | 13 + .../FeaturesTest.cs | 380 ++++++++ ...asa.Contrib.Dispatcher.Events.Tests.csproj | 39 + .../Middleware/LoggingMiddleware.cs | 17 + .../SagaTest.cs | 98 ++ .../TestBase.cs | 47 + .../_Imports.cs | 21 + .../EventHandlers/AddGoodsHandler.cs | 13 + .../Events/AddGoodsEvent.cs | 15 + ....Events.CheckMethodsParameter.Tests.csproj | 14 + .../_Imports.cs | 5 + .../EventHandlers/DeleteGoodsHandler.cs | 13 + .../Events/DeleteGoodsEvent.cs | 11 + ....CheckMethodsParameterNotNull.Tests.csproj | 14 + .../_Imports.cs | 2 + .../EventHandlers/AddCatalogHandler.cs | 19 + .../Events/AddCatalogEvent.cs | 11 + ...nts.CheckMethodsParameterType.Tests.csproj | 14 + .../_Imports.cs | 4 + .../EventHandlers/AddBasketHandler.cs | 17 + .../Events/AddBasketEvent.cs | 11 + ...tcher.Events.CheckMethodsType.Tests.csproj | 14 + .../_Imports.cs | 6 + .../EventHandlers/Handler.cs | 51 ++ .../Events/CalculateEvent.cs | 15 + ...ispatcher.Events.HandlerOrder.Tests.csproj | 14 + .../_Imports.cs | 4 + .../EventHandlers/UserEventHandler.cs | 13 + .../Events/BindPhoneNumberEvent.cs | 13 + ...cher.Events.OnlyCancelHandler.Tests.csproj | 14 + .../_Imports.cs | 4 + .../EventHandlers/EditCategoryHandler.cs | 24 + .../Events/EditCategoryEvent.cs | 11 + ...tcher.Events.OrderEqualBySaga.Tests.csproj | 14 + .../_Imports.cs | 6 + .../EnvironmentContext.cs | 11 + .../IsolationBuilderExtensions.cs | 33 + ....Contrib.Isolation.MultiEnvironment.csproj | 14 + .../Middleware/MultiEnvironmentMiddleware.cs | 77 ++ .../README.md | 96 ++ .../README.zh-CN.md | 97 ++ .../_Imports.cs | 12 + .../ConvertProvider.cs | 13 + .../IsolationBuilderExtensions.cs | 37 + .../Masa.Contrib.Isolation.MultiTenant.csproj | 14 + .../Middleware/MultiTenantMiddleware.cs | 77 ++ .../MultiTenantOptions.cs | 11 + .../README.md | 99 ++ .../README.zh-CN.md | 100 +++ .../TenantContext.cs | 11 + .../_Imports.cs | 13 + ...efaultIsolationConnectionStringProvider.cs | 96 ++ .../DispatcherOptionsExtensions.cs | 89 ++ .../IsolationBuilder.cs | 14 + .../IsolationBuilderExtensions.cs | 13 + .../IsolationDbContextProvider.cs | 23 + .../Masa.Contrib.Isolation.csproj | 18 + .../Middleware/IsolationMiddleware.cs | 44 + .../Masa.Contrib.Isolation/README.md | 5 + .../Masa.Contrib.Isolation/README.zh-CN.md | 5 + .../Masa.Contrib.Isolation/_Imports.cs | 21 + ...ib.Isolation.MultiEnvironment.Tests.csproj | 29 + .../TestEnvironment.cs | 71 ++ .../TestMiddleware.cs | 147 +++ .../_Imports.cs | 12 + ...Contrib.Isolation.MultiTenant.Tests.csproj | 29 + .../TestMiddleware.cs | 359 ++++++++ .../TestTenant.cs | 56 ++ .../_Imports.cs | 12 + .../Masa.Contrib.Isolation.Tests.csproj | 31 + .../RequestCookieCollection.cs | 9 + ...TestDbIsolationConnectionStringProvider.cs | 533 +++++++++++ .../TestIsolation.cs | 158 ++++ .../TestParserProvider.cs | 377 ++++++++ .../UnitOfWorkAccessor.cs | 11 + .../Masa.Contrib.Isolation.Tests/_Imports.cs | 23 + .../DispatcherOptionsExtensions.cs | 81 ++ .../Internal/TypeExtensions.cs | 13 + .../IsolationDbContext.cs | 80 ++ .../IsolationSaveChangesFilter.cs | 45 + .../Masa.Contrib.Isolation.UoW.EF.csproj | 19 + .../Masa.Contrib.Isolation.UoW.EF/README.md | 76 ++ .../README.zh-CN.md | 76 ++ .../Masa.Contrib.Isolation.UoW.EF/_Imports.cs | 18 + .../CustomDbContext.cs | 58 ++ ...Masa.Contrib.Isolation.UoW.EF.Tests.csproj | 40 + .../TestBase.cs | 21 + .../TestIsolation.cs | 371 ++++++++ .../_Imports.cs | 25 + .../appsettings.json | 18 + .../CustomDbContext.cs | 92 ++ .../EdgeDriverTest.cs | 66 ++ .../EventHandlers/AddRoleEventHandler.cs | 53 ++ .../EventHandlers/RegisterUserEventHandler.cs | 54 ++ .../Events/AddRoleEvent.cs | 8 + .../Events/RegisterUserEvent.cs | 8 + ....Contrib.Isolation.UoW.EF.Web.Tests.csproj | 35 + .../TestBase.cs | 21 + .../_Imports.cs | 25 + .../appsettings.json | 18 + .../Commands/CommandHandler.cs | 15 + ...Masa.Contrib.ReadWriteSpliting.Cqrs.csproj | 18 + .../Queries/QueryHandler.cs | 11 + .../README.md | 86 ++ .../README.zh-CN.md | 87 ++ .../_Imports.cs | 6 + .../Commands/CreateProductionCommand.cs | 13 + .../CqrsTest.cs | 54 ++ .../CreateProductionCommandHandler.cs | 27 + ...ontrib.ReadWriteSpliting.Cqrs.Tests.csproj | 30 + .../ProductionQueryHandler.cs | 21 + .../Queries/ProductionItemQuery.cs | 13 + .../_Imports.cs | 11 + .../AutoCompleteClient.cs | 196 ++++ .../AutoCompleteFactory.cs | 42 + ...chEngine.AutoComplete.ElasticSearch.csproj | 19 + .../Options/AutoCompleteOptions.cs | 86 ++ .../Options/AutoCompleteRelationsOptions.cs | 57 ++ .../README.md | 186 ++++ .../README.zh-CN.md | 186 ++++ .../ServiceCollectionExtensions.cs | 201 +++++ .../_Imports.cs | 19 + .../AutoCompleteTest.cs | 679 ++++++++++++++ ...ne.AutoComplete.ElasticSearch.Tests.csproj | 29 + .../Model/Employee.cs | 17 + .../_Imports.cs | 10 + .../CallerOptionsExtensions.cs | 40 + .../DaprCaller.cs | 91 ++ .../DaprCallerBase.cs | 31 + .../DefaultDaprClientBuilder.cs | 17 + .../HttpMessageHandlerBuilder.cs | 14 + .../IDaprRequestMessage.cs | 9 + ...a.Contrib.Service.Caller.DaprClient.csproj | 17 + .../MasaDaprClientBuilder.cs | 70 ++ .../MasaDaprClientBuilderExtensions.cs | 48 + .../Options/CallerDaprClientOptions.cs | 9 + .../README.md | 102 +++ .../README.zh-CN.md | 102 +++ .../_Imports.cs | 10 + .../CallerOptionsExtensions.cs | 26 + .../HttpClientCaller.cs | 72 ++ .../HttpClientCallerBase.cs | 32 + ...a.Contrib.Service.Caller.HttpClient.csproj | 17 + .../MasaHttpClientBuilder.cs | 62 ++ .../README.md | 111 +++ .../README.zh-CN.md | 111 +++ .../_Imports.cs | 6 + .../DefaultCallerFactory.cs | 31 + .../DefaultRequestMessage.cs | 34 + .../DefaultResponseMessage.cs | 92 ++ .../DefaultTypeConvertor.cs | 98 ++ .../Internal/CallerDependExtensions.cs | 89 ++ .../Internal/ErrorMessages.cs | 9 + .../Internal/Options/PropertyInfoMember.cs | 31 + .../Internal/XmlUtils.cs | 26 + .../JsonRequestMessage.cs | 30 + .../Masa.Contrib.Service.Caller.csproj | 14 + .../Masa.Contrib.Service.Caller/README.md | 36 + .../README.zh-CN.md | 36 + .../ServiceCollectionExtensions.cs | 107 +++ .../XmlRequestMessage.cs | 27 + .../Masa.Contrib.Service.Caller/_Imports.cs | 22 + .../CallerTest.cs | 138 +++ .../CustomHttpClientCaller.cs | 14 + .../DefaultXmlResponseMessage.cs | 91 ++ .../HttpClientCallerTest.cs | 128 +++ .../Masa.Contrib.Service.Caller.Tests.csproj | 24 + .../Queries/UserDetailQuery.cs | 34 + .../Queries/UserListQuery.cs | 18 + .../Requesties/RegisterUser.cs | 22 + .../Response/BaseResponse.cs | 16 + .../TypeConvertTest.cs | 30 + .../Utils/XmlUtils.cs | 26 + .../_Imports.cs | 21 + .../AutomaticCallerTest.cs | 47 + .../CallerTest.cs | 214 +++++ .../Callers/DaprCaller.cs | 16 + .../Callers/GithubCaller.cs | 20 + .../Callers/RoleCaller.cs | 11 + .../Callers/UserCaller.cs | 11 + .../Callers/UserDaprCallerBase.cs | 20 + .../DefaultDaprRequestMessage.cs | 13 + ...ervice.Caller.AutomaticCaller.Tests.csproj | 28 + .../_Imports.cs | 14 + .../Masa.Contrib.Service.MinimalAPIs.csproj | 18 + .../README.md | 53 ++ .../README.zh-CN.md | 53 ++ .../ServiceBase.cs | 122 +++ .../ServiceCollectionExtensions.cs | 45 + .../_Imports.cs | 12 + ...a.Contrib.Service.MinimalAPIs.Tests.csproj | 29 + .../MinimalAPITest.cs | 51 ++ .../Services/CustomService.cs | 16 + .../_Imports.cs | 7 + .../Masa.Contrib.StackSdks.Auth/AuthClient.cs | 29 + .../Masa.Contrib.StackSdks.Auth/Constants.cs | 12 + .../EnvironmentProvider.cs | 19 + .../HttpEnvironmentDelegatingHandler.cs | 27 + .../Masa.Contrib.StackSdks.Auth.csproj | 22 + .../Masa.Contrib.StackSdks.Auth/README.md | 46 + .../README.zh-CN.md | 45 + .../Service/PermissionService.cs | 75 ++ .../Service/ProjectService.cs | 26 + .../Service/SubjectService.cs | 21 + .../Service/TeamService.cs | 47 + .../Service/UserService.cs | 172 ++++ .../ServiceCollectionExtensions.cs | 44 + .../Masa.Contrib.StackSdks.Auth/_Imports.cs | 15 + .../Masa.Contrib.StackSdks.Dcc/DccClient.cs | 16 + .../Internal/Constants.cs | 10 + .../Masa.Contrib.StackSdks.Dcc.csproj | 16 + .../Masa.Contrib.StackSdks.Dcc/README.md | 54 ++ .../README.zh-CN.md | 54 ++ .../Service/LabelService.cs | 21 + .../ServiceCollectionExtensions.cs | 47 + .../Masa.Contrib.StackSdks.Dcc/_Imports.cs | 11 + .../Masa.Contrib.StackSdks.Mc/Constants.cs | 10 + ...ttpClientAuthorizationDelegatingHandler.cs | 24 + .../Extensions/DictionaryExtensions.cs | 118 +++ .../Extensions/ExtraPropertiesExtensions.cs | 61 ++ .../Infrastructure/Helper/TypeHelper.cs | 170 ++++ .../Masa.Contrib.StackSdks.Mc.csproj | 15 + .../Masa.Contrib.StackSdks.Mc/McClient.cs | 28 + .../Service/ChannelService.cs | 27 + .../Service/MessageTaskService.cs | 33 + .../Service/MessageTemplateService.cs | 27 + .../Service/ReceiverGroupService.cs | 27 + .../Service/WebsiteMessageService.cs | 72 ++ .../ServiceCollectionExtensions.cs | 45 + .../Masa.Contrib.StackSdks.Mc/_Imports.cs | 20 + .../Masa.Contrib.StackSdks.Pm/Constants.cs | 9 + .../Masa.Contrib.StackSdks.Pm.csproj | 18 + .../Masa.Contrib.StackSdks.Pm/PmClient.cs | 27 + .../Masa.Contrib.StackSdks.Pm/README.md | 38 + .../Masa.Contrib.StackSdks.Pm/README.zh-CN.md | 38 + .../Service/AppService.cs | 57 ++ .../Service/ClusterService.cs | 49 + .../Service/EnvironmentService.cs | 33 + .../Service/ProjectService.cs | 65 ++ .../ServiceCollectionExtensions.cs | 45 + .../Masa.Contrib.StackSdks.Pm/_Imports.cs | 9 + .../Constants.cs | 10 + ...ttpClientAuthorizationDelegatingHandler.cs | 24 + .../Masa.Contrib.StackSdks.Scheduler.csproj | 20 + .../README.md | 41 + .../README.zh-CN.md | 41 + .../SchedulerClient.cs | 20 + .../ServiceCollectionExtensions.cs | 53 ++ .../Services/SchedulerJobService.cs | 127 +++ .../Services/SchedulerTaskService.cs | 58 ++ .../_Imports.cs | 13 + .../Extensions/CallerProviderExtensions.cs | 18 + .../Extensions/ServiceExtensions.cs | 36 + .../Extensions/StreamExtensions.cs | 48 + .../Logging/OpenTelemetryLoggingExtensions.cs | 21 + .../Masa.Contrib.StackSdks.Tsc.csproj | 28 + .../MasaObservableOptions.cs | 17 + .../Metrics/MasaServiceExtensions.cs | 21 + .../OpenTelemetryAttributeName.cs | 146 +++ .../OpenTemetry/ResourceBuilderExtenstions.cs | 26 + .../Masa.Contrib.StackSdks.Tsc/README.md | 56 ++ .../README.zh-CN.md | 56 ++ .../Service/LogService.cs | 32 + .../Service/MetricService.cs | 46 + .../Tracing/ActivityExtensions.cs | 101 +++ ...NetCoreInstrumentationOptionsExtensions.cs | 74 ++ .../Tracing/MasaServiceExtensions.cs | 37 + .../OpenTelemetryInstrumentationOptions.cs | 95 ++ .../Masa.Contrib.StackSdks.Tsc/TscClient.cs | 20 + .../Masa.Contrib.StackSdks.Tsc/_Imports.cs | 26 + .../AuthClientTest.cs | 42 + .../Masa.Contrib.StackSdks.Auth.Tests.csproj | 26 + .../PermissionServiceTest.cs | 109 +++ .../ProjectServiceTest.cs | 30 + .../SubjectServiceTest.cs | 28 + .../TeamServiceTest.cs | 56 ++ .../UserServiceTest.cs | 446 ++++++++++ .../_Imports.cs | 12 + .../DccClientTest.cs | 47 + .../LabelServiceTest.cs | 44 + .../Masa.Contrib.StackSdks.Dcc.Tests.csproj | 35 + .../_Imports.cs | 11 + .../appsettings.json | 14 + .../ChannelServiceTest.cs | 38 + .../Masa.Contrib.StackSdks.Mc.Tests.csproj | 24 + .../McClientTest.cs | 32 + .../MessageTaskServiceTest.cs | 48 + .../MessageTemplateServiceTest.cs | 38 + .../ReceiverGroupServiceTest.cs | 38 + .../WebsiteMessageServiceTest.cs | 112 +++ .../_Imports.cs | 12 + .../AppServiceTest.cs | 184 ++++ .../ClusterServiceTest.cs | 151 ++++ .../EnvironmentServiceTest.cs | 79 ++ .../Masa.Contrib.StackSdks.Pm.Tests.csproj | 24 + .../PmClientTest.cs | 74 ++ .../ProjectServiceTest.cs | 216 +++++ .../_Imports.cs | 11 + ...a.Contrib.StackSdks.Scheduler.Tests.csproj | 24 + .../SchedulerClientTest.cs | 54 ++ .../SchedulerJobServiceTest.cs | 307 +++++++ .../SchedulerTaskServiceTest.cs | 51 ++ .../_Imports.cs | 12 + .../CallerProviderExtensionsTests.cs | 21 + .../Masa.Contrib.StackSdks.Tsc.Tests.csproj | 21 + .../Service/LogServiceTests.cs | 100 +++ .../Service/MetricServiceTests.cs | 86 ++ .../_Imports.cs | 17 + .../BaseClient.cs | 33 + .../BucketNameProvider.cs | 18 + .../DefaultCredentialProvider.cs | 92 ++ .../DefaultOssClientFactory.cs | 16 + .../DefaultStorageClient.cs | 135 +++ .../IAliyunStorageOptionProvider.cs | 13 + .../ICredentialProvider.cs | 12 + .../IOssClientFactory.cs | 11 + .../Internal/Const.cs | 21 + .../DefaultAliyunStorageOptionProvider.cs | 70 ++ .../Internal/ObjectStorageExtensions.cs | 15 + .../Internal/Response/UploadObjectResponse.cs | 44 + ...ontrib.Storage.ObjectStorage.Aliyun.csproj | 28 + .../Options/AliyunOptions.cs | 11 + .../Options/AliyunStorageConfigureOptions.cs | 11 + .../Options/AliyunStorageOptions.cs | 138 +++ .../Options/AliyunStsOptions.cs | 62 ++ .../README.md | 147 +++ .../README.zh-CN.md | 149 ++++ .../ServiceCollectionExtensions.cs | 146 +++ .../_Imports.cs | 23 + .../BaseTest.cs | 30 + .../CustomCredentialProvider.cs | 45 + .../CustomNullClient.cs | 27 + .../CustomizeClient.cs | 76 ++ ....Storage.ObjectStorage.Aliyun.Tests.csproj | 37 + .../StorageContainer.cs | 10 + .../TestALiYunStorageOptions.cs | 139 +++ .../TestClient.cs | 137 +++ .../TestCredentialProvider.cs | 124 +++ .../TestStorage.cs | 315 +++++++ .../_Imports.cs | 18 + .../appsettings.json | 21 + ...lientFactoryServiceCollectionExtensions.cs | 111 +++ .../Extensions/JsonSerializerExtensions.cs | 558 ++++++++++++ .../Extensions/RedisExtensions.cs | 38 + .../Helpers/RedisHelper.cs | 122 +++ .../Internal/Enum/CompressMode.cs | 19 + .../Masa.Utils.Caching.Redis.csproj | 19 + .../Models/RedisConfigurationOptions.cs | 87 ++ .../Models/RedisServerOptions.cs | 73 ++ .../RedisCacheClient.cs | 576 ++++++++++++ .../RedisCacheClientFactory.cs | 44 + .../Masa.Utils.Caching.Redis/_Imports.cs | 24 + .../ConvertToValueTest.cs | 115 +++ .../Masa.Utils.Caching.Redis.Tests.csproj | 21 + .../_Imports.cs | 7 + .../DependencyInjection/CachingBuilder.cs | 24 + ...DistributedCacheClientBuilderExtensions.cs | 42 + .../DependencyInjection/ICachingBuilder.cs | 20 + .../DistributedCacheClientFactory.cs | 49 + ...DistributedCacheClientFactoryExtensions.cs | 25 + .../Helpers/SubscribeHelper.cs | 57 ++ .../Interfaces/ICacheClient.cs | 100 +++ .../Interfaces/ICacheClientFactory.cs | 19 + .../Interfaces/IDistributedCacheClient.cs | 85 ++ .../IDistributedCacheClientFactory.cs | 11 + .../Masa.Utils.Caching.Core.csproj | 15 + .../Models/CombinedCacheEntryOptions.cs | 55 ++ .../Models/SubscribeKeyTypes.cs | 16 + .../Models/SubscribeOperation.cs | 14 + .../Models/SubscribeOptions.cs | 25 + .../Masa.Utils.Caching.Core/_Imports.cs | 11 + .../MemoryCacheClientBuilderExtensions.cs | 33 + ...heClientFactoryCachingBuilderExtensions.cs | 56 ++ .../Interfaces/IMemoryCacheClient.cs | 26 + .../Interfaces/IMemoryCacheClientFactory.cs | 11 + ...asa.Utils.Caching.DistributedMemory.csproj | 19 + .../MemoryCacheClient.cs | 407 +++++++++ .../MemoryCacheClientFactory.cs | 63 ++ .../MemoryCacheClientFactoryExtensions.cs | 25 + .../Models/MasaMemoryCacheOptions.cs | 20 + .../_Imports.cs | 15 + .../Masa.Utils.Caching.Memory.csproj | 9 + .../Masa.Utils.Caching.Memory/MemoryCache.cs | 110 +++ .../Masa.Utils.Caching.Memory/_Imports.cs | 4 + .../AbstractCallerProvider.cs | 391 ++++++++ .../AddCallerExtensions.cs | 15 + .../Masa.Utils.Caller.Core/CallerBase.cs | 31 + .../Masa.Utils.Caller.Core/CallerOptions.cs | 36 + .../DefaultCallerFactory.cs | 31 + .../DefaultRequestIdGenerator.cs | 9 + .../DefaultRequestMessage.cs | 32 + .../DefaultResponseMessage.cs | 92 ++ .../DefaultTypeConvertProvider.cs | 98 ++ .../Masa.Utils.Caller.Core/ICallerFactory.cs | 11 + .../Masa.Utils.Caller.Core/ICallerProvider.cs | 219 +++++ .../IRequestIdGenerator.cs | 9 + .../Masa.Utils.Caller.Core/IRequestMessage.cs | 11 + .../IResponseMessage.cs | 11 + .../ITypeConvertProvider.cs | 24 + .../Internal/CallerDependExtensions.cs | 89 ++ .../Internal/CallerRelations.cs | 20 + .../Masa.Utils.Caller.Core/Internal/Const.cs | 9 + .../Internal/Options/PropertyInfoMember.cs | 31 + .../JsonRequestMessage.cs | 29 + .../Masa.Utils.Caller.Core.csproj | 19 + .../Caller/Masa.Utils.Caller.Core/README.md | 36 + .../Masa.Utils.Caller.Core/README.zh-CN.md | 36 + .../ServiceCollectionExtensions.cs | 105 +++ .../Caller/Masa.Utils.Caller.Core/_Imports.cs | 19 + .../CallerOptionsExtensions.cs | 40 + .../DaprCallerBase.cs | 30 + .../DaprCallerProvider.cs | 46 + .../Masa.Utils.Caller.DaprClient.csproj | 17 + .../MasaDaprClientBuilder.cs | 70 ++ .../Masa.Utils.Caller.DaprClient/README.md | 101 +++ .../README.zh-CN.md | 101 +++ .../Masa.Utils.Caller.DaprClient/_Imports.cs | 6 + .../CallerOptionsExtensions.cs | 26 + .../HttpClientCallerBase.cs | 32 + .../HttpClientCallerProvider.cs | 72 ++ .../Masa.Utils.Caller.HttpClient.csproj | 19 + .../MasaHttpClientBuilder.cs | 62 ++ .../Masa.Utils.Caller.HttpClient/README.md | 110 +++ .../README.zh-CN.md | 110 +++ .../Masa.Utils.Caller.HttpClient/_Imports.cs | 5 + .../CustomHttpClientCallerProvider.cs | 14 + .../Application/Queries/UserDetailQury.cs | 34 + .../Application/Queries/UserListQury.cs | 18 + .../Application/Requesties/RegisterUser.cs | 22 + .../Application/Response/BaseResponse.cs | 16 + .../AutomaticCallerTest.cs | 47 + .../Masa.Utils.Caller.Tests/CallerTest.cs | 235 +++++ .../HttpClientCallerTest.cs | 128 +++ .../Infrastructure/Callers/DaprCaller.cs | 15 + .../Infrastructure/Callers/GithubCaller.cs | 19 + .../Infrastructure/Callers/RoleCaller.cs | 11 + .../Infrastructure/Callers/UserCaller.cs | 11 + .../Callers/UserDaprCallerBase.cs | 15 + .../DefaultXmlResponseMessage.cs | 93 ++ .../Infrastructure/Utils/XmlUtils.cs | 23 + .../Infrastructure/XmlRequestMessage.cs | 19 + .../Masa.Utils.Caller.Tests.csproj | 24 + .../TypeConvertTest.cs | 129 +++ .../Masa.Utils.Caller.Tests/_Imports.cs | 26 + .../Masa.Utils.Configuration.Dcc.csproj | 9 + .../AppSettings.cs | 102 +++ .../JsonConfiguration.cs | 118 +++ .../JsonFileOptions.cs | 23 + .../Masa.Utils.Configuration.Json.csproj | 14 + .../DataAnnotations/MinCountAttribute.cs | 57 ++ .../DataAnnotations/NonDefaultAttribute.cs | 32 + .../Masa.Utils.Data.DataAnnotations.csproj | 9 + .../_Imports.cs | 5 + .../TokenFilters/IPinYinTokenFilter.cs | 106 +++ .../PinYinTokenFilterDescriptor.cs | 125 +++ .../Masa.Utils.Data.Elasticsearch/Const.cs | 9 + .../DefaultElasticsearchFactory.cs | 84 ++ .../DefaultMasaElasticClient.cs | 391 ++++++++ .../ElasticsearchOptions.cs | 66 ++ .../ElasticsearchRelations.cs | 56 ++ .../IElasticsearchFactory.cs | 15 + .../IMasaElasticClient.cs | 153 ++++ .../BulkOperation/BulkDeleteOperation.cs | 15 + .../Internal/DeleteMultiExtensions.cs | 30 + .../Masa.Utils.Data.Elasticsearch.csproj | 15 + .../MasaElasticsearchBuilder.cs | 20 + .../Options/Alias/BindAliasIndexOptions.cs | 27 + .../Options/Alias/UnBindAliasIndexOptions.cs | 27 + .../Options/ConnectionSettingsOptions.cs | 38 + .../Document/Count/CountDocumentRequest.cs | 11 + .../Create/CreateDocumentItemRequest.cs | 12 + .../Document/Create/CreateDocumentRequest.cs | 12 + .../Create/CreateMultiDocumentRequest.cs | 30 + .../Document/Delete/DeleteDocumentRequest.cs | 11 + .../Delete/DeleteMultiDocumentRequest.cs | 15 + .../Options/Document/DocumentOptions.cs | 17 + .../Document/Exist/ExistDocumentRequest.cs | 12 + .../Document/Get/GetDocumentRequest.cs | 11 + .../Document/Get/GetMultiDocumentRequest.cs | 15 + .../Document/Query/PaginatedOptions.cs | 44 + .../Document/Query/QueryBaseOptions.cs | 45 + .../Options/Document/Query/QueryOptions.cs | 19 + .../Set/SetDocumentItemBaseRequest.cs | 12 + .../Document/Set/SetDocumentRequest.cs | 30 + .../Document/SingleDocumentBaseRequest.cs | 17 + .../Update/UpdateDocumentBaseRequest.cs | 25 + .../Document/Update/UpdateDocumentRequest.cs | 15 + .../Update/UpdateMultiDocumentRequest.cs | 18 + .../Options/ElasticsearchRelationsOptions.cs | 20 + .../Options/Index/CreateIndexOptions.cs | 13 + .../Options/Index/DeleteIndexOptions.cs | 9 + .../Options/StaticConnectionPoolOptions.cs | 29 + .../Masa.Utils.Data.Elasticsearch/README.md | 89 ++ .../README.zh-CN.md | 89 ++ .../Response/Alias/BulkAliasResponse.cs | 11 + .../Response/Alias/GetAliasResponse.cs | 22 + .../Response/BulkResponse.cs | 14 + .../Response/BulkResponseItems.cs | 23 + .../Response/CreateMultiResponse.cs | 11 + .../Response/CreateResponse.cs | 11 + .../Response/DeleteMultiResponse.cs | 17 + .../Response/DeleteRangeResponseItems.cs | 20 + .../Response/DeleteResponse.cs | 11 + .../Document/ClearDocumentResponse.cs | 11 + .../Document/CountDocumentResponse.cs | 11 + .../Response/ExistsResponse.cs | 16 + .../Response/GetMultiResponse.cs | 15 + .../Response/GetMultiResponseItems.cs | 18 + .../Response/GetResponse.cs | 15 + .../Response/Index/CreateIndexResponse.cs | 11 + .../Response/Index/DeleteIndexResponse.cs | 19 + .../Response/Index/GetIndexByAliasResponse.cs | 14 + .../Response/Index/GetIndexResponse.cs | 14 + .../Response/ResponseBase.cs | 21 + .../Response/SearchPaginatedResponse.cs | 22 + .../Response/SearchResponse.cs | 15 + .../Response/SetResponse.cs | 11 + .../Response/UpdateMultiResponse.cs | 11 + .../Response/UpdateResponse.cs | 11 + .../ServiceCollectionExtensions.Extensions.cs | 30 + .../ServiceCollectionExtensions.cs | 75 ++ .../Masa.Utils.Data.Elasticsearch/_Imports.cs | 26 + .../Enums/ResultStatuses.cs | 10 + .../Enums/ResultTypes.cs | 15 + .../Extensions/CallerProviderExtensions.cs | 15 + .../Extensions/ObjectExtensions.cs | 142 +++ .../Extensions/StringExtensions.cs | 20 + .../IMasaPrometheusClient.cs | 19 + .../Masa.Utils.Data.Prometheus.csproj | 13 + .../MasaPrometheusClient.cs | 127 +++ .../Reponse/Exemplar/ExemplarDataModel.cs | 13 + .../Model/Reponse/Exemplar/ExemplarModel.cs | 11 + .../Exemplar/ExemplarResultResponse.cs | 9 + .../Reponse/MetaData/LabelResultResponse.cs | 9 + .../Reponse/MetaData/SeriesResultResponse.cs | 9 + .../Query/QueryResultCommonResponse.cs | 9 + .../Reponse/Query/QueryResultDataResponse.cs | 11 + .../Query/QueryResultInstantVectorResponse.cs | 11 + .../Query/QueryResultMatrixRangeResponse.cs | 11 + .../Model/Reponse/ResultBaseResponse.cs | 15 + .../Model/Request/LableValueQueryRequest.cs | 9 + .../Model/Request/MetaDataQueryRequest.cs | 13 + .../Model/Request/QueryExemplarRequest.cs | 14 + .../Model/Request/QueryRangeRequest.cs | 17 + .../Model/Request/QueryRequest.cs | 13 + .../Data/Masa.Utils.Data.Prometheus/README.md | 75 ++ .../README.zh-CN.md | 75 ++ .../ServiceCollectionExtensions.cs | 39 + .../Masa.Utils.Data.Prometheus/_Imports.cs | 15 + ...sa.Utils.Data.DataAnnotations.Tests.csproj | 21 + .../MinCountAttributeTests.cs | 84 ++ .../NonDefaultAttributeTests.cs | 84 ++ .../DefaultMasaElasticClientTests.cs | 571 ++++++++++++ ...Masa.Utils.Data.Elasticsearch.Tests.csproj | 21 + .../Models/AutoCompleteDocument.cs | 30 + .../_Imports.cs | 19 + .../Extensions/ObjectExtensionsTests.cs | 171 ++++ .../Extensions/StringExtensionsTests.cs | 30 + .../Masa.Utils.Data.Prometheus.Test.csproj | 22 + .../MasaPrometheusClientTests.cs | 154 ++++ .../UserStruct.cs | 13 + .../_Imports.cs | 12 + .../DaprBackgroundService.cs | 66 ++ .../DefaultAppPortProvider.cs | 42 + .../IAppPortProvider.cs | 9 + ...a.Utils.Development.Dapr.AspNetCore.csproj | 14 + .../README.md | 59 ++ .../README.zh-CN.md | 59 ++ .../ServiceCollectionExtensions.cs | 76 ++ .../_Imports.cs | 11 + .../CommandLineBuilder.cs | 29 + .../Configurations/DaprRuntimeOptions.cs | 28 + .../DaprExtensions.cs | 43 + .../DaprOptions.cs | 283 ++++++ .../DaprProcess.cs | 351 ++++++++ .../DaprProvider.cs | 56 ++ .../EnvironmentExtensions.cs | 17 + .../IDaprProcess.cs | 18 + .../IDaprProvider.cs | 11 + .../Internal/CommandArgumentBuilder.cs | 55 ++ .../Internal/Const.cs | 28 + .../Internal/DaprCoreOptions.cs | 145 +++ .../Internal/DaprProcessStatus.cs | 13 + .../Internal/NetworkUtils.cs | 18 + .../Internal/ProcessUtils.cs | 107 +++ .../Masa.Utils.Development.Dapr/LogLevel.cs | 14 + .../Masa.Utils.Development.Dapr.csproj | 17 + .../Process/IProcess.cs | 17 + .../Process/IProcessProvider.cs | 33 + .../Process/ProcessProvider.cs | 181 ++++ .../Process/SystemProcess.cs | 39 + .../Masa.Utils.Development.Dapr/Protocol.cs | 10 + .../Masa.Utils.Development.Dapr/README.md | 95 ++ .../README.zh-CN.md | 95 ++ .../ServiceCollectionExtensions.cs | 44 + .../Masa.Utils.Development.Dapr/_Imports.cs | 18 + .../BaseTypeProvider.cs | 28 + .../DefaultServiceRegister.cs | 41 + .../DefaultTypeProvider.cs | 73 ++ .../DependencyAttribute.cs | 18 + .../IAutoFireDependency.cs | 12 + .../IScopedDependency.cs | 21 + .../IServiceRegister.cs | 9 + .../ISingletonDependency.cs | 8 + .../ITransientDependency.cs | 9 + .../ITypeProvider.cs | 17 + .../IgnoreInjectionAttribute.cs | 15 + ...tils.Extensions.DependencyInjection.csproj | 14 + .../Options/ServiceDescriptorOptions.cs | 23 + .../README.md | 117 +++ .../README.zh-CN.md | 117 +++ .../ServiceCollectionDescriptorExtensions.cs | 122 +++ .../ServiceCollectionExtensions.cs | 135 +++ .../_Imports.cs | 6 + .../Masa.Utils.Extensions.DotNet.csproj | 9 + .../TypeExtensions.cs | 27 + .../EnumExtensions.cs | 36 + .../Masa.Utils.Extensions.Enums/EnumUtil.cs | 36 + .../Masa.Utils.Extensions.Enums.csproj | 9 + .../Model/EnumObject.cs | 11 + .../Masa.Utils.Extensions.Enums/_Enum.cs | 116 +++ .../Masa.Utils.Extensions.Enums/_Imports.cs | 5 + .../ExpressionExtensions.cs | 117 +++ .../Masa.Utils.Extensions.Expressions.csproj | 10 + .../_Imports.cs | 4 + .../DependencyInjectionTest.cs | 190 ++++ .../Domain/Models/User.cs | 11 + .../Domain/Repositories/IRepository.cs | 17 + .../Services/ICalculateProviderService.cs | 9 + .../Domain/Services/IClientFactory.cs | 9 + .../Repositories/BaseRepository.cs | 22 + .../Infrastructure/Services/BaseService.cs | 19 + .../Services/CustomizeClientFactory.cs | 12 + .../Services/EmptyClientFactory.cs | 11 + .../Services/GoodsBaseService.cs | 12 + .../Infrastructure/Services/GoodsService.cs | 14 + .../Services/NullCalculateProviderService.cs | 11 + .../Services/OrderBaseService.cs | 12 + .../Infrastructure/Services/OrderService.cs | 8 + .../Services/UserBaseService.cs | 11 + .../Infrastructure/Services/UserService.cs | 14 + .../Infrastructure/UserDbContext.cs | 9 + ...xtensions.DependencyInjection.Tests.csproj | 21 + .../_Imports.cs | 11 + .../FluentValidationExtensions.cs | 104 +++ ...nsions.Validations.FluentValidation.csproj | 13 + .../RegularHelper.cs | 21 + .../_Imports.cs | 4 + .../Entries/LdapAddress.cs | 19 + .../Entries/LdapUser.cs | 53 ++ .../Extensions/LdapAttributeSetExtensions.cs | 27 + .../Extensions/ServiceCollectionExtensions.cs | 27 + .../Masa.Utils.Ldap.Novell/ILdapFactory.cs | 9 + .../Masa.Utils.Ldap.Novell/ILdapProvider.cs | 25 + .../Masa.Utils.Ldap.Novell/LdapFactory.cs | 12 + .../Masa.Utils.Ldap.Novell/LdapOptions.cs | 49 + .../Masa.Utils.Ldap.Novell/LdapProvider.cs | 294 ++++++ .../Masa.Utils.Ldap.Novell.csproj | 17 + .../Ldap/Masa.Utils.Ldap.Novell/_Imports.cs | 10 + .../Masa.Utils.Ldap.Novell.Tests/LdapTest.cs | 85 ++ .../Masa.Utils.Ldap.Novell.Tests.csproj | 30 + .../Masa.Utils.Ldap.Novell.Tests/_Imports.cs | 10 + .../appsettings.json | 12 + .../ApplicationBuilderExtensions.cs | 81 ++ .../Extensions/MvcBuilderExtensions.cs | 23 + .../Handlers/ExceptionHandlerMiddleware.cs | 80 ++ .../Handlers/ExceptionHandlingMiddleware.cs | 56 ++ .../Handlers/GlobalExceptionFilter.cs | 69 ++ .../IMasaExceptionHandler.cs | 9 + .../Internal/Constant.cs | 11 + .../Internal/ExceptionExtensions.cs | 18 + .../Internal/ExceptionHandlerExtensions.cs | 31 + .../Internal/HttpResponseExtensions.cs | 26 + .../Masa.Utils.Exceptions.csproj | 13 + .../Masa.Utils.Exceptions/MasaException.cs | 28 + .../MasaExceptionContext.cs | 47 + .../MasaHttpStatusCode.cs | 9 + .../Options/MasaExceptionHandlerOptions.cs | 18 + .../Options/MasaExceptionHandlingOptions.cs | 11 + .../MasaExceptionLogRelationOptions.cs | 23 + src/Utils/Masa.Utils.Exceptions/README.md | 130 +++ .../Masa.Utils.Exceptions/README.zh-CN.md | 130 +++ .../Results/DefaultExceptionResult.cs | 25 + .../InternalServerErrorObjectResult.cs | 13 + .../Results/UserFriendlyExceptionResult.cs | 19 + .../UserFriendlyException.cs | 12 + src/Utils/Masa.Utils.Exceptions/_Imports.cs | 16 + .../Masa.Utils.Models.Config/AppConfig.cs | 9 + .../Masa.Utils.Models.Config.csproj | 9 + ...curity.Authentication.OpenIdConnect.csproj | 15 + .../MasaOpenIdConnectOptions.cs | 15 + .../ServiceCollectionExtensions.cs | 96 ++ .../Attributes/MasaAuthorizeAttribute.cs | 15 + .../Constants/MasaClaimTypes.cs | 27 + .../Extensions/ClaimsIdentityExtensions.cs | 53 ++ .../ICurrentPrincipalAccessor.cs | 9 + .../Masa.Utils.Security.Authentication.csproj | 20 + .../MasaUser.cs | 47 + .../ThreadCurrentPrincipalAccessor.cs | 9 + .../_Imports.cs | 8 + .../AesUtils.cs | 529 +++++++++++ .../Base64Utils.cs | 34 + .../DESEncryType.cs | 17 + .../DesUtils.cs | 415 +++++++++ .../EncryptBase.cs | 43 + .../EncryptType.cs | 13 + .../FillType.cs | 17 + .../GlobalConfigurationUtils.cs | 21 + .../HashAlgorithmBase.cs | 48 + .../MD5Utils.cs | 117 +++ .../Masa.Utils.Security.Cryptography.csproj | 9 + .../SHA1Utils.cs | 20 + .../SHA256Utils.cs | 20 + .../SHA384Utils.cs | 20 + .../SHA512Utils.cs | 20 + .../_Imports.cs | 5 + .../DefaultJwtProvider.cs | 85 ++ .../Masa.Utils.Security.Token/IJwtProvider.cs | 22 + .../Masa.Utils.Security.Token/JwtUtils.cs | 31 + .../Masa.Utils.Security.Token.csproj | 20 + .../Model/JwtConfigurationOptions.cs | 13 + .../ServiceCollectionExtensions.cs | 15 + .../Masa.Utils.Security.Token/_Imports.cs | 13 + .../AesTest.cs | 30 + .../DesTest.cs | 30 + ...a.Utils.Security.Cryptography.Tests.csproj | 22 + .../_Imports.cs | 4 + 1710 files changed, 71284 insertions(+) create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs create mode 100644 src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs create mode 100644 src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs create mode 100644 src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/IMapping.cs create mode 100644 src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Mapper.cs create mode 100644 src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj create mode 100644 src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs create mode 100644 src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs create mode 100644 src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/_Imports.cs create mode 100644 src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj create mode 100644 src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs create mode 100644 src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs create mode 100644 src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/_Imports.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs create mode 100644 src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj create mode 100644 src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs create mode 100644 src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs create mode 100644 src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs create mode 100644 src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs create mode 100644 src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs create mode 100644 src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj create mode 100644 src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs create mode 100644 src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj create mode 100644 src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs create mode 100644 src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs create mode 100644 src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs create mode 100644 src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.md create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs create mode 100644 src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/_Imports.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.md create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs create mode 100644 src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj create mode 100644 src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs create mode 100644 src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md create mode 100644 src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json create mode 100644 src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/README.md create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/README.zh-CN.md create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs create mode 100644 src/Contrib/Configuration/Masa.Contrib.Configuration/_Imports.cs create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/appsettings.json create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/customAppConfig.json create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/rabbitMq.json create mode 100644 src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/redis.json create mode 100644 src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs create mode 100644 src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj create mode 100644 src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs create mode 100644 src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs create mode 100644 src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs create mode 100644 src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs create mode 100644 src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj create mode 100644 src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs create mode 100644 src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs create mode 100644 src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs create mode 100644 src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj create mode 100644 src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md create mode 100644 src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/README.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs create mode 100644 src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs create mode 100644 src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj create mode 100644 src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs create mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj create mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs create mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md create mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md create mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs create mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj create mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs create mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs create mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj create mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md create mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md create mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs create mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/README.md create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj create mode 100644 src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs create mode 100644 src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Internal/Const.cs create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.md create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.zh-CN.md create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Transaction.cs create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs create mode 100644 src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/_Imports.cs create mode 100644 src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs create mode 100644 src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj create mode 100644 src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs create mode 100644 src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs create mode 100644 src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs create mode 100644 src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.md create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainEventBus.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainService.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/_Imports.cs create mode 100644 src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs create mode 100644 src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs create mode 100644 src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs create mode 100644 src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj create mode 100644 src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs create mode 100644 src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs create mode 100644 src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs create mode 100644 src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs create mode 100644 src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs create mode 100644 src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj create mode 100644 src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs create mode 100644 src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs create mode 100644 src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj create mode 100644 src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/README.md create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md create mode 100644 src/Contrib/Isolation/Masa.Contrib.Isolation/_Imports.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestIsolation.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestParserProvider.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs create mode 100644 src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/_Imports.cs create mode 100644 src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs create mode 100644 src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs create mode 100644 src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs create mode 100644 src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs create mode 100644 src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj create mode 100644 src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.md create mode 100644 src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md create mode 100644 src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/_Imports.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs create mode 100644 src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json create mode 100644 src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs create mode 100644 src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj create mode 100644 src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs create mode 100644 src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md create mode 100644 src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md create mode 100644 src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs create mode 100644 src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs create mode 100644 src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs create mode 100644 src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs create mode 100644 src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj create mode 100644 src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs create mode 100644 src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs create mode 100644 src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs create mode 100644 src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs create mode 100644 src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs create mode 100644 src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj create mode 100644 src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs create mode 100644 src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs create mode 100644 src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md create mode 100644 src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md create mode 100644 src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs create mode 100644 src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs create mode 100644 src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj create mode 100644 src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs create mode 100644 src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/README.md create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs create mode 100644 src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CallerTest.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs create mode 100644 src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/_Imports.cs create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj create mode 100644 src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs create mode 100644 src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj create mode 100644 src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/README.md create mode 100644 src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md create mode 100644 src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs create mode 100644 src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs create mode 100644 src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj create mode 100644 src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs create mode 100644 src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs create mode 100644 src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/AuthClient.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Constants.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/DccClient.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Constants.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/McClient.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Constants.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/PmClient.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/README.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/AppService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/_Imports.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Constants.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/TscClient.cs create mode 100644 src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs create mode 100644 src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs create mode 100644 src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/RedisCacheClient.cs create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs create mode 100644 src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/_Imports.cs create mode 100644 src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs create mode 100644 src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj create mode 100644 src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/_Imports.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Core/_Imports.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs create mode 100644 src/Utils/Caching/Masa.Utils.Caching.Memory/_Imports.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/CallerBase.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/CallerOptions.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/Internal/Const.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/README.md create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/README.zh-CN.md create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Core/_Imports.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj create mode 100644 src/Utils/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.DaprClient/README.md create mode 100644 src/Utils/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md create mode 100644 src/Utils/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj create mode 100644 src/Utils/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.HttpClient/README.md create mode 100644 src/Utils/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md create mode 100644 src/Utils/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/CallerTest.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/TypeConvertTest.cs create mode 100644 src/Utils/Caller/Masa.Utils.Caller.Tests/_Imports.cs create mode 100644 src/Utils/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj create mode 100644 src/Utils/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs create mode 100644 src/Utils/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs create mode 100644 src/Utils/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs create mode 100644 src/Utils/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj create mode 100644 src/Utils/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj create mode 100644 src/Utils/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Const.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/README.md create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/README.md create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs create mode 100644 src/Utils/Data/Masa.Utils.Data.Prometheus/_Imports.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/UserStruct.cs create mode 100644 src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/_Imports.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/README.md create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/CommandLineBuilder.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprExtensions.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprOptions.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprProcess.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprProvider.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/IDaprProcess.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/IDaprProvider.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/Const.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/LogLevel.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/IProcess.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/SystemProcess.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Protocol.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/README.md create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/README.zh-CN.md create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs create mode 100644 src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/_Imports.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj create mode 100644 src/Utils/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj create mode 100644 src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs create mode 100644 src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs create mode 100644 src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj create mode 100644 src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs create mode 100644 src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj create mode 100644 src/Utils/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs create mode 100644 src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs create mode 100644 src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj create mode 100644 src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs create mode 100644 src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json create mode 100644 src/Utils/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/IMasaExceptionHandler.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Internal/Constant.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj create mode 100644 src/Utils/Masa.Utils.Exceptions/MasaException.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/MasaExceptionContext.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/MasaHttpStatusCode.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/README.md create mode 100644 src/Utils/Masa.Utils.Exceptions/README.zh-CN.md create mode 100644 src/Utils/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/UserFriendlyException.cs create mode 100644 src/Utils/Masa.Utils.Exceptions/_Imports.cs create mode 100644 src/Utils/Models/Masa.Utils.Models.Config/AppConfig.cs create mode 100644 src/Utils/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/MasaUser.cs create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs create mode 100644 src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/_Imports.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/AesUtils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/DesUtils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/EncryptType.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/FillType.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Cryptography/_Imports.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Token/IJwtProvider.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Token/JwtUtils.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj create mode 100644 src/Utils/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs create mode 100644 src/Utils/Security/Masa.Utils.Security.Token/_Imports.cs create mode 100644 src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/AesTest.cs create mode 100644 src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/DesTest.cs create mode 100644 src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj create mode 100644 src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/_Imports.cs diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs new file mode 100644 index 000000000..087259862 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class DefaultTypeConvertProvider : ITypeConvertProvider +{ + public T ConvertTo(string value) + { + if (typeof(T) == typeof(Guid)) + return (T)TypeDescriptor.GetConverter(typeof(T)).ConvertFromInvariantString(value)!; + + return (T)Convert.ChangeType(value, typeof(T)); + } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs new file mode 100644 index 000000000..b116f32bb --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IIdentityUser +{ + string Id { get; set; } + + string? UserName { get; set; } + + IEnumerable> Roles { get; set; } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs new file mode 100644 index 000000000..2ecacfe4a --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class IdentityRole +{ + public T Id { get; set; } + + public string Name { get; set; } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs new file mode 100644 index 000000000..31213d8d5 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class IdentityUser : IIdentityUser +{ + public string Id { get; set; } + + public string? UserName { get; set; } + + public IEnumerable> Roles { get; set; } = new List>(); +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs new file mode 100644 index 000000000..656188c3f --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IIsolatedIdentityUser : IMultiTenantIdentityUser, IMultiEnvironmentIdentityUser +{ +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs new file mode 100644 index 000000000..72d89fdf0 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IMultiEnvironmentIdentityUser : IIdentityUser +{ + string? Environment { get; set; } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs new file mode 100644 index 000000000..d57e54ee9 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IMultiTenantIdentityUser : IIdentityUser +{ + string? TenantId { get; set; } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs new file mode 100644 index 000000000..1121b1b03 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class IsolatedIdentityUser : MultiTenantIdentityUser +{ + public string? Environment { get; set; } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs new file mode 100644 index 000000000..fc3e54447 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class MultiEnvironmentIdentityUser : IdentityUser +{ + public string? Environment { get; set; } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs new file mode 100644 index 000000000..da9be1540 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public class MultiTenantIdentityUser : IdentityUser, IMultiTenantIdentityUser +{ + public string? TenantId { get; set; } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs new file mode 100644 index 000000000..bce77db68 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +[Flags] +public enum IdentityType +{ + /// + /// Only use user information + /// + Basic = 0x01, + + /// + /// Multi-tenant + /// + MultiTenant = 0x02, + + /// + /// Multi-Environment + /// + MultiEnvironment = 0x04, +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs new file mode 100644 index 000000000..a5c9b3505 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IIsolatedUserContext : IMultiTenantUserContext, + IMultiEnvironmentUserContext +{ + +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs new file mode 100644 index 000000000..62c3f97e8 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IMultiEnvironmentUserContext : IUserContext +{ + string? Environment { get; } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs new file mode 100644 index 000000000..a4b517917 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IMultiTenantUserContext : IUserContext +{ + string? TenantId { get; } + + TTenantId? GetTenantId(); +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs new file mode 100644 index 000000000..2862d2bae --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface ITypeConvertProvider +{ + T ConvertTo(string value); +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs new file mode 100644 index 000000000..32a7302ea --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IUserContext +{ + bool IsAuthenticated { get; } + + string? UserId { get; } + + string? UserName { get; } + + TUserId? GetUserId(); + + TIdentityUser? GetUser() where TIdentityUser : IIdentityUser; + + IEnumerable> GetUserRoles(); +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs new file mode 100644 index 000000000..5ac2d328e --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public interface IUserSetter +{ + IDisposable Change(TIdentityUser identityUser) where TIdentityUser : IIdentityUser; +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs new file mode 100644 index 000000000..2a2408616 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel.Internal; + +internal class DisposeAction : IDisposable +{ + private readonly Action _action; + + public DisposeAction(Action action) + { + ArgumentNullException.ThrowIfNull(action, nameof(action)); + _action = action; + } + + public void Dispose() => _action(); +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs new file mode 100644 index 000000000..004c5e44a --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Identity.IdentityModel; + +public abstract class UserContext : IUserSetter, IUserContext +{ + private readonly AsyncLocal _currentUser = new(); + + public bool IsAuthenticated => GetUserSimple() != null; + + public string? UserId => GetUserSimple()?.Id; + + public string? UserName => GetUserSimple()?.UserName; + + protected ITypeConvertProvider TypeConvertProvider { get; } + + public UserContext(ITypeConvertProvider typeConvertProvider) => TypeConvertProvider = typeConvertProvider; + + protected abstract object? GetUser(); + + protected abstract IdentityUser? GetUserBasicInfo(); + + public TUserId? GetUserId() + { + var userId = UserId; + if (userId == null) + return default; + + return TypeConvertProvider.ConvertTo(userId); + } + + public TIdentityUser? GetUser() where TIdentityUser : IIdentityUser + { + var user = _currentUser.Value ?? GetUser(); + return user == null ? default : (TIdentityUser)user; + } + + public IIdentityUser? GetUserSimple() => GetUser(); + + public IDisposable Change(TIdentityUser identityUser) where TIdentityUser : IIdentityUser + { + var user = GetUser(); + _currentUser.Value = identityUser; + return new DisposeAction(() => _currentUser.Value = user); + } + + public IEnumerable> GetUserRoles() + { + return GetUserSimple()?.Roles.Select(r => new IdentityRole + { + Id = TypeConvertProvider.ConvertTo(r.Id), + Name = r.Name + }) ?? new List>(); + } +} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs new file mode 100644 index 000000000..15e5b13bc --- /dev/null +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Identity.IdentityModel.Internal; +global using System.ComponentModel; diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs new file mode 100644 index 000000000..92c5a5390 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; + +public interface IApiResourceCache +{ + Task> GetListAsync(IEnumerable names); + + Task> GetListAsync(); + + Task SetAsync(ApiResource apiResource); + + Task SetRangeAsync(IEnumerable apiResources); + + Task RemoveAsync(ApiResource apiResource); + + Task ResetAsync(IEnumerable identityResources); +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs new file mode 100644 index 000000000..07002b1ac --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; + +public interface IApiScopeCache +{ + Task> GetListAsync(IEnumerable names); + + Task> GetListAsync(); + + Task SetAsync(ApiScope apiScope); + + Task SetRangeAsync(IEnumerable apiScopes); + + Task RemoveAsync(ApiScope apiScope); + + Task ResetAsync(IEnumerable identityResources); +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs new file mode 100644 index 000000000..f0e2ac840 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; + +public interface IClientCache +{ + Task GetAsync(string clientId); + + Task> GetListAsync(IEnumerable clientIds); + + Task SetAsync(Client client); + + Task SetRangeAsync(IEnumerable clients); + + Task RemoveAsync(Client client); + + Task ResetAsync(IEnumerable clients); +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs new file mode 100644 index 000000000..7c0ef59c1 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; + +public interface IIdentityResourceCache +{ + Task> GetListAsync(IEnumerable names); + + Task> GetListAsync(); + + Task SetAsync(IdentityResource identityResource); + + Task SetRangeAsync(IEnumerable identityResources); + + Task RemoveAsync(IdentityResource identityResource); + + Task ResetAsync(IEnumerable identityResources); +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs new file mode 100644 index 000000000..f9859df48 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs new file mode 100644 index 000000000..962779103 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs @@ -0,0 +1,37 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; + +public class GrantTypeConsts +{ + public static ICollection Implicit => + new[] { GrantTypes.IMPLICIT }; + + public static ICollection ImplicitAndClientCredentials => + new[] { GrantTypes.IMPLICIT, GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection Code => + new[] { GrantTypes.AUTHORIZATION_CODE }; + + public static ICollection CodeAndClientCredentials => + new[] { GrantTypes.AUTHORIZATION_CODE, GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection Hybrid => + new[] { GrantTypes.HYBRID }; + + public static ICollection HybridAndClientCredentials => + new[] { GrantTypes.HYBRID, GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection ClientCredentials => + new[] { GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection ResourceOwnerPassword => + new[] { GrantTypes.RESOURCE_OWNER_PASSWORD }; + + public static ICollection ResourceOwnerPasswordAndClientCredentials => + new[] { GrantTypes.RESOURCE_OWNER_PASSWORD, GrantTypes.CLIENT_CREDENTIALS }; + + public static ICollection DeviceFlow => + new[] { GrantTypes.DEVICE_FLOW }; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs new file mode 100644 index 000000000..d6e49be2d --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; + +public static class GrantTypes +{ + public const string IMPLICIT = "implicit"; + + public const string HYBRID = "hybrid"; + + public const string AUTHORIZATION_CODE = "authorization_code"; + + public const string CLIENT_CREDENTIALS = "client_credentials"; + + public const string RESOURCE_OWNER_PASSWORD = "password"; + + public const string DEVICE_FLOW = "urn:ietf:params:oauth:grant-type:device_code"; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs new file mode 100644 index 000000000..a76ab6f88 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; + +public abstract class Property : Entity +{ + public string Key { get; protected set; } = ""; + + public string Value { get; protected set; } = ""; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs new file mode 100644 index 000000000..d317f503b --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; + +public abstract class Secret : FullEntity +{ + public string Description { get; protected set; } = string.Empty; + + public string Value { get; protected set; } = string.Empty; + + public DateTime? Expiration { get; protected set; } + + public string Type { get; protected set; } = "SharedSecret"; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs new file mode 100644 index 000000000..c953e82d5 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs @@ -0,0 +1,78 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResource : FullAggregateRoot +{ + private List _secrets = new(); + private List _apiScopes = new(); + private List _userClaims = new(); + private List _properties = new(); + + public bool Enabled { get; private set; } + + public string Name { get; private set; } = ""; + + public string DisplayName { get; private set; } = ""; + + public string Description { get; private set; } = ""; + + public string AllowedAccessTokenSigningAlgorithms { get; private set; } = ""; + + public bool ShowInDiscoveryDocument { get; private set; } = true; + + public DateTime? LastAccessed { get; private set; } + + public bool NonEditable { get; private set; } + + public IReadOnlyCollection Secrets => _secrets; + + public IReadOnlyCollection ApiScopes => _apiScopes; + + public IReadOnlyCollection UserClaims => _userClaims; + + public IReadOnlyCollection Properties => _properties; + + public ApiResource(string name, string displayName, string description, string allowedAccessTokenSigningAlgorithms, bool showInDiscoveryDocument, DateTime? lastAccessed, bool nonEditable, bool enabled) + { + Enabled = enabled; + Name = name; + DisplayName = displayName; + Description = description; + AllowedAccessTokenSigningAlgorithms = allowedAccessTokenSigningAlgorithms; + ShowInDiscoveryDocument = showInDiscoveryDocument; + LastAccessed = lastAccessed; + NonEditable = nonEditable; + } + + public void Update(string displayName, string description, string allowedAccessTokenSigningAlgorithms, bool showInDiscoveryDocument, DateTime? lastAccessed, bool nonEditable, bool enabled) + { + Enabled = enabled; + DisplayName = displayName; + Description = description; + AllowedAccessTokenSigningAlgorithms = allowedAccessTokenSigningAlgorithms; + ShowInDiscoveryDocument = showInDiscoveryDocument; + LastAccessed = lastAccessed; + NonEditable = nonEditable; + } + + public void BindUserClaims(List userClaims) + { + _userClaims.Clear(); + _userClaims.AddRange(userClaims.Select(id => new ApiResourceClaim(id))); + } + + public void BindProperties(Dictionary properties) + { + _properties.Clear(); + _properties.AddRange(properties.Select(property => new ApiResourceProperty(property.Key, property.Value))); + } + + public void BindApiScopes(List apiScopes) + { + _apiScopes.Clear(); + _apiScopes.AddRange(apiScopes.Select(id => new ApiResourceScope(id))); + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs new file mode 100644 index 000000000..0188babe4 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResourceClaim : FullEntity +{ + public int UserClaimId { get; private set; } + + public UserClaim UserClaim { get; private set; } = null!; + + public int ApiResourceId { get; private set; } + + public ApiResource ApiResource { get; private set; } = null!; + + public ApiResourceClaim(int userClaimId) + { + UserClaimId = userClaimId; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs new file mode 100644 index 000000000..8dde202ac --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResourceProperty : Property +{ + public int ApiResourceId { get; private set; } + + public ApiResource ApiResource { get; private set; } = null!; + + public ApiResourceProperty(string key, string value) + { + Key = key; + Value = value; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs new file mode 100644 index 000000000..745deb01a --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResourceScope : FullEntity +{ + public int ApiScopeId { get; private set; } + + public ApiScope ApiScope { get; private set; } = null!; + + public int ApiResourceId { get; private set; } + + public ApiResource ApiResource { get; private set; } = null!; + + public ApiResourceScope(int apiScopeId) + { + ApiScopeId = apiScopeId; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs new file mode 100644 index 000000000..aef627684 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiResourceSecret : Secret +{ + public int ApiResourceId { get; private set; } + + public ApiResource ApiResource { get; private set; } = null!; +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs new file mode 100644 index 000000000..b2d6c400f --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiScope : FullAggregateRoot +{ + private List _userClaims = new(); + private List _properties = new(); + + public bool Enabled { get; private set; } + + public string Name { get; private set; } = ""; + + public string DisplayName { get; private set; } = ""; + + public string Description { get; private set; } = ""; + + public bool Required { get; private set; } + + public bool Emphasize { get; private set; } + + public bool ShowInDiscoveryDocument { get; private set; } + + public IReadOnlyCollection UserClaims => _userClaims; + + public IReadOnlyCollection Properties => _properties; + + public ApiScope(string name) : this(name, name, "", true, true, true, true) + { + + } + + public ApiScope(string name, string displayName, string description, bool required, bool emphasize, bool showInDiscoveryDocument, bool enabled) + { + Enabled = enabled; + Name = name; + DisplayName = displayName; + Description = description; + Required = required; + Emphasize = emphasize; + ShowInDiscoveryDocument = showInDiscoveryDocument; + } + + public void Update(string displayName, string description, bool required, bool emphasize, bool showInDiscoveryDocument, bool enabled) + { + Enabled = enabled; + DisplayName = displayName; + Description = description; + Required = required; + Emphasize = emphasize; + ShowInDiscoveryDocument = showInDiscoveryDocument; + } + + public void BindUserClaims(List userClaims) + { + _userClaims.Clear(); + _userClaims.AddRange(userClaims.Select(id => new ApiScopeClaim(id))); + } + + public void BindProperties(Dictionary properties) + { + _properties.Clear(); + _properties.AddRange(properties.Select(property => new ApiScopeProperty(property.Key, property.Value))); + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs new file mode 100644 index 000000000..613e08be7 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiScopeClaim : FullEntity +{ + public int UserClaimId { get; private set; } + + public UserClaim UserClaim { get; private set; } = null!; + + public int ApiScopeId { get; private set; } + + public ApiScope ApiScope { get; private set; } = null!; + + public ApiScopeClaim(int userClaimId) + { + UserClaimId = userClaimId; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs new file mode 100644 index 000000000..9b49e1e00 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ApiScopeProperty : Property +{ + public int ScopeId { get; private set; } + + public ApiScope Scope { get; private set; } = null!; + + public ApiScopeProperty(string key, string value) + { + Key = key; + Value = value; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs new file mode 100644 index 000000000..535e3a8ee --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs @@ -0,0 +1,161 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class Client : FullAggregateRoot +{ + public ClientTypes ClientType { get; private set; } + + public bool Enabled { get; private set; } = true; + + public string ClientId { get; private set; } = string.Empty; + + public string ProtocolType { get; private set; } = "oidc"; + + public List ClientSecrets { get; private set; } = new(); + + public bool RequireClientSecret { get; private set; } = true; + + public string ClientName { get; private set; } = string.Empty; + + public string Description { get; private set; } = string.Empty; + + public string ClientUri { get; private set; } = string.Empty; + + public string LogoUri { get; private set; } = string.Empty; + + public bool RequireConsent { get; private set; } = false; + + public bool AllowRememberConsent { get; private set; } = true; + + public bool AlwaysIncludeUserClaimsInIdToken { get; private set; } + + public List AllowedGrantTypes { get; private set; } = new(); + + public bool RequirePkce { get; private set; } = true; + + public bool AllowPlainTextPkce { get; private set; } + + public bool RequireRequestObject { get; private set; } + + public bool AllowAccessTokensViaBrowser { get; private set; } + + public List RedirectUris { get; private set; } = new(); + + public List PostLogoutRedirectUris { get; private set; } = new(); + + public string FrontChannelLogoutUri { get; private set; } = string.Empty; + + public bool FrontChannelLogoutSessionRequired { get; private set; } = true; + + public string BackChannelLogoutUri { get; private set; } = string.Empty; + + public bool BackChannelLogoutSessionRequired { get; private set; } = true; + + public bool AllowOfflineAccess { get; private set; } + + public List AllowedScopes { get; private set; } = new(); + + public int IdentityTokenLifetime { get; private set; } = 300; + + public string AllowedIdentityTokenSigningAlgorithms { get; private set; } = string.Empty; + + public int AccessTokenLifetime { get; private set; } = 3600; + + public int AuthorizationCodeLifetime { get; private set; } = 300; + + public int? ConsentLifetime { get; private set; } = null; + + public int AbsoluteRefreshTokenLifetime { get; private set; } = 2592000; + + public int SlidingRefreshTokenLifetime { get; private set; } = 1296000; + + public int RefreshTokenUsage { get; private set; } = (int)TokenUsage.OneTimeOnly; + + public bool UpdateAccessTokenClaimsOnRefresh { get; private set; } + + public int RefreshTokenExpiration { get; private set; } = (int)TokenExpiration.Absolute; + + public int AccessTokenType { get; private set; } = 0; // AccessTokenType.Jwt; + + public bool EnableLocalLogin { get; private set; } = true; + + public List IdentityProviderRestrictions { get; private set; } = new(); + + public bool IncludeJwtId { get; private set; } + + public List Claims { get; private set; } = new(); + + public bool AlwaysSendClientClaims { get; private set; } + + public string ClientClaimsPrefix { get; private set; } = "client_"; + + public string PairWiseSubjectSalt { get; private set; } = string.Empty; + + public List AllowedCorsOrigins { get; private set; } = new(); + + public List Properties { get; private set; } = new(); + + public DateTime? LastAccessed { get; private set; } + + public int? UserSsoLifetime { get; private set; } + + public string UserCodeType { get; private set; } = string.Empty; + + public int DeviceCodeLifetime { get; private set; } = 300; + + public bool NonEditable { get; private set; } + + private Client() + { + } + + public Client(ClientTypes clientType, string clientId, string clientName) + { + SetClientType(clientType); + ClientId = clientId; + ClientName = clientName; + } + + public void SetClientType(ClientTypes clientType) + { + ClientType = clientType; + switch (clientType) + { + case ClientTypes.Web: + case ClientTypes.Spa: + case ClientTypes.Native: + AllowedGrantTypes = GrantTypeConsts.Code.Select(x => new ClientGrantType(x)).ToList(); + RequirePkce = true; + RequireClientSecret = false; + break; + case ClientTypes.Machine: + AllowedGrantTypes = GrantTypeConsts.ClientCredentials.Select(x => new ClientGrantType(x)).ToList(); + RequireClientSecret = true; + break; + case ClientTypes.Device: + AllowedGrantTypes = GrantTypeConsts.DeviceFlow.Select(x => new ClientGrantType(x)).ToList(); + RequireClientSecret = false; + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + public void SetRedirectUris(List redirectUris) + { + RedirectUris = redirectUris.Select(x => new ClientRedirectUri(x)).ToList(); + } + + public void SetPostLogoutRedirectUris(List postLogoutRedirectUris) + { + PostLogoutRedirectUris = postLogoutRedirectUris.Select(x => new ClientPostLogoutRedirectUri(x)).ToList(); + } + + public void SetAllowedScopes(List allowedScopes) + { + AllowedScopes = allowedScopes.Select(x => new ClientScope(x)).ToList(); + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs new file mode 100644 index 000000000..a95e140f4 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientClaim : Entity +{ + public string Type { get; private set; } = string.Empty; + + public string Value { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs new file mode 100644 index 000000000..942460995 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientCorsOrigin : Entity +{ + public string Origin { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs new file mode 100644 index 000000000..aa6124fc9 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientGrantType : Entity +{ + public string GrantType { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientGrantType(string grantType) + { + GrantType = grantType; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs new file mode 100644 index 000000000..61ed181a8 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientIdPRestriction : Entity +{ + public string Provider { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs new file mode 100644 index 000000000..b50256c26 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientPostLogoutRedirectUri : Entity +{ + public string PostLogoutRedirectUri { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientPostLogoutRedirectUri(string postLogoutRedirectUri) + { + PostLogoutRedirectUri = postLogoutRedirectUri; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs new file mode 100644 index 000000000..8d78e460b --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientProperty : Property +{ + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientProperty(string key, string value) + { + Key = key; + Value = value; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs new file mode 100644 index 000000000..7d0016b87 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientRedirectUri : Entity +{ + public string RedirectUri { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientRedirectUri(string redirectUri) + { + RedirectUri = redirectUri; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs new file mode 100644 index 000000000..051e242b1 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientScope : Entity +{ + public string Scope { get; private set; } = string.Empty; + + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; + + public ClientScope(string scope) + { + Scope = scope; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs new file mode 100644 index 000000000..415646d32 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class ClientSecret : Secret +{ + public int ClientId { get; private set; } + + public Client Client { get; private set; } = null!; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs new file mode 100644 index 000000000..5607d7399 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs @@ -0,0 +1,71 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class DeviceFlowCodes : FullAggregateRoot +{ + /// + /// Gets or sets the device code. + /// + /// + /// The device code. + /// + public string DeviceCode { get; private set; } = string.Empty; + + /// + /// Gets or sets the user code. + /// + /// + /// The user code. + /// + public string UserCode { get; private set; } = string.Empty; + + /// + /// Gets or sets the subject identifier. + /// + /// + /// The subject identifier. + /// + public string SubjectId { get; private set; } = string.Empty; + + /// + /// Gets or sets the session identifier. + /// + /// + /// The session identifier. + /// + public string SessionId { get; private set; } = string.Empty; + + /// + /// Gets or sets the client identifier. + /// + /// + /// The client identifier. + /// + public string ClientId { get; private set; } = string.Empty; + + /// + /// Gets the description the user assigned to the device being authorized. + /// + /// + /// The description. + /// + public string Description { get; private set; } = string.Empty; + + /// + /// Gets or sets the expiration. + /// + /// + /// The expiration. + /// + public DateTime? Expiration { get; private set; } + + /// + /// Gets or sets the data. + /// + /// + /// The data. + /// + public string Data { get; private set; } = string.Empty; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs new file mode 100644 index 000000000..e947153b2 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class IdentityResource : FullAggregateRoot +{ + private List _userClaims = new(); + private List _properties = new(); + + public string Name { get; private set; } = string.Empty; + + public string DisplayName { get; private set; } = string.Empty; + + public string Description { get; private set; } = string.Empty; + + public bool Enabled { get; private set; } = true; + + public bool Required { get; private set; } + + public bool Emphasize { get; private set; } + + public bool ShowInDiscoveryDocument { get; private set; } = true; + + public IReadOnlyCollection UserClaims => _userClaims; + + public IReadOnlyCollection Properties => _properties; + + public bool NonEditable { get; private set; } + + public IdentityResource(string name, string displayName, string description, bool enabled, bool required, bool emphasize, bool showInDiscoveryDocument, bool nonEditable) + { + Name = name; + DisplayName = displayName; + Description = description; + Enabled = enabled; + Required = required; + Emphasize = emphasize; + ShowInDiscoveryDocument = showInDiscoveryDocument; + NonEditable = nonEditable; + } + + public void BindUserClaims(IEnumerable userClaims) + { + _userClaims.Clear(); + _userClaims.AddRange(userClaims.Select(id => new IdentityResourceClaim(id))); + } + + public void BindProperties(Dictionary properties) + { + _properties.Clear(); + _properties.AddRange(properties.Select(property => new IdentityResourceProperty(property.Key, property.Value))); + } + + public void Update(string displayName, string description, bool enabled, bool required, bool emphasize, bool showInDiscoveryDocument, bool nonEditable) + { + DisplayName = displayName; + Description = description; + Enabled = enabled; + Required = required; + Emphasize = emphasize; + ShowInDiscoveryDocument = showInDiscoveryDocument; + NonEditable = nonEditable; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs new file mode 100644 index 000000000..d8f4fa9f6 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class IdentityResourceClaim : FullEntity +{ + public int UserClaimId { get; private set; } + + public UserClaim UserClaim { get; private set; } = null!; + + public int IdentityResourceId { get; private set; } + + public IdentityResource IdentityResource { get; private set; } = null!; + + public IdentityResourceClaim(int userClaimId) + { + UserClaimId = userClaimId; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs new file mode 100644 index 000000000..88b21d15c --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities +{ + public class IdentityResourceProperty : Property + { + public int IdentityResourceId { get; private set; } + + public IdentityResource IdentityResource { get; private set; } = null!; + + public IdentityResourceProperty(string key, string value) + { + Key = key; + Value = value; + } + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs new file mode 100644 index 000000000..2ceeced09 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class PersistedGrant : FullAggregateRoot +{ + public string Key { get; private set; } = null!; + + public string Type { get; private set; } = string.Empty; + + public string SubjectId { get; private set; } = string.Empty; + + public string SessionId { get; private set; } = string.Empty; + + public string ClientId { get; private set; } = string.Empty; + + public string Description { get; private set; } = string.Empty; + + public DateTime? Expiration { get; private set; } + + public DateTime? ConsumedTime { get; private set; } + + public string Data { get; private set; } = string.Empty; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs new file mode 100644 index 000000000..669417c56 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; + +public class UserClaim : FullAggregateRoot +{ + public string Name { get; private set; } + + public string Description { get; private set; } + + public UserClaim(string name, string description) + { + Name = name; + Description = description; + } + + public void Update(string description) + { + Description = description; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs new file mode 100644 index 000000000..d4882f57d --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; + +public enum ClientTypes +{ + Web = 1, + Spa = 2, + Native = 3, + Machine = 4, + Device = 5 +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs new file mode 100644 index 000000000..410ac838f --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; + +/// +/// Token expiration types. +/// +public enum TokenExpiration +{ + /// + /// Sliding token expiration + /// + Sliding = 0, + + /// + /// Absolute token expiration + /// + Absolute = 1 +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs new file mode 100644 index 000000000..67eaa8040 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; + +/// +/// Token usage types. +/// +public enum TokenUsage +{ + /// + /// Re-use the refresh token handle + /// + Reuse = 0, + + /// + /// Issue a new refresh token handle every time + /// + OneTimeOnly = 1 +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs new file mode 100644 index 000000000..c7118c570 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IApiResourceRepository : IRepositoryBase +{ +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs new file mode 100644 index 000000000..6d5822e83 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IApiScopeRepository : IRepositoryBase +{ +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs new file mode 100644 index 000000000..31c686ff4 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IClientRepository : IRepositoryBase +{ +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs new file mode 100644 index 000000000..f70b7ab4d --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IIdentityResourceRepository : IRepositoryBase +{ + Task AddStandardIdentityResourcesAsync(); +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs new file mode 100644 index 000000000..a15fceae5 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IRepositoryBase where TEntity : class, IEntity +{ + Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null); + + Task GetDetailAsync(int id); + + Task> GetListAsync(); + + Task FindAsync(Expression> predicate); + + Task GetCountAsync(Expression> predicate); + + ValueTask AddAsync(TEntity entity); + + Task UpdateAsync(TEntity entity); + + Task RemoveAsync(TEntity entity); +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs new file mode 100644 index 000000000..2a884f1fb --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; + +public interface IUserClaimRepository : IRepositoryBase +{ + Task AddStandardUserClaimsAsync(); +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs new file mode 100644 index 000000000..623152bd2 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Entities.Full; +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; +global using System.Linq.Expressions; diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs new file mode 100644 index 000000000..900f0e698 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; + +public static class GrantType +{ + public const string IMPLICIT = "implicit"; + + public const string HYBRID = "hybrid"; + + public const string AUTHORIZATION_CODE = "authorization_code"; + + public const string CLIENT_CREDENTIALS = "client_credentials"; + + public const string RESOURCE_OWNER_PASSWORD = "password"; + + public const string DEVICE_FLOW = "urn:ietf:params:oauth:grant-type:device_code"; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs new file mode 100644 index 000000000..dbcd5e530 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs @@ -0,0 +1,37 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; + +public class GrantTypes +{ + public static ICollection Implicit => + new[] { GrantType.IMPLICIT }; + + public static ICollection ImplicitAndClientCredentials => + new[] { GrantType.IMPLICIT, GrantType.CLIENT_CREDENTIALS }; + + public static ICollection Code => + new[] { GrantType.AUTHORIZATION_CODE }; + + public static ICollection CodeAndClientCredentials => + new[] { GrantType.AUTHORIZATION_CODE, GrantType.CLIENT_CREDENTIALS }; + + public static ICollection Hybrid => + new[] { GrantType.HYBRID }; + + public static ICollection HybridAndClientCredentials => + new[] { GrantType.HYBRID, GrantType.CLIENT_CREDENTIALS }; + + public static ICollection ClientCredentials => + new[] { GrantType.CLIENT_CREDENTIALS }; + + public static ICollection ResourceOwnerPassword => + new[] { GrantType.RESOURCE_OWNER_PASSWORD }; + + public static ICollection ResourceOwnerPasswordAndClientCredentials => + new[] { GrantType.RESOURCE_OWNER_PASSWORD, GrantType.CLIENT_CREDENTIALS }; + + public static ICollection DeviceFlow => + new[] { GrantType.DEVICE_FLOW }; +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs new file mode 100644 index 000000000..b1dc32a84 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs @@ -0,0 +1,104 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; + +public class StandardIdentityResources +{ + [Description("Your user identifier")] + public static IdentityResourceModel OpenId = new() + { + Name = "openid", + DisplayName = "Your user identifier", + Description = "Your user identifier", + Required = true, + UserClaims = new List() + { + StandardUserClaims.Subject + } + }; + + [Description("Your address")] + public static IdentityResourceModel Address = new() + { + Name = "address", + DisplayName = "Your address", + Description = "Your address", + Emphasize = true, + UserClaims = new List() + { + StandardUserClaims.Address + } + }; + + [Description("Your email address")] + public static IdentityResourceModel Email = new() + { + Name = "email", + DisplayName = "Your email address", + Description = "Your email address", + Emphasize = true, + UserClaims = new List() + { + StandardUserClaims.Email, + StandardUserClaims.EmailVerified, + } + }; + + [Description("Your phone number")] + public static IdentityResourceModel Phone = new() + { + Name = "phone", + DisplayName = "Your phone number", + Description = "Your phone number", + Emphasize = true, + UserClaims = new List() + { + StandardUserClaims.PhoneNumber, + StandardUserClaims.PhoneNumberVerified + } + }; + + [Description("User profile")] + public static IdentityResourceModel Profile = new() + { + Name = "profile", + DisplayName = "User profile", + Description = "Your user profile information (first name, last name, etc.)", + Emphasize = true, + UserClaims = new List() + { + StandardUserClaims.Name, + StandardUserClaims.FamilyName, + StandardUserClaims.GivenName, + StandardUserClaims.MiddleName, + StandardUserClaims.NickName, + StandardUserClaims.PreferredUserName, + StandardUserClaims.Profile, + StandardUserClaims.Picture, + StandardUserClaims.WebSite, + StandardUserClaims.Gender, + StandardUserClaims.BirthDate, + StandardUserClaims.ZoneInfo, + StandardUserClaims.Locale, + StandardUserClaims.UpdatedAt + } + }; + + static List? _identityResources; + + public static List IdentityResources => _identityResources ??= GetIdentityResources(); + + static List GetIdentityResources() + { + var identityResources = new List(); + var fields = typeof(StandardIdentityResources).GetFields(BindingFlags.Static | BindingFlags.Public); + foreach (var field in fields) + { + var idrs = (IdentityResourceModel)(field.GetValue(null) ?? throw new Exception("Error standard identity resources data")); + identityResources.Add(idrs); + } + + return identityResources; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs new file mode 100644 index 000000000..f6b2d8ed9 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs @@ -0,0 +1,78 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; + +public static class StandardUserClaims +{ + [Description("subject 的缩写,唯一标识,一般为用户 ID")] + public static readonly string Subject = "sub"; + [Description("姓名")] + public static readonly string Name = "name"; + [Description("名字")] + public static readonly string GivenName = "given_name"; + [Description("姓")] + public static readonly string FamilyName = "family_name"; + [Description("中间名")] + public static readonly string MiddleName = "middle_name"; + [Description("昵称")] + public static readonly string NickName = "nickname"; + [Description("希望被称呼的名字")] + public static readonly string PreferredUserName = "preferred_username"; + [Description("基础资料")] + public static readonly string Profile = "profile"; + [Description("头像")] + public static readonly string Picture = "picture"; + [Description("网站链接")] + public static readonly string WebSite = "website"; + [Description("电子邮箱")] + public static readonly string Email = "email"; + [Description("邮箱是否被认证")] + public static readonly string EmailVerified = "email_verified"; + [Description("性别")] + public static readonly string Gender = "gender"; + [Description("生日")] + public static readonly string BirthDate = "birthdate"; + [Description("时区")] + public static readonly string ZoneInfo = "zoneinfo"; + [Description("区域")] + public static readonly string Locale = "locale"; + [Description("手机号")] + public static readonly string PhoneNumber = "phone_number"; + [Description("认证手机号")] + public static readonly string PhoneNumberVerified = "phone_number_verified"; + [Description("地址")] + public static readonly string Address = "address"; + [Description("详细地址")] + public static readonly string Formatted = "formatted"; + [Description("街道地址")] + public static readonly string StreetAddress = "street_address"; + [Description("城市")] + public static readonly string Locality = "locality"; + [Description("省")] + public static readonly string Region = "region"; + [Description("邮编")] + public static readonly string PostalCode = "postal_code"; + [Description("国家")] + public static readonly string Country = "country"; + [Description("信息更新时间")] + public static readonly string UpdatedAt = "updated_at"; + + static Dictionary? _claims; + + public static Dictionary Claims => _claims ??= GetClaims(); + + static Dictionary GetClaims() + { + var claims = new Dictionary(); + var fileds = typeof(StandardUserClaims).GetFields(BindingFlags.Static | BindingFlags.Public); + foreach (var filed in fileds) + { + var value = filed.GetValue(null)?.ToString() ?? ""; + var description = filed.GetCustomAttribute()?.Description ?? ""; + claims.Add(value, description); + } + + return claims; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs new file mode 100644 index 000000000..f49e96f2b --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; + +public enum AccessTokenType +{ + [Description("Self-contained Json Web Token")] + Jwt, + [Description("Reference token")] + Reference +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs new file mode 100644 index 000000000..8a3e0dd6f --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; + +public enum TokenExpiration +{ + [Description("Sliding token expiration")] + Sliding, + [Description("Absolute token expiration")] + Absolute +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs new file mode 100644 index 000000000..52ffd7eff --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; + +public enum TokenUsage +{ + [Description("Re-use the refresh token handle")] + Reuse, + [Description("Issue a new refresh token handle every time")] + OneTimeOnly +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs new file mode 100644 index 000000000..7e27dd894 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs @@ -0,0 +1,50 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ApiResourceModel : ResourceModel +{ + public ICollection? Scopes { get; set; } + + public ICollection? ApiSecrets { get; set; } + + public ICollection? AllowedAccessTokenSigningAlgorithms { get; set; } + + public ApiResourceModel() + { + + } + + public ApiResourceModel( + string name, + string? displayName = null, + ICollection? userClaims = null) + { + Name = name; + DisplayName = displayName ?? name; + if (userClaims is not null) UserClaims = userClaims; + } + + public ApiResourceModel( + string name, + string displayName, + string? description, + bool enabled, + bool showInDiscoveryDocument, + ICollection? userClaims, + ICollection? scopes, + IDictionary properties, + ICollection? apiSecrets, + ICollection? allowedAccessTokenSigningAlgorithms) : this(name, displayName, userClaims) + { + Description = description; + Enabled = enabled; + ShowInDiscoveryDocument = showInDiscoveryDocument; + Scopes = scopes; + Properties = properties; + ApiSecrets = apiSecrets; + AllowedAccessTokenSigningAlgorithms = allowedAccessTokenSigningAlgorithms; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs new file mode 100644 index 000000000..584292172 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs @@ -0,0 +1,46 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ApiScopeModel : ResourceModel +{ + public bool Required { get; set; } + + public bool Emphasize { get; set; } + + public ApiScopeModel() + { + + } + + public ApiScopeModel( + string name, + string? displayName = null, + ICollection? userClaims = null) + { + Name = name; + DisplayName = displayName ?? name; + if (userClaims is not null) UserClaims = userClaims; + } + + public ApiScopeModel( + string name, + string displayName, + string? description, + bool enabled, + bool showInDiscoveryDocument, + bool required, + bool emphasize, + ICollection? userClaims, + Dictionary properties) : this(name, displayName, userClaims) + { + Description = description; + Enabled = enabled; + ShowInDiscoveryDocument = showInDiscoveryDocument; + Required = required; + Emphasize = emphasize; + Properties = properties; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs new file mode 100644 index 000000000..7b37e0dba --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs @@ -0,0 +1,59 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ClientClaimModel +{ + /// + /// The claim type + /// + public string Type { get; set; } + + /// + /// The claim value + /// + public string Value { get; set; } + + /// + /// The claim value type + /// + public string ValueType { get; set; } = ClaimValueTypes.String; + + /// + /// ctor + /// + public ClientClaimModel(string type, string value, string? valueType = null) + { + Type = type; + Value = value; + if (valueType is not null) ValueType = valueType; + } + + public override int GetHashCode() + { + unchecked + { + int hash = 17; + + hash = hash * 23 + Value.GetHashCode(); + hash = hash * 23 + Type.GetHashCode(); + hash = hash * 23 + ValueType.GetHashCode(); + return hash; + } + } + + public override bool Equals(object? obj) + { + if (obj is null) return false; + if (obj is ClientClaimModel c) + { + return string.Equals(Type, c.Type, StringComparison.Ordinal) && + string.Equals(Value, c.Value, StringComparison.Ordinal) && + string.Equals(ValueType, c.ValueType, StringComparison.Ordinal); + } + + return false; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs new file mode 100644 index 000000000..d9522b574 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs @@ -0,0 +1,227 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ClientModel +{ + private IEnumerable? _allowedGrantTypes; + private IEnumerable? _apiScopes; + + public string ClientId { get; set; } + + public string ClientName { get; set; } + + public string Description { get; set; } + + public string ClientUri { get; set; } + + public string LogoUri { get; set; } + + public IEnumerable ClientSecrets { get; set; } + + public IEnumerable RedirectUris { get; set; } + + public IEnumerable PostLogoutRedirectUris { get; set; } + + public IEnumerable AllowedGrantTypes + { + get + { + if (_allowedGrantTypes is null) throw new Exception("Please set Client.GrantTypes"); + ValidateGrantTypes(_allowedGrantTypes); + return _allowedGrantTypes.Distinct(); + } + set + { + ValidateGrantTypes(value); + _allowedGrantTypes = value; + } + } + + public IEnumerable AllowedScopes + { + get => _apiScopes?.Distinct() ?? throw new Exception("Please set Client.AllowedScopes"); + set => _apiScopes = value; + } + + /// + /// Signing algorithm for identity token. If empty, will use the server default signing + /// + public IEnumerable? AllowedIdentityTokenSigningAlgorithms { get; set; } + + /// + /// Allows settings claims for the client (will be included in the access token) + /// + public ICollection? Claims { get; set; } + + /// + /// Gets or sets the allowed CORS origins for JavaScript clients. + /// + public ICollection? AllowedCorsOrigins { get; set; } + + /// + /// Gets or sets the custom properties for the client. + /// + public IDictionary Properties { get; set; } = new Dictionary(); + + /// + /// Specifies which external IdPs can be used with this client (if list is empty + /// all IdPs are allowed). Defaults to empty. + /// + public ICollection IdentityProviderRestrictions { get; set; } = new HashSet(); + + public bool RequireConsent { get; set; } + + public bool RequireClientSecret { get; set; } = true; + + public bool Enabled { get; set; } = true; + + public bool AllowRememberConsent { get; set; } = true; + + public bool RequirePkce { get; set; } = true; + + public bool AllowPlainTextPkce { get; set; } + + public bool RequireRequestObject { get; set; } + + public bool AllowAccessTokensViaBrowser { get; set; } + + public bool AllowOfflineAccess { get; set; } + + public bool AlwaysIncludeUserClaimsInIdToken { get; set; } + + public bool BackChannelLogoutSessionRequired { get; set; } = true; + + /// + /// Gets or sets a value indicating whether JWT access tokens should include an identifier. + /// + public bool IncludeJwtId { get; set; } = true; + + /// + /// Gets or sets a value indicating whether client claims should be always included + /// in the access tokens - or only for client credentials flow. Defaults to false + /// + public bool AlwaysSendClientClaims { get; set; } + + /// + /// Gets or sets a value indicating whether the local login is allowed for this client.Defaults to true. + /// + public bool EnableLocalLogin { get; set; } = true; + + /// + /// Gets or sets a value indicating whether the access token (and its claims) should + /// be updated on a refresh token request. Defaults to false. + /// + public bool UpdateAccessTokenClaimsOnRefresh { get; set; } + + /// + /// Lifetime of identity token in seconds (defaults to 300 seconds / 5 minutes) + /// + public int IdentityTokenLifetime { get; set; } = 300; + + /// + /// Lifetime of access token in seconds (defaults to 3600 seconds / 1 hour) + /// + public int AccessTokenLifetime { get; set; } = 3600; + + /// + /// Lifetime of authorization code in seconds (defaults to 300 seconds / 5 minutes) + /// + public int AuthorizationCodeLifetime { get; set; } = 300; + + /// + /// Maximum lifetime of a refresh token in seconds (defaults to 2592000 seconds / 30 days) + /// + public int AbsoluteRefreshTokenLifetime { get; set; } = 2592000; + + /// + /// Sliding lifetime of a refresh token in seconds (defaults to 1296000 seconds / 15 days) + /// + public int SlidingRefreshTokenLifetime { get; set; } = 1296000; + + /// + /// Lifetime of a user consent in seconds. Defaults to null (no expiration) + /// + public int? ConsentLifetime { get; set; } + + /// + /// The maximum duration (in seconds) since the last time the user authenticated. + /// + public int? UserSsoLifetime { get; set; } + + /// + /// Gets or sets the device code lifetime. + /// + public int DeviceCodeLifetime { get; set; } = 300; + + /// + /// Absolute: the refresh token will expire on a fixed point in time (specified by + /// the AbsoluteRefreshTokenLifetime) Sliding: when refreshing the token, the lifetime + /// of the refresh token will be renewed(by the amount specified in SlidingRefreshTokenLifetime). + /// he lifetime will not exceed AbsoluteRefreshTokenLifetime. + /// + public TokenExpiration RefreshTokenExpiration { get; set; } = TokenExpiration.Absolute; + + /// + /// ReUse:the refresh token handle will stay the same when refreshing tokens + /// OneTimeOnly:the refresh token handle will be updated when refreshing tokens + /// Default value OneTimeOnly + /// + public TokenUsage RefreshTokenUsage { get; set; } = TokenUsage.OneTimeOnly; + + public AccessTokenType AccessTokenType { get; set; } + + public string ProtocolType { get; set; } = "oidc"; + + public string? FrontChannelLogoutUri { get; set; } + + public bool FrontChannelLogoutSessionRequired { get; set; } = true; + + public string? BackChannelLogoutUri { get; set; } + + /// + /// Gets or sets a value to prefix it on client claim types. Defaults to client_. + /// + public string ClientClaimsPrefix { get; set; } = "client_"; + + /// + /// Gets or sets a salt value used in pair-wise subjectId generation for users of + /// this client. + /// + public string? PairWiseSubjectSalt { get; set; } + + /// + /// Gets or sets the type of the device flow user code. + /// + public string? UserCodeType { get; set; } + + public ClientModel(string clientId, string clientName, string description, string clientUri, string logoUri, IEnumerable redirectUris, IEnumerable postLogoutRedirectUris, IEnumerable allowedGrantTypes, IEnumerable allowedScopes) + { + ClientId = clientId; + ClientName = clientName; + Description = description; + ClientUri = clientUri; + LogoUri = logoUri; + RedirectUris = redirectUris; + PostLogoutRedirectUris = postLogoutRedirectUris; + AllowedGrantTypes = allowedGrantTypes; + AllowedScopes = allowedScopes; + } + + private static void ValidateGrantTypes(IEnumerable grantTypes) + { + if (grantTypes.Any(grantType => grantType.Contains(' '))) + throw new InvalidOperationException("Grant types cannot contain spaces"); + + if (grantTypes.Count() != 1) + { + foreach (var (value1, value2) in GrantType.DisallowGrantTypeCombinations) + { + if (grantTypes.Contains(value1, StringComparer.Ordinal) && grantTypes.Contains(value2, StringComparer.Ordinal)) + throw new InvalidOperationException($"Grant types list cannot contain both {value1} and {value2}"); + } + } + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs new file mode 100644 index 000000000..a8762ad57 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs @@ -0,0 +1,113 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +/// +/// Represents data needed for device flow. +/// +public class DeviceCodeModel +{ + /// + /// Gets or sets the creation time. + /// + /// + /// The creation time. + /// + public DateTime CreationTime { get; set; } + + /// + /// Gets or sets the lifetime. + /// + /// + /// The lifetime. + /// + public int Lifetime { get; set; } + + /// + /// Gets or sets the client identifier. + /// + /// + /// The client identifier. + /// + public string ClientId { get; set; } + + /// + /// Gets the description the user assigned to the device being authorized. + /// + /// + /// The description. + /// + public string Description { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is open identifier. + /// + /// + /// true if this instance is open identifier; otherwise, false. + /// + public bool IsOpenId { get; set; } + + /// + /// Gets or sets a value indicating whether this instance is authorized. + /// + /// + /// true if this instance is authorized; otherwise, false. + /// + public bool IsAuthorized { get; set; } + + /// + /// Gets or sets the requested scopes. + /// + /// + /// The authorized scopes. + /// + public IEnumerable RequestedScopes { get; set; } + + /// + /// Gets or sets the authorized scopes. + /// + /// + /// The authorized scopes. + /// + public IEnumerable AuthorizedScopes { get; set; } + + /// + /// Gets or sets the subject. + /// + /// + /// The subject. + /// + public ClaimsPrincipal Subject { get; set; } + + /// + /// Gets or sets the session identifier. + /// + /// + /// The session identifier. + /// + public string SessionId { get; set; } + + public DeviceCodeModel( + DateTime creationTime, + int lifetime, + string clientId, + string description, + bool isOpenId, + bool isAuthorized, + IEnumerable requestedScopes, + IEnumerable authorizedScopes, + ClaimsPrincipal subject, string sessionId) + { + CreationTime = creationTime; + Lifetime = lifetime; + ClientId = clientId; + Description = description; + IsOpenId = isOpenId; + IsAuthorized = isAuthorized; + RequestedScopes = requestedScopes; + AuthorizedScopes = authorizedScopes; + Subject = subject; + SessionId = sessionId; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs new file mode 100644 index 000000000..5e74f68c7 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class GrantType +{ + public const string Implicit = "implicit"; + public const string Hybrid = "hybrid"; + public const string AuthorizationCode = "authorization_code"; + public const string ClientCredentials = "client_credentials"; + public const string ResourceOwnerPassword = "password"; + public const string DeviceFlow = "urn:ietf:params:oauth:grant-type:device_code"; + + public static List<(string, string)> DisallowGrantTypeCombinations = new() + { + (Implicit, AuthorizationCode), + (Implicit, Hybrid), + (AuthorizationCode, Hybrid), + }; +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs new file mode 100644 index 000000000..523a33b30 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs @@ -0,0 +1,48 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class IdentityResourceModel : ResourceModel +{ + public bool Required { get; set; } + + public bool Emphasize { get; set; } + + public override ICollection UserClaims { get; set; } + + public IdentityResourceModel() + { + } + + public IdentityResourceModel(string name, string displayName, ICollection userClaims) + { + Name = name; + DisplayName = displayName; + UserClaims = userClaims; + } + + public IdentityResourceModel(string name, ICollection userClaims) : this(name, name, userClaims) + { + } + + public IdentityResourceModel( + string name, + string displayName, + string? description, + bool enabled, + bool showInDiscoveryDocument, + bool required, + bool emphasize, + ICollection userClaims, + IDictionary properties) : this(name, displayName, userClaims) + { + Description = description; + Enabled = enabled; + ShowInDiscoveryDocument = showInDiscoveryDocument; + Required = required; + Emphasize = emphasize; + Properties = properties; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs new file mode 100644 index 000000000..b59ec207f --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +/// +/// Represents a filter used when accessing the persisted grants store. +/// Setting multiple properties is interpreted as a logical 'AND' to further filter the query. +/// At least one value must be supplied. +/// +public class PersistedGrantFilter +{ + /// + /// Subject id of the user. + /// + public string SubjectId { get; set; } + + /// + /// Session id used for the grant. + /// + public string SessionId { get; set; } + + /// + /// Client id the grant was issued to. + /// + public string ClientId { get; set; } + + /// + /// The type of grant. + /// + public string Type { get; set; } + + public PersistedGrantFilter( + string subjectId, + string sessionId, + string clientId, + string type) + { + SubjectId = subjectId; + SessionId = sessionId; + ClientId = clientId; + Type = type; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs new file mode 100644 index 000000000..8616114a4 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs @@ -0,0 +1,114 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +/// +/// A model for a persisted grant +/// +public class PersistedGrantModel +{ + /// + /// Gets or sets the key. + /// + /// + /// The key. + /// + public string Key { get; set; } + + /// + /// Gets the type. + /// + /// + /// The type. + /// + public string Type { get; set; } + + /// + /// Gets the subject identifier. + /// + /// + /// The subject identifier. + /// + public string SubjectId { get; set; } + + /// + /// Gets the session identifier. + /// + /// + /// The session identifier. + /// + public string SessionId { get; set; } + + /// + /// Gets the client identifier. + /// + /// + /// The client identifier. + /// + public string ClientId { get; set; } + + /// + /// Gets the description the user assigned to the device being authorized. + /// + /// + /// The description. + /// + public string Description { get; set; } + + /// + /// Gets or sets the creation time. + /// + /// + /// The creation time. + /// + public DateTime CreationTime { get; set; } + + /// + /// Gets or sets the expiration. + /// + /// + /// The expiration. + /// + public DateTime? Expiration { get; set; } + + /// + /// Gets or sets the consumed time. + /// + /// + /// The consumed time. + /// + public DateTime? ConsumedTime { get; set; } + + /// + /// Gets or sets the data. + /// + /// + /// The data. + /// + public string Data { get; set; } + + public PersistedGrantModel( + string key, + string type, + string subjectId, + string sessionId, + string clientId, + string description, + DateTime creationTime, + DateTime? expiration, + DateTime? consumedTime, + string data) + { + Key = key; + Type = type; + SubjectId = subjectId; + SessionId = sessionId; + ClientId = clientId; + Description = description; + CreationTime = creationTime; + Expiration = expiration; + ConsumedTime = consumedTime; + Data = data; + } +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs new file mode 100644 index 000000000..a9da1fd8d --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public abstract class ResourceModel +{ + public bool Enabled { get; set; } = true; + + public string Name { get; set; } = ""; + + public string DisplayName { get; set; } = ""; + + public string? Description { get; set; } + + public bool ShowInDiscoveryDocument { get; set; } = true; + + [DisallowNull] + public virtual ICollection UserClaims { get; set; } = new HashSet(); + + public IDictionary Properties { get; set; } = new Dictionary(); +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs new file mode 100644 index 000000000..44df9f5bf --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class ResourcesModel +{ + /// + /// Gets or sets a value indicating whether [offline access]. + /// + public bool OfflineAccess { get; set; } + + public IEnumerable IdentityResources { get; set; } = new HashSet(); + + public IEnumerable ApiResources { get; set; } = new HashSet(); + + public IEnumerable ApiScopes { get; set; } = new HashSet(); + + public ResourcesModel() + { + } + + public ResourcesModel(ResourcesModel other) + : this(other.IdentityResources, other.ApiResources, other.ApiScopes) + { + OfflineAccess = other.OfflineAccess; + } + + public ResourcesModel(IEnumerable identityResources, IEnumerable apiResources, IEnumerable apiScopes) + { + if (identityResources?.Any() == true) + { + IdentityResources = new HashSet(identityResources.ToArray()); + } + if (apiResources?.Any() == true) + { + ApiResources = new HashSet(apiResources.ToArray()); + } + if (apiScopes?.Any() == true) + { + ApiScopes = new HashSet(apiScopes.ToArray()); + } + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs new file mode 100644 index 000000000..77406b319 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; + +public class SecretModel +{ + public string? Value { get; set; } + + public string? Description { get; set; } + + public DateTime? Expiration { get; set; } + + public string Type { get; set; } = "SharedSecret"; + + public SecretModel(string? value = null, string? description = null, DateTime? expiration = null) + { + Value = value; + Description = description; + Expiration = expiration; + } + + public override int GetHashCode() + { + return (17 * 23 + (Value?.GetHashCode() ?? 0)) * 23 + Type.GetHashCode(); + } + + public override bool Equals(object? obj) + { + if (obj is null) return false; + if (obj is SecretModel secret) + { + if (secret == this) return true; + return string.Equals(secret.Type, Type, StringComparison.Ordinal) && string.Equals(secret.Value, Value, StringComparison.Ordinal); + } + + return false; + } +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs new file mode 100644 index 000000000..e5b433234 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +global using System.ComponentModel; +global using System.Diagnostics.CodeAnalysis; +global using System.Reflection; +global using System.Security.Claims; diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj new file mode 100644 index 000000000..ed98caad6 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj @@ -0,0 +1,16 @@ + + + + net6.0 + enable + enable + + $(WarningsAsErrors);CS8600;CS8601;CS8602;CS8603;CS8604;CS8609;CS8610;CS8614;CS8616;CS8618;CS8619;CS8620;CS8622;CS8625 + + + + + + + + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs new file mode 100644 index 000000000..976845a60 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; + +public interface IClientStore +{ + /// + /// Finds a client by id + /// + /// The client id + /// The client + Task FindClientByIdAsync(string clientId); +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs new file mode 100644 index 000000000..4875f3ea4 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; + +/// +/// Interface for the device flow store +/// +public interface IDeviceFlowStore +{ + /// + /// Stores the device authorization request. + /// + /// The device code. + /// The user code. + /// The data. + /// + Task StoreDeviceAuthorizationAsync(string deviceCode, string userCode, DeviceCodeModel data); + + /// + /// Finds device authorization by user code. + /// + /// The user code. + /// + Task FindByUserCodeAsync(string userCode); + + /// + /// Finds device authorization by device code. + /// + /// The device code. + Task FindByDeviceCodeAsync(string deviceCode); + + /// + /// Updates device authorization, searching by user code. + /// + /// The user code. + /// The data. + Task UpdateByUserCodeAsync(string userCode, DeviceCodeModel data); + + /// + /// Removes the device authorization, searching by device code. + /// + /// The device code. + Task RemoveByDeviceCodeAsync(string deviceCode); +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs new file mode 100644 index 000000000..b08e71f14 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; + +/// +/// Interface for persisting any type of grant. +/// +public interface IPersistedGrantStore +{ + /// + /// Stores the grant. + /// + /// The grant. + /// + Task StoreAsync(PersistedGrantModel grant); + + /// + /// Gets the grant. + /// + /// The key. + /// + Task GetAsync(string key); + + /// + /// Gets all grants based on the filter. + /// + /// The filter. + /// + Task> GetAllAsync(PersistedGrantFilter filter); + + /// + /// Removes the grant by key. + /// + /// The key. + /// + Task RemoveAsync(string key); + + /// + /// Removes all grants based on the filter. + /// + /// The filter. + /// + Task RemoveAllAsync(PersistedGrantFilter filter); +} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs new file mode 100644 index 000000000..45aebca13 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; + +public interface IResourceStore +{ + /// + /// Gets identity resources by scope name. + /// + /// + /// + Task> FindIdentityResourcesByScopeNameAsync(IEnumerable scopeNames); + + /// + /// Gets API scopes by scope name. + /// + /// + /// + Task> FindApiScopesByNameAsync(IEnumerable scopeNames); + + /// + /// Gets API resources by scope name. + /// + /// + /// + Task> FindApiResourcesByScopeNameAsync(IEnumerable scopeNames); + + /// + /// Gets API resources by API resource name. + /// + /// + /// + Task> FindApiResourcesByNameAsync(IEnumerable apiResourceNames); + + /// + /// Gets all resources. + /// + /// + Task GetAllResourcesAsync(); +} + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs new file mode 100644 index 000000000..c045e84b7 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj new file mode 100644 index 000000000..231c41326 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/Masa.BuildingBlocks.Configuration.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs new file mode 100644 index 000000000..633b5b235 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/TestProperties.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration.Tests; + +[TestClass] +public class TestProperties +{ + [TestMethod] + public void TestEquals() + { + var id = Guid.NewGuid().ToString(); + var x = new Properties(new Dictionary() + { + {"id", id}, + }); + var y = new Properties(new Dictionary() + { + {"id", id}, + }); + var z = new Properties(new Dictionary() + { + {"id2", Guid.NewGuid().ToString()}, + {"id", id} + }); + Assert.IsTrue(x.Equals(y)); + Assert.IsTrue(!x.Equals(null)); + Assert.IsTrue(!x!.Equals(z)); + Assert.IsTrue(!z.Equals(x)); + + var w = new Properties(new Dictionary() + { + {"id", Guid.NewGuid().ToString()}, + }); + + Assert.IsFalse(x!.Equals(w)); + } + + [TestMethod] + public void TestGetHashCode() + { + var id = Guid.NewGuid().ToString(); + Properties x = new(new Dictionary() { { "Id", id } }); + Properties y = new(new Dictionary() { { "Id", id } }); + + Assert.AreEqual(x.GetHashCode(), y.GetHashCode()); + } + + [TestMethod] + public void TestOperator() + { + var id = Guid.NewGuid().ToString(); + Properties x = new(new Dictionary() { { "Id", id } }); + Properties y = new(new Dictionary() { { "Id", id } }); + Properties z = new(new Dictionary() { { "Id", Guid.NewGuid().ToString() } }); + + Assert.IsTrue(x == y); + Assert.IsTrue(x != z); + + Properties? m = null; + Assert.IsTrue(m == null); + Assert.IsTrue(null == m); + Assert.IsFalse(null != m); + Assert.IsFalse(m != null); + } +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs new file mode 100644 index 000000000..1109a8e81 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration.Tests/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs new file mode 100644 index 000000000..d6101ffdf --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/AbstractConfigurationRepository.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public abstract class AbstractConfigurationRepository : IConfigurationRepository +{ + private readonly ILogger? _logger; + + private readonly List _listeners = new(); + + public abstract SectionTypes SectionType { get; } + + public AbstractConfigurationRepository(ILoggerFactory? loggerFactory = null) + => _logger = loggerFactory?.CreateLogger(); + + public abstract Properties Load(); + + public void AddChangeListener(IRepositoryChangeListener listener) + { + if (!_listeners.Contains(listener)) + _listeners.Add(listener); + } + + public void RemoveChangeListener(IRepositoryChangeListener listener) + => _listeners.Remove(listener); + + public void FireRepositoryChange(SectionTypes sectionType, Properties newProperties) + { + foreach (var listener in _listeners) + { + try + { + listener.OnRepositoryChange(sectionType, newProperties); + } + catch (Exception ex) + { + _logger?.LogError($"Failed to invoke repository change listener {listener.GetType()}", ex); + } + } + } +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs new file mode 100644 index 000000000..7860859ce --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/ConfigurationTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; +public enum ConfigurationTypes +{ + Properties = 1, + Text, + Json, + Yaml, + Xml +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs new file mode 100644 index 000000000..7ef0d1bb8 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApi.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IConfigurationApi +{ + public IConfiguration Get(string appId); +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs new file mode 100644 index 000000000..349e61ab2 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiClient.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; +public interface IConfigurationApiClient +{ + Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string configObject, Action? valueChanged = null); + + Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged = null); + + Task GetAsync(string configObject, Action? valueChanged = null); + + Task GetAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged = null); + + Task GetDynamicAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged = null); + + Task GetDynamicAsync(string key); +} + diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs new file mode 100644 index 000000000..9fa71028c --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationApiManage.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IConfigurationApiManage +{ + /// + /// Initialize config object + /// + /// Environment name + /// Cluster name + /// App id + /// Config objects,Key:config object name,Value:config object content + /// + Task InitializeAsync(string environment, string cluster, string appId, Dictionary configObjects); + + Task UpdateAsync(string environment, string cluster, string appId, string configObject, object value); +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs new file mode 100644 index 000000000..ae74f6a32 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IConfigurationRepository.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IConfigurationRepository +{ + SectionTypes SectionType { get; } + + Properties Load(); + + void AddChangeListener(IRepositoryChangeListener listener); + + void RemoveChangeListener(IRepositoryChangeListener listener); +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs new file mode 100644 index 000000000..3e96f0f72 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfiguration.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IMasaConfiguration +{ + public IConfiguration Local { get; } + + public IConfigurationApi ConfigurationApi { get; } +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs new file mode 100644 index 000000000..7a7f8ac50 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IMasaConfigurationBuilder.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IMasaConfigurationBuilder : IConfigurationBuilder +{ + IServiceCollection Services { get; } + + IConfiguration Configuration { get; } + + void AddRepository(IConfigurationRepository configurationRepository); + + void AddRelations(params ConfigurationRelationOptions[] relationOptions); +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs new file mode 100644 index 000000000..ded04a54a --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/IRepositoryChangeListener.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public interface IRepositoryChangeListener +{ + void OnRepositoryChange(SectionTypes sectionType, Properties newProperties); +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj new file mode 100644 index 000000000..e70c41401 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Masa.BuildingBlocks.Configuration.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs new file mode 100644 index 000000000..d43243275 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/ConfigurationRelationOptions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration.Options; + +public class ConfigurationRelationOptions +{ + public SectionTypes SectionType { get; set; } + + public string? ParentSection { get; set; } + + public string? Section { get; set; } = default!; + + /// + /// Object type of mapping node relationship + /// + public Type ObjectType { get; set; } = default!; +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs new file mode 100644 index 000000000..9f7f641e6 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/IMasaConfigurationOptions.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration.Options; + +/// +/// Automatic mapping relationship specification. +/// When ParentSection is Null or an empty string, the configuration will be mounted to the root node. +/// When Section is Null, the configuration will be mounted under the ParentSection node, and its node name is class name. +/// If Section is an empty string, it will be directly mounted under the ParentSection node +/// +public interface IMasaConfigurationOptions +{ + /// + /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType + /// + [JsonIgnore] + string? ParentSection { get; } + + /// + /// The section null means same as the class name, else load from the specify section + /// + [JsonIgnore] + string? Section { get; } + + [JsonIgnore] + SectionTypes SectionType { get; } +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs new file mode 100644 index 000000000..598f95251 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Options/MasaConfigurationOptions.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration.Options; +public abstract class MasaConfigurationOptions : IMasaConfigurationOptions +{ + /// + /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType + /// + [JsonIgnore] + public virtual string? ParentSection => null; + + /// + /// The section null means same as the class name, else load from the specify section + /// + [JsonIgnore] + public virtual string? Section => null; + + [JsonIgnore] + public abstract SectionTypes SectionType { get; } +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs new file mode 100644 index 000000000..088729dd1 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/Properties.cs @@ -0,0 +1,73 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public class Properties : IEquatable, IEquatable +{ + private readonly Dictionary _dict; + + public Properties() => _dict = new Dictionary(StringComparer.OrdinalIgnoreCase); + + public Properties(IDictionary? dictionary) => + _dict = dictionary == null + ? new Dictionary(StringComparer.OrdinalIgnoreCase) + : new Dictionary(dictionary, StringComparer.OrdinalIgnoreCase); + + public Properties(Properties source) => _dict = source._dict; + + public bool TryGetProperty(string key, [NotNullWhen(true)] out string? value) => _dict.TryGetValue(key, out value); + + public string? GetProperty(string key) + { + _dict.TryGetValue(key, out var result); + + return result; + } + + public ISet GetPropertyNames() => new HashSet(_dict.Keys); + + public override bool Equals(object? obj) + { + if (this is null ^ obj is null) return false; + + if (obj is Properties other) + { + return Equals(other); + } + else + { + return false; + } + } + + public bool Equals(Properties? newProperties) + { + if (newProperties == null) return false; + + return GetHashCode() == newProperties.GetHashCode(); + } + + public static bool operator ==(Properties? x, Properties? y) + { + if (x is null ^ y is null) return false; + + if (x is null) return true; + + return x.Equals(y); + } + + public static bool operator !=(Properties? x, Properties? y) + { + if (x is null ^ y is null) return false; + + if (x is null) return false; + + return !x.Equals(y); + } + + public override int GetHashCode() + { + return _dict.Select(key => key.Key + key.Value).Aggregate(0, (hashCode, next) => HashCode.Combine(hashCode, next)); + } +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs new file mode 100644 index 000000000..2a3086cf2 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/SectionTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public enum SectionTypes +{ + Local = 1, + ConfigurationApi +} diff --git a/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs new file mode 100644 index 000000000..e06845834 --- /dev/null +++ b/src/BuildingBlocks/Configuration/Masa.BuildingBlocks.Configuration/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Configuration.Options; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using System.Diagnostics.CodeAnalysis; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/IMapping.cs b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/IMapping.cs new file mode 100644 index 000000000..709f99c16 --- /dev/null +++ b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/IMapping.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Mapping; + +public interface IMapper +{ + TDestination Map(TSource source, MapOptions? options = null); + + TDestination Map(object source, MapOptions? options = null); + + TDestination Map(TSource source, TDestination destination, MapOptions? options = null); +} diff --git a/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Mapper.cs b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Mapper.cs new file mode 100644 index 000000000..567292ca2 --- /dev/null +++ b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Mapper.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Mapping; + +public sealed class Mapper +{ + public static Mapper? Instance { get; set; } + + private readonly IMapper _mapper; + + public Mapper(IServiceCollection services) => _mapper = services.BuildServiceProvider().GetRequiredService(); + + public TDestination Map(TSource source, MapOptions? options = null) + => _mapper.Map(source, options); + + public TDestination Map(object source, MapOptions? options = null) + => _mapper.Map(source, options); + + public TDestination Map(TSource source, TDestination destination, MapOptions? options = null) + => _mapper.Map(source, destination, options); +} diff --git a/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj new file mode 100644 index 000000000..a4d5434e8 --- /dev/null +++ b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Masa.BuildingBlocks.Data.Mapping.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs new file mode 100644 index 000000000..d51a933dd --- /dev/null +++ b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Options/Enum/MapMode.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Mapping.Options.Enum; + +/// +/// Mapping mode +/// Currently only shared mapping modes are supported +/// +public enum MapMode +{ + /// + /// Use global settings and update global settings (update nested mappings) + /// + Shared = 1, +} diff --git a/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs new file mode 100644 index 000000000..958c9b8ad --- /dev/null +++ b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/Options/MapOptions.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Mapping.Options; + +public class MapOptions +{ + public MapMode Mode { get; set; } +} diff --git a/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/_Imports.cs b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/_Imports.cs new file mode 100644 index 000000000..f9edf00cf --- /dev/null +++ b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.Mapping/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Mapping.Options; +global using Masa.BuildingBlocks.Data.Mapping.Options.Enum; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj new file mode 100644 index 000000000..12c5adf20 --- /dev/null +++ b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/Masa.BuildingBlocks.Data.MappingExtensions.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs new file mode 100644 index 000000000..1a6e92ff3 --- /dev/null +++ b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/ObjectExtensions.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public static class ObjectExtensions +{ + private static Mapper? _mapper; + private static Mapper GetMapper() => _mapper ??= Mapper.Instance ?? throw new Exception("Please use MapperFactory to initialize Mapper"); + + public static TDestination Map(this TSource source, MapOptions? options = null) + => GetMapper().Map(source, options); + + public static TDestination Map(this object obj, MapOptions? options = null) + => GetMapper().Map(obj, options); + + public static TDestination Map(this TSource source, TDestination destination, MapOptions? options = null) + => GetMapper().Map(source, destination, options); +} diff --git a/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs new file mode 100644 index 000000000..e7ac38dcf --- /dev/null +++ b/src/BuildingBlocks/Data/Mapping/Masa.BuildingBlocks.Data.MappingExtensions/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Mapping; +global using Masa.BuildingBlocks.Data.Mapping.Options; diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs new file mode 100644 index 000000000..2e1a2aeba --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/IDataFilter.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Contracts.DataFiltering; + +public interface IDataFilter +{ + IDisposable Enable() where TFilter : class; + + IDisposable Disable() where TFilter : class; + + bool IsEnabled() where TFilter : class; +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs new file mode 100644 index 000000000..b503daf17 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/DataFiltering/ISoftDelete.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Contracts.DataFiltering; + +public interface ISoftDelete +{ + bool IsDeleted { get; } +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj new file mode 100644 index 000000000..5a26be858 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/Masa.BuildingBlocks.Data.Contracts.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs new file mode 100644 index 000000000..8c25e5522 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/Paginated/BasePaginatedList.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Contracts.Paginated; + +public class BasePaginatedList + where TEntity : class +{ + public long Total { get; set; } + + public int TotalPages { get; set; } + + public List Result { get; set; } = default!; +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs new file mode 100644 index 000000000..b6f0781ac --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.Extensions.DependencyInjection; +global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs new file mode 100644 index 000000000..dd3593f96 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/CommitState.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public enum CommitState +{ + /// + /// A transaction is opened and the data has changed + /// + UnCommited, + /// + /// The transaction is not opened or the data has not changed + /// + Commited +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs new file mode 100644 index 000000000..cc77bf386 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/EntityState.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public enum EntityState +{ + UnChanged, + Changed +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs new file mode 100644 index 000000000..36ca7d1e8 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/ITransaction.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public interface ITransaction +{ + [JsonIgnore] + IUnitOfWork? UnitOfWork { get; set; } +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs new file mode 100644 index 000000000..e8f37cd4d --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWork.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public interface IUnitOfWork : IDisposable, IAsyncDisposable +{ + IServiceProvider ServiceProvider { get; } + + DbTransaction Transaction { get; } + + /// + /// Whether the transaction has been opened + /// + bool TransactionHasBegun { get; } + + /// + /// Whether to use transaction + /// + bool UseTransaction { get; set; } + + /// + /// Disable transaction rollback after failure + /// + bool DisableRollbackOnFailure { get; set; } + + EntityState EntityState { get; set; } + + CommitState CommitState { get; set; } + + Task SaveChangesAsync(CancellationToken cancellationToken = default); + + Task CommitAsync(CancellationToken cancellationToken = default); + + Task RollbackAsync(CancellationToken cancellationToken = default); + + /// + /// Provides support for enqueuing aggregate root realm events + /// + /// + /// + Task AddDomainEventAsync(TDomainEvent @event) where TDomainEvent : class; +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs new file mode 100644 index 000000000..fe830ba5a --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkAccessor.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public interface IUnitOfWorkAccessor +{ + /// + /// Only exists after the DbContext is confirmed to be created + /// + MasaDbContextConfigurationOptions? CurrentDbContextOptions { get; set; } +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs new file mode 100644 index 000000000..79a3d2e25 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/IUnitOfWorkManager.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.UoW; + +public interface IUnitOfWorkManager +{ + /// + /// Create new DbContext + /// We create DbContext with lazy loading enabled by default + /// + /// Deferred creation of DbContext, easy to specify tenant or environment by yourself, which is very effective for physical isolation + /// + IUnitOfWork CreateDbContext(bool lazyLoading = true); + + IUnitOfWork CreateDbContext(MasaDbContextConfigurationOptions dbContextOptions); +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj new file mode 100644 index 000000000..876b59650 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/Masa.BuildingBlocks.Data.UoW.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs new file mode 100644 index 000000000..a376a67ba --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.UoW/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Options; +global using System.Data.Common; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs new file mode 100644 index 000000000..b50c3b680 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/BaseDbConnectionStringProvider.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public abstract class BaseDbConnectionStringProvider : IDbConnectionStringProvider +{ + private readonly List? _dbContextOptionsList = null; + + public virtual List DbContextOptionsList => _dbContextOptionsList ?? GetDbContextOptionsList(); + + protected abstract List GetDbContextOptionsList(); +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs new file mode 100644 index 000000000..a34bdd2f3 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/DefaultConcurrencyStampProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public class DefaultConcurrencyStampProvider : IConcurrencyStampProvider +{ + public string GetRowVersion() => Guid.NewGuid().ToString(); +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs new file mode 100644 index 000000000..37968eaff --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/IConcurrencyStampProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IConcurrencyStampProvider +{ + string GetRowVersion(); +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs new file mode 100644 index 000000000..9d5647341 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Concurrency/IHasConcurrencyStamp.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IHasConcurrencyStamp +{ + string RowVersion { get; } +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs new file mode 100644 index 000000000..7d78706b7 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/ConnectionStringNameAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +[AttributeUsage(AttributeTargets.Class)] +public class ConnectionStringNameAttribute : Attribute +{ + public string Name { get; set; } + + public ConnectionStringNameAttribute(string name) => Name = name; + + public static string GetConnStringName() => GetConnStringName(typeof(T)); + + public static string GetConnStringName(Type type) + { + var nameAttribute = type.GetTypeInfo().GetCustomAttribute(); + + if (nameAttribute == null) + return ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME; + + return !string.IsNullOrEmpty(nameAttribute.Name) ? nameAttribute.Name : type.FullName!; + } +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs new file mode 100644 index 000000000..835b485c5 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/ConnectionStrings.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public class ConnectionStrings : Dictionary +{ + public const string DEFAULT_SECTION = "ConnectionStrings"; + + public const string DEFAULT_CONNECTION_STRING_NAME = "DefaultConnection"; + + public string DefaultConnection + { + get => GetConnectionString(DEFAULT_CONNECTION_STRING_NAME); + set => this[DEFAULT_CONNECTION_STRING_NAME] = value; + } + + public ConnectionStrings() { } + + public ConnectionStrings(IEnumerable> connectionStrings) : base(connectionStrings) { } + + public string GetConnectionString(string name) + { + if (base.TryGetValue(name, out var connectionString)) + return connectionString; + + return string.Empty; + } +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs new file mode 100644 index 000000000..40a1554fa --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Enum/SequentialGuidType.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public enum SequentialGuidType +{ + /// + /// The GUID should be sequential when formatted using the + /// Used by MySql and PostgreSql. + /// + SequentialAsString, + + /// + /// The GUID should be sequential when formatted using the + /// Used by Oracle. + /// + SequentialAsBinary, + + /// + /// The sequential portion of the GUID should be located at the end + /// of the Data4 block. + /// Used by SqlServer. + /// + SequentialAtEnd +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs new file mode 100644 index 000000000..e22189617 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Enum/TimestampType.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public enum TimestampType +{ + Milliseconds = 1, + Seconds +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs new file mode 100644 index 000000000..2b55934d4 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IConnectionStringProvider.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IConnectionStringProvider +{ + /// + /// Get Database Connection Strings based on ConnectionName + /// + /// + /// + Task GetConnectionStringAsync(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME); + + /// + /// Get Database Connection Strings based on ConnectionName + /// + /// + /// + string GetConnectionString(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME); +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs new file mode 100644 index 000000000..23e8e483a --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IDbConnectionStringProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IDbConnectionStringProvider +{ + List DbContextOptionsList { get; } +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs new file mode 100644 index 000000000..64a1ed9d1 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IDistributedLock.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IDistributedLock +{ + IDisposable? TryGet(string key, TimeSpan timeout = default); + + Task TryGetAsync(string key, TimeSpan timeout = default, CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs new file mode 100644 index 000000000..c3cac5b22 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IMasaDbContext.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IMasaDbContext : IDisposable, IAsyncDisposable +{ +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs new file mode 100644 index 000000000..0e6180fbf --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IGuidGenerator.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IGuidGenerator : IIdGenerator +{ +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs new file mode 100644 index 000000000..59e657e16 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IIdGenerator.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface IIdGenerator + where T : notnull + where TOut : notnull +{ + public TOut NewId(); +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs new file mode 100644 index 000000000..cb0c52148 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/ISequentialGuidGenerator.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface ISequentialGuidGenerator : IIdGenerator +{ + Guid Create(SequentialGuidType guidType); +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs new file mode 100644 index 000000000..3b04cb7b4 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/ISnowflakeGenerator.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public interface ISnowflakeGenerator : IIdGenerator +{ +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs new file mode 100644 index 000000000..ac34d991b --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/IdGenerator/IdGeneratorFactory.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public class IdGeneratorFactory +{ + private static IGuidGenerator? _guidGenerator; + public static IGuidGenerator GuidGenerator => _guidGenerator ?? throw new Exception($"Unsupported {nameof(GuidGenerator)}"); + + private static ISequentialGuidGenerator? _sequentialGuidGenerator; + public static ISequentialGuidGenerator SequentialGuidGenerator + => _sequentialGuidGenerator ?? throw new Exception($"Unsupported {nameof(SequentialGuidGenerator)}"); + + private static ISnowflakeGenerator? _snowflakeGenerator; + public static ISnowflakeGenerator SnowflakeGenerator + => _snowflakeGenerator ?? throw new Exception($"Unsupported {nameof(SnowflakeGenerator)}"); + + public static void SetGuidGenerator(IGuidGenerator guidGenerator) + { + ArgumentNullException.ThrowIfNull(guidGenerator, nameof(guidGenerator)); + _guidGenerator = guidGenerator; + } + + public static void SetSequentialGuidGenerator(ISequentialGuidGenerator sequentialGuidGenerator) + { + ArgumentNullException.ThrowIfNull(sequentialGuidGenerator, nameof(sequentialGuidGenerator)); + _sequentialGuidGenerator = sequentialGuidGenerator; + } + + public static void SetSnowflakeGenerator(ISnowflakeGenerator snowflakeGenerator) + { + ArgumentNullException.ThrowIfNull(snowflakeGenerator, nameof(snowflakeGenerator)); + _snowflakeGenerator = snowflakeGenerator; + } +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj new file mode 100644 index 000000000..d54911de3 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Masa.BuildingBlocks.Data.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs new file mode 100644 index 000000000..2bced1bca --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Options/MasaDbConnectionOptions.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data; + +public class MasaDbConnectionOptions +{ + private static readonly List> _connectionStrings = new(); + public ConnectionStrings ConnectionStrings { get; set; } + + public MasaDbConnectionOptions() + { + ConnectionStrings = new ConnectionStrings(_connectionStrings); + } + + public void TryAddConnectionString(string name, string connectionString) + { + if (_connectionStrings.All(item => item.Key != name)) + _connectionStrings.Add(new KeyValuePair(name, connectionString)); + } +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs new file mode 100644 index 000000000..3e32d3e29 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/Options/MasaDbContextConfigurationOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Data.Options; + +public class MasaDbContextConfigurationOptions +{ + public string ConnectionString { get; } + + public MasaDbContextConfigurationOptions(string connectionString) => ConnectionString = connectionString; +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs new file mode 100644 index 000000000..b0eb7ed86 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/System/SequentialGuid.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public readonly struct SequentialGuid +{ + +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs new file mode 100644 index 000000000..1e8ff2d9b --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/System/Snowflake.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public readonly struct Snowflake +{ + +} diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/_Imports.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/_Imports.cs new file mode 100644 index 000000000..5096951d3 --- /dev/null +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Options; +global using System.Reflection; diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj new file mode 100644 index 000000000..70f384749 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/Masa.BuildingBlocks.Ddd.Domain.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs new file mode 100644 index 000000000..e6a21820d --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/TestEntity.cs @@ -0,0 +1,64 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Tests; + +[TestClass] +public class TestEntity +{ + [TestMethod] + public void TestToString() + { + MasaEntity entity = new(Guid.Empty); + Assert.AreEqual("MasaEntity:Id=00000000-0000-0000-0000-000000000000", entity.ToString()); + } + + [TestMethod] + public void TestEquals() + { + var id = Guid.NewGuid(); + MasaEntity x = new(id); + MasaEntity y = new(id); + + Assert.IsTrue(x.Equals(y)); + Assert.IsTrue(x.Equals((object)y)); + } + + [TestMethod] + public void TestGetHashCode() + { + var id = Guid.NewGuid(); + MasaEntity x = new(id); + MasaEntity y = new(id); + + Assert.AreEqual(x.GetHashCode(), y.GetHashCode()); + } + + [TestMethod] + public void TestOperator() + { + var id = Guid.NewGuid(); + MasaEntity x = new(id); + MasaEntity y = new(id); + MasaEntity z = new(Guid.NewGuid()); + + Assert.IsTrue(x == y); + Assert.IsTrue(x != z); + + MasaEntity? m = null; + Assert.IsTrue(m == null); + Assert.IsTrue(null == m); + Assert.IsFalse(null != m); + Assert.IsFalse(m != null); + Assert.IsTrue(x != null); + Assert.IsTrue(null != x); + } + + public class MasaEntity : Entity + { + public MasaEntity(Guid id) + { + Id = id; + } + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs new file mode 100644 index 000000000..d2679ea25 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/TestValueObject.cs @@ -0,0 +1,52 @@ +using Masa.BuildingBlocks.Ddd.Domain.Values; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Tests; + +[TestClass] +public class TestValueObject +{ + [TestMethod] + public void TestEquals() + { + var id = Guid.NewGuid(); + MasaValueObject x = new() { Id = id }; + MasaValueObject y = new() { Id = id }; + + Assert.IsTrue(x.Equals(y)); + } + + [TestMethod] + public void TestGetHashCode() + { + var id = Guid.NewGuid(); + MasaValueObject x = new() { Id = id }; + MasaValueObject y = new() { Id = id }; + + Assert.AreEqual(x.GetHashCode(), y.GetHashCode()); + } + + [TestMethod] + public void TestOperator() + { + var id = Guid.NewGuid(); + MasaValueObject x = new() { Id = id }; + MasaValueObject y = new() { Id = id }; + MasaValueObject z = new() { Id = Guid.NewGuid() }; + + Assert.IsTrue(x == y); + Assert.IsTrue(x != z); + } + + public class MasaValueObject : ValueObject + { + public Guid Id { get; set; } + + protected override IEnumerable GetEqualityValues() + { + yield return Id; + } + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs new file mode 100644 index 000000000..fdacb3726 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain.Tests/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs new file mode 100644 index 000000000..48b1f709f --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/AggregateRoot.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public abstract class AggregateRoot : Entity, IAggregateRoot, IGenerateDomainEvents +{ + private readonly List _domainEvents = new(); + + public virtual void AddDomainEvent(IDomainEvent domainEvent) + { + _domainEvents.Add(domainEvent); + } + + public virtual void RemoveDomainEvent(IDomainEvent domainEvent) + { + _domainEvents.Remove(domainEvent); + } + + public virtual IEnumerable GetDomainEvents() + { + return _domainEvents; + } + + public void ClearDomainEvents() + { + _domainEvents.Clear(); + } + + public async Task PublishDomainEventsAsync(IDomainEventBus eventBus) + { + while (_domainEvents.Any()) + { + await eventBus.PublishAsync(_domainEvents.First()); + _domainEvents.RemoveAt(0); + } + } +} + +public abstract class AggregateRoot : Entity, IAggregateRoot, IGenerateDomainEvents +{ + private readonly List _domainEvents = new(); + + public AggregateRoot() : base() + { + } + + public AggregateRoot(TKey id) : base(id) + { + } + + public virtual void AddDomainEvent(IDomainEvent domainEvent) + { + _domainEvents.Add(domainEvent); + } + + public virtual void RemoveDomainEvent(IDomainEvent domainEvent) + { + _domainEvents.Remove(domainEvent); + } + + public virtual IEnumerable GetDomainEvents() + { + return _domainEvents; + } + + public void ClearDomainEvents() + { + _domainEvents.Clear(); + } + + public async Task PublishDomainEventsAsync(IDomainEventBus eventBus) + { + while (_domainEvents.Any()) + { + await eventBus.PublishAsync(_domainEvents.First()); + _domainEvents.RemoveAt(0); + } + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs new file mode 100644 index 000000000..7730550e4 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditAggregateRoot.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; + +public abstract class AuditAggregateRoot : AggregateRoot, IAuditAggregateRoot +{ + public TUserId Creator { get; protected set; } = default!; + + public DateTime CreationTime { get; protected set; } + + public TUserId Modifier { get; protected set; } = default!; + + public DateTime ModificationTime { get; set; } + + public AuditAggregateRoot() => Initialize(); + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + this.ModificationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; +} + +public abstract class AuditAggregateRoot : AggregateRoot, IAuditAggregateRoot +{ + public TUserId Creator { get; protected set; } = default!; + + public DateTime CreationTime { get; protected set; } + + public TUserId Modifier { get; protected set; } = default!; + + public DateTime ModificationTime { get; protected set; } + + public AuditAggregateRoot() : base() + { + Initialize(); + } + + public AuditAggregateRoot(TKey id) : base(id) + { + Initialize(); + } + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + this.ModificationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs new file mode 100644 index 000000000..cee548d09 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/AuditEntity.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; + +public abstract class AuditEntity : Entity, IAuditEntity +{ + public TUserId Creator { get; protected set; } = default!; + + public DateTime CreationTime { get; protected set; } + + public TUserId Modifier { get; protected set; } = default!; + + public DateTime ModificationTime { get; set; } + + public AuditEntity() => Initialize(); + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + this.ModificationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; +} + +public abstract class AuditEntity : Entity, IAuditEntity +{ + public TUserId Creator { get; protected set; } = default!; + + public DateTime CreationTime { get; protected set; } + + public TUserId Modifier { get; protected set; } = default!; + + public DateTime ModificationTime { get; protected set; } + + public AuditEntity() : base() + { + Initialize(); + } + + public AuditEntity(TKey id) : base(id) + { + Initialize(); + } + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + this.ModificationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs new file mode 100644 index 000000000..653f21d20 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditAggregateRoot.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; + +public interface IAuditAggregateRoot : IAuditEntity, IAggregateRoot +{ + +} + +public interface IAuditAggregateRoot : IAuditEntity, IAggregateRoot +{ + +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs new file mode 100644 index 000000000..af78ad9b6 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Auditing/IAuditEntity.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; + +public interface IAuditEntity : IEntity +{ + TUserId Creator { get; } + + DateTime CreationTime { get; } + + TUserId Modifier { get; } + + DateTime ModificationTime { get; } +} + +public interface IAuditEntity : IAuditEntity, IEntity +{ +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs new file mode 100644 index 000000000..125e7a35d --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Entity.cs @@ -0,0 +1,78 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public abstract class Entity : IEntity, IEquatable, IEquatable +{ + public abstract IEnumerable<(string Name, object Value)> GetKeys(); + + /// + public override string ToString() + { + var keys = GetKeys().ToArray(); + string connector = keys.Length > 1 ? Environment.NewLine : string.Empty; + + return $"{GetType().Name}:{connector}{string.Join(Environment.NewLine, keys.Select(key => $"{key.Name}={key.Value}"))}"; + } + + public override bool Equals(object? obj) + { + if (this is null ^ obj is null) return false; + + if (obj is Entity other) + { + return other.GetKeys().Select(key => key.Value).SequenceEqual(GetKeys().Select(key => key.Value)); + } + else + { + return false; + } + } + + public bool Equals(Entity? other) + { + if (this is null ^ other is null) return false; + + return other!.GetKeys().Select(key => key.Value).SequenceEqual(GetKeys().Select(key => key.Value)); + } + + public override int GetHashCode() + { + return GetKeys().Select(key => key.Value).Aggregate(0, (hashCode, next) => HashCode.Combine(hashCode, next)); + } + + public static bool operator ==(Entity? x, Entity? y) + { + if (x is null ^ y is null) return false; + + if (x is null) return true; + + return x.Equals(y); + } + + public static bool operator !=(Entity? x, Entity? y) + { + if (x is null ^ y is null) return true; + + if (x is null) return false; + + return !x.Equals(y); + } +} + +public abstract class Entity : Entity, IEntity +{ + public TKey Id { get; protected set; } = default!; + + protected Entity() + { + } + + protected Entity(TKey id) : this() => Id = id; + + public override IEnumerable<(string Name, object Value)> GetKeys() + { + yield return ("Id", Id!); + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs new file mode 100644 index 000000000..79b0b08bb --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullAggregateRoot.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; + +public abstract class FullAggregateRoot + : AuditAggregateRoot, IFullAggregateRoot +{ + public bool IsDeleted { get; protected set; } +} + +public abstract class FullAggregateRoot + : AuditAggregateRoot, IFullAggregateRoot +{ + public bool IsDeleted { get; protected set; } + + public FullAggregateRoot() : base() + { + } + + public FullAggregateRoot(TKey id) : base(id) + { + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs new file mode 100644 index 000000000..86e51d88b --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/FullEntity.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; + +public abstract class FullEntity + : AuditEntity, IFullEntity +{ + public bool IsDeleted { get; protected set; } +} + +public abstract class FullEntity + : AuditEntity, IFullEntity +{ + public bool IsDeleted { get; protected set; } + + public FullEntity() : base() + { + } + + public FullEntity(TKey id) : base(id) + { + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs new file mode 100644 index 000000000..2e2be7c5c --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullAggregateRoot.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; + +public interface IFullAggregateRoot : IFullEntity, IAuditAggregateRoot +{ + +} + +public interface IFullAggregateRoot : IFullEntity, IAuditAggregateRoot +{ + +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs new file mode 100644 index 000000000..fdcfa99bb --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/Full/IFullEntity.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities.Full; + +public interface IFullEntity : IAuditEntity, ISoftDelete +{ + +} + +public interface IFullEntity : IAuditEntity, ISoftDelete +{ + +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs new file mode 100644 index 000000000..bcb3af683 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IAggregateRoot.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public interface IAggregateRoot : IEntity +{ + +} + +public interface IAggregateRoot : IEntity, IAggregateRoot +{ + +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs new file mode 100644 index 000000000..2d497da0c --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IEntity.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public interface IEntity +{ + IEnumerable<(string Name, object Value)> GetKeys(); +} + +public interface IEntity : IEntity +{ + TKey Id { get; } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs new file mode 100644 index 000000000..d9cb031b2 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Entities/IGenerateDomainEvents.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Entities; + +public interface IGenerateDomainEvents +{ + IEnumerable GetDomainEvents(); + + void ClearDomainEvents(); +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs new file mode 100644 index 000000000..4379070f7 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainCommand.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public abstract record DomainCommand : IDomainCommand +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + public DomainCommand() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public DomainCommand(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs new file mode 100644 index 000000000..403b43267 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainEvent.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public abstract record DomainEvent : IDomainEvent +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + public DomainEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public DomainEvent(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs new file mode 100644 index 000000000..577dc6a0b --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public abstract record DomainQuery : IDomainQuery + where TResult : notnull +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork + { + get => null; + set => throw new NotSupportedException(nameof(UnitOfWork)); + } + + public abstract TResult Result { get; set; } + + public DomainQuery() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public DomainQuery(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs new file mode 100644 index 000000000..30fb5801b --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainCommand.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IDomainCommand : ICommand, IDomainEvent +{ + +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs new file mode 100644 index 000000000..ef591fa07 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEvent.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IDomainEvent : IEvent, ITransaction +{ + +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs new file mode 100644 index 000000000..f34878152 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainEventBus.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IDomainEventBus : IEventBus +{ + Task Enqueue(TDomainEvent @event) + where TDomainEvent : IDomainEvent; + + Task PublishQueueAsync(); + + Task AnyQueueAsync(); +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs new file mode 100644 index 000000000..b265889fd --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IDomainQuery : IDomainEvent, IQuery + where TResult : notnull +{ + +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs new file mode 100644 index 000000000..3e5864c70 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IIntegrationDomainEvent.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public interface IIntegrationDomainEvent : IDomainEvent, IIntegrationEvent +{ + +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs new file mode 100644 index 000000000..5222a9c10 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IntegrationDomainEvent.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Events; + +public abstract record IntegrationDomainEvent(Guid Id, DateTime CreationTime) : DomainEvent(Id, CreationTime), IIntegrationDomainEvent +{ + [JsonIgnore] + public abstract string Topic { get; set; } + + public IntegrationDomainEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj new file mode 100644 index 000000000..541a26d5b --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Masa.BuildingBlocks.Ddd.Domain.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs new file mode 100644 index 000000000..549704fc3 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/BaseRepository.cs @@ -0,0 +1,163 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; + +public abstract class BaseRepository : + IRepository + where TEntity : class, IEntity +{ + public IServiceProvider ServiceProvider { get; } + + public virtual EntityState EntityState + { + get => UnitOfWork.EntityState; + set => UnitOfWork.EntityState = value; + } + + public virtual CommitState CommitState + { + get => UnitOfWork.CommitState; + protected set => UnitOfWork.CommitState = value; + } + + protected BaseRepository(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; + + public abstract IUnitOfWork UnitOfWork { get; } + + #region IRepository + + public abstract ValueTask AddAsync(TEntity entity, CancellationToken cancellationToken = default); + + public virtual async Task AddRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await AddAsync(entity, cancellationToken); + } + } + + public abstract Task FindAsync(IEnumerable> keyValues, CancellationToken cancellationToken = default); + + public abstract Task FindAsync(Expression> predicate, CancellationToken cancellationToken = default); + + public abstract Task RemoveAsync(TEntity entity, CancellationToken cancellationToken = default); + + public abstract Task RemoveAsync(Expression> predicate, CancellationToken cancellationToken = default); + + public virtual async Task RemoveRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await RemoveAsync(entity, cancellationToken); + } + } + + public abstract Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default); + + public virtual async Task UpdateRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) + { + foreach (var entity in entities) + { + await UpdateAsync(entity, cancellationToken); + } + } + + public abstract Task> GetListAsync(CancellationToken cancellationToken = default); + + public abstract Task> GetListAsync(string sortField, bool isDescending = true, CancellationToken cancellationToken = default); + + public abstract Task> GetListAsync(Expression> predicate, CancellationToken cancellationToken = default); + + public abstract Task> GetListAsync(Expression> predicate, string sortField, bool isDescending = true, CancellationToken cancellationToken = default); + + public abstract Task GetCountAsync(CancellationToken cancellationToken = default); + + public abstract Task GetCountAsync(Expression> predicate, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + public abstract Task> GetPaginatedListAsync(int skip, int take, string sortField, bool isDescending, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + public abstract Task> GetPaginatedListAsync(int skip, int take, Dictionary? sorting = null, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + public abstract Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, string sortField, + bool isDescending = true, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + public abstract Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, Dictionary? sorting = null, CancellationToken cancellationToken = default); + + public virtual async Task> GetPaginatedListAsync(PaginatedOptions options, CancellationToken cancellationToken = default) + { + var result = await GetPaginatedListAsync( + (options.Page - 1) * options.PageSize, + options.PageSize <= 0 ? int.MaxValue : options.PageSize, + options.Sorting, + cancellationToken + ); + + var total = await GetCountAsync(cancellationToken); + + return new PaginatedList() + { + Total = total, + Result = result, + TotalPages = (int)Math.Ceiling(total / (decimal)options.PageSize) + }; + } + + public async Task> GetPaginatedListAsync(Expression> predicate, PaginatedOptions options, CancellationToken cancellationToken = default) + { + var result = await GetPaginatedListAsync( + predicate, + (options.Page - 1) * options.PageSize, + options.PageSize <= 0 ? int.MaxValue : options.PageSize, + options.Sorting, + cancellationToken + ); + + var total = await GetCountAsync(predicate, cancellationToken); + + return new PaginatedList() + { + Total = total, + Result = result, + TotalPages = (int)Math.Ceiling(total / (decimal)options.PageSize) + }; + } + + #endregion +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs new file mode 100644 index 000000000..6867b9443 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/IRepository.cs @@ -0,0 +1,132 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; + +public interface IRepository + where TEntity : class, IEntity +{ + IUnitOfWork UnitOfWork { get; } + + #region Add + + ValueTask AddAsync(TEntity entity, CancellationToken cancellationToken = default); + + Task AddRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default); + + #endregion + + #region Update + + Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default); + + Task UpdateRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default); + + #endregion + + #region Remove + + Task RemoveAsync(TEntity entity, CancellationToken cancellationToken = default); + + Task RemoveRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default); + + Task RemoveAsync(Expression> predicate, CancellationToken cancellationToken = default); + + #endregion + + #region Find + + Task FindAsync(IEnumerable> keyValues, CancellationToken cancellationToken = default); + + Task FindAsync(Expression> predicate, CancellationToken cancellationToken = default); + + #endregion + + #region Get + + Task> GetListAsync(CancellationToken cancellationToken = default); + + Task> GetListAsync(string sortField, bool isDescending = true, CancellationToken cancellationToken = default); + + Task> GetListAsync(Expression> predicate, CancellationToken cancellationToken = default); + + Task> GetListAsync(Expression> predicate, string sortField, bool isDescending = true, CancellationToken cancellationToken = default); + + Task GetCountAsync(CancellationToken cancellationToken = default); + + Task GetCountAsync(Expression> predicate, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + Task> GetPaginatedListAsync(int skip, int take, string sortField, bool isDescending = true, + CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + Task> GetPaginatedListAsync(int skip, int take, Dictionary? sorting = null, + CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, string sortField, + bool isDescending = true, CancellationToken cancellationToken = default); + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, + Dictionary? sorting = null, CancellationToken cancellationToken = default); + + Task> GetPaginatedListAsync(PaginatedOptions options, CancellationToken cancellationToken = default); + + Task> GetPaginatedListAsync(Expression> predicate, PaginatedOptions options, + CancellationToken cancellationToken = default); + + #endregion +} + +public interface IRepository : IRepository + where TEntity : class, IEntity + where TKey : IComparable +{ + #region Find + + Task FindAsync(TKey id, CancellationToken cancellationToken = default); + + #endregion + + #region Remove + + Task RemoveAsync(TKey id, CancellationToken cancellationToken = default); + + Task RemoveRangeAsync(IEnumerable ids, CancellationToken cancellationToken = default); + + #endregion +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs new file mode 100644 index 000000000..df089f229 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedList.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; + +public class PaginatedList : BasePaginatedList + where TEntity : class, IEntity +{ +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs new file mode 100644 index 000000000..90d921394 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Repositories/PaginatedOptions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Repositories; + +public class PaginatedOptions +{ + public int Page { get; set; } + + public int PageSize { get; set; } + + public Dictionary? Sorting { get; set; } + + public PaginatedOptions() + { + } + + public PaginatedOptions(int page, int pageSize, Dictionary? sorting = null) + { + Page = page; + PageSize = pageSize; + Sorting = sorting; + } + + /// + /// Initialize a new instance of PaginatedOptions. + /// + /// page number + /// returns per page + /// sort field name + /// true descending order, false ascending order, default: true + public PaginatedOptions(int page, int pageSize, string sortField, bool isDescending = true) + : this(page, pageSize, new Dictionary(new List> { new(sortField, isDescending) })) + { + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs new file mode 100644 index 000000000..3fa9753c9 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/SeedWork/Enumeration.cs @@ -0,0 +1,72 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.SeedWork; + +/// +/// Reference from https://docs.microsoft.com/zh-cn/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types +/// +public abstract class Enumeration : IComparable +{ + public string Name { get; private set; } + + public int Id { get; private set; } + + protected Enumeration(int id, string name) => (Id, Name) = (id, name); + + public override string ToString() => Name; + + public static IEnumerable GetAll() + where T : Enumeration + { + return typeof(T).GetFields(BindingFlags.Public | + BindingFlags.Static | + BindingFlags.DeclaredOnly) + .Select(f => f.GetValue(null)) + .Cast(); + } + + public override bool Equals(object? obj) + { + if (obj is not Enumeration otherValue) + { + return false; + } + + if (this is null ^ obj is null) return false; + + var typeMatches = GetType().Equals(obj!.GetType()); + var valueMatches = Id.Equals(otherValue.Id); + + return typeMatches && valueMatches; + } + + public override int GetHashCode() => Id.GetHashCode(); + + public static int AbsoluteDifference(Enumeration firstValue, Enumeration secondValue) + { + return Math.Abs(firstValue.Id - secondValue.Id); + } + + public static T FromValue(int value) where T : Enumeration + { + return Parse(value, "value", item => item.Id == value); + } + + public static T FromDisplayName(string displayName) where T : Enumeration + { + return Parse(displayName, "display name", item => item.Name == displayName); + } + + private static T Parse(K value, string description, Func predicate) where T : Enumeration + { + var matchingItem = GetAll().FirstOrDefault(predicate); + + if (matchingItem == null) + throw new InvalidOperationException($"'{value}' is not a valid {description} in {typeof(T)}"); + + return matchingItem; + } + + public int CompareTo(object? other) => Id.CompareTo(((Enumeration?)other)?.Id); +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs new file mode 100644 index 000000000..cbb9b30e9 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Services/IDomainService.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Services; + +public interface IDomainService +{ + IDomainEventBus EventBus { get; } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs new file mode 100644 index 000000000..c494285c8 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Specifications/BaseSpecification.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Specifications; + +public abstract class BaseSpecification : ISpecification +{ + public BaseSpecification(Expression> whereExpression) + { + WhereExpression = whereExpression; + } + public Expression> WhereExpression { get; } + + public List>> Includes { get; } = + new List>>(); + + public List IncludeStrings { get; } = new List(); + + public abstract bool IsSatisfiedBy(T obj); + + protected virtual void AddInclude(Expression> includeExpression) + { + Includes.Add(includeExpression); + } + + protected virtual void AddInclude(string includeString) + { + IncludeStrings.Add(includeString); + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs new file mode 100644 index 000000000..34b14a8dd --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Specifications/ISpecification.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Specifications; + +/// +/// Reference from +/// https://docs.microsoft.com/zh-cn/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/infrastructure-persistence-layer-implementation-entity-framework-core +/// https://martinfowler.com/apsupp/spec.pdf +/// +public interface ISpecification +{ + bool IsSatisfiedBy(T obj); + + Expression> WhereExpression { get; } + + List>> Includes { get; } + + List IncludeStrings { get; } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs new file mode 100644 index 000000000..35bd261a2 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Values/ValueObject.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Ddd.Domain.Values; + +public abstract class ValueObject +{ + protected abstract IEnumerable GetEqualityValues(); + + public override bool Equals(object? obj) + { + if (this is null ^ obj is null) return false; + + if (obj is ValueObject entity) + { + return entity.GetEqualityValues().SequenceEqual(GetEqualityValues()); + } + else + { + return false; + } + } + + public override int GetHashCode() + { + return GetEqualityValues().Aggregate(0, (hashCode, next) => HashCode.Combine(hashCode, next)); + } + + public static bool operator ==(ValueObject x, ValueObject y) + { + return x.Equals(y); + } + + public static bool operator !=(ValueObject x, ValueObject y) + { + return !x.Equals(y); + } +} diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs new file mode 100644 index 000000000..dac97ea04 --- /dev/null +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/_Imports.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; +global using Masa.BuildingBlocks.Data.Contracts.Paginated; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; +global using Masa.BuildingBlocks.Ddd.Domain.Events; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; +global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; +global using System.Linq.Expressions; +global using System.Reflection; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs new file mode 100644 index 000000000..d559be44d --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Event.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public abstract record Event : IEvent +{ + private Guid _eventId; + private DateTime _creationTime; + + public Event() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public Event(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs new file mode 100644 index 000000000..964e9c59e --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IDispatcherOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IDispatcherOptions +{ + IServiceCollection Services { get; } + + Assembly[] Assemblies { get; } +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs new file mode 100644 index 000000000..f3893912d --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IEvent +{ + Guid GetEventId(); + + void SetEventId(Guid eventId); + + DateTime GetCreationTime(); + + void SetCreationTime(DateTime creationTime); +} + +public interface IEvent : IEvent + where TResult : notnull +{ + TResult Result { get; set; } +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs new file mode 100644 index 000000000..da39dd140 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBus.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IEventBus +{ + Task PublishAsync(TEvent @event) + where TEvent : IEvent; + + IEnumerable GetAllEventTypes(); + + Task CommitAsync(CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs new file mode 100644 index 000000000..820cb2504 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventBusBuilder.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IEventBusBuilder +{ + public IServiceCollection Services { get; } + + IEventBusBuilder UseMiddleware(Type middleware, ServiceLifetime middlewareLifetime = ServiceLifetime.Transient); +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs new file mode 100644 index 000000000..0039bc86e --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEventHandler.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface IEventHandler + where TEvent : IEvent +{ + Task HandleAsync(TEvent @event); +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs new file mode 100644 index 000000000..5e9eae264 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IMiddleware.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public delegate Task EventHandlerDelegate(); + +/// +/// Middleware is assembled into an event pipeline to handle invoke event and result +/// +public interface IMiddleware + where TEvent : IEvent +{ + Task HandleAsync(TEvent @event, EventHandlerDelegate next); + + /// + /// If Recursive is not supported, the current Middleware only executes once + /// If Recursive is supported, Middleware will be executed everytime when EventBus is nested + /// + bool SupportRecursive { get; } +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs new file mode 100644 index 000000000..be470b149 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/ISagaEventHandler.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public interface ISagaEventHandler : IEventHandler + where TEvent : IEvent +{ + Task CancelAsync(TEvent @event); +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj new file mode 100644 index 000000000..5a26be858 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Masa.BuildingBlocks.Dispatcher.Events.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs new file mode 100644 index 000000000..db37200da --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/Middleware.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.Events; + +public abstract class Middleware : IMiddleware where TEvent : IEvent +{ + public virtual bool SupportRecursive => true; + + public abstract Task HandleAsync(TEvent @event, EventHandlerDelegate next); +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs new file mode 100644 index 000000000..67285f175 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.Extensions.DependencyInjection; +global using System.Reflection; diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs new file mode 100644 index 000000000..468933d79 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IDistributedDispatcherOptions.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public interface IDistributedDispatcherOptions : IDispatcherOptions +{ +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs new file mode 100644 index 000000000..a31cf0f41 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEvent.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public interface IIntegrationEvent : IEvent, ITopic, ITransaction +{ +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs new file mode 100644 index 000000000..639364f3e --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IIntegrationEventBus.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public interface IIntegrationEventBus : IEventBus +{ + +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs new file mode 100644 index 000000000..c5792c4f8 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/ITopic.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public interface ITopic +{ + string Topic { get; set; } +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs new file mode 100644 index 000000000..297fcba1c --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEvent.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public abstract record IntegrationEvent : IIntegrationEvent +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + [JsonIgnore] + public abstract string Topic { get; set; } + + public IntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + protected IntegrationEvent(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs new file mode 100644 index 000000000..43f539830 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/IntegrationEventStates.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents; + +public enum IntegrationEventStates +{ + NotPublished = 0, + InProgress = 1, + Published = 2, + PublishedFailed = 3 +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs new file mode 100644 index 000000000..b07efc722 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IIntegrationEventLogService.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; + +public interface IIntegrationEventLogService +{ + /// + /// Get messages to retry + /// + /// The size of a single event to be retried + /// + /// default: 60s + /// + Task> RetrieveEventLogsFailedToPublishAsync(int retryBatchSize = 200, int maxRetryTimes = 10, int minimumRetryInterval = 60); + + Task SaveEventAsync(IIntegrationEvent @event, DbTransaction transaction); + + Task MarkEventAsPublishedAsync(Guid eventId); + + Task MarkEventAsInProgressAsync(Guid eventId); + + Task MarkEventAsFailedAsync(Guid eventId); + + /// + /// Delete successfully published and expired data + /// + /// + /// + /// + /// + Task DeleteExpiresAsync(DateTime expiresAt, int batchCount = 1000, CancellationToken token = default); +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs new file mode 100644 index 000000000..104851c9f --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Logs/IntegrationEventLog.cs @@ -0,0 +1,72 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; + +public class IntegrationEventLog : IHasConcurrencyStamp +{ + public Guid Id { get; private set; } + + public Guid EventId { get; private set; } + + public string EventTypeName { get; private set; } = null!; + + [NotMapped] + public string EventTypeShortName => EventTypeName.Split('.').Last(); + + [NotMapped] + public IIntegrationEvent Event { get; private set; } = null!; + + public IntegrationEventStates State { get; set; } = IntegrationEventStates.NotPublished; + + public int TimesSent { get; set; } = 0; + + public DateTime CreationTime { get; private set; } + + public DateTime ModificationTime { get; set; } + + public string Content { get; private set; } = null!; + + public Guid TransactionId { get; private set; } = Guid.Empty; + + public string RowVersion { get; private set; } + + private IntegrationEventLog() + { + Id = Guid.NewGuid(); + Initialize(); + } + + public IntegrationEventLog(IIntegrationEvent @event, Guid transactionId) : this() + { + EventId = @event.GetEventId(); + CreationTime = @event.GetCreationTime(); + ModificationTime = @event.GetCreationTime(); + EventTypeName = @event.GetType().FullName!; + Content = System.Text.Json.JsonSerializer.Serialize((object)@event); + TransactionId = transactionId; + } + + public void Initialize() + { + this.CreationTime = this.GetCurrentTime(); + } + + public virtual DateTime GetCurrentTime() => DateTime.UtcNow; + + public IntegrationEventLog DeserializeJsonContent(Type type) + { + Event = (System.Text.Json.JsonSerializer.Deserialize(Content, type) as IIntegrationEvent)!; + Event?.SetEventId(this.EventId); + Event?.SetCreationTime(this.CreationTime); + return this; + } + + public void SetRowVersion(string rowVersion) + { + if (string.IsNullOrEmpty(rowVersion)) + throw new ArgumentNullException(nameof(rowVersion)); + + RowVersion = rowVersion; + } +} diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj new file mode 100644 index 000000000..c530b0d9f --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/Masa.BuildingBlocks.Dispatcher.IntegrationEvents.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs new file mode 100644 index 000000000..e33e8f784 --- /dev/null +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.IntegrationEvents/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using System.ComponentModel.DataAnnotations.Schema; +global using System.Data.Common; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs new file mode 100644 index 000000000..920f7451a --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Environment; + +public interface IEnvironmentContext +{ + string CurrentEnvironment { get; } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs new file mode 100644 index 000000000..db701075f --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IEnvironmentSetter.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Environment; + +public interface IEnvironmentSetter +{ + void SetEnvironment(string environment); +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs new file mode 100644 index 000000000..e86cceb23 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Environment/IMultiEnvironment.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Environment; + +public interface IMultiEnvironment +{ + /// + /// The framework is responsible for the assignment operation, no manual assignment is required + /// + public string Environment { get; set; } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs new file mode 100644 index 000000000..f9aed3942 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IConvertProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation; + +public interface IConvertProvider +{ + object ChangeType(string value, Type conversionType); +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs new file mode 100644 index 000000000..8e2c89760 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IIsolation.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation; + +public interface IIsolation : IMultiTenant, IMultiEnvironment + where TKey : IComparable +{ +} + +public interface IIsolation : IIsolation +{ +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs new file mode 100644 index 000000000..918e3b41e --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IIsolationBuilder.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation; + +public interface IIsolationBuilder +{ + IServiceCollection Services { get; } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs new file mode 100644 index 000000000..de646ff37 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/IParserProvider.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation; + +public interface IParserProvider +{ + string Name { get; } + + Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action); +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj new file mode 100644 index 000000000..efde41b45 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Masa.BuildingBlocks.Isolation.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs new file mode 100644 index 000000000..e14fea629 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Middleware/IIsolationMiddleware.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Middleware; + +public interface IIsolationMiddleware +{ + Task HandleAsync(); +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs new file mode 100644 index 000000000..638f693fb --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/IMultiTenant.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.MultiTenant; + +public interface IMultiTenant : IMultiTenant +{ +} + +public interface IMultiTenant where TKey : IComparable +{ + /// + /// The framework is responsible for the assignment operation, no manual assignment is required + /// + public TKey TenantId { get; set; } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs new file mode 100644 index 000000000..6d5eddb8a --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.MultiTenant; + +public interface ITenantContext +{ + Tenant? CurrentTenant { get; } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs new file mode 100644 index 000000000..f8cca629f --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/ITenantSetter.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.MultiTenant; + +public interface ITenantSetter +{ + void SetTenant(Tenant? tenant); +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs new file mode 100644 index 000000000..6fdbde873 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/MultiTenant/Tenant.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.MultiTenant; + +public class Tenant +{ + public string Id { get; set; } + + public Tenant(object id) : this(id?.ToString() ?? throw new ArgumentNullException(nameof(id))) + { + } + + public Tenant(string id) + { + if (string.IsNullOrEmpty(id)) + throw new ArgumentNullException(nameof(id)); + + Id = id; + } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs new file mode 100644 index 000000000..91cfdff63 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationDbConnectionOptions.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Options; + +public class IsolationDbConnectionOptions : MasaDbConnectionOptions +{ + public List IsolationConnectionStrings { get; set; } = new(); +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs new file mode 100644 index 000000000..b9d7078dc --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Options/IsolationOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Options; + +public class IsolationOptions +{ + public string TenantId { get; set; } + + public string Environment { get; set; } + + public string Name { get; set; } = string.Empty; + + public string ConnectionString { get; set; } + + /// + /// Used to control the configuration with the highest score when multiple configurations are satisfied. The default score is 100 + /// + public int Score { get; set; } = 100; +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs new file mode 100644 index 000000000..e27f005e4 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/CookieParserProvider.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class CookieParserProvider : IParserProvider +{ + public string Name => "Cookie"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (httpContext?.Request.Cookies.ContainsKey(key) ?? false) + { + var value = httpContext.Request.Cookies[key]; + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs new file mode 100644 index 000000000..7e50d1da0 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/EnvironmentVariablesParserProvider.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class EnvironmentVariablesParserProvider : IParserProvider +{ + public string Name { get; } = "EnvironmentVariables"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + string? value = System.Environment.GetEnvironmentVariable(key); + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs new file mode 100644 index 000000000..c471328c9 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/FormParserProvider.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class FormParserProvider : IParserProvider +{ + public string Name => "Form"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (!(httpContext?.Request.HasFormContentType ?? false)) + return Task.FromResult(false); + + if (httpContext?.Request.Form.ContainsKey(key) ?? false) + { + var value = httpContext.Request.Form[key].ToString(); + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs new file mode 100644 index 000000000..4149c3165 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/HeaderParserProvider.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class HeaderParserProvider : IParserProvider +{ + public string Name => "Header"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (httpContext?.Request.Headers.ContainsKey(key) ?? false) + { + var value = httpContext.Request.Headers[key].ToString(); + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs new file mode 100644 index 000000000..76dbbfd9a --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/HttpContextItemParserProvider.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class HttpContextItemParserProvider : IParserProvider +{ + public string Name => "Items"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (httpContext?.Items.ContainsKey(key) ?? false) + { + var value = httpContext.Items[key]?.ToString() ?? string.Empty; + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs new file mode 100644 index 000000000..c76c2b904 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/QueryStringParserProvider.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class QueryStringParserProvider : IParserProvider +{ + public string Name => "QueryString"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + if (httpContext?.Request.Query.ContainsKey(key) ?? false) + { + var value = httpContext.Request.Query[key].ToString(); + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + } + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs new file mode 100644 index 000000000..34b637282 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/Parser/RouteParserProvider.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Isolation.Parser; + +public class RouteParserProvider : IParserProvider +{ + public string Name => "Route"; + + public Task ResolveAsync(IServiceProvider serviceProvider, string key, Action action) + { + var httpContext = serviceProvider.GetRequiredService().HttpContext; + var value = httpContext?.GetRouteValue(key)?.ToString() ?? string.Empty; + if (!string.IsNullOrEmpty(value)) + { + action.Invoke(value); + return Task.FromResult(true); + } + + return Task.FromResult(false); + } +} diff --git a/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs new file mode 100644 index 000000000..c998d2ac1 --- /dev/null +++ b/src/BuildingBlocks/Isolation/Masa.BuildingBlocks.Isolation/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Isolation.Environment; +global using Masa.BuildingBlocks.Isolation.MultiTenant; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Routing; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs new file mode 100644 index 000000000..5408d26b6 --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/Command.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; + +public abstract record Command : ICommand +{ + private Guid _eventId; + private DateTime _creationTime; + + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + public Command() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public Command(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs new file mode 100644 index 000000000..b16f0ad3e --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommand.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; + +public interface ICommand : IEvent, ITransaction +{ +} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs new file mode 100644 index 000000000..59d6070e5 --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Commands/ICommandHandler.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; + +public interface ICommandHandler : IEventHandler + where TCommand : ICommand +{ +} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj new file mode 100644 index 000000000..2438d134a --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs new file mode 100644 index 000000000..c32c90b5b --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; + +public interface IQuery : IEvent + where TResult : notnull +{ +} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs new file mode 100644 index 000000000..2bcdb7e68 --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; + +public interface IQueryHandler : IEventHandler + where TCommand : IQuery where TResult : notnull +{ +} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs new file mode 100644 index 000000000..5f71f1b84 --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/Query.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; + +public abstract record Query : IQuery + where TResult : notnull +{ + private Guid _eventId; + private DateTime _creationTime; + + public abstract TResult Result { get; set; } + + public Query() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public Query(Guid eventId, DateTime creationTime) + { + _eventId = eventId; + _creationTime = creationTime; + } + + public Guid GetEventId() => _eventId; + + public void SetEventId(Guid eventId) => _eventId = eventId; + + public DateTime GetCreationTime() => _creationTime; + + public void SetCreationTime(DateTime creationTime) => _creationTime = creationTime; +} diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs new file mode 100644 index 000000000..212b5d65b --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing/Masa.BuildingBlocks.ReadWriteSpliting.EventSourcing.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs new file mode 100644 index 000000000..8175cc184 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/AutoCompleteDocument.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public class AutoCompleteDocument +{ + private string? _documentId; + + private string? _text; + + public string Text + { + get + { + return _text ??= GetText(); + } + init + { + if (value != null!) + _text = value; + } + } + + public AutoCompleteDocument() + { + } + + public AutoCompleteDocument(string text) : this() + { + Text = text; + } + + public virtual string GetDocumentId() => _documentId ??= Guid.NewGuid().ToString(); + + protected virtual string GetText() => string.Empty; +} + +public class AutoCompleteDocument : AutoCompleteDocument where TValue : notnull +{ + private string _id; + + public string Id + { + get + { + if (string.IsNullOrEmpty(_id)) + return Value?.ToString() ?? throw new ArgumentException("{Id} cannot be empty", nameof(Id)); + + return _id; + } + init + { + if (string.IsNullOrEmpty(value)) + throw new ArgumentException("{Id} cannot be empty", nameof(Id)); + + _id = value; + } + } + + public TValue Value { get; set; } + + public AutoCompleteDocument() + { + } + + public AutoCompleteDocument(string text, TValue value) + : this(value?.ToString() ?? throw new ArgumentException($"{value} cannot be empty", nameof(value)), text, value) + { + } + + public AutoCompleteDocument(string id, string text, TValue value) : this() + { + Id = id; + Text = text; + Value = value; + } + + public override string GetDocumentId() => Id; +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs new file mode 100644 index 000000000..7b7aafe35 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/BaseAutoCompleteClient.cs @@ -0,0 +1,96 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public abstract class BaseAutoCompleteClient : IAutoCompleteClient +{ + public virtual Task>> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) + => GetAsync(keyword, options, cancellationToken); + + public virtual Task>> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull + => GetAsync, TValue>(keyword, options, cancellationToken); + + public virtual Task> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument + => GetBySpecifyDocumentAsync(keyword, options, cancellationToken); + + public abstract Task> GetBySpecifyDocumentAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + public virtual Task SetAsync( + AutoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) + => SetAsync, Guid>(document, options, cancellationToken); + + public virtual Task SetAsync( + IEnumerable> documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) + => SetAsync, Guid>(documents, options, cancellationToken); + + public virtual Task SetAsync( + AutoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull + => SetAsync, TValue>(document, options, cancellationToken); + + public virtual Task SetAsync( + IEnumerable> documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull + => SetAsync, TValue>(documents, options, cancellationToken); + + public virtual Task SetAsync( + TAudoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument + => SetAsync(new List { document }, options, cancellationToken); + + public virtual Task SetAsync( + IEnumerable documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument + => SetBySpecifyDocumentAsync(documents, options, cancellationToken); + + public virtual Task SetBySpecifyDocumentAsync( + TAudoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument + => SetBySpecifyDocumentAsync(new List { document }, options, cancellationToken); + + public abstract Task SetBySpecifyDocumentAsync( + IEnumerable documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + + public abstract Task DeleteAsync(string id, CancellationToken cancellationToken = default); + + public virtual Task DeleteAsync(T id, CancellationToken cancellationToken = default) where T : IComparable + => DeleteAsync(id.ToString() ?? throw new ArgumentNullException($"{id} is not null", nameof(id)), cancellationToken); + + public abstract Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default); + + public virtual Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) + where T : IComparable + { + var type = typeof(T); + if (!type.IsPrimitive && type != typeof(Guid) && type != typeof(string)) + throw new NotSupportedException("Unsupported types, id only supports simple types or guid, string"); + + return DeleteAsync(ids.Select(id => id.ToString() ?? throw new ArgumentNullException($"{id} is not null", nameof(id))), + cancellationToken); + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs new file mode 100644 index 000000000..ba29aed29 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteClient.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public interface IAutoCompleteClient +{ + Task>> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default); + + Task>> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull; + + [Obsolete($"{nameof(GetAsync)} expired, please use {nameof(GetBySpecifyDocumentAsync)}")] + Task> GetAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) + where TAudoCompleteDocument : AutoCompleteDocument; + + Task> GetBySpecifyDocumentAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) + where TAudoCompleteDocument : AutoCompleteDocument; + + Task SetAsync( + AutoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default); + + Task SetAsync( + IEnumerable> documents, + SetOptions? options = null, + CancellationToken cancellationToken = default); + + Task SetAsync( + AutoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull; + + Task SetAsync( + IEnumerable> documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TValue : notnull; + + [Obsolete($"{nameof(SetAsync)} expired, please use {nameof(SetBySpecifyDocumentAsync)}")] + Task SetAsync( + TAudoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + [Obsolete($"{nameof(SetAsync)} expired, please use {nameof(SetBySpecifyDocumentAsync)}")] + Task SetAsync( + IEnumerable documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + Task SetBySpecifyDocumentAsync( + TAudoCompleteDocument document, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + Task SetBySpecifyDocumentAsync( + IEnumerable documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) where TAudoCompleteDocument : AutoCompleteDocument; + + Task DeleteAsync(string id, CancellationToken cancellationToken = default); + + Task DeleteAsync(T id, CancellationToken cancellationToken = default) where T : IComparable; + + Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default); + + Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) where T : IComparable; +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs new file mode 100644 index 000000000..77f5ed483 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/IAutoCompleteFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public interface IAutoCompleteFactory +{ + IAutoCompleteClient CreateClient(); + + IAutoCompleteClient CreateClient(string name); +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj new file mode 100644 index 000000000..ca62071d4 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Masa.BuildingBlocks.SearchEngine.AutoComplete.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs new file mode 100644 index 000000000..98e26886c --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/AutoCompleteOptions.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; + +public class AutoCompleteOptions +{ + public string Field { get; set; } + + private int _page; + + public int Page + { + get => _page; + set + { + if (value <= 0) + throw new ArgumentException($"{nameof(Page)} must be greater than 0", nameof(Page)); + + _page = value; + } + } + + private int _pageSize; + + public int PageSize + { + get => _pageSize; + set + { + if (value <= 0) + throw new ArgumentException($"{nameof(PageSize)} must be greater than 0", nameof(PageSize)); + + _pageSize = value; + } + } + + public SearchType? SearchType { get; } + + public AutoCompleteOptions(SearchType? searchType = null) + { + this.Field = "text"; + this.Page = 1; + this.PageSize = 10; + this.SearchType = searchType; + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs new file mode 100644 index 000000000..f74dd5010 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Options/SetOptions.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; + +public class SetOptions +{ + public bool IsOverride { get; set; } + + public SetOptions(bool isOverride = true) + { + IsOverride = isOverride; + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs new file mode 100644 index 000000000..9e6c2fcfb --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteMultiResponse.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class DeleteMultiResponse : ResponseBase +{ + public List Data { get; set; } + + public DeleteMultiResponse(bool isValid, string message) : base(isValid, message) + { + } + + public DeleteMultiResponse(bool isValid, string message, IEnumerable? data) : this(isValid, message) + { + ArgumentNullException.ThrowIfNull(data, nameof(data)); + + Data = data.ToList(); + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs new file mode 100644 index 000000000..fb3ad8895 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteRangeResponseItems.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class DeleteRangeResponseItems +{ + public string Id { get; } + + public bool IsValid { get; } + + public string Message { get; } + + public DeleteRangeResponseItems(string id, bool isValid, string message) + { + this.Id = id; + this.IsValid = isValid; + this.Message = message; + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs new file mode 100644 index 000000000..65df88c4e --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/DeleteResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class DeleteResponse : ResponseBase +{ + public DeleteResponse(bool isValid, string message) : base(isValid, message) + { + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs new file mode 100644 index 000000000..a02a7f7a4 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/GetResponse.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class GetResponse : ResponseBase + where TDropdownBox : AutoCompleteDocument +{ + public long Total { get; set; } + + public long TotalPages { get; set; } + + public List Data { get; set; } + + public GetResponse(bool isValid, string message) : base(isValid, message) + { + } + + public GetResponse(bool isValid, string message, IEnumerable data) : this(isValid, message) + { + ArgumentNullException.ThrowIfNull(data, nameof(data)); + + Data = data.ToList(); + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs new file mode 100644 index 000000000..6e3022ed0 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/ResponseBase.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class ResponseBase +{ + public bool IsValid { get; } + + public string Message { get; } + + public ResponseBase(bool isValid, string message) + { + IsValid = isValid; + Message = message; + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs new file mode 100644 index 000000000..53785a71e --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponse.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class SetResponse : ResponseBase +{ + public List Items { get; set; } + + public SetResponse(bool isValid, string message) : base(isValid, message) + { + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs new file mode 100644 index 000000000..bd03efdca --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/Response/SetResponseItems.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + +public class SetResponseItems +{ + public string Id { get; } + + public bool IsValid { get; } + + public string Message { get; } + + public SetResponseItems(string id, bool isValid, string message) + { + Id = id; + IsValid = isValid; + Message = message; + } +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs new file mode 100644 index 000000000..f481c2404 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/SearchType.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete; + +public enum SearchType +{ + Precise = 1, + Fuzzy = 2 +} diff --git a/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs new file mode 100644 index 000000000..ec81698cc --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Masa.BuildingBlocks.SearchEngine.AutoComplete/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; + diff --git a/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs new file mode 100644 index 000000000..a06a134da --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/CustomAutoCompleteClient.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests; + +public class CustomAutoCompleteClient : BaseAutoCompleteClient +{ + + public override Task> GetBySpecifyDocumentAsync(string keyword, AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SetBySpecifyDocumentAsync(IEnumerable documents, SetOptions? options = null, + CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task DeleteAsync(string id, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) + => Task.FromResult(new DeleteMultiResponse(true, "")); +} diff --git a/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj b/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj new file mode 100644 index 000000000..7eeab6225 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs b/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs new file mode 100644 index 000000000..f98407229 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/TestAutoCompleteClient.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests; + +[TestClass] +public class TestAutoCompleteClient +{ + [TestMethod] + public async Task TestDeleteMultiAsyncReturnSuccess() + { + var client = new CustomAutoCompleteClient(); + var response = await client.DeleteAsync(new[] { 1, 2 }); + Assert.IsTrue(response.IsValid); + + response = await client.DeleteAsync(new[] { "1", "2" }); + Assert.IsTrue(response.IsValid); + + response = await client.DeleteAsync(new[] { 1d, 2d }); + Assert.IsTrue(response.IsValid); + + response = await client.DeleteAsync(new[] { 1L, 2L }); + Assert.IsTrue(response.IsValid); + + response = await client.DeleteAsync(new[] { Guid.NewGuid(), Guid.NewGuid() }); + Assert.IsTrue(response.IsValid); + } +} diff --git a/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs b/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs new file mode 100644 index 000000000..b8cdf88c8 --- /dev/null +++ b/src/BuildingBlocks/SearchEngine/Tests/Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs new file mode 100644 index 000000000..a3963e6a7 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/AbstractCaller.cs @@ -0,0 +1,391 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public abstract class AbstractCaller : ICaller +{ + private readonly ITypeConvertor _typeConvertor; + public readonly IServiceProvider ServiceProvider; + + private IRequestMessage? _requestMessage; + private IResponseMessage? _responseMessage; + protected IRequestMessage RequestMessage => _requestMessage ??= ServiceProvider.GetRequiredService(); + protected IResponseMessage ResponseMessage => _responseMessage ??= ServiceProvider.GetRequiredService(); + + public AbstractCaller(IServiceProvider serviceProvider) + { + _typeConvertor = serviceProvider.GetRequiredService(); + ServiceProvider = serviceProvider; + } + + public virtual async Task SendAsync( + HttpRequestMessage request, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var response = await SendAsync(request, cancellationToken); + if (autoThrowUserFriendlyException) + await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + + return response; + } + + public abstract Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + public abstract Task CreateRequestAsync( + HttpMethod method, + string? methodName); + + public abstract Task CreateRequestAsync( + HttpMethod method, + string? methodName, + TRequest data); + + public abstract Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName); + request.Content = content; + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public abstract Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default); + + public abstract Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default) + where TResponse : IMessage, new(); + + public abstract Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage; + + public abstract Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage + where TResponse : IMessage, new(); + + public virtual async Task GetStringAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsStringAsync(cancellationToken); + } + + public virtual Task GetStringAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetStringAsync( + GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetStringAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetStringAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetByteArrayAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsByteArrayAsync(cancellationToken); + } + + public virtual Task GetByteArrayAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetByteArrayAsync( + GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetByteArrayAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetByteArrayAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetStreamAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsStreamAsync(cancellationToken); + } + + public virtual Task GetStreamAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetStreamAsync( + GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetStreamAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetStreamAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual Task GetAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Get, methodName, null, autoThrowUserFriendlyException, cancellationToken); + + public virtual Task GetAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetAsync( + string? methodName, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) where TRequest : class + { + HttpRequestMessage request = + await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data))); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = + await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertor.ConvertToKeyValuePairs(data))); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + Dictionary data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, data)); + return await SendAsync(request, cancellationToken); + } + + protected virtual string GetUrl(string? url, IEnumerable> properties) + { + url ??= string.Empty; + foreach (var property in properties) + { + string value = property.Value; + + url = !url.Contains("?") ? + $"{url}?{property.Key}={value}" : + $"{url}&{property.Key}={value}"; + } + + return url; + } + + public virtual Task PostAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Post, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PostAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PostAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PostAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task PatchAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Patch, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PatchAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Patch, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PatchAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PatchAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task PutAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Put, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PutAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PutAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PutAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task DeleteAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Delete, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task DeleteAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task DeleteAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task DeleteAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, cancellationToken); + } +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs new file mode 100644 index 000000000..6deb557ef --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/AddCallerExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public static class AddCallerExtensions +{ + public static void AddCaller(CallerOptions callerOptions, string name, bool isDefault, Func func) + { + if (callerOptions.Callers.Any(c => c.Name == name)) + throw new ArgumentException($"The caller name already exists, please change the name, the repeat name is {name}"); + + callerOptions.Callers.Add(new CallerRelationOptions(name, isDefault, func)); + } +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs new file mode 100644 index 000000000..e345d8d46 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/CallerBase.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public abstract class CallerBase +{ + public virtual string Name { get; set; } = string.Empty; + + protected CallerOptions CallerOptions { get; private set; } = default!; + + private ICaller? _caller; + + protected ICaller Caller => _caller ??= ServiceProvider.GetRequiredService().Create(Name); + + [Obsolete("CallerProvider has expired, please use Caller")] + protected ICaller CallerProvider => Caller; + + private IServiceProvider ServiceProvider { get; } + + protected CallerBase(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; + + public abstract void UseCallerExtension(); + + public void SetCallerOptions(CallerOptions options, string name) + { + CallerOptions = options; + if (string.IsNullOrEmpty(Name)) + Name = name; + } +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs new file mode 100644 index 000000000..c69510e3a --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ICaller.cs @@ -0,0 +1,219 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface ICaller +{ + Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpRequestMessage request, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default); + + Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default) + where TResponse : IMessage, new(); + + Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage; + + Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage + where TResponse : IMessage, new(); + + Task GetStringAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStringAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetStringAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetByteArrayAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetByteArrayAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetByteArrayAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStreamAsync(string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStreamAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetStreamAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + where TRequest : class; + + Task GetAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task GetAsync(string? methodName, Dictionary data, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task DeleteAsync(string? methodName, TRequest data, CancellationToken cancellationToken = default); + + Task DeleteAsync(string? methodName, object data, CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs new file mode 100644 index 000000000..cd2a0b49c --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ICallerFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface ICallerFactory +{ + ICaller Create(); + + ICaller Create(string name); +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs new file mode 100644 index 000000000..bcf6f4059 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/IRequestMessage.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface IRequestMessage +{ + Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage); + + Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data); +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs new file mode 100644 index 000000000..ffc42c0a6 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/IResponseMessage.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface IResponseMessage +{ + Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); + + Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs new file mode 100644 index 000000000..2b2e670d8 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/ITypeConvertor.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller; + +public interface ITypeConvertor +{ + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + [Obsolete("Use ConvertToKeyValuePairs instead")] + Dictionary ConvertToDictionary(TRequest request) where TRequest : class; + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class; +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj new file mode 100644 index 000000000..2e0c7dfd8 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Masa.BuildingBlocks.Service.Caller.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs new file mode 100644 index 000000000..010163cb6 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerFactoryOptions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller.Options; + +public class CallerFactoryOptions +{ + public readonly List Callers = new(); + + public JsonSerializerOptions? JsonSerializerOptions { get; set; } + + public string? RequestIdKey { get; set; } +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs new file mode 100644 index 000000000..63acc4048 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerOptions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller.Options; + +public class CallerOptions +{ + public readonly List Callers = new(); + + public IServiceCollection Services { get; } + + private Assembly[] _assemblies = AppDomain.CurrentDomain.GetAssemblies(); + + public Assembly[] Assemblies + { + get => _assemblies; + set + { + ArgumentNullException.ThrowIfNull(value, nameof(Assemblies)); + + _assemblies = value; + } + } + + public ServiceLifetime CallerLifetime { get; set; } + + public JsonSerializerOptions? JsonSerializerOptions { get; set; } + + public string? RequestIdKey { get; set; } + + public CallerOptions(IServiceCollection services) + { + Services = services; + CallerLifetime = ServiceLifetime.Scoped; + } +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs new file mode 100644 index 000000000..9a5b101fa --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/Options/CallerRelationOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Caller.Options; + +public class CallerRelationOptions +{ + public string Name { get; } = default!; + + public bool IsDefault { get; } + + public Func Func { get; } = default!; + + public CallerRelationOptions(string name, bool isDefault, Func func) + { + Name = name; + IsDefault = isDefault; + Func = func; + } +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs new file mode 100644 index 000000000..7d22b6607 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Caller/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Google.Protobuf; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Microsoft.Extensions.DependencyInjection; +global using System.Reflection; +global using System.Text.Json; diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs new file mode 100644 index 000000000..f9407964d --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseMessage.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Contracts; + +public class BaseMessage +{ + /// + /// Unique Identifier + /// + protected Guid _correlationId = Guid.NewGuid(); + + public Guid CorrelationId() => _correlationId; +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs new file mode 100644 index 000000000..d13057fe6 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseRequest.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Contracts; + +public abstract class BaseRequest : BaseMessage +{ +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs new file mode 100644 index 000000000..d901a1082 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/BaseResponse.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.Contracts; + +public abstract class BaseResponse : BaseMessage +{ + public BaseResponse(Guid correlationId) : base() + { + base._correlationId = correlationId; + } + + public BaseResponse() + { + } +} + +public abstract class BaseResponse : BaseResponse +{ + public T? Data { get; set; } + + public BaseResponse(Guid correlationId) + : base(correlationId) + { + } + + public BaseResponse() + { + } +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.Contracts/Masa.BuildingBlocks.Service.Contracts.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs new file mode 100644 index 000000000..7a159cc54 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/IService.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Service.MinimalAPIs; + +public interface IService +{ + WebApplication App { get; } + + IServiceCollection Services { get; } + + TService? GetService(); + + TService GetRequiredService() where TService : notnull; +} diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj new file mode 100644 index 000000000..1e1618a72 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/Masa.BuildingBlocks.Service.MinimalAPIs.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs new file mode 100644 index 000000000..aefd78f01 --- /dev/null +++ b/src/BuildingBlocks/Service/Masa.BuildingBlocks.Service.MinimalAPIs/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs new file mode 100644 index 000000000..09dc7e961 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/GenderTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; + +public enum GenderTypes +{ + Male = 1, + Female, +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs new file mode 100644 index 000000000..5662a2328 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/StaffTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; + +public enum StaffTypes +{ + InternalStaff = 1, + ExternalStaff +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs new file mode 100644 index 000000000..9a51a0fda --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/SubjectTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; + +public enum SubjectTypes +{ + User = 1, + Department, + Role, + Team, +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs new file mode 100644 index 000000000..dc6cc09df --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Enum/TeamTypes.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; + +public enum TeamTypes +{ + Normal = 1 +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Masa.BuildingBlocks.StackSdks.Auth.Contracts.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs new file mode 100644 index 000000000..03b2b2516 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddUserModel.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class AddUserModel +{ + public string Account { get; set; } + + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string? IdCard { get; set; } + + public string? CompanyName { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } + + public string? Password { get; set; } + + public GenderTypes Gender { get; set; } + + public AddUserModel() + { + Account = ""; + Name = ""; + } + + public AddUserModel(string account, string name) + { + Account = account; + Name = name; + } +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs new file mode 100644 index 000000000..1b94a7c70 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AddressValueModel.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class AddressValueModel +{ + public string Address { get; set; } + + public string? ProvinceCode { get; set; } + + public string? CityCode { get; set; } + + public string? DistrictCode { get; set; } + + public AddressValueModel() + { + Address = ""; + } + + public AddressValueModel(string address, string? provinceCode, string? cityCode, string? districtCode) + { + Address = address; + ProvinceCode = provinceCode; + CityCode = cityCode; + DistrictCode = districtCode; + } + + public override string ToString() + { + return Address; + } +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs new file mode 100644 index 000000000..6d15c2b6a --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/AppModel.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class AppModel +{ + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public string Identity { get; set; } = string.Empty; + + public string Tag { get; set; } = string.Empty; + + public int ProjectId { get; set; } + + public List Navs { get; set; } = new(); +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs new file mode 100644 index 000000000..486dcac30 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/CollectMenuModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class CollectMenuModel +{ + public Guid Value { get; set; } + + public string Text { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs new file mode 100644 index 000000000..188ab7033 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/DisableUserModel.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class DisableUserModel +{ + public string Account { get; set; } + + public DisableUserModel(string account) + { + Account = account; + } +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs new file mode 100644 index 000000000..5c6975e30 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/MenuModel.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class MenuModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public string Code { get; set; } + + public string Icon { get; set; } + + public string Url { get; set; } + + public List Children { get; set; } = new(); +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs new file mode 100644 index 000000000..911fca3c1 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/NavModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class NavModel +{ + public string Code { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public string Icon { get; set; } = string.Empty; + + public string Url { get; set; } = string.Empty; + + public List Children { get; set; } = new(); +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs new file mode 100644 index 000000000..08dda6f4f --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/ProjectModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class ProjectModel +{ + public int Id { get; set; } + + public string Name { get; set; } = string.Empty; + + public string Identity { get; set; } = string.Empty; + + public List Apps { get; set; } = new(); +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs new file mode 100644 index 000000000..8b35cee28 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/RoleModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class RoleModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs new file mode 100644 index 000000000..84203a467 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffDetailModel.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class StaffDetailModel: StaffModel +{ + public List Roles { get; set; } + + public List Teams { get; set; } + + public DateTime CreationTime { get; set; } + + public DateTime ModificationTime { get; set; } +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs new file mode 100644 index 000000000..f55e215ae --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/StaffModel.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class StaffModel +{ + public Guid Id { get; set; } + + public Guid UserId { get; set; } + + public string Department { get; set; } = ""; + + public string Position { get; set; } = ""; + + public string JobNumber { get; set; } = ""; + + public StaffTypes StaffType { get; set; } + + public string Name { get; set; } = ""; + + public string DisplayName { get; set; } = ""; + + public string Avatar { get; set; } = ""; + + public string IdCard { get; set; } = ""; + + public string Account { get; set; } = ""; + + public string CompanyName { get; set; } = ""; + + public string PhoneNumber { get; set; } = ""; + + public string Email { get; set; } = ""; + + public AddressValueModel Address { get; set; } = new(); + + public GenderTypes Gender { get; set; } + + public StaffModel() + { + } + + public StaffModel( + Guid id, + Guid userId, + string department, + string position, + string jobNumber, + StaffTypes staffType, + string name, + string displayName, + string avatar, + string idCard, + string account, + string companyName, + string phoneNumber, + string email, + AddressValueModel address, + GenderTypes gender) + { + Id = id; + UserId = userId; + Department = department; + Position = position; + JobNumber = jobNumber; + StaffType = staffType; + Name = name; + DisplayName = displayName; + Avatar = avatar; + IdCard = idCard; + Account = account; + CompanyName = companyName; + PhoneNumber = phoneNumber; + Email = email; + Address = address; + Gender = gender; + } +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs new file mode 100644 index 000000000..a21a3c131 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/SubjectModel.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class SubjectModel +{ + public Guid SubjectId { get; set; } + + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string? Avatar { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } + + public SubjectTypes SubjectType { get; set; } + + public SubjectModel() + { + Name = ""; + } + + public SubjectModel( + Guid subjectId, + string name, + string? displayName, + string? avatar, + string? phoneNumber, + string? email, + SubjectTypes subjectType) + { + SubjectId = subjectId; + Name = name; + DisplayName = displayName; + Avatar = avatar; + PhoneNumber = phoneNumber; + Email = email; + SubjectType = subjectType; + } +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs new file mode 100644 index 000000000..a4ba3acdc --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamDetailModel.cs @@ -0,0 +1,49 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class TeamDetailModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public string Avatar { get; set; } + + public string Description { get; set; } + + public TeamTypes TeamType { get; set; } + + public List Admins { get; set; } + + public List Members { get; set; } + + public TeamDetailModel() + { + Name = ""; + Avatar = ""; + Description = ""; + Admins = new(); + Members = new(); + } + + public TeamDetailModel( + Guid id, + string name, + string avatar, + string description, + TeamTypes teamType, + List admins, + List members) + { + Id = id; + Name = name; + Avatar = avatar; + Description = description; + TeamType = teamType; + Admins = admins; + Members = members; + } +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs new file mode 100644 index 000000000..2c5832153 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamModel.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class TeamModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public string Avatar { get; set; } + + public string Description { get; set; } + + public string Role { get; set; } + + public int MemberCount { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs new file mode 100644 index 000000000..c955b46a6 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/TeamPersonnelModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class TeamPersonnelModel +{ + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string Avatar { get; set; } + + public string Account { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs new file mode 100644 index 000000000..d84c75367 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserBasicInfoModel.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class UpdateUserBasicInfoModel +{ + public Guid Id { get; set; } + + public string DisplayName { get; set; } = ""; + + public string Avatar { get; set; } = ""; + + public string PhoneNumber { get; set; } = ""; + + public string Email { get; set; } = ""; + + public GenderTypes Gender { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs new file mode 100644 index 000000000..c5e164269 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpdateUserPasswordModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class UpdateUserPasswordModel +{ + public Guid Id { get; set; } + + public string OldPassword { get; set; } = ""; + + public string NewPassword { get; set; } = ""; +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs new file mode 100644 index 000000000..52bbad87e --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UpsertUserModel.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class UpsertUserModel +{ + public Guid Id { get; set; } + + public string Account { get; set; } + + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string? IdCard { get; set; } + + public string? CompanyName { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } + + public GenderTypes Gender { get; set; } + + public UpsertUserModel() + { + Account = ""; + Name = ""; + } + + public UpsertUserModel(string account, string name) + { + Account = account; + Name = name; + } +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs new file mode 100644 index 000000000..c6da02b56 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserModel.cs @@ -0,0 +1,73 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class UserModel +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public string? DisplayName { get; set; } + + public string Account { get; set; } + + public GenderTypes Gender { get; set; } + + public string Avatar { get; set; } + + public string? IdCard { get; set; } + + public string? PhoneNumber { get; set; } + + public string? Email { get; set; } + + public string? CompanyName { get; set; } + + public string? Department { get; set; } + + public string? Position { get; set; } + + public AddressValueModel Address { get; set; } = new(); + + public List Roles { get; set; } = new(); + + public UserModel() + { + Name = ""; + Avatar = ""; + Account = ""; + } + + public UserModel( + Guid id, + string name, + string? displayName, + string account, + GenderTypes gender, + string avatar, + string? idCard, + string? phoneNumber, + string? email, + string? companyName, + string? department, + string? position, + AddressValueModel address) + { + Id = id; + Name = name; + DisplayName = displayName; + Account = account; + Gender = gender; + Avatar = avatar; + IdCard = idCard; + PhoneNumber = phoneNumber; + Email = email; + CompanyName = companyName; + Department = department; + Position = position; + Address = address; + } +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs new file mode 100644 index 000000000..df76bc966 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserPortraitModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class UserPortraitModel +{ + public Guid Id { get; set; } + + public string Account { get; set; } + + public string Name { get; set; } + + public string DisplayName { get; set; } + + public string Avatar { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs new file mode 100644 index 000000000..14cbe1c49 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserSimpleModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class UserSimpleModel +{ + public Guid Id { get; set; } + + public string Account { get; set; } + + public string? DisplayName { get; set; } + + public UserSimpleModel(Guid id, string account, string? displayName) + { + Id = id; + Account = account; + DisplayName = displayName; + } +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs new file mode 100644 index 000000000..6e3e02a8f --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/Model/UserVisitedModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; + +public class UserVisitedModel +{ + public string Name { get; set; } = string.Empty; + + public string Url { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs new file mode 100644 index 000000000..069e32609 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth.Contracts/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs new file mode 100644 index 000000000..656dddcd4 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IAuthClient.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth; + +public interface IAuthClient +{ + IUserService UserService { get; } + + ISubjectService SubjectService { get; } + + ITeamService TeamService { get; } + + IPermissionService PermissionService { get; } + + IProjectService ProjectService { get; } +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs new file mode 100644 index 000000000..6c6f22319 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/IEnvironmentProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth; + +public interface IEnvironmentProvider +{ + string GetEnvironment(); +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj new file mode 100644 index 000000000..7ae248f00 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Masa.BuildingBlocks.StackSdks.Auth.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs new file mode 100644 index 000000000..8ccb4d687 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IPermissionService.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; + +public interface IPermissionService +{ + /// + /// Get menus for the appid with current user + /// + /// + /// + Task> GetMenusAsync(string appId); + + /// + /// Get element permissions for the appid with current user + /// + /// + /// + Task> GetElementPermissionsAsync(string appId); + + Task AuthorizedAsync(string appId, string code); + + Task AddFavoriteMenuAsync(Guid menuId); + + Task RemoveFavoriteMenuAsync(Guid menuId); + + Task> GetFavoriteMenuListAsync(); +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs new file mode 100644 index 000000000..3b1157237 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IProjectService.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; + +public interface IProjectService +{ + Task> GetGlobalNavigations(); +} diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs new file mode 100644 index 000000000..3eb636495 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ISubjectService.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; + +public interface ISubjectService +{ + Task> GetListAsync(string filter); +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs new file mode 100644 index 000000000..a8c0b74d5 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/ITeamService.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; + +public interface ITeamService +{ + Task GetDetailAsync(Guid id); + + Task> GetAllAsync(); + + Task> GetUserTeamsAsync(); +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs new file mode 100644 index 000000000..2d8074789 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/Service/IUserService.cs @@ -0,0 +1,52 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Auth.Service; + +public interface IUserService +{ + Task> GetListByTeamAsync(Guid teamId); + + Task> GetListByRoleAsync(Guid roleId); + + Task> GetListByDepartmentAsync(Guid departmentId); + + Task GetTotalByDepartmentAsync(Guid departmentId); + + Task GetTotalByRoleAsync(Guid roleId); + + Task GetTotalByTeamAsync(Guid teamId); + + Task AddAsync(AddUserModel user); + + Task UpsertAsync(UpsertUserModel user); + + Task ValidateCredentialsByAccountAsync(string account, string password, bool isLdap = false); + + Task FindByAccountAsync(string account); + + Task FindByPhoneNumberAsync(string phoneNumber); + + Task FindByEmailAsync(string email); + + Task GetCurrentUserAsync(); + + Task GetCurrentStaffAsync(); + + Task VisitedAsync(string url); + + Task> GetVisitedListAsync(); + + Task UpdatePasswordAsync(UpdateUserPasswordModel user); + + Task UpdateBasicInfoAsync(UpdateUserBasicInfoModel user); + + Task> GetUserPortraitsAsync(params Guid[] userIds); + + Task SaveUserSystemDataAsync(string systemId, T data); + + Task GetUserSystemDataAsync(string systemId); + + Task DisableUserAsync(DisableUserModel user); +} + diff --git a/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs new file mode 100644 index 000000000..a3ed35b1a --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Auth/Masa.BuildingBlocks.StackSdks.Auth/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; +global using Masa.BuildingBlocks.StackSdks.Auth.Service; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs new file mode 100644 index 000000000..f4eaa89d3 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Enums/AggregationTypes.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Enums; + +public enum AggregationTypes +{ + Count = 1, + Sum, + Avg +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs new file mode 100644 index 000000000..20c08dd9a --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/ITscClient.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc; + +public interface ITscClient +{ + public ILogService LogService { get; } + + public IMetricService MetricService { get; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Masa.BuildingBlocks.StackSdks.Tsc.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs new file mode 100644 index 000000000..b74a374dc --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/FieldAggregationRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; + +public class FieldAggregationRequest +{ + public string Name { get; set; } + + public string Alias { get; set; } + + public AggregationTypes AggregationType { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs new file mode 100644 index 000000000..5fe6fae08 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogAggregationRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; + +public class LogAggregationRequest +{ + public IEnumerable FieldMaps { get; set; } + + public string Query { get; set; } + + public DateTime Start { get; set; } + + public DateTime End { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs new file mode 100644 index 000000000..0e2020489 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Log/LogLatestRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; + +public class LogLatestRequest +{ + public string Query { get; set; } + + public DateTime Start { get; set; } + + public DateTime End { get; set; } + + public bool IsDesc { get; set; } = true; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs new file mode 100644 index 000000000..6ecf1f444 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/LableValuesRequest.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; + +public class LableValuesRequest +{ + private string[] _match = new string[1]; + + /// + /// it for the parameter `match` whitch is IEnumerable + /// and in this case only support single mode,for example: + /// Match="up", last `Matches` result is (IEnumerable){"up"} + /// + [JsonIgnore] + public string Match { get { return _match[0]; } set { _match[0] = value; } } + + /// + /// for parameter transform + /// + [JsonPropertyName("match")] + public IEnumerable Matches { get { return _match; } } + + public DateTime Start { get; set; } + + public DateTime End { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs new file mode 100644 index 000000000..ab79dc846 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Model/Metric/ValuesRequest.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Model; + +public class ValuesRequest +{ + public string Match { get; set; } + + /// + /// for parameter `match` child, for example + /// Match = "up", Lables=new string[]{ "instance=\"k8s-hz-001\"" }, last result is 'up{instance="k8s-hz-001"} for `Match`' + /// + [JsonIgnore] + public IEnumerable? Lables { get; set; } + + public DateTime Start { get; set; } + + public DateTime End { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs new file mode 100644 index 000000000..97086caec --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/ILogService.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Service; + +public interface ILogService +{ + Task> GetFieldsAsync(); + + Task>> GetAggregationAsync(LogAggregationRequest query); + + Task GetLatestAsync(LogLatestRequest query); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs new file mode 100644 index 000000000..cbd2b3bcf --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/Service/IMetricService.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Tsc.Service; + +public interface IMetricService +{ + Task> GetNamesAsync(IEnumerable? match); + + Task>> GetLabelValuesAsync(LableValuesRequest query); + + Task GetValuesAsync(ValuesRequest query); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs new file mode 100644 index 000000000..9549f7961 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdk.Tsc/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Tsc.Enums; +global using Masa.BuildingBlocks.StackSdks.Tsc.Model; +global using Masa.BuildingBlocks.StackSdks.Tsc.Service; +global using System.Text.Json.Serialization; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs new file mode 100644 index 000000000..e1d7971f0 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/IDccClient.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Dcc; + +public interface IDccClient +{ + public ILabelService LabelService { get; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Masa.BuildingBlocks.StackSdks.Dcc.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs new file mode 100644 index 000000000..1be05ebc4 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Model/LabelModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Dcc.Model +{ + public class LabelModel + { + public int Id { get; set; } + + public string Code { get; set; } = ""; + + public string Name { get; set; } = ""; + + public string TypeCode { get; set; } = ""; + + public string TypeName { get; set; } = ""; + + public string Description { get; set; } = ""; + } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs new file mode 100644 index 000000000..0d4c1417a --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/Service/ILabelService.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Dcc.Service; + +public interface ILabelService +{ + Task> GetListByTypeCodeAsync(string typeCode); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs new file mode 100644 index 000000000..328df80c1 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Dcc/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Dcc.Model; +global using Masa.BuildingBlocks.StackSdks.Dcc.Service; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs new file mode 100644 index 000000000..7be436d31 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ChannelTypes.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum ChannelTypes +{ + Sms = 1, + Email, + WebsiteMessage +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs new file mode 100644 index 000000000..babf49792 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskReceiverTypes.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum MessageTaskReceiverTypes +{ + User = 1, + Organization, + Role, + Team, + Group +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs new file mode 100644 index 000000000..e8c70f610 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSelectReceiverTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum MessageTaskSelectReceiverTypes +{ + ManualSelection = 1, + BatchUpload +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs new file mode 100644 index 000000000..3133a88eb --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskSources.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum MessageTaskSources +{ + Management = 1, + Sdk, +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs new file mode 100644 index 000000000..a02130d88 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTaskStatuses.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum MessageTaskStatuses +{ + NotPublished = 1, + InProgress, + Cancel, + Published, + PublishedFailed, + PartialFailed +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs new file mode 100644 index 000000000..66b7abbd2 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateAuditStatuses.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum MessageTemplateAuditStatuses +{ + Waited = 1, + Approved, + Failed, +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs new file mode 100644 index 000000000..412def79e --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTemplateStates.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum MessageTemplateStates +{ + Normal = 1, + Invalid +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs new file mode 100644 index 000000000..4d49430d7 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/MessageTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum MessageTypes +{ + Ordinary = 1, + Template +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs new file mode 100644 index 000000000..da0924f5a --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/ReceiverGroupItemTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum ReceiverGroupItemTypes +{ + User = 1, + Organization, + Role, + Team +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs new file mode 100644 index 000000000..bb3015eba --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/SendTargets.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum SendTargets +{ + Assign = 1, + Broadcast +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs new file mode 100644 index 000000000..a50c75583 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Enum/WebsiteMessageFilterType.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Enum; + +public enum WebsiteMessageFilterType +{ + Title = 1, + Content, +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs new file mode 100644 index 000000000..935e624f5 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/IMcClient.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc; + +public interface IMcClient +{ + IChannelService ChannelService { get; } + + IMessageTaskService MessageTaskService { get; } + + IMessageTemplateService MessageTemplateService { get; } + + IReceiverGroupService ReceiverGroupService { get; } + + IWebsiteMessageService WebsiteMessageService { get; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs new file mode 100644 index 000000000..b8ff3d9be --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Infrastructure/ObjectExtending/ExtraPropertyDictionary.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System.Collections.Concurrent; + +[Serializable] +public class ExtraPropertyDictionary : ConcurrentDictionary +{ + public ExtraPropertyDictionary() + { + + } + + public ExtraPropertyDictionary(IDictionary dictionary) + : base(dictionary) + { + } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj new file mode 100644 index 000000000..e1a297cd3 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Masa.BuildingBlocks.StackSdks.Mc.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs new file mode 100644 index 000000000..9b4217c7a --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/AuditEntityModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class AuditEntityModel : EntityModel +{ + public TUserId Creator { get; set; } = default!; + + public DateTime CreationTime { get; set; } + + public TUserId Modifier { get; set; } = default!; + + public DateTime ModificationTime { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs new file mode 100644 index 000000000..f1ba0051e --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ChannelModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class ChannelModel : AuditEntityModel +{ + public string DisplayName { get; set; } = string.Empty; + + public string Code { get; set; } = string.Empty; + + public ChannelTypes Type { get; set; } + + public string Description { get; set; } = string.Empty; + + public string Color { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs new file mode 100644 index 000000000..ebb8df3e6 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/EntityModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class EntityModel +{ + public TKey Id { get; set; } = default!; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs new file mode 100644 index 000000000..cf32ef960 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetChannelModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class GetChannelModel : PaginatedOptions +{ + public string Filter { get; set; } = string.Empty; + + public ChannelTypes? Type { get; set; } + + public string DisplayName { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs new file mode 100644 index 000000000..d783dcc1d --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetMessageTemplateModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class GetMessageTemplateModel : PaginatedOptions +{ + public string Filter { get; set; } = string.Empty; + + public MessageTemplateStates? Status { get; set; } + + public MessageTemplateAuditStatuses? AuditStatus { get; set; } + + public ChannelTypes? ChannelType { get; set; } + + public Guid? ChannelId { get; set; } + + public DateTime? StartTime { get; set; } + + public DateTime? EndTime { get; set; } + + public int TemplateType { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs new file mode 100644 index 000000000..bfed7b35f --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetNoticeListModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class GetNoticeListModel +{ + public int PageSize { get; set; } = 5; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs new file mode 100644 index 000000000..06af3f7c0 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetReceiverGroupModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class GetReceiverGroupModel : PaginatedOptions +{ + public string Filter { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs new file mode 100644 index 000000000..1175ddb2e --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/GetWebsiteMessageModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class GetWebsiteMessageModel : PaginatedOptionsModel +{ + public string Filter { get; set; } = string.Empty; + + public WebsiteMessageFilterType? FilterType { get; set; } + + public Guid? ChannelId { get; set; } + + public bool? IsRead { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs new file mode 100644 index 000000000..f56dcd142 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class MessageInfoModel +{ + public string Title { get; set; } = string.Empty; + + public string Content { get; set; } = string.Empty; + + public string Markdown { get; set; } = string.Empty; + + public bool IsJump { get; set; } + + public string JumpUrl { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs new file mode 100644 index 000000000..6fc0daec8 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageInfoUpsertModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class MessageInfoUpsertModel +{ + public string Title { get; set; } = string.Empty; + + public string Content { get; set; } = string.Empty; + + public string Markdown { get; set; } = string.Empty; + + public bool IsJump { get; set; } + + public string JumpUrl { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs new file mode 100644 index 000000000..61f43e012 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskModel.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class MessageTaskModel : AuditEntityModel +{ + public string DisplayName { get; set; } = string.Empty; + + public Guid ChannelId { get; set; } + + public ChannelModel Channel { get; set; } = new(); + + public MessageTypes EntityType { get; set; } + + public Guid EntityId { get; set; } + + public bool IsDraft { get; set; } + + public bool IsEnabled { get; set; } + + public SendTargets ReceiverType { get; set; } + + public MessageTaskSelectReceiverTypes SelectReceiverType { get; set; } + + public DateTimeOffset? SendTime { get; set; } + + public string Sign { get; set; } = string.Empty; + + public MessageInfoModel MessageInfo { get; set; } = new(); + + public List Receivers { get; set; } = new(); + + public SendRuleModel SendRules { get; set; } = new(); + + public ExtraPropertyDictionary Variables { get; set; } = new(); + + public string Content { get; set; } = string.Empty; + + public MessageTaskStatuses Status { get; set; } + + public MessageTaskSources Source { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs new file mode 100644 index 000000000..587696efd --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTaskReceiverModel.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class MessageTaskReceiverModel +{ + public Guid SubjectId { get; set; } + + public string DisplayName { get; set; } = string.Empty; + + public string Avatar { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; + + public MessageTaskReceiverTypes Type { get; set; } + + public ExtraPropertyDictionary Variables { get; set; } = new(); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs new file mode 100644 index 000000000..acec18d51 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateItemModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class MessageTemplateItemModel +{ + public string Code { get; set; } = string.Empty; + + public string MappingCode { get; set; } = string.Empty; + + public string DisplayText { get; set; } = string.Empty; + + public string Description { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs new file mode 100644 index 000000000..a724c8ca7 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/MessageTemplateModel.cs @@ -0,0 +1,50 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class MessageTemplateModel : AuditEntityModel +{ + public Guid ChannelId { get; set; } + + public string DisplayName { get; set; } = string.Empty; + + public string Title { get; set; } = string.Empty; + + public string Content { get; set; } = string.Empty; + + public string Markdown { get; set; } = string.Empty; + + public string TemplateId { get; set; } = string.Empty; + + public bool IsJump { get; set; } + + public string JumpUrl { get; set; } = string.Empty; + + public string Sign { get; set; } = string.Empty; + + public MessageTemplateStates Status { get; set; } + + public MessageTemplateAuditStatuses AuditStatus { get; set; } + + public DateTimeOffset? AuditTime { get; set; } + + public DateTimeOffset? InvalidTime { get; set; } + + public string AuditReason { get; set; } = string.Empty; + + public int TemplateType { get; set; } + + public string TemplateTypeDisplayName { get; set; } + + public long PerDayLimit { get; set; } + + public bool IsStatic { get; set; } + + public List Items { get; set; } + + public MessageTemplateModel() + { + this.Items = new List(); + } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs new file mode 100644 index 000000000..8793915f2 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedListModel.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class PaginatedListModel +{ + public long Total { get; set; } + + public int TotalPages { get; set; } + + public List Result { get; set; } = default!; + + public PaginatedListModel() + { + Result = new List(); + } + + public PaginatedListModel(long total, int totalPages, List result) + { + Total = total; + TotalPages = totalPages; + Result = result; + } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs new file mode 100644 index 000000000..1846fc3d8 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/PaginatedOptionsModel.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class PaginatedOptionsModel +{ + public int Page { get; set; } = 1; + + public int PageSize { get; set; } = 10; + + public string Sorting { get; set; } + + public PaginatedOptionsModel(string sorting = "", int page = 1, int pageSize = 10) + { + Sorting = sorting; + Page = page; + PageSize = pageSize; + } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs new file mode 100644 index 000000000..bbd431360 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadAllWebsiteMessageModel.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class ReadAllWebsiteMessageModel : GetWebsiteMessageModel +{ +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs new file mode 100644 index 000000000..69aaa8191 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReadWebsiteMessageModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class ReadWebsiteMessageModel +{ + public Guid Id { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs new file mode 100644 index 000000000..ab3a27b65 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupItemModel.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class ReceiverGroupItemModel +{ + public Guid GroupId { get; set; } + + public ReceiverGroupItemTypes Type { get; set; } + + public Guid SubjectId { get; set; } + + public string DisplayName { get; set; } = string.Empty; + + public string Avatar { get; set; } = string.Empty; + + public string PhoneNumber { get; set; } = string.Empty; + + public string Email { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs new file mode 100644 index 000000000..9af8a9f07 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/ReceiverGroupModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class ReceiverGroupModel : AuditEntityModel +{ + public string DisplayName { get; set; } = string.Empty; + + public string Description { get; set; } = string.Empty; + + public List Items { get; set; } = new(); + + public string ModifierName { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs new file mode 100644 index 000000000..2fbdb54e3 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendOrdinaryMessageModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class SendOrdinaryMessageModel +{ + public string ChannelCode { get; set; } = string.Empty; + + public ChannelTypes? ChannelType { get; set; } + + public SendTargets ReceiverType { get; set; } + + public List Receivers { get; set; } = new(); + + public SendRuleModel SendRules { get; set; } = new(); + + public MessageInfoUpsertModel MessageInfo { get; set; } = new(); + + public ExtraPropertyDictionary Variables { get; set; } = new(); + + public Guid OperatorId { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs new file mode 100644 index 000000000..6a02b1a0c --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendRuleModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class SendRuleModel +{ + public bool IsCustom { get; set; } + + public string CronExpression { get; set; } = string.Empty; + + public long SendingCount { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs new file mode 100644 index 000000000..08cb07f3b --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/SendTemplateMessageModel.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class SendTemplateMessageModel +{ + public string ChannelCode { get; set; } = string.Empty; + + public ChannelTypes? ChannelType { get; set; } + + public string TemplateCode { get; set; } = string.Empty; + + public SendTargets ReceiverType { get; set; } + + public string Sign { get; set; } = string.Empty; + + public List Receivers { get; set; } = new(); + + public SendRuleModel SendRules { get; set; } = new(); + + public ExtraPropertyDictionary Variables { get; set; } = new(); + + public Guid OperatorId { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs new file mode 100644 index 000000000..4d7cf3711 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageChannelModel.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class WebsiteMessageChannelModel : WebsiteMessageModel +{ + public long NoReading { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs new file mode 100644 index 000000000..efeceb5c0 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Model/WebsiteMessageModel.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Model; + +public class WebsiteMessageModel : AuditEntityModel +{ + public Guid ChannelId { get; set; } + + public ChannelModel Channel { get; set; } = default!; + + public Guid UserId { get; set; } + + public string Title { get; set; } = string.Empty; + + public string Content { get; set; } = string.Empty; + + public string LinkUrl { get; set; } = string.Empty; + + public DateTimeOffset SendTime { get; set; } + + public bool IsRead { get; set; } + + public DateTimeOffset? ReadTime { get; set; } + + public string Abstract { get; set; } = string.Empty; + + public Guid PrevId { get; set; } + + public Guid NextId { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs new file mode 100644 index 000000000..f13b62319 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IChannelService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; + +public interface IChannelService +{ + Task GetAsync(Guid id); + + Task> GetListAsync(GetChannelModel options); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs new file mode 100644 index 000000000..e19aded92 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTaskService.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; + +public interface IMessageTaskService +{ + Task GetAsync(Guid id); + + Task SendTemplateMessageAsync(SendTemplateMessageModel options); + + Task SendOrdinaryMessageAsync(SendOrdinaryMessageModel options); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs new file mode 100644 index 000000000..a72efd7ee --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IMessageTemplateService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; + +public interface IMessageTemplateService +{ + Task GetAsync(Guid id); + + Task> GetListAsync(GetMessageTemplateModel options); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs new file mode 100644 index 000000000..784e10b8d --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IReceiverGroupService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; + +public interface IReceiverGroupService +{ + Task GetAsync(Guid id); + + Task> GetListAsync(GetReceiverGroupModel inputDto); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs new file mode 100644 index 000000000..d7030a6fc --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/Service/IWebsiteMessageService.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Mc.Service; + +public interface IWebsiteMessageService +{ + Task> GetListAsync(GetWebsiteMessageModel options); + + Task GetAsync(Guid id); + + Task> GetChannelListAsync(); + + Task SetAllReadAsync(ReadAllWebsiteMessageModel options); + + Task DeleteAsync(Guid id); + + Task ReadAsync(ReadWebsiteMessageModel options); + + Task CheckAsync(); + + Task> GetNoticeListAsync(GetNoticeListModel options); + + Task SendCheckNotificationAsync(); + + Task SendGetNotificationAsync(List userIds); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs new file mode 100644 index 000000000..e2152a3c0 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Mc.Enum; +global using Masa.BuildingBlocks.StackSdks.Mc.Model; +global using Masa.BuildingBlocks.StackSdks.Mc.Service; +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; +global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs new file mode 100644 index 000000000..61c8a96b2 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/AppTypes.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Enum; + +public enum AppTypes +{ + [Description("Service")] + Service = 1, + + [Description("UI")] + UI, + + [Description("Job")] + Job +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs new file mode 100644 index 000000000..6d38f766f --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Enum/ServiceTypes.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Enum; + +public enum ServiceTypes +{ + [Description("Dapr")] + Dapr = 1, + + [Description("Web Api")] + WebApi +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs new file mode 100644 index 000000000..76d8c48a9 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/IPmClient.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.BuildingBlocks.StackSdks.Pm; + +public interface IPmClient +{ + public IEnvironmentService EnvironmentService { get; init; } + + public IClusterService ClusterService { get; init; } + + public IProjectService ProjectService { get; init; } + + public IAppService AppService { get; init; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Masa.BuildingBlocks.StackSdks.Pm.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs new file mode 100644 index 000000000..5aa26698c --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppDetailModel.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class AppDetailModel : BaseModel +{ + public int ProjectId { get; set; } + + public int Id { get; set; } + + public string Name { get; set; } = ""; + + public string Identity { get; set; } = ""; + + public string Description { get; set; } = ""; + + public AppTypes Type { get; set; } + + public ServiceTypes ServiceType { get; set; } + + public string Url { get; set; } = ""; + + public string SwaggerUrl { get; set; } = ""; + + public List EnvironmentClusters { get; set; } = new(); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs new file mode 100644 index 000000000..b364aaa64 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/AppModel.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Enum; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class AppModel +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string Identity { get; set; } + + public int ProjectId { get; set; } + + public AppTypes Type { get; set; } + + public AppModel() + { + } + + public AppModel(int id, string name, string identity, int projectId) + { + Id = id; + Name = name; + Identity = identity; + ProjectId = projectId; + } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs new file mode 100644 index 000000000..07ad7a895 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/BaseModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class BaseModel +{ + public Guid Creator { get; set; } + + public DateTime CreationTime { get; set; } + + public Guid Modifier { get; set; } + + public DateTime ModificationTime { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs new file mode 100644 index 000000000..41fc6b4e4 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterDetailModel.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class ClusterDetailModel : BaseModel +{ + public int Id { get; set; } + + public string Name { get; set; } = default!; + + public string Description { get; set; } = ""; + + public List EnvironmentIds { get; set; } = new(); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs new file mode 100644 index 000000000..6a1b19dbe --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ClusterModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class ClusterModel +{ + public int Id { get; set; } + + public string Name { get; set; } = default!; + + public int EnvironmentClusterId { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs new file mode 100644 index 000000000..ee1916645 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentClusterModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class EnvironmentClusterModel +{ + public int Id { get; set; } + + public string EnvironmentName { get; set; } = ""; + + public string EnvironmentColor { get; set; } = ""; + + public string ClusterName { get; set; } = ""; + + public string EnvironmentClusterName + { + get + { + return $"{EnvironmentName}/{ClusterName}"; + } + } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs new file mode 100644 index 000000000..32c517967 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentDetailModel.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class EnvironmentDetailModel : BaseModel +{ + public int Id { get; set; } + + public string Name { get; set; } = default!; + + public string Description { get; set; } = ""; + + public string Color { get; set; } = ""; + + public List ClusterIds { get; set; } = default!; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs new file mode 100644 index 000000000..c939ab264 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/EnvironmentModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class EnvironmentModel +{ + public int Id { get; set; } + + public string Name { get; set; } = ""; + + public string Color { get; set; } = ""; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs new file mode 100644 index 000000000..0ce6b7eb6 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectAppsModel.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class ProjectAppsModel +{ + public int Id { get; set; } + + public string Identity { get; set; } + + public string Name { get; set; } + + public string LabelCode { get; set; } + + public Guid TeamId { get; set; } + + public List Apps { get; set; } = new(); + + public ProjectAppsModel(int id, string identity, string name, string labelCode, Guid teamId) + { + Id = id; + Identity = identity; + Name = name; + LabelCode = labelCode; + TeamId = teamId; + } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs new file mode 100644 index 000000000..50a80f1de --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectDetailModel.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class ProjectDetailModel : BaseModel +{ + public int Id { get; set; } + + public string Identity { get; set; } = ""; + + public string LabelCode { get; set; } + + public string Name { get; set; } = ""; + + public string Description { get; set; } = ""; + + public Guid TeamId { get; set; } + + public List EnvironmentClusterIds { get; set; } = new List(); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs new file mode 100644 index 000000000..49368da25 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectModel.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class ProjectModel +{ + public int Id { get; set; } + + public string Identity { get; set; } = ""; + + public string Name { get; set; } = ""; + + public string Description { get; set; } = ""; + + public string LabelCode { get; set; } = ""; + + public string LabelName { get; set; } = ""; + + public Guid Modifier { get; set; } + + public DateTime ModificationTime { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs new file mode 100644 index 000000000..b8751e6b8 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Model/ProjectTypeModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Pm.Model; + +public class ProjectTypeModel +{ + public int Id { get; set; } + + public string Name { get; set; } = ""; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs new file mode 100644 index 000000000..122c00bc2 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IAppService.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Service; + +public interface IAppService +{ + Task> GetListAsync(); + + Task> GetListByProjectIdsAsync(List projectIds); + + Task GetWithEnvironmentClusterAsync(int Id); + + Task GetAsync(int Id); + + Task GetByIdentityAsync(string identity); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs new file mode 100644 index 000000000..01bc8cbe1 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IClusterService.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Service; + +public interface IClusterService +{ + Task> GetListAsync(); + + Task> GetListByEnvIdAsync(int envId); + + Task GetAsync(int Id); + + Task> GetEnvironmentClustersAsync(); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs new file mode 100644 index 000000000..c6ed3a684 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IEnvironmentService.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Service; + +public interface IEnvironmentService +{ + Task> GetListAsync(); + + Task GetAsync(int Id); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs new file mode 100644 index 000000000..464a7ca6b --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/Service/IProjectService.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.BuildingBlocks.StackSdks.Pm.Service; + +public interface IProjectService +{ + Task> GetProjectAppsAsync(string envName); + + Task> GetListByEnvironmentClusterIdAsync(int envClusterId); + + Task> GetListByTeamIdsAsync(List teamIds); + + Task GetAsync(int id); + + Task GetByIdentityAsync(string identity); + + Task> GetProjectTypesAsync(); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs new file mode 100644 index 000000000..4b1a5eaaa --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Pm/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Pm.Enum; +global using Masa.BuildingBlocks.StackSdks.Pm.Model; +global using Masa.BuildingBlocks.StackSdks.Pm.Service; +global using System.ComponentModel; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs new file mode 100644 index 000000000..7263de700 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpMethods.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; + +public enum HttpMethods +{ + GET = 1, + POST, + HEAD, + PUT, + DELETE +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs new file mode 100644 index 000000000..c7213212b --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/HttpVerifyTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; + +public enum HttpVerifyTypes +{ + StatusCode200 = 1, + CustomStatusCode, + ContentContains, + ContentUnContains, +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs new file mode 100644 index 000000000..e0a928ea7 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/JobTypes.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; + +public enum JobTypes +{ + JobApp = 1, + Http, + DaprServiceInvocation +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs new file mode 100644 index 000000000..8df0a446a --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/RunTimeoutStrategyTypes.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; + +public enum RunTimeoutStrategyTypes +{ + RunFailedStrategy = 1, + IgnoreTimeout +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs new file mode 100644 index 000000000..d9bd4f523 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleBlockStrategyTypes.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; + +public enum ScheduleBlockStrategyTypes +{ + Serial = 1, + Parallel, + Discard, + Cover +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs new file mode 100644 index 000000000..a406828e8 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Enum/ScheduleExpiredStrategyTypes.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Enum; + +public enum ScheduleExpiredStrategyTypes +{ + ExecuteImmediately = 1, + AutoCompensation, + Ignore +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs new file mode 100644 index 000000000..744e46613 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerClient.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler; + +public interface ISchedulerClient +{ + ISchedulerJobService SchedulerJobService { get; } + + ISchedulerTaskService SchedulerTaskService { get; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs new file mode 100644 index 000000000..4e9bafa62 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/ISchedulerJob.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler; + +public interface ISchedulerJob +{ + Task BeforeExcuteAsync(JobContext context); + + Task ExcuteAsync(JobContext context); + + Task AfterExcuteAsync(JobContext context); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Masa.BuildingBlocks.StackSdks.Scheduler.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs new file mode 100644 index 000000000..89d51ab50 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/JobContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; + +public class JobContext +{ + public Guid JobId { get; set; } + + public Guid TaskId { get; set; } + + public DateTimeOffset ExecutionTime { get; set; } + + public string ExcuteClassName { get; set; } = string.Empty; + + public List ExcuteParameters { get; set; } = new(); + + public object? ExcuteResult { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs new file mode 100644 index 000000000..890aa16d8 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobAppConfig.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; + +public class SchedulerJobAppConfig +{ + public string JobAppIdentity { get; set; } = string.Empty; + + public string JobEntryAssembly { get; set; } = string.Empty; + + public string JobEntryClassName { get; set; } = string.Empty; + + public string JobParams { get; set; } = string.Empty; + + public string Version { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs new file mode 100644 index 000000000..ab5feef95 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobDaprServiceInvocationConfig.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; + +public class SchedulerJobDaprServiceInvocationConfig +{ + public string MethodName { get; set; } = string.Empty; + + public HttpMethods HttpMethod { get; set; } + + public string Data { get; set; } = string.Empty; + + public string DaprServiceIdentity { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs new file mode 100644 index 000000000..bebb18f00 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Model/SchedulerJobHttpConfig.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Model; + +public class SchedulerJobHttpConfig +{ + public HttpMethods HttpMethod { get; set; } + + public string RequestUrl { get; set; } = string.Empty; + + public List> HttpParameters { get; set; } = new(); + + public List> HttpHeaders { get; set; } = new(); + + public string HttpBody { get; set; } = string.Empty; + + public HttpVerifyTypes HttpVerifyType { get; set; } + + public string VerifyContent { get; set; } = string.Empty; +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs new file mode 100644 index 000000000..1ba5c2afd --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/AddSchedulerJobRequest.cs @@ -0,0 +1,48 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; + +public class AddSchedulerJobRequest +{ + public string ProjectIdentity { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public bool IsAlertException { get; set; } + + public JobTypes JobType { get; set; } + + public Guid OperatorId { get; set; } + + public string CronExpression { get; set; } = string.Empty; + + public string Description { get; set; } = string.Empty; + + /// + /// Default Ignore + /// + public ScheduleExpiredStrategyTypes ScheduleExpiredStrategy { get; set; } = ScheduleExpiredStrategyTypes.Ignore; + + /// + /// Default Parallel + /// + public ScheduleBlockStrategyTypes ScheduleBlockStrategy { get; set; } = ScheduleBlockStrategyTypes.Serial; + + /// + /// Default IgnoreTimeout + /// + public RunTimeoutStrategyTypes RunTimeoutStrategy { get; set; } = RunTimeoutStrategyTypes.IgnoreTimeout; + + public int RunTimeoutSecond { get; set; } + + public int FailedRetryInterval { get; set; } + + public int FailedRetryCount { get; set; } + + public SchedulerJobAppConfig? JobAppConfig { get; set; } + + public SchedulerJobHttpConfig? HttpConfig { get; set; } + + public SchedulerJobDaprServiceInvocationConfig? DaprServiceInvocationConfig { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs new file mode 100644 index 000000000..9a7997211 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerJobRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; + +public class BaseSchedulerJobRequest +{ + public Guid JobId { get; set; } + + public Guid OperatorId { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs new file mode 100644 index 000000000..16e1a1287 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/BaseSchedulerTaskRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; + +public class BaseSchedulerTaskRequest +{ + public Guid TaskId { get; set; } + + public Guid OperatorId { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs new file mode 100644 index 000000000..550257661 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/ChangeEnabledStatusRequest.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; + +public class ChangeEnabledStatusRequest : BaseSchedulerJobRequest +{ + public bool Enabled { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs new file mode 100644 index 000000000..9699187ab --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Request/StartSchedulerTaskRequest.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Request; + +public class StartSchedulerTaskRequest : BaseSchedulerTaskRequest +{ + public bool IsManual { get; set; } +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs new file mode 100644 index 000000000..fd7d7bc3f --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerJobService.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Service; + +public interface ISchedulerJobService +{ + Task AddAsync(AddSchedulerJobRequest job); + + Task StartAsync(BaseSchedulerJobRequest request); + + Task RemoveAsync(BaseSchedulerJobRequest request); + + Task EnableAsync(BaseSchedulerJobRequest request); + + Task DisableAsync(BaseSchedulerJobRequest request); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs new file mode 100644 index 000000000..524d0b4da --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/Service/ISchedulerTaskService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.StackSdks.Scheduler.Service; + +public interface ISchedulerTaskService +{ + Task StopAsync(BaseSchedulerTaskRequest request); + + Task StartAsync(BaseSchedulerTaskRequest request); +} diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs new file mode 100644 index 000000000..54eafd273 --- /dev/null +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Scheduler/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; +global using Masa.BuildingBlocks.StackSdks.Scheduler.Model; +global using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +global using Masa.BuildingBlocks.StackSdks.Scheduler.Service; diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs new file mode 100644 index 000000000..2692fc072 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNameAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +[AttributeUsage(AttributeTargets.Class)] +public class BucketNameAttribute : Attribute +{ + public string? Name { get; set; } + + public BucketNameAttribute(string? name = null) => Name = name; + + public static string GetName() => GetName(typeof(T)); + + public static string GetName(Type type) + { + var nameAttribute = type.GetTypeInfo().GetCustomAttribute(); + + if (nameAttribute == null) + return BucketNames.DEFAULT_BUCKET_NAME; + + return !string.IsNullOrWhiteSpace(nameAttribute.Name) ? nameAttribute.Name : type.FullName!; + } +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs new file mode 100644 index 000000000..ca61c53f5 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/BucketNames.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public class BucketNames : Dictionary +{ + public const string DEFAULT_BUCKET_NAME = "DefaultBucketName"; + + public string DefaultBucketName + { + get => GetBucketName(DEFAULT_BUCKET_NAME); + set => this[DEFAULT_BUCKET_NAME] = value; + } + + public BucketNames() { } + public BucketNames(IEnumerable> names) : base(names) { } + + public string GetBucketName(string name) + { + if (base.TryGetValue(name, out var bucketName)) + return bucketName; + + return string.Empty; + } +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs new file mode 100644 index 000000000..34bb6026b --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientContainer.cs @@ -0,0 +1,51 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public class DefaultClientContainer + : DefaultClientContainer, IClientContainer where TContainer : class +{ + public DefaultClientContainer(IClient client, IBucketNameProvider bucketNameProvider) + : base(client, bucketNameProvider.GetBucketName()) + { + } +} + +public class DefaultClientContainer : IClientContainer +{ + private readonly IClient _client; + private readonly string _bucketName; + + public DefaultClientContainer(IClient client, string bucketName) + { + _client = client; + _bucketName = bucketName; + } + + public TemporaryCredentialsResponse GetSecurityToken() => _client.GetSecurityToken(); + + public string GetToken() => _client.GetToken(); + + public Task GetObjectAsync(string objectName, Action callback, CancellationToken cancellationToken = default) + => _client.GetObjectAsync(_bucketName, objectName, callback, cancellationToken); + + public Task GetObjectAsync(string objectName, + long offset, + long length, + Action callback, + CancellationToken cancellationToken = default) + => _client.GetObjectAsync(_bucketName, objectName, offset, length, callback, cancellationToken); + + public Task PutObjectAsync(string objectName, Stream data, CancellationToken cancellationToken = default) + => _client.PutObjectAsync(_bucketName, objectName, data, cancellationToken); + + public Task ObjectExistsAsync(string objectName, CancellationToken cancellationToken = default) + => _client.ObjectExistsAsync(_bucketName, objectName, cancellationToken); + + public Task DeleteObjectAsync(string objectName, CancellationToken cancellationToken = default) + => _client.DeleteObjectAsync(_bucketName, objectName, cancellationToken); + + public Task DeleteObjectAsync(IEnumerable objectNames, CancellationToken cancellationToken = default) + => _client.DeleteObjectAsync(_bucketName, objectNames, cancellationToken); +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs new file mode 100644 index 000000000..def32b589 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/DefaultClientFactory.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public class DefaultClientFactory : IClientFactory +{ + private readonly IClient _client; + + public DefaultClientFactory(IClient client) => _client = client; + + public IClientContainer Create(string bucketName) + { + if (string.IsNullOrWhiteSpace(bucketName)) + throw new AggregateException($"{nameof(bucketName)} cannot be empty"); + + return new DefaultClientContainer(_client, bucketName); + } +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs new file mode 100644 index 000000000..756d16bbc --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IBucketNameProvider.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public interface IBucketNameProvider +{ + string GetBucketName(); + + string GetBucketName() where TContainer : class; +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs new file mode 100644 index 000000000..378cbded2 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClient.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public interface IClient +{ + /// + /// Obtain temporary authorization credentials through STS service + /// + /// + TemporaryCredentialsResponse GetSecurityToken(); + + /// + /// Obtain temporary request token through authorization service + /// + /// + string GetToken(); + + Task GetObjectAsync( + string bucketName, + string objectName, + Action callback, + CancellationToken cancellationToken = default(CancellationToken)); + + Task GetObjectAsync( + string bucketName, + string objectName, + long offset, + long length, + Action callback, + CancellationToken cancellationToken = default(CancellationToken)); + + Task PutObjectAsync( + string bucketName, + string objectName, + Stream data, + CancellationToken cancellationToken = default(CancellationToken)); + + Task ObjectExistsAsync( + string bucketName, + string objectName, + CancellationToken cancellationToken = default(CancellationToken)); + + Task DeleteObjectAsync( + string bucketName, + string objectName, + CancellationToken cancellationToken = default(CancellationToken)); + + Task DeleteObjectAsync( + string bucketName, + IEnumerable objectNames, + CancellationToken cancellationToken = default(CancellationToken)); +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs new file mode 100644 index 000000000..cd3b0f020 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientContainer.cs @@ -0,0 +1,53 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public interface IClientContainer : IClientContainer where TContainer : class +{ + +} + +public interface IClientContainer +{ + /// + /// Obtain temporary authorization credentials through STS service + /// + /// + TemporaryCredentialsResponse GetSecurityToken(); + + /// + /// Obtain temporary request token through authorization service + /// + /// + string GetToken(); + + Task GetObjectAsync( + string objectName, + Action callback, + CancellationToken cancellationToken = default); + + Task GetObjectAsync( + string objectName, + long offset, + long length, + Action callback, + CancellationToken cancellationToken = default); + + Task PutObjectAsync( + string objectName, + Stream data, + CancellationToken cancellationToken = default); + + Task ObjectExistsAsync( + string objectName, + CancellationToken cancellationToken = default); + + Task DeleteObjectAsync( + string objectName, + CancellationToken cancellationToken = default); + + Task DeleteObjectAsync( + IEnumerable objectNames, + CancellationToken cancellationToken = default); +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs new file mode 100644 index 000000000..e133ce1c7 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/IClientFactory.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public interface IClientFactory +{ + IClientContainer Create(string bucketName); +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj new file mode 100644 index 000000000..17a5a8795 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Masa.BuildingBlocks.Storage.ObjectStorage.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs new file mode 100644 index 000000000..c626350f0 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/Response/TemporaryCredentialsResponse.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage.Response; + +public class TemporaryCredentialsResponse +{ + public string AccessKeyId { get; } + + public string AccessKeySecret { get; } + + public string SessionToken { get; } + + public DateTime? Expiration { get; } + + public TemporaryCredentialsResponse(string accessKeyId, string accessKeySecret, string sessionToken, DateTime? expiration) + { + AccessKeyId = accessKeyId; + AccessKeySecret = accessKeySecret; + SessionToken = sessionToken; + Expiration = expiration; + } +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs new file mode 100644 index 000000000..02c338f62 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/StorageOptions.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Storage.ObjectStorage; + +public class StorageOptions +{ + private static readonly List> _bucketNames = new(); + + public BucketNames BucketNames { get; set; } + + public StorageOptions() => BucketNames = new BucketNames(_bucketNames); + + public void TryAddBucketName(string name, string bucketName) + { + if (_bucketNames.All(item => item.Key != name)) + _bucketNames.Add(new KeyValuePair(name, bucketName)); + } +} diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs new file mode 100644 index 000000000..16a47c504 --- /dev/null +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Storage.ObjectStorage.Response; +global using Microsoft.Extensions.Options; +global using System.Reflection; diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs new file mode 100644 index 000000000..7ec98fcb8 --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel; + +public static class ClaimExtensions +{ + public static string? FindClaimValue(this ClaimsPrincipal claimsPrincipal, string claimType) + => claimsPrincipal.Claims.FirstOrDefault(c => c.Type == claimType)?.Value; +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs new file mode 100644 index 000000000..45ec16a17 --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel.Const; + +public class ClaimType +{ + public const string DEFAULT_USER_ID = ClaimTypes.NameIdentifier; + + public const string DEFAULT_USER_NAME = ClaimTypes.Name; + + public const string DEFAULT_USER_ROLE = ClaimTypes.Role; + + public const string DEFAULT_TENANT_ID = $"{DEFAULT_PREFIX}/tenantid"; + + public const string DEFAULT_ENVIRONMENT = $"{DEFAULT_PREFIX}/environment"; + + private const string DEFAULT_PREFIX = "https://masastack.com/security/identity/claims"; +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs new file mode 100644 index 000000000..23013421c --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs @@ -0,0 +1,50 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel; + +internal class DefaultIsolatedUserContext : DefaultUserContext, IIsolatedUserContext +{ + public string? TenantId => GetUser()?.TenantId; + + public string? Environment => GetUser()?.Environment; + + private readonly IOptionsMonitor _optionsMonitor; + + public DefaultIsolatedUserContext( + ITypeConvertProvider typeConvertProvider, + ICurrentPrincipalAccessor currentPrincipalAccessor, + IOptionsMonitor optionsMonitor, + ILoggerFactory? loggerFactory = null) + : base(typeConvertProvider, currentPrincipalAccessor, optionsMonitor, loggerFactory) + { + _optionsMonitor = optionsMonitor; + } + + public TTenantId? GetTenantId() + { + var tenantId = TenantId; + if (tenantId == null) + return default; + + return TypeConvertProvider.ConvertTo(tenantId); + } + + protected override IsolatedIdentityUser? GetUser() + { + var identityUser = GetUserBasicInfo(); + if (identityUser == null) + { + return null; + } + + return new IsolatedIdentityUser + { + Id = identityUser.Id, + UserName = identityUser.UserName, + Roles = identityUser.Roles, + TenantId = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.TenantId), + Environment = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.Environment), + }; + } +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs new file mode 100644 index 000000000..3c1d8cd3d --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel; + +internal class DefaultMultiEnvironmentUserContext : DefaultUserContext, IMultiEnvironmentUserContext +{ + public string? Environment => GetUser()?.Environment; + + private readonly IOptionsMonitor _optionsMonitor; + + public DefaultMultiEnvironmentUserContext( + ITypeConvertProvider typeConvertProvider, + ICurrentPrincipalAccessor currentPrincipalAccessor, + IOptionsMonitor optionsMonitor, + ILoggerFactory? loggerFactory = null) + : base(typeConvertProvider, currentPrincipalAccessor, optionsMonitor, loggerFactory) + { + _optionsMonitor = optionsMonitor; + } + + protected override MultiEnvironmentIdentityUser? GetUser() + { + var identityUser = GetUserBasicInfo(); + if (identityUser == null) + { + return null; + } + + return new MultiEnvironmentIdentityUser + { + Id = identityUser.Id, + UserName = identityUser.UserName, + Roles = identityUser.Roles, + Environment = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.Environment), + }; + } +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs new file mode 100644 index 000000000..1ff28c5bd --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel; + +internal class DefaultMultiTenantUserContext : DefaultUserContext, IMultiTenantUserContext +{ + public string? TenantId => GetUser()?.TenantId; + + private readonly IOptionsMonitor _optionsMonitor; + + public DefaultMultiTenantUserContext( + ITypeConvertProvider typeConvertProvider, + ICurrentPrincipalAccessor currentPrincipalAccessor, + IOptionsMonitor optionsMonitor, + ILoggerFactory? loggerFactory = null) + : base(typeConvertProvider, currentPrincipalAccessor, optionsMonitor, loggerFactory) + { + _optionsMonitor = optionsMonitor; + } + + public virtual TTenantId? GetTenantId() + { + var tenantId = TenantId; + if (tenantId == null) + return default; + + return TypeConvertProvider.ConvertTo(tenantId); + } + + protected override MultiTenantIdentityUser? GetUser() + { + var identityUser = GetUserBasicInfo(); + if (identityUser == null) + { + return null; + } + + return new MultiTenantIdentityUser + { + Id = identityUser.Id, + UserName = identityUser.UserName, + Roles = identityUser.Roles, + TenantId = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.TenantId), + }; + } +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs new file mode 100644 index 000000000..64e0ad129 --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel; + +internal class DefaultUserContext : UserContext +{ + private readonly IOptionsMonitor _optionsMonitor; + private readonly ILogger? _logger; + + protected ClaimsPrincipal? ClaimsPrincipal { get; set; } + + public DefaultUserContext( + ITypeConvertProvider typeConvertProvider, + ICurrentPrincipalAccessor currentPrincipalAccessor, + IOptionsMonitor optionsMonitor, ILoggerFactory? loggerFactory = null) + : base(typeConvertProvider) + { + _optionsMonitor = optionsMonitor; + ClaimsPrincipal = currentPrincipalAccessor.GetCurrentPrincipal(); + _logger = loggerFactory?.CreateLogger(); + } + + protected override IdentityUser? GetUser() + { + return GetUserBasicInfo(); + } + + protected override IdentityUser? GetUserBasicInfo() + { + + var userId = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.UserId); + if (userId == null) + return null; + + var roleStr = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.Role); + var roles = new List>(); + if (!string.IsNullOrWhiteSpace(roleStr)) + { + try + { + roles = JsonSerializer.Deserialize>>(roleStr) ?? roles; + } + catch (Exception e) + { + _logger?.LogError("role data deserialization failed", e); + } + } + return new IdentityUser + { + Id = userId, + UserName = ClaimsPrincipal?.FindClaimValue(_optionsMonitor.CurrentValue.UserName), + Roles = roles + }; + } +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs new file mode 100644 index 000000000..98d647299 --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel; + +public class HttpContextCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public HttpContextCurrentPrincipalAccessor(IHttpContextAccessor httpContextAccessor) => _httpContextAccessor = httpContextAccessor; + + public override ClaimsPrincipal? GetCurrentPrincipal() + => _httpContextAccessor.HttpContext?.User ?? base.GetCurrentPrincipal(); +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs new file mode 100644 index 000000000..056376d42 --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel; + +public interface ICurrentPrincipalAccessor +{ + ClaimsPrincipal? GetCurrentPrincipal(); +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs new file mode 100644 index 000000000..4f64d1aa5 --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel; + +public class IdentityClaimOptions +{ + public string UserId { get; set; } + + public string UserName { get; set; } + + public string Role { get; set; } + + public string TenantId { get; set; } + + public string Environment { get; set; } + + public IdentityClaimOptions() + { + UserId = ClaimType.DEFAULT_USER_ID; + UserName = ClaimType.DEFAULT_USER_NAME; + Role = ClaimType.DEFAULT_USER_ROLE; + TenantId = ClaimType.DEFAULT_TENANT_ID; + Environment = ClaimType.DEFAULT_ENVIRONMENT; + } +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj new file mode 100644 index 000000000..2192d0a54 --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.md b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.md new file mode 100644 index 000000000..8f704f771 --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.md @@ -0,0 +1,49 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Identity + +Example: + +```` C# +Install-Package Masa.Contrib.Identity.IdentityModel +```` + +1. Modify `Program.cs` + +```` C# +builder.Services.AddMasaIdentityModel(); +```` + +2. Get user information + +```` C# +IUserContext userContext;//Get IUserContext from DI +userContext.User;//Get user information +```` + +> The default user information is obtained from HttpContext.User +> +> UserId: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_USER_ID +> +> UserName: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_USER_NAME +> +> TenantId: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_TENANT_ID +> +> Environment: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_ENVIRONMENT + +3. Temporarily change the current login user information + +```` C# +IUserSetter userSetter;//Get IUserSetter from DI +var user = new IdentityUser() +{ + Id = "2", + UserName = "Tom", + Environment = "Production", + TenantId = "2" +}; +using(userSetter.Change(user)) +{ + //The obtained user information is Tom +} +```` \ No newline at end of file diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md new file mode 100644 index 000000000..916fba22b --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md @@ -0,0 +1,49 @@ +中 | [EN](README.md) + +## Masa.Contrib.Identity + +用例: + +``` C# +Install-Package Masa.Contrib.Identity.IdentityModel +``` + +1. 修改`Program.cs` + +``` C# +builder.Services.AddMasaIdentityModel(); +``` + +2. 获取用户信息 + +``` C# +IUserContext userContext;//从DI中获取IUserContext +userContext.User;//获取用户信息 +``` + +> 默认用户信息从HttpContext.User中获取 +> +> UserId: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_USER_ID +> +> UserName: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_USER_NAME +> +> TenantId: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_TENANT_ID +> +> Environment: Masa.Contrib.IdentityModel.Const.ClaimType.DEFAULT_ENVIRONMENT + +3. 临时更改当前登录用户信息 + +``` C# +IUserSetter userSetter;//从DI中获取IUserSetter +var user = new IdentityUser() +{ + Id = "2", + UserName = "Tom", + Environment = "Production", + TenantId = "2" +}; +using (userSetter.Change(user)) +{ + //获取到的用户信息为Tom +} +``` \ No newline at end of file diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..28e782e81 --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs @@ -0,0 +1,100 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddMasaIdentityModel( + this IServiceCollection services, + IdentityType identityType = IdentityType.Basic) + => services.AddMasaIdentityModel(identityType, _ => + { + }); + + public static IServiceCollection AddMasaIdentityModel( + this IServiceCollection services, + IdentityType identityType, + Action configureOptions) + { + ArgumentNullException.ThrowIfNull(configureOptions); + + if (services.Any()) + return services; + + services.AddSingleton(); + services.TryAddSingleton(); + services.AddHttpContextAccessor(); + services.TryAddSingleton(); + + services.Configure(configureOptions); + + if (identityType.HasFlag(IdentityType.MultiTenant) && identityType.HasFlag(IdentityType.MultiEnvironment)) + return services.AddMasaIdentityByIsolation(); + + if (identityType.HasFlag(IdentityType.MultiTenant)) + return services.AddMasaIdentityByMultiTenant(); + + if (identityType.HasFlag(IdentityType.MultiEnvironment)) + return services.AddMasaIdentityByMultiEnvironment(); + + if ((identityType & IdentityType.Basic) != 0) + return services.AddMasaIdentityByBasic(); + + throw new NotSupportedException(nameof(identityType)); + } + + private static IServiceCollection AddMasaIdentityByBasic(this IServiceCollection services) + { + services.TryAddScoped(); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + return services; + } + + private static IServiceCollection AddMasaIdentityByMultiTenant(this IServiceCollection services) + { + services.TryAddScoped(); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + return services; + } + + private static IServiceCollection AddMasaIdentityByMultiEnvironment(this IServiceCollection services) + { + services.TryAddScoped(); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + return services; + } + + private static IServiceCollection AddMasaIdentityByIsolation(this IServiceCollection services) + { + services.TryAddScoped(); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + services.TryAddScoped(serviceProvider + => serviceProvider.GetRequiredService()); + return services; + } + + private class IdentityProvider + { + } +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs new file mode 100644 index 000000000..f6aaae84d --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel; + +public class ThreadCurrentPrincipalAccessor : ICurrentPrincipalAccessor +{ + public virtual ClaimsPrincipal? GetCurrentPrincipal() => Thread.CurrentPrincipal as ClaimsPrincipal; +} diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/_Imports.cs b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/_Imports.cs new file mode 100644 index 000000000..287fe982b --- /dev/null +++ b/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.Contrib.Identity.IdentityModel; +global using Masa.Contrib.Identity.IdentityModel.Const; +global using Microsoft.AspNetCore.Http; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using System.Security.Claims; +global using System.Text.Json; diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj new file mode 100644 index 000000000..d71eab6fd --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + $(WarningsAsErrors);CS8600;CS8601;CS8602;CS8603;CS8604;CS8609;CS8610;CS8614;CS8616;CS8618;CS8619;CS8620;CS8622;CS8625 + + + + + + + + + diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md new file mode 100644 index 000000000..7c54883d0 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md @@ -0,0 +1,47 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Authentication.Oidc.Cache.Storage + +Effect: + +Use IClientStore and IResourceStore get oidc resources and client data. + +```c# +├── IClientStore +├── IResourceStore +``` + +Example: + +```C# +Install-Package Masa.Contrib.Authentication.Oidc.Cache.Storage +``` + +```C# +builder.Services.AddOidcCacheStorage(nnew RedisConfigurationOptions +{ + Servers = new List + { + new RedisServerOptions + { + Host="127.0.0.1", + Port=6379 + } + }, + DefaultDatabase = 0, + Password = "", +}); +``` + +How to use: + +```c# +var app = builder.Build(); + +app.MapGet("/GetClient", async ([FromServices] IClientStore store) => +{ + return await store.FindClientByIdAsync("clientId"); +}); + +app.Run(); +``` diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md new file mode 100644 index 000000000..7d050dabb --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md @@ -0,0 +1,47 @@ +中 | [EN](README.md) + +## Masa.Contrib.Authentication.Oidc.Cache.Storag + +作用: + +通过IClientStore和IResourceStore获取资源和客户端的相关数据 + +```c# +├── IClientStore +├── IResourceStore +``` + +用例: + +```C# +Install-Package Masa.Contrib.Authentication.Oidc.Cache.Storag +``` + +```C# +builder.Services.AddOidcCacheStorage(nnew RedisConfigurationOptions +{ + Servers = new List + { + new RedisServerOptions + { + Host="127.0.0.1", + Port=6379 + } + }, + DefaultDatabase = 0, + Password = "", +}); +``` + +如何使用: + +```c# +var app = builder.Build(); + +app.MapGet("/GetClient", async ([FromServices] IClientStore store) => +{ + return await store.FindClientByIdAsync("clientId"); +}); + +app.Run(); +``` diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..850232a68 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Storage; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddOidcCacheStorage(this IServiceCollection services, RedisConfigurationOptions options) + { + services.AddOidcCache(options); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + + return services; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs new file mode 100644 index 000000000..bd2ad9e71 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; + +public class ClientStore : IClientStore +{ + IClientCache _clientCache; + + public ClientStore(IClientCache clientCache) + { + _clientCache = clientCache; + } + + public async Task FindClientByIdAsync(string clientId) + { + ArgumentNullException.ThrowIfNull(clientId); + + var client = await _clientCache.GetAsync(clientId); + return client; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs new file mode 100644 index 000000000..2e6f65101 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; + +public class DeviceFlowStore : IDeviceFlowStore +{ + public Task FindByDeviceCodeAsync(string deviceCode) + { + throw new NotImplementedException(); + } + + public Task FindByUserCodeAsync(string userCode) + { + throw new NotImplementedException(); + } + + public Task RemoveByDeviceCodeAsync(string deviceCode) + { + throw new NotImplementedException(); + } + + public Task StoreDeviceAuthorizationAsync(string deviceCode, string userCode, DeviceCodeModel data) + { + throw new NotImplementedException(); + } + + public Task UpdateByUserCodeAsync(string userCode, DeviceCodeModel data) + { + throw new NotImplementedException(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs new file mode 100644 index 000000000..ebab3a890 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; + +public class PersistedGrantStore : IPersistedGrantStore +{ + public Task> GetAllAsync(PersistedGrantFilter filter) + { + throw new NotImplementedException(); + } + + public Task GetAsync(string key) + { + throw new NotImplementedException(); + } + + public Task RemoveAllAsync(PersistedGrantFilter filter) + { + throw new NotImplementedException(); + } + + public Task RemoveAsync(string key) + { + throw new NotImplementedException(); + } + + public Task StoreAsync(PersistedGrantModel grant) + { + throw new NotImplementedException(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs new file mode 100644 index 000000000..856805159 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs @@ -0,0 +1,58 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; + +public class ResourceStore : IResourceStore +{ + IIdentityResourceCache _identityResourceCache; + IApiResourceCache _apiResourceCache; + IApiScopeCache _apiScopeCache; + + public ResourceStore(IIdentityResourceCache identityResourceCache, IApiResourceCache apiResourceCache, IApiScopeCache apiScopeCache) + { + _identityResourceCache = identityResourceCache; + _apiResourceCache = apiResourceCache; + _apiScopeCache = apiScopeCache; + } + + public async Task> FindApiResourcesByNameAsync(IEnumerable apiResourceNames) + { + ArgumentNullException.ThrowIfNull(apiResourceNames); + + return await _apiResourceCache.GetListAsync(apiResourceNames); + } + + public async Task> FindApiResourcesByScopeNameAsync(IEnumerable scopeNames) + { + ArgumentNullException.ThrowIfNull(scopeNames); + + var apiResources = await _apiResourceCache.GetListAsync(); + return apiResources.Where(apiResource => apiResource.Scopes?.Any(scope => scopeNames.Contains(scope)) is true); + } + + public async Task> FindApiScopesByNameAsync(IEnumerable scopeNames) + { + ArgumentNullException.ThrowIfNull(scopeNames); + + var apiScopes = await _apiScopeCache.GetListAsync(scopeNames); + return apiScopes; + } + + public async Task> FindIdentityResourcesByScopeNameAsync(IEnumerable scopeNames) + { + ArgumentNullException.ThrowIfNull(scopeNames); + + var identityResources = await _identityResourceCache.GetListAsync(scopeNames); + return identityResources; + } + + public async Task GetAllResourcesAsync() + { + var identityResources = await _identityResourceCache.GetListAsync(); + var apiScopes = await _apiScopeCache.GetListAsync(); + var apiResources = await _apiResourceCache.GetListAsync(); + var resources = new ResourcesModel(identityResources, apiResources, apiScopes); + return resources; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs new file mode 100644 index 000000000..111ca2413 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +global using Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; +global using Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; +global using Microsoft.Extensions.DependencyInjection; +global using Masa.Utils.Caching.Redis.Models; diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs new file mode 100644 index 000000000..1a5afadc8 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs @@ -0,0 +1,78 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; + +public class ApiResourceCache : IApiResourceCache +{ + IMemoryCacheClient _memoryCacheClient; + + public ApiResourceCache(IMemoryCacheClient memoryCacheClient) + { + _memoryCacheClient = memoryCacheClient; + } + + public async Task> GetListAsync(IEnumerable names) + { + var keys = names.Select(name => FormatKey(name)); + var apiResources = await _memoryCacheClient.GetListAsync(keys.ToArray()); + return apiResources.Where(apiResource => apiResource is not null).ToList()!; + } + + public async Task> GetListAsync() + { + var apiResources = await _memoryCacheClient.GetAsync>(CacheKeyConstants.API_RESOURCE_KEY) ?? new(); + return apiResources; + } + + public async Task SetAsync(ApiResource apiResource) + { + var model = apiResource.ToModel(); + await _memoryCacheClient.SetAsync(FormatKey(apiResource), model); + // update list cache + var list = await GetListAsync(); + list.Set(model, item => item.Name); + await UpdateListAsync(list); + } + + public async Task SetRangeAsync(IEnumerable apiResources) + { + var map = apiResources.ToDictionary(apiResource => FormatKey(apiResource), apiResource => apiResource.ToModel()); + await _memoryCacheClient.SetListAsync(map); + // update list cache + var list = await GetListAsync(); + list.SetRange(map.Values, item => item.Name); + await UpdateListAsync(list); + } + + public async Task RemoveAsync(ApiResource apiResource) + { + await _memoryCacheClient.RemoveAsync(FormatKey(apiResource)); + // update list cache + var list = await GetListAsync(); + list.Remove(item => item.Name == apiResource.Name); + await UpdateListAsync(list); + } + + public async Task ResetAsync(IEnumerable apiResources) + { + var map = apiResources.ToDictionary(apiResource => FormatKey(apiResource), apiResource => apiResource.ToModel()); + await _memoryCacheClient.SetListAsync(map); + await UpdateListAsync(map.Values); + } + + private async Task UpdateListAsync(IEnumerable models) + { + await _memoryCacheClient.SetAsync(CacheKeyConstants.API_RESOURCE_KEY, models); + } + + private string FormatKey(ApiResource apiResources) + { + return FormatKey(apiResources.Name); + } + + private string FormatKey(string name) + { + return $"{CacheKeyConstants.API_RESOURCE_KEY}_{name}"; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs new file mode 100644 index 000000000..7ffdab3f5 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs @@ -0,0 +1,78 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; + +public class ApiScopeCache : IApiScopeCache +{ + IMemoryCacheClient _memoryCacheClient; + + public ApiScopeCache(IMemoryCacheClient memoryCacheClient) + { + _memoryCacheClient = memoryCacheClient; + } + + public async Task> GetListAsync(IEnumerable names) + { + var keys = names.Select(name => FormatKey(name)).ToArray(); + var apiScopes = await _memoryCacheClient.GetListAsync(keys); + return apiScopes.Where(apiScope => apiScope is not null).ToList()!; + } + + public async Task> GetListAsync() + { + var apiScopes = await _memoryCacheClient.GetAsync>(CacheKeyConstants.API_SCOPE_KEY) ?? new(); + return apiScopes; + } + + public async Task SetAsync(ApiScope apiScope) + { + var model = apiScope.ToModel(); + await _memoryCacheClient.SetAsync(FormatKey(apiScope), model); + // update list cache + var list = await GetListAsync(); + list.Set(model, item => item.Name); + await UpdateListAsync(list); + } + + public async Task SetRangeAsync(IEnumerable apiScopes) + { + var map = apiScopes.ToDictionary(apiScope => FormatKey(apiScope), apiScope => apiScope.ToModel()); + await _memoryCacheClient.SetListAsync(map); + // update list cache + var list = await GetListAsync(); + list.SetRange(map.Values, item => item.Name); + await UpdateListAsync(list); + } + + public async Task RemoveAsync(ApiScope apiScope) + { + await _memoryCacheClient.RemoveAsync(FormatKey(apiScope)); + // update list cache + var list = await GetListAsync(); + list.Remove(item => item.Name == apiScope.Name); + await UpdateListAsync(list); + } + + public async Task ResetAsync(IEnumerable apiScopes) + { + var map = apiScopes.ToDictionary(apiScope => FormatKey(apiScope), apiScope => apiScope.ToModel()); + await _memoryCacheClient.SetListAsync(map); + await UpdateListAsync(map.Values); + } + + private async Task UpdateListAsync(IEnumerable models) + { + await _memoryCacheClient.SetAsync(CacheKeyConstants.API_SCOPE_KEY, models); + } + + private string FormatKey(ApiScope apiScopes) + { + return FormatKey(apiScopes.Name); + } + + private string FormatKey(string name) + { + return $"{CacheKeyConstants.API_SCOPE_KEY}_{name}"; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs new file mode 100644 index 000000000..3cb9e950a --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs @@ -0,0 +1,58 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; + +public class ClientCache : IClientCache +{ + IMemoryCacheClient _memoryCacheClient; + + public ClientCache(IMemoryCacheClient memoryCacheClient) + { + _memoryCacheClient = memoryCacheClient; + } + + public async Task GetAsync(string clientId) + { + return await _memoryCacheClient.GetAsync(FormatKey(clientId)); + } + + public async Task> GetListAsync(IEnumerable clientIds) + { + var keys = clientIds.Select(clientId => FormatKey(clientId)).ToArray(); + var clients = await _memoryCacheClient.GetListAsync(keys); + return clients.Where(client => client is not null).ToList()!; + } + + public async Task SetAsync(Client client) + { + await _memoryCacheClient.SetAsync(FormatKey(client), client.ToModel()); + } + + public async Task RemoveAsync(Client client) + { + await _memoryCacheClient.RemoveAsync(FormatKey(client)); + } + + public async Task SetRangeAsync(IEnumerable clients) + { + var data = clients.ToDictionary(client => FormatKey(client), client => client.ToModel()); + await _memoryCacheClient.SetListAsync(data); + } + + public async Task ResetAsync(IEnumerable clients) + { + var data = clients.ToDictionary(client => FormatKey(client), client => client.ToModel()); + await _memoryCacheClient.SetListAsync(data); + } + + private string FormatKey(Client client) + { + return FormatKey(client.ClientId); + } + + private string FormatKey(string clientId) + { + return $"{CacheKeyConstants.CLIENT_KEY}_{clientId}"; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs new file mode 100644 index 000000000..ad250936c --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs @@ -0,0 +1,78 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; + +public class IdentityResourceCache : IIdentityResourceCache +{ + IMemoryCacheClient _memoryCacheClient; + + public IdentityResourceCache(IMemoryCacheClient memoryCacheClient) + { + _memoryCacheClient = memoryCacheClient; + } + + public async Task> GetListAsync(IEnumerable names) + { + var keys = names.Select(name => FormatKey(name)).ToArray(); + var identityResources = await _memoryCacheClient.GetListAsync(keys); + return identityResources.Where(identityResource => identityResource is not null).ToList()!; + } + + public async Task> GetListAsync() + { + var identityResources = await _memoryCacheClient.GetAsync>(CacheKeyConstants.IDENTITY_RESOURCE_KEY) ?? new(); + return identityResources; + } + + public async Task SetAsync(IdentityResource identityResource) + { + var model = identityResource.ToModel(); + await _memoryCacheClient.SetAsync(FormatKey(identityResource), model); + // update list cache + var list = await GetListAsync(); + list.Set(model, item => item.Name); + await UpdateListAsync(list); + } + + public async Task SetRangeAsync(IEnumerable identityResources) + { + var map = identityResources.ToDictionary(identityResource => FormatKey(identityResource), identityResource => identityResource.ToModel()); + await _memoryCacheClient.SetListAsync(map); + // update list cache + var list = await GetListAsync(); + list.SetRange(map.Values, item => item.Name); + await UpdateListAsync(list); + } + + public async Task RemoveAsync(IdentityResource identityResource) + { + await _memoryCacheClient.RemoveAsync(FormatKey(identityResource)); + // update list cache + var list = await GetListAsync(); + list.Remove(item => item.Name == identityResource.Name); + await UpdateListAsync(list); + } + + public async Task ResetAsync(IEnumerable identityResources) + { + var map = identityResources.ToDictionary(identityResource => FormatKey(identityResource), identityResource => identityResource.ToModel()); + await _memoryCacheClient.SetListAsync(map); + await UpdateListAsync(map.Values); + } + + private async Task UpdateListAsync(IEnumerable models) + { + await _memoryCacheClient.SetAsync(CacheKeyConstants.IDENTITY_RESOURCE_KEY, models); + } + + private string FormatKey(IdentityResource identityResources) + { + return FormatKey(identityResources.Name); + } + + private string FormatKey(string name) + { + return $"{CacheKeyConstants.IDENTITY_RESOURCE_KEY}_{name}"; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj new file mode 100644 index 000000000..49037dd72 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs new file mode 100644 index 000000000..c5d9e6a1e --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Models; + +public static class CacheKeyConstants +{ + public const string CLIENT_KEY = "oidc_client"; + public const string API_RESOURCE_KEY = "oidc_apiResource"; + public const string API_SCOPE_KEY = "oidc_apiScope"; + public const string IDENTITY_RESOURCE_KEY = "oidc_identityResource"; +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs new file mode 100644 index 000000000..7945f9ab1 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs @@ -0,0 +1,106 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Models; + +public static class Mapper +{ + public static ApiScopeModel ToModel(this ApiScope apiScope) + { + return new ApiScopeModel(apiScope.Name, apiScope.DisplayName, apiScope.UserClaims.Select(uc => uc.UserClaim.Name).ToList()) + { + Required = apiScope.Required, + Emphasize = apiScope.Emphasize, + Enabled = apiScope.Enabled, + Description = apiScope.Description, + Properties = apiScope.Properties.ToDictionary(p => p.Key, p => p.Value), + ShowInDiscoveryDocument = apiScope.ShowInDiscoveryDocument, + }; + } + + public static IdentityResourceModel ToModel(this IdentityResource identityResource) + { + return new IdentityResourceModel(identityResource.Name, identityResource.DisplayName, identityResource.UserClaims.Select(uc => uc.UserClaim.Name).ToList()) + { + Required = identityResource.Required, + Emphasize = identityResource.Emphasize, + Enabled = identityResource.Enabled, + Description = identityResource.Description, + Properties = identityResource.Properties.ToDictionary(p => p.Key, p => p.Value), + ShowInDiscoveryDocument = identityResource.ShowInDiscoveryDocument, + }; + } + + public static ApiResourceModel ToModel(this ApiResource apiResource) + { + return new ApiResourceModel(apiResource.Name, apiResource.DisplayName, apiResource.UserClaims.Select(uc => uc.UserClaim.Name).ToList()) + { + Scopes = apiResource.ApiScopes.Select(a => a.ApiScope.Name).ToList(), + ApiSecrets = apiResource.Secrets.Select(s => new SecretModel(s.Value, s.Description, s.Expiration)).ToList(), + AllowedAccessTokenSigningAlgorithms = Convert(apiResource.AllowedAccessTokenSigningAlgorithms), + Enabled = apiResource.Enabled, + Description = apiResource.Description, + ShowInDiscoveryDocument = apiResource.ShowInDiscoveryDocument, + }; + + ICollection Convert(string sourceMember) + { + var list = new HashSet(); + if (!string.IsNullOrWhiteSpace(sourceMember)) + { + sourceMember = sourceMember.Trim(); + foreach (var item in sourceMember.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Distinct()) + { + list.Add(item); + } + } + return list; + } + } + + public static ClientModel ToModel(this Client client) + { + return new ClientModel(client.ClientId.ToString(), client.ClientName, client.Description, client.ClientUri, client.LogoUri, client.RedirectUris.Select(r => r.RedirectUri), client.PostLogoutRedirectUris.Select(p => p.PostLogoutRedirectUri), client.AllowedGrantTypes.Select(a => a.GrantType), client.AllowedScopes.Select(a => a.Scope)) + { + Enabled = client.Enabled, + ProtocolType = client.ProtocolType, + RequireConsent = client.RequireConsent, + AllowRememberConsent = client.AllowRememberConsent, + RequireClientSecret = client.RequireClientSecret, + AlwaysIncludeUserClaimsInIdToken = client.AlwaysIncludeUserClaimsInIdToken, + AllowPlainTextPkce = client.AllowPlainTextPkce, + RequireRequestObject = client.RequireRequestObject, + RequirePkce = client.RequirePkce, + FrontChannelLogoutUri = client.FrontChannelLogoutUri, + FrontChannelLogoutSessionRequired = client.FrontChannelLogoutSessionRequired, + BackChannelLogoutUri = client.BackChannelLogoutUri, + BackChannelLogoutSessionRequired = client.BackChannelLogoutSessionRequired, + AllowOfflineAccess = client.AllowOfflineAccess, + IdentityTokenLifetime = client.IdentityTokenLifetime, + AccessTokenLifetime = client.AccessTokenLifetime, + AuthorizationCodeLifetime = client.AuthorizationCodeLifetime, + ConsentLifetime = client.ConsentLifetime, + AbsoluteRefreshTokenLifetime = client.AbsoluteRefreshTokenLifetime, + SlidingRefreshTokenLifetime = client.SlidingRefreshTokenLifetime, + UpdateAccessTokenClaimsOnRefresh = client.UpdateAccessTokenClaimsOnRefresh, + EnableLocalLogin = client.EnableLocalLogin, + AlwaysSendClientClaims = client.AlwaysSendClientClaims, + Claims = client.Claims.Select(c => new ClientClaimModel(c.Type, c.Value)).ToList(), + AllowedCorsOrigins = client.AllowedCorsOrigins.Select(a => a.Origin).ToList(), + Properties = client.Properties.ToDictionary(p => p.Key, p => p.Value), + IdentityProviderRestrictions = client.IdentityProviderRestrictions.Select(i => i.Provider).ToList(), + AllowAccessTokensViaBrowser = client.AllowAccessTokensViaBrowser, + IncludeJwtId = client.IncludeJwtId, + AccessTokenType = (AccessTokenType)client.AccessTokenType, + DeviceCodeLifetime = client.DeviceCodeLifetime, + UserSsoLifetime = client.UserSsoLifetime, + RefreshTokenExpiration = (TokenExpiration)client.RefreshTokenExpiration, + RefreshTokenUsage = (TokenUsage)client.RefreshTokenUsage, + ClientClaimsPrefix = client.ClientClaimsPrefix, + PairWiseSubjectSalt = client.PairWiseSubjectSalt, + UserCodeType = client.UserCodeType, + ClientSecrets = client.ClientSecrets.Select(s => new SecretModel(s.Type, s.Value)).ToList(), + AllowedIdentityTokenSigningAlgorithms = client.AllowedIdentityTokenSigningAlgorithms.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(), + }; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.md new file mode 100644 index 000000000..888728030 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.md @@ -0,0 +1,49 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Authentication.Oidc.Cache + +Effect: + +Use the second level cache to operate resources and client data. + +```c# +├── ApiResourceCache +├── ApiScopeCache +├── ClientCache +├── IdentityResourceCache +``` + +Example: + +```C# +Install-Package Masa.Contrib.Authentication.Oidc.Cache +``` + +```C# +builder.Services.AddOidcCache(nnew RedisConfigurationOptions +{ + Servers = new List + { + new RedisServerOptions + { + Host="127.0.0.1", + Port=6379 + } + }, + DefaultDatabase = 0, + Password = "", +}); +``` + +How to use: + +```c# +var app = builder.Build(); + +app.MapGet("/GetClient", async ([FromServices] IClientCache cache) => +{ + return await cache.GetAsync("clientId"); +}); + +app.Run(); +``` diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md new file mode 100644 index 000000000..6e29ffc4c --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md @@ -0,0 +1,49 @@ +中 | [EN](README.md) + +## Masa.Contrib.Authentication.Oidc.Cache + +作用: + +使用二级缓存来操作资源和客户端数据。 + +```c# +├── ApiResourceCache +├── ApiScopeCache +├── ClientCache +├── IdentityResourceCache +``` + +用例: + +```C# +Install-Package Masa.Contrib.Authentication.Oidc.Cache +``` + +```C# +builder.Services.AddOidcCache(nnew RedisConfigurationOptions +{ + Servers = new List + { + new RedisServerOptions + { + Host="127.0.0.1", + Port=6379 + } + }, + DefaultDatabase = 0, + Password = "", +}); +``` + +如何使用: + +```c# +var app = builder.Build(); + +app.MapGet("/GetClient", async ([FromServices] IClientCache cache) => +{ + return await cache.GetAsync("clientId"); +}); + +app.Run(); +``` diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..a663238b9 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddOidcCache(this IServiceCollection services, RedisConfigurationOptions options) + { + services.AddMasaRedisCache(options).AddMasaMemoryCache(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + + return services; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs new file mode 100644 index 000000000..b52bd7fb3 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs @@ -0,0 +1,52 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.Cache.Utils; + +public static class CollectionExtensions +{ + public static void Set(this ICollection collection, T data, Func keySelector) + { + collection.Remove(data, keySelector); + collection.Add(data); + } + + public static void SetRange(this ICollection collection, IEnumerable datas, Func keySelector) + { + collection.RemoveRange(datas, keySelector); + foreach (var data in datas) + { + collection.Add(data); + } + } + + public static void Remove(this ICollection collection, T data, Func keySelector) + { + var oldData = collection.FirstOrDefault(item => keySelector(item).Equals(keySelector(data))); + if (oldData is not null) collection.Remove(oldData); + } + + public static void RemoveRange(this ICollection collection, IEnumerable datas, Func keySelector) + { + var oldDatas = collection.Where(item => datas.Any(data => keySelector(data).Equals(keySelector(item)))).ToList(); + if (oldDatas.Count() > 0) + { + foreach (var oldData in oldDatas) + { + collection.Remove(oldData); + } + } + } + + public static void Remove(this ICollection collection, Func condition) + { + var datas = collection.Where(condition).ToList(); + if(datas.Count() > 0) + { + foreach (var data in datas) + { + collection.Remove(data); + } + } + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs new file mode 100644 index 000000000..bf854463c --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +global using Masa.Contrib.Authentication.Oidc.Cache.Caches; +global using Masa.Contrib.Authentication.Oidc.Cache.Models; +global using Masa.Contrib.Authentication.Oidc.Cache.Utils; +global using Masa.Utils.Caching.DistributedMemory.DependencyInjection; +global using Masa.Utils.Caching.DistributedMemory.Interfaces; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs new file mode 100644 index 000000000..cb67b22ef --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs @@ -0,0 +1,111 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Caches; + +public class SyncCache +{ + IClientCache _clientCache; + IApiResourceCache _apiResourceCache; + IApiScopeCache _apiScopeCache; + IIdentityResourceCache _identityResourceCache; + DbContext _context; + + public SyncCache(IClientCache clientCache, IApiResourceCache apiResourceCache, IApiScopeCache apiScopeCache, IIdentityResourceCache identityResourceCache, OidcDbContext context) + { + _clientCache = clientCache; + _apiResourceCache = apiResourceCache; + _apiScopeCache = apiScopeCache; + _identityResourceCache = identityResourceCache; + _context = context; + } + + internal async Task SyncApiResourceCacheAsync(int id) + { + var apiResource = await ApiResourceQuery().FirstOrDefaultAsync(apiResource => apiResource.Id == id); + if (apiResource is null) return; + await _apiResourceCache.SetAsync(apiResource); + } + + internal async Task SyncApiScopeCacheAsync(int id) + { + var apiScope = await ApiScopeQuery().FirstOrDefaultAsync(apiScope => apiScope.Id == id); + if (apiScope is null) return; + await _apiScopeCache.SetAsync(apiScope); + } + + internal async Task SyncIdentityResourceCacheAsync(params int[] ids) + { + var identityResources = await IdentityResourceQuery().Where(idrs => ids.Contains(idrs.Id)).ToListAsync(); + if (identityResources.Count < 0) return; + await _identityResourceCache.SetRangeAsync(identityResources); + } + + internal async Task RemoveApiResourceCacheAsync(ApiResource apiResource) + { + await _apiResourceCache.RemoveAsync(apiResource); + } + + internal async Task RemoveApiScopeCacheAsync(ApiScope apiScope) + { + await _apiScopeCache.RemoveAsync(apiScope); + } + + internal async Task RemoveIdentityResourceCacheAsync(IdentityResource identityResource) + { + await _identityResourceCache.RemoveAsync(identityResource); + } + + public async Task ResetAsync() + { + var clients = await ClientQuery().ToListAsync(); + var apiScopes = await ApiScopeQuery().ToListAsync(); + var apiResources = await ApiResourceQuery().ToListAsync(); + var identityResource = await IdentityResourceQuery().ToListAsync(); + + await _clientCache.ResetAsync(clients); + await _apiScopeCache.ResetAsync(apiScopes); + await _apiResourceCache.ResetAsync(apiResources); + await _identityResourceCache.ResetAsync(identityResource); + } + + private IQueryable ClientQuery() + { + return _context.Set() + .Include(c => c.AllowedGrantTypes) + .Include(c => c.RedirectUris) + .Include(c => c.PostLogoutRedirectUris) + .Include(c => c.Properties) + .Include(c => c.Claims) + .Include(c => c.IdentityProviderRestrictions) + .Include(c => c.AllowedCorsOrigins) + .Include(c => c.ClientSecrets) + .Include(c => c.AllowedScopes); + } + + private IQueryable IdentityResourceQuery() + { + return _context.Set() + .Include(idrs => idrs.UserClaims) + .ThenInclude(uc => uc.UserClaim) + .Include(idrs => idrs.Properties); + } + + private IQueryable ApiScopeQuery() + { + return _context.Set() + .Include(apiScope => apiScope.UserClaims) + .ThenInclude(apiScope => apiScope.UserClaim) + .Include(apiScope => apiScope.Properties); + } + + private IQueryable ApiResourceQuery() + { + return _context.Set() + .Include(apiResource => apiResource.UserClaims) + .ThenInclude(userClaim => userClaim.UserClaim) + .Include(apiResource => apiResource.Properties) + .Include(apiResource => apiResource.ApiScopes) + .ThenInclude(apiScope => apiScope.ApiScope); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs new file mode 100644 index 000000000..7d39a137c --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.DbContexts; + +public class OidcDbContext +{ + public DbContext Dbcontext { get; set; } + + public OidcDbContext(DbContext dbcontext) + { + Dbcontext = dbcontext; + } + + public static implicit operator DbContext(OidcDbContext context) + { + return context.Dbcontext; + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..1b1e4ee88 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ApiResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(x => x.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs new file mode 100644 index 000000000..f4acbda1c --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ApiResourceEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Name).HasMaxLength(200).IsRequired(); + builder.Property(x => x.DisplayName).HasMaxLength(200); + builder.Property(x => x.Description).HasMaxLength(1000); + builder.Property(x => x.AllowedAccessTokenSigningAlgorithms).HasMaxLength(100); + builder.HasIndex(x => x.Name).IsUnique().HasFilter("[IsDeleted] = 0"); + builder.HasMany(x => x.Secrets).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).OnDelete(DeleteBehavior.Cascade); + builder.HasMany(x => x.ApiScopes).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).IsRequired().OnDelete(DeleteBehavior.Cascade); + builder.HasMany(x => x.UserClaims).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).OnDelete(DeleteBehavior.Cascade); + builder.HasMany(x => x.Properties).WithOne(x => x.ApiResource).HasForeignKey(x => x.ApiResourceId).OnDelete(DeleteBehavior.Cascade); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs new file mode 100644 index 000000000..6348fd9de --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ApiResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs new file mode 100644 index 000000000..0bb2487fc --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ApiResourceScopeEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(apiResourceScope => apiResourceScope.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs new file mode 100644 index 000000000..a147bb209 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ApiResourceSecretEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Description).HasMaxLength(1000); + builder.Property(x => x.Value).HasMaxLength(4000).IsRequired(); + builder.Property(x => x.Type).HasMaxLength(250).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..75f9f67a5 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ApiScopeClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(apiScopeClaim => apiScopeClaim.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs new file mode 100644 index 000000000..e896c2544 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ApiScopeEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasIndex(apiScope => apiScope.Name).IsUnique(); + + builder.Property(apiScope => apiScope.Name).HasMaxLength(200).IsRequired(); + builder.Property(apiScope => apiScope.DisplayName).HasMaxLength(200); + builder.Property(apiScope => apiScope.Description).HasMaxLength(1000); + + builder.HasMany(apiScope => apiScope.UserClaims).WithOne(apiScope => apiScope.ApiScope).HasForeignKey(apiScope => apiScope.ApiScopeId).IsRequired().OnDelete(DeleteBehavior.Cascade); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs new file mode 100644 index 000000000..d1e77c39c --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ApiScopePropertyEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..f820fb239 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Type).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(250).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs new file mode 100644 index 000000000..b7d305fd0 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientCorsOriginEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Origin).HasMaxLength(150).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs new file mode 100644 index 000000000..6dfbec804 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs @@ -0,0 +1,35 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.ClientId).HasMaxLength(200).IsRequired(); + builder.Property(x => x.ProtocolType).HasMaxLength(200).IsRequired(); + builder.Property(x => x.ClientName).HasMaxLength(200); + builder.Property(x => x.ClientUri).HasMaxLength(2000); + builder.Property(x => x.LogoUri).HasMaxLength(2000); + builder.Property(x => x.Description).HasMaxLength(1000); + builder.Property(x => x.FrontChannelLogoutUri).HasMaxLength(2000); + builder.Property(x => x.BackChannelLogoutUri).HasMaxLength(2000); + builder.Property(x => x.ClientClaimsPrefix).HasMaxLength(200); + builder.Property(x => x.PairWiseSubjectSalt).HasMaxLength(200); + builder.Property(x => x.UserCodeType).HasMaxLength(100); + builder.Property(x => x.AllowedIdentityTokenSigningAlgorithms).HasMaxLength(100); + builder.HasIndex(x => x.ClientId); + builder.HasIndex(x => x.ClientId).IsUnique().HasFilter("[IsDeleted] = 0"); + + builder.HasMany(x => x.AllowedGrantTypes).WithOne(x => x.Client); + builder.HasMany(x => x.RedirectUris).WithOne(x => x.Client); + builder.HasMany(x => x.PostLogoutRedirectUris).WithOne(x => x.Client); + builder.HasMany(x => x.AllowedScopes).WithOne(x => x.Client); + builder.HasMany(x => x.ClientSecrets).WithOne(x => x.Client); + builder.HasMany(x => x.Claims).WithOne(x => x.Client); + builder.HasMany(x => x.IdentityProviderRestrictions).WithOne(x => x.Client); + builder.HasMany(x => x.AllowedCorsOrigins).WithOne(x => x.Client); + builder.HasMany(x => x.Properties).WithOne(x => x.Client); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs new file mode 100644 index 000000000..078f6bee9 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientGrantTypeEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.GrantType).HasMaxLength(250).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs new file mode 100644 index 000000000..020d4b47a --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientIdPRestrictionEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Provider).HasMaxLength(200).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs new file mode 100644 index 000000000..9ec42b572 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientPostLogoutRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(x => x.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs new file mode 100644 index 000000000..2dfc932b7 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientPropertyEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs new file mode 100644 index 000000000..4bd36f03a --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.RedirectUri).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs new file mode 100644 index 000000000..e1341c78f --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientScopeEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Scope).HasMaxLength(200).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs new file mode 100644 index 000000000..63cff7b2a --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class ClientSecretEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Value).HasMaxLength(4000).IsRequired(); + builder.Property(x => x.Type).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Description).HasMaxLength(2000); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs new file mode 100644 index 000000000..8d0acd9d9 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class DeviceFlowCodesEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.DeviceCode).HasMaxLength(200).IsRequired(); + builder.Property(x => x.UserCode).HasMaxLength(200).IsRequired(); + builder.Property(x => x.SubjectId).HasMaxLength(200); + builder.Property(x => x.SessionId).HasMaxLength(100); + builder.Property(x => x.ClientId).HasMaxLength(200).IsRequired(); + builder.Property(x => x.Description).HasMaxLength(200); + builder.Property(x => x.CreationTime).IsRequired(); + builder.Property(x => x.Expiration).IsRequired(); + // 50000 chosen to be explicit to allow enough size to avoid truncation, yet stay beneath the MySql row size limit of ~65K + // apparently anything over 4K converts to nvarchar(max) on SqlServer + builder.Property(x => x.Data).HasMaxLength(50000).IsRequired(); + + builder.HasKey(x => new { x.UserCode }); + + builder.HasIndex(x => x.DeviceCode).IsUnique().HasFilter("[IsDeleted] = 0"); + builder.HasIndex(x => x.Expiration); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..1f96fd9bc --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class IdentityResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(identityResourceClaim => identityResourceClaim.Id); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs new file mode 100644 index 000000000..efe5181bc --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class IdentityResourceEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Name).HasMaxLength(200).IsRequired(); + builder.Property(x => x.DisplayName).HasMaxLength(200); + builder.Property(x => x.Description).HasMaxLength(1000); + builder.HasIndex(x => x.Name).IsUnique().HasFilter("[IsDeleted] = 0"); + + builder.HasMany(x => x.UserClaims).WithOne(x => x.IdentityResource).HasForeignKey(x => x.IdentityResourceId).IsRequired().OnDelete(DeleteBehavior.Cascade); + builder.HasMany(x => x.Properties).WithOne(x => x.IdentityResource).HasForeignKey(x => x.IdentityResourceId).IsRequired().OnDelete(DeleteBehavior.Cascade); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs new file mode 100644 index 000000000..0ac7d865f --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class IdentityResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(250).IsRequired(); + builder.Property(x => x.Value).HasMaxLength(2000).IsRequired(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs new file mode 100644 index 000000000..d01df6089 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class PersistedGrantEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.Property(x => x.Key).HasMaxLength(200).ValueGeneratedNever(); + builder.Property(x => x.Type).HasMaxLength(50).IsRequired(); + builder.Property(x => x.SubjectId).HasMaxLength(200); + builder.Property(x => x.SessionId).HasMaxLength(100); + builder.Property(x => x.ClientId).HasMaxLength(200).IsRequired(); + builder.Property(x => x.Description).HasMaxLength(200); + builder.Property(x => x.CreationTime).IsRequired(); + // 50000 chosen to be explicit to allow enough size to avoid truncation, yet stay beneath the MySql row size limit of ~65K + // apparently anything over 4K converts to nvarchar(max) on SqlServer + builder.Property(x => x.Data).HasMaxLength(50000).IsRequired(); + + builder.HasKey(x => x.Key); + + builder.HasIndex(x => new { x.SubjectId, x.ClientId, x.Type }); + builder.HasIndex(x => new { x.SubjectId, x.SessionId, x.Type }); + builder.HasIndex(x => x.Expiration); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs new file mode 100644 index 000000000..1230b761d --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; + +public class UserClaimEntityTypeConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(x => x.Id); + builder.Property(x => x.Name).HasMaxLength(200).IsRequired(); + builder.Property(x => x.Description).HasMaxLength(1000); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj new file mode 100644 index 000000000..8ba99a929 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs new file mode 100644 index 000000000..fcf01b693 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs @@ -0,0 +1,41 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Options; + +public class OidcDbContextOptions +{ + internal IServiceProvider ServiceProvider { get; set; } + + public OidcDbContextOptions(IServiceProvider serviceProvider) + { + ServiceProvider = serviceProvider; + } + + public async Task SeedClientDataAsync(List clients) + { + var clientRepository = ServiceProvider.GetRequiredService(); + + foreach (var client in clients) + { + if (await clientRepository.FindAsync(s => s.ClientId == client.ClientId) is null) + { + await clientRepository.AddAsync(client); + } + } + } + + public async Task SeedStandardResourcesAsync() + { + var userClaim = ServiceProvider.GetRequiredService(); + var identityResourcerepository = ServiceProvider.GetRequiredService(); + await userClaim.AddStandardUserClaimsAsync(); + await identityResourcerepository.AddStandardIdentityResourcesAsync(); + } + + public async Task SyncCacheAsync() + { + var syncCache = ServiceProvider.GetRequiredService(); + await syncCache.ResetAsync(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md new file mode 100644 index 000000000..cfa90b183 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md @@ -0,0 +1,39 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Authentication.Oidc.EntityFrameworkCore + +Effect: + +Use the Repository to operate the Oidc database + +```c# +├── ApiResourceRepository +├── ApiScopeRepository +├── ClientRepository +├── IdentityResourceRepository +├── UserClaimRepository +``` + +Example: + +```C# +Install-Package Masa.Contrib.Authentication.Oidc.EntityFrameworkCore +``` + +```C# +builder.Services.AddOidcDbContext(option => option.UseSqlServer("ConnectionString", + b => b.MigrationsAssembly(migrationsAssembly))); +``` + +How to use: + +```c# +var app = builder.Build(); + +app.MapGet("/GetClients", async ([FromServices] IClientRepository repository) => +{ + return await repository.GetListAsync(); +}); + +app.Run(); +``` diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md new file mode 100644 index 000000000..20c85efa3 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md @@ -0,0 +1,39 @@ +中 | [EN](README.md) + +## Masa.Contrib.Authentication.Oidc.EntityFrameworkCore + +作用: + +通过Repository操作Oidc数据库 + +```c# +├── ApiResourceRepository +├── ApiScopeRepository +├── ClientRepository +├── IdentityResourceRepository +├── UserClaimRepository +``` + +用例: + +```C# +Install-Package Masa.Contrib.Authentication.Oidc.EntityFrameworkCore +``` + +```C# +builder.Services.AddOidcDbContext(option => option.UseSqlServer("ConnectionString", + b => b.MigrationsAssembly(migrationsAssembly))); +``` + +如何使用: + +```c# +var app = builder.Build(); + +app.MapGet("/GetClients", async ([FromServices] IClientRepository repository) => +{ + return await repository.GetListAsync(); +}); + +app.Run(); +``` diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs new file mode 100644 index 000000000..846f2e75d --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs @@ -0,0 +1,91 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; + +public class ApiResourceRepository : IApiResourceRepository +{ + SyncCache _cache; + DbContext _context; + IRepository _repository; + + public ApiResourceRepository(SyncCache cache, OidcDbContext context, IRepository repository) + { + _cache = cache; + _context = context; + _repository = repository; + } + + public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) + { + condition ??= userClaim => true; + var query = _context.Set().Where(condition); + var total = await query.LongCountAsync(); + var apiResources = await query.OrderByDescending(s => s.ModificationTime) + .ThenByDescending(s => s.CreationTime) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToListAsync(); + return new PaginatedList() + { + Total = total, + Result = apiResources + }; + } + + public async Task GetDetailAsync(int id) + { + var apiResource = await _context.Set() + .Include(apiResource => apiResource.UserClaims) + .ThenInclude(userClaim => userClaim.UserClaim) + .Include(apiResource => apiResource.Properties) + .Include(apiResource => apiResource.ApiScopes) + .ThenInclude(apiScope => apiScope.ApiScope) + .FirstOrDefaultAsync(apiResource => apiResource.Id == id); + + return apiResource; + } + + public async Task> GetListAsync() + { + var apiResources = await _context.Set().ToListAsync(); + return apiResources; + } + + public async Task FindAsync(Expression> predicate) + { + return await _context.Set().FirstOrDefaultAsync(predicate); + } + + public async Task GetCountAsync(Expression> predicate) + { + return await _context.Set().Where(predicate).CountAsync(); + } + + public async ValueTask AddAsync(ApiResource apiResource) + { + var exist = await _context.Set().CountAsync(a => a.Name == apiResource.Name) > 0; + if (exist) + throw new UserFriendlyException($"ApiResource with name {apiResource.Name} already exists"); + + var newApiResource = await _repository.AddAsync(apiResource); + await _context.SaveChangesAsync(); + await _cache.SyncApiResourceCacheAsync(apiResource.Id); + return newApiResource; + } + + public async Task UpdateAsync(ApiResource apiResource) + { + var newApiResource = await _repository.UpdateAsync(apiResource); + await _context.SaveChangesAsync(); + await _cache.SyncApiResourceCacheAsync(apiResource.Id); + return newApiResource; + } + + public async Task RemoveAsync(ApiResource apiResource) + { + await _repository.RemoveAsync(apiResource); + await _context.SaveChangesAsync(); + await _cache.RemoveApiResourceCacheAsync(apiResource); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs new file mode 100644 index 000000000..c85a850ee --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs @@ -0,0 +1,89 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; + +public class ApiScopeRepository : IApiScopeRepository +{ + SyncCache _cache; + DbContext _context; + IRepository _repository; + + public ApiScopeRepository(SyncCache cache, OidcDbContext context, IRepository repository) + { + _cache = cache; + _context = context; + _repository = repository; + } + + public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) + { + condition ??= userClaim => true; + var query = _context.Set().Where(condition); + var total = await query.LongCountAsync(); + var apiScopes = await query.OrderByDescending(s => s.ModificationTime) + .ThenByDescending(s => s.CreationTime) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToListAsync(); + return new PaginatedList() + { + Total = total, + Result = apiScopes + }; + } + + public async Task GetDetailAsync(int id) + { + var apiScope = await _context.Set() + .Include(apiScope => apiScope.UserClaims) + .ThenInclude(apiScope => apiScope.UserClaim) + .Include(apiScope => apiScope.Properties) + .FirstOrDefaultAsync(apiScope => apiScope.Id == id); + + return apiScope; + } + + public async Task> GetListAsync() + { + var apiScopes = await _context.Set().ToListAsync(); + return apiScopes; + } + + public async Task FindAsync(Expression> predicate) + { + return await _context.Set().FirstOrDefaultAsync(predicate); + } + + public async Task GetCountAsync(Expression> predicate) + { + return await _context.Set().Where(predicate).CountAsync(); + } + + public async ValueTask AddAsync(ApiScope apiScope) + { + var exist = await _context.Set().CountAsync(a => a.Name == apiScope.Name) > 0; + if (exist) + throw new UserFriendlyException($"ApiScope with name {apiScope.Name} already exists"); + + var newApiScope = await _repository.AddAsync(apiScope); + await _context.SaveChangesAsync(); + await _cache.SyncApiScopeCacheAsync(apiScope.Id); + return newApiScope; + } + + public async Task UpdateAsync(ApiScope apiScope) + { + var newApiScope = await _repository.UpdateAsync(apiScope); + await _context.SaveChangesAsync(); + await _cache.SyncApiScopeCacheAsync(apiScope.Id); + return newApiScope; + } + + public async Task RemoveAsync(ApiScope apiScope) + { + await _repository.RemoveAsync(apiScope); + await _context.SaveChangesAsync(); + await _cache.RemoveApiScopeCacheAsync(apiScope); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs new file mode 100644 index 000000000..7705f911f --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs @@ -0,0 +1,92 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; + +public class ClientRepository : IClientRepository +{ + IClientCache _cache; + DbContext _context; + IRepository _repository; + + public ClientRepository(IClientCache cache, OidcDbContext context, IRepository repository) + { + _cache = cache; + _context = context; + _repository = repository; + } + + public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) + { + condition ??= userClaim => true; + var query = _context.Set().Where(condition); + var total = await query.LongCountAsync(); + var clients = await query.OrderByDescending(s => s.ModificationTime) + .ThenByDescending(s => s.CreationTime) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToListAsync(); + return new PaginatedList() + { + Total = total, + Result = clients + }; + } + + public async Task GetDetailAsync(int id) + { + return await _context.Set() + .Where(c => c.Id == id) + .Include(c => c.AllowedGrantTypes) + .Include(c => c.RedirectUris) + .Include(c => c.PostLogoutRedirectUris) + .Include(c => c.Properties) + .Include(c => c.Claims) + .Include(c => c.IdentityProviderRestrictions) + .Include(c => c.AllowedCorsOrigins) + .Include(c => c.ClientSecrets) + .Include(c => c.AllowedScopes) + .FirstOrDefaultAsync(); + } + + public async Task> GetListAsync() + { + var clients = await _context.Set().ToListAsync(); + return clients; + } + + public async Task FindAsync(Expression> predicate) + { + return await _context.Set().FirstOrDefaultAsync(predicate); + } + + public async Task GetCountAsync(Expression> predicate) + { + return await _context.Set().Where(predicate).CountAsync(); + } + + public async ValueTask AddAsync(Client client) + { + var newClient = await _repository.AddAsync(client); + await _context.SaveChangesAsync(); + var detail = await GetDetailAsync(client.Id); + await _cache.SetAsync(detail!); + return newClient; + } + + public async Task UpdateAsync(Client client) + { + var newClient = await _repository.UpdateAsync(client); + await _context.SaveChangesAsync(); + var detail = await GetDetailAsync(client.Id); + await _cache.SetAsync(detail!); + return newClient; + } + + public async Task RemoveAsync(Client client) + { + await _repository.RemoveAsync(client); + await _context.SaveChangesAsync(); + await _cache.RemoveAsync(client); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs new file mode 100644 index 000000000..48621f5d0 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs @@ -0,0 +1,114 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; + +public class IdentityResourceRepository : IIdentityResourceRepository +{ + SyncCache _cache; + DbContext _context; + IRepository _repository; + + public IdentityResourceRepository(SyncCache cache, OidcDbContext context, IRepository repository) + { + _cache = cache; + _context = context; + _repository = repository; + } + + public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) + { + condition ??= userClaim => true; + var query = _context.Set().Where(condition); + var total = await query.LongCountAsync(); + var identityResources = await query.OrderByDescending(s => s.ModificationTime) + .ThenByDescending(s => s.CreationTime) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToListAsync(); + return new PaginatedList() + { + Total = total, + Result = identityResources + }; + } + + public async Task> GetListAsync() + { + return await _context.Set().ToListAsync(); + } + + public async Task GetDetailAsync(int id) + { + var identityResources = await _context.Set() + .Include(idrs => idrs.UserClaims) + .Include(idrs => idrs.Properties) + .FirstOrDefaultAsync(idrs => idrs.Id == id); + + return identityResources; + } + + public async Task FindAsync(Expression> predicate) + { + return await _context.Set().FirstOrDefaultAsync(predicate); + } + + public async Task GetCountAsync(Expression> predicate) + { + return await _context.Set().Where(predicate).CountAsync(); + } + + public async ValueTask AddAsync(IdentityResource identityResource) + { + var exist = await _context.Set().CountAsync(idrs => idrs.Name == identityResource.Name) > 0; + if (exist) + throw new UserFriendlyException($"IdentityResource with name {identityResource.Name} already exists"); + + var newIdentityResource = await _repository.AddAsync(identityResource); + await _context.SaveChangesAsync(); + await _cache.SyncIdentityResourceCacheAsync(identityResource.Id); + return newIdentityResource; + } + + public async Task UpdateAsync(IdentityResource identityResource) + { + var newIdentityResource = await _repository.UpdateAsync(identityResource); + await _context.SaveChangesAsync(); + await _cache.SyncIdentityResourceCacheAsync(identityResource.Id); + + return newIdentityResource; + } + + public async Task RemoveAsync(IdentityResource identityResource) + { + await _repository.RemoveAsync(identityResource); + await _context.SaveChangesAsync(); + await _cache.RemoveIdentityResourceCacheAsync(identityResource); + } + + public async Task AddStandardIdentityResourcesAsync() + { + var userClaims = await _context.Set().ToListAsync(); + var syncIdentityResources = new List(); + foreach (var identityResource in StandardIdentityResources.IdentityResources) + { + var userClaimIds = userClaims.Where(uc => identityResource.UserClaims.Contains(uc.Name)).Select(uc => uc.Id); + var existData = await FindAsync(idrs => idrs.Name == identityResource.Name); + if (existData is not null) + { + existData.Update(identityResource.DisplayName, identityResource.Description ?? "", true, identityResource.Required, identityResource.Emphasize, identityResource.ShowInDiscoveryDocument, true); + existData.BindUserClaims(userClaimIds); + await _repository.UpdateAsync(existData); + } + else + { + existData = new IdentityResource(identityResource.Name, identityResource.DisplayName, identityResource.Description ?? "", true, identityResource.Required, identityResource.Enabled, identityResource.ShowInDiscoveryDocument, true); + existData.BindUserClaims(userClaimIds); + await _repository.AddAsync(existData); + } + syncIdentityResources.Add(existData); + } + await _context.SaveChangesAsync(); + await _cache.SyncIdentityResourceCacheAsync(syncIdentityResources.Select(idrs => idrs.Id).ToArray()); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs new file mode 100644 index 000000000..d876dc5b8 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs @@ -0,0 +1,97 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; + +public class UserClaimRepository : IUserClaimRepository +{ + IRepository _repository; + DbContext _context; + + public UserClaimRepository(IRepository repository, OidcDbContext context) + { + _repository = repository; + _context = context; + } + + public async Task> GetPaginatedListAsync(int page, int pageSize, Expression>? condition = null) + { + condition ??= userClaim => true; + var query = _context.Set().Where(condition); + var total = await query.LongCountAsync(); + var userClaims = await query.OrderByDescending(s => s.ModificationTime) + .ThenByDescending(s => s.CreationTime) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToListAsync(); + return new PaginatedList() + { + Total = total, + Result = userClaims + }; + } + + public async Task GetDetailAsync(int id) + { + var userClaim = await _context.Set() + .FirstOrDefaultAsync(userClaim => userClaim.Id == id); + + return userClaim; + } + + public async Task> GetListAsync() + { + var userClaims = await _context.Set().ToListAsync(); + return userClaims; + } + + public async Task FindAsync(Expression> predicate) + { + return await _context.Set().FirstOrDefaultAsync(predicate); + } + + public async Task GetCountAsync(Expression> predicate) + { + return await _context.Set().Where(predicate).CountAsync(); + } + + public async ValueTask AddAsync(UserClaim userClaim) + { + var exist = await _context.Set().CountAsync(uc => uc.Name == userClaim.Name) > 0; + if (exist) + throw new UserFriendlyException($"UserClaim with name {userClaim.Name} already exists"); + + var newUserClaim = await _repository.AddAsync(userClaim); + await _context.SaveChangesAsync(); + + return newUserClaim; + } + + public async Task UpdateAsync(UserClaim userClaim) + { + var newUserClaim = await _repository.UpdateAsync(userClaim); + await _context.SaveChangesAsync(); + + return newUserClaim; + } + + public async Task RemoveAsync(UserClaim userClaim) + { + await _repository.RemoveAsync(userClaim); + await _context.SaveChangesAsync(); + } + + public async Task AddStandardUserClaimsAsync() + { + var userClaims = new List(); + foreach (var claim in StandardUserClaims.Claims) + { + var exist = await GetCountAsync(userClaim => userClaim.Name == claim.Key) > 0; + if (exist) continue; + + userClaims.Add(new UserClaim(claim.Key, claim.Value)); + } + await _repository.AddRangeAsync(userClaims); + await _context.SaveChangesAsync(); + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..9eaea907a --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.Data; +using Masa.BuildingBlocks.Data.UoW; + +namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddOidcDbContext(this IServiceCollection services) where T : DbContext, IMasaDbContext + { + services.AddScoped(provider => new OidcDbContext(provider.GetRequiredService())); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + + return services; + } + + public static async Task AddOidcDbContext(this IServiceCollection services, Func options) where T : DbContext, IMasaDbContext + { + services.AddOidcDbContext(); + using var scope = services.BuildServiceProvider().CreateScope(); + var oidcDbContextOptions = new OidcDbContextOptions(scope.ServiceProvider); + await options.Invoke(oidcDbContextOptions); + var unitOfWork = scope.ServiceProvider.GetService(); + if(unitOfWork is not null) + { + await unitOfWork.CommitAsync(); + } + } +} diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs new file mode 100644 index 000000000..905a8f086 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; +global using Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; +global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Caches; +global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.DbContexts; +global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Options; +global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using Microsoft.Extensions.DependencyInjection; +global using System.Linq.Expressions; diff --git a/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj b/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj new file mode 100644 index 000000000..d4a73183a --- /dev/null +++ b/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj @@ -0,0 +1,30 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + diff --git a/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs b/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs new file mode 100644 index 000000000..b7c42cea6 --- /dev/null +++ b/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs @@ -0,0 +1,238 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Identity.IdentityModel.Tests; + +[TestClass] +public class TestIdentity +{ + [TestMethod] + public void TestIdentityClaimOptionsReturnTenantIdEqualTenantId() + { + var services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiTenant | IdentityType.MultiEnvironment, identityClaimOptions => + { + identityClaimOptions.TenantId = "TenantId"; + }); + var serviceProvider = services.BuildServiceProvider(); + var optionsMonitor = serviceProvider.GetRequiredService>(); + Assert.IsTrue(optionsMonitor.CurrentValue.TenantId == "TenantId"); + Assert.IsTrue(optionsMonitor.CurrentValue.Environment == ClaimType.DEFAULT_ENVIRONMENT); + } + + [TestMethod] + public void TestIdentityType() + { + var services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.Basic); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNull(serviceProvider.GetService()); + Assert.IsNull(serviceProvider.GetService()); + + services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.MultiTenant); + serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService()); + Assert.IsNull(serviceProvider.GetService()); + + services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiTenant); + serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService()); + Assert.IsNull(serviceProvider.GetService()); + + services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.MultiEnvironment); + serviceProvider = services.BuildServiceProvider(); + Assert.IsNull(serviceProvider.GetService()); + Assert.IsNotNull(serviceProvider.GetService()); + + services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiEnvironment); + serviceProvider = services.BuildServiceProvider(); + Assert.IsNull(serviceProvider.GetService()); + Assert.IsNotNull(serviceProvider.GetService()); + + services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.MultiTenant | IdentityType.MultiEnvironment); + serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService()); + Assert.IsNotNull(serviceProvider.GetService()); + + services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiTenant | IdentityType.MultiEnvironment); + serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService()); + Assert.IsNotNull(serviceProvider.GetService()); + Assert.IsNotNull(serviceProvider.GetService()); + } + + [TestMethod] + public void TestDefaultIdentityReturnTenantIdEqualtenantid() + { + var services = new ServiceCollection(); + services.AddMasaIdentityModel(); + var serviceProvider = services.BuildServiceProvider(); + var optionsMonitor = serviceProvider.GetRequiredService>(); + Assert.IsTrue(optionsMonitor.CurrentValue.TenantId == ClaimType.DEFAULT_TENANT_ID); + Assert.IsTrue(optionsMonitor.CurrentValue.Environment == ClaimType.DEFAULT_ENVIRONMENT); + } + + [TestMethod] + public void TestAddIsolationIdentityReturnUserIdEqual1AndTenantIdEqual1() + { + var services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.Basic | IdentityType.MultiTenant | IdentityType.MultiEnvironment); + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext() + { + User = new ClaimsPrincipal(new List() + { + new(new List() + { + new(ClaimType.DEFAULT_USER_ID, "1"), + new(ClaimType.DEFAULT_USER_NAME, "Jim"), + new(ClaimType.DEFAULT_TENANT_ID, "1"), + new(ClaimType.DEFAULT_ENVIRONMENT, "dev") + }) + }) + }; + var userContext = serviceProvider.GetService(); + Assert.IsNotNull(userContext); + + Assert.IsTrue(userContext.UserId == "1"); + + var multiTenantUserContext = serviceProvider.GetService(); + Assert.IsNotNull(multiTenantUserContext); + + Assert.IsTrue(multiTenantUserContext.TenantId == "1"); + + var multiEnvironmentUserContext = serviceProvider.GetService(); + Assert.IsNotNull(multiEnvironmentUserContext); + + Assert.IsTrue(multiEnvironmentUserContext.Environment == "dev"); + + var isolationUserContext = serviceProvider.GetService(); + Assert.IsNotNull(isolationUserContext); + + Assert.IsTrue(isolationUserContext.IsAuthenticated); + Assert.IsTrue(isolationUserContext.UserId == "1"); + Assert.IsTrue(isolationUserContext.UserName == "Jim"); + Assert.IsTrue(isolationUserContext.TenantId == "1"); + Assert.IsTrue(isolationUserContext.Environment == "dev"); + } + + [TestMethod] + public void TestAddSimpleIdentityReturnUserIdEqual1() + { + var services = new ServiceCollection(); + services.AddMasaIdentityModel(); + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext() + { + User = new ClaimsPrincipal(new List() + { + new(new List() + { + new(ClaimType.DEFAULT_USER_ID, "1"), + new(ClaimType.DEFAULT_USER_NAME, "Jim"), + new(ClaimType.DEFAULT_TENANT_ID, "1"), + new(ClaimType.DEFAULT_USER_ROLE, "[{ \"Name\": \"admin\",\"Id\": \"1\" }]") + }) + }) + }; + var userContext = serviceProvider.GetService(); + Assert.IsNotNull(userContext); + Assert.IsTrue(userContext.IsAuthenticated); + Assert.IsTrue(userContext.UserId == "1"); + Assert.IsTrue(userContext.UserName == "Jim"); + Assert.IsTrue(userContext.GetUserRoles().Count() == 1); + + var multiTenantUserContext = serviceProvider.GetService(); + Assert.IsNull(multiTenantUserContext); + + var multiEnvironmentUserContext = serviceProvider.GetService(); + Assert.IsNull(multiEnvironmentUserContext); + + var isolationUserContext = serviceProvider.GetService(); + Assert.IsNull(isolationUserContext); + } + + [TestMethod] + public void TestAddMultiTenantIdentityReturnTenantIdIs1() + { + var services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.MultiTenant); + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext() + { + User = new ClaimsPrincipal(new List() + { + new(new List() + { + new(ClaimType.DEFAULT_USER_ID, "1"), + new(ClaimType.DEFAULT_USER_NAME, "Jim"), + new(ClaimType.DEFAULT_TENANT_ID, "1"), + new(ClaimType.DEFAULT_USER_ROLE, "[{ \"Name\": \"admin\",\"Id\": \"1\" }]") + }) + }) + }; + var userContext = serviceProvider.GetService(); + Assert.IsNotNull(userContext); + Assert.IsTrue(userContext.IsAuthenticated); + Assert.IsTrue(userContext.UserId == "1"); + Assert.IsTrue(userContext.UserName == "Jim"); + Assert.IsTrue(userContext.GetUserRoles().Count() > 0); + + var multiTenantUserContext = serviceProvider.GetService(); + Assert.IsNotNull(multiTenantUserContext); + Assert.IsTrue(multiTenantUserContext.TenantId == "1"); + + var multiEnvironmentUserContext = serviceProvider.GetService(); + Assert.IsNull(multiEnvironmentUserContext); + + var isolationUserContext = serviceProvider.GetService(); + Assert.IsNull(isolationUserContext); + } + + [TestMethod] + public void TestTemporarilyUserReturnUserIdEqual1() + { + var services = new ServiceCollection(); + services.AddMasaIdentityModel(); + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext() + { + User = new ClaimsPrincipal(new List() + { + new(new List() + { + new(ClaimType.DEFAULT_USER_ID, "1"), + new(ClaimType.DEFAULT_USER_NAME, "Jim") + }) + }) + }; + var userContext = serviceProvider.GetRequiredService(); + var userSetter = serviceProvider.GetRequiredService(); + + var user = new IdentityUser() + { + Id = "2", + UserName = "Tom" + }; + using (userSetter.Change(user)) + { + Assert.IsTrue(userContext.IsAuthenticated); + Assert.IsTrue(userContext.UserId == "2"); + Assert.IsTrue(userContext.UserName == "Tom"); + } + + Assert.IsTrue(userContext.IsAuthenticated); + Assert.IsTrue(userContext.UserId == "1"); + Assert.IsTrue(userContext.UserName == "Jim"); + } +} diff --git a/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs b/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs new file mode 100644 index 000000000..0e455e7f8 --- /dev/null +++ b/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.Contrib.Identity.IdentityModel.Const; +global using Microsoft.AspNetCore.Http; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System.Security.Claims; diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs new file mode 100644 index 000000000..87c8ea67a --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiClient.cs @@ -0,0 +1,212 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc; + +public class ConfigurationApiClient : ConfigurationApiBase, IConfigurationApiClient +{ + private readonly IServiceProvider _serviceProvider; + private readonly IMemoryCacheClient _client; + private readonly JsonSerializerOptions _jsonSerializerOptions; + private readonly ILogger? _logger; + + private readonly ConcurrentDictionary>> _taskExpandoObjects = new(); + private readonly ConcurrentDictionary>> _taskJsonObjects = new(); + private readonly IDeserializer _deserializer = new DeserializerBuilder().Build(); + + public ConfigurationApiClient( + IServiceProvider serviceProvider, + IMemoryCacheClient client, + JsonSerializerOptions jsonSerializerOptions, + DccSectionOptions defaultSectionOption, + List? expandSectionOptions) + : base(defaultSectionOption, expandSectionOptions) + { + _serviceProvider = serviceProvider; + _client = client; + _jsonSerializerOptions = jsonSerializerOptions; + _logger = serviceProvider.GetService>(); + } + + public Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string configObject, Action? valueChanged) + { + return GetRawAsync(GetEnvironment(string.Empty), GetCluster(string.Empty), GetAppId(string.Empty), configObject, valueChanged); + } + + public Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawAsync(string environment, string cluster, string appId, + string configObject, Action? valueChanged) + { + var key = FomartKey(environment, cluster, appId, configObject); + return GetRawByKeyAsync(key, valueChanged); + } + + public Task GetAsync(string configObject, Action? valueChanged) + { + return GetAsync(GetEnvironment(string.Empty), GetCluster(string.Empty), GetAppId(string.Empty), configObject, valueChanged); + } + + public async Task GetAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged) + { + var key = FomartKey(environment, cluster, appId, configObject); + + var value = await _taskJsonObjects.GetOrAdd(key, k => new Lazy>(async () => + { + var options = new JsonSerializerOptions(_jsonSerializerOptions); + options.EnableDynamicTypes(); + + var result = await GetRawByKeyAsync(k, (value) => + { + var result = JsonSerializer.Deserialize(value, options); + + var newValue = new Lazy>(() => Task.FromResult((object)result!)); + _taskJsonObjects.AddOrUpdate(k, newValue, (_, _) => newValue); + valueChanged?.Invoke(result!); + }); + if (typeof(T).GetInterfaces().Any(type => type == typeof(IConvertible))) + { + if (result.ConfigurationType == ConfigurationTypes.Text) + return Convert.ChangeType(result.Raw, typeof(T)); + + throw new FormatException(result.Raw); + } + + return JsonSerializer.Deserialize(result.Raw, options) ?? throw new ArgumentException(nameof(configObject)); + })).Value; + + return (T)value; + } + + public async Task GetDynamicAsync(string environment, string cluster, string appId, string configObject, Action? valueChanged) + { + var key = FomartKey(environment, cluster, appId, configObject); + + return await GetDynamicAsync(key, (k, value, options) => + { + var result = JsonSerializer.Deserialize(value, options); + var newValue = new Lazy>(() => Task.FromResult(result)!); + _taskExpandoObjects.AddOrUpdate(k, newValue!, (_, _) => newValue!); + valueChanged?.Invoke(result!); + }); + } + + public Task GetDynamicAsync(string configObject) + { + var key = FomartKey(GetEnvironment(string.Empty), GetCluster(string.Empty), GetAppId(string.Empty), configObject); + return GetDynamicAsync(key, null); + } + + protected virtual async Task GetDynamicAsync(string key, Action? valueChanged) + { + if (string.IsNullOrEmpty(key)) + throw new ArgumentNullException(nameof(key)); + + var value = _taskExpandoObjects.GetOrAdd(key, k => new Lazy>(async () => + { + var options = new JsonSerializerOptions(_jsonSerializerOptions); + options.EnableDynamicTypes(); + + var raw = await GetRawByKeyAsync(k, value => + { + valueChanged?.Invoke(k, value, options); + }); + return JsonSerializer.Deserialize(raw.Raw, options) ?? throw new ArgumentException(key); + })).Value; + + return await value; + } + + protected virtual async Task<(string Raw, ConfigurationTypes ConfigurationType)> GetRawByKeyAsync(string key, Action? valueChanged) + { + var raw = await _client.GetAsync(key, value => + { + var result = FormatRaw(value, key); + valueChanged?.Invoke(result.Raw); + }); + + return FormatRaw(raw, key); + } + + protected virtual (string Raw, ConfigurationTypes ConfigurationType) FormatRaw(string? raw, string paramName) + { + PublishRelease result = GetPublishRelease(raw, paramName); + + switch (result.ConfigFormat) + { + case ConfigFormats.Json: + return (result.Content!, ConfigurationTypes.Json); + + case ConfigFormats.Raw: + return (result.Content!, ConfigurationTypes.Text); + + case ConfigFormats.Properties: + try + { + var properties = PropertyConfigurationParser.Parse(result.Content!, _jsonSerializerOptions); + return (JsonSerializer.Serialize(properties, _jsonSerializerOptions), ConfigurationTypes.Properties); + } + catch (Exception exception) + { + _logger?.LogWarning(exception, + $"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is not a valid Properties type"); + throw new ArgumentException("configObject invalid"); + } + + case ConfigFormats.Xml: + try + { + var json = XmlConfigurationParser.XmlToJson(result.Content!); + return (json, ConfigurationTypes.Xml); + } + catch (Exception exception) + { + _logger?.LogWarning(exception, + $"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is not a valid Xml type"); + throw new ArgumentException("configObject invalid"); + } + + case ConfigFormats.Yaml: + try + { + var yamlObject = _deserializer.Deserialize(result.Content!); + + var serializer = new SerializerBuilder().JsonCompatible().Build(); + var json = serializer.Serialize(yamlObject); + return (json, ConfigurationTypes.Yaml); + } + catch (Exception exception) + { + _logger?.LogWarning(exception, + $"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is not a valid Yaml type"); + throw new ArgumentException("configObject invalid"); + } + + default: + throw new NotSupportedException("Unsupported configuration type"); + } + } + + private string FomartKey(string environment, string cluster, string appId, string configObject) + => $"{GetEnvironment(environment)}-{GetCluster(cluster)}-{GetAppId(appId)}-{GetConfigObject(configObject)}".ToLower(); + + private PublishRelease GetPublishRelease(string? raw, string paramName) + { + if (raw == null) + throw new ArgumentException($"configObject invalid, {paramName} is not null"); + + PublishRelease? result; + try + { + result = JsonSerializer.Deserialize(raw, _jsonSerializerOptions); + } + catch (Exception exception) + { + string message = $"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is not a valid response value"; + _logger?.LogWarning(exception, message); + throw new ArgumentException(message); + } + if (result == null || result.ConfigFormat == 0) + throw new ArgumentException($"Dcc.ConfigurationApiClient: configObject invalid, {paramName} is an unsupported type"); + + return result; + } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs new file mode 100644 index 000000000..7b6d27c55 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiExtensions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.BuildingBlocks.Configuration; + +public static class ConfigurationApiExtensions +{ + + public static IConfiguration GetDefault(this IConfigurationApi configurationApi) + { + return configurationApi.Get(StaticConfig.AppId); + } + + public static IConfiguration GetPublic(this IConfigurationApi configurationApi) + { + return configurationApi.Get(StaticConfig.PublicId); + } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs new file mode 100644 index 000000000..e4a6951e9 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/ConfigurationApiManage.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc; + +public class ConfigurationApiManage : ConfigurationApiBase, IConfigurationApiManage +{ + private readonly ICaller _caller; + + public ConfigurationApiManage( + ICaller caller, + DccSectionOptions defaultSectionOption, + List? expandSectionOptions) + : base(defaultSectionOption, expandSectionOptions) + { + _caller = caller; + } + + /// + public async Task InitializeAsync(string environment, string cluster, string appId, Dictionary configObjects) + { + var requestUri = $"open-api/releasing/init/{GetEnvironment(environment)}/{GetCluster(cluster)}/{GetAppId(appId)}"; + var result = await _caller.PostAsync(requestUri, configObjects, default); + + // 299 is the status code when throwing a UserFriendlyException in masa.framework + if ((int)result.StatusCode == 299 || !result.IsSuccessStatusCode) + { + var error = await result.Content.ReadAsStringAsync(); + throw new HttpRequestException(error); + } + } + + public async Task UpdateAsync(string environment, string cluster, string appId, string configObject, object value) + { + var requestUri = $"open-api/releasing/{GetEnvironment(environment)}/{GetCluster(cluster)}/{GetAppId(appId)}/{GetConfigObject(configObject)}"; + var result = await _caller.PutAsync(requestUri, value, default); + + // 299 is the status code when throwing a UserFriendlyException in masa.framework + if ((int)result.StatusCode == 299 || !result.IsSuccessStatusCode) + { + var error = await result.Content.ReadAsStringAsync(); + throw new HttpRequestException(error); + } + } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs new file mode 100644 index 000000000..d2420dc36 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigFormats.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; + +internal enum ConfigFormats +{ + Properties = 1, + Raw, + Json, + Yaml, + Xml +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs new file mode 100644 index 000000000..394767d04 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/ConfigurationApiBase.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; + +public class ConfigurationApiBase +{ + private readonly DccSectionOptions _defaultSectionOption; + private readonly List _expandSectionOptions; + + protected ConfigurationApiBase(DccSectionOptions defaultSectionOption, List? expandSectionOptions) + { + _defaultSectionOption = defaultSectionOption; + _expandSectionOptions = expandSectionOptions ?? new(); + } + + protected string GetSecret(string appId) + { + if (_defaultSectionOption.AppId == GetAppId(appId)) + return _defaultSectionOption.Secret ?? ""; + + var option = _expandSectionOptions.FirstOrDefault(x => x.AppId == appId); + if (option == null) + throw new ArgumentNullException(nameof(appId)); + + return option.Secret ?? ""; + } + + protected string GetEnvironment(string environment) + => !string.IsNullOrEmpty(environment) ? environment : _defaultSectionOption.Environment!; + + protected string GetCluster(string cluster) + => !string.IsNullOrEmpty(cluster) ? cluster : _defaultSectionOption.Cluster!; + + protected string GetAppId(string appId) + => !string.IsNullOrEmpty(appId) ? appId : _defaultSectionOption.AppId!; + + protected string GetConfigObject(string configObject) + => !string.IsNullOrEmpty(configObject) ? configObject : throw new ArgumentNullException(nameof(configObject)); +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs new file mode 100644 index 000000000..3c7347eb7 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Constants.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; + +internal class Constants +{ + internal const string DEFAULT_CLIENT_NAME = "masa.contrib.configuration.configurationapi.dcc"; + + internal const string DEFAULT_SUBSCRIBE_KEY_PREFIX = "masa.dcc:"; + + internal const string DEFAULT_ENVIRONMENT_NAME = "ASPNETCORE_ENVIRONMENT"; + + internal const string DATA_DICTIONARY_SECTION_NAME = "DataDictionary"; +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs new file mode 100644 index 000000000..a4dd590ab --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccConfigurationRepository.cs @@ -0,0 +1,95 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; + +internal class DccConfigurationRepository : AbstractConfigurationRepository +{ + private readonly IConfigurationApiClient _client; + + public override SectionTypes SectionType => SectionTypes.ConfigurationApi; + + private readonly ConcurrentDictionary> _dictionaries = new(); + + private readonly ConcurrentDictionary _configObjectConfigurationTypeRelations = new(); + + public DccConfigurationRepository( + IEnumerable sectionOptions, + IConfigurationApiClient client, + ILoggerFactory loggerFactory) + : base(loggerFactory) + { + _client = client; + foreach (var sectionOption in sectionOptions) + { + Initialize(sectionOption).ConfigureAwait(false).GetAwaiter().GetResult(); + } + } + + private async Task Initialize(DccSectionOptions sectionOption) + { + foreach (var configObject in sectionOption.ConfigObjects) + { + string key = $"{sectionOption.Environment!}-{sectionOption.Cluster!}-{sectionOption.AppId}-{configObject}".ToLower(); + var result = await _client.GetRawAsync(sectionOption.Environment!, sectionOption.Cluster!, sectionOption.AppId, configObject, (val) => + { + if (_configObjectConfigurationTypeRelations.TryGetValue(key, out var configurationType)) + { + _dictionaries[key] = FormatRaw(sectionOption.AppId, configObject, val, configurationType); + FireRepositoryChange(SectionType, Load()); + } + }); + + _configObjectConfigurationTypeRelations.TryAdd(key, result.ConfigurationType); + _dictionaries[key] = FormatRaw(sectionOption.AppId, configObject, result.Raw, result.ConfigurationType); + } + } + + private IDictionary FormatRaw(string appId, string configObject, string? raw, ConfigurationTypes configurationType) + { + if (raw == null) + return new Dictionary(); + + switch (configurationType) + { + case ConfigurationTypes.Json: + return SecondaryFormat(appId, configObject, JsonConfigurationParser.Parse(raw)); + case ConfigurationTypes.Properties: + return SecondaryFormat(appId, configObject, JsonSerializer.Deserialize>(raw)!); + case ConfigurationTypes.Text: + return new Dictionary() + { + { $"{appId}{ConfigurationPath.KeyDelimiter}{configObject}" , raw ?? "" } + }; + default: + throw new NotSupportedException(nameof(configurationType)); + } + } + + private IDictionary SecondaryFormat( + string appId, + string configObject, + IDictionary data) + { + var dictionary = new Dictionary(); + foreach (var item in data) + { + dictionary[$"{appId}{ConfigurationPath.KeyDelimiter}{configObject}{ConfigurationPath.KeyDelimiter}{item.Key}"] = item.Value; + } + return dictionary; + } + + public override Properties Load() + { + Dictionary properties = new(); + foreach (var item in _dictionaries) + { + foreach (var key in item.Value.Keys) + { + properties[key] = item.Value[key]; + } + } + return new Properties(properties); + } + +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs new file mode 100644 index 000000000..5aa9592f4 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/DccFactory.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; + +internal class DccFactory +{ + public static IConfigurationApiClient CreateClient( + IServiceProvider serviceProvider, + IMemoryCacheClient client, + JsonSerializerOptions jsonSerializerOptions, + DccSectionOptions defaultSectionOption, + List? expandSectionOptions) + { + return new ConfigurationApiClient(serviceProvider, client, jsonSerializerOptions, defaultSectionOption, expandSectionOptions); + } + + public static IConfigurationApiManage CreateManage( + ICaller caller, + DccSectionOptions defaultSectionOption, + List? expandSectionOptions) + => new ConfigurationApiManage(caller, defaultSectionOption, expandSectionOptions); +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs new file mode 100644 index 000000000..06c331360 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/Property.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Model; + +internal class Property +{ + public string Key { get; set; } = default!; + + public string Value { get; set; } = default!; +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs new file mode 100644 index 000000000..f0cb189b3 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/PublishRelease.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Model; + +internal class PublishRelease +{ + private ConfigFormats _configFormat; + public ConfigFormats ConfigFormat + { + get + { + try + { + if (_configFormat == 0 && !string.IsNullOrWhiteSpace(FormatLabelCode)) + _configFormat = (ConfigFormats)Enum.Parse(typeof(ConfigFormats), FormatLabelCode); + } + catch (Exception ex) + { + throw new NotSupportedException("Unsupported configuration type", ex); + } + + return _configFormat; + } + set + { + _configFormat = value; + } + } + + public string? FormatLabelCode { get; set; } + + public string? Content { get; set; } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs new file mode 100644 index 000000000..22e1755c0 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Model/StaticConfig.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Model; + +internal class StaticConfig +{ + public static string AppId { get; set; } + + public static string PublicId => "public-$Config"; +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs new file mode 100644 index 000000000..1034a3621 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Options/DccOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Options; + +internal class DccOptions +{ + public DccConfigurationOptions DccConfigurationOptions { get; } + + public DccSectionOptions DefaultSectionOptions { get; } + + public List ExpansionSectionOptions { get; } + + public DccOptions(DccConfigurationOptions dccConfigurationOptions, DccSectionOptions defaultSectionOptions, List expansionSectionOptions) + { + DccConfigurationOptions = dccConfigurationOptions; + DefaultSectionOptions = defaultSectionOptions; + ExpansionSectionOptions = expansionSectionOptions; + } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs new file mode 100644 index 000000000..75c139ef9 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/JsonConfigurationParser.cs @@ -0,0 +1,104 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Parser; + +/// +/// https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Configuration.Json/src/JsonConfigurationFileParser.cs +/// +internal sealed class JsonConfigurationParser +{ + private JsonConfigurationParser() + { + } + + private readonly Dictionary _data = new Dictionary(StringComparer.OrdinalIgnoreCase); + private readonly Stack _paths = new Stack(); + + public static IDictionary Parse(string json) + => new JsonConfigurationParser().ParseJson(json); + + private IDictionary ParseJson(string json) + { + var jsonDocumentOptions = new JsonDocumentOptions + { + CommentHandling = JsonCommentHandling.Skip, + AllowTrailingCommas = true, + }; + + var doc = JsonDocument.Parse(json, jsonDocumentOptions); + + if (doc.RootElement.ValueKind != JsonValueKind.Object) + { + throw new FormatException($"[{doc.RootElement.ValueKind}]Invalid top level JsonElement."); + } + + VisitElement(doc.RootElement); + + return _data; + } + + private void VisitElement(JsonElement element) + { + var isEmpty = true; + + foreach (JsonProperty property in element.EnumerateObject()) + { + isEmpty = false; + EnterContext(property.Name); + VisitValue(property.Value); + ExitContext(); + } + + if (isEmpty && _paths.Count > 0) + { + _data[_paths.Peek()] = ""; + } + } + + private void VisitValue(JsonElement value) + { + Debug.Assert(_paths.Count > 0); + + switch (value.ValueKind) + { + case JsonValueKind.Object: + VisitElement(value); + break; + + case JsonValueKind.Array: + int index = 0; + foreach (JsonElement arrayElement in value.EnumerateArray()) + { + EnterContext(index.ToString()); + VisitValue(arrayElement); + ExitContext(); + index++; + } + + break; + + case JsonValueKind.Number: + case JsonValueKind.String: + case JsonValueKind.True: + case JsonValueKind.False: + case JsonValueKind.Null: + string key = _paths.Peek(); + if (_data.ContainsKey(key)) + { + throw new FormatException($"[{key}]key is duplicated."); + } + + _data[key] = value.ToString(); + break; + + default: + throw new FormatException($"[{value.ValueKind}]Unsupported json token."); + } + } + + private void EnterContext(string context) => + _paths.Push(_paths.Count > 0 ? _paths.Peek() + ConfigurationPath.KeyDelimiter + context : context); + + private void ExitContext() => _paths.Pop(); +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs new file mode 100644 index 000000000..21680f28c --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/PropertyConfigurationParser.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Parser; + +internal class PropertyConfigurationParser +{ + public static IDictionary? Parse(string raw, JsonSerializerOptions serializerOption) + => JsonSerializer.Deserialize>(raw, serializerOption)!.ToDictionary(k => k.Key, v => v.Value); +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs new file mode 100644 index 000000000..93ba3445c --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Internal/Parser/XmlConfigurationParser.cs @@ -0,0 +1,83 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using System.Data; +using System.Text; + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Parser; + +internal class XmlConfigurationParser +{ + public static string XmlToJson(string xmlStr) + { + var dataSet = XmlToDataSet(xmlStr); + + return DatasetToJson(dataSet); + } + + public static DataSet XmlToDataSet(string xmlStr) + { + try + { + var ds = new DataSet(); + using var xmlStringReader = new StringReader(xmlStr); + + ds.ReadXml(xmlStringReader); + + return ds; + } + catch (Exception ex) + { + throw new FormatException("Xml character string invalid", ex); + } + } + + public static string DatasetToJson(DataSet ds) + { + var json = new StringBuilder(); + + foreach (DataTable dt in ds.Tables) + { + json.Append("{\""); + json.Append(dt.TableName); + json.Append("\":"); + json.Append(DataTableToJson(dt)); + json.Append('}'); + } + return json.ToString(); + } + + public static string DataTableToJson(DataTable table) + { + var jsonStringBuilder = new StringBuilder(); + if (table.Rows.Count > 0) + { + jsonStringBuilder.Append('['); + for (int i = 0; i < table.Rows.Count; i++) + { + jsonStringBuilder.Append('{'); + for (int j = 0; j < table.Columns.Count; j++) + { + if (j < table.Columns.Count - 1) + { + jsonStringBuilder.Append("\"" + table.Columns[j].ColumnName.ToString() + "\":" + "\"" + table.Rows[i][j].ToString() + "\","); + } + else if (j == table.Columns.Count - 1) + { + jsonStringBuilder.Append("\"" + table.Columns[j].ColumnName.ToString() + "\":" + "\"" + table.Rows[i][j].ToString() + "\""); + } + } + if (i == table.Rows.Count - 1) + { + jsonStringBuilder.Append('}'); + } + else + { + jsonStringBuilder.Append("},"); + } + } + jsonStringBuilder.Append(']'); + } + return jsonStringBuilder.ToString(); + } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj new file mode 100644 index 000000000..b842db3a8 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Masa.Contrib.Configuration.ConfigurationApi.Dcc.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs new file mode 100644 index 000000000..80b79d983 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/MasaConfigurationExtensions.cs @@ -0,0 +1,217 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc; + +public static class MasaConfigurationExtensions +{ + public static IMasaConfigurationBuilder UseDcc( + this IMasaConfigurationBuilder builder, + Action? jsonSerializerOptions = null, + Action? callerOptions = null) + { + var configurationSection = builder.Configuration.GetSection("DccOptions"); + var dccOptions = configurationSection.Get(); + + List expandSections = new(); + var configurationExpandSection = builder.Configuration.GetSection("ExpandSections"); + if (configurationExpandSection.Exists()) + { + configurationExpandSection.Bind(expandSections); + } + + return builder.UseDcc(() => dccOptions, option => + { + option.Environment = builder.Configuration[nameof(DccSectionOptions.Environment)]; + option.Cluster = builder.Configuration[nameof(DccSectionOptions.Cluster)]; + option.AppId = builder.Configuration[nameof(DccSectionOptions.AppId)]; + option.ConfigObjects = builder.Configuration.GetSection(nameof(DccSectionOptions.ConfigObjects)).Get>(); + option.Secret = builder.Configuration[nameof(DccSectionOptions.Secret)]; + }, option => option.ExpandSections = expandSections, jsonSerializerOptions, callerOptions); + } + + public static IMasaConfigurationBuilder UseDcc( + this IMasaConfigurationBuilder builder, + Func configureOptions, + Action defaultSectionOptions, + Action? expansionSectionOptions, + Action? jsonSerializerOptions = null, + Action? callerOptions = null) + { + ArgumentNullException.ThrowIfNull(configureOptions, nameof(configureOptions)); + DccConfigurationOptions dccConfigurationOptions = configureOptions.Invoke(); + + ArgumentNullException.ThrowIfNull(defaultSectionOptions, nameof(defaultSectionOptions)); + DccSectionOptions defaultSectionOption = new(); + defaultSectionOptions.Invoke(defaultSectionOption); + + var expansionSectionOption = new DccExpandSectionOptions(); + expansionSectionOptions?.Invoke(expansionSectionOption); + + return builder.UseDcc(dccConfigurationOptions, defaultSectionOption, expansionSectionOption.ExpandSections, + jsonSerializerOptions, callerOptions); + } + + public static IMasaConfigurationBuilder UseDcc( + this IMasaConfigurationBuilder builder, + DccConfigurationOptions configureOptions, + DccSectionOptions defaultSectionOptions, + List? expansionSectionOptions, + Action? jsonSerializerOptions, + Action? action) + { + StaticConfig.AppId = defaultSectionOptions.AppId; + + var services = builder.Services; + if (services.Any(service => service.ImplementationType == typeof(DccConfigurationProvider))) + return builder; + + services.AddSingleton(); + + var config = GetDccConfigurationOption(configureOptions, defaultSectionOptions, expansionSectionOptions); + + var jsonSerializerOption = new JsonSerializerOptions() + { + PropertyNameCaseInsensitive = true + }; + jsonSerializerOptions?.Invoke(jsonSerializerOption); + string callerName = DEFAULT_CLIENT_NAME; + services.AddCaller(options => + { + if (action == null) + { + options.UseHttpClient(() + => new MasaHttpClientBuilder(callerName, string.Empty, + opt => opt.BaseAddress = new Uri(config.DccConfigurationOptions.ManageServiceAddress)) + ); + } + else + { + action.Invoke(options); + callerName = options.Callers.Select(opt => opt.Name).FirstOrDefault() + ?? throw new Exception("Missing Caller implementation, eg: options.UseHttpClient()"); + } + }); + + services.AddMasaRedisCache(DEFAULT_CLIENT_NAME, config.DccConfigurationOptions.RedisOptions) + .AddSharedMasaMemoryCache(config.DccConfigurationOptions.SubscribeKeyPrefix ?? DEFAULT_SUBSCRIBE_KEY_PREFIX); + + TryAddConfigurationApiClient(services, config.DefaultSectionOptions, config.ExpansionSectionOptions, jsonSerializerOption); + TryAddConfigurationApiManage(services, callerName, config.DefaultSectionOptions, config.ExpansionSectionOptions); + + var sectionOptions = new List() + { + config.DefaultSectionOptions + }.Concat(config.ExpansionSectionOptions); + + var configurationApiClient = services.BuildServiceProvider().GetRequiredService(); + var loggerFactory = services.BuildServiceProvider().GetRequiredService(); + builder.AddRepository(new DccConfigurationRepository(sectionOptions, configurationApiClient, loggerFactory)); + return builder; + } + + public static IServiceCollection TryAddConfigurationApiClient(IServiceCollection services, + DccSectionOptions defaultSectionOption, + List expansionSectionOptions, + JsonSerializerOptions jsonSerializerOption) + { + services.TryAddSingleton(serviceProvider => + { + var client = serviceProvider.GetRequiredService().CreateClient(DEFAULT_CLIENT_NAME); + + ArgumentNullException.ThrowIfNull(client, nameof(client)); + + return DccFactory.CreateClient( + serviceProvider, + client, + jsonSerializerOption, + defaultSectionOption, + expansionSectionOptions); + }); + return services; + } + + public static IServiceCollection TryAddConfigurationApiManage(IServiceCollection services, + string callerName, + DccSectionOptions defaultSectionOption, + List expansionSectionOptions) + { + services.TryAddSingleton(serviceProvider => + { + var callerFactory = serviceProvider.GetRequiredService(); + return DccFactory.CreateManage(callerFactory.Create(callerName), defaultSectionOption, expansionSectionOptions); + }); + return services; + } + + private static DccOptions GetDccConfigurationOption( + DccConfigurationOptions dccConfigurationOption, + DccSectionOptions defaultSectionOptions, + List? expansionSectionOptions = null) + { + ArgumentNullException.ThrowIfNull(dccConfigurationOption, nameof(dccConfigurationOption)); + + if (string.IsNullOrEmpty(dccConfigurationOption.ManageServiceAddress)) + throw new ArgumentNullException(nameof(dccConfigurationOption.ManageServiceAddress)); + + if (dccConfigurationOption.RedisOptions == null) + throw new ArgumentNullException(nameof(dccConfigurationOption.RedisOptions)); + + if (dccConfigurationOption.RedisOptions.Servers == null || dccConfigurationOption.RedisOptions.Servers.Count == 0 || + dccConfigurationOption.RedisOptions.Servers.Any(service => string.IsNullOrEmpty(service.Host) || service.Port <= 0)) + throw new ArgumentNullException(nameof(dccConfigurationOption.RedisOptions.Servers)); + + ArgumentNullException.ThrowIfNull(defaultSectionOptions, nameof(defaultSectionOptions)); + + if (string.IsNullOrEmpty(defaultSectionOptions.AppId)) + throw new ArgumentNullException("AppId cannot be empty"); + + if (defaultSectionOptions.ConfigObjects == null || !defaultSectionOptions.ConfigObjects.Any()) + throw new ArgumentNullException("ConfigObjects cannot be empty"); + + if (string.IsNullOrEmpty(defaultSectionOptions.Cluster)) + defaultSectionOptions.Cluster = "Default"; + if (string.IsNullOrEmpty(defaultSectionOptions.Environment)) + defaultSectionOptions.Environment = GetDefaultEnvironment(); + + List expansionOptions = new(); + foreach (var expansionOption in expansionSectionOptions ?? new()) + { + if (string.IsNullOrEmpty(expansionOption.Environment)) + expansionOption.Environment = defaultSectionOptions.Environment; + if (string.IsNullOrEmpty(expansionOption.Cluster)) + expansionOption.Cluster = defaultSectionOptions.Cluster; + + if (expansionOption.ConfigObjects == null || !expansionOption.ConfigObjects.Any()) + throw new ArgumentNullException("ConfigObjects in the extension section cannot be empty"); + + if (expansionOption.AppId == defaultSectionOptions.AppId || + expansionOptions.Any(section => section.AppId == expansionOption.AppId)) + throw new ArgumentNullException("The current section already exists, no need to mount repeatedly"); + + expansionOptions.Add(expansionOption); + } + return new(dccConfigurationOption, defaultSectionOptions, expansionOptions); + } + + private static ICachingBuilder AddSharedMasaMemoryCache(this ICachingBuilder builder, string subscribeKeyPrefix) + { + builder.AddMasaMemoryCache(options => + { + options.SubscribeKeyType = SubscribeKeyTypes.SpecificPrefix; + options.SubscribeKeyPrefix = subscribeKeyPrefix; + }); + + return builder; + } + + private static string GetDefaultEnvironment() + => System.Environment.GetEnvironmentVariable(DEFAULT_ENVIRONMENT_NAME) ?? + throw new ArgumentNullException( + "Error getting environment information, please make sure the value of ASPNETCORE_ENVIRONMENT has been configured"); + + private class DccConfigurationProvider + { + + } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs new file mode 100644 index 000000000..46f68e0ae --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/ConfigurationApiMasaConfigurationOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; + +public abstract class ConfigurationApiMasaConfigurationOptions : MasaConfigurationOptions +{ + /// + /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType + /// + [JsonIgnore] + public sealed override string? ParentSection => AppId; + + public virtual string AppId => StaticConfig.AppId; + + /// + /// The section null means same as the class name, else load from the specify section + /// + [JsonIgnore] + public sealed override string? Section => ObjectName; + + public virtual string? ObjectName { get; } + + /// + /// Configuration object name + /// + [JsonIgnore] + public sealed override SectionTypes SectionType => SectionTypes.ConfigurationApi; +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs new file mode 100644 index 000000000..605bbae3a --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccConfigurationOptions.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; + +public class DccConfigurationOptions +{ + public RedisConfigurationOptions RedisOptions { get; set; } + + public string ManageServiceAddress { get; set; } = default!; + + /// + /// The prefix of Dcc PubSub, it is not recommended to modify + /// + public string? SubscribeKeyPrefix { get; set; } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs new file mode 100644 index 000000000..57ce1c9a0 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccExpandSectionOptions.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; + +public class DccExpandSectionOptions +{ + /// + /// Expansion section information + /// + public List? ExpandSections { get; set; } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs new file mode 100644 index 000000000..1394f89c2 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/Options/DccSectionOptions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; + +public class DccSectionOptions +{ + /// + /// The environment name. + /// Get from the environment variable ASPNETCORE_ENVIRONMENT when Environment is null or empty + /// + public string? Environment { get; set; } = null; + + /// + /// The cluster name. + /// + public string? Cluster { get; set; } + + /// + /// The app id. + /// + public string AppId { get; set; } = default!; + + public List ConfigObjects { get; set; } = default!; + + public string? Secret { get; set; } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md new file mode 100644 index 000000000..d7055f623 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md @@ -0,0 +1,174 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Configuration.ConfigurationApi.Dcc + +Effect: + +Extend the ability of IConfiguration to manage remote configuration through Dcc. + +```c# +IConfiguration +├── Local Local node (fixed) +├── ConfigurationApi Remote node (fixed Dcc to expand its capacity) +│ ├── AppId Replace-With-Your-AppId +│ ├── AppId ├── Redis Custom node +│ ├── AppId ├── Redis ├── Host Parameter +``` + +Example: + +```C# +Install-Package Masa.Contrib.Configuration +Install-Package Masa.Contrib.Configuration.ConfigurationApi.Dcc //Provides the ability to remotely configure +``` + +appsettings.json +``` +{ + //Dcc configuration, extended Configuration capabilities, support remote configuration + "DccOptions": { + "ManageServiceAddress": "http://localhost:8890", + "RedisOptions": { + "Servers": [ + { + "Host": "localhost", + "Port": 8889 + } + ], + "DefaultDatabase": 0, + "Password": "" + } + }, + "AppId": "Replace-With-Your-AppId", + "Environment": "Development", + "ConfigObjects": [ "Redis" ], //The name of the object to be mounted, the Redis configuration will be mounted here under the ConfigurationApi: node + "Secret": "", //Dcc App key + "Cluster": "Default" +} + +``` + +```C# +builder.AddMasaConfiguration(configurationBuilder => configurationBuilder.UseDcc());//Ability to provide remote configuration using Dcc + +/// +/// Automatically map node relationships +/// +public class RedisOptions : ConfigurationApiMasaConfigurationOptions +{ + /// + /// The app id. + /// + [JsonIgnore] + public override string AppId { get; set; } = "Replace-With-Your-AppId"; + + [JsonIgnore] + public override string? ObjectName { get; init; } = "Redis"; + + public string Host { get; set; } + + public int Port { get; set; } + + public int DefaultDatabase { get; set; } +} + +public class CustomDccSectionOptions : ConfigurationApiMasaConfigurationOptions +{ + /// + /// The app id. + /// + [JsonIgnore] + public override string AppId { get; set; } = "Replace-With-Your-AppId"; + + /// + /// The environment name. + /// Get from the environment variable ASPNETCORE_ENVIRONMENT when Environment is null or empty + /// + public string? Environment { get; set; } = null; + + /// + /// The cluster name. + /// + public string? Cluster { get; set; } + + public List ConfigObjects { get; set; } = default!; + + public string? Secret { get; set; } + + /// + /// Mount CustomDccSectionOptions under the root node + /// + [JsonIgnore] + public virtual string? Section => string.Empty; +} +``` + +How to use configuration: + +```c# +var app = builder.Build(); + +//Read the configuration at the program entrance +var redisHost = builder.GetMasaConfiguration().ConfigurationApi.GetDefault().GetValue("Redis:Host"); + +app.MapGet("/GetRedis", ([FromServices] IOptions option) => +{ + //recommend + return System.Text.Json.JsonSerializer.Serialize(option.Value);//Or use IOptionsMonitor to support monitoring changes +}); + +app.MapGet("/GetRedisByMonitor", ([FromServices] IOptionsMonitor options) => +{ + options.OnChange(option => + { + //TODO Configuration update + }); + return System.Text.Json.JsonSerializer.Serialize(option.CurrentValue); +}); + +app.MapGet("/GetRedisHost", ([FromServices] IConfiguration configuration) => +{ + //Obtain the configuration value of the Host of the specified configuration object (ConfigObject) under the specified AppId from the configuration center + //Format ConfigurationApi::: + return configuration["ConfigurationApi::Redis:Host"]; +}); + +app.MapPut("/UpdateRedis", ([FromServices] IConfigurationAPIManage configurationAPIManage, + [FromServices] IOptions configuration, + RedisOptions newRedis) => +{ + //Modify Dcc configuration + return configurationAPIManage.UpdateAsync(option.Value.Environment, + option.Value.Cluster, + option.Value.AppId, + "",newRedis);//Here Replace-With-Your-ConfigObject is Redis +}); +app.Run(); +``` + +How to update the configuration: + +```c# +var app = builder.Build(); + +app.MapPut("/UpdateRedis", ([FromServices] IConfigurationAPIManage configurationAPIManage, + [FromServices] IOptions configuration, + RedisOptions newRedis) => +{ + //Modify Dcc configuration + return configurationAPIManage.UpdateAsync(option.Value.Environment, + option.Value.Cluster, + option.Value.AppId, + "" + ,newRedis); + //Here Replace-With-Your-ConfigObject is Redis +}); + +app.Run(); +``` + +Summarize: + +Dcc provides remote configuration management and viewing capabilities for IConfiguration. For the complete capabilities of IConfiguration, please refer to the [document](../../Configuration/Masa.Contrib.Configuration/README.md) + +Redis here is remote configuration, which introduces the effect and usage of remote configuration after mounting to IConfiguration. This configuration has nothing to do with Redis in Masa.Contrib.Configuration. It just shows the use of the same configuration information in two sources. Ways and differences in mapping node relationships \ No newline at end of file diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md new file mode 100644 index 000000000..b217be2dc --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md @@ -0,0 +1,165 @@ +中 | [EN](README.md) + +## Masa.Contrib.Configuration.ConfigurationApi.Dcc + +作用: + +通过Dcc扩展IConfiguration管理远程配置的能力。 + +```c# +IConfiguration +├── Local 本地节点(固定) +├── ConfigurationApi 远程节点(固定 Dcc扩展其能力) +│ ├── AppId Replace-With-Your-AppId +│ ├── AppId ├── Redis 自定义节点 +│ ├── AppId ├── Redis ├── Host 参数 +``` + +用例: + +```C# +Install-Package Masa.Contrib.Configuration +Install-Package Masa.Contrib.Configuration.ConfigurationApi.Dcc //提供远程配置的能力 +``` + +appsettings.json +``` +{ + //Dcc配置,扩展Configuration能力,支持远程配置 + "DccOptions": { + "ManageServiceAddress ": "http://localhost:8890", + "RedisOptions": { + "Servers": [ + { + "Host": "localhost", + "Port": 8889 + } + ], + "DefaultDatabase": 0, + "Password": "" + } + }, + "AppId": "Replace-With-Your-AppId", + "Environment": "Development", + "ConfigObjects": [ "Redis" ], //待挂载的对象名, 此处会将Redis配置挂载到ConfigurationApi:节点下 + "Secret": "", //Dcc App 秘钥 + "Cluster": "Default" +} + +``` + +```C# +builder.AddMasaConfiguration(configurationBuilder => configurationBuilder.UseDcc());//使用Dcc提供远程配置的能力 + +/// +/// 自动映射节点关系 +/// +public class RedisOptions : ConfigurationApiMasaConfigurationOptions +{ + /// + /// The app id. + /// + [JsonIgnore] + public override string AppId { get; set; } = "Replace-With-Your-AppId"; + + [JsonIgnore] + public override string? ObjectName { get; init; } = "Redis"; + + public string Host { get; set; } + + public int Port { get; set; } + + public int DefaultDatabase { get; set; } +} + +public class CustomDccSectionOptions : ConfigurationApiMasaConfigurationOptions +{ + /// + /// The app id. + /// + [JsonIgnore] + public override string AppId { get; set; } = "Replace-With-Your-AppId"; + + /// + /// The environment name. + /// Get from the environment variable ASPNETCORE_ENVIRONMENT when Environment is null or empty + /// + public string? Environment { get; set; } = null; + + /// + /// The cluster name. + /// + public string? Cluster { get; set; } + + public List ConfigObjects { get; set; } = default!; + + public string? Secret { get; set; } + + /// + /// 将CustomDccSectionOptions挂载到根节点下 + /// + [JsonIgnore] + public virtual string? Section => string.Empty; +} +``` + +如何使用配置: + +```c# +var app = builder.Build(); + +//在程序入口处读取配置 +var redisHost = builder.GetMasaConfiguration().ConfigurationApi.GetDefault().GetValue("Redis:Host"); + +app.MapGet("/GetRedis", ([FromServices] IOptions option) => +{ + //推荐 + return System.Text.Json.JsonSerializer.Serialize(option.Value); +}); + +app.MapGet("/GetRedisByMonitor", ([FromServices] IOptionsMonitor options) => +{ + options.OnChange(option => + { + //TODO 配置更新 + }); + return System.Text.Json.JsonSerializer.Serialize(option.CurrentValue); +}); + +app.MapGet("/GetRedisHost2", ([FromServices] IConfiguration configuration) => +{ + //从配置中心获取指定AppId下的指定配置对象(ConfigObject)的Host的配置值 + //格式:ConfigurationApi:<自定义AppId>:<自定义的ConfigObject>:<参数名Host> + return configuration["ConfigurationApi::Redis:Host"]; +}); + +app.Run(); +``` + +如何更新配置 + + +```c# +var app = builder.Build(); + +app.MapPut("/UpdateRedis", ([FromServices] IConfigurationAPIManage configurationAPIManage, + [FromServices] IOptions configuration, + RedisOptions newRedis) => +{ + //修改Dcc配置 + return configurationAPIManage.UpdateAsync(option.Value.Environment, + option.Value.Cluster, + option.Value.AppId, + "<自定义-ConfigObject>" + ,newRedis); + //此处<自定义-ConfigObject>是Redis +}); + +app.Run(); +``` + +总结: + +Dcc为IConfiguration提供了远程配置的管理以及查看能力,IConfiguration完整的能力请查看[文档](../../Configuration/Masa.Contrib.Configuration/README.zh-CN.md) + +此处Redis为远程配置,介绍的是远程配置挂载到IConfiguration之后的效果以及用法,此配置与MASA.Contrib.Configuration中Redis的毫无关系,仅仅是展示同一个配置信息在两个源的使用方式以及映射节点关系的差别 \ No newline at end of file diff --git a/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs new file mode 100644 index 000000000..5219841a2 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Masa.Contrib.Configuration.ConfigurationApi.Dcc/_Imports.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Configuration; +global using Masa.BuildingBlocks.Configuration.Options; +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Model; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Options; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Parser; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; +global using Masa.Contrib.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Utils.Caching.Core.DependencyInjection; +global using Masa.Utils.Caching.Core.Models; +global using Masa.Utils.Caching.DistributedMemory.DependencyInjection; +global using Masa.Utils.Caching.DistributedMemory.Interfaces; +global using Masa.Utils.Caching.Redis.Extensions; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using System.Collections.Concurrent; +global using System.Diagnostics; +global using System.Dynamic; +global using System.Text.Json; +global using System.Text.Json.Serialization; +global using YamlDotNet.Serialization; +global using static Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal.Constants; diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs new file mode 100644 index 000000000..92cd83e58 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/CustomMemoryCacheClientFactory.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests; + +public class CustomMemoryCacheClientFactory : IMemoryCacheClientFactory +{ + private readonly IMemoryCache _memoryCache; + + public CustomMemoryCacheClientFactory(IMemoryCache memoryCache) => _memoryCache = memoryCache; + + public MemoryCacheClient CreateClient(string name) => new(_memoryCache, null!, SubscribeKeyTypes.SpecificPrefix); +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs new file mode 100644 index 000000000..670e9aad4 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccClientTest.cs @@ -0,0 +1,464 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests; + +[TestClass] +public class DccClientTest +{ + private Mock _client; + private IServiceCollection _services; + private IServiceProvider _serviceProvider => _services.BuildServiceProvider(); + private JsonSerializerOptions _jsonSerializerOptions; + private DccSectionOptions _dccSectionOptions; + private CustomTrigger _trigger; + + [TestInitialize] + public void Initialize() + { + _client = new Mock(); + _services = new ServiceCollection(); + _jsonSerializerOptions = new JsonSerializerOptions() + { + PropertyNameCaseInsensitive = true + }; + _dccSectionOptions = new DccSectionOptions() + { + Environment = "Test", + Cluster = "Default", + AppId = "DccTest", + ConfigObjects = new List() + { + "Test1" + }, + Secret = "" + }; + _trigger = new CustomTrigger(_jsonSerializerOptions); + } + + [TestMethod] + public void TestFormatCodeErrorRawReturnThrowNotSupportedException() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = "", + FormatLabelCode = "json", + }, _jsonSerializerOptions); + Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName"), "configObject invalid"); + } + + [TestMethod] + public void TestJsonFormatCodeRawReturnConfigurationTypeIsJson() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = "", + FormatLabelCode = "Json", + }, _jsonSerializerOptions); + var result = client.TestFormatRaw(raw, "DccObjectName"); + Assert.IsTrue(result.ConfigurationType == ConfigurationTypes.Json); + } + + [TestMethod] + public void TestFormatNullRawReturnThrowArgumentException() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + Assert.ThrowsException(() => client.TestFormatRaw(null, "DccObjectName"), "configObject invalid"); + } + + [TestMethod] + public void TestFormatEmptyRawReturnThrowArgumentException() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + Assert.ThrowsException(() => client.TestFormatRaw(string.Empty, "DccObjectName"), "configObject invalid"); + } + + [TestMethod] + public void TestFormatNotSupportRawReturnThrowArgumentException() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + string raw = JsonSerializer.Serialize(new PublishRelease(), _jsonSerializerOptions); + Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName"), "configObject invalid"); + } + + [TestMethod] + public void TestFormatRawByJsonReturnConfigurationTypeIsJson() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + var content = JsonSerializer.Serialize(new { Name = "Microsoft" }, _jsonSerializerOptions); + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = content, + ConfigFormat = ConfigFormats.Json + }, _jsonSerializerOptions); + var result = client.TestFormatRaw(raw, "DccObjectName"); + Assert.IsTrue(result.Raw == content && result.ConfigurationType == ConfigurationTypes.Json); + } + + [TestMethod] + public void TestFormatRawByTextReturnConfigurationTypeIsText() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + var content = "Microsoft"; + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = content, + ConfigFormat = ConfigFormats.Text + }, _jsonSerializerOptions); + var result = client.TestFormatRaw(raw, "DccObjectName"); + Assert.IsTrue(result.Raw == content && result.ConfigurationType == ConfigurationTypes.Text); + } + + [TestMethod] + public void TestFormatRawByPropertiesReturnConfigurationTypeIsProperties() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + var list = new List() + { + new() + { + Key = "Id", + Value = Guid.NewGuid().ToString(), + }, + new() + { + Key = "Name", + Value = "Microsoft" + } + }; + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = JsonSerializer.Serialize(list), + ConfigFormat = ConfigFormats.Properties + }, _jsonSerializerOptions); + var result = client.TestFormatRaw(raw, "DccObjectName"); + Dictionary dictionary = new(list.Select(x => new KeyValuePair(x.Key, x.Value)).ToList()); + Assert.IsTrue(result.Raw == JsonSerializer.Serialize(dictionary, _jsonSerializerOptions) && + result.ConfigurationType == ConfigurationTypes.Properties); + } + + [TestMethod] + public void TestFormatRawByPropertiesAndContentIsErrorReturnThrowArgumentException() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + var content = JsonSerializer.Serialize(new + { + Key = "Name", + Value = "Microsoft" + }, _jsonSerializerOptions); + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = content, + ConfigFormat = ConfigFormats.Properties + }, _jsonSerializerOptions); + Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName")); + } + + [TestMethod] + public void TestFormatRawByXmlAndContentIsErrorReturnThrowArgumentException() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + string xml = @" + + blazor + https://blazor.masastack.com/ + + "; + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = xml, + ConfigFormat = ConfigFormats.Xml + }, _jsonSerializerOptions); + + Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName")); + } + + [TestMethod] + public void TestFormatRawByXmlReturnConfigurationTypeIsXml() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + string xml = @" + + + blazor + https://blazor.masastack.com/ + + "; + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = xml, + ConfigFormat = ConfigFormats.Xml + }, _jsonSerializerOptions); + var result = client.TestFormatRaw(raw, "DccObjectName"); + + Assert.IsTrue(result.ConfigurationType == ConfigurationTypes.Xml); + } + + [TestMethod] + public void TestFormatRawByYamlAndContentIsErrorReturnThrowArgumentException() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + string yaml = @" +name: Masa, +age: 1.5 +addresses: +home: + city: hangzhou"; + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = yaml, + ConfigFormat = ConfigFormats.Yaml + }, _jsonSerializerOptions); + Assert.ThrowsException(() => client.TestFormatRaw(raw, "DccObjectName")); + } + + [TestMethod] + public void TestFormatRawByYamlReturnConfigurationTypeIsXml() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + string yaml = @" +name: Masa +age: 1.5 +addresses: + home: + city: hangzhou"; + var deserializer = new DeserializerBuilder().Build(); + var yamlObject = deserializer.Deserialize(yaml); + + var serializer = new SerializerBuilder().JsonCompatible().Build(); + var json = serializer.Serialize(yamlObject); + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = yaml, + ConfigFormat = ConfigFormats.Yaml + }, _jsonSerializerOptions); + var result = client.TestFormatRaw(raw, "DccObjectName"); + + Assert.IsTrue(result.Raw == json && result.ConfigurationType == ConfigurationTypes.Yaml); + } + + [TestMethod] + public async Task TestGetRawByKeyAsyncReturnConfigurationTypeIsText() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + string content = "Microsoft"; + string raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = content, + ConfigFormat = ConfigFormats.Text + }, _jsonSerializerOptions); + string key = "DccObjectName"; + bool isExecute = false; + _client + .Setup(c => c.GetAsync(key, It.IsAny>()!)) + .ReturnsAsync(raw) + .Callback((string value, Action action) => + { + _trigger.Formats = ConfigFormats.Text; + _trigger.Content = JsonSerializer.Serialize(new PublishRelease() + { + Content = "Apple", + ConfigFormat = ConfigFormats.Text + }, _jsonSerializerOptions); + _trigger.Action = action; + }); + var result = await client.TestGetRawByKeyAsync(key, message => + { + isExecute = true; + }); + Assert.IsTrue(result.ConfigurationType == ConfigurationTypes.Text && result.Raw == content); + Assert.IsFalse(isExecute); + _trigger.Execute(); + Assert.IsTrue(isExecute); + } + + [TestMethod] + public void TestGetDynamicAsyncByEmptyKeyReturnThrowArgumentNullException() + { + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + Assert.ThrowsExceptionAsync(() => client.TestGetDynamicAsync(string.Empty, null)); + } + + [TestMethod] + public async Task TestGetDynamicAsyncReturnResultNameIsApple() + { + string key = "environment-cluster-appId-configObject"; + var raw = JsonSerializer.Serialize(new PublishRelease() + { + Content = JsonSerializer.Serialize(new + { + id = "1", + name = "Apple" + }, _jsonSerializerOptions), + ConfigFormat = ConfigFormats.Json + }, _jsonSerializerOptions); + _client + .Setup(c => c.GetAsync(key, It.IsAny>()!)) + .ReturnsAsync(raw) + .Callback((string str, Action action) => + { + _trigger.Formats = ConfigFormats.Json; + _trigger.Content = JsonSerializer.Serialize(new PublishRelease() + { + Content = JsonSerializer.Serialize(new + { + id = "1", + name = "HuaWei" + }, _jsonSerializerOptions), + ConfigFormat = ConfigFormats.Json + }, _jsonSerializerOptions); + _trigger.Action = action; + }); + bool isExecute = false; + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + dynamic result = await client.TestGetDynamicAsync(key, (key, value, options) => + { + isExecute = true; + }); + Assert.IsTrue(result.name == "Apple"); + Assert.IsTrue(result.id == "1"); + _trigger.Execute(); + Assert.IsTrue(isExecute); + } + + [DataTestMethod] + [DataRow("Test", "Default", "DccTest", "Brand")] + public async Task TaskGetDynamicAsyncReturnResultCountIs2(string environment, string cluster, string appId, string configObject) + { + var brand = new List() + { + new() + { + Key = "Id", + Value = Guid.NewGuid().ToString(), + }, + new() + { + Key = "Name", + Value = "Microsoft" + } + }; + _client.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>())) + .ReturnsAsync(() => new PublishRelease() + { + ConfigFormat = ConfigFormats.Properties, + Content = brand.Serialize(_jsonSerializerOptions) + }.Serialize(_jsonSerializerOptions)) + .Callback((string value, Action action) => + { + _trigger.Formats = ConfigFormats.Properties; + _trigger.Content = new List() + { + new() + { + Key = "Id", + Value = Guid.NewGuid().ToString(), + }, + new() + { + Key = "Name", + Value = "HuaWei" + } + }.Serialize(_jsonSerializerOptions); + _trigger.Action = action; + }) + .Verifiable(); + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + bool isExecute = false; + var result = await client.GetDynamicAsync(environment, cluster, appId, configObject, value => isExecute = true); + _trigger.Execute(); + Assert.IsTrue((result as ExpandoObject)!.Count() == 2); + Assert.IsTrue(isExecute); + } + + [TestMethod] + public async Task TaskGetDynamicAsyncByKeyReturnResultCountIs1() + { + var brand = new List() + { + new() + { + Key = "Id", + Value = Guid.NewGuid().ToString(), + } + }; + _client.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>())) + .ReturnsAsync(() => new PublishRelease + { + ConfigFormat = ConfigFormats.Properties, + Content = brand.Serialize(_jsonSerializerOptions) + }.Serialize(_jsonSerializerOptions)) + .Verifiable(); + var client = new CustomConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + + string key = "environment-cluster-appId-configObject"; + var result = await client.GetDynamicAsync(key); + _trigger.Execute(); + Assert.IsTrue((result as ExpandoObject)!.Count() == 1); + } + + [TestMethod] + [DataRow("Test", "Default", "DccTest", "Brand")] + public async Task TestGetAsyncByJsonReturn(string environment, string cluster, string appId, string configObject) + { + var brand = new Brands("Microsoft"); + var newBrand = new Brands("Microsoft2"); + + _client.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result).Returns(() => new PublishRelease() + { + ConfigFormat = ConfigFormats.Json, + Content = brand.Serialize(_jsonSerializerOptions) + }.Serialize(_jsonSerializerOptions)).Callback((string str, Action action) => + { + _trigger.Formats = ConfigFormats.Json; + _trigger.Content = newBrand.Serialize(_jsonSerializerOptions); + _trigger.Action = action; + }); + var client = new ConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + var ret = await client.GetAsync(environment, cluster, appId, configObject, (Brands br) => + { + Assert.IsTrue(br.Id == newBrand.Id); + Assert.IsTrue(br.Name == newBrand.Name); + }); + Assert.IsNotNull(ret); + Assert.IsTrue(brand.Id == ret.Id && brand.Name == ret.Name); + _trigger.Execute(); + + ret = await client.GetAsync(environment, cluster, appId, configObject, It.IsAny>()); + Assert.IsNotNull(ret); + + Assert.IsTrue(ret.Id == newBrand.Id && ret.Name == newBrand.Name); + } + + // [DataTestMethod] + // [DataRow("Test", "Default", "DccTest", "Brand")] + // public async Task GetAsyncByProperty(string environment, string cluster, string appId, string configObject) + // { + // var brand = new List() + // { + // new() + // { + // Key = "Id", + // Value = Guid.NewGuid().ToString(), + // }, + // new() + // { + // Key = "Name", + // Value = "Microsoft" + // } + // }; + // _client.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result).Returns(() => new PublishRelease() + // { + // ConfigFormat = ConfigFormats.Properties, + // Content = brand.Serialize(_jsonSerializerOptions) + // }.Serialize(_jsonSerializerOptions)).Verifiable(); + // var client = new ConfigurationApiClient(_serviceProvider, _client.Object, _jsonSerializerOptions, _dccSectionOptions, null); + // var ret = await client.GetAsync(environment, cluster, appId, configObject, It.IsAny>()); + // Assert.IsNotNull(ret); + // + // Assert.IsTrue(ret.Id.ToString() == brand.Where(b => b.Key == "Id").Select(t => t.Value).FirstOrDefault() && + // ret.Name == brand.Where(b => b.Key == "Name").Select(t => t.Value).FirstOrDefault()); + // } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs new file mode 100644 index 000000000..115ccff3a --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccManageTest.cs @@ -0,0 +1,219 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + + + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests; + +[TestClass] +public class DccManageTest +{ + private DccSectionOptions _dccSectionOptions; + private JsonSerializerOptions _jsonSerializerOptions; + private Mock _caller; + + [TestInitialize] + public void Initialize() + { + _dccSectionOptions = new DccSectionOptions() + { + Environment = "Test", + Cluster = "Default", + AppId = "DccTest", + ConfigObjects = new List() + { + "Test1" + }, + Secret = "Secret" + }; + _jsonSerializerOptions = new JsonSerializerOptions() + { + PropertyNameCaseInsensitive = true + }; + _caller = new Mock(); + } + + [DataTestMethod] + [DataRow("Test", "Default", "DccTest", "Brand")] + public async Task TestUpdateAsync(string environment, string cluster, string appId, string configObject) + { + var brand = new Brands("Microsoft"); + _caller.Setup(factory => factory.PutAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent(brand.Serialize(_jsonSerializerOptions)) + }).Verifiable(); + + var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); + await manage.UpdateAsync(environment, cluster, appId, configObject, brand); + } + + [DataTestMethod] + [DataRow("Test", "Default", "DccTest", "Brand")] + public async Task TestUpdateAsyncAndError(string environment, string cluster, string appId, string configObject) + { + var brand = new Brands("Microsoft"); + + _caller.Setup(factory => factory.PutAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() + { + StatusCode = HttpStatusCode.ExpectationFailed, + Content = new StringContent("error") + }).Verifiable(); + + var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); + await Assert.ThrowsExceptionAsync(async () => await manage.UpdateAsync(environment, cluster, appId, configObject, brand)); + } + + [DataTestMethod] + [DataRow("Test", "Default", "DccTest", "Brand")] + public async Task TestUpdateAsyncAndCustomError(string environment, string cluster, string appId, string configObject) + { + var brand = new Brands("Microsoft"); + _caller.Setup(factory => factory.PutAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() + { + StatusCode = (HttpStatusCode)299, + Content = new StringContent("custom error") + }).Verifiable(); + + var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); + await Assert.ThrowsExceptionAsync(async () => await manage.UpdateAsync(environment, cluster, appId, configObject, brand)); + } + + [DataTestMethod] + [DataRow("Test", "Default", "DccTest")] + public async Task TestInitAsync(string environment, string cluster, string appId) + { + var configObjects = new Dictionary + { + { "Appsettings", "{\"ConnectionStrings\":\"xxxx\"}" } + }; + _caller.Setup(factory => factory.PostAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent(configObjects.Serialize(_jsonSerializerOptions)) + }).Verifiable(); + + var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); + await manage.InitializeAsync(environment, cluster, appId, configObjects); + } + + [DataTestMethod] + [DataRow("Test", "Default", "DccTest")] + public async Task TestInitAsyncAndError(string environment, string cluster, string appId) + { + var configObjects = new Dictionary + { + { "Appsettings", "{\"ConnectionStrings\":\"xxxx\"}" } + }; + + _caller.Setup(factory => factory.PostAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() + { + StatusCode = HttpStatusCode.ExpectationFailed, + Content = new StringContent("error") + }).Verifiable(); + + var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); + await Assert.ThrowsExceptionAsync(async () => await manage.InitializeAsync(environment, cluster, appId, configObjects)); + } + + [DataTestMethod] + [DataRow("Test", "Default", "DccTest")] + public async Task TestInitAsyncAndCustomError(string environment, string cluster, string appId) + { + var configObjects = new Dictionary + { + { "Appsettings", "{\"ConnectionStrings\":\"xxxx\"}" } + }; + + _caller.Setup(factory => factory.PostAsync(It.IsAny(), It.IsAny(), false, default).Result).Returns(() => new HttpResponseMessage() + { + StatusCode = (HttpStatusCode)299, + Content = new StringContent("custom error") + }).Verifiable(); + + var manage = new ConfigurationApiManage(_caller.Object, _dccSectionOptions, null); + await Assert.ThrowsExceptionAsync(async () => await manage.InitializeAsync(environment, cluster, appId, configObjects)); + } + + [DataTestMethod] + [DataRow("DccTest", "Secret")] + [DataRow("DccTest2", "Secret2")] + [DataRow("DccTest3", "")] + public void TestGetSecret(string appId, string secret) + { + var api = new CustomConfigurationAPI(_dccSectionOptions, new List() + { + new() + { + Environment = "Test2", + Cluster = "Default2", + AppId = "DccTest2", + ConfigObjects = new List() + { + "Test12" + }, + Secret = "Secret2" + } + }); + if (string.IsNullOrEmpty(secret)) + Assert.ThrowsException(() => api.GetSecret(appId)); + else + Assert.IsTrue(api.GetSecret(appId) == secret); + } + + [DataTestMethod] + [DataRow("Test2", "Test2")] + [DataRow("", "Test")] + public void TestGetEnvironment(string environment, string outEnvironment) + { + var api = new CustomConfigurationAPI(_dccSectionOptions, null); + Assert.IsTrue(api.GetEnvironment(environment) == outEnvironment); + } + + [DataTestMethod] + [DataRow("CustomCluster", "CustomCluster")] + [DataRow("", "Default")] + public void GetCluster(string cluster, string outCluster) + { + var api = new CustomConfigurationAPI(_dccSectionOptions, null); + Assert.IsTrue(api.GetCluster(cluster) == outCluster); + } + + [DataTestMethod] + [DataRow("CustomAppid", "CustomAppid")] + [DataRow("", "DccTest")] + public void GetAppid(string appId, string outAppid) + { + var api = new CustomConfigurationAPI(_dccSectionOptions, null); + Assert.IsTrue(api.GetAppId(appId) == outAppid); + } + + [DataTestMethod] + [DataRow("configObject", "configObject")] + [DataRow("", "")] + public void GetConfigObject(string configObject, string outConfigObject) + { + var api = new CustomConfigurationAPI(_dccSectionOptions, null); + if (string.IsNullOrEmpty(configObject)) + Assert.ThrowsException(() => api.GetConfigObject(configObject)); + else + Assert.IsTrue(api.GetConfigObject(configObject) == outConfigObject); + } +} + +public class CustomConfigurationAPI : ConfigurationApiBase +{ + public CustomConfigurationAPI(DccSectionOptions defaultSectionOption, List? expandSectionOptions) : base(defaultSectionOption, expandSectionOptions) + { + } + + public new string GetSecret(string appId) => base.GetSecret(appId); + + public new string GetEnvironment(string environment) => base.GetEnvironment(environment); + + public new string GetCluster(string cluster) => base.GetCluster(cluster); + + public new string GetAppId(string appId) => base.GetAppId(appId); + + public new string GetConfigObject(string configObject) => base.GetConfigObject(configObject); +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs new file mode 100644 index 000000000..bed38fa52 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/DccTest.cs @@ -0,0 +1,842 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests; + +[TestClass] +public class DccTest +{ + private string DEFAULT_CLIENT_NAME = "masa.contrib.configuration.configurationapi.dcc"; + private Mock _masaConfigurationBuilder; + private JsonSerializerOptions _jsonSerializerOptions; + private IServiceCollection _services; + + private Mock _memoryCacheClientFactory; + private Mock _memoryCache; + private Mock _distributedCacheClient; + private const string DEFAULT_ENVIRONMENT_NAME = "ASPNETCORE_ENVIRONMENT"; + private const string DEFAULT_SUBSCRIBE_KEY_PREFIX = "masa.dcc:"; + + [TestInitialize] + public void Initialize() + { + _services = new ServiceCollection(); + _masaConfigurationBuilder = new Mock(); + var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json", true, true).Build; + _masaConfigurationBuilder.Setup(builder => builder.Configuration).Returns(configuration).Verifiable(); + _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + _memoryCacheClientFactory = new Mock(); + _memoryCache = new Mock(); + _distributedCacheClient = new Mock(); + _jsonSerializerOptions = new JsonSerializerOptions() + { + PropertyNameCaseInsensitive = true + }; + } + + [TestMethod] + public void TestTryAddConfigurationApiClient() + { + _memoryCacheClientFactory.Setup(factory => factory.CreateClient(DEFAULT_CLIENT_NAME)).Returns(() => null!).Verifiable(); + _services.AddSingleton(_ => _memoryCacheClientFactory.Object); + MasaConfigurationExtensions.TryAddConfigurationApiClient(_services, new DccSectionOptions(), new List(), null!); + Assert.IsTrue(_services.Count(service + => service.ServiceType == typeof(IConfigurationApiClient) && service.Lifetime == ServiceLifetime.Singleton) == 1); + Assert.ThrowsException(() => + { + var _ = _services.BuildServiceProvider().GetServices(); + }); + + _services = new ServiceCollection(); + _memoryCacheClientFactory + .Setup(factory => factory.CreateClient(DEFAULT_CLIENT_NAME)) + .Returns(() => new MemoryCacheClient(_memoryCache.Object, _distributedCacheClient.Object, + SubscribeKeyTypes.ValueTypeFullNameAndKey)) + .Verifiable(); + _services.AddSingleton(_ => _memoryCacheClientFactory.Object); + MasaConfigurationExtensions.TryAddConfigurationApiClient(_services, new DccSectionOptions(), new List(), + new JsonSerializerOptions() + { + Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping + }); + + var clienties = _services.BuildServiceProvider().GetServices(); + Assert.IsTrue(clienties.Count() == 1); + + _services = new ServiceCollection(); + _memoryCacheClientFactory + .Setup(factory => factory.CreateClient(DEFAULT_CLIENT_NAME)) + .Returns(() => new MemoryCacheClient(_memoryCache.Object, _distributedCacheClient.Object, + SubscribeKeyTypes.ValueTypeFullNameAndKey)) + .Verifiable(); + _services.AddSingleton(_ => _memoryCacheClientFactory.Object); + MasaConfigurationExtensions.TryAddConfigurationApiClient(_services, new DccSectionOptions(), new List(), + _jsonSerializerOptions); + MasaConfigurationExtensions.TryAddConfigurationApiClient(_services, new DccSectionOptions(), new List(), + _jsonSerializerOptions); + clienties = _services.BuildServiceProvider().GetServices(); + Assert.IsTrue(clienties.Count() == 1); + } + + [TestMethod] + public void TestTryAddConfigurationApiManage() + { + Mock httpClientFactory = new(); + _services.AddSingleton(httpClientFactory.Object); + _services.AddCaller(options => options.UseHttpClient()); + + MasaConfigurationExtensions.TryAddConfigurationApiManage( + _services, + "http", + new DccSectionOptions(), + new List()); + + MasaConfigurationExtensions.TryAddConfigurationApiManage( + _services, + "http", + new DccSectionOptions(), + new List()); + Assert.IsTrue(_services.Count(service + => service.ServiceType == typeof(IConfigurationApiManage) && service.Lifetime == ServiceLifetime.Singleton) == 1); + var serviceProvider = _services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestUseDccAndNullDccConfigurationOption() + { + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => null!, option => + { + option.AppId = "Test"; + option.Environment = "Test"; + option.ConfigObjects = new List() { "Te" }; + }, null)); + } + + [TestMethod] + public void TestCustomCaller() + { + var response = JsonSerializer.Serialize(new PublishRelease() + { + Content = string.Empty, + ConfigFormat = ConfigFormats.Text + }); + Mock memoryCacheClient = new(); + memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) + .Returns(() => response); + + var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), + memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); + _services.AddSingleton(configurationApiClient); + _masaConfigurationBuilder.Object.UseDcc(() => new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }, option => + { + option.AppId = "Test"; + option.Environment = "Test"; + option.ConfigObjects = new List() + { + "Settings" + }; + }, null, jsonSerializerOption => + { + jsonSerializerOption.Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping; + }, option => + { + option.UseHttpClient(builder => + { + builder.Name = "CustomHttpClient"; + builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); + }); + }); + var caller = _services.BuildServiceProvider().GetRequiredService().Create("CustomHttpClient"); + Assert.IsNotNull(caller); + } + + [TestMethod] + public void TestUseDccAndEmptyDccServiceAddress() + { + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "", + }; + }, null!, null), "DccServiceAddress"); + } + + [TestMethod] + public void TestUseDccAndErrorDccService() + { + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = null! + } + }; + }, null!, null), "Servers"); + + _services = new ServiceCollection(); + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions + { + Servers = new List() + } + }; + }, null!, null), "Servers"); + + _services = new ServiceCollection(); + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions + { + Servers = new List() + { + new() + { + Host = "", + Port = 8080 + } + } + } + }; + }, null!, null), "Servers"); + + _services = new ServiceCollection(); + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = -1 + } + } + } + }; + }, null!, null), "Servers"); + } + + [TestMethod] + public void TestUseDccAndErrorDefaultSectionOption() + { + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, null!, null), "defaultSectionOptions"); + + _services = new ServiceCollection(); + _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, option => + { + option.AppId = ""; + }, null), "AppId cannot be empty"); + + _services = new ServiceCollection(); + _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, option => + { + option.AppId = "Test"; + option.ConfigObjects = null!; + }, null), "ConfigObjects cannot be empty"); + + _services = new ServiceCollection(); + _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, option => + { + option.AppId = "Test"; + option.ConfigObjects = new List(); + }, null), "ConfigObjects cannot be empty"); + + _services = new ServiceCollection(); + _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, option => + { + option.AppId = "Test"; + option.ConfigObjects = new List() + { + "Brand" + }; + }, null), "Error getting environment information, please make sure the value of ASPNETCORE_ENVIRONMENT has been configured"); + } + + [TestMethod] + public void TestUseDccAndErrorExpansionSectionOptions() + { + Environment.SetEnvironmentVariable(DEFAULT_ENVIRONMENT_NAME, "Test"); + + _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, option => + { + option.AppId = "Test"; + option.ConfigObjects = new List() + { + "Brand" + }; + }, option => + { + option.ExpandSections = new List() + { + new() + { + AppId = "Test2", + } + }; + }), "ConfigObjects in the extension section cannot be empty"); + + _services = new ServiceCollection(); + _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, option => + { + option.AppId = "Test"; + option.ConfigObjects = new List() + { + "Brand" + }; + }, option => + { + option.ExpandSections = new List() + { + new() + { + AppId = "Test2", + ConfigObjects = new List() + } + }; + }), "ConfigObjects in the extension section cannot be empty"); + + _services = new ServiceCollection(); + _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, option => + { + option.AppId = "Test"; + option.ConfigObjects = new List() + { + "Brand" + }; + }, option => + { + option.ExpandSections = new List() + { + new() + { + AppId = "Test", + ConfigObjects = new List() + { + "Settings" + } + } + }; + }), "The current section already exists, no need to mount repeatedly"); + + _services = new ServiceCollection(); + _masaConfigurationBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, option => + { + option.AppId = "Test"; + option.ConfigObjects = new List() + { + "Brand" + }; + }, option => + { + option.ExpandSections = new List() + { + new() + { + AppId = "Test2", + ConfigObjects = new List() + { + "Settings" + } + }, + new() + { + AppId = "Test2", + ConfigObjects = new List() + { + "Settings" + } + } + }; + }), "The current section already exists, no need to mount repeatedly"); + } + + [DataTestMethod] + [DataRow("Development", "Default", "WebApplication1", "Brand")] + public void TestUseDccAndSuccess(string environment, string cluster, string appId, string configObject) + { + Environment.SetEnvironmentVariable(DEFAULT_ENVIRONMENT_NAME, "Test"); + var brand = new Brands("Microsoft"); + var response = JsonSerializer.Serialize(new PublishRelease() + { + Content = JsonSerializer.Serialize(brand), + ConfigFormat = ConfigFormats.Json + }); + Mock memoryCacheClient = new(); + memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) + .Returns(() => response); + + var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), + memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); + _services.AddSingleton(configurationApiClient); + + _masaConfigurationBuilder.Object.UseDcc(() => + { + return new DccConfigurationOptions() + { + ManageServiceAddress = "https://github.com", + RedisOptions = new RedisConfigurationOptions() + { + Servers = new List() + { + new() + { + Host = "localhost", + Port = 6379 + } + } + } + }; + }, option => + { + option.AppId = "Test"; + option.ConfigObjects = new List() + { + "Brand" + }; + }, null); + var optionFactory = _services.BuildServiceProvider().GetRequiredService>(); + var option = optionFactory.Create(DEFAULT_CLIENT_NAME); + + Assert.IsTrue(option.SubscribeKeyType == SubscribeKeyTypes.SpecificPrefix); + + Assert.IsTrue(option.SubscribeKeyPrefix == DEFAULT_SUBSCRIBE_KEY_PREFIX); + } + + [TestMethod] + public void TestDccConfigurationOptions() + { + var options = new DccConfigurationOptions + { + RedisOptions = new RedisConfigurationOptions() + { + SyncTimeout = 10 + }, + ManageServiceAddress = "https://github.com", + SubscribeKeyPrefix = "masa.dcc.test:" + }; + Assert.IsTrue(options.SubscribeKeyPrefix == "masa.dcc.test:"); + Assert.IsTrue(options.ManageServiceAddress == "https://github.com"); + Assert.IsTrue(options.RedisOptions.SyncTimeout == 10); + } + + [DataTestMethod] + [DataRow("Development", "Default", "WebApplication1", "Brand")] + public void TestUseDccAndSingleSection(string environment, string cluster, string appId, string configObject) + { + CustomTrigger trigger = new CustomTrigger(_jsonSerializerOptions); + var brand = new Brands("Microsoft"); + var response = JsonSerializer.Serialize(new PublishRelease() + { + Content = brand.Serialize(_jsonSerializerOptions), + ConfigFormat = ConfigFormats.Text + }); + Mock memoryCacheClient = new(); + memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) + .Returns(() => response); + var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), + memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); + _services.AddSingleton(configurationApiClient); + + _masaConfigurationBuilder.Object.UseDcc(); + Assert.IsTrue( + configurationApiClient + .GetRawAsync(environment, cluster, appId, configObject, It.IsAny>()) + .GetAwaiter() + .GetResult().Raw == brand.Serialize(_jsonSerializerOptions)); + trigger.Execute(); + } + + [DataTestMethod] + [DataRow("Development", "Default", "WebApplication1", "Brand")] + public void TestUseDccAndSingleSection2(string environment, string cluster, string appId, string configObject) + { + CustomTrigger trigger = new CustomTrigger(_jsonSerializerOptions); + Mock memoryCacheClient = new(); + Dictionary masaDic = new Dictionary() + { + { "Id", Guid.NewGuid().ToString() }, + { "Name", "Masa" } + }; + var response = JsonSerializer.Serialize(new PublishRelease() + { + Content = masaDic.Serialize(_jsonSerializerOptions), + ConfigFormat = ConfigFormats.Json + }); + memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) + .Returns(() => response); + var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), + memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); + _services.AddSingleton(configurationApiClient); + + _masaConfigurationBuilder.Object.UseDcc(); + Assert.IsTrue( + configurationApiClient.GetRawAsync( + environment, + cluster, + appId, + configObject, + It.IsAny>()).Result.Raw == masaDic.Serialize(_jsonSerializerOptions)); + } + + [DataTestMethod] + [DataRow("Development", "Default", "WebApplication1", "Brand")] + public void TestUseDccAndSingleSection3(string environment, string cluster, string appId, string configObject) + { + Mock memoryCacheClient = new(); + + var response = JsonSerializer.Serialize(new PublishRelease() + { + Content = "Test", + ConfigFormat = ConfigFormats.Text + }); + memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) + .Returns(() => response); + var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), + memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); + _services.AddSingleton(configurationApiClient); + + _masaConfigurationBuilder.Object.UseDcc(); + Assert.IsTrue(configurationApiClient.GetRawAsync( + environment, + cluster, + appId, + configObject, + It.IsAny>()).GetAwaiter().GetResult().Raw == "Test"); + } + + [DataTestMethod] + [DataRow("Development", "Default", "WebApplication1", "Brand")] + public void TestUseDccAndSingleSection4(string environment, string cluster, string appId, string configObject) + { + Mock memoryCacheClient = new(); + + var response = JsonSerializer.Serialize(new PublishRelease() + { + Content = null, + ConfigFormat = ConfigFormats.Text + }); + memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) + .Returns(() => response); + var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), + memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); + _services.AddSingleton(configurationApiClient); + + _masaConfigurationBuilder.Object.UseDcc(); + Assert.IsTrue(configurationApiClient.GetRawAsync( + environment, + cluster, + appId, + configObject, + It.IsAny>()).GetAwaiter().GetResult().Raw == null); + } + + [TestMethod] + public void TestUseDccAndSingleSection5() + { + CustomTrigger trigger = new CustomTrigger(_jsonSerializerOptions); + Mock memoryCacheClient = new(); + var response = JsonSerializer.Serialize(new PublishRelease() + { + Content = "Test", + ConfigFormat = (ConfigFormats)4 + }); + memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result) + .Returns(() => response); + var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), + memoryCacheClient.Object, _jsonSerializerOptions, new Mock().Object, new List()); + _services.AddSingleton(configurationApiClient); + + Assert.ThrowsException(() => _masaConfigurationBuilder.Object.UseDcc()); + } + + [DataTestMethod] + [DataRow("Development", "Default", "WebApplication1", "Brand")] + public void TestUseMultiDcc(string environment, string cluster, string appId, string configObject) + { + var brand = new Brands("Microsoft"); + var response = JsonSerializer.Serialize(new PublishRelease() + { + Content = JsonSerializer.Serialize(brand), + ConfigFormat = ConfigFormats.Json + }); + Mock memoryCacheClient = new(); + memoryCacheClient.Setup(client => client.GetAsync(It.IsAny(), It.IsAny>()).Result).Returns(() => response); + + var configurationApiClient = new ConfigurationApiClient(_services.BuildServiceProvider(), memoryCacheClient.Object, + _jsonSerializerOptions, new Mock().Object, new List()); + _services.AddSingleton(configurationApiClient); + + _masaConfigurationBuilder.Object.UseDcc().UseDcc(); + var result = configurationApiClient.GetRawAsync( + environment, + cluster, + appId, + configObject, + It.IsAny>()).ConfigureAwait(false).GetAwaiter().GetResult(); + Assert.IsTrue(result.Raw == JsonSerializer.Serialize(brand)); + + var httpClient = _services.BuildServiceProvider().GetRequiredService().CreateClient(DEFAULT_CLIENT_NAME); + Assert.IsTrue(httpClient.BaseAddress!.ToString() == "http://localhost:6379/"); + } + + [TestMethod] + public void TestLoadPropertiesShouldReturnJson() + { + var brands = new Brands("Microsoft"); + Mock configurationClient = new(); + configurationClient.Setup(client => client.GetRawAsync(It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny(), It.IsAny>())).ReturnsAsync((JsonSerializer.Serialize(brands), ConfigurationTypes.Json)); + } + + [TestMethod] + public void TestMasaConfigurationByConfigurationAPIReturnKeyIsExist() + { + var builder = WebApplication.CreateBuilder(); + var brand = new Brands("Apple"); + builder.Services.AddMemoryCache(); + string key = "Development-Default-WebApplication1-Brand".ToLower(); + builder.Services.AddSingleton(serviceProvider => + { + var memoryCache = serviceProvider.GetRequiredService(); + string value = new PublishRelease() + { + Content = brand.Serialize(_jsonSerializerOptions), + ConfigFormat = ConfigFormats.Json + }.Serialize(_jsonSerializerOptions); + memoryCache.Set($"{key}String", value); + return new CustomMemoryCacheClientFactory(memoryCache); + }); + + builder.AddMasaConfiguration(masaBuilder => masaBuilder.UseDcc()); + + var serviceProvider = builder.Services.BuildServiceProvider(); + var masaConfiguration = serviceProvider.GetService(); + Assert.IsTrue(masaConfiguration != null); + var configuration = masaConfiguration!.ConfigurationApi; + Assert.IsNotNull(configuration); + + Assert.IsTrue(configuration.Get("WebApplication1")["Brand:Name"] == "Apple"); + } + + [TestMethod] + public void TestGetSecretRenturnSecretEqualSecret() + { + var builder = WebApplication.CreateBuilder(); + var brand = new Brands("Apple"); + builder.Services.AddMemoryCache(); + string key = "Development-Default-WebApplication1-Brand".ToLower(); + builder.Services.AddSingleton(serviceProvider => + { + var memoryCache = serviceProvider.GetRequiredService(); + string value = new PublishRelease() + { + Content = brand.Serialize(_jsonSerializerOptions), + ConfigFormat = ConfigFormats.Json + }.Serialize(_jsonSerializerOptions); + memoryCache.Set($"{key}String", value); + return new CustomMemoryCacheClientFactory(memoryCache); + }); + builder.AddMasaConfiguration(configurationBuilder => configurationBuilder.UseDcc()); + + var serviceProvider = builder.Services.BuildServiceProvider(); + var configurationApiClient = serviceProvider.GetRequiredService(); + var field = typeof(ConfigurationApiBase).GetField("_defaultSectionOption", BindingFlags.Instance | BindingFlags.NonPublic); + var option = field!.GetValue(configurationApiClient); + Assert.IsTrue(((DccSectionOptions)option!).Secret == "Secret"); + } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs new file mode 100644 index 000000000..383e39b14 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Common/SerializeCommon.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Common; + +internal static class SerializeCommon +{ + public static string Serialize(this object obj, JsonSerializerOptions? jsonSerializerOptions) + => JsonSerializer.Serialize(obj, jsonSerializerOptions); +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs new file mode 100644 index 000000000..49cb47bdd --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/Property.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Config; + +internal class Property +{ + public string Key { get; set; } = default!; + + public string Value { get; set; } = default!; +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs new file mode 100644 index 000000000..612d947d0 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Config/PublishRelease.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Config; + +internal class PublishRelease +{ + public ConfigFormats ConfigFormat { get; set; } + + public string? FormatLabelCode { get; set; } + + public string? Content { get; set; } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs new file mode 100644 index 000000000..2a755fd91 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomConfigurationApiClient.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal; + +internal class CustomConfigurationApiClient : ConfigurationApiClient +{ + public CustomConfigurationApiClient( + IServiceProvider serviceProvider, + IMemoryCacheClient client, + JsonSerializerOptions jsonSerializerOptions, + DccSectionOptions defaultSectionOption, + List? expandSectionOptions) + : base(serviceProvider, client, jsonSerializerOptions, defaultSectionOption, expandSectionOptions) + { + } + + public (string Raw, ConfigurationTypes ConfigurationType) TestFormatRaw(string? raw, string paramName) + => base.FormatRaw(raw, paramName); + + public Task<(string Raw, ConfigurationTypes ConfigurationType)> TestGetRawByKeyAsync(string key, Action? valueChanged) + => base.GetRawByKeyAsync(key, valueChanged); + + public Task TestGetDynamicAsync(string key, Action? valueChanged) => base.GetDynamicAsync(key, valueChanged); +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs new file mode 100644 index 000000000..f4f3360fe --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/CustomTrigger.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal; + +public class CustomTrigger +{ + private JsonSerializerOptions _jsonSerializerOptions; + + public CustomTrigger(JsonSerializerOptions jsonSerializerOptions) + { + _jsonSerializerOptions = jsonSerializerOptions; + } + + internal ConfigFormats Formats { get; set; } + + internal string Content { get; set; } + + internal Action Action { get; set; } + + internal void Execute() + { + Action?.Invoke(new PublishRelease() + { + ConfigFormat = Formats, + Content = Content + }.Serialize(_jsonSerializerOptions)); + } +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs new file mode 100644 index 000000000..96a145453 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Enum/ConfigFormats.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Enum; + +internal enum ConfigFormats +{ + Properties = 1, + Text, + Json, + Yaml, + Xml +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs new file mode 100644 index 000000000..85f7c4c30 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Internal/Model/Brands.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Model; + +internal class Brands +{ + public Guid Id { get; init; } + + public string Name { get; set; } + + public Brands() + => this.Id = Guid.NewGuid(); + + public Brands(string Name) : this() + => this.Name = Name; +} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj new file mode 100644 index 000000000..a2b47fcee --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj @@ -0,0 +1,41 @@ + + + + net6.0 + enable + false + enable + + + + + Always + + + Always + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs new file mode 100644 index 000000000..4216f2904 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/_Imports.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Configuration; +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Internal; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Options; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Common; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Config; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Enum; +global using Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.Internal.Model; +global using Masa.Contrib.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Core.Models; +global using Masa.Utils.Caching.DistributedMemory; +global using Masa.Utils.Caching.DistributedMemory.Interfaces; +global using Masa.Utils.Caching.DistributedMemory.Models; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.Caching.Memory; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Dynamic; +global using System.Net; +global using System.Reflection; +global using System.Text.Json; +global using YamlDotNet.Serialization; diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json new file mode 100644 index 000000000..3708a6f41 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/appsettings.json @@ -0,0 +1,23 @@ +{ + "DccOptions": { + "ManageServiceAddress": "http://localhost:6379", + "SubscribeKeyPrefix": "masa.dcc:", + "RedisOptions": { + "Servers": [ + { + "Host": "localhost", + "Port": 6379 + } + ], + "DefaultDatabase": 0, + "Password": "" + } + }, + "AppId": "WebApplication1", + "Environment": "Development", + "Cluster": "Default", + "ConfigObjects": [ + "Brand" + ], + "Secret": "Secret" +} \ No newline at end of file diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json new file mode 100644 index 000000000..28e953152 --- /dev/null +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/expandSections.json @@ -0,0 +1,32 @@ +{ + "DccOptions": { + "ManageServiceAddress": "http://localhost:6379", + "RedisOptions": { + "Servers": [ + { + "Host": "localhost", + "Port": 8888 + } + ], + "DefaultDatabase": 0, + "Password": "" + } + }, + "AppId": "DccTest", + "Environment": "Test", + "Cluster": "Default", + "ConfigObjects": [ + "Test1" + ], + "Sectet": "", + "ExpandSections": [ + { + "AppId": "DccTest2", + "Environment": "Test2", + "Cluster": "Default", + "ConfigObjects": [ + "Test3" + ] + } + ] +} \ No newline at end of file diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs new file mode 100644 index 000000000..47d6531d1 --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/ConfigurationOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public class ConfigurationOptions +{ + public Assembly[] Assemblies { get; set; } + + public List ExcludeConfigurationSourceTypes { get; set; } + + public List ExcludeConfigurationProviderTypes { get; set; } + + public ConfigurationOptions() + { + Assemblies = AppDomain.CurrentDomain.GetAssemblies(); + ExcludeConfigurationSourceTypes = Internal.ConfigurationExtensions.DefaultExcludeConfigurationSourceTypes; + ExcludeConfigurationProviderTypes = Internal.ConfigurationExtensions.DefaultExcludeConfigurationProviderTypes; + } +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs new file mode 100644 index 000000000..dcf6d8b4b --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultConfigurationApi.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public class DefaultConfigurationApi : IConfigurationApi +{ + private readonly IConfiguration _configuration; + + public DefaultConfigurationApi(IConfiguration configuration) + { + _configuration = configuration; + } + + public IConfiguration Get(string appId) + { + return _configuration.GetSection(SectionTypes.ConfigurationApi.ToString()).GetSection(appId); + } +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs new file mode 100644 index 000000000..eab1a495e --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultMasaConfiguration.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public class DefaultMasaConfiguration : IMasaConfiguration +{ + private readonly IConfiguration _configuration; + + public IConfiguration Local => GetConfiguration(SectionTypes.Local); + + public IConfigurationApi ConfigurationApi { get; } + + public DefaultMasaConfiguration(IConfiguration configuration, IConfigurationApi configurationApi) + { + _configuration = configuration; + ConfigurationApi = configurationApi; + } + + public IConfiguration GetConfiguration(SectionTypes sectionType) => _configuration.GetSection(sectionType.ToString()); +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs new file mode 100644 index 000000000..9de09e6fa --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/DefaultMasaConfigurationSourceProvider.cs @@ -0,0 +1,79 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public class DefaultMasaConfigurationSourceProvider : IMasaConfigurationSourceProvider +{ + public virtual (List MigrateConfigurationSources, List ConfigurationSources) GetMigrated( + IConfigurationBuilder configurationBuilder, + List excludeConfigurationSourceTypes, + List excludeConfigurationProviderTypes) + { + List migrateConfigurationSources = new(); + List configurationSources = new(); + foreach (var source in configurationBuilder.Sources) + { + var result = GetMigrated(source, excludeConfigurationSourceTypes, excludeConfigurationProviderTypes); + migrateConfigurationSources.AddRange(result.MigrateConfigurationSources); + configurationSources.AddRange(result.ConfigurationSources); + } + return (migrateConfigurationSources, configurationSources); + } + + public virtual (List MigrateConfigurationSources, List ConfigurationSources) + GetMigrated( + IConfiguration configuration, + List excludeConfigurationSourceTypes, + List excludeConfigurationProviderTypes) + { + List migrateConfigurationSources = new(); + List configurationSources = new(); + if (configuration is IConfigurationBuilder configurationBuilder) + { + foreach (var configurationSource in configurationBuilder.Sources) + { + var result = GetMigrated( + configurationSource, + excludeConfigurationSourceTypes, + excludeConfigurationProviderTypes); + migrateConfigurationSources.AddRange(result.MigrateConfigurationSources); + configurationSources.AddRange(result.ConfigurationSources); + } + } + else if (configuration is IConfigurationRoot configurationRoot) + { + foreach (var configurationProvider in configurationRoot.Providers) + { + var masaConfigurationSource = new MasaConfigurationSource(configurationProvider); + if (excludeConfigurationProviderTypes.Contains(configurationProvider.GetType())) + configurationSources.Add(masaConfigurationSource); + else migrateConfigurationSources.Add(masaConfigurationSource); + } + } + return new(migrateConfigurationSources, configurationSources); + } + + public virtual (List MigrateConfigurationSources, List ConfigurationSources) + GetMigrated( + IConfigurationSource configurationSource, + List excludeConfigurationSourceTypes, + List excludeConfigurationProviderTypes) + { + List migrateConfigurationSources = new(); + List configurationSources = new(); + if (excludeConfigurationSourceTypes.Contains(configurationSource.GetType())) + { + configurationSources.Add(configurationSource); + return (migrateConfigurationSources, configurationSources); + } + if (configurationSource is ChainedConfigurationSource chainedConfigurationSource) + return GetMigrated( + chainedConfigurationSource.Configuration, + excludeConfigurationSourceTypes, + excludeConfigurationProviderTypes); + + migrateConfigurationSources.Add(configurationSource); + return (migrateConfigurationSources, configurationSources); + } +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs new file mode 100644 index 000000000..0bdf49ab8 --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/IMasaConfigurationSourceProvider.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public interface IMasaConfigurationSourceProvider +{ + (List MigrateConfigurationSources, List ConfigurationSources) GetMigrated( + IConfigurationBuilder configurationBuilder, + List excludeConfigurationSourceTypes, + List excludeConfigurationProviderTypes); +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs new file mode 100644 index 000000000..958eb9ed7 --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/Internal/ConfigurationExtensions.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.Internal; + +internal static class ConfigurationExtensions +{ + public static readonly List DefaultExcludeConfigurationProviderTypes = new() + { + typeof(EnvironmentVariablesConfigurationProvider), + typeof(MemoryConfigurationProvider), + typeof(CommandLineConfigurationProvider), + typeof(KeyPerFileConfigurationProvider) + }; + + public static readonly List DefaultExcludeConfigurationSourceTypes = new() + { + typeof(CommandLineConfigurationSource), + typeof(EnvironmentVariablesConfigurationSource), + typeof(KeyPerFileConfigurationSource), + typeof(MemoryConfigurationSource) + }; + + public static IConfigurationBuilder AddRange(this IConfigurationBuilder configurationBuilder, + IEnumerable configurationSources) + { + foreach (var configurationSource in configurationSources) + configurationBuilder.Add(configurationSource); + return configurationBuilder; + } +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs new file mode 100644 index 000000000..f77e56bbc --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationOptions.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public abstract class LocalMasaConfigurationOptions : MasaConfigurationOptions +{ + /// + /// ParentSection is not required for local configuration + /// + [JsonIgnore] + public sealed override string? ParentSection => null; + + [JsonIgnore] + public sealed override SectionTypes SectionType => SectionTypes.Local; +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs new file mode 100644 index 000000000..80478d62d --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/LocalMasaConfigurationRepository.cs @@ -0,0 +1,61 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +internal class LocalMasaConfigurationRepository : AbstractConfigurationRepository +{ + public override SectionTypes SectionType => SectionTypes.Local; + + private Properties _data = new(); + + public LocalMasaConfigurationRepository( + IConfiguration configuration, + ILoggerFactory? loggerFactory) + : base(loggerFactory) + { + Initialize(configuration); + + ChangeToken.OnChange(configuration.GetReloadToken, () => + { + Initialize(configuration); + FireRepositoryChange(SectionType, Load()); + }); + } + + private void Initialize(IConfiguration configuration) + { + Dictionary data = new(); + GetData(configuration, configuration.GetChildren(), ref data); + _data = new Properties(data); + } + + private void GetData(IConfiguration configuration, IEnumerable configurationSections, + ref Dictionary dictionary) + { + foreach (var configurationSection in configurationSections) + { + var section = configuration.GetSection(configurationSection.Path); + + var childrenSections = section.GetChildren()?.ToList() ?? new List(); + + if (!section.Exists() || !childrenSections.Any()) + { + var key = section.Path; + if (!dictionary.ContainsKey(key)) + { + dictionary.Add(key, configuration[section.Path]); + } + } + else + { + GetData(configuration, childrenSections, ref dictionary); + } + } + } + + public override Properties Load() + { + return _data; + } +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj b/src/Contrib/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj new file mode 100644 index 000000000..05a49ddc9 --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/Masa.Contrib.Configuration.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs new file mode 100644 index 000000000..6f9a3b564 --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationBuilder.cs @@ -0,0 +1,39 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public class MasaConfigurationBuilder : IMasaConfigurationBuilder +{ + private readonly IConfigurationBuilder _builder; + + public IServiceCollection Services { get; } + + public IDictionary Properties => _builder.Properties; + + public IList Sources => _builder.Sources; + + private IConfiguration? _configuration; + + public IConfiguration Configuration => _configuration ??= _builder.Build(); + + internal List Repositories { get; } = new(); + + internal List Relations { get; } = new(); + + public MasaConfigurationBuilder(IServiceCollection services, IConfigurationBuilder builder) + { + Services = services; + _builder = builder; + } + + public void AddRepository(IConfigurationRepository configurationRepository) + => Repositories.Add(configurationRepository); + + public void AddRelations(params ConfigurationRelationOptions[] relationOptions) + => Relations.AddRange(relationOptions); + + public IConfigurationBuilder Add(IConfigurationSource source) => _builder.Add(source); + + public IConfigurationRoot Build() => _builder.Build(); +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs new file mode 100644 index 000000000..19e371e7b --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationExtensions.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public static class MasaConfigurationExtensions +{ + public static void UseMasaOptions(this IMasaConfigurationBuilder builder, Action options) + { + var relation = new MasaRelationOptions(); + options.Invoke(relation); + builder.AddRelations(relation.Relations.ToArray()); + } + + internal static void AutoMapping(this MasaConfigurationBuilder builder, params Assembly[] assemblies) + { + var optionTypes = assemblies + .SelectMany(assembly => assembly.GetTypes()) + .Where(type => type != typeof(IMasaConfigurationOptions) && + type != typeof(MasaConfigurationOptions) && + !type.IsAbstract && + typeof(IMasaConfigurationOptions).IsAssignableFrom(type)) + .ToList(); + optionTypes.ForEach(optionType => + { + var constructorInfo = optionType.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).FirstOrDefault(info => info.GetParameters().Length == 0); + + if (constructorInfo == null) + throw new Exception($"[{optionType.Name}] must have a parameterless constructor"); + + var option = (IMasaConfigurationOptions)Activator.CreateInstance(optionType, !constructorInfo.IsPublic)!; + var sectionName = option.Section ?? optionType.Name; + if (builder.Relations.Any(relation => relation.SectionType == option.SectionType && relation.Section == sectionName && relation.ObjectType == optionType)) + { + throw new ArgumentException( + "The section has been loaded, no need to load repeatedly, check whether there are duplicate sections or inheritance between auto-mapping classes"); + } + builder.AddRelations(new ConfigurationRelationOptions() + { + SectionType = option.SectionType, + ParentSection = option.ParentSection, + Section = sectionName, + ObjectType = optionType + }); + }); + } +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs new file mode 100644 index 000000000..61b964150 --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationProvider.cs @@ -0,0 +1,67 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public class MasaConfigurationProvider : ConfigurationProvider, IRepositoryChangeListener, IDisposable +{ + private readonly ConcurrentDictionary _data; + private readonly IEnumerable _configurationRepositories; + + public MasaConfigurationProvider(MasaConfigurationSource source) + { + _data = new(); + _configurationRepositories = source.Builder!.Repositories; + + foreach (var configurationRepository in _configurationRepositories) + { + configurationRepository.AddChangeListener(this); + } + } + + public override void Load() + { + foreach (var configurationRepository in _configurationRepositories) + { + var properties = configurationRepository.Load(); + _data[configurationRepository.SectionType] = properties; + } + SetData(); + } + + public void OnRepositoryChange(SectionTypes sectionType, Properties newProperties) + { + if (_data[sectionType] == newProperties) + return; + + _data[sectionType] = newProperties; + + SetData(); + + OnReload(); + } + + void SetData() + { + Dictionary data = new(); + + foreach (var configurationType in _data.Keys) + { + var properties = _data[configurationType]; + foreach (var key in properties.GetPropertyNames()) + { + data[$"{configurationType}{ConfigurationPath.KeyDelimiter}{key}"] = properties.GetProperty(key)!; + } + } + + Data = data; + } + + public void Dispose() + { + foreach (var configurationRepository in _configurationRepositories) + { + configurationRepository.RemoveChangeListener(this); + } + } +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs new file mode 100644 index 000000000..b8739b1c1 --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaConfigurationSource.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public class MasaConfigurationSource : IConfigurationSource +{ + internal readonly MasaConfigurationBuilder? Builder; + + internal readonly IConfigurationProvider? ConfigurationProvider; + + public MasaConfigurationSource(MasaConfigurationBuilder builder) => Builder = builder; + + public MasaConfigurationSource(IConfigurationProvider configurationProvider) => ConfigurationProvider = configurationProvider; + + public IConfigurationProvider Build(IConfigurationBuilder builder) + => Builder != null ? new MasaConfigurationProvider(this) : ConfigurationProvider!; +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs new file mode 100644 index 000000000..8b7c9aaec --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/MasaRelationOptions.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration; + +public class MasaRelationOptions +{ + internal List Relations { get; } = new(); + + /// + /// Map Section relationship By Local + /// + /// + /// The default is null, which is consistent with the mapping class name, and string.Empty when no root node exists + /// + public MasaRelationOptions MappingLocal(string? section = null) where TModel : class + => Mapping(SectionTypes.Local, null!, section); + + /// + /// Map Section relationship By ConfigurationApi + /// + /// + /// The name of the parent section, if it is empty, it will be mounted under SectionType, otherwise it will be mounted to the specified section under SectionType + /// The default is null, which is consistent with the mapping class name, and string.Empty when no root node exists + /// + public MasaRelationOptions MappingConfigurationApi(string parentSection, string? section = null) where TModel : class + => Mapping(SectionTypes.ConfigurationApi, parentSection, section); + + /// + /// Map Section relationship + /// + /// + /// + /// parent section, local section is the name of the locally configured section, and ConfigurationApi is the name of the Appid where the configuration is located + /// The default is null, which is consistent with the mapping class name + /// + /// + public MasaRelationOptions Mapping(SectionTypes sectionType, string parentSection, string? section = null) where TModel : class + { + section ??= typeof(TModel).Name; + + if (Relations.Any(relation => relation.SectionType == sectionType && relation.Section == section)) + throw new ArgumentOutOfRangeException(nameof(section), "The current section already has a configuration"); + + Relations.Add(new ConfigurationRelationOptions() + { + SectionType = sectionType, + ParentSection = parentSection, + Section = section, + ObjectType = typeof(TModel) + }); + return this; + } +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/README.md b/src/Contrib/Configuration/Masa.Contrib.Configuration/README.md new file mode 100644 index 000000000..804ce4cba --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/README.md @@ -0,0 +1,125 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Configuration + +Structure: + +```c# +IConfiguration +├── Local Local node (fixed) +│ ├── Redis Custom configuration +│ ├── ├── Host Parameter +├── ConfigurationApi Remote node (fixed) +│ ├── AppId Replace-With-Your-AppId +│ ├── AppId ├── Redis Custom node +│ ├── AppId ├── Redis ├── Host Parameter +``` + +Example: + +```C# +Install-Package Masa.Contrib.Configuration +Install-Package Masa.Contrib.StackSdks.Dcc //DCC can provide remote configuration capabilities +​```json +{ + //Custom configuration + "Redis": { + "Host": "localhost" + }, + //Dcc configuration, extended Configuration capabilities, support remote configuration + "DccOptions": { + "ManageServiceAddress": "http://localhost:8890", + "RedisOptions": { + "Servers": [ + { + "Host": "localhost", + "Port": 8889 + } + ], + "DefaultDatabase": 0, + "Password": "" + } + }, + "AppId": "Replace-With-Your-AppId", + "ConfigObjects": [ "Redis" ], //The name of the object to be mounted. Here, the Redis configuration will be mounted under the ConfigurationApi: node + "Secret": "", //Dcc App key + "Cluster": "Default" +} +``` + +Automatically map node relationships: + +```c# +public class RedisOptions : LocalMasaConfigurationOptions +{ + [JsonIgnore] + public override string? Section { get; init; } = "Redis"; + + public string Host { get; set; } +} + +//Use MasaConfiguration to take over Configuration, and mount the current Configuration to Local section by default +builder.AddMasaConfiguration(configurationBuilder => +{ + //configurationBuilder.UseDcc(builder.Services);//Use Dcc to extend Configuration capabilities and support remote configuration +}); +``` + +> Local configuration needs to inherit LocalMasaConfigurationOptions + +Or manually map node relationships: + +```C# +builder.AddMasaConfiguration(configurationBuilder => +{ + //configurationBuilder.UseDcc(builder.Services);//Use Dcc to extend Configuration capabilities and support remote configuration + + configurationBuilder.UseMasaOptions(options => + { + options.MappingLocal("Redis"); //Map the RedisOptions binding to the Local:Redis node + }); +}); +``` + +how to use: + +```c# +var app = builder.Build(); + +app.Map("/GetRedis", ([FromServices] IOptions option) => +{ + //Recommended (need to automatically or manually map the node relationship before it can be used) + return System.Text.Json.JsonSerializer.Serialize(option.Value); +}); + +app.Map("/GetRedis", ([FromServices] IOptionsMonitor option) => +{ + //Recommended (need to automatically or manually map the node relationship before it can be used) + options.OnChange(option => + { + //TODO Configuration update service + }); + + return System.Text.Json.JsonSerializer.Serialize(option.CurrentValue); +}); + +app.Map("/GetRedisHost", ([FromServices] IConfiguration configuration) => +{ + //Base + return configuration["Local:Redis:Host"]; +}); + +app.Run(); +``` + +How to take over more local nodes? + +```c# +builder.AddMasaConfiguration(builder => builder.AddJsonFile("custom.json", true, true));//In addition to the default ICongiguration, mount custom.json into the new Configuration +``` + +Tip: + +Configuration automatically obtains classes that inherit LocalMasaConfigurationOptions by default, and maps node relationships to facilitate obtaining configuration information through IOptions, IOptionsSnapshot, and IOptionsMonitor + +The above Redis is a local configuration, which is used to demonstrate the effect and usage of the local configuration after it is mounted to IConfiguration \ No newline at end of file diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/README.zh-CN.md b/src/Contrib/Configuration/Masa.Contrib.Configuration/README.zh-CN.md new file mode 100644 index 000000000..84b722cd6 --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/README.zh-CN.md @@ -0,0 +1,131 @@ +中 | [EN](README.md) + +## Masa.Contrib.Configuration + +结构: + +```c# +IConfiguration +├── Local 本地节点(固定) +│ ├── Redis 自定义配置 +│ ├── ├── Host 参数 +├── ConfigurationApi 远程节点(固定) +│ ├── AppId 替换为你的AppId +│ ├── AppId ├── Redis 自定义节点 +│ ├── AppId ├── Redis ├── Host 参数 +``` + +用例: + +```C# +Install-Package Masa.Contrib.Configuration +Install-Package Masa.Contrib.StackSdks.Dcc //DCC可提供远程配置的能力 +``` + +appsettings.json +```json +{ + //自定义配置 + "Redis": { + "Host": "localhost" + }, + //Dcc配置,扩展Configuration能力,支持远程配置 + "DccOptions": { + "ManageServiceAddress ": "http://localhost:8890", + "RedisOptions": { + "Servers": [ + { + "Host": "localhost", + "Port": 8889 + } + ], + "DefaultDatabase": 0, + "Password": "" + } + }, + "AppId": "Replace-With-Your-AppId", + "ConfigObjects": [ "Redis" ], // 要挂载的对象名称,此处会将Redis配置挂载到ConfigurationApi:节点下 + "Secret": "", //Dcc App 秘钥 + "Cluster": "Default" +} +``` + +自动映射节点关系: + +```c# +/// +/// 自动映射节点关系 +/// +public class RedisOptions : LocalMasaConfigurationOptions +{ + [JsonIgnore] + public override string? Section { get; init; } = "Redis"; + + public string Host { get; set; } +} + +//使用MasaConfiguration接管Configuration,默认会将当前的Configuration挂载到Local节点下 +builder.AddMasaConfiguration(configurationBuilder => +{ + //configurationBuilder.UseDcc();//使用Dcc 扩展Configuration能力,支持远程配置 +}); +``` + +> 本地配置需要继承LocalMasaConfigurationOptions + +或手动添加映射节点关系: + +```C# +builder.AddMasaConfiguration(configurationBuilder => +{ + //configurationBuilder.UseDcc();//使用Dcc 扩展Configuration能力,支持远程配置 + + configurationBuilder.UseMasaOptions(options => + { + options.MappingLocal("Redis"); //将RedisOptions绑定映射到Local:Redis节点 + }); +}); +``` + +如何使用: + +```c# +var app = builder.Build(); + +app.Map("/GetRedis", ([FromServices] IOptions option) => +{ + //推荐(需要自动或手动映射节点关系后才能使用) + return System.Text.Json.JsonSerializer.Serialize(option.Value); +}); + +app.Map("/GetRedis", ([FromServices] IOptionsMonitor option) => +{ + options.OnChange(option => + { + //TODO 配置更新业务 + }); + + return System.Text.Json.JsonSerializer.Serialize(option.CurrentValue); +});//推荐(需要自动或手动映射节点关系后才能使用) + +app.Map("/GetRedisformHost", ([FromServices] IConfiguration configuration) => +{ + //基础 + return configuration["Local:Redis:Host"]; +}); + +app.Run(); +``` + +如何接管更多的本地节点? + +```c# +builder.AddMasaConfiguration(builder => builder.AddJsonFile("custom.json", true, true));//除了默认的ICongiguration,还将custom.json挂载到新的Configuration中 +``` + +提示: + +Configuration默认自动获取继承LocalMasaConfigurationOptions的类,并映射节点关系,方便通过IOptions、IOptionsSnapshot、IOptionsMonitor获取配置信息 + +上文Redis为本地配置,用于演示本地配置挂载到IConfiguration后的效果以及使用用法 + diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..8e039562e --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/ServiceCollectionExtensions.cs @@ -0,0 +1,120 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IConfigurationRoot CreateMasaConfiguration( + this IServiceCollection services, + Action? configureDelegate, + IConfigurationBuilder configurationBuilder, + params Assembly[] assemblies) + { + return services.CreateMasaConfiguration( + configureDelegate, + configurationBuilder, + options => options.Assemblies = assemblies); + } + + public static IConfigurationRoot CreateMasaConfiguration( + this IServiceCollection services, + Action? configureDelegate, + IConfigurationBuilder configurationBuilder, + Action? action) + { + if (services.Any(service => service.ImplementationType == typeof(MasaConfigurationProvider))) + return new ConfigurationBuilder().Build(); + + services.AddSingleton(); + services.AddOptions(); + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + var configurationOptions = new ConfigurationOptions(); + action?.Invoke(configurationOptions); + + var configurationSourceResult = services + .BuildServiceProvider() + .GetRequiredService() + .GetMigrated(configurationBuilder, configurationOptions.ExcludeConfigurationSourceTypes, configurationOptions.ExcludeConfigurationProviderTypes); + + MasaConfigurationBuilder masaConfigurationBuilder = new MasaConfigurationBuilder(services, + new ConfigurationBuilder().AddRange(configurationSourceResult.MigrateConfigurationSources)); + configureDelegate?.Invoke(masaConfigurationBuilder); + + MasaConfigurationBuilder builder = new(services, new ConfigurationBuilder()); + builder.AddRelations(masaConfigurationBuilder.Relations.ToArray()); + masaConfigurationBuilder.Repositories.ForEach(repository => builder.AddRepository(repository)); + var localConfigurationRepository = new LocalMasaConfigurationRepository( + masaConfigurationBuilder.Configuration, + services.BuildServiceProvider().GetService()); + builder.AddRepository(localConfigurationRepository); + + var source = new MasaConfigurationSource(builder); + var configuration = builder + .Add(source) + .AddRange(configurationSourceResult.ConfigurationSources) + .Build(); + + builder.AutoMapping(configurationOptions.Assemblies); + + builder.Relations.ForEach(relation => + { + List sectionNames = new() + { + relation.SectionType.ToString(), + }; + if (!string.IsNullOrEmpty(relation.ParentSection)) + sectionNames.Add(relation.ParentSection); + + if (relation.Section != "") + { + sectionNames.AddRange(relation.Section!.Split(ConfigurationPath.KeyDelimiter)); + } + + services.ConfigureOption(configuration, sectionNames, relation.ObjectType); + }); + + return configuration; + } + + private static void ConfigureOption( + this IServiceCollection services, + IConfiguration configuration, + List sectionNames, + Type optionType) + { + IConfigurationSection? configurationSection = null; + foreach (var sectionName in sectionNames) + { + if (configurationSection == null) + configurationSection = configuration.GetSection(sectionName); + else + configurationSection = configurationSection.GetSection(sectionName); + } + if (!configurationSection.Exists()) + throw new Exception($"Check if the mapping section is correct,section name is [{configurationSection!.Path}]"); + + var configurationChangeTokenSource = + Activator.CreateInstance(typeof(ConfigurationChangeTokenSource<>).MakeGenericType(optionType), string.Empty, + configurationSection)!; + services.TryAdd(new ServiceDescriptor(typeof(IOptionsChangeTokenSource<>).MakeGenericType(optionType), + configurationChangeTokenSource)); + + Action configureBinder = _ => + { + }; + var configureOptions = + Activator.CreateInstance(typeof(NamedConfigureFromConfigurationOptions<>).MakeGenericType(optionType), + string.Empty, + configurationSection, configureBinder)!; + services.TryAdd(new ServiceDescriptor(typeof(IConfigureOptions<>).MakeGenericType(optionType), + configureOptions)); + } + + private class MasaConfigurationProvider + { + + } +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs new file mode 100644 index 000000000..bb0a3beaf --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/WebApplicationBuilderExtensions.cs @@ -0,0 +1,60 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Builder; + +public static class WebApplicationBuilderExtensions +{ + public static WebApplicationBuilder AddMasaConfiguration( + this WebApplicationBuilder builder, + Action? configureDelegate = null) + { + Action? action = null; + return builder.AddMasaConfiguration(configureDelegate, action); + } + + public static WebApplicationBuilder AddMasaConfiguration( + this WebApplicationBuilder builder, + params Assembly[] assemblies) + => builder.AddMasaConfiguration( + null, + options => options.Assemblies = assemblies); + + public static WebApplicationBuilder AddMasaConfiguration( + this WebApplicationBuilder builder, + Action? action) + => builder.AddMasaConfiguration(null, action); + + public static WebApplicationBuilder AddMasaConfiguration( + this WebApplicationBuilder builder, + Action? configureDelegate, + params Assembly[] assemblies) + => builder.AddMasaConfiguration( + configureDelegate, + options => options.Assemblies = assemblies); + + public static WebApplicationBuilder AddMasaConfiguration( + this WebApplicationBuilder builder, + Action? configureDelegate, + Action? action) + { + IConfigurationRoot masaConfiguration = + builder.Services.CreateMasaConfiguration( + configureDelegate, + builder.Configuration, + action); + + if (!masaConfiguration.Providers.Any()) + return builder; + + Microsoft.Extensions.Hosting.HostingHostBuilderExtensions.ConfigureAppConfiguration( + builder.Host, + configBuilder => configBuilder.Sources.Clear()); + builder.Configuration.AddConfiguration(masaConfiguration); + + return builder; + } + + public static IMasaConfiguration GetMasaConfiguration(this WebApplicationBuilder builder) + => builder.Services.BuildServiceProvider().GetRequiredService(); +} diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/_Imports.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/_Imports.cs new file mode 100644 index 000000000..9d41a9afa --- /dev/null +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/_Imports.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Configuration; +global using Masa.BuildingBlocks.Configuration.Options; +global using Masa.Contrib.Configuration; +global using Masa.Contrib.Configuration.Internal; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.Configuration.CommandLine; +global using Microsoft.Extensions.Configuration.EnvironmentVariables; +global using Microsoft.Extensions.Configuration.KeyPerFile; +global using Microsoft.Extensions.Configuration.Memory; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using Microsoft.Extensions.Primitives; +global using System; +global using System.Collections.Concurrent; +global using System.Collections.Generic; +global using System.Linq; +global using System.Reflection; +global using System.Text.Json.Serialization; diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs new file mode 100644 index 000000000..e4b10e038 --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/MountSectionRedisOptions.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.Tests.Config; + +public class MountSectionRedisOptions +{ + +} diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs new file mode 100644 index 000000000..f7f9b2efb --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/RabbitMqOptions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.Tests.Config; + +public class RabbitMqOptions : LocalMasaConfigurationOptions +{ + public string HostName { get; set; } + + public string UserName { get; set; } + + public string Password { get; set; } + + public string VirtualHost { get; set; } + + public string Port { get; set; } + + /// + /// The section null means same as the class name, else load from the specify section + /// + [JsonIgnore] + public override string? Section => "RabbitMq"; +} diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs new file mode 100644 index 000000000..108cdaa5a --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/RedisOptions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.Tests.Config; + +public class RedisOptions +{ + public string Ip { get; set; } + + public string Password { get; set; } + + public int Port { get; set; } +} diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs new file mode 100644 index 000000000..ca361eb15 --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Config/SystemOptions.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.Tests.Config; + +public class SystemOptions : LocalMasaConfigurationOptions +{ + public string? Name { get; set; } +} diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs new file mode 100644 index 000000000..8c3d6da3a --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs @@ -0,0 +1,296 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.Configuration.AutoMap.Tests; + +namespace Masa.Contrib.Configuration.Tests; + +[TestClass] +public class ConfigurationTest +{ + [TestMethod] + public void TestDefaultMasaConfiguration() + { + var configurationApi = Mock.Of(); + + var builder = WebApplication.CreateBuilder(); + var masaConfiguration = new DefaultMasaConfiguration(builder.Configuration, configurationApi); + var localConfiguration = masaConfiguration.GetConfiguration(SectionTypes.Local); + var configurationApiConfiguration = masaConfiguration.GetConfiguration(SectionTypes.Local); + Assert.IsTrue(!((IConfigurationSection)localConfiguration).Exists()); + Assert.IsTrue(!((IConfigurationSection)configurationApiConfiguration).Exists()); + } + + [TestMethod] + public void TestAddMasaConfigurationShouldThrowException() + { + var builder = WebApplication.CreateBuilder(); + Assert.ThrowsException(() => builder.AddMasaConfiguration()); + } + + [TestMethod] + public void TestAddJsonFileShouldReturnRabbitMqOptionAndSystemOptionsExist() + { + var builder = WebApplication.CreateBuilder(); + builder.AddMasaConfiguration(masaConfigurationBuilder + => masaConfigurationBuilder.AddJsonFile("rabbitMq.json", optional: false, reloadOnChange: true)); + var configurationApi = Mock.Of(); + var masaConfiguration = new DefaultMasaConfiguration(builder.Configuration, configurationApi); + var localConfiguration = masaConfiguration.GetConfiguration(SectionTypes.Local); + var configurationApiConfiguration = masaConfiguration.GetConfiguration(SectionTypes.ConfigurationApi); + Assert.IsTrue(((IConfigurationSection)localConfiguration).Exists()); + Assert.IsTrue(!((IConfigurationSection)configurationApiConfiguration).Exists()); + + var serviceProvider = builder.Services.BuildServiceProvider(); + var rabbitMqOptions = serviceProvider.GetRequiredService>(); + Assert.IsTrue(rabbitMqOptions is + { Value.HostName: "localhost", Value.UserName: "admin", Value.Password: "admin", Value.VirtualHost: "/", Value.Port: "5672" }); + + var systemOptions = serviceProvider.GetRequiredService>(); + Assert.IsTrue(systemOptions is { Value.Name: "Masa TEST" }); + + var redisOptions = serviceProvider.GetRequiredService>(); + Assert.IsTrue(redisOptions is { Value.Ip: null, Value.Password: null, Value.Port: 0 }); + } + + [TestMethod] + public void TestManuallyMappingShouldReturnRedisExist() + { + var builder = WebApplication.CreateBuilder(); + builder.AddMasaConfiguration(masaConfigurationBuilder => + { + masaConfigurationBuilder + .AddJsonFile("rabbitMq.json", optional: false, reloadOnChange: true) + .AddJsonFile("redis.json", optional: false, reloadOnChange: true); + + masaConfigurationBuilder.UseMasaOptions(options => + { + options.MappingLocal(); + }); + }); + + var configurationApi = Mock.Of(); + var masaConfiguration = new DefaultMasaConfiguration(builder.Configuration, configurationApi); + var localConfiguration = masaConfiguration.GetConfiguration(SectionTypes.Local); + var configurationApiConfiguration = masaConfiguration.GetConfiguration(SectionTypes.ConfigurationApi); + Assert.IsTrue(((IConfigurationSection)localConfiguration).Exists()); + Assert.IsTrue(!((IConfigurationSection)configurationApiConfiguration).Exists()); + + var serviceProvider = builder.Services.BuildServiceProvider(); + var rabbitMqOptions = serviceProvider.GetRequiredService>(); + Assert.IsTrue(rabbitMqOptions is + { Value.HostName: "localhost", Value.UserName: "admin", Value.Password: "admin", Value.VirtualHost: "/", Value.Port: "5672" }); + + var systemOptions = serviceProvider.GetRequiredService>(); + Assert.IsTrue(systemOptions is { Value.Name: "Masa TEST" }); + + var redisOptions = serviceProvider.GetRequiredService>(); + Assert.IsTrue(redisOptions is { Value.Ip: "localhost", Value.Password: "", Value.Port: 6379 }); + } + + [TestMethod] + public void TestMasaConfigurationBuilderShouldReturnSourceCount3() + { + var configurationBuilder = new ConfigurationBuilder() + .AddJsonFile("rabbitMq.json", optional: false, reloadOnChange: true) + .AddJsonFile("redis.json", optional: false, reloadOnChange: true); + var masaConfigurationBuilder = new MasaConfigurationBuilder(new ServiceCollection(), configurationBuilder); + Assert.IsTrue(masaConfigurationBuilder.Sources.Count == 2); + + var appsettingConfigurationBuilder = + new ConfigurationBuilder().AddJsonFile("appsettings.json", optional: false, reloadOnChange: true); + Assert.IsTrue(appsettingConfigurationBuilder.Sources.Count == 1); + masaConfigurationBuilder.Add(appsettingConfigurationBuilder.Sources.FirstOrDefault()!); + Assert.IsTrue(masaConfigurationBuilder.Sources.Count == 3); + + Assert.IsTrue(masaConfigurationBuilder.Build()["KafkaOptions:Servers"] == + appsettingConfigurationBuilder.Build()["KafkaOptions:Servers"]); + + Assert.IsTrue(masaConfigurationBuilder.Properties.Count == configurationBuilder.Properties.Count); + } + + [TestMethod] + public void TestAddMultiMasaConfigurationShouldReturnIMasaConfigurationCount1() + { + var builder = WebApplication.CreateBuilder(); + builder.AddMasaConfiguration(configurationBuilder => + { + configurationBuilder.AddJsonFile("redis.json", true, true) + .AddJsonFile("rabbitMq.json", true, true); + + configurationBuilder.UseMasaOptions(option => option.MappingLocal("RedisOptions")); + }).AddMasaConfiguration(); + var serviceProvider = builder.Services.BuildServiceProvider(); + var configuration = serviceProvider.GetRequiredService(); + var redisOption = serviceProvider.GetRequiredService>(); + Assert.IsTrue(configuration["Local:RedisOptions:Ip"] == "localhost"); + Assert.IsTrue(redisOption.Value.Ip == "localhost"); + + var rabbitMqOption = serviceProvider.GetRequiredService>(); + Assert.IsTrue(configuration["Local:RabbitMq:UserName"] == "admin"); + Assert.IsTrue(rabbitMqOption.Value.UserName == "admin" && rabbitMqOption.Value.Password == "admin"); + + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestAutoMapSectionErrorShouldThrowException() + { + var builder = WebApplication.CreateBuilder(); + builder.Host.ConfigureAppConfiguration((_, config) => config.Sources.Clear()); + var chainedConfiguration = new ConfigurationBuilder() + .SetBasePath(builder.Environment.ContentRootPath) + .AddJsonFile("appsettings.json", true, true); + builder.Configuration.AddConfiguration(chainedConfiguration.Build()); + + Assert.ThrowsException(() + => builder.AddMasaConfiguration() + , $"Check if the mapping section is correct,section name is [{It.IsAny()}]"); + } + + [TestMethod] + public void TestSpecifyAssembliesShouldKafKaOptionsExist() + { + var builder = WebApplication.CreateBuilder(); + builder.Host.ConfigureAppConfiguration((_, config) => config.Sources.Clear()); + var chainedConfiguration = new ConfigurationBuilder() + .SetBasePath(builder.Environment.ContentRootPath) + .AddJsonFile("appsettings.json", true, true); + builder.Configuration.AddConfiguration(chainedConfiguration.Build()); + builder.AddMasaConfiguration(typeof(KafkaOptions).Assembly); + + var serviceProvider = builder.Services.BuildServiceProvider(); + var kafkaOptions = serviceProvider.GetRequiredService>(); + Assert.IsTrue(kafkaOptions is { Value: { Servers: "Kafka Server", ConnectionPoolSize: 10 } }); + } + + [TestMethod] + public void TestSpecifyAssembliesShouldThrowException() + { + var builder = WebApplication.CreateBuilder(); + Assert.ThrowsException(() => + { + return builder.AddMasaConfiguration(configurationBuilder => + { + configurationBuilder + .AddJsonFile("rabbitMq.json", true, true) + .AddJsonFile("redis.json", true, true); + configurationBuilder.UseMasaOptions(option => option.MappingConfigurationApi("Test")); + }); + }, $"Check if the mapping section is correct,section name is [{It.IsAny()}]"); + } + + [TestMethod] + public void TestNoParameterlessConstructorSpecifyAssembliesShouldThrowException() + { + var builder = WebApplication.CreateBuilder(); + Assert.ThrowsException( + () => builder.AddMasaConfiguration(typeof(ConfigurationTest).Assembly, typeof(EsOptions).Assembly), + $"[{It.IsAny()}] must have a parameterless constructor"); + } + + [TestMethod] + public void TestRepeatMapptingShouldThrowException() + { + var builder = WebApplication.CreateBuilder(); + Assert.ThrowsException(() => + { + builder.AddMasaConfiguration(configurationBuilder => + { + configurationBuilder.AddJsonFile("redis.json", true, true) + .AddJsonFile("rabbitMq.json", true, true); + + configurationBuilder.UseMasaOptions(option => option.MappingLocal().MappingLocal()); + }); + }, "The current section already has a configuration"); + } + + [TestMethod] + public void TestCreateMasaConfigurationShouldReturnRedisOptionsAndSystemOptionsExist() + { + var services = new ServiceCollection(); + services.CreateMasaConfiguration(configurationBuilder => + { + configurationBuilder.AddJsonFile("redis.json", true, true) + .AddJsonFile("rabbitMq.json", true, true); + + configurationBuilder.UseMasaOptions(option => option.MappingLocal().MappingLocal()); + }, new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", true, true)); + IServiceProvider serviceProvider = services.BuildServiceProvider(); + var redisOption = serviceProvider.GetRequiredService>(); + Assert.IsTrue(redisOption.Value.Ip == "localhost"); + + var systemOptions = serviceProvider.GetRequiredService>(); + Assert.IsTrue(systemOptions is { Value.Name: "Masa TEST" }); + } + + [TestMethod] + public async Task TestConfigurationChangeShouldReturnNameEmpty() + { + var builder = WebApplication.CreateBuilder(); + var rootPath = builder.Environment.ContentRootPath; + builder.AddMasaConfiguration(configurationBuilder => + { + configurationBuilder.AddJsonFile("customAppConfig.json", true, true) + .AddJsonFile("rabbitMq.json", true, true); + configurationBuilder.UseMasaOptions(option => option.MappingLocal()); + }, typeof(ConfigurationTest).Assembly); + + var serviceProvider = builder.Services.BuildServiceProvider(); + var redisOptions = serviceProvider.GetRequiredService>(); + + Assert.IsNotNull(redisOptions); + Assert.IsTrue(redisOptions.Value.Ip == "localhost" && redisOptions.Value.Port == 6379); + + var newRedisOption = redisOptions.Value; + newRedisOption.Ip = String.Empty; + + var oldContent = await File.ReadAllTextAsync(Path.Combine(rootPath, "customAppConfig.json")); + await File.WriteAllTextAsync(Path.Combine(rootPath, "customAppConfig.json"), + System.Text.Json.JsonSerializer.Serialize(new { RedisOptions = newRedisOption })); + + Thread.Sleep(2000); + var option = serviceProvider.GetRequiredService>(); + Assert.IsTrue(option.CurrentValue.Ip == "" && option.CurrentValue.Port == 6379); + + await File.WriteAllTextAsync(Path.Combine(rootPath, "customAppConfig.json"), oldContent); + } + + [TestMethod] + public void TestEnvironmentConfigurationMigrated() + { + var builder = WebApplication.CreateBuilder(); + Environment.SetEnvironmentVariable("project-name", "masa-unit-test"); + builder.AddMasaConfiguration(configurationBuilder => + { + configurationBuilder.AddJsonFile("customAppConfig.json", true, true) + .AddJsonFile("rabbitMq.json", true, true); + configurationBuilder.UseMasaOptions(option => option.MappingLocal()); + }, options => + { + options.Assemblies = new[] { typeof(ConfigurationTest).Assembly }; + options.ExcludeConfigurationSourceTypes = new List(); + options.ExcludeConfigurationProviderTypes = new List(); + }); + + Assert.IsTrue(builder.Configuration[$"{SectionTypes.Local}{ConfigurationPath.KeyDelimiter}project-name"] == "masa-unit-test"); + + } + + [TestMethod] + public void TestEnvironmentConfigurationNotMigrated() + { + var builder = WebApplication.CreateBuilder(); + Environment.SetEnvironmentVariable("project-name", "masa-unit-test"); + builder.AddMasaConfiguration(configurationBuilder => + { + configurationBuilder.AddJsonFile("customAppConfig.json", true, true) + .AddJsonFile("rabbitMq.json", true, true); + configurationBuilder.UseMasaOptions(option => option.MappingLocal()); + }, typeof(ConfigurationTest).Assembly); + + Assert.IsTrue(builder.Configuration["project-name"] == "masa-unit-test"); + } +} diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj new file mode 100644 index 000000000..b426fc405 --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj @@ -0,0 +1,50 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + Always + + + + Always + + + + Always + + + + Always + + + + + + + + + + diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs new file mode 100644 index 000000000..6cfdf19bb --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Configuration; +global using Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests; +global using Masa.Contrib.Configuration.Tests.Config; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Text.Json.Serialization; diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/appsettings.json b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/appsettings.json new file mode 100644 index 000000000..124f418bc --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/appsettings.json @@ -0,0 +1,14 @@ +{ + "KafkaOptions": { + "Servers": "Kafka Server", + "ConnectionPoolSize": 10 + }, + "SystemOptions": { + "Name": "Masa TEST" + }, + "EsOptions": { + "Nodes": [ + "http://localhost:9200" + ] + } +} \ No newline at end of file diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/customAppConfig.json b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/customAppConfig.json new file mode 100644 index 000000000..5fb6c8c30 --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/customAppConfig.json @@ -0,0 +1,7 @@ +{ + "RedisOptions": { + "Ip": "localhost", + "Password": "", + "Port": 6379 + } +} \ No newline at end of file diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/rabbitMq.json b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/rabbitMq.json new file mode 100644 index 000000000..86ae5e2a1 --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/rabbitMq.json @@ -0,0 +1,9 @@ +{ + "RabbitMq": { + "HostName": "localhost", + "UserName": "admin", + "Password": "admin", + "VirtualHost": "/", + "Port": 5672 + } +} \ No newline at end of file diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/redis.json b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/redis.json new file mode 100644 index 000000000..5fb6c8c30 --- /dev/null +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/redis.json @@ -0,0 +1,7 @@ +{ + "RedisOptions": { + "Ip": "localhost", + "Password": "", + "Port": 6379 + } +} \ No newline at end of file diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs new file mode 100644 index 000000000..3d06cf9d2 --- /dev/null +++ b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests; + +public class EsOptions : LocalMasaConfigurationOptions +{ + public string[] Nodes { get; set; } + + public EsOptions(string[] nodes) + { + Nodes = nodes; + } +} diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj new file mode 100644 index 000000000..c8416fbae --- /dev/null +++ b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + false + enable + Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests + + + + + + + diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs new file mode 100644 index 000000000..376df7c4a --- /dev/null +++ b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Configuration.AutoMap.Tests; + +public class KafkaOptions : LocalMasaConfigurationOptions +{ + public string Servers { get; set; } + + public int ConnectionPoolSize { get; set; } +} diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj new file mode 100644 index 000000000..034b4300d --- /dev/null +++ b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + false + enable + + + + + + + diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs new file mode 100644 index 000000000..1e365be22 --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs @@ -0,0 +1,71 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Contracts.EF.DataFiltering; + +public class DataFilter : IDataFilter +{ + private readonly IServiceProvider _serviceProvider; + private readonly MemoryCache _cache; + + public DataFilter(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + _cache = new(); + } + + public IDisposable Enable() where TFilter : class + => GetFilter().Enable(); + + public IDisposable Disable() where TFilter : class + => GetFilter().Disable(); + + public bool IsEnabled() where TFilter : class + => GetFilter().Enabled; + + private DataFilter GetFilter() + where TFilter : class + { + return (_cache.GetOrAdd( + typeof(TFilter), + _ => _serviceProvider.GetRequiredService>() + ) as DataFilter)!; + } +} + +public class DataFilter where TFilter : class +{ + private readonly AsyncLocal _filter; + + public DataFilter() => _filter = new AsyncLocal(); + + public bool Enabled + { + get + { + _filter.Value ??= new DataFilterState(true); + + return _filter.Value!.Enabled; + } + } + + public IDisposable Enable() + { + if (Enabled) + return NullDisposable.Instance; + + _filter.Value!.Enabled = true; + + return new DisposeAction(() => Disable()); + } + + public IDisposable Disable() + { + if (!Enabled) + return NullDisposable.Instance; + + _filter.Value!.Enabled = false; + + return new DisposeAction(() => Enable()); + } +} diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs new file mode 100644 index 000000000..4f406e70a --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs @@ -0,0 +1,93 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Contracts.EF.DataFiltering; + +public class SoftDeleteSaveChangesFilter : ISaveChangesFilter + where TDbContext : DbContext + where TUserId : IComparable +{ + private readonly Type _userIdType; + private readonly IUserContext? _userContext; + private readonly TDbContext _context; + private readonly MasaDbContextOptions _masaDbContextOptions; + + public SoftDeleteSaveChangesFilter( + MasaDbContextOptions masaDbContextOptions, + TDbContext dbContext, + IUserContext? userContext = null) + { + _userIdType = typeof(TUserId); + _masaDbContextOptions = masaDbContextOptions; + _context = dbContext; + _userContext = userContext; + } + + public void OnExecuting(ChangeTracker changeTracker) + { + if (!_masaDbContextOptions.EnableSoftDelete) + return; + + changeTracker.DetectChanges(); + var entries = changeTracker.Entries().Where(entry => entry.State == EntityState.Deleted && entry.Entity is ISoftDelete); + foreach (var entity in entries) + { + HandleNavigationEntry(entity.Navigations.Where(n => (n.Metadata is not ISkipNavigation) && !((IReadOnlyNavigation)n.Metadata).IsOnDependent)); + + entity.State = EntityState.Modified; + entity.CurrentValues[nameof(ISoftDelete.IsDeleted)] = true; + + if (_userContext != null && entity.Entity is IAuditEntity && + entity.CurrentValues[nameof(IAuditEntity.Modifier)] != default) + { + var userId = GetUserId(_userContext.UserId); + if (userId != null) entity.CurrentValues[nameof(IAuditEntity.Modifier)] = userId; + + entity.CurrentValues[nameof(IAuditEntity.ModificationTime)] = + DateTime.UtcNow; //The current time to change to localization after waiting for localization + } + } + } + + protected virtual void HandleNavigationEntry(IEnumerable navigationEntries) + { + foreach (var navigationEntry in navigationEntries) + { + if (navigationEntry is CollectionEntry collectionEntry) + { + foreach (var dependentEntry in collectionEntry.CurrentValue ?? new List()) + { + HandleDependent(dependentEntry); + } + } + else + { + var dependentEntry = navigationEntry.CurrentValue; + if (dependentEntry != null) + { + HandleDependent(dependentEntry); + } + } + } + } + + protected virtual void HandleDependent(object dependentEntry) + { + var entityEntry = _context.Entry(dependentEntry); + entityEntry.State = EntityState.Modified; + + if (entityEntry.Entity is ISoftDelete) + entityEntry.CurrentValues[nameof(ISoftDelete.IsDeleted)] = true; + } + + private object? GetUserId(string? userId) + { + if (userId == null) + return null; + + if (_userIdType == typeof(Guid)) + return Guid.Parse(userId); + + return Convert.ChangeType(userId, _userIdType); + } +} diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs new file mode 100644 index 000000000..85364dfa7 --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Contracts.EF.Internal; + +internal class DataFilterState +{ + public bool Enabled { get; set; } + + public DataFilterState(bool enabled) + { + Enabled = enabled; + } +} diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs new file mode 100644 index 000000000..2c179575d --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Contracts.EF.Internal; + +internal class DisposeAction : IDisposable +{ + private readonly Action _action; + + public DisposeAction(Action action) => _action = action; + + public void Dispose() => _action.Invoke(); +} diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs new file mode 100644 index 000000000..09a1e0e7c --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Contracts.EF.Internal; + +internal class InstanceBuilder +{ + internal delegate object InvokeDelegate(params object?[] parameters); + + public static InvokeDelegate CreateInstanceDelegate(ConstructorInfo constructorInfo) + { + ParameterInfo[] parameters = constructorInfo.GetParameters(); + var parameterParameterExpression = Expression.Parameter(typeof(object[]), "parameters"); + + var parameterCast = new List(parameters.Length); + for (int i = 0; i < parameters.Length; i++) + { + var paramInfo = parameters[i]; + var valueObj = Expression.ArrayIndex(parameterParameterExpression, Expression.Constant(i)); + var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); + parameterCast.Add(valueCast); + } + NewExpression newExp = Expression.New(constructorInfo, parameterCast); + var lambdaExp = Expression.Lambda(newExp, parameterParameterExpression); + return lambdaExp.Compile(); + } +} diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs new file mode 100644 index 000000000..ad67a3355 --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Contracts.EF.Internal; + +internal class NullDisposable : IDisposable +{ + public static NullDisposable Instance { get; } = new(); + + public void Dispose() + { + } +} diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj new file mode 100644 index 000000000..632632a94 --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs new file mode 100644 index 000000000..7584bb2ce --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs @@ -0,0 +1,68 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Contracts.EF; + +public static class MasaDbContextOptionsBuilderExtensions +{ + private static readonly List _types = new(); + + public static MasaDbContextBuilder UseFilter( + this MasaDbContextBuilder masaDbContextOptionsBuilder, + Action? options = null) + => masaDbContextOptionsBuilder.UseFilterCore(false, options); + + public static MasaDbContextBuilder UseTestFilter( + this MasaDbContextBuilder masaDbContextOptionsBuilder, + Action? options = null) + => masaDbContextOptionsBuilder.UseFilterCore(true, options); + + private static MasaDbContextBuilder UseFilterCore( + this MasaDbContextBuilder masaDbContextOptionsBuilder, + bool isTest, + Action? options = null) + { + var filterOptions = new FilterOptions(); + options?.Invoke(filterOptions); + + masaDbContextOptionsBuilder.Services.TryAddScoped(typeof(DataFilter<>)); + masaDbContextOptionsBuilder.Services.TryAddScoped(); + + if (filterOptions.EnableSoftDelete) masaDbContextOptionsBuilder.UseSoftDelete(isTest); + + return masaDbContextOptionsBuilder; + } + + private static void UseSoftDelete(this MasaDbContextBuilder masaDbContextOptionsBuilder, bool isTest = false) + { + if (!isTest) + { + if (_types.Any(type => masaDbContextOptionsBuilder.DbContextType == type)) + return; + + _types.Add(masaDbContextOptionsBuilder.DbContextType); + } + + var masaDbContextOptionsType = typeof(MasaDbContextOptions<>).MakeGenericType(masaDbContextOptionsBuilder.DbContextType); + var softDeleteSaveChangesFilterType = + typeof(SoftDeleteSaveChangesFilter<,>).MakeGenericType( + masaDbContextOptionsBuilder.DbContextType, + masaDbContextOptionsBuilder.UserIdType); + var constructorInfo = softDeleteSaveChangesFilterType.GetConstructors().FirstOrDefault()!; + var invokeDelegate = InstanceBuilder.CreateInstanceDelegate(constructorInfo); + + masaDbContextOptionsBuilder.Services.Add( + new ServiceDescriptor(typeof(ISaveChangesFilter), + serviceProvider => + { + var instance = invokeDelegate.Invoke( + serviceProvider.GetRequiredService(masaDbContextOptionsType), + serviceProvider.GetRequiredService(masaDbContextOptionsBuilder.DbContextType), + serviceProvider.GetService()); + return instance; + }, + ServiceLifetime.Scoped)); + + masaDbContextOptionsBuilder.EnableSoftDelete = true; + } +} diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs new file mode 100644 index 000000000..d9d92f32d --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Contracts.EF.Options; + +public class FilterOptions +{ + /// + /// enable soft delete + /// default: true + /// If you are sure that you do not need to use soft delete in the project, you can change to false + /// IDataFilter does not support ISoftDelete when soft delete is disabled + /// + public bool EnableSoftDelete { get; set; } = true; +} diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs new file mode 100644 index 000000000..9b7d93fac --- /dev/null +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; +global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; +global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.Contrib.Data.Contracts.EF.DataFiltering; +global using Masa.Contrib.Data.Contracts.EF.Internal; +global using Masa.Contrib.Data.Contracts.EF.Options; +global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Data.EntityFrameworkCore.Filters; +global using Masa.Utils.Caching.Memory; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.ChangeTracking; +global using Microsoft.EntityFrameworkCore.Metadata; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using System.Linq.Expressions; +global using System.Reflection; diff --git a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs new file mode 100644 index 000000000..afc0310fe --- /dev/null +++ b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Contracts.EF.Tests; + +[TestClass] +public class DataFilterTest +{ + private IServiceCollection _services; + private IDataFilter _dataFilter; + + [TestInitialize] + public void Initialize() + { + _services = new ServiceCollection(); + _services.AddSingleton(); + _services.AddSingleton(typeof(DataFilter<>)); + _dataFilter = new DataFilter(_services.BuildServiceProvider()); + } + + [TestMethod] + public void TestDataFilterReturnTrue() + { + Assert.IsTrue(_dataFilter.IsEnabled()); + + using (_dataFilter.Disable()) + { + Assert.IsFalse(_dataFilter.IsEnabled()); + } + + Assert.IsTrue(_dataFilter.IsEnabled()); + } + + [TestMethod] + public void TestDataFilterReturnFalse() + { + _dataFilter.Disable(); + Assert.IsFalse(_dataFilter.IsEnabled()); + + using (_dataFilter.Enable()) + { + Assert.IsTrue(_dataFilter.IsEnabled()); + } + + Assert.IsFalse(_dataFilter.IsEnabled()); + } +} diff --git a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj new file mode 100644 index 000000000..33b5b3d0b --- /dev/null +++ b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj @@ -0,0 +1,29 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs new file mode 100644 index 000000000..05c2ff359 --- /dev/null +++ b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; +global using Masa.Contrib.Data.Contracts.EF.DataFiltering; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs new file mode 100644 index 000000000..9d87952e2 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/DefaultLocalDistributedLock.cs @@ -0,0 +1,39 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Local; + +public class DefaultLocalDistributedLock : IDistributedLock +{ + private readonly MemoryCache _localObjects = new(); + + public IDisposable? TryGet(string key, TimeSpan timeout = default) + { + var semaphore = GetSemaphoreSlim(key); + + if (!semaphore.Wait(timeout)) + { + return null; + } + + return new DisposeAction(semaphore); + } + + public async Task TryGetAsync(string key, TimeSpan timeout = default, CancellationToken cancellationToken = default) + { + var semaphore = GetSemaphoreSlim(key); + + if (!await semaphore.WaitAsync(timeout, cancellationToken)) + { + return null; + } + + return new DisposeAction(semaphore); + } + + private SemaphoreSlim GetSemaphoreSlim(string key) + { + ArgumentNullOrWhiteSpaceException.ThrowIfNullOrWhiteSpace(key); + return _localObjects.GetOrAdd(key, _ => new SemaphoreSlim(1, 1)); + } +} diff --git a/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs new file mode 100644 index 000000000..5298a191f --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/ArgumentNullOrWhiteSpaceException.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Local.Internal; + +internal class ArgumentNullOrWhiteSpaceException +{ + public static void ThrowIfNullOrWhiteSpace(string? argument, string? paramName = null) + { + paramName ??= nameof(argument); + + if (string.IsNullOrWhiteSpace(argument)) + throw new ArgumentException($"{paramName} can not be null, empty or white space!", paramName); + } +} diff --git a/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs new file mode 100644 index 000000000..42d85c737 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Internal/DisposeAction.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Local.Internal; + +internal class DisposeAction : IDisposable, IAsyncDisposable +{ + private readonly SemaphoreSlim _semaphore; + + public DisposeAction(SemaphoreSlim semaphore) => _semaphore = semaphore; + + public ValueTask DisposeAsync() + { + _semaphore.Release(); + return ValueTask.CompletedTask; + } + + public void Dispose() => _semaphore.Release(); +} diff --git a/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj new file mode 100644 index 000000000..a02b6a725 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/Masa.Contrib.Data.DistributedLock.Local.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md new file mode 100644 index 000000000..a8ad4be77 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.md @@ -0,0 +1,28 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Local + +## Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Local +``` + +1. Modify the class `Program` + +``` C# +builder.Services.AddLocalDistributedLock(); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md new file mode 100644 index 000000000..6904395ac --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/README.zh-CN.md @@ -0,0 +1,28 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Local + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Local +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddLocalDistributedLock(); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..b8bec19be --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/ServiceCollectionExtensions.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddLocalDistributedLock(this IServiceCollection services) + { + if (services.Any()) + return services; + + services.TryAddSingleton(); + return services; + } +} diff --git a/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs new file mode 100644 index 000000000..4080f7033 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Masa.Contrib.Data.DistributedLock.Local/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.Contrib.Data.DistributedLock.Local; +global using Masa.Contrib.Data.DistributedLock.Local.Internal; +global using Masa.Utils.Caching.Memory; +global using Microsoft.Extensions.DependencyInjection.Extensions; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj new file mode 100644 index 000000000..3b60b397e --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/Masa.Contrib.Data.DistributedLock.Medallion.Azure.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs new file mode 100644 index 000000000..ff3274a06 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/MedallionBuilderExtensions.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MedallionBuilderExtensions +{ + public static void UseAzure(this MedallionBuilder medallionBuilder, + string connectionString, + string blobContainerName, + Action? options = null) + => medallionBuilder.UseAzure(new BlobContainerClient(connectionString, blobContainerName), options); + + public static void UseAzure(this MedallionBuilder medallionBuilder, + string connectionString, + string blobContainerName, + BlobClientOptions blobClientOptions, + Action? options = null) + => medallionBuilder.UseAzure(new BlobContainerClient(connectionString, blobContainerName, blobClientOptions), options); + + public static void UseAzure(this MedallionBuilder medallionBuilder, + BlobContainerClient blobContainerClient, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => new AzureBlobLeaseDistributedSynchronizationProvider(blobContainerClient, options)); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md new file mode 100644 index 000000000..aaea956dc --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md @@ -0,0 +1,31 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion.Azure + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Azure +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseAzure("Replace Your connectionString", "Replace your blobContainerName"); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md new file mode 100644 index 000000000..8baea08c5 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md @@ -0,0 +1,32 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Medallion.Azure + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Azure +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseAzure("Replace Your connectionString", "Replace your blobContainerName"); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs new file mode 100644 index 000000000..57b06380d --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Azure/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Azure.Storage.Blobs; +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Medallion.Threading; +global using Medallion.Threading.Azure; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj new file mode 100644 index 000000000..d42ce5da9 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs new file mode 100644 index 000000000..9cf3ff7f7 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/MedallionBuilderExtensions.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MedallionBuilderExtensions +{ + public static void UseFileSystem(this MedallionBuilder medallionBuilder, string path) + => medallionBuilder.UseFileSystem(new DirectoryInfo(path)); + + public static void UseFileSystem(this MedallionBuilder medallionBuilder, DirectoryInfo lockFileDirectory) + { + medallionBuilder.Services.AddSingleton(_ + => new FileDistributedSynchronizationProvider(lockFileDirectory)); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md new file mode 100644 index 000000000..8e6090360 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md @@ -0,0 +1,31 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion.FileSystem + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.FileSystem +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseFileSystem("Replace your directory path"); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md new file mode 100644 index 000000000..47dab4155 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md @@ -0,0 +1,32 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Medallion.FileSystem + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.FileSystem +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseFileSystem("Replace your directory path"); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs new file mode 100644 index 000000000..16aa420eb --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Medallion.Threading; +global using Medallion.Threading.FileSystem; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj new file mode 100644 index 000000000..c4bfd8f36 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/Masa.Contrib.Data.DistributedLock.Medallion.MySql.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs new file mode 100644 index 000000000..965d11332 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/MedallionBuilderExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MedallionBuilderExtensions +{ + public static void UseMySQL(this MedallionBuilder medallionBuilder, + string connectionString, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => new MySqlDistributedSynchronizationProvider(connectionString, options)); + } + + public static void UseMySQL(this MedallionBuilder medallionBuilder, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(serviceProvider + => + { + var unitOfWorkManager = serviceProvider.GetService(); + if (unitOfWorkManager == null) + throw new NotSupportedException("UoW is not supported"); + + using (var unitOfWork = unitOfWorkManager.CreateDbContext()) + { + var name = ConnectionStringNameAttribute.GetConnStringName(typeof(TDbContextType)); + var connectionStringProvider = unitOfWork.ServiceProvider.GetRequiredService(); + var connectionString = connectionStringProvider.GetConnectionString(name); + return new MySqlDistributedSynchronizationProvider(connectionString, options); + } + }); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md new file mode 100644 index 000000000..4983e5a08 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.md @@ -0,0 +1,31 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion.MySql + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.MySql +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd"); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md new file mode 100644 index 000000000..42699c1fa --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/README.zh-CN.md @@ -0,0 +1,32 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLocking.Medallion.MySql + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLocking.Medallion.MySql +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd"); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs new file mode 100644 index 000000000..395c74dfe --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.MySql/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Medallion.Threading; +global using Medallion.Threading.MySql; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj new file mode 100644 index 000000000..1f72bfaaf --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/Masa.Contrib.Data.DistributedLock.Medallion.Oracle.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs new file mode 100644 index 000000000..3dda0c231 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/MedallionBuilderExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MedallionBuilderExtensions +{ + public static void UseOracle(this MedallionBuilder medallionBuilder, + string connectionString, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => new OracleDistributedSynchronizationProvider(connectionString, options)); + } + + public static void UseOracle(this MedallionBuilder medallionBuilder, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(serviceProvider + => + { + var unitOfWorkManager = serviceProvider.GetService(); + if (unitOfWorkManager == null) + throw new NotSupportedException("UoW is not supported"); + + using (var unitOfWork = unitOfWorkManager.CreateDbContext()) + { + var name = ConnectionStringNameAttribute.GetConnStringName(typeof(TDbContextType)); + var connectionStringProvider = unitOfWork.ServiceProvider.GetRequiredService(); + var connectionString = connectionStringProvider.GetConnectionString(name); + return new OracleDistributedSynchronizationProvider(connectionString, options); + } + }); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md new file mode 100644 index 000000000..e686dc0c0 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.md @@ -0,0 +1,31 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion.Oracle + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Oracle +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseOracle("Data Source=MyOracleDB;Integrated Security=yes;"); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md new file mode 100644 index 000000000..88930baa3 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/README.zh-CN.md @@ -0,0 +1,32 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Medallion.Oracle + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Oracle +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseOracle("Data Source=MyOracleDB;Integrated Security=yes;"); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs new file mode 100644 index 000000000..28c35b3d6 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Oracle/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Medallion.Threading; +global using Medallion.Threading.Oracle; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj new file mode 100644 index 000000000..2da860b49 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs new file mode 100644 index 000000000..a56d3c519 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/MedallionBuilderExtensions.cs @@ -0,0 +1,35 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MedallionBuilderExtensions +{ + public static void UseNpgsql(this MedallionBuilder medallionBuilder, + string connectionString, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => new PostgresDistributedSynchronizationProvider(connectionString, options)); + } + + public static void UseNpgsql(this MedallionBuilder medallionBuilder, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(serviceProvider + => + { + var unitOfWorkManager = serviceProvider.GetService(); + if (unitOfWorkManager == null) + throw new NotSupportedException("UoW is not supported"); + + using (var unitOfWork = unitOfWorkManager.CreateDbContext()) + { + var name = ConnectionStringNameAttribute.GetConnStringName(typeof(TDbContextType)); + var connectionStringProvider = unitOfWork.ServiceProvider.GetRequiredService(); + var connectionString = connectionStringProvider.GetConnectionString(name); + return new PostgresDistributedSynchronizationProvider(connectionString, options); + } + }); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md new file mode 100644 index 000000000..6eae77aaf --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.md @@ -0,0 +1,31 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseNpgsql("Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity"); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md new file mode 100644 index 000000000..9b6f7501d --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/README.zh-CN.md @@ -0,0 +1,32 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseNpgsql("Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity"); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs new file mode 100644 index 000000000..9546f8105 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.PostgreSql/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Medallion.Threading; +global using Medallion.Threading.Postgres; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs new file mode 100644 index 000000000..e90a7af6e --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Internal/ConfigurationOptionsExtensions.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Medallion.Redis.Internal; + +internal static class ConfigurationOptionsExtensions +{ + public static ConfigurationOptions GetConfigurationOptions(RedisConfigurationOptions redisOptions) + { + var configurationOptions = new ConfigurationOptions + { + AbortOnConnectFail = redisOptions.AbortOnConnectFail, + AllowAdmin = redisOptions.AllowAdmin, + ChannelPrefix = redisOptions.ChannelPrefix, + ClientName = redisOptions.ClientName, + ConnectRetry = redisOptions.ConnectRetry, + ConnectTimeout = redisOptions.ConnectTimeout, + DefaultDatabase = redisOptions.DefaultDatabase, + Password = redisOptions.Password, + Proxy = redisOptions.Proxy, + Ssl = redisOptions.Ssl, + SyncTimeout = redisOptions.SyncTimeout + }; + + foreach (var server in redisOptions.Servers) + { + configurationOptions.EndPoints.Add(server.Host, server.Port); + } + return configurationOptions; + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj new file mode 100644 index 000000000..381ee02bd --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/Masa.Contrib.Data.DistributedLock.Medallion.Redis.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs new file mode 100644 index 000000000..9f2e1aba5 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/MedallionBuilderExtensions.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MedallionBuilderExtensions +{ + public static void UseRedis(this MedallionBuilder medallionBuilder, + string connectionString, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => + { + var connection = ConnectionMultiplexer.Connect(connectionString); + return new RedisDistributedSynchronizationProvider(connection.GetDatabase(), options); + }); + } + + public static void UseRedis(this MedallionBuilder medallionBuilder, + IDatabase database, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => new RedisDistributedSynchronizationProvider(database, options)); + } + + public static void UseRedis(this MedallionBuilder medallionBuilder, + IEnumerable databases, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => new RedisDistributedSynchronizationProvider(databases, options)); + } + + public static void UseRedis(this MedallionBuilder medallionBuilder, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(serviceProvider + => + { + var redisOptions = serviceProvider.GetRequiredService>(); + var connection = ConnectionMultiplexer.Connect(ConfigurationOptionsExtensions.GetConfigurationOptions(redisOptions.Value)); + return new RedisDistributedSynchronizationProvider(connection.GetDatabase(), options); + }); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md new file mode 100644 index 000000000..6a8a0d7cc --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.md @@ -0,0 +1,31 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion.Redis + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Redis +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseRedis("127.0.0.1:6379"); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md new file mode 100644 index 000000000..f93514b4e --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/README.zh-CN.md @@ -0,0 +1,32 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Medallion.Redis + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Redis +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseRedis("127.0.0.1:6379"); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs new file mode 100644 index 000000000..c35b9c490 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Redis/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Masa.Contrib.Data.DistributedLock.Medallion.Redis.Internal; +global using Masa.Utils.Caching.Redis.Models; +global using Medallion.Threading; +global using Medallion.Threading.Redis; +global using Microsoft.Extensions.Options; +global using StackExchange.Redis; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj new file mode 100644 index 000000000..fe6e0259b --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + Masa.Contrib.Data.DistributedLocking.Medallion.SqlServer + + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs new file mode 100644 index 000000000..934b6dd45 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/MedallionBuilderExtensions.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MedallionBuilderExtensions +{ + public static void UseSqlServer(this MedallionBuilder medallionBuilder, + string connectionString, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => new SqlDistributedSynchronizationProvider(connectionString, options)); + } + + public static void UseSqlServer(this MedallionBuilder medallionBuilder, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(serviceProvider + => + { + var unitOfWorkManager = serviceProvider.GetService(); + if (unitOfWorkManager == null) + throw new NotSupportedException("UoW is not supported"); + + using var unitOfWork = unitOfWorkManager.CreateDbContext(); + var name = ConnectionStringNameAttribute.GetConnStringName(typeof(TDbContextType)); + var connectionStringProvider = unitOfWork.ServiceProvider.GetRequiredService(); + var connectionString = connectionStringProvider.GetConnectionString(name); + return new SqlDistributedSynchronizationProvider(connectionString, options); + + }); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md new file mode 100644 index 000000000..f8b630db2 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md @@ -0,0 +1,31 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion.SqlServer + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.SqlServer +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md new file mode 100644 index 000000000..e5a71cdc1 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md @@ -0,0 +1,32 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Medallion.SqlServer + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.SqlServer +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs new file mode 100644 index 000000000..192f5b75b --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Medallion.Threading; +global using Medallion.Threading.SqlServer; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs new file mode 100644 index 000000000..ce28bdb20 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/DefaultMedallionDistributedLockTest.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Medallion.Tests; + +/// +/// Only supports local testing +/// +[TestClass] +public class DefaultMedallionDistributedLockTest +{ + // private IDistributedLock DistributedLock { get; set; } + // + // [TestInitialize] + // public void Initialize() + // { + // var services = new ServiceCollection(); + // services.AddDistributedLock(medallionBuilder => + // { + // medallionBuilder.UseRedis("127.0.0.1:6379"); + // }); + // DistributedLock = services.GetInstance(); + // } + // + // [TestMethod] + // public void TestDistributedLock() + // { + // using var obj = DistributedLock.TryGet("test", TimeSpan.FromSeconds(1)); + // Assert.IsNotNull(obj); + // } + // + // [TestMethod] + // public async Task TestDistributedLockAsync() + // { + // await using var obj = await DistributedLock.TryGetAsync("test", TimeSpan.FromSeconds(1)); + // Assert.IsNotNull(obj); + // } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj new file mode 100644 index 000000000..15c3b8e24 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/Masa.Contrib.Data.DistributedLock.Medallion.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs new file mode 100644 index 000000000..7c77986d2 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj new file mode 100644 index 000000000..fe556e799 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + Masa.Contrib.Data.DistributedLocking.Medallion.WaitHandles + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs new file mode 100644 index 000000000..42a36ad86 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/MedallionBuilderExtensions.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MedallionBuilderExtensions +{ + /// + /// used to coordinate between processes on the same machine + /// + /// + /// specifies how frequently the implementation will check to see if the original holder of a lock/semaphore abandoned it without properly releasing it while waiting for it to become available. Defaults to 2s + public static void UseWaitHandles(this MedallionBuilder medallionBuilder, + TimeSpan? abandonmentCheckCadence = null) + { + medallionBuilder.Services.AddSingleton(_ + => new WaitHandleDistributedSynchronizationProvider(abandonmentCheckCadence)); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md new file mode 100644 index 000000000..101963153 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.md @@ -0,0 +1,33 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseWaitHandles(); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + +> Does not support cross-machine, only supports coordination between processes on the same machine \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md new file mode 100644 index 000000000..6d156a984 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/README.zh-CN.md @@ -0,0 +1,33 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseWaitHandles(); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + +> 不支持跨机器,仅支持同一台机器上进程之间进行协调 \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs new file mode 100644 index 000000000..965419076 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.WaitHandles/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Medallion.Threading; +global using Medallion.Threading.WaitHandles; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj new file mode 100644 index 000000000..22d396f1c --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs new file mode 100644 index 000000000..6841604a5 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/MedallionBuilderExtensions.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MedallionBuilderExtensions +{ + public static void UseZooKeeper(this MedallionBuilder medallionBuilder, + string connectionString, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => new ZooKeeperDistributedSynchronizationProvider(connectionString, options)); + } + + public static void UseZooKeeper(this MedallionBuilder medallionBuilder, + ZooKeeperPath directoryPath, + string connectionString, + Action? options = null) + { + medallionBuilder.Services.AddSingleton(_ + => new ZooKeeperDistributedSynchronizationProvider(directoryPath, connectionString, options)); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md new file mode 100644 index 000000000..2df963d1b --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md @@ -0,0 +1,31 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion.SqlServer + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.SqlServer +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseZooKeeper("Replace your ZooKeeper connectionString"); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md new file mode 100644 index 000000000..7167fa89d --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md @@ -0,0 +1,32 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseZooKeeper("Replace your ZooKeeper connectionString"); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs new file mode 100644 index 000000000..980fcdb59 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Medallion.Threading; +global using Medallion.Threading.ZooKeeper; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs new file mode 100644 index 000000000..f8cd492fa --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/DefaultMedallionDistributedLock.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Medallion; + +public class DefaultMedallionDistributedLock : IMasaDistributedLock +{ + private readonly IDistributedLockProvider _distributedLockProvider; + + public DefaultMedallionDistributedLock(IDistributedLockProvider distributedLockProvider) + => _distributedLockProvider = distributedLockProvider; + + public IDisposable? TryGet(string key, TimeSpan timeout = default) + { + ArgumentNullOrWhiteSpaceException.ThrowIfNullOrWhiteSpace(key); + var handle = _distributedLockProvider.TryAcquireLock(key, timeout); + if (handle == null) + return null; + + return new DisposeAction(handle); + } + + public async Task TryGetAsync(string key, TimeSpan timeout = default, CancellationToken cancellationToken = default) + { + ArgumentNullOrWhiteSpaceException.ThrowIfNullOrWhiteSpace(key); + var handle = await _distributedLockProvider.TryAcquireLockAsync(key, timeout, cancellationToken); + if (handle == null) + return null; + + return new DisposeAction(handle); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs new file mode 100644 index 000000000..88c311fa7 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Internal/ArgumentNullOrWhiteSpaceException.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Medallion.Internal; + +internal class ArgumentNullOrWhiteSpaceException +{ + public static void ThrowIfNullOrWhiteSpace(string? argument, string? paramName = null) + { + paramName ??= nameof(argument); + + if (string.IsNullOrWhiteSpace(argument)) + throw new ArgumentException($"{paramName} can not be null, empty or white space!", paramName); + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs new file mode 100644 index 000000000..29298fdae --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Internal/DisposeAction.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Medallion.Internal; + +internal class DisposeAction : IDisposable, IAsyncDisposable +{ + private readonly IDistributedSynchronizationHandle _handle; + + public DisposeAction(IDistributedSynchronizationHandle handle) => _handle = handle; + + public ValueTask DisposeAsync() + { + _handle.DisposeAsync(); + return ValueTask.CompletedTask; + } + + public void Dispose() => _handle.Dispose(); +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj new file mode 100644 index 000000000..2eb2d960f --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/Masa.Contrib.Data.DistributedLock.Medallion.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs new file mode 100644 index 000000000..5ddc19f65 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/MedallionBuilder.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Medallion; + +public class MedallionBuilder +{ + public IServiceCollection Services { get; } + + public MedallionBuilder(IServiceCollection services) => Services = services; +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/README.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/README.md new file mode 100644 index 000000000..c39d912ca --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/README.md @@ -0,0 +1,46 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.DistributedLock.Medallion + +Masa.Contrib.Data.DistributedLock.Medallion is a distributed lock based on [DistributedLock](https://github.com/madelson/DistributedLock) + +### Implementations + +- [Azure](../Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.md) +- [FileSystem](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) +- [MySql](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) +- [Oracle](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) +- [PostgreSql](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) +- [Redis](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) +- [SqlServer](../Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.md) +- [WaitHandles](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.md) +- [ZooKeeper](../Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.md) + +### Example: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Redis// an example of Redis +``` + +1. Modify `Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseRedis("127.0.0.1:6379"); +}); +``` + +2. Use distributed locks + +``` C# +IDistributedLock distributedLock;//Get `IDistributedLock` from DI +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md new file mode 100644 index 000000000..1663a7a03 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/README.zh-CN.md @@ -0,0 +1,47 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.DistributedLock.Medallion + +Masa.Contrib.Data.DistributedLock.Medallion是基于[DistributedLock](https://github.com/madelson/DistributedLock)的一个分布式锁 + +## 实现 + +- [Azure](../Masa.Contrib.Data.DistributedLock.Medallion.Azure/README.zh-CN.md) +- [FileSystem](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) +- [MySql](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) +- [Oracle](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) +- [PostgreSql](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) +- [Redis](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) +- [SqlServer](../Masa.Contrib.Data.DistributedLock.Medallion.SqlServer/README.zh-CN.md) +- [WaitHandles](../Masa.Contrib.Data.DistributedLock.Medallion.FileSystem/README.zh-CN.md) +- [ZooKeeper](../Masa.Contrib.Data.DistributedLock.Medallion.ZooKeeper/README.zh-CN.md) + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.DistributedLock.Medallion +Install-Package Masa.Contrib.Data.DistributedLock.Medallion.Redis//以Redis举例 +``` + +1. 修改类`Program` + +``` C# +builder.Services.AddDistributedLock(medallionBuilder => +{ + medallionBuilder.UseRedis("127.0.0.1:6379"); +}); +``` + +2. 使用分布式锁 + +``` C# +IDistributedLock distributedLock;//从DI获取`IDistributedLock` +using (var lockObj = distributedLock.TryGet("Replace Your Lock Name")) +{ + if (lockObj != null) + { + // todo: The code that needs to be executed after acquiring the distributed lock + } +} +``` + diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..f2df56ad4 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/ServiceCollectionExtensions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddDistributedLock(this IServiceCollection services, Action builder) + { + ArgumentNullException.ThrowIfNull(builder); + + if (services.Any()) + services.RemoveAll(); + + builder.Invoke(new MedallionBuilder(services)); + + if (!services.Any()) + throw new Exception("Please add IDistributedLockProvider first."); + + services.TryAddSingleton(); + return services; + } +} diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs new file mode 100644 index 000000000..7360fe7df --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Data.DistributedLock.Medallion; +global using Masa.Contrib.Data.DistributedLock.Medallion.Internal; +global using Medallion.Threading; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using IMasaDistributedLock = Masa.BuildingBlocks.Data.IDistributedLock; diff --git a/src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs b/src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs new file mode 100644 index 000000000..024dacde2 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/LocalDistributedLockTest.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.DistributedLock.Local.Tests; + +[TestClass] +public class LocalDistributedLockTest +{ + private IDistributedLock DistributedLock { get; set; } + + [TestInitialize] + public void Initialize() + { + var services = new ServiceCollection(); + services.AddLocalDistributedLock(); + DistributedLock = services.GetInstance(); + } + + [TestMethod] + public void TestDistributedLock() + { + using var obj = DistributedLock.TryGet("test", TimeSpan.FromSeconds(1)); + Assert.IsNotNull(obj); + } + + [TestMethod] + public async Task TestDistributedLockAsync() + { + await using var obj = await DistributedLock.TryGetAsync("test", TimeSpan.FromSeconds(1)); + Assert.IsNotNull(obj); + } +} diff --git a/src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj b/src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj new file mode 100644 index 000000000..ce4e87f6a --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/Masa.Contrib.Data.DistributedLock.Local.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs b/src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs new file mode 100644 index 000000000..7c77986d2 --- /dev/null +++ b/src/Contrib/Data/DistributedLock/Tests/Masa.Contrib.Data.DistributedLock.Local.Tests/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj new file mode 100644 index 000000000..e6f8c7eb0 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs new file mode 100644 index 000000000..d59be78bf --- /dev/null +++ b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/NormalGuidGenerator.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.NormalGuid; + +public class NormalGuidGenerator : IGuidGenerator +{ + public Guid NewId() => Guid.NewGuid(); +} + + diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md new file mode 100644 index 000000000..73b167c47 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md @@ -0,0 +1,26 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.IdGenerator.SimpleGuid + +Masa.Contrib.Data.IdGenerator.SimpleGuid is a simple guid constructor that provides a unique identifier of type Guid + +## Example: + +1. Install `Masa.Contrib.Data.IdGenerator.SimpleGuid` + + ````c# + Install-Package Masa.Contrib.Data.IdGenerator.SimpleGuid + ```` + +2. Use `Masa.Contrib.Data.IdGenerator.SimpleGuid` + + ```` C# + builder.Services.AddSimpleGuidGenerator(); + ```` + +3. Get Id + + ```` + IGuidGenerator generator;// Get it through DI, or get it through IdGeneratorFactory.GuidGenerator + generator.NewId();//Create a unique id + ```` \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md new file mode 100644 index 000000000..20fa99c97 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md @@ -0,0 +1,26 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.IdGenerator.NormalGuid + +Masa.Contrib.Data.IdGenerator.NormalGuid是一个简单的Guid构造器,提供Guid类型的唯一标识 + +## 用例: + +1. 安装`Masa.Contrib.Data.IdGenerator.NormalGuid` + + ```c# + Install-Package Masa.Contrib.Data.IdGenerator.NormalGuid + ``` + +2. 使用`Masa.Contrib.Data.IdGenerator.NormalGuid` + + ``` C# + builder.Services.AddSimpleGuidGenerator(); + ``` + +3. 获取Id + + ``` + IGuidGenerator generator;// 通过DI获取,或者通过IdGeneratorFactory.GuidGenerator获取 + generator.NewId();//创建唯一id + ``` diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..832b93820 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/ServiceCollectionExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddSimpleGuidGenerator(this IServiceCollection services) + { + services.TryAddSingleton(); + services.TryAddSingleton, IGuidGenerator>(); + IdGeneratorFactory.SetGuidGenerator(services.BuildServiceProvider().GetRequiredService()); + return services; + } +} diff --git a/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs new file mode 100644 index 000000000..152235712 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/NormalGuid/Masa.Contrib.Data.IdGenerator.NormalGuid/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.Contrib.Data.IdGenerator.NormalGuid; +global using Microsoft.Extensions.DependencyInjection.Extensions; diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj new file mode 100644 index 000000000..2ee0692eb --- /dev/null +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + false + + + + + + + + + + + + + + diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs new file mode 100644 index 000000000..c891db7f3 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/SequentialGuidGeneratorTest.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests; + +[TestClass] +public class SequentialGuidGeneratorTest +{ + [TestMethod] + public void Test() + { + int count = 10000000; + List guids = new(); + for (int i = 0; i < count; i++) + { + guids.Add(new SequentialGuidGenerator(SequentialGuidType.SequentialAsString).NewId()); + } + Assert.IsTrue(guids.Count == guids.Distinct().Count()); + } +} diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs new file mode 100644 index 000000000..801a4c366 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.Tests/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System; +global using System.Collections.Generic; +global using System.Linq; diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj new file mode 100644 index 000000000..e6f8c7eb0 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md new file mode 100644 index 000000000..07182ecec --- /dev/null +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md @@ -0,0 +1,26 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.IdGenerator.SequentialGuid + +Masa.Contrib.Data.IdGenerator.SequentialGuid is an ordered Guid constructor that provides a unique identifier of the Guid type + +## Example: + +1. Install `Masa.Contrib.Data.IdGenerator.SequentialGuid` + + ````c# + Install-Package Masa.Contrib.Data.IdGenerator.SequentialGuid + ```` + +2. Use `Masa.Contrib.Data.IdGenerator.SequentialGuid` + + ```` C# + builder.Services.AddSequentialGuidGenerator(); + ```` + +3. Get Id + + ```` + ISequentialGuidGenerator generator;// Obtained through DI, or obtained through IdGeneratorFactory.SequentialGuidGenerator + generator.NewId();//Create a unique id + ```` \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md new file mode 100644 index 000000000..af7381f03 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md @@ -0,0 +1,26 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.IdGenerator.SequentialGuid + +Masa.Contrib.Data.IdGenerator.SequentialGuid是一个有序的Guid构造器,提供Guid类型的唯一标识 + +## 用例: + +1. 安装`Masa.Contrib.Data.IdGenerator.SequentialGuid` + + ```c# + Install-Package Masa.Contrib.Data.IdGenerator.SequentialGuid + ``` + +2. 使用`Masa.Contrib.Data.IdGenerator.SequentialGuid` + + ``` C# + builder.Services.AddSequentialGuidGenerator(); + ``` + +3. 获取Id + + ``` + ISequentialGuidGenerator generator;// 通过DI获取,或者通过IdGeneratorFactory.SequentialGuidGenerator获取 + generator.NewId();//创建唯一id + ``` diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs new file mode 100644 index 000000000..61aab967f --- /dev/null +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/SequentialGuidGenerator.cs @@ -0,0 +1,71 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.SequentialGuid; + +public class SequentialGuidGenerator : ISequentialGuidGenerator +{ + private static readonly RandomNumberGenerator RandomGenerator = RandomNumberGenerator.Create(); + + private readonly SequentialGuidType _guidType; + + public SequentialGuidGenerator(SequentialGuidType guidType) => _guidType = guidType; + + public Guid NewId() => Create(_guidType); + + public Guid Create(SequentialGuidType guidType) + { + byte[] randomBytes = GetRandomBytes(); + byte[] timestampBytes = GetTimestampBytes(); + byte[] guidBytes = GetGuidBytes(guidType, timestampBytes, randomBytes); + return new Guid(guidBytes); + } + + private byte[] GetTimestampBytes() + { + long timestamp = DateTime.UtcNow.Ticks / 10000L; + byte[] timestampBytes = BitConverter.GetBytes(timestamp); + if (BitConverter.IsLittleEndian) + { + Array.Reverse(timestampBytes); + } + return timestampBytes; + } + + private byte[] GetRandomBytes() + { + byte[] randomBytes = new byte[10]; + RandomGenerator.GetBytes(randomBytes); + return randomBytes; + } + + private byte[] GetGuidBytes(SequentialGuidType sequentialGuidType, byte[] timestampBytes, byte[] randomBytes) + { + byte[] guidBytes = new byte[16]; + switch (sequentialGuidType) + { + case SequentialGuidType.SequentialAtEnd: + + Buffer.BlockCopy(randomBytes, 0, guidBytes, 0, 10); + Buffer.BlockCopy(timestampBytes, 2, guidBytes, 10, 6); + break; + + case SequentialGuidType.SequentialAsString: + case SequentialGuidType.SequentialAsBinary: + + Buffer.BlockCopy(timestampBytes, 2, guidBytes, 0, 6); + Buffer.BlockCopy(randomBytes, 0, guidBytes, 6, 10); + + if (sequentialGuidType == SequentialGuidType.SequentialAsString && BitConverter.IsLittleEndian) + { + Array.Reverse(guidBytes, 0, 4); + Array.Reverse(guidBytes, 4, 2); + } + break; + + default: + throw new NotSupportedException($"unsupported {sequentialGuidType}"); + } + return guidBytes; + } +} diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..44681154a --- /dev/null +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/ServiceCollectionExtensions.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddSequentialGuidGenerator(this IServiceCollection services) + => services.AddSequentialGuidGenerator(SequentialGuidType.SequentialAtEnd); + + public static IServiceCollection AddSequentialGuidGenerator(this IServiceCollection services, SequentialGuidType guidType) + { + services.TryAddSingleton(_ => new SequentialGuidGenerator(guidType)); + services.TryAddSingleton>(serviceProvider + => serviceProvider.GetRequiredService()); + IdGeneratorFactory.SetSequentialGuidGenerator(services.BuildServiceProvider().GetRequiredService()); + return services; + } +} diff --git a/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs new file mode 100644 index 000000000..c763fdd36 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/SequentialGuid/Masa.Contrib.Data.IdGenerator.SequentialGuid/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.Contrib.Data.IdGenerator.SequentialGuid; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using System.Security.Cryptography; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs new file mode 100644 index 000000000..fe5446e12 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/BaseRedis.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; + +public class BaseRedis +{ + protected IDistributedCacheClient DistributedCacheClient { get; } + internal ConnectionMultiplexer Connection { get; } + internal IDatabase Database { get; } + + public BaseRedis(IDistributedCacheClient distributedCacheClient, IOptions redisOptions) + { + DistributedCacheClient = distributedCacheClient; + var options = GetConfigurationOptions(redisOptions.Value); + Connection = ConnectionMultiplexer.Connect(options); + Database = Connection.GetDatabase(options.DefaultDatabase ?? 0); + } + + private ConfigurationOptions GetConfigurationOptions(RedisConfigurationOptions redisOptions) + { + var configurationOptions = new ConfigurationOptions + { + AbortOnConnectFail = redisOptions.AbortOnConnectFail, + AllowAdmin = redisOptions.AllowAdmin, + ChannelPrefix = redisOptions.ChannelPrefix, + ClientName = redisOptions.ClientName, + ConnectRetry = redisOptions.ConnectRetry, + ConnectTimeout = redisOptions.ConnectTimeout, + DefaultDatabase = redisOptions.DefaultDatabase, + Password = redisOptions.Password, + Proxy = redisOptions.Proxy, + Ssl = redisOptions.Ssl, + SyncTimeout = redisOptions.SyncTimeout + }; + + foreach (var server in redisOptions.Servers) + { + configurationOptions.EndPoints.Add(server.Host, server.Port); + } + return configurationOptions; + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs new file mode 100644 index 000000000..d83f092d4 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedIdGeneratorOptions.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; + +public class DistributedIdGeneratorOptions +{ + /// + /// When there is no available WorkerId, Recycle idle and unused WorkerIds and recycle them + /// default: 120000ms(2min) + /// + /// + public long IdleTimeOut { get; set; } = 2 * 60 * 1000; + + /// + /// Get the minimum interval for WorkerId + /// default: 5000ms + /// + public long GetWorkerIdMinInterval { get; set; } = 5 * 1000; + + /// + /// refresh timestamp period + /// default: 500ms + /// + public long RefreshTimestampInterval { get; set; } = 500; + + public IdGeneratorOptions IdGeneratorOptions { get; } + + public DistributedIdGeneratorOptions(IdGeneratorOptions idGeneratorOptions) + => IdGeneratorOptions = idGeneratorOptions; +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs new file mode 100644 index 000000000..624e84ab5 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/DistributedWorkerProvider.cs @@ -0,0 +1,185 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; + +public class DistributedWorkerProvider : BaseRedis, IWorkerProvider +{ + private readonly string _channel = "snowflake.workerid"; + private long? _workerId; + private readonly TimestampType _timestampType; + private readonly long _idleTimeOut; + private readonly long _maxWorkerId; + private readonly long _workerIdMinInterval; + private readonly string _currentWorkerKey; + private readonly string _inUseWorkerKey; + private readonly string _logOutWorkerKey; + private readonly string _getWorkerIdKey; + private readonly string _token; + private readonly TimeSpan _timeSpan; + private DateTime? _lastTime; + private readonly ILogger? _logger; + private readonly object _lock = new(); + private readonly string? _uniquelyIdentifies; + + public DistributedWorkerProvider( + IDistributedCacheClient distributedCacheClient, + DistributedIdGeneratorOptions? distributedIdGeneratorOptions, + IOptions redisOptions, + ILogger? logger) : base(distributedCacheClient, redisOptions) + { + _uniquelyIdentifies ??= Guid.NewGuid().ToString(); + ArgumentNullException.ThrowIfNull(distributedIdGeneratorOptions); + + _timestampType = distributedIdGeneratorOptions.IdGeneratorOptions.TimestampType; + _idleTimeOut = distributedIdGeneratorOptions.IdleTimeOut; + _maxWorkerId = distributedIdGeneratorOptions.IdGeneratorOptions.MaxWorkerId; + _workerIdMinInterval = distributedIdGeneratorOptions.GetWorkerIdMinInterval; + _currentWorkerKey = "snowflake.current.workerid"; + _inUseWorkerKey = "snowflake.inuse.workerid"; + _logOutWorkerKey = "snowflake.logout.workerid"; + _getWorkerIdKey = "snowflake.get.workerid"; + _token = Environment.MachineName; + _timeSpan = TimeSpan.FromSeconds(10); + _logger = logger; + + DistributedCacheClient.Subscribe(_channel, options => + { + if (options.Key == _uniquelyIdentifies) + return; + + if (_workerId.HasValue && _workerId.Value == options.Value) + _workerId = null; + }); + } + + public Task GetWorkerIdAsync() + { + if (_workerId.HasValue) + return Task.FromResult(_workerId.Value); + + if (_lastTime != null && (DateTime.UtcNow - _lastTime.Value).TotalMilliseconds < _workerIdMinInterval) + { + _logger?.LogDebug("Failed to get WorkerId, please rest for a while and try again"); + throw new MasaException("Failed to get WorkerId, please rest for a while and try again"); + } + + _lastTime = DateTime.UtcNow; + lock (_lock) + { + if (_workerId.HasValue) + return Task.FromResult(_workerId.Value); + + _workerId = GetNextWorkerIdAsync().ConfigureAwait(false).GetAwaiter().GetResult(); + + RefreshAsync().ConfigureAwait(false).GetAwaiter().GetResult(); + + DistributedCacheClient.Publish(_channel, options => + { + options.Key = _uniquelyIdentifies!; + options.Value = _workerId.Value; + }); + return Task.FromResult(_workerId.Value); + } + } + + public async Task RefreshAsync() + { + if (_workerId == null) + throw new MasaException("No WorkerId available"); + + await Database.SortedSetAddAsync(_inUseWorkerKey, _workerId, GetCurrentTimestamp()); + } + + public async Task LogOutAsync() + { + if (_workerId == null) + return; + + var workerId = _workerId; + _workerId = null; + + _logger?.LogDebug("----- Logout WorkerId, the current WorkerId: {WorkerId}, currentTime: {CurrentTime}", + workerId, + DateTime.UtcNow); + + await Database.SortedSetAddAsync(_logOutWorkerKey, workerId, GetCurrentTimestamp()); + await Database.SortedSetRemoveAsync(_inUseWorkerKey, workerId); + + _logger?.LogDebug("----- Logout WorkerId succeeded, the current WorkerId: {WorkerId}, currentTime: {CurrentTime}", + workerId, + DateTime.UtcNow); + } + + private async Task GetNextWorkerIdAsync() + { + var workerId = await DistributedCacheClient.HashIncrementAsync(_currentWorkerKey, 1) - 1; + if (workerId > _maxWorkerId) + { + var lockdb = Connection.GetDatabase(); + if (await lockdb.LockTakeAsync(_getWorkerIdKey, _token, _timeSpan)) + { + try + { + workerId = await GetNextWorkerIdByDistributedLockAsync(); + } + finally + { + await lockdb.LockReleaseAsync(_getWorkerIdKey, _token); + } + } + else + { + _logger?.LogDebug( + "----- Failed to obtain WorkerId, failed to obtain distributed lock, the currentTime: {CurrentTime}", + DateTime.UtcNow); + throw new MasaException("----- Failed to get WorkerId, please try again later"); + } + } + else + { + _workerId = workerId; + } + + return workerId; + } + + private async Task GetNextWorkerIdByDistributedLockAsync() + { + var workerId = await GetWorkerIdByLogOutAsync(); + if (workerId != null) + return workerId.Value; + + workerId = await GetWorkerIdByInUseAsync(); + if (workerId != null) + return workerId.Value; + + throw new MasaException("No WorkerId available"); + } + + protected virtual async Task GetWorkerIdByLogOutAsync() + { + var entries = await Database.SortedSetRangeByScoreWithScoresAsync(_logOutWorkerKey, take: 1); + if (entries is { Length: > 0 }) + return long.Parse(entries[0].Element); + + return null; + } + + protected virtual async Task GetWorkerIdByInUseAsync() + { + var entries = await Database.SortedSetRangeByScoreWithScoresAsync( + _inUseWorkerKey, + 0, + GetCurrentTimestamp(DateTime.UtcNow.AddMilliseconds(-_idleTimeOut)), + take: 1); + + if (entries is { Length: > 0 }) + return long.Parse(entries[0].Element); + + return null; + } + + private long GetCurrentTimestamp(DateTime? dateTime = null) + => new DateTimeOffset(dateTime ?? DateTime.UtcNow).GetTimestamp(_timestampType); +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs new file mode 100644 index 000000000..5adf99045 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/IdGeneratorOptionsExtensions.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; + +public static class IdGeneratorOptionsExtensions +{ + public static void UseRedis(this IdGeneratorOptions idGeneratorOptions, Action? action = null) + { + idGeneratorOptions.EnableSupportDistributed(); + DistributedIdGeneratorOptions distributedIdGeneratorOptions = new DistributedIdGeneratorOptions(idGeneratorOptions); + action?.Invoke(distributedIdGeneratorOptions); + + if (!idGeneratorOptions.Services.Any(service => service.ServiceType == typeof(IDistributedCacheClientFactory) && + service.ImplementationType == typeof(RedisCacheClientFactory))) + throw new MasaException("Please add first using AddMasaRedisCache"); + + if (distributedIdGeneratorOptions.IdleTimeOut <= idGeneratorOptions.HeartbeatInterval) + { + throw new ArgumentOutOfRangeException( + $"{nameof(distributedIdGeneratorOptions.IdleTimeOut)} must be greater than {idGeneratorOptions.HeartbeatInterval}"); + } + + idGeneratorOptions.Services.TryAddSingleton(serviceProvider + => new DistributedWorkerProvider(serviceProvider.GetRequiredService(), + distributedIdGeneratorOptions, + serviceProvider.GetRequiredService>(), + serviceProvider.GetService>())); + + if (idGeneratorOptions.EnableMachineClock) + { + idGeneratorOptions.Services.TryAddSingleton(serviceProvider + => new MachineClockIdGenerator(serviceProvider.GetRequiredService(), + serviceProvider.GetRequiredService(), + serviceProvider.GetRequiredService>(), + distributedIdGeneratorOptions)); + } + } + + private static TService GetInstance(this IServiceCollection services) where TService : notnull => + services.BuildServiceProvider().GetRequiredService(); + + +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs new file mode 100644 index 000000000..24114114a --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Internal/SnowflakeExtensions.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Internal; + +internal static class SnowflakeExtensions +{ + /// + /// get timestamp + /// + /// + /// Timestamp type: milliseconds: 1, seconds: 2 + /// + public static long GetTimestamp(this DateTimeOffset dateTimeOffset, TimestampType timestampType) + { + if (timestampType == TimestampType.Milliseconds) + return dateTimeOffset.ToUnixTimeMilliseconds(); + + return dateTimeOffset.ToUnixTimeSeconds(); + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs new file mode 100644 index 000000000..cb72f564d --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/MachineClockIdGenerator.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; + +public class MachineClockIdGenerator : Snowflake.MachineClockIdGenerator +{ + private readonly string _lastTimestampKey = "snowflake.last_timestamp"; + private long _lastRefreshTimestamp = 0; + private readonly long _refreshTimestampInterval; + private readonly BaseRedis _redis; + + public MachineClockIdGenerator( + IDistributedCacheClient distributedCacheClient, + IWorkerProvider workerProvider, + IOptions redisOptions, + DistributedIdGeneratorOptions distributedIdGeneratorOptions) + : base(workerProvider, distributedIdGeneratorOptions.IdGeneratorOptions) + { + _redis = new BaseRedis(distributedCacheClient, redisOptions); + _refreshTimestampInterval = distributedIdGeneratorOptions.IdGeneratorOptions.TimestampType == TimestampType.Milliseconds ? + long.Parse(Math.Ceiling(distributedIdGeneratorOptions.RefreshTimestampInterval / 1000m) + .ToString(CultureInfo.InvariantCulture)) : distributedIdGeneratorOptions.RefreshTimestampInterval; + if (_redis.Database.HashExists(_lastTimestampKey, GetHashField())) + { + LastTimestamp = long.Parse(_redis.Database.HashGet(_lastTimestampKey, GetHashField())) + _refreshTimestampInterval; + } + } + + public string GetHashField() => base.GetWorkerId().ToString(); + + protected override long TilNextMillis(long lastTimestamp) + { + lastTimestamp += 1; + if (lastTimestamp - _lastRefreshTimestamp >= _refreshTimestampInterval) + { + _redis.Database.HashSetAsync(_lastTimestampKey, GetHashField(), lastTimestamp); + _lastRefreshTimestamp = lastTimestamp; + } + return lastTimestamp; + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj new file mode 100644 index 000000000..7dba6ff29 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md new file mode 100644 index 000000000..c36e62f88 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.md @@ -0,0 +1,38 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis + +Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis is based on `Masa.Contrib.Data.IdGenerator.Snowflake` +The upgraded version supports distributed deployment, relies on Redis to provide WorkerId, and supports deployment under K8s + +## Example: + +1. Install `Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis`, + + ````c# + Install-Package Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis + ```` + +2. Use `Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis` + + ```` C# + builder.Services.AddSnowflake(option => option.UseRedis()); + ```` + + > Due to the dependency on Redis, [Masa.Utils.Caching.Redis](https://github.com/masastack/MASA.Utils/tree/main/src/Caching/Masa.Utils.Caching.Redis) + +3. Get id + + ```` + ISnowflakeGenerator generator;// Get it through DI, or get it through IdGeneratorFactory.SnowflakeGenerator + generator.NewId();//Create a unique id + ```` + +### Parameters: + +* IdleTimeOut: Idle recycling time, default: 120000ms (2min), when there is no available WorkerId, it will try to obtain the WorkerId whose active time exceeds IdleTimeOut from the historically used WorkerId collection, and select the one that is farthest away from the current WorkerId for reuse +* GetWorkerIdMinInterval: Time interval for getting WorkerId, default: 5000ms (5s) + > When the current WorkerId is available, the WorkerId will be returned directly without any restrictions + > When the service fails to refresh the WorkerId and the duration exceeds the specified time, the WorkerId will be automatically released. When a new Id is obtained again, it will try to obtain a new WorkerId again. If the latest WorkerId obtained and the current time are less than GetWorkerIdMinInterval, the Denied service +* RefreshTimestampInterval: default 500ms + > After selecting to enable the clock lock, when the obtained next time stamp and the most recent time stamp exceed RefreshTimestampInterval, the corresponding relationship between the current time stamp and WorkerId will be saved in Redis for subsequent use, reducing the need for the current system time dependence \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md new file mode 100644 index 000000000..0f9327495 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/README.zh-CN.md @@ -0,0 +1,37 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis + +Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis是基于`Masa.Contrib.Data.IdGenerator.Snowflake`的升级版,支持分布式部署,依赖于Redis提供WorkerId,支持在K8s下部署 + +## 用例: + +1. 安装`Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis`、 + + ```c# + Install-Package Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis + ``` + +2. 使用`Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis` + + ``` C# + builder.Services.AddSnowflake(option => option.UseRedis()); + ``` + + > 由于依赖Redis,需使用[Masa.Utils.Caching.Redis](https://github.com/masastack/MASA.Utils/tree/main/src/Caching/Masa.Utils.Caching.Redis) + +3. 获取id + + ``` + ISnowflakeGenerator generator;// 通过DI获取,或者通过IdGeneratorFactory.SnowflakeGenerator获取 + generator.NewId();//创建唯一id + ``` + +### 参数: + +* IdleTimeOut: 闲置回收时间,默认: 120000ms (2min),当无可用的WorkerId后会尝试从历史使用的WorkerId集合中获取活跃时间超过IdleTimeOut的WorkerId,并选取距离现在最远的一个WorkerId进行复用 +* GetWorkerIdMinInterval: 获取WorkerId的时间间隔,默认: 5000ms (5s) + > 当前WorkerId可用时,会将WorkerId直接返回,不会有任何限制 + > 当服务刷新WorkerId失败,并持续时间超过指定时间后,会自动释放WorkerId,当再次获取新的Id时,会尝试重新获取新的WorkerId,若最近一次获取WorkerId时间与当前时间小于GetWorkerIdMinInterval时,会被拒绝提供服务 +* RefreshTimestampInterval: 默认500ms + > 选择启用时钟锁后,当获取到下次的时间戳与最近一次的时间戳超过RefreshTimestampInterval时,会将当前的时间戳与WorkerId对应关系保存在Redis中,用于后续继续使用,减少对当前系统时间的依赖 \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs new file mode 100644 index 000000000..e69f3df50 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis/_Imports.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Internal; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Redis; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using StackExchange.Redis; +global using System.Globalization; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs new file mode 100644 index 000000000..5815d83ab --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/BaseIdGenerator.cs @@ -0,0 +1,109 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake; + +public abstract class BaseIdGenerator +{ + private readonly IWorkerProvider _workerProvider; + + /// + /// start timestamp + /// + protected long Twepoch { get; } + + /// + /// milliseconds: 1 + /// seconds: 2 + /// + protected TimestampType TimestampType { get; } + + protected long MaxCallBackTime { get; } + + /// + /// sequence mask, used to limit the sequence maximum + /// + protected long SequenceMask { get; } + + protected int SequenceBits { get; } + + /// + /// Timestamp shift offset bits + /// + protected int TimestampLeftShift { get; } + + /// + /// Sequence within milliseconds + /// + protected long Sequence { get; set; } + + /// + /// The last time the ID was generated + /// + protected long LastTimestamp { get; set; } = -1L; + + protected object Lock { get; } = new(); + + public BaseIdGenerator(IWorkerProvider workerProvider, IdGeneratorOptions idGeneratorOptions) + { + _workerProvider = workerProvider; + TimestampType = idGeneratorOptions.TimestampType; + MaxCallBackTime = idGeneratorOptions.MaxCallBackTime; + Twepoch = new DateTimeOffset(idGeneratorOptions.BaseTime).ToUnixTimeMilliseconds(); + SequenceMask = ~(-1 << idGeneratorOptions.SequenceBits); + SequenceBits = idGeneratorOptions.SequenceBits; + TimestampLeftShift = idGeneratorOptions.SequenceBits + idGeneratorOptions.WorkerIdBits; + } + + public virtual long NewId() + { + lock (Lock) + { + var currentTimestamp = GetCurrentTimestamp(); + + if (currentTimestamp < LastTimestamp) + { + var res = TimeCallBack(currentTimestamp); + + if (res.Support) LastTimestamp = res.LastTimestamp; + else + throw new Exception( + $"InvalidSystemClock: Clock moved backwards, Refusing to generate id for {LastTimestamp - currentTimestamp} milliseconds"); + } + + if (LastTimestamp == currentTimestamp) + { + Sequence = (Sequence + 1) & SequenceMask; + if (Sequence == 0) currentTimestamp = TilNextMillis(LastTimestamp); + } + else + { + Sequence = 0; + } + + LastTimestamp = currentTimestamp; + + return NextId(currentTimestamp - Twepoch); + } + } + + protected virtual (bool Support, long LastTimestamp) TimeCallBack(long currentTimestamp) => (false, 0); + + protected virtual long NextId(long deltaSeconds) + { + return (deltaSeconds << TimestampLeftShift) + | (GetWorkerId() << SequenceBits) + | Sequence; + } + + protected virtual long TilNextMillis(long lastTimestamp) + { + var timestamp = GetCurrentTimestamp(); + while (timestamp <= lastTimestamp) timestamp = GetCurrentTimestamp(); + return timestamp; + } + + protected virtual long GetWorkerId() => _workerProvider.GetWorkerIdAsync().ConfigureAwait(false).GetAwaiter().GetResult(); + + protected long GetCurrentTimestamp() => new DateTimeOffset(DateTime.UtcNow).GetTimestamp(TimestampType); +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs new file mode 100644 index 000000000..a40f2d357 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/DefaultWorkerProvider.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake; + +public sealed class DefaultWorkerProvider : IWorkerProvider +{ + private readonly long _workerId; + + public DefaultWorkerProvider() + { + _workerId = EnironmentExtensions.GetEnvironmentVariable(Const.DEFAULT_WORKER_ID_KEY) ?? 0; + } + + public Task GetWorkerIdAsync() => Task.FromResult(_workerId); + + public Task RefreshAsync() => Task.CompletedTask; + + public Task LogOutAsync() => Task.CompletedTask; +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs new file mode 100644 index 000000000..88a398d73 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/IWorkerProvider.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake; + +public interface IWorkerProvider +{ + /// + /// Working machine id + /// + Task GetWorkerIdAsync(); + + /// + /// Refresh workid activity status + /// + /// + Task RefreshAsync(); + + /// + /// logout workid active status + /// + /// + Task LogOutAsync(); +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs new file mode 100644 index 000000000..4c8162e79 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/IdGeneratorOptions.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake; + +public class IdGeneratorOptions +{ + public IServiceCollection Services { get;} + + /// + /// Baseline time, it is not recommended to change after use to avoid duplicate ids + /// + public DateTime BaseTime { get; set; } = new(2020, 1, 1, 0, 0, 0, DateTimeKind.Utc); + + /// + /// The number of digits the sequence occupies in the id + /// default: 10 + /// + public int SequenceBits { get; set; } = 12; + + /// + /// The number of digits occupied by the working machines in the id + /// + public int WorkerIdBits { get; set; } = 10; + + public TimestampType TimestampType { get; set; } = TimestampType.Milliseconds; + + /// + /// When the machine clock is enabled, the timestamp is meaningless + /// After the machine clock is enabled, the timestamp will be meaningless. + /// The time when the project first obtains the id is used as the starting time, which is not affected by the clock callback. + /// + public bool EnableMachineClock { get; set; } = false; + + /// + /// Maximum acceptable callback duration, default 3000ms(3s) + /// + public long MaxCallBackTime { get; set; } = 3000; + + /// + /// Whether to support distributed id + /// + public bool SupportDistributed { get; private set; } + + /// + /// WorkerId check interval(Suitable for distributed deployment) + /// + public int HeartbeatInterval { get; set; } = Const.DEFAULT_HEARTBEAT_INTERVAL; + + /// + /// The maximum expiration time. When the new WorkerId is not obtained after this time, the WorkerId of the current service will be cancelled. + /// + public int MaxExpirationTime { get; set; } = Const.DEFAULT_EXPIRATION_TIME; + + /// + /// Maximum supported worker machine id + /// + public long MaxWorkerId => ~(-1L << WorkerIdBits); + + public void EnableSupportDistributed() => SupportDistributed = true; + + public IdGeneratorOptions(IServiceCollection services) + { + Services = services; + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs new file mode 100644 index 000000000..daea77545 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/Const.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; + +internal class Const +{ + /// + /// Default working cluster idkey + /// + public const string DEFAULT_WORKER_ID_KEY = "WORKER_ID"; + + /// + /// By default, the status of the workid is refreshed every 3 seconds to ensure that the workid will not be removed. + /// default: 3s + /// + public const int DEFAULT_HEARTBEAT_INTERVAL = 3 * 1000; + + /// + /// If the interval for failure to obtain WorkerId exceeds 10s + /// it is considered that the current service cannot provide a valid WorkerId + /// and the use is temporarily stopped. + /// default: 10s + /// + public const int DEFAULT_EXPIRATION_TIME = 10 * 1000; +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs new file mode 100644 index 000000000..94360c2fe --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/EnironmentExtensions.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; + +internal class EnironmentExtensions +{ + public static int? GetEnvironmentVariable(string variable) + { + var environmentVariable = Environment.GetEnvironmentVariable(variable); + if (string.IsNullOrEmpty(environmentVariable)) + return null; + + return int.Parse(environmentVariable); + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs new file mode 100644 index 000000000..98ecc198a --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeExtensions.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; + +internal static class SnowflakeExtensions +{ + /// + /// get timestamp + /// + /// + /// Timestamp type: milliseconds: 1, seconds: 2 + /// + public static long GetTimestamp(this DateTimeOffset dateTimeOffset, TimestampType timestampType) + { + if (timestampType == TimestampType.Milliseconds) + return dateTimeOffset.ToUnixTimeMilliseconds(); + + return dateTimeOffset.ToUnixTimeSeconds(); + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs new file mode 100644 index 000000000..0cf96aabf --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/SnowflakeIdGenerator.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; + +public class SnowflakeIdGenerator : BaseIdGenerator, ISnowflakeGenerator +{ + public SnowflakeIdGenerator(IWorkerProvider workerProvider, IdGeneratorOptions idGeneratorOptions) + : base(workerProvider, idGeneratorOptions) + { + } + + protected override (bool Support, long LastTimestamp) TimeCallBack(long currentTimestamp) + { + if ((TimestampType == TimestampType.Milliseconds && LastTimestamp - currentTimestamp <= MaxCallBackTime) || + (TimestampType == TimestampType.Seconds && LastTimestamp - currentTimestamp <= Math.Floor(MaxCallBackTime / 1000m))) + return (true, TilNextMillis(LastTimestamp)); + + return (false, 0); + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs new file mode 100644 index 000000000..8ddce1b9d --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Internal/WorkerIdBackgroundServices.cs @@ -0,0 +1,74 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Internal; + +internal class WorkerIdBackgroundServices : BackgroundService +{ + private readonly int _heartbeatInterval; + private readonly int _maxExpirationTime; + private readonly IWorkerProvider _workerProvider; + private readonly ILogger? _logger; + private bool _isAvailable; + private DateTime? _firstFailedTime; + + public WorkerIdBackgroundServices(int heartbeatInterval, int maxExpirationTime, IWorkerProvider workerProvider, + ILogger? logger) + { + _heartbeatInterval = heartbeatInterval; + _maxExpirationTime = maxExpirationTime; + _workerProvider = workerProvider; + _logger = logger; + } + + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + if (stoppingToken.IsCancellationRequested) + { + await _workerProvider.LogOutAsync(); + } + else + { + while (true) + { + try + { + if (_isAvailable) + await _workerProvider.RefreshAsync(); + else + await _workerProvider.GetWorkerIdAsync(); //Get new WorkerId + + _firstFailedTime = null; + _isAvailable = true; + } + catch (Exception ex) + { + _firstFailedTime ??= DateTime.UtcNow; + if (_firstFailedTime != null && (DateTime.UtcNow - _firstFailedTime.Value).TotalMilliseconds > _maxExpirationTime) + { + _isAvailable = false; + _logger?.LogWarning(_isAvailable ? + "----- Logout WorkerId, Failed to refresh WorkerId, error reason: {Error}, current time: {CurrentTime}" : + "----- Logout WorkerId, Failed to get new WorkerId, error reason: {Error}, current time: {CurrentTime}", + ex, + DateTime.UtcNow); + + await _workerProvider.LogOutAsync(); + } + else + { + _logger?.LogWarning( + _isAvailable ? "Failed to refresh WorkerId, error reason: {Error}, current time: {CurrentTime}" : + "Failed to get new WorkerId, error reason: {Error}, current time: {CurrentTime}", + ex, + DateTime.UtcNow); + } + } + finally + { + await Task.Delay(_heartbeatInterval, stoppingToken); + } + } + } + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs new file mode 100644 index 000000000..4c6e41bff --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/MachineClockIdGenerator.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake; + +public class MachineClockIdGenerator : BaseIdGenerator, ISnowflakeGenerator +{ + public MachineClockIdGenerator(IWorkerProvider workerProvider, IdGeneratorOptions idGeneratorOptions) + : base(workerProvider, idGeneratorOptions) + { + LastTimestamp = GetCurrentTimestamp(); + } + + public override long NewId() + { + lock (Lock) + { + var timestamp = LastTimestamp; + Sequence = (Sequence + 1) & SequenceMask; + if (Sequence == 0) timestamp = TilNextMillis(LastTimestamp); + + LastTimestamp = timestamp; + + return NextId(timestamp - Twepoch); + } + } + + protected override long TilNextMillis(long lastTimestamp) => lastTimestamp + 1; +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj new file mode 100644 index 000000000..80ee06a61 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/README.md b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/README.md new file mode 100644 index 000000000..e48dd4cfb --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/README.md @@ -0,0 +1,113 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.IdGenerator.Snowflake + +Masa.Contrib.Data.IdGenerator.Snowflake is an id constructor based on snowflake id, providing a unique identifier of long type + +## Example: + +1. Install `Masa.Contrib.Data.IdGenerator.Snowflake` + + ````c# + Install-Package Masa.Contrib.Data.IdGenerator.Snowflake + ```` + +2. Using `Masa.Contrib.Data.IdGenerator.Snowflake` + + ```` C# + builder.Services.AddSnowflake(); + ```` + +3. Set the value of WorkerId for the current service, add the value of the environment variable `WORKER_ID`, the range is: 0-1023 (2^MaxWorkerId-1) + +4. Get Id + + ```` + ISnowflakeGenerator generator;// Get it through DI, or get it through IdGeneratorFactory.SnowflakeGenerator + generator.NewId();//Create a unique id + ```` + +### Parameters and FAQs: + +* Parameter Description + * BaseTime: Base time, less than current time (time zone: UTC +0) + > It is recommended to choose a fixed time that is closer to now. Once used, it cannot be changed (changes may lead to: duplicate id) + * SequenceBits: serial number, default: 12, support 0-4095 (2^12-1) + > 4095 requests per worker per millisecond + * WorkerIdBits: Worker machine id, default: 10, supports 0-1023 machines (2^10-1) + > By default, it is not supported to be used in k8s clusters. The WorkerId obtained by multiple copies in a Pod is the same, and there may be duplicate IDs. + * EnableMachineClock: enable clock lock, default: false + > After enabling the clock lock, the generated id no longer has an absolute relationship with the current time. The generated id takes the time when the project was started as the initial time, and the clock callback after the project runs will not affect the generation of the id + * The value of WorkerId is obtained from the environment variable `WORKER_ID` by default, if not set, it will return 0 + > When deploying on multiple machines, please ensure that the WorkerId of each service is unique + * TimestampType: Timestamp type, default: 1 (milliseconds: Milliseconds, seconds: Seconds) + > When TimestampType is Milliseconds, the maximum length of SequenceBits + WorkerIdBits is 22 + > + > When TimestampType is Seconds, the maximum length of SequenceBits + WorkerIdBits is 31 +* When distributed deployment + * SupportDistributed: supports distributed deployment, default: false (assigned by the class library provided by WorkerId) + * HeartbeatInterval: Heartbeat interval, default: 3000ms + > Used to periodically check the status of the refresh service to ensure that the WorkerId will not be recycled + * MaxExpirationTime: Maximum expiration time: Default: 10000ms + > When the refresh service status fails, check that the time difference between the current time and the first refresh service failure exceeds the maximum expiration time, actively give up the current WorkerId, and refuse to provide the service for generating id until a new WorkerId can be obtained and then provide it again Serve + * MaxCallBackTime: maximum callback time, default: 3000 (milliseconds) + > When the clock lock is not enabled, if the time callback is less than MaxCallBackTime, the id will be generated again after the waiting time is greater than the last time the id was generated. If it is greater than the maximum callback time, an exception will be thrown + +### Performance Testing + +1. TimestampType is 1 (milliseconds) + `BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) + 11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores + .NET SDK=7.0.100-preview.4.22252.9 + [Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT DEBUG + Job-JPQDWN : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT + Job-BKJUSV : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT + Job-UGZQME : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` + +`Runtime=.NET 6.0 RunStrategy=ColdStart` + +| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | +|----------------------- |----------- |--------------- |-----------:|----------:|-----------:|-----------:|-----------:|-------------:| +| SnowflakeByMillisecond | Job-JPQDWN | 1000 | 2,096.1 ns | 519.98 ns | 4,982.3 ns | 1,900.0 ns | 1,000.0 ns | 156,600.0 ns | +| SnowflakeByMillisecond | Job-BKJUSV | 10000 | 934.0 ns | 58.44 ns | 1,775.5 ns | 500.0 ns | 200.0 ns | 161,900.0 ns | +| SnowflakeByMillisecond | Job-UGZQME | 100000 | 474.6 ns | 5.54 ns | 532.8 ns | 400.0 ns | 200.0 ns | 140,500.0 ns | + +2. TimestampType is 2 (seconds) + +`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) +11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores +.NET SDK=7.0.100-preview.4.22252.9 +[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-RVUKKG : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-JAUDMW : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-LOMSTK : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` + +`Runtime=.NET 6.0 RunStrategy=ColdStart` + +| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | +|------------------ |----------- |--------------- |----------:|-----------:|-------------:|----------:|----------:|-------------:| +| SnowflakeBySecond | Job-RVUKKG | 1000 | 1.882 us | 0.5182 us | 4.965 us | 1.5000 us | 0.9000 us | 158.0 us | +| SnowflakeBySecond | Job-JAUDMW | 10000 | 11.505 us | 35.1131 us | 1,066.781 us | 0.4000 us | 0.3000 us | 106,678.8 us | +| SnowflakeBySecond | Job-LOMSTK | 100000 | 22.097 us | 15.0311 us | 1,444.484 us | 0.4000 us | 0.2000 us | 118,139.7 us | + +3. TimestampType is 1 (milliseconds), enable clock lock + +`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) +11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores +.NET SDK=7.0.100-preview.4.22252.9 +[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-BBZSDR : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-NUSWYF : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-FYICRN : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` + +`Runtime=.NET 6.0 RunStrategy=ColdStart` + +| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | +|-------------------------- |----------- |--------------- |-----------:|----------:|-----------:|-----------:|------------:|-------------:| +| MachineClockByMillisecond | Job-BBZSDR | 1000 | 1,502.0 ns | 498.35 ns | 4,775.1 ns | 1,100.0 ns | 700.0000 ns | 151,600.0 ns | +| MachineClockByMillisecond | Job-NUSWYF | 10000 | 602.0 ns | 54.76 ns | 1,663.7 ns | 200.0 ns | 100.0000 ns | 145,400.0 ns | +| MachineClockByMillisecond | Job-FYICRN | 100000 | 269.8 ns | 5.64 ns | 542.4 ns | 200.0 ns | 0.0000 ns | 140,900.0 ns | + +### Notice: + +The snowflake id algorithm relies heavily on time. Even after the clock lock is enabled, the project still needs to obtain the current time as the reference time at startup. If the initial acquisition time obtained is an expired time, the generated id may still be repeated. \ No newline at end of file diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md new file mode 100644 index 000000000..4071aa952 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/README.zh-CN.md @@ -0,0 +1,115 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.IdGenerator.Snowflake + +Masa.Contrib.Data.IdGenerator.Snowflake是一个基于雪花id的id构造器,提供long类型的唯一标识 + +## 用例: + +1. 安装`Masa.Contrib.Data.IdGenerator.Snowflake` + + ```c# + Install-Package Masa.Contrib.Data.IdGenerator.Snowflake + ``` + +2. 使用`Masa.Contrib.Data.IdGenerator.Snowflake` + + ``` C# + builder.Services.AddSnowflake(); + ``` + +3. 为当前服务设置WorkerId的值,添加环境变量`WORKER_ID`的值,其范围为:0-1023 (2^MaxWorkerId-1) + +4. 获取Id + + ``` + ISnowflakeGenerator generator;// 通过DI获取,或者通过IdGeneratorFactory.SnowflakeGenerator获取 + generator.NewId();//创建唯一id + ``` + +### 参数及常见问题: + +* 参数说明 + * BaseTime: 基准时间,小于当前时间(时区:UTC +0) + > 建议选用现在更近的固定时间,一经使用,不可更变(更改可能导致: 重复id) + * SequenceBits: 序列号, 默认: 12,支持0-4095 (2^12-1) + > 每毫秒每个工作机器最多产生4095个请求 + * WorkerIdBits: 工作机器id,默认: 10,支持0-1023个机器 (2^10-1) + > 默认不支持在k8s集群中使用,在一个Pod中多副本获取到的WorkerId是一样的,可能会出现重复id + * EnableMachineClock: 启用时钟锁,默认: false + > 启用时钟锁后,生成的id不再与当前时间有绝对关系,生成的id以项目启动时的时间作为初始时间,项目运行后时钟回拨不会影响id的生成 + * WorkerId的值默认从环境变量`WORKER_ID`中获取,如未设置则会返回0 + > 多机部署时请确保每个服务的WorkerId是唯一的 + * TimestampType: 时间戳类型,默认: 1 (毫秒: Milliseconds, 秒: Seconds) + > TimestampType为Milliseconds时,SequenceBits + WorkerIdBits 最大长度为22 + > + > TimestampType为Seconds时,SequenceBits + WorkerIdBits 最大长度为31 + * MaxCallBackTime: 最大回拨时间,默认: 3000 (毫秒) + > 当不启用时钟锁时,如果出现时间回拨小于MaxCallBackTime,则会等待时间大于最后一次生成id的时间后,再次生成id,如果大于最大回拨时间,则会抛出异常 + +* 分布式部署时 + * SupportDistributed: 支持分布式部署,默认: false (由WorkerId的提供类库赋值) + * HeartbeatInterval: 心跳周期,默认: 3000ms + > 用于定期检查刷新服务的状态,确保WorkerId不会被回收 + * MaxExpirationTime: 最大过期时间: 默认: 10000ms + > 当刷新服务状态失败时,检查当前时间与第一次刷新服务失败的时间差超过最大过期时间后,主动放弃当前的WorkerId,并拒绝提供生成id的服务,直到可以获取到新的WokerId后再次提供服务 + +### 性能测试 + +1. TimestampType为1(毫秒) + +`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) +11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores +.NET SDK=7.0.100-preview.4.22252.9 +[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT DEBUG +Job-JPQDWN : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-BKJUSV : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-UGZQME : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` + +`Runtime=.NET 6.0 RunStrategy=ColdStart` + +| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | +|----------------------- |----------- |--------------- |-----------:|----------:|-----------:|-----------:|-----------:|-------------:| +| SnowflakeByMillisecond | Job-JPQDWN | 1000 | 2,096.1 ns | 519.98 ns | 4,982.3 ns | 1,900.0 ns | 1,000.0 ns | 156,600.0 ns | +| SnowflakeByMillisecond | Job-BKJUSV | 10000 | 934.0 ns | 58.44 ns | 1,775.5 ns | 500.0 ns | 200.0 ns | 161,900.0 ns | +| SnowflakeByMillisecond | Job-UGZQME | 100000 | 474.6 ns | 5.54 ns | 532.8 ns | 400.0 ns | 200.0 ns | 140,500.0 ns | + +2. TimestampType为2(秒) + +`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) +11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores +.NET SDK=7.0.100-preview.4.22252.9 +[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-RVUKKG : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-JAUDMW : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-LOMSTK : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` + +`Runtime=.NET 6.0 RunStrategy=ColdStart` + +| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | +|------------------ |----------- |--------------- |----------:|-----------:|-------------:|----------:|----------:|-------------:| +| SnowflakeBySecond | Job-RVUKKG | 1000 | 1.882 us | 0.5182 us | 4.965 us | 1.5000 us | 0.9000 us | 158.0 us | +| SnowflakeBySecond | Job-JAUDMW | 10000 | 11.505 us | 35.1131 us | 1,066.781 us | 0.4000 us | 0.3000 us | 106,678.8 us | +| SnowflakeBySecond | Job-LOMSTK | 100000 | 22.097 us | 15.0311 us | 1,444.484 us | 0.4000 us | 0.2000 us | 118,139.7 us | + +3. TimestampType为1(毫秒)、启用时钟锁 + +`BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) +11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores +.NET SDK=7.0.100-preview.4.22252.9 +[Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-BBZSDR : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-NUSWYF : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT +Job-FYICRN : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT` + +`Runtime=.NET 6.0 RunStrategy=ColdStart` + +| Method | Job | IterationCount | Mean | Error | StdDev | Median | Min | Max | +|-------------------------- |----------- |--------------- |-----------:|----------:|-----------:|-----------:|------------:|-------------:| +| MachineClockByMillisecond | Job-BBZSDR | 1000 | 1,502.0 ns | 498.35 ns | 4,775.1 ns | 1,100.0 ns | 700.0000 ns | 151,600.0 ns | +| MachineClockByMillisecond | Job-NUSWYF | 10000 | 602.0 ns | 54.76 ns | 1,663.7 ns | 200.0 ns | 100.0000 ns | 145,400.0 ns | +| MachineClockByMillisecond | Job-FYICRN | 100000 | 269.8 ns | 5.64 ns | 542.4 ns | 200.0 ns | 0.0000 ns | 140,900.0 ns | + +### 注意: + +雪花id算法严重依赖时间,哪怕是启用时钟锁后,项目在启动时仍然需要获取一次当前时间作为基准时间,如果获取到的初始获取时间为已经过期的时间,那生成的id仍然有重复的可能 diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..a85f95745 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/ServiceCollectionExtensions.cs @@ -0,0 +1,75 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddSnowflake(this IServiceCollection services) + => services.AddSnowflake(null); + + public static IServiceCollection AddSnowflake(this IServiceCollection services, Action? options) + { + var idGeneratorOptions = new IdGeneratorOptions(services); + options?.Invoke(idGeneratorOptions); + + services.TryAddSingleton(); + + CheckIdGeneratorOptions(services, idGeneratorOptions); + + services.TryAddSingleton>(serviceProvider + => serviceProvider.GetRequiredService()); + if (idGeneratorOptions.EnableMachineClock) + { + services.TryAddSingleton(serviceProvider + => new MachineClockIdGenerator(serviceProvider.GetRequiredService(), idGeneratorOptions)); + } + else + { + services.TryAddSingleton(serviceProvider + => new SnowflakeIdGenerator(serviceProvider.GetRequiredService(), + idGeneratorOptions)); + } + + if (idGeneratorOptions.SupportDistributed) + { + services.Add(ServiceDescriptor.Singleton(serviceProvider + => new WorkerIdBackgroundServices( + idGeneratorOptions.HeartbeatInterval, + idGeneratorOptions.MaxExpirationTime, + serviceProvider.GetRequiredService(), + serviceProvider.GetService>() + ))); + } + IdGeneratorFactory.SetSnowflakeGenerator(services.BuildServiceProvider().GetRequiredService()); + return services; + } + + private static TService GetInstance(this IServiceCollection services) where TService : notnull => + services.BuildServiceProvider().GetRequiredService(); + + private static void CheckIdGeneratorOptions(IServiceCollection services, IdGeneratorOptions generatorOptions) + { + if (generatorOptions.BaseTime > DateTime.UtcNow) + throw new ArgumentOutOfRangeException(nameof(generatorOptions.BaseTime), + $"{nameof(generatorOptions.BaseTime)} must not be greater than the current time"); + + if (generatorOptions.SupportDistributed) + { + if (generatorOptions.HeartbeatInterval < 100) + throw new ArgumentOutOfRangeException($"{nameof(generatorOptions.HeartbeatInterval)} must be greater than 100"); + } + else + { + long workerId = GetInstance(services).GetWorkerIdAsync().ConfigureAwait(false).GetAwaiter().GetResult(); + if (workerId > generatorOptions.MaxWorkerId) + throw new ArgumentOutOfRangeException( + $"workerId must be greater than 0 or less than or equal to {generatorOptions.MaxWorkerId}"); + } + + var maxLength = generatorOptions.TimestampType == TimestampType.Milliseconds ? 22 : 31; + if (generatorOptions.SequenceBits + generatorOptions.WorkerIdBits > maxLength) + throw new ArgumentOutOfRangeException( + $"The sum of {nameof(generatorOptions.WorkerIdBits)} And {nameof(generatorOptions.SequenceBits)} must be less than {maxLength}"); + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs new file mode 100644 index 000000000..4e0eab734 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Masa.Contrib.Data.IdGenerator.Snowflake/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.Contrib.Data.IdGenerator.Snowflake; +global using Masa.Contrib.Data.IdGenerator.Snowflake.Internal; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Hosting; +global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs new file mode 100644 index 000000000..f9899456b --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs @@ -0,0 +1,59 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks; + +[MarkdownExporter, AsciiDocExporter, HtmlExporter] +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 1000)] +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 10000)] +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100000)] +[MinColumn, MaxColumn, MeanColumn, MedianColumn] +public class Benchmarks +{ + private IIdGenerator _idGenerator; + private IIdGenerator _idGeneratorBySecond; + private IIdGenerator _idGeneratorByEnableMachineClock; + private IIdGenerator _idGeneratorBySecondAndEnableMachineClock; + + [GlobalSetup] + public void GlobalSetup() + { + _idGenerator = InitializeIdGenerator(services => services.AddSnowflake()); + _idGeneratorBySecond = + InitializeIdGenerator(services => services.AddSnowflake(options => options.TimestampType = TimestampType.Seconds)); + _idGeneratorByEnableMachineClock = + InitializeIdGenerator(services => services.AddSnowflake(options => options.EnableMachineClock = true)); + _idGeneratorBySecondAndEnableMachineClock = + InitializeIdGenerator(services => services.AddSnowflake(options => + { + options.EnableMachineClock = true; + options.TimestampType = TimestampType.Seconds; + })); + } + + private IIdGenerator InitializeIdGenerator(Action action) + { + IServiceCollection services = new ServiceCollection(); + action.Invoke(services); + var serviceProvider = services.BuildServiceProvider(); + var idGenerator = serviceProvider.GetRequiredService>(); + idGenerator.NewId(); + return idGenerator; + } + + [Benchmark(Baseline = true)] + public void SnowflakeByMillisecond() + => _idGenerator.NewId(); + + [Benchmark] + public void SnowflakeBySecond() + => _idGeneratorBySecond.NewId(); + + [Benchmark] + public void SnowflakeByMillisecondAndEnableMachineClock() + => _idGeneratorByEnableMachineClock.NewId(); + + [Benchmark] + public void SnowflakeBySecondAndEnableMachineClock() + => _idGeneratorBySecondAndEnableMachineClock.NewId(); +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj new file mode 100644 index 000000000..f20a5de76 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj @@ -0,0 +1,22 @@ + + + + Exe + net6.0 + AnyCPU + false + enable + false + enable + + + + + + + + + + + + diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs new file mode 100644 index 000000000..422680280 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks; + +class Program +{ + static void Main(string[] args) + { + var config = DefaultConfig.Instance + .AddValidator(ExecutionValidator.FailOnError) + .WithOptions(ConfigOptions.DisableOptimizationsValidator); + BenchmarkRunner.Run(config); + Console.ReadLine(); + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs new file mode 100644 index 000000000..1dda9dd1e --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using BenchmarkDotNet.Attributes; +global using BenchmarkDotNet.Configs; +global using BenchmarkDotNet.Engines; +global using BenchmarkDotNet.Jobs; +global using BenchmarkDotNet.Running; +global using BenchmarkDotNet.Validators; +global using Masa.BuildingBlocks.Data; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs new file mode 100644 index 000000000..f3a67128f --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks; + +/// +/// Only supports the use of Redis environment +/// +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 1000)] +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 10000)] +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100000)] +[MinColumn, MaxColumn, MeanColumn, MedianColumn] +public class DistributedBenchmarks +{ + private IIdGenerator _idGenerator; + + [GlobalSetup] + public void GlobalSetup() + { + IServiceCollection services = new ServiceCollection(); + services.AddMasaRedisCache(opt => + { + opt.Password = ""; + opt.DefaultDatabase = 2; + opt.Servers = new List() + { + new("127.0.0.1", 6379) + }; + }); + services.AddSnowflake(options => + { + options.UseRedis(); + options.EnableMachineClock = true; + }); + var serviceProvider = services.BuildServiceProvider(); + _idGenerator = serviceProvider.GetRequiredService>(); + _idGenerator.NewId(); + } + + [Benchmark] + public void Distributed() + { + _idGenerator.NewId(); + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj new file mode 100644 index 000000000..6d30766d2 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj @@ -0,0 +1,24 @@ + + + + Exe + net6.0 + AnyCPU + false + enable + false + enable + + + + + + + + + + + + + + diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs new file mode 100644 index 000000000..d8860fe0a --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks; + +class Program +{ + static void Main(string[] args) + { + var config = DefaultConfig.Instance + .AddValidator(ExecutionValidator.FailOnError) + .WithOptions(ConfigOptions.DisableOptimizationsValidator); + // BenchmarkRunner.Run(config); + Console.ReadLine(); + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs new file mode 100644 index 000000000..d9175cc2d --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using BenchmarkDotNet.Attributes; +global using BenchmarkDotNet.Configs; +global using BenchmarkDotNet.Engines; +global using BenchmarkDotNet.Jobs; +global using BenchmarkDotNet.Running; +global using BenchmarkDotNet.Validators; +global using Masa.BuildingBlocks.Data; +global using Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs new file mode 100644 index 000000000..316f17bcc --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/CustomDistributedWorkerProvider.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests; + +public class CustomDistributedWorkerProvider : DistributedWorkerProvider +{ + public CustomDistributedWorkerProvider(IDistributedCacheClient distributedCacheClient, + DistributedIdGeneratorOptions? distributedIdGeneratorOptions, + IOptions redisOptions, + ILogger? logger) + : base(distributedCacheClient, distributedIdGeneratorOptions, redisOptions, logger) + { + } + + protected override Task GetWorkerIdByLogOutAsync() + { + return Task.FromResult(null); + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs new file mode 100644 index 000000000..42def1c0a --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/IdGeneratorTest.cs @@ -0,0 +1,353 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests; + +[TestClass] +public class IdGeneratorTest +{ + private RedisCacheClient _redisCacheClient; + private IOptions _redisOptions; + + /// + /// Only supports local testing + /// + [TestInitialize] + public Task InitRedisDataAsync() + { + RedisConfigurationOptions redisConfigurationOptions = new() + { + Password = "", + DefaultDatabase = 2, + Servers = new List() + { + new("127.0.0.1", 6379) + } + }; + _redisOptions = Options.Create(redisConfigurationOptions); + var options = GetConfigurationOptions(_redisOptions.Value); + _redisCacheClient = new RedisCacheClient(options); + // var connection = await ConnectionMultiplexer.ConnectAsync(options); + // var db = connection.GetDatabase(options.DefaultDatabase ?? 0); + // db.KeyDelete("snowflake.current.workerid"); + // db.KeyDelete("snowflake.inuse.workerid"); + // db.KeyDelete("snowflake.logout.workerid"); + // db.KeyDelete("snowflake.get.workerid"); + return Task.CompletedTask; + } + + [TestMethod] + public void TestEnableMachineClock() + { + var services = new ServiceCollection(); + services.AddSnowflake(opt => + { + opt.EnableMachineClock = true; + }); + var serviceProvider = services.BuildServiceProvider(); + var idGenerator = serviceProvider.GetRequiredService>(); + int count = 1; + List ids = new(); + while (count < 500000) + { + var id = idGenerator.NewId(); + ids.Add(id); + count++; + } + + if (ids.Distinct().Count() != ids.Count) + throw new Exception("duplicate id"); + } + + [TestMethod] + public void TestDisableMachineClock() + { + var services = new ServiceCollection(); + services.AddSnowflake(); + var serviceProvider = services.BuildServiceProvider(); + var idGenerator = serviceProvider.GetRequiredService>(); + int count = 1; + List ids = new(); + while (count < 500000) + { + var id = idGenerator.NewId(); + ids.Add(id); + count++; + } + + if (ids.Distinct().Count() != ids.Count) + throw new Exception("duplicate id"); + } + + [TestMethod] + public void TestErrorBaseTimeReturnThrowArgumentOutOfRangeException() + { + var services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddSnowflake(options => + { + options.BaseTime = DateTime.UtcNow.AddHours(1); + }); + }); + } + + [TestMethod] + public void TestErrorWorkerIdReturnThrowArgumentOutOfRangeException() + { + long maxWorkerId = ~(-1L << 5); + long workerId = maxWorkerId + 1; + Environment.SetEnvironmentVariable("WORKER_ID", workerId.ToString()); + var services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddSnowflake(options => + { + options.WorkerIdBits = 5; + }); + }); + } + + [TestMethod] + public void TestErrorSequenceBitsReturnThrowArgumentOutOfRangeException() + { + var services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddSnowflake(options => + { + options.SequenceBits = 21; + options.WorkerIdBits = 2; + }); + }); + } + + [TestMethod] + public void TestErrorHeartbeatIntervalReturnThrowArgumentOutOfRangeException() + { + var services = new ServiceCollection(); + services.AddMasaRedisCache(opt => + { + opt.Password = ""; + opt.DefaultDatabase = 2; + opt.Servers = new List() + { + new("127.0.0.1", 6379) + }; + }); + Assert.ThrowsException(() => + { + services.AddSnowflake(options => + { + options.UseRedis(); + options.HeartbeatInterval = 99; + }); + }); + } + + /// + /// Only supports local testing + /// + [TestMethod] + public void TestDistributedSnowflake() + { + // var services = new ServiceCollection(); + // services.AddMasaRedisCache(opt => + // { + // opt.Password = ""; + // opt.DefaultDatabase = 2; + // opt.Servers = new List() + // { + // new("127.0.0.1", 6379) + // }; + // }); + // + // services.AddDistributedSnowflake(); + // var serviceProvider = services.BuildServiceProvider(); + // var idGenerator = serviceProvider.GetRequiredService>(); + // int count = 1; + // List ids = new(); + // while (count < 500000) + // { + // var id = idGenerator.Create(); + // ids.Add(id); + // count++; + // } + // + // if (ids.Distinct().Count() != ids.Count) + // throw new Exception("duplicate id"); + } + + /// + /// Only supports local testing + /// + [TestMethod] + public Task TestDistributedWorkerAsync() + { + // var services = new ServiceCollection(); + // services.AddMasaRedisCache(opt => + // { + // opt.Password = ""; + // opt.DefaultDatabase = 2; + // opt.Servers = new List() + // { + // new("127.0.0.1", 6379) + // }; + // }); + // + // services.AddDistributedSnowflake(distributedIdGeneratorOptions => + // { + // distributedIdGeneratorOptions.GetWorkerIdMinInterval = 0; + // }); + // + // var serviceProvider = services.BuildServiceProvider(); + // var workerIdProvider = serviceProvider.GetRequiredService(); + // List workerIds = new(); + // var maxWorkerId = ~(-1L << 10); + // for (int index = 0; index <= maxWorkerId; index++) + // { + // var workerId = await workerIdProvider.GetWorkerIdAsync(); + // await workerIdProvider.LogOutAsync(); + // workerIds.Add(workerId); + // } + // + // Assert.IsTrue(workerIds.Distinct().Count() == workerIds.Count && workerIds.Count == maxWorkerId + 1); + return Task.CompletedTask; + } + + /// + /// Only supports local testing + /// + [TestMethod] + public void TestDistributedWorkerAndEnableMachineClock() + { + // var services = new ServiceCollection(); + // services.AddMasaRedisCache(opt => + // { + // opt.Password = ""; + // opt.DefaultDatabase = 2; + // opt.Servers = new List() + // { + // new("127.0.0.1", 6379) + // }; + // }); + // + // services.AddDistributedSnowflake(distributedIdGeneratorOptions => + // { + // distributedIdGeneratorOptions.GetWorkerIdMinInterval = 0; + // distributedIdGeneratorOptions.EnableMachineClock = true; + // }); + // + // var serviceProvider = services.BuildServiceProvider(); + // var idGenerator = serviceProvider.GetRequiredService>(); + // var id = idGenerator.Create(); + // var maxSequenceBit = ~(-1L << 12); + // for (int i = 1; i < maxSequenceBit; i++) + // { + // var idTemp = idGenerator.Create(); + // Assert.IsTrue(i + id == idTemp); + // } + } + + /// + /// Only supports local testing + /// + [TestMethod] + public Task TestGetWorkerIdAsync() + { + // var workerIdProvider = GetWorkerProvider(); + // List workerIds = new(); + // var errCount = 0; + // var maxWorkerId = ~(-1L << 10); + // for (int index = 0; index <= maxWorkerId + 1; index++) + // { + // try + // { + // var workerId = await workerIdProvider.GetWorkerIdAsync(); + // await workerIdProvider.LogOutAsync(); + // workerIds.Add(workerId); + // } + // catch (MasaException ex) + // { + // errCount = 1; + // Assert.IsTrue(ex.Message == "No WorkerId available" && index == maxWorkerId + 1); + // } + // } + // Assert.IsTrue(workerIds.Count == maxWorkerId + 1); + // Assert.IsTrue(errCount == 1); + return Task.CompletedTask; + } + + /// + /// Only supports local testing + /// + [TestMethod] + public Task TestGetDistibutedLockFaieldAsync() + { + // var workerIdBits = 10; + // var maxWorkerId = ~(-1L << workerIdBits); + // var tasks = new ConcurrentBag(); + // ThreadPool.GetMinThreads(out _, out var minIoc); + // ThreadPool.SetMinThreads((int)maxWorkerId, minIoc); + // + // int laterTime = 0; + // try + // { + // Parallel.For(0, maxWorkerId * 2, i => + // { + // tasks.Add(GetWorkerIdAsync(null, workerIdBits)); + // }); + // await Task.WhenAll(tasks); + // } + // catch (Exception ex) + // { + // if (ex.Message.Contains("please try again later") || + // (ex.InnerException != null && ex.InnerException.Message.Contains("please try again later"))) + // { + // laterTime++; + // } + // } + // Assert.IsTrue(laterTime > 0); + return Task.CompletedTask; + } + + private Task GetWorkerIdAsync(IServiceCollection? services, int workerIdBits) + => GetWorkerProvider(services, workerIdBits).GetWorkerIdAsync(); + + private IWorkerProvider GetWorkerProvider(IServiceCollection? services, int workerIdBits = 10) + { + var idGeneratorOptions = new IdGeneratorOptions(services ?? new ServiceCollection()) + { + WorkerIdBits = workerIdBits + }; + DistributedIdGeneratorOptions distributedIdGeneratorOptions = new DistributedIdGeneratorOptions(idGeneratorOptions) + { + GetWorkerIdMinInterval = 0 + }; + return new CustomDistributedWorkerProvider(_redisCacheClient, distributedIdGeneratorOptions, _redisOptions, null); + } + + private ConfigurationOptions GetConfigurationOptions(RedisConfigurationOptions redisOptions) + { + var configurationOptions = new ConfigurationOptions + { + AbortOnConnectFail = redisOptions.AbortOnConnectFail, + AllowAdmin = redisOptions.AllowAdmin, + ChannelPrefix = redisOptions.ChannelPrefix, + ClientName = redisOptions.ClientName, + ConnectRetry = redisOptions.ConnectRetry, + ConnectTimeout = redisOptions.ConnectTimeout, + DefaultDatabase = redisOptions.DefaultDatabase, + Password = redisOptions.Password, + Proxy = redisOptions.Proxy, + Ssl = redisOptions.Ssl, + SyncTimeout = redisOptions.SyncTimeout + }; + + foreach (var server in redisOptions.Servers) + { + configurationOptions.EndPoints.Add(server.Host, server.Port); + } + return configurationOptions; + } +} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj new file mode 100644 index 000000000..25d273fb8 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + false + + + + + + + + + + + + + + diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs new file mode 100644 index 000000000..15da5bb58 --- /dev/null +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Masa.Contrib.Data.IdGenerator.Snowflake.Tests/_Imports.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Redis; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using StackExchange.Redis; +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Threading.Tasks; diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs new file mode 100644 index 000000000..ed893e326 --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMapper.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster; + +public class DefaultMapper : IMapper +{ + private readonly IMappingConfigProvider _provider; + + public DefaultMapper(IMappingConfigProvider provider) + => _provider = provider; + + public TDestination Map(TSource source, MapOptions? options = null) + { + ArgumentNullException.ThrowIfNull(source, nameof(source)); + + return source.Adapt(_provider.GetConfig(source.GetType(), typeof(TDestination), options)); + } + + public TDestination Map(object source, MapOptions? options = null) + { + ArgumentNullException.ThrowIfNull(source, nameof(source)); + + return source.Adapt(_provider.GetConfig(source.GetType(), typeof(TDestination), options)); + } + + public TDestination Map(TSource source, TDestination destination, MapOptions? options = null) + { + ArgumentNullException.ThrowIfNull(source, nameof(source)); + + Type destinationType = destination?.GetType() ?? typeof(TDestination); + return source.Adapt(destination, _provider.GetConfig(source.GetType(), destinationType, options)); + } +} diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs new file mode 100644 index 000000000..bf1136d5f --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/DefaultMappingConfigProvider.cs @@ -0,0 +1,187 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster; + +public class DefaultMappingConfigProvider : IMappingConfigProvider +{ + private readonly MemoryCache<(Type SourceType, Type DestinationType, MapOptions? MapOptions), TypeAdapterConfig?> _cache = new(); + + private readonly MapOptions _options; + + public DefaultMappingConfigProvider(MapOptions options) => _options = options; + + public TypeAdapterConfig GetConfig(Type sourceType, Type destinationType, MapOptions? options = null) + => GetConfigByCache(sourceType, destinationType, options); + + protected virtual TypeAdapterConfig GetConfigByCache(Type sourceType, Type destinationType, MapOptions? options) + { + TypeAdapterConfig? config = _cache.GetOrAdd( + (sourceType, destinationType, options), + type => GetAdapterConfig(type.SourceType, type.DestinationType, options)); + + return config ?? GetDefaultConfig(options); + } + + protected virtual TypeAdapterConfig? GetAdapterConfig(Type sourceType, Type destinationType, MapOptions? options) + { + TypeAdapterConfig adapterConfig = GetDefaultConfig(options); + + var mapTypes = GetMapAndSelectorTypes(adapterConfig, sourceType, destinationType, options, true); + + foreach (var item in mapTypes) + { + var methodExecutor = InvokeBuilder.Build(item.SourceType, item.DestinationType); + methodExecutor.Invoke(adapterConfig, item.Constructor); + } + + return IsShare(options) ? null : adapterConfig; //When in shared mode, Config returns empty to save memory space + } + + //todo: In the follow-up, according to the situation, consider whether the configuration requires Fork, which is not processed for the time being + private List GetMapTypes( + TypeAdapterConfig adapterConfig, + Type sourceType, + Type destinationType, + MapOptions? options) + { + if (!NeedAutomaticMap(sourceType, destinationType)) + return new List(); + + List mapTypes = new(); + var sourceProperties = sourceType.GetProperties().ToList(); + var destinationProperties = destinationType.GetProperties().ToList(); + + List destinationConstructors = destinationType + .GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) + .Where(c => c.GetParameters().Length <= sourceProperties.Count) + .OrderByDescending(c => c.GetParameters().Length) + .ToList(); + + MapTypeOptions mapTypeOption = new(sourceType, destinationType) + { + Constructor = GetBestConstructor(destinationConstructors, sourceProperties) + }; + if (!RuleMapIsExist(adapterConfig, sourceType, destinationType)) + { + mapTypes.Add(mapTypeOption); + } + + List<(string Name, Type DdestinationPropertyType)> destinationPropertyList = destinationProperties + .Select(p => (p.Name.ToLower(), p.PropertyType)) + .Concat(mapTypeOption.Constructor.GetParameters().Select(p => (p.Name!.ToLower(), p.ParameterType))!) + .Distinct() + .ToList(); + + foreach (var sourceProperty in sourceProperties) + { + if (!sourceProperty.CanRead) + continue; + + var destinationProperty = destinationPropertyList.FirstOrDefault(p + => p.Name.Equals(sourceProperty.Name, StringComparison.OrdinalIgnoreCase)); + if (destinationProperty != default) + { + var subMapTypes = GetMapAndSelectorTypes(adapterConfig, sourceProperty.PropertyType, + destinationProperty.DdestinationPropertyType, options, false); + + if (!subMapTypes.Any() || mapTypes.Any(option => subMapTypes.Any(subOption + => subOption.SourceType == option.SourceType && subOption.DestinationType == option.DestinationType))) + continue; + + mapTypes.AddRange(subMapTypes); + } + } + + return mapTypes; + } + + private List GetMapAndSelectorTypes(TypeAdapterConfig adapterConfig, Type sourceType, Type destinationType, + MapOptions? options, bool isFirst) + { + bool sourcePropertyIsEnumerable = IsCollection(sourceType); + bool destinationPropertyIsEnumerable = IsCollection(destinationType); + if (!sourcePropertyIsEnumerable && !destinationPropertyIsEnumerable) + { + var subMapTypes = GetMapTypes( + adapterConfig, + sourceType, + destinationType, + options); + if (subMapTypes.Any()) return subMapTypes; + } + else if (sourcePropertyIsEnumerable && destinationPropertyIsEnumerable) + { + var subMapTypes = GetMapTypes(adapterConfig, + sourceType.GetGenericArguments()[0], + destinationType.GetGenericArguments()[0], + options); + + if (subMapTypes.Any()) return subMapTypes; + } + return new(); + } + + protected virtual bool IsCollection(Type type) + => type.IsGenericType && type.GetInterfaces().Any(x => x.GetGenericTypeDefinition() == typeof(IEnumerable<>)); + + protected virtual ConstructorInfo GetBestConstructor(List destinationConstructors, List sourceProperties) + { + if (destinationConstructors.Count <= 1) + return destinationConstructors.First(); + + foreach (var constructor in destinationConstructors) + { + if (IsPreciseMatch(constructor, sourceProperties)) + return constructor; + } + + throw new Exception("Failed to get the best constructor"); + } + + protected virtual bool IsPreciseMatch(ConstructorInfo destinationConstructor, List sourceProperties) + { + foreach (var parameter in destinationConstructor.GetParameters()) + { + if (!sourceProperties.Any(p + => p.Name.Equals(parameter.Name, StringComparison.OrdinalIgnoreCase) && p.PropertyType == parameter.ParameterType)) + { + return false; + } + } + return true; + } + + protected virtual List NotNeedAutomaticMapTypes => new() + { + typeof(string) + }; + + protected virtual bool NeedAutomaticMap(Type sourceType, Type destinationType) + => sourceType.IsClass && + !IsCollection(sourceType) && + (sourceType != destinationType || (sourceType != typeof(object) || destinationType != typeof(object))) && + !NotNeedAutomaticMapTypes.Contains(sourceType); + + protected virtual bool RuleMapIsExist(TypeAdapterConfig adapterConfig, Type sourceType, Type destinationType) + => adapterConfig.RuleMap.Any(r => r.Key == new TypeTuple(sourceType, destinationType)); + + protected virtual bool IsShare(MapOptions? options) => (options?.Mode ?? _options.Mode) == MapMode.Shared; + + /// + /// Get initial configuration + /// When currently in shared mode, return the default global settings + /// + /// + protected virtual TypeAdapterConfig GetDefaultConfig(MapOptions? options) + { + //todo: Other modes are currently not supported, and will be added in the future according to the situation + switch (options?.Mode ?? _options.Mode) + { + case MapMode.Shared: + return TypeAdapterConfig.GlobalSettings; + default: + throw new ArgumentException("Only shared configuration is supported", nameof(MapOptions.Mode)); + } + } +} diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs new file mode 100644 index 000000000..60e9aa742 --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/IMappingConfigProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster; + +public interface IMappingConfigProvider +{ + TypeAdapterConfig GetConfig(Type sourceType, Type destinationType, MapOptions? options = null); +} diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs new file mode 100644 index 000000000..9ae65c460 --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/InvokeBuilder.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Internal; + +internal class InvokeBuilder +{ + private static readonly MethodInfo _newConfigMethodInfo; + private static readonly Type _typeAdapterConfigType; + + static InvokeBuilder() + { + var typeAdapterSetterExpandType = typeof(TypeAdapterSetterExpand); + _newConfigMethodInfo = typeAdapterSetterExpandType.GetMethod(nameof(TypeAdapterSetterExpand.NewConfigByConstructor))!; + _typeAdapterConfigType = typeof(TypeAdapterConfig); + } + + internal delegate TypeAdapterSetter MethodExecutor(TypeAdapterConfig target, object parameter); + + public static MethodExecutor Build( + Type sourceType, + Type destinationType) + { + var methodInfo = _newConfigMethodInfo.MakeGenericMethod(sourceType, destinationType); + + ParameterExpression[] parameters = + { + Expression.Parameter(_typeAdapterConfigType, "adapterConfigParameter"), + Expression.Parameter(typeof(object), "constructorInfoParameter") + }; + var newConfigMethodCall = Expression.Call( + null, + methodInfo, + parameters + ); + + var lambda = Expression.Lambda(newConfigMethodCall, parameters); + return lambda.Compile(); + } +} diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs new file mode 100644 index 000000000..7f93638c2 --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/Options/MapTypeOptions.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Internal.Options; + +internal class MapTypeOptions +{ + public Type SourceType { get; } = default!; + + public Type DestinationType { get; } = default!; + + public ConstructorInfo Constructor { get; set; } = default!; + + public MapTypeOptions(Type sourceType, Type destinationType) + { + SourceType = sourceType; + DestinationType = destinationType; + } +} diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs new file mode 100644 index 000000000..f119e2d95 --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Internal/TypeAdapterSetterExpand.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Internal; + +internal class TypeAdapterSetterExpand +{ + public static TypeAdapterSetter NewConfigByConstructor(TypeAdapterConfig adapterConfig, + object constructorInfo) + { + return adapterConfig + .NewConfig() + .MapToConstructor((constructorInfo as ConstructorInfo)!); + } +} diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj new file mode 100644 index 000000000..8c1319ee8 --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/Masa.Contrib.Data.Mapping.Mapster.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md new file mode 100644 index 000000000..c6bd1958c --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md @@ -0,0 +1,85 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.Mapping.Mapster + +Masa.Contrib.Data.Mapping.Mapster is an object-to-object mapper based on [Mapster](https://github.com/MapsterMapper/Mapster). It adds automatic acquisition and uses the best constructor mapping on the original basis. Nested mapping is supported to reduce the workload of mapping. + +## Mapping Rules + +* When the target object has no constructor: use an empty constructor, which maps to fields and properties. + +* Target object has multiple constructors: get the best constructor map + + > Best constructor: The number of parameters of the target object constructor is searched in descending order, the parameter names are the same (case-insensitive), and the parameter types are the same as the source object properties + +## Example: + +1. Install `Masa.Contrib.Data.Mapping.Mapster` + + ````c# + Install-Package Masa.Contrib.Data.Mapping.Mapster + ```` + +2. Using `Mapping` + + ```` C# + builder.Services.AddMapster(); + ```` + +3. Mapping objects + + ```` + IMapper mapper;// Get through DI + + var request = new + { + Name = "Teach you to learn Dapr...", + OrderItem = new OrderItem("Teach you to learn Dapr hand by hand", 49.9m) + }; + var order = mapper.Map(request);// Map the request to a new object, Parameters with the same attribute name and type of the source object and the target object will be automatically mapped, or the constructor parameter name (case-insensitive) and type of the target object are the same as those of the source object, and they will be mapped through the constructor + ```` + + Mapping class `Order`: + + ```` Order.cs + public class Order + { + public string Name { get; set; } + + public decimal TotalPrice { get; set; } + + public List OrderItems { get; set; } + + public Order(string name) + { + Name = name; + } + + public Order(string name, OrderItem orderItem) : this(name) + { + OrderItems = new List { orderItem }; + TotalPrice = OrderItems.Sum(item => item.Price * item.Number); + } + } + + public class OrderItem + { + public string Name { get; set; } + + public decimal Price { get; set; } + + public int Number { get; set; } + + public OrderItem(string name, decimal price) : this(name, price, 1) + { + + } + + public OrderItem(string name, decimal price, int number) + { + Name = name; + Price = price; + Number = number; + } + } + ```` \ No newline at end of file diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md new file mode 100644 index 000000000..3565a78ba --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md @@ -0,0 +1,86 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.Mapping.Mapster + +Masa.Contrib.Data.Mapping.Mapster是基于[Mapster](https://github.com/MapsterMapper/Mapster)的一个对象到对象的映射器,在原来的基础上增加自动获取并使用最佳构造函数映射,支持嵌套映射,减轻映射的工作量。 + +## 映射规则 + +* 目标对象没有构造函数时:使用空构造函数,映射到字段和属性。 + +* 目标对象存在多个构造函数:获取最佳构造函数映射 + + > 最佳构造函数: 目标对象构造函数参数数量从大到小降序查找,参数名称一致(不区分大小写)且参数类型与源对象属性一致 + +## 用例: + +1. 安装`Masa.Contrib.Data.Mapping.Mapster` + + ```c# + Install-Package Masa.Contrib.Data.Mapping.Mapster + ``` + +2. 使用`Mapping` + + ``` C# + builder.Services.AddMapster(); + ``` + +3. 映射对象 + + ``` + IMapper mapper;// 通过DI获取 + + var request = new + { + Name = "Teach you to learn Dapr ……", + OrderItem = new OrderItem("Teach you to learn Dapr hand by hand", 49.9m) + }; + var order = mapper.Map(request);// 将request映射到新的对象 + + ``` + + 映射类`Order`: + + ``` Order.cs + public class Order + { + public string Name { get; set; } + + public decimal TotalPrice { get; set; } + + public List OrderItems { get; set; } + + public Order(string name) + { + Name = name; + } + + public Order(string name, OrderItem orderItem) : this(name) + { + OrderItems = new List { orderItem }; + TotalPrice = OrderItems.Sum(item => item.Price * item.Number); + } + } + + public class OrderItem + { + public string Name { get; set; } + + public decimal Price { get; set; } + + public int Number { get; set; } + + public OrderItem(string name, decimal price) : this(name, price, 1) + { + + } + + public OrderItem(string name, decimal price, int number) + { + Name = name; + Price = price; + Number = number; + } + } + ``` \ No newline at end of file diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..80ae4839d --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/ServiceCollectionExtensions.cs @@ -0,0 +1,46 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddMapster(this IServiceCollection services) + => services.AddMapster(MapMode.Shared); + + public static IServiceCollection AddMapster(this IServiceCollection services, MapMode mode) + => services.AddMapster(new MapOptions() + { + Mode = mode + }); + + public static IServiceCollection AddMapster(this IServiceCollection services, MapOptions mapOptions) + { + if (services.Any(service => service.ImplementationType == typeof(MappingProvider))) + return services; + + services.AddSingleton(); + + services.TryAddSingleton(_ => new DefaultMappingConfigProvider(mapOptions)); + services.TryAddSingleton(); + + Mapper.Instance = new Mapper(services); + return services; + } + + [Obsolete("Use AddMapster instead")] + public static IServiceCollection AddMapping(this IServiceCollection services) + => services.AddMapster(MapMode.Shared); + + [Obsolete("Use AddMapster instead")] + public static IServiceCollection AddMapping(this IServiceCollection services, MapMode mode) + => services.AddMapster(mode); + + [Obsolete("Use AddMapster instead")] + public static IServiceCollection AddMapping(this IServiceCollection services, MapOptions mapOptions) + => services.AddMapster(mapOptions); + + private class MappingProvider + { + } +} diff --git a/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs new file mode 100644 index 000000000..0862034c5 --- /dev/null +++ b/src/Contrib/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/_Imports.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Mapster; +global using Mapster.Models; +global using Masa.BuildingBlocks.Data.Mapping; +global using Masa.BuildingBlocks.Data.Mapping.Options; +global using Masa.BuildingBlocks.Data.Mapping.Options.Enum; +global using Masa.Contrib.Data.Mapping.Mapster; +global using Masa.Contrib.Data.Mapping.Mapster.Internal; +global using Masa.Contrib.Data.Mapping.Mapster.Internal.Options; +global using Masa.Utils.Caching.Memory; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using System.Linq.Expressions; +global using System.Reflection; diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs new file mode 100644 index 000000000..5701ea8fe --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/BaseMappingTest.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests; + +[TestClass] +public class BaseMappingTest +{ + protected IServiceCollection _services; + protected IMapper _mapper = default!; + + [TestInitialize] + public void Initialize() + { + _services = new ServiceCollection(); + _services.AddMapster(); + var serviceProvider = _services.BuildServiceProvider(); + _mapper = serviceProvider.GetRequiredService(); + } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs new file mode 100644 index 000000000..cf21dff84 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/Order.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Orders; + +public class Order +{ + public Guid Id { get; set; } + + public string Name { get; set; } + + public decimal TotalPrice { get; set; } + + public List OrderItems { get; set; } + + private Order() + { + Id = Guid.NewGuid(); + } + + public Order(string name) : this() + { + Name = name; + } + + public Order(string name, OrderItem orderItem) : this(name, new List { orderItem }) + { + } + + public Order(string name, List orderItems) : this(name) + { + Name = name; + OrderItems = orderItems; + TotalPrice = orderItems.Sum(item => item.Price * item.Number); + } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs new file mode 100644 index 000000000..ff48919c7 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Orders/OrderItem.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Orders; + +public class OrderItem +{ + public string Name { get; set; } + + public decimal Price { get; set; } + + public int Number { get; set; } + + public OrderItem(string name, decimal price) : this(name, price, 1) + { + + } + + public OrderItem(string name, decimal price, int number) + { + Name = name; + Price = price; + Number = number; + } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs new file mode 100644 index 000000000..ac3609192 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/Aggregates/Users/User.cs @@ -0,0 +1,41 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Users; + +public class User +{ + public string Name { get; set; } + + public int Age { get; set; } + + public string Description { get; set; } + + public DateTime Birthday { get; set; } + + public AddressItem Hometown { get; set; } + + + public User() + { + + } + public User(string name) + { + Name = name; + } + + public User(string name, int age, string description, DateTime birthday) + : this(name) + { + Age = age; + Description = description; + Birthday = birthday; + } + + public User(string name, int age, string description, DateTime birthday, AddressItem hometown) + : this(name, age, description, birthday) + { + Hometown = hometown; + } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs new file mode 100644 index 000000000..b99b089b9 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Domain/ValueObjects/AddressItem.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.ValueObjects; + +public class AddressItem +{ + public string Province { get; set; } + + public string City { get; set; } + + public string Address { get; set; } + + public AddressItem(string fullAddress) : this(fullAddress.Split(',')[0], fullAddress.Split(',')[1], fullAddress.Split(',')[2]) + { + + } + + public AddressItem(string province, string city, string address) + { + Province = province; + City = city; + Address = address; + } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs new file mode 100644 index 000000000..5ac2153ee --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingExtensionsTest.cs @@ -0,0 +1,198 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests; + +[TestClass] +public class MappingExtensionsTest +{ + [TestInitialize] + public void Initialize() + { + var services = new ServiceCollection(); + services.AddMapster(); + } + + [TestMethod] + public void TestCreateUserRequestMapToUserReturnUserNameEqualRequestName() + { + var request = new CreateUserRequest() + { + Name = "Jim", + }; + var user = request.Map(); + Assert.IsNotNull(user); + Assert.IsTrue(user.Name == request.Name); + } + + [TestMethod] + public void TestObjectMapToUserReturnUserIsNotNull() + { + var request = new + { + Name = "Jim", + Age = 18, + Birthday = DateTime.Now, + Description = "i am jim" + }; + + var user = request.Map(); + Assert.IsNotNull(user); + Assert.AreEqual(request.Name, user.Name); + Assert.AreEqual(request.Age, user.Age); + Assert.AreEqual(request.Birthday, user.Birthday); + Assert.AreEqual(request.Description, user.Description); + } + + [TestMethod] + public void TestObjectMapToUserAndSourceParameterGreatherThanDestinationControllerParameterLength() + { + var request = new + { + Name = "Jim", + Age = 18, + Birthday = DateTime.Now, + Description = "i am jim", + Tag = Array.Empty() + }; + + var user = request.Map(); + Assert.IsNotNull(user); + Assert.AreEqual(request.Name, user.Name); + Assert.AreEqual(request.Age, user.Age); + Assert.AreEqual(request.Birthday, user.Birthday); + Assert.AreEqual(request.Description, user.Description); + } + + [TestMethod] + public void TestCreateFullUserRequestMapToUserReturnHometownIsNotNull() + { + var request = new CreateFullUserRequest() + { + Name = "Jim", + Age = 18, + Birthday = DateTime.Now, + Hometown = new AddressItemRequest() + { + Province = "BeiJing", + City = "BeiJing", + Address = "National Sport Stadium" + } + }; + + var user = request.Map(); + Assert.IsNotNull(user); + Assert.AreEqual(request.Name, user.Name); + Assert.AreEqual(request.Age, user.Age); + Assert.AreEqual(request.Birthday, user.Birthday); + Assert.AreEqual(request.Description, user.Description); + Assert.IsNotNull(request.Hometown); + Assert.AreEqual(request.Hometown.Province, user.Hometown.Province); + Assert.AreEqual(request.Hometown.City, user.Hometown.City); + Assert.AreEqual(request.Hometown.Address, user.Hometown.Address); + } + + [TestMethod] + public void TestOrderRequestMapToOrderReturnTotalPriceIs10() + { + var request = new OrderRequest() + { + Name = "orderName", + OrderItem = new OrderItem("apple", 10) + }; + + var order = request.Map(); + Assert.IsNotNull(order); + Assert.AreEqual(order.Name, request.Name); + Assert.AreEqual(order.OrderItems.Count, 1); + Assert.AreEqual(order.OrderItems[0].Name, request.OrderItem.Name); + Assert.AreEqual(order.OrderItems[0].Price, request.OrderItem.Price); + Assert.AreEqual(order.OrderItems[0].Number, 1); + Assert.AreEqual(order.TotalPrice, 1 * 10); + } + + [TestMethod] + public void TestOrderMultiRequestMapToOrderReturnOrderItemsCountIs1AndTotalPriceIs10() + { + var request = new + { + Name = "Order Name", + OrderItems = new List() + { + new("Apple", 10) + } + }; + + var order = request.Map(); + Assert.IsNotNull(order); + Assert.AreEqual(order.Name, request.Name); + Assert.AreEqual(order.OrderItems.Count, 1); + Assert.AreEqual(order.OrderItems[0].Name, request.OrderItems[0].Name); + Assert.AreEqual(order.OrderItems[0].Price, request.OrderItems[0].Price); + Assert.AreEqual(order.OrderItems[0].Number, 1); + Assert.AreEqual(order.TotalPrice, 10); + } + + [TestMethod] + public void TestOrderMultiRequestMapToOrderReturnOrderItemsCountIs1() + { + var request = new OrderMultiRequest() + { + Name = "Order Name", + OrderItems = new List() + { + new() + { + Name = "Apple", + Price = 10, + Number = 1 + } + } + }; + + var order = request.Map(); + Assert.IsNotNull(order); + Assert.AreEqual(order.Name, request.Name); + Assert.AreEqual(order.OrderItems.Count, 1); + Assert.AreEqual(order.OrderItems[0].Name, request.OrderItems[0].Name); + Assert.AreEqual(order.OrderItems[0].Price, request.OrderItems[0].Price); + Assert.AreEqual(order.OrderItems[0].Number, 1); + Assert.AreEqual(order.TotalPrice, 0); + } + + [TestMethod] + public void TestMapToExistingObject() + { + var request = new + { + Name = "Jim", + Age = 18 + }; + User user = new User("Time") + { + Description = "Description", + }; + + var newUser = request.Map(user); + Assert.IsNotNull(newUser); + Assert.IsTrue(newUser.Description == "Description"); + Assert.IsTrue(newUser.Name == "Jim"); + Assert.IsTrue(newUser.Age == 18); + } + + [TestMethod] + public void TestCreateUserRequestListMapToUsers() + { + List requests = new List() + { + new() + { + Name = "Jim" + } + }; + List users = new(); + var newUsers = requests.Map(users); + Assert.IsTrue(newUsers.Count == 1); + Assert.IsTrue(newUsers[0].Name == "Jim"); + } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs new file mode 100644 index 000000000..685c2586b --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingFormTest.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests; + +[TestClass] +public class MappingFormTest : BaseMappingTest +{ + [TestMethod] + public void TestUseShareModeReturnMapRuleIsExist() + { + var request = new CreateUserRequest() + { + Name = "Jim", + }; + _mapper.Map(request); + Assert.IsTrue(TypeAdapterConfig.GlobalSettings.RuleMap.Any(r + => r.Key.Source == typeof(CreateUserRequest) && r.Key.Destination == typeof(User))); + } + + [TestMethod] + public void TestAddMultiMapping() + { + _services.AddMapster(); + var mappers = _services.BuildServiceProvider().GetServices(); + Assert.IsTrue(mappers.Count() == 1); + } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs new file mode 100644 index 000000000..ceb5d22af --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/MappingTest.cs @@ -0,0 +1,191 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests; + +[TestClass] +public class MappingTest : BaseMappingTest +{ + [TestMethod] + public void TestCreateUserRequestMapToUserReturnUserNameEqualRequestName() + { + var request = new CreateUserRequest() + { + Name = "Jim", + }; + var user = _mapper.Map(request); + Assert.IsNotNull(user); + Assert.IsTrue(user.Name == request.Name); + } + + [TestMethod] + public void TestObjectMapToUserReturnUserIsNotNull() + { + var request = new + { + Name = "Jim", + Age = 18, + Birthday = DateTime.Now, + Description = "i am jim" + }; + + var user = _mapper.Map(request); + Assert.IsNotNull(user); + Assert.AreEqual(request.Name, user.Name); + Assert.AreEqual(request.Age, user.Age); + Assert.AreEqual(request.Birthday, user.Birthday); + Assert.AreEqual(request.Description, user.Description); + } + + [TestMethod] + public void TestObjectMapToUserAndSourceParameterGreatherThanDestinationControllerParameterLength() + { + var request = new + { + Name = "Jim", + Age = 18, + Birthday = DateTime.Now, + Description = "i am jim", + Tag = Array.Empty() + }; + + var user = _mapper.Map(request); + Assert.IsNotNull(user); + Assert.AreEqual(request.Name, user.Name); + Assert.AreEqual(request.Age, user.Age); + Assert.AreEqual(request.Birthday, user.Birthday); + Assert.AreEqual(request.Description, user.Description); + } + + [TestMethod] + public void TestCreateFullUserRequestMapToUserReturnHometownIsNotNull() + { + var request = new CreateFullUserRequest() + { + Name = "Jim", + Age = 18, + Birthday = DateTime.Now, + Hometown = new AddressItemRequest() + { + Province = "BeiJing", + City = "BeiJing", + Address = "National Sport Stadium" + } + }; + + var user = _mapper.Map(request); + Assert.IsNotNull(user); + Assert.AreEqual(request.Name, user.Name); + Assert.AreEqual(request.Age, user.Age); + Assert.AreEqual(request.Birthday, user.Birthday); + Assert.AreEqual(request.Description, user.Description); + Assert.IsNotNull(request.Hometown); + Assert.AreEqual(request.Hometown.Province, user.Hometown.Province); + Assert.AreEqual(request.Hometown.City, user.Hometown.City); + Assert.AreEqual(request.Hometown.Address, user.Hometown.Address); + } + + [TestMethod] + public void TestOrderRequestMapToOrderReturnTotalPriceIs10() + { + var request = new OrderRequest() + { + Name = "orderName", + OrderItem = new OrderItem("apple", 10) + }; + + var order = _mapper.Map(request); + Assert.IsNotNull(order); + Assert.AreEqual(order.Name, request.Name); + Assert.AreEqual(order.OrderItems.Count, 1); + Assert.AreEqual(order.OrderItems[0].Name, request.OrderItem.Name); + Assert.AreEqual(order.OrderItems[0].Price, request.OrderItem.Price); + Assert.AreEqual(order.OrderItems[0].Number, 1); + Assert.AreEqual(order.TotalPrice, 1 * 10); + } + + [TestMethod] + public void TestOrderMultiRequestMapToOrderReturnOrderItemsCountIs1AndTotalPriceIs10() + { + var request = new + { + Name = "Order Name", + OrderItems = new List() + { + new("Apple", 10) + } + }; + + var order = _mapper.Map(request); + Assert.IsNotNull(order); + Assert.AreEqual(order.Name, request.Name); + Assert.AreEqual(order.OrderItems.Count, 1); + Assert.AreEqual(order.OrderItems[0].Name, request.OrderItems[0].Name); + Assert.AreEqual(order.OrderItems[0].Price, request.OrderItems[0].Price); + Assert.AreEqual(order.OrderItems[0].Number, 1); + Assert.AreEqual(order.TotalPrice, 10); + } + + [TestMethod] + public void TestOrderMultiRequestMapToOrderReturnOrderItemsCountIs1() + { + var request = new OrderMultiRequest() + { + Name = "Order Name", + OrderItems = new List() + { + new() + { + Name = "Apple", + Price = 10, + Number = 1 + } + } + }; + + var order = _mapper.Map(request); + Assert.IsNotNull(order); + Assert.AreEqual(order.Name, request.Name); + Assert.AreEqual(order.OrderItems.Count, 1); + Assert.AreEqual(order.OrderItems[0].Name, request.OrderItems[0].Name); + Assert.AreEqual(order.OrderItems[0].Price, request.OrderItems[0].Price); + Assert.AreEqual(order.OrderItems[0].Number, 1); + Assert.AreEqual(order.TotalPrice, 0); + } + + [TestMethod] + public void TestMapToExistingObject() + { + var request = new + { + Name = "Jim", + Age = 18 + }; + User user = new User("Time") + { + Description = "Description", + }; + + var newUser = _mapper.Map(request, user); + Assert.IsNotNull(newUser); + Assert.IsTrue(newUser.Description == "Description"); + Assert.IsTrue(newUser.Name == "Jim"); + Assert.IsTrue(newUser.Age == 18); + } + + [TestMethod] + public void TestCreateUserRequestListMapToUsers() + { + List requests = new List() + { + new() + { + Name = "Jim" + } + }; + List users = new(); + var newUsers = _mapper.Map(requests, users); + Assert.IsTrue(newUsers.Count == 1); + Assert.IsTrue(newUsers[0].Name == "Jim"); + } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj new file mode 100644 index 000000000..486b2cdb3 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Masa.Contrib.Data.Mapping.Mapster.Tests.csproj @@ -0,0 +1,23 @@ + + + + net6.0 + enable + + false + + + + + + + + + + + + + + + + diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs new file mode 100644 index 000000000..8981f95dc --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/AddressItemRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests; + +public class AddressItemRequest +{ + public string Province { get; set; } + + public string City { get; set; } + + public string Address { get; set; } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs new file mode 100644 index 000000000..afdf4f0b5 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderItemRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Orders; + +public class OrderItemRequest +{ + public string Name { get; set; }= default!; + + public decimal Price { get; set; } + + public int Number { get; set; } +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs new file mode 100644 index 000000000..a3a3a1e39 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderMultiRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Orders; + +public class OrderMultiRequest +{ + public Guid Id { get; set; } + + public string Name { get; set; } = default!; + + public List OrderItems { get; set; } = default!; +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs new file mode 100644 index 000000000..9c8139dc2 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Orders/OrderRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Orders; + +public class OrderRequest +{ + public string Name { get; set; }= default!; + + public OrderItem OrderItem { get; set; }= default!; +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs new file mode 100644 index 000000000..e6ccb82b6 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateFullUserRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Users; + +public class CreateFullUserRequest : CreateUserRequest +{ + public int Age { get; set; } + + public string Description { get; set; } = default!; + + public DateTime Birthday { get; set; } + + public AddressItemRequest Hometown { get; set; } = default!; +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs new file mode 100644 index 000000000..feb0041f9 --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/Requests/Users/CreateUserRequest.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Users; + +public class CreateUserRequest +{ + public string Name { get; set; } = default!; +} diff --git a/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs new file mode 100644 index 000000000..0f0e72afa --- /dev/null +++ b/src/Contrib/Data/Mapping/Tests/Masa.Contrib.Data.Mapping.Mapster.Tests/_Imports.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Mapster; +global using Masa.BuildingBlocks.Data.Mapping; +global using Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Orders; +global using Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.Aggregates.Users; +global using Masa.Contrib.Data.Mapping.Mapster.Tests.Domain.ValueObjects; +global using Masa.Contrib.Data.Mapping.Mapster.Tests.Requests; +global using Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Orders; +global using Masa.Contrib.Data.Mapping.Mapster.Tests.Requests.Users; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System; +global using System.Collections.Generic; +global using System.Linq; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs new file mode 100644 index 000000000..f734442a5 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Cosmos.Internal; + +internal static class Parser +{ + public static Dictionary ToDictionary(this string connectionString) + { + if (string.IsNullOrEmpty(connectionString)) + throw new ArgumentException("Cosmos: empty database connection string", nameof(connectionString)); + + Dictionary dictionary = new(); + foreach (var item in connectionString.Split(';')) + { + if (string.IsNullOrEmpty(item)) + continue; + + if (item.Split('=').Length != 2) + throw new ArgumentException("Cosmos: Bad database connection string"); + + dictionary.Add(item.Split('=')[0], item.Split('=')[1]); + } + return dictionary; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj new file mode 100644 index 000000000..b9232abc8 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs new file mode 100644 index 000000000..38730fe8b --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs @@ -0,0 +1,105 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextBuilderExtensions +{ + public static MasaDbContextBuilder UseCosmos( + this MasaDbContextBuilder builder, + Action? cosmosOptionsAction = null) + { + builder.Builder = (serviceProvider, dbContextOptionsBuilder) => + { + var connectionStringProvider = serviceProvider.GetRequiredService(); + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + var configurationDic = connectionStringProvider.GetConnectionString(name).ToDictionary(); + + if (!configurationDic.TryGetValue("Database", out string? databaseName)) + throw new ArgumentException("Cosmos: Bad database connection string, Failed to get [Database] name"); + + if (configurationDic.TryGetValue("ConnectionString", out string? connectionString)) + { + dbContextOptionsBuilder.UseCosmos(connectionString, databaseName, cosmosOptionsAction); + return; + } + + if (!configurationDic.TryGetValue("AccountKey", out string? accountKey) || + !configurationDic.TryGetValue("AccountEndpoint", out string? accountEndpoint)) + throw new ArgumentException( + "Cosmos: Bad database connection string, Failed to get [AccountKey] name or [AccountEndpoint] name"); + + dbContextOptionsBuilder.UseCosmos(accountEndpoint, accountKey, databaseName, cosmosOptionsAction); + }; + return builder; + } + + public static MasaDbContextBuilder UseCosmos( + this MasaDbContextBuilder builder, + string accountEndpoint, + string accountKey, + string databaseName, + Action? cosmosOptionsAction = null) + => builder.UseCosmosCore(accountEndpoint, accountKey, databaseName, false, cosmosOptionsAction); + + public static MasaDbContextBuilder UseTestCosmos( + this MasaDbContextBuilder builder, + string accountEndpoint, + string accountKey, + string databaseName, + Action? cosmosOptionsAction = null) + => builder.UseCosmosCore(accountEndpoint, accountKey, databaseName, true, cosmosOptionsAction); + + private static MasaDbContextBuilder UseCosmosCore( + this MasaDbContextBuilder builder, + string accountEndpoint, + string accountKey, + string databaseName, + bool isTest, + Action? cosmosOptionsAction = null) + { + builder.Builder = (_, dbContextOptionsBuilder) + => dbContextOptionsBuilder.UseCosmos(accountEndpoint, accountKey, databaseName, cosmosOptionsAction); + return builder.UseCosmosCore($"AccountEndpoint={accountEndpoint};AccountKey={accountKey};Database={databaseName};", isTest); + } + + public static MasaDbContextBuilder UseCosmos( + this MasaDbContextBuilder builder, + string connectionString, + string databaseName, + Action? cosmosOptionsAction = null) + => builder.UseCosmosCore(connectionString, databaseName, false, cosmosOptionsAction); + + public static MasaDbContextBuilder UseTestCosmos( + this MasaDbContextBuilder builder, + string connectionString, + string databaseName, + Action? cosmosOptionsAction = null) + => builder.UseCosmosCore(connectionString, databaseName, true, cosmosOptionsAction); + + private static MasaDbContextBuilder UseCosmosCore( + this MasaDbContextBuilder builder, + string connectionString, + string databaseName, + bool isTest, + Action? cosmosOptionsAction = null) + { + builder.Builder = (_, dbContextOptionsBuilder) + => dbContextOptionsBuilder.UseCosmos(connectionString, databaseName, cosmosOptionsAction); + return builder.UseCosmosCore($"{connectionString};Database={databaseName};", isTest); + } + + private static MasaDbContextBuilder UseCosmosCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest = false) + { + var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) + throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); + + dbConnectionOptions.TryAddConnectionString(name, connectionString); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs new file mode 100644 index 000000000..5b5b97b55 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextOptionsBuilderExtensions +{ + public static MasaDbContextOptionsBuilder UseCosmos( + this MasaDbContextOptionsBuilder builder, + string accountEndpoint, + string accountKey, + string databaseName, + Action? cosmosOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseCosmos(accountEndpoint, accountKey, databaseName, cosmosOptionsAction); + return builder; + } + + public static MasaDbContextOptionsBuilder UseCosmos( + this MasaDbContextOptionsBuilder builder, + string connectionString, + string databaseName, + Action? cosmosOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseCosmos(connectionString, databaseName, cosmosOptionsAction); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md new file mode 100644 index 000000000..de4021a5f --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md @@ -0,0 +1,34 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.EntityFrameworkCore.Cosmos + +## Example: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.Cosmos +``` + +##### Usage 1: + +1. Configure appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "AccountKey=AccountKey;AccountEndpoint=AccountEndpoint;Database=Database"// or "ConnectionString=ConnectionString;Database=Database" + } +} +``` + +2. Using MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos()); +``` + +##### Usage 2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos($"{accountEndpoint}",$"{accountKey}",$"{databaseName}")); +//builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos($"{connectionString}",$"{databaseName}")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md new file mode 100644 index 000000000..fba9c83bf --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md @@ -0,0 +1,34 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.EntityFrameworkCore.Cosmos + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.Cosmos +``` + +#### 用法1: + +1. 配置appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "AccountKey=AccountKey;AccountEndpoint=AccountEndpoint;Database=Database"//或"ConnectionString=ConnectionString;Database=Database" + } +} +``` + +2. 使用MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos()); +``` + +#### 用法2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos($"{accountEndpoint}",$"{accountKey}",$"{databaseName}")); +//builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseCosmos($"{connectionString}",$"{databaseName}")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs new file mode 100644 index 000000000..aab4fdb17 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.Contrib.Data.EntityFrameworkCore.Cosmos.Internal; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Infrastructure; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj new file mode 100644 index 000000000..3edf550bc --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs new file mode 100644 index 000000000..4eddf1d3b --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs @@ -0,0 +1,59 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextBuilderExtensions +{ + public static MasaDbContextBuilder UseInMemoryDatabase( + this MasaDbContextBuilder builder, + Action? inMemoryOptionsAction = null) + { + builder.Builder = (serviceProvider, dbContextOptionsBuilder) => + { + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + var connectionStringProvider = serviceProvider.GetRequiredService(); + dbContextOptionsBuilder.UseInMemoryDatabase( + connectionStringProvider.GetConnectionString(name), + inMemoryOptionsAction); + }; + return builder; + } + + public static MasaDbContextBuilder UseInMemoryDatabase( + this MasaDbContextBuilder builder, + string databaseName, + Action? inMemoryOptionsAction = null) + => builder.UseInMemoryDatabaseCore(databaseName, false, inMemoryOptionsAction); + + public static MasaDbContextBuilder UseInMemoryTestDatabase( + this MasaDbContextBuilder builder, + string databaseName, + Action? inMemoryOptionsAction = null) + => builder.UseInMemoryDatabaseCore(databaseName, true, inMemoryOptionsAction); + + private static MasaDbContextBuilder UseInMemoryDatabaseCore( + this MasaDbContextBuilder builder, + string databaseName, + bool isTest, + Action? inMemoryOptionsAction) + { + builder.Builder = (_, dbContextOptionsBuilder) + => dbContextOptionsBuilder.UseInMemoryDatabase(databaseName, inMemoryOptionsAction); + return builder.UseInMemoryDatabaseCore(databaseName, isTest); + } + + private static MasaDbContextBuilder UseInMemoryDatabaseCore( + this MasaDbContextBuilder builder, + string databaseName, + bool isTest = false) + { + var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) + throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); + + dbConnectionOptions.TryAddConnectionString(name, databaseName); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs new file mode 100644 index 000000000..7d8293971 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextOptionsBuilderExtensions +{ + public static MasaDbContextOptionsBuilder UseInMemoryDatabase( + this MasaDbContextOptionsBuilder builder, + string connectionString, + Action? inMemoryOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseInMemoryDatabase(connectionString, inMemoryOptionsAction); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md new file mode 100644 index 000000000..b4293b730 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md @@ -0,0 +1,33 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.EntityFrameworkCore.InMemory + +## Example: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.InMemory +``` + +##### Usage 1: + +1. Configure appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "identity" + } +} +``` + +2. Using MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseInMemoryDatabase()); +``` + +##### Usage 2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseInMemoryDatabase("identity")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md new file mode 100644 index 000000000..e28c40a0e --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md @@ -0,0 +1,33 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.EntityFrameworkCore.InMemory + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.InMemory +``` + +#### 用法1: + +1. 配置appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "identity" + } +} +``` + +2. 使用MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseInMemoryDatabase()); +``` + +#### 用法2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseInMemoryDatabase("identity")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs new file mode 100644 index 000000000..4ec3d59f9 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Infrastructure; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj new file mode 100644 index 000000000..77df81d87 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs new file mode 100644 index 000000000..7ae2bbe24 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextBuilderExtensions +{ + public static MasaDbContextBuilder UseMySQL( + this MasaDbContextBuilder builder, + Action? mySqlOptionsAction = null) + { + builder.Builder = (serviceProvider, dbContextOptionsBuilder) => + { + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + var connectionStringProvider = serviceProvider.GetRequiredService(); + dbContextOptionsBuilder.UseMySQL( + connectionStringProvider.GetConnectionString(name), + mySqlOptionsAction); + }; + return builder; + } + + public static MasaDbContextBuilder UseMySQL( + this MasaDbContextBuilder builder, + string connectionString, + Action? mySqlOptionsAction = null) + => builder.UseMySQLCore(connectionString, false, mySqlOptionsAction); + + public static MasaDbContextBuilder UseTestMySQL( + this MasaDbContextBuilder builder, + string connectionString, + Action? mySqlOptionsAction = null) + => builder.UseMySQLCore(connectionString, true, mySqlOptionsAction); + + private static MasaDbContextBuilder UseMySQLCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest, + Action? mySqlOptionsAction) + { + builder.Builder = (_, dbContextOptionsBuilder) + => dbContextOptionsBuilder.UseMySQL(connectionString, mySqlOptionsAction); + return builder.UseMySQLCore(connectionString, isTest); + } + + public static MasaDbContextBuilder UseMySQL( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? mySqlOptionsAction = null) + => builder.UseMySQLCore(connection, false, mySqlOptionsAction); + + public static MasaDbContextBuilder UseTestMySQL( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? mySqlOptionsAction = null) + => builder.UseMySQLCore(connection, true, mySqlOptionsAction); + + private static MasaDbContextBuilder UseMySQLCore( + this MasaDbContextBuilder builder, + DbConnection connection, + bool isTest, + Action? mySqlOptionsAction = null) + { + builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseMySQL(connection, mySqlOptionsAction); + return builder.UseMySQLCore(connection.ConnectionString, isTest); + } + + private static MasaDbContextBuilder UseMySQLCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest = false) + { + var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) + throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); + + dbConnectionOptions.TryAddConnectionString(name, connectionString); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs new file mode 100644 index 000000000..d83be809a --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextOptionsBuilderExtensions +{ + public static MasaDbContextOptionsBuilder UseMySQL( + this MasaDbContextOptionsBuilder builder, + string connectionString, + Action? mySqlOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseMySQL(connectionString, mySqlOptionsAction); + return builder; + } + + public static MasaDbContextOptionsBuilder UseMySQL( + this MasaDbContextOptionsBuilder builder, + DbConnection connection, + Action? mySqlOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseMySQL(connection, mySqlOptionsAction); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md new file mode 100644 index 000000000..967a2674f --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md @@ -0,0 +1,33 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.EntityFrameworkCore.MySql + +## Example: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.MySql +``` + +##### Usage 1: + +1. Configure appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;" + } +} +``` + +2. Using MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySQL()); +``` + +##### Usage 2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md new file mode 100644 index 000000000..f19a31586 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md @@ -0,0 +1,33 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.EntityFrameworkCore.MySql + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.MySql +``` + +#### 用法1: + +1. 配置appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;" + } +} +``` + +2. 使用MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySQL()); +``` + +#### 用法2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySQL("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs new file mode 100644 index 000000000..686d0e2ae --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using MySql.EntityFrameworkCore.Infrastructure; +global using System.Data.Common; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj new file mode 100644 index 000000000..ef7797dc1 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs new file mode 100644 index 000000000..d9fe02baa --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextBuilderExtensions +{ + public static MasaDbContextBuilder UseOracle( + this MasaDbContextBuilder builder, + Action? oracleOptionsAction = null) + { + builder.Builder = (serviceProvider, dbContextOptionsBuilder) => + { + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + var connectionStringProvider = serviceProvider.GetRequiredService(); + dbContextOptionsBuilder.UseOracle( + connectionStringProvider.GetConnectionString(name), + oracleOptionsAction); + }; + return builder; + } + + public static MasaDbContextBuilder UseOracle( + this MasaDbContextBuilder builder, + string connectionString, + Action? oracleOptionsAction = null) + => builder.UseOracleCore(connectionString, false, oracleOptionsAction); + + public static MasaDbContextBuilder UseTestOracle( + this MasaDbContextBuilder builder, + string connectionString, + Action? oracleOptionsAction = null) + => builder.UseOracleCore(connectionString, true, oracleOptionsAction); + + private static MasaDbContextBuilder UseOracleCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest, + Action? oracleOptionsAction) + { + builder.Builder = (_, dbContextOptionsBuilder) + => dbContextOptionsBuilder.UseOracle(connectionString, oracleOptionsAction); + return builder.UseOracleCore(connectionString, isTest); + } + + public static MasaDbContextBuilder UseOracle( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? oracleOptionsAction = null) + => builder.UseOracleCore(connection, false, oracleOptionsAction); + + public static MasaDbContextBuilder UseTestOracle( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? oracleOptionsAction = null) + => builder.UseOracleCore(connection, true, oracleOptionsAction); + + private static MasaDbContextBuilder UseOracleCore( + this MasaDbContextBuilder builder, + DbConnection connection, + bool isTest = false, + Action? oracleOptionsAction = null) + { + builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseOracle(connection, oracleOptionsAction); + return builder.UseOracleCore(connection.ConnectionString, isTest); + } + + private static MasaDbContextBuilder UseOracleCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest = false) + { + var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) + throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); + + dbConnectionOptions.TryAddConnectionString(name, connectionString); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs new file mode 100644 index 000000000..50591cd78 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextOptionsBuilderExtensions +{ + public static MasaDbContextOptionsBuilder UseOracle( + this MasaDbContextOptionsBuilder builder, + string connectionString, + Action? oracleOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseOracle(connectionString, oracleOptionsAction); + return builder; + } + + public static MasaDbContextOptionsBuilder UseOracle( + this MasaDbContextOptionsBuilder builder, + DbConnection connection, + Action? oracleOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseOracle(connection, oracleOptionsAction); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md new file mode 100644 index 000000000..97f1a32b5 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md @@ -0,0 +1,33 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.EntityFrameworkCore.Oracle + +## Example: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.Oracle +``` + +##### Usage 1: + +1. Configure appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Data Source=MyOracleDB;Integrated Security=yes;" + } +} +``` + +2. Using MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseOracle()); +``` + +##### Usage 2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseOracle("Data Source=MyOracleDB;Integrated Security=yes;")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md new file mode 100644 index 000000000..fd3328d07 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md @@ -0,0 +1,33 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.EntityFrameworkCore.Oracle + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.Oracle +``` + +#### 用法1: + +1. 配置appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Data Source=MyOracleDB;Integrated Security=yes;" + } +} +``` + +2. 使用MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseOracle()); +``` + +#### 用法2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseOracle("Data Source=MyOracleDB;Integrated Security=yes;")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs new file mode 100644 index 000000000..b9b2a72c4 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using Oracle.EntityFrameworkCore.Infrastructure; +global using System.Data.Common; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj new file mode 100644 index 000000000..5abc63273 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs new file mode 100644 index 000000000..9edc1bf94 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs @@ -0,0 +1,89 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextBuilderExtensions +{ + public static MasaDbContextBuilder UseMySql( + this MasaDbContextBuilder builder, + ServerVersion serverVersion, + Action? mySqlOptionsAction = null) + { + builder.Builder = (serviceProvider, dbContextOptionsBuilder) => + { + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + var connectionStringProvider = serviceProvider.GetRequiredService(); + dbContextOptionsBuilder.UseMySql( + connectionStringProvider.GetConnectionString(name), + serverVersion, + mySqlOptionsAction); + }; + return builder; + } + + public static MasaDbContextBuilder UseMySql( + this MasaDbContextBuilder builder, + string connectionString, + ServerVersion serverVersion, + Action? mySqlOptionsAction = null) + => builder.UseMySqlCore(connectionString, serverVersion, false, mySqlOptionsAction); + + public static MasaDbContextBuilder UseTestMySql( + this MasaDbContextBuilder builder, + string connectionString, + ServerVersion serverVersion, + Action? mySqlOptionsAction = null) + => builder.UseMySqlCore(connectionString, serverVersion, true, mySqlOptionsAction); + + private static MasaDbContextBuilder UseMySqlCore( + this MasaDbContextBuilder builder, + string connectionString, + ServerVersion serverVersion, + bool isTest, + Action? mySqlOptionsAction = null) + { + builder.Builder = (_, dbContextOptionsBuilder) + => dbContextOptionsBuilder.UseMySql(connectionString, serverVersion, mySqlOptionsAction); + return builder.UseMySqlCore(connectionString, isTest); + } + + public static MasaDbContextBuilder UseMySql( + this MasaDbContextBuilder builder, + DbConnection connection, + ServerVersion serverVersion, + Action? mySqlOptionsAction = null) + => builder.UseMySqlCore(connection, serverVersion, false, mySqlOptionsAction); + + public static MasaDbContextBuilder UseTestMySql( + this MasaDbContextBuilder builder, + DbConnection connection, + ServerVersion serverVersion, + Action? mySqlOptionsAction = null) + => builder.UseMySqlCore(connection, serverVersion, true, mySqlOptionsAction); + + private static MasaDbContextBuilder UseMySqlCore( + this MasaDbContextBuilder builder, + DbConnection connection, + ServerVersion serverVersion, + bool isTest, + Action? mySqlOptionsAction = null) + { + builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseMySql(connection, serverVersion, mySqlOptionsAction); + return builder.UseMySqlCore(connection.ConnectionString, isTest); + } + + private static MasaDbContextBuilder UseMySqlCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest = false) + { + var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) + throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); + + dbConnectionOptions.TryAddConnectionString(name, connectionString); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs new file mode 100644 index 000000000..485b3f63e --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextOptionsBuilderExtensions +{ + public static MasaDbContextOptionsBuilder UseMySql( + this MasaDbContextOptionsBuilder builder, + string connectionString, + ServerVersion serverVersion, + Action? mySqlOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseMySql(connectionString, serverVersion, mySqlOptionsAction); + return builder; + } + + public static MasaDbContextOptionsBuilder UseMySql( + this MasaDbContextOptionsBuilder builder, + DbConnection connection, + ServerVersion serverVersion, + Action? mySqlOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseMySql(connection, serverVersion, mySqlOptionsAction); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md new file mode 100644 index 000000000..5d170c32a --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md @@ -0,0 +1,33 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql + +## Example: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql +``` + +##### Usage 1: + +1. Configure appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;" + } +} +``` + +2. Using MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySql(Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.28-mysql"))); +``` + +##### Usage 2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySql("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;", Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.28-mysql"))); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md new file mode 100644 index 000000000..9113e1bb1 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md @@ -0,0 +1,33 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql +``` + +#### 用法1: + +1. 配置appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;" + } +} +``` + +2. 使用MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySql(Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.28-mysql"))); +``` + +#### 用法2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseMySql("Server=localhost;Database=identity;Uid=myUsername;Pwd=P@ssw0rd;", Microsoft.EntityFrameworkCore.ServerVersion.Parse("5.7.28-mysql"))); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs new file mode 100644 index 000000000..4bc00c11b --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Infrastructure; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using System.Data.Common; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj new file mode 100644 index 000000000..699e24cd3 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs new file mode 100644 index 000000000..1ffcf34e0 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextBuilderExtensions +{ + public static MasaDbContextBuilder UseNpgsql( + this MasaDbContextBuilder builder, + Action? npgsqlOptionsAction = null) + { + builder.Builder = (serviceProvider, dbContextOptionsBuilder) => + { + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + var connectionStringProvider = serviceProvider.GetRequiredService(); + dbContextOptionsBuilder.UseNpgsql( + connectionStringProvider.GetConnectionString(name), + npgsqlOptionsAction); + }; + return builder; + } + + public static MasaDbContextBuilder UseNpgsql( + this MasaDbContextBuilder builder, + string connectionString, + Action? npgsqlOptionsAction = null) + => builder.UseNpgsqlCore(connectionString, false, npgsqlOptionsAction); + + public static MasaDbContextBuilder UseTestNpgsql( + this MasaDbContextBuilder builder, + string connectionString, + Action? npgsqlOptionsAction = null) + => builder.UseNpgsqlCore(connectionString, true, npgsqlOptionsAction); + + private static MasaDbContextBuilder UseNpgsqlCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest, + Action? npgsqlOptionsAction) + { + builder.Builder = (_, dbContextOptionsBuilder) + => dbContextOptionsBuilder.UseNpgsql(connectionString, npgsqlOptionsAction); + return builder.UseNpgsqlCore(connectionString, isTest); + } + + public static MasaDbContextBuilder UseNpgsql( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? npgsqlOptionsAction = null) + => builder.UseNpgsqlCore(connection, false, npgsqlOptionsAction); + + public static MasaDbContextBuilder UseTestNpgsql( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? npgsqlOptionsAction = null) + => builder.UseNpgsqlCore(connection, true, npgsqlOptionsAction); + + private static MasaDbContextBuilder UseNpgsqlCore( + this MasaDbContextBuilder builder, + DbConnection connection, + bool isTest, + Action? npgsqlOptionsAction = null) + { + builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseNpgsql(connection, npgsqlOptionsAction); + return builder.UseNpgsqlCore(connection.ConnectionString, isTest); + } + + private static MasaDbContextBuilder UseNpgsqlCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest = false) + { + var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) + throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); + + dbConnectionOptions.TryAddConnectionString(name, connectionString); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs new file mode 100644 index 000000000..17624e597 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextOptionsBuilderExtensions +{ + public static MasaDbContextOptionsBuilder UseNpgsql( + this MasaDbContextOptionsBuilder builder, + string connectionString, + Action? npgsqlOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseNpgsql(connectionString, npgsqlOptionsAction); + return builder; + } + + public static MasaDbContextOptionsBuilder UseNpgsql( + this MasaDbContextOptionsBuilder builder, + DbConnection connection, + Action? npgsqlOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseNpgsql(connection, npgsqlOptionsAction); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md new file mode 100644 index 000000000..88af3796e --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md @@ -0,0 +1,33 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.EntityFrameworkCore.PostgreSql + +## Example: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.PostgreSql +``` + +##### Usage 1: + +1. Configure appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity" + } +} +``` + +2. Using MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseNpgsql()); +``` + +##### Usage 2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseNpgsql("Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md new file mode 100644 index 000000000..99af59623 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md @@ -0,0 +1,33 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.EntityFrameworkCore.PostgreSql + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.PostgreSql +``` + +#### 用法1: + +1. 配置appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity" + } +} +``` + +2. 使用MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseNpgsql()); +``` + +#### 用法2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseNpgsql("Host=myserver;Username=sa;Password=P@ssw0rd;Database=identity")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs new file mode 100644 index 000000000..4e2f40e11 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure; +global using System.Data.Common; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj new file mode 100644 index 000000000..ee9aca007 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs new file mode 100644 index 000000000..25939987a --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextBuilderExtensions +{ + public static MasaDbContextBuilder UseSqlServer( + this MasaDbContextBuilder builder, + Action? sqlServerOptionsAction = null) + { + builder.Builder = (serviceProvider, dbContextOptionsBuilder) => + { + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + var connectionStringProvider = serviceProvider.GetRequiredService(); + dbContextOptionsBuilder.UseSqlServer( + connectionStringProvider.GetConnectionString(name), + sqlServerOptionsAction); + }; + return builder; + } + + public static MasaDbContextBuilder UseSqlServer( + this MasaDbContextBuilder builder, + string connectionString, + Action? sqlServerOptionsAction = null) + => builder.UseSqlServerCore(connectionString, false, sqlServerOptionsAction); + + public static MasaDbContextBuilder UseTestSqlServer( + this MasaDbContextBuilder builder, + string connectionString, + Action? sqlServerOptionsAction) + => builder.UseSqlServerCore(connectionString, true, sqlServerOptionsAction); + + private static MasaDbContextBuilder UseSqlServerCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest, + Action? sqlServerOptionsAction) + { + builder.Builder = (_, dbContextOptionsBuilder) + => dbContextOptionsBuilder.UseSqlServer(connectionString, sqlServerOptionsAction); + return builder.UseSqlServerCore(connectionString, isTest); + } + + public static MasaDbContextBuilder UseSqlServer( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? sqlServerOptionsAction = null) + => builder.UseSqlServerCore(connection, false, sqlServerOptionsAction); + + public static MasaDbContextBuilder UseTestSqlServer( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? sqlServerOptionsAction = null) + => builder.UseSqlServerCore(connection, true, sqlServerOptionsAction); + + private static MasaDbContextBuilder UseSqlServerCore( + this MasaDbContextBuilder builder, + DbConnection connection, + bool isTest, + Action? sqlServerOptionsAction = null) + { + builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseSqlServer(connection, sqlServerOptionsAction); + return builder.UseSqlServerCore(connection.ConnectionString, isTest); + } + + private static MasaDbContextBuilder UseSqlServerCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest = false) + { + var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) + throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); + + dbConnectionOptions.TryAddConnectionString(name, connectionString); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs new file mode 100644 index 000000000..dcd110898 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextOptionsBuilderExtensions +{ + public static MasaDbContextOptionsBuilder UseSqlServer( + this MasaDbContextOptionsBuilder builder, + string connectionString, + Action? sqlServerOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseSqlServer(connectionString, sqlServerOptionsAction); + return builder; + } + + public static MasaDbContextOptionsBuilder UseSqlServer( + this MasaDbContextOptionsBuilder builder, + DbConnection connection, + Action? sqlServerOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseSqlServer(connection, sqlServerOptionsAction); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md new file mode 100644 index 000000000..3bb2223f2 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md @@ -0,0 +1,33 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.EntityFrameworkCore.SqlServer + +## Example: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +##### Usage 1: + +1. Configure appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity" + } +} +``` + +2. Using MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlServer()); +``` + +##### Usage 2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md new file mode 100644 index 000000000..baca04f2f --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md @@ -0,0 +1,33 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.EntityFrameworkCore.SqlServer + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +#### 用法1: + +1. 配置appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity" + } +} +``` + +2. 使用MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlServer()); +``` + +#### 用法2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs new file mode 100644 index 000000000..4bc00c11b --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Infrastructure; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using System.Data.Common; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj new file mode 100644 index 000000000..6ddda3d22 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs new file mode 100644 index 000000000..6d3ada22d --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextBuilderExtensions +{ + public static MasaDbContextBuilder UseSqlite( + this MasaDbContextBuilder builder, + Action? sqliteOptionsAction = null) + { + builder.Builder = (serviceProvider, dbContextOptionsBuilder) => + { + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + var connectionStringProvider = serviceProvider.GetRequiredService(); + dbContextOptionsBuilder.UseSqlite( + connectionStringProvider.GetConnectionString(name), + sqliteOptionsAction); + }; + return builder; + } + + public static MasaDbContextBuilder UseSqlite( + this MasaDbContextBuilder builder, + string connectionString, + Action? sqliteOptionsAction = null) + => builder.UseSqliteCore(connectionString, false, sqliteOptionsAction); + + public static MasaDbContextBuilder UseTestSqlite( + this MasaDbContextBuilder builder, + string connectionString, + Action? sqliteOptionsAction = null) + => builder.UseSqliteCore(connectionString, true, sqliteOptionsAction); + + private static MasaDbContextBuilder UseSqliteCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest, + Action? sqliteOptionsAction) + { + builder.Builder = (_, dbContextOptionsBuilder) + => dbContextOptionsBuilder.UseSqlite(connectionString, sqliteOptionsAction); + return builder.UseSqliteCore(connectionString, isTest); + } + + public static MasaDbContextBuilder UseSqlite( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? sqliteOptionsAction = null) + => builder.UseSqliteCore(connection, false, sqliteOptionsAction); + + public static MasaDbContextBuilder UseTestSqlite( + this MasaDbContextBuilder builder, + DbConnection connection, + Action? sqliteOptionsAction = null) + => builder.UseSqliteCore(connection, true, sqliteOptionsAction); + + private static MasaDbContextBuilder UseSqliteCore( + this MasaDbContextBuilder builder, + DbConnection connection, + bool isTest, + Action? sqliteOptionsAction = null) + { + builder.Builder = (_, dbContextOptionsBuilder) => dbContextOptionsBuilder.UseSqlite(connection, sqliteOptionsAction); + return builder.UseSqliteCore(connection.ConnectionString, isTest); + } + + private static MasaDbContextBuilder UseSqliteCore( + this MasaDbContextBuilder builder, + string connectionString, + bool isTest = false) + { + var dbConnectionOptions = builder.ServiceProvider.GetRequiredService>().CurrentValue; + var name = ConnectionStringNameAttribute.GetConnStringName(builder.DbContextType); + if (!isTest && dbConnectionOptions.ConnectionStrings.ContainsKey(name)) + throw new ArgumentException($"The [{builder.DbContextType.Name}] Database Connection String already exists"); + + dbConnectionOptions.TryAddConnectionString(name, connectionString); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs new file mode 100644 index 000000000..c8bc12f72 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class MasaDbContextOptionsBuilderExtensions +{ + public static MasaDbContextOptionsBuilder UseSqlite( + this MasaDbContextOptionsBuilder builder, + string connectionString, + Action? sqliteOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseSqlite(connectionString, sqliteOptionsAction); + return builder; + } + + public static MasaDbContextOptionsBuilder UseSqlite( + this MasaDbContextOptionsBuilder builder, + DbConnection connection, + Action? sqliteOptionsAction = null) + { + builder.DbContextOptionsBuilder.UseSqlite(connection, sqliteOptionsAction); + return builder; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md new file mode 100644 index 000000000..f67058740 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md @@ -0,0 +1,33 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.EntityFrameworkCore.Sqlite + +## Example: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.Sqlite +``` + +##### Usage 1: + +1. Configure appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Data Source=c:\mydb.db;Version=3;Password=P@ssw0rd;" + } +} +``` + +2. Using MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlite()); +``` + +##### Usage 2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlite("Data Source=c:\mydb.db;Version=3;Password=P@ssw0rd;")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md new file mode 100644 index 000000000..bcef8183c --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md @@ -0,0 +1,33 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.EntityFrameworkCore.Sqlite + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore.Sqlite +``` + +#### 用法1: + +1. 配置appsettings.json + +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "Data Source=c:\mydb.db;Version=3;Password=P@ssw0rd;" + } +} +``` + +2. 使用MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlite()); +``` + +#### 用法2: + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => optionsBuilder.UseFilter().UseSqlite("Data Source=c:\mydb.db;Version=3;Password=P@ssw0rd;")); +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs new file mode 100644 index 000000000..4bc00c11b --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Infrastructure; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using System.Data.Common; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs new file mode 100644 index 000000000..9538e0227 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; + +public class CustomDbContext : MasaDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + } + + protected override void OnModelCreatingExecuting(ModelBuilder modelBuilder) + { + modelBuilder.Entity(); + modelBuilder.Entity().OwnsOne(x => x.Address); + modelBuilder.Entity().OwnsMany(t => t.Hobbies); + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs new file mode 100644 index 000000000..e72d3336d --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs @@ -0,0 +1,219 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; + +[TestClass] +public class DbContextTest : TestBase +{ + [TestMethod] + public async Task TestAddAsync() + { + await using var dbContext = CreateDbContext(true, out _); + await dbContext.Set().AddAsync(new Student() + { + Id = 1, + Name = "Jim", + Age = 18, + Address = new Address() + { + City = "ShangHai", + Street = "PuDong", + }, + Hobbies = new List() + { + new() + { + Name = "Sing", + Description = "loves singing" + }, + new() + { + Name = "Game", + Description = "mobile game" + } + } + }); + await dbContext.SaveChangesAsync(); + Assert.IsTrue(await dbContext.Set().CountAsync() == 1); + } + + [TestMethod] + public async Task TestSoftDeleteAsync() + { + Services.Configure(options => + { + options.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = $"data source=soft-delete-db-{Guid.NewGuid()}" + }; + }); + await using var dbContext = CreateDbContext(true, out IServiceProvider serviceProvider, false); + var student = new Student() + { + Id = 1, + Name = "Jim", + Age = 18, + Address = new Address() + { + City = "ShangHai", + Street = "PuDong", + }, + Hobbies = new List() + { + new() + { + Name = "Sing", + Description = "loves singing" + }, + new() + { + Name = "Game", + Description = "mobile game" + } + } + }; + await dbContext.Set().AddAsync(student); + await dbContext.SaveChangesAsync(); + Assert.IsTrue(await dbContext.Set().CountAsync() == 1); + + student = await dbContext.Set().Include(s => s.Address).Include(s => s.Hobbies).FirstAsync(); + dbContext.Set().Remove(student); + await dbContext.SaveChangesAsync(); + + Assert.IsTrue(await dbContext.Set().CountAsync() == 0); + + var dataFilter = serviceProvider.GetRequiredService(); + using (dataFilter.Disable()) + { + Assert.IsTrue(await dbContext.Set().CountAsync() == 1); + + student = (await dbContext.Set().Include(s => s.Address).FirstOrDefaultAsync())!; + Assert.IsTrue(student.Id == 1); + Assert.IsTrue(student.Name == "Jim"); + Assert.IsTrue(student.Age == 18); + Assert.IsTrue(student.IsDeleted); + Assert.IsTrue(student.Address.City == "ShangHai"); + Assert.IsTrue(student.Address.Street == "PuDong"); + + Assert.IsTrue(student.Hobbies.Count == 2); + Assert.IsTrue(student.Hobbies.Any(h => h.Name == "Sing")); + Assert.IsTrue(student.Hobbies.Any(h => h.Name == "Game")); + } + } + + [TestMethod] + public async Task TestDisabledSoftDelete() + { + Services.AddMasaDbContext(options + => options.UseTestFilter().UseTestSqlite($"data source=disabled-soft-delete-db-{Guid.NewGuid()}")); + var serviceProvider = Services.BuildServiceProvider(); + var dbContext = serviceProvider.GetRequiredService(); + await dbContext.Database.EnsureCreatedAsync(); + var student = new Student + { + Id = 1, + Name = "Jim", + Age = 18, + Address = new Address() + { + City = "ShangHai", + Street = "PuDong", + } + }; + await dbContext.Set().AddAsync(student); + await dbContext.SaveChangesAsync(); + Assert.IsTrue(await dbContext.Set().CountAsync() == 1); + + dbContext.Set().Remove(student); + await dbContext.SaveChangesAsync(); + + Assert.IsTrue(await dbContext.Set().CountAsync() == 0); + + var dataFilter = serviceProvider.GetRequiredService(); + using (dataFilter.Disable()) + { + var count = await dbContext.Set().IgnoreQueryFilters().CountAsync(); + Assert.IsTrue(count == 1); + } + } + + [TestMethod] + public void TestAddMultiMasaDbContextReturnSaveChangeFilterEqual1() + { + var services = new ServiceCollection(); + services.AddMasaDbContext() + .AddMasaDbContext(); + + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestAddMasaDbContextReturnSaveChangeFilterEqual2() + { + var services = new ServiceCollection(); + services.AddMasaDbContext(opt => + { + opt.UseTestSqlite(Guid.NewGuid().ToString()).UseFilter(); + }); + + var serviceProvider = services.BuildServiceProvider(); + + var filters = serviceProvider.GetServices(); + Assert.IsTrue(filters.Count() == 2); + } + + [TestMethod] + public async Task TestGetPaginatedListAsyncReturnCountEqualResultCount() + { + Services.Configure(options => + { + options.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = $"data source=soft-delete-db-{Guid.NewGuid()}" + }; + }); + await using var dbContext = CreateDbContext(true, out IServiceProvider serviceProvider); + var students = new List() + { + new() + { + Id = 1, + Name = "Jim", + Age = 18, + Address = new Address() + { + City = "ShangHai", + Street = "PuDong", + } + }, + new() + { + Id = 2, + Name = "Tom", + Age = 20, + Address = new Address() + { + City = "ShangHai", + Street = "PuDong", + } + } + }; + await dbContext.Set().AddRangeAsync(students); + await dbContext.SaveChangesAsync(); + Assert.IsTrue(await dbContext.Set().CountAsync() == 2); + + var student = await dbContext.Set().FirstAsync(); + dbContext.Set().Remove(student); + await dbContext.SaveChangesAsync(); + + var result = await new Repository(dbContext).GetPaginatedListAsync(new PaginatedOptions() + { + Page = 1, + PageSize = 10 + }); + + Assert.IsTrue(result.Result.Count == result.Total); + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs new file mode 100644 index 000000000..b14e73e0e --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; + +[TestClass] +public class DefaultConnectionStringProviderTest +{ + [TestMethod] + public async Task TestGetConnectionStringAsyncReturnTest1() + { + IServiceCollection services = new ServiceCollection(); + services.Configure(options => + { + options.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = "Test1" + }; + }); + var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + var defaultConnectionStringProvider = new DefaultConnectionStringProvider(options); + var connectionString = await defaultConnectionStringProvider.GetConnectionStringAsync(); + Assert.AreEqual("Test1", connectionString); + } + + [TestMethod] + public async Task TestGetConnectionStringAsyncAndNameIsEmptyReturnTest1() + { + IServiceCollection services = new ServiceCollection(); + services.Configure(options => + { + options.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = "Test1" + }; + }); + var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + var defaultConnectionStringProvider = new DefaultConnectionStringProvider(options); + var connectionString = await defaultConnectionStringProvider.GetConnectionStringAsync(string.Empty); + Assert.AreEqual("Test1", connectionString); + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs new file mode 100644 index 000000000..14a21d266 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; + +internal class PaginatedOptions +{ + public int Page { get; set; } + + public int PageSize { get; set; } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs new file mode 100644 index 000000000..8977dee53 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs @@ -0,0 +1,35 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; + +internal class Repository +{ + private readonly CustomDbContext _testDbContext; + + public Repository(CustomDbContext testDbContext) => _testDbContext = testDbContext; + + public Task> GetPaginatedListAsync(int skip, int take, CancellationToken cancellationToken = default) + => _testDbContext.Set().Skip(skip).Take(take).ToListAsync(cancellationToken); + + public virtual async Task> GetPaginatedListAsync(PaginatedOptions options, CancellationToken cancellationToken = default) + { + var result = await GetPaginatedListAsync( + (options.Page - 1) * options.PageSize, + options.PageSize <= 0 ? int.MaxValue : options.PageSize, + cancellationToken + ); + + var total = await GetCountAsync(cancellationToken); + + return new BasePaginatedList() + { + Total = total, + Result = result, + TotalPages = (int)Math.Ceiling(total / (decimal)options.PageSize) + }; + } + + public async Task GetCountAsync(CancellationToken cancellationToken = default) + => await _testDbContext.Set().LongCountAsync(cancellationToken); +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj new file mode 100644 index 000000000..9eda3cadc --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,25 @@ + + + + net6.0 + enable + false + enable + + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs new file mode 100644 index 000000000..2909884f3 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; + +public class Address +{ + public string City { get; set; } = default!; + + public string Street { get; set; } = default!; +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs new file mode 100644 index 000000000..366e9a9b9 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; + +public class Hobby +{ + public Guid Id { get; set; } + + public string Name { get; set; } = default!; + + public string Description { get; set; } = default!; + + public Hobby() + { + Id = Guid.NewGuid(); + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs new file mode 100644 index 000000000..9850f1531 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; + +public class Student : ISoftDelete +{ + public int Id { get; set; } + + public string Name { get; set; } = default!; + + public int Age { get; set; } + + public bool IsDeleted { get; private set; } = default!; + + public Address Address { get; set; } = default!; + + public List Hobbies { get; set; } = default!; +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs new file mode 100644 index 000000000..1f6585563 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; + +public class TestBase +{ + protected IServiceCollection Services; + + [TestInitialize] + public void Initialize() + { + Services = new ServiceCollection(); + } + + protected CustomDbContext CreateDbContext(bool enableSoftDelete, out IServiceProvider serviceProvider, + bool initConnectionString = true) + { + Services.AddMasaDbContext(options => + { + if (enableSoftDelete) + options.UseTestFilter(); + + if (initConnectionString) + options.UseTestSqlite($"data source=test-{Guid.NewGuid()}"); + else + options.UseSqlite(); + }); + serviceProvider = Services.BuildServiceProvider(); + var dbContext = serviceProvider.GetRequiredService(); + dbContext.Database.EnsureCreated(); + return dbContext; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs new file mode 100644 index 000000000..ad5bdcf50 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; +global using Masa.BuildingBlocks.Data.Contracts.Paginated; +global using Masa.Contrib.Data.Contracts.EF; +global using Masa.Contrib.Data.EntityFrameworkCore.Filters; +global using Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; +global using Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs new file mode 100644 index 000000000..243a36930 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public class DbConnectionStringProvider : BaseDbConnectionStringProvider +{ + private readonly IOptionsMonitor _options; + + public DbConnectionStringProvider(IOptionsMonitor options) => _options = options; + + protected override List GetDbContextOptionsList() + => _options.CurrentValue.ConnectionStrings.Select(item => new MasaDbContextConfigurationOptions(item.Value)).Distinct().ToList(); +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs new file mode 100644 index 000000000..d351e6dce --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public class DefaultConnectionStringProvider : IConnectionStringProvider +{ + private readonly IOptionsMonitor _options; + + public DefaultConnectionStringProvider(IOptionsMonitor options) => _options = options; + + public Task GetConnectionStringAsync(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) => Task.FromResult(GetConnectionString(name)); + + public string GetConnectionString(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) + { + if (string.IsNullOrEmpty(name)) + return _options.CurrentValue.ConnectionStrings.DefaultConnection; + + return _options.CurrentValue.ConnectionStrings.GetConnectionString(name); + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs new file mode 100644 index 000000000..505fc7ff0 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public static class EntityTypeBuilderExtensions +{ + private const int _maxLength = 36; + + public static void TryConfigureConcurrencyStamp( + this EntityTypeBuilder entityTypeBuilder, + string? propertyName) + => entityTypeBuilder.TryConfigureConcurrencyStamp(_maxLength, propertyName); + + public static void TryConfigureConcurrencyStamp( + this EntityTypeBuilder entityTypeBuilder, + int maxLength = _maxLength, + string? propertyName = null) + { + if (entityTypeBuilder.Metadata.ClrType.IsAssignableTo(typeof(IHasConcurrencyStamp))) + { + entityTypeBuilder.Property(nameof(IHasConcurrencyStamp.RowVersion)) + .IsConcurrencyToken() + .HasMaxLength(maxLength) + .HasColumnName(propertyName ?? nameof(IHasConcurrencyStamp.RowVersion)); + } + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs new file mode 100644 index 000000000..ac9e73fc4 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Filters; + +public interface ISaveChangesFilter +{ + void OnExecuting(ChangeTracker changeTracker); +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs new file mode 100644 index 000000000..f9daadfe5 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore.Filters; + +public class SaveChangeFilter : ISaveChangesFilter + where TDbContext : DbContext +{ + private readonly Type _userIdType; + private readonly IUserContext? _userContext; + + public SaveChangeFilter(IUserContext? userContext = null) + { + _userIdType = typeof(TUserId); + _userContext = userContext; + } + + public void OnExecuting(ChangeTracker changeTracker) + { + changeTracker.DetectChanges(); + + foreach (var entity in changeTracker.Entries() + .Where(entry => entry.Entity is IAuditEntity && + (entry.State == EntityState.Added || entry.State == EntityState.Modified))) + { + var userId = GetUserId(_userContext?.UserId); + if (entity.State == EntityState.Added) + { + if (userId != null) + { + entity.CurrentValues[nameof(IAuditEntity.Creator)] = userId; + entity.CurrentValues[nameof(IAuditEntity.Modifier)] = userId; + } + entity.CurrentValues[nameof(IAuditEntity.CreationTime)] = + DateTime.UtcNow; //The current time to change to localization after waiting for localization + } + else if (entity.CurrentValues[nameof(IAuditEntity.Modifier)] != default && userId != null) + { + entity.CurrentValues[nameof(IAuditEntity.Modifier)] = userId; + } + entity.CurrentValues[nameof(IAuditEntity.ModificationTime)] = + DateTime.UtcNow; //The current time to change to localization after waiting for localization + } + } + + private object? GetUserId(string? userId) + { + if (userId == null) + return null; + + if (_userIdType == typeof(Guid)) + return Guid.Parse(userId); + + return Convert.ChangeType(userId, _userIdType); + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs new file mode 100644 index 000000000..0fa3ebcb5 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public interface IModelCreatingProvider +{ + /// + /// For building DbContext models and their mappings + /// + /// + void Configure(ModelBuilder modelBuilder); +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj new file mode 100644 index 000000000..f1d673564 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs new file mode 100644 index 000000000..5d3a0d14e --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs @@ -0,0 +1,251 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public abstract class MasaDbContext : DbContext, IMasaDbContext +{ + private bool _isInitialize = false; + private IDataFilter? _dataFilter; + + protected IDataFilter? DataFilter + { + get + { + TryInitialize(); + return _dataFilter; + } + } + + protected readonly MasaDbContextOptions Options; + + private IDomainEventBus? _domainEventBus; + + protected IDomainEventBus? DomainEventBus + { + get + { + TryInitialize(); + return _domainEventBus; + } + } + + private IConcurrencyStampProvider? _concurrencyStampProvider; + + public IConcurrencyStampProvider? ConcurrencyStampProvider + { + get + { + TryInitialize(); + return _concurrencyStampProvider; + } + } + + public MasaDbContext(MasaDbContextOptions options) : base(options) + { + Options = options; + } + + protected virtual void TryInitialize() + { + if (!_isInitialize) Initialize(); + } + + protected virtual void Initialize() + { + _dataFilter = Options.ServiceProvider?.GetService(); + _domainEventBus = Options.ServiceProvider?.GetService(); + _concurrencyStampProvider = Options.ServiceProvider?.GetRequiredService(); + } + + /// + /// Automatic filter soft delete data. + /// When you override this method,you should call base.. + /// + /// + /// + protected sealed override void OnModelCreating(ModelBuilder modelBuilder) + { + OnModelCreatingExecuting(modelBuilder); + + OnModelCreatingConfigureGlobalFilters(modelBuilder); + + // null when run dotnet ef cli + if (Options == null) + { + base.OnModelCreating(modelBuilder); + return; + } + + foreach (var provider in Options.ModelCreatingProviders) + provider.Configure(modelBuilder); + } + + /// + /// Use this method instead of OnModelCreating + /// + /// + protected virtual void OnModelCreatingExecuting(ModelBuilder modelBuilder) + { + + } + + protected virtual void OnModelCreatingConfigureGlobalFilters(ModelBuilder modelBuilder) + { + var methodInfo = typeof(MasaDbContext).GetMethod(nameof(ConfigureGlobalFilters), BindingFlags.NonPublic | BindingFlags.Instance); + + foreach (var entityType in modelBuilder.Model.GetEntityTypes()) + { + methodInfo!.MakeGenericMethod(entityType.ClrType).Invoke(this, new object?[] { modelBuilder, entityType }); + } + } + + protected virtual void ConfigureGlobalFilters(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType) + where TEntity : class + { + if (mutableEntityType.BaseType == null) + { + var filterExpression = CreateFilterExpression(); + if (filterExpression != null) + modelBuilder.Entity().HasQueryFilter(filterExpression); + } + } + + protected virtual Expression>? CreateFilterExpression() + where TEntity : class + { + Expression>? expression = null; + + if (typeof(ISoftDelete).IsAssignableFrom(typeof(TEntity))) + { + expression = entity => !IsSoftDeleteFilterEnabled || !EF.Property(entity, nameof(ISoftDelete.IsDeleted)); + } + + return expression; + } + + protected virtual bool IsSoftDeleteFilterEnabled + => (Options?.EnableSoftDelete ?? false) && (DataFilter?.IsEnabled() ?? false); + + /// + /// Automatic soft delete. + /// + /// + /// + public override int SaveChanges() => SaveChanges(true); + + public sealed override int SaveChanges(bool acceptAllChangesOnSuccess) + { + OnBeforeSaveChanges(); + return base.SaveChanges(acceptAllChangesOnSuccess); + } + + protected virtual void OnBeforeSaveChanges() + { + if (Options != null) + { + UpdateRowVesion(ChangeTracker); + OnBeforeSaveChangesByFilters(); + DomainEventEnqueueAsync(ChangeTracker).ConfigureAwait(false).GetAwaiter().GetResult(); + } + } + + protected virtual async Task OnBeforeSaveChangesAsync() + { + if (Options != null) + { + UpdateRowVesion(ChangeTracker); + OnBeforeSaveChangesByFilters(); + await DomainEventEnqueueAsync(ChangeTracker); + } + } + + protected virtual void OnBeforeSaveChangesByFilters() + { + foreach (var filter in Options.SaveChangesFilters) + { + try + { + filter.OnExecuting(ChangeTracker); + } + catch (Exception ex) + { + throw new Exception("An error occured when intercept SaveChanges() or SaveChangesAsync()", ex); + } + } + } + + protected virtual async Task DomainEventEnqueueAsync(ChangeTracker changeTracker) + { + if (DomainEventBus == null) + return; + + var domainEntities = changeTracker + .Entries() + .Where(entry => entry.Entity.GetDomainEvents().Any()); + + var domainEvents = domainEntities + .SelectMany(entry => entry.Entity.GetDomainEvents()) + .ToList(); + + domainEntities.ToList() + .ForEach(entity => entity.Entity.ClearDomainEvents()); + + foreach (var domainEvent in domainEvents) + await DomainEventBus.Enqueue(domainEvent); + } + + protected virtual void UpdateRowVesion(ChangeTracker changeTracker) + { + if (ConcurrencyStampProvider == null) + return; + + var entries = changeTracker.Entries().Where(entry + => (entry.State == EntityState.Added || entry.State == EntityState.Modified || entry.State == EntityState.Deleted) && + entry.Entity is IHasConcurrencyStamp); + foreach (var entity in entries) + { + entity.CurrentValues[nameof(IHasConcurrencyStamp.RowVersion)] = ConcurrencyStampProvider.GetRowVersion(); + } + } + + /// + /// Automatic soft delete. + /// + /// + /// + /// + public override Task SaveChangesAsync(CancellationToken cancellationToken = default) => SaveChangesAsync(true, cancellationToken); + + /// + /// Automatic soft delete. + /// + /// + /// + /// + /// + public sealed override async Task SaveChangesAsync(bool acceptAllChangesOnSuccess, CancellationToken cancellationToken = default) + { + await OnBeforeSaveChangesAsync(); + return await base.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken); + } +} + +public abstract class MasaDbContext : MasaDbContext + where TDbContext : DbContext, IMasaDbContext +{ + public MasaDbContext(MasaDbContextOptions options) : base(options) + { + } + + protected override void OnModelCreatingConfigureGlobalFilters(ModelBuilder modelBuilder) + { + var methodInfo = + typeof(MasaDbContext).GetMethod(nameof(ConfigureGlobalFilters), BindingFlags.NonPublic | BindingFlags.Instance); + + foreach (var entityType in modelBuilder.Model.GetEntityTypes()) + { + methodInfo!.MakeGenericMethod(entityType.ClrType).Invoke(this, new object?[] { modelBuilder, entityType }); + } + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs new file mode 100644 index 000000000..2877a57f0 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public class MasaDbContextBuilder +{ + private IServiceProvider? _serviceProvider; + + public IServiceProvider ServiceProvider => _serviceProvider ??= Services.BuildServiceProvider(); + + public IServiceCollection Services { get; } + + public Type DbContextType { get; } + + public Type UserIdType { get; } + + public Action Builder { get; set; } = default!; + + public bool EnableSoftDelete { get; set; } + + public MasaDbContextBuilder(IServiceCollection services, Type dbContextType, Type userIdType) + { + Services = services; + DbContextType = dbContextType; + UserIdType = userIdType; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs new file mode 100644 index 000000000..68af024e7 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public abstract class MasaDbContextOptions : DbContextOptions +{ + public readonly IServiceProvider? ServiceProvider; + + public abstract IEnumerable ModelCreatingProviders { get; } + + /// + /// Can be used to intercept SaveChanges(Async) method + /// + public abstract IEnumerable SaveChangesFilters { get; } + + public bool EnableSoftDelete { get; } + + internal MasaDbContextOptions(IServiceProvider? serviceProvider, bool enableSoftDelete) + { + ServiceProvider = serviceProvider; + EnableSoftDelete = enableSoftDelete; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs new file mode 100644 index 000000000..eef2f8263 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public abstract class MasaDbContextOptionsBuilder +{ + internal IServiceProvider? ServiceProvider { get; } + + public bool EnableSoftDelete { get; } + + public virtual DbContextOptionsBuilder DbContextOptionsBuilder { get; } + + protected MasaDbContextOptionsBuilder(IServiceProvider? serviceProvider, MasaDbContextOptions options) + { + ServiceProvider = serviceProvider; + EnableSoftDelete = options.EnableSoftDelete; + DbContextOptionsBuilder = new DbContextOptionsBuilder(options); + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs new file mode 100644 index 000000000..dbfe6a65a --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public class MasaDbContextOptionsBuilder : MasaDbContextOptionsBuilder + where TDbContext : MasaDbContext, IMasaDbContext +{ + public MasaDbContextOptions MasaOptions + => new(ServiceProvider, (DbContextOptions)DbContextOptionsBuilder.Options, EnableSoftDelete); + + public MasaDbContextOptionsBuilder(bool enableSoftDelete = false) : this(null, enableSoftDelete) + { + } + + public MasaDbContextOptionsBuilder( + IServiceProvider? serviceProvider, + bool enableSoftDelete) + : base(serviceProvider, new MasaDbContextOptions(serviceProvider, new DbContextOptions(), enableSoftDelete)) + { + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs new file mode 100644 index 000000000..a00b7ad08 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs @@ -0,0 +1,71 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.EntityFrameworkCore; + +public class MasaDbContextOptions : MasaDbContextOptions + where TContext : DbContext +{ + private readonly DbContextOptions _originOptions; + + public MasaDbContextOptions( + IServiceProvider? serviceProvider, + DbContextOptions originOptions, + bool enableSoftDelete) : base(serviceProvider, enableSoftDelete) => _originOptions = originOptions; + + private IEnumerable? _modelCreatingProviders; + + /// + /// Can be used to filter data + /// + public override IEnumerable ModelCreatingProviders + => _modelCreatingProviders ??= ServiceProvider?.GetServices() ?? new List(); + + private IEnumerable? _saveChangesFilters; + + /// + /// Can be used to intercept SaveChanges(Async) method + /// + public override IEnumerable SaveChangesFilters + => _saveChangesFilters ??= ServiceProvider?.GetServices() ?? new List(); + + /// + /// + /// + public override Type ContextType => _originOptions.ContextType; + + /// + /// + /// + public override bool IsFrozen => _originOptions.IsFrozen; + + /// + /// + /// + public override IEnumerable Extensions => _originOptions.Extensions; + + /// + /// + /// + /// + /// + /// + public override DbContextOptions WithExtension(TExtension extension) + => _originOptions.WithExtension(extension); + + public override TExtension? FindExtension() where TExtension : class + => _originOptions.FindExtension(); + + /// + /// + /// + public override void Freeze() => _originOptions.Freeze(); + + /// + /// + /// + /// + /// + public override TExtension GetExtension() + => _originOptions.GetExtension(); +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md new file mode 100644 index 000000000..6d3f9645d --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md @@ -0,0 +1,47 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Data.EntityFrameworkCore + +## Example: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore +Install-Package Microsoft.EntityFrameworkCore.SqlServer +``` + +#### Basic usage: + +Using MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => +{ + optionsBuilder.UseFilter();//enable filtering + optionsBuilder.DbContextOptionsBuilder.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"); +}); +``` + +Recommended usage: + +- [SqlServer](../Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md) +- [MySql](../Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md) +- [Pomelo.MySql](../Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md) +- [Sqlite](../Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md) +- [Cosmos](../Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md) +- [InMemory](../Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md) +- [Oracle](../Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md) +- [PostgreSql](../Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md) + +#### data filter + +``` C# +public async Task GetAllAsync([FromServices] IRepository repository, [FromServices] IDataFilter dataFilter) +{ + // Temporarily disable soft delete filtering + using (dataFilter.Disable()) + { + var list = (await repository.GetListAsync()).ToList(); + return System.Text.Json.JsonSerializer.Serialize(list); + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md new file mode 100644 index 000000000..1f2182399 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md @@ -0,0 +1,48 @@ +中 | [EN](README.md) + +## Masa.Contrib.Data.EntityFrameworkCore + +## 用例: + +```c# +Install-Package Masa.Contrib.Data.EntityFrameworkCore +Install-Package Masa.Contrib.Data.Contracts.EF +Install-Package Microsoft.EntityFrameworkCore.SqlServer//这里以SqlServer举例 +``` + +#### 基本用法: + +使用MasaDbContext + +``` C# +builder.Services.AddMasaDbContext(optionsBuilder => +{ + optionsBuilder.UseFilter();//启用过滤 + optionsBuilder.DbContextOptionsBuilder.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"); +}); +``` + +推荐用法: + +- [SqlServer](../Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md) +- [MySql](../Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md) +- [Pomelo.MySql](../Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md) +- [Sqlite](../Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md) +- [Cosmos](../Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md) +- [InMemory](../Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md) +- [Oracle](../Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md) +- [PostgreSql](../Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md) + +#### 数据过滤器 + +``` C# +public async Task GetAllAsync([FromServices] IRepository repository, [FromServices] IDataFilter dataFilter) +{ + // 临时禁用软删除过滤 + using (dataFilter.Disable()) + { + var list = (await repository.GetListAsync()).ToList(); + return System.Text.Json.JsonSerializer.Serialize(list); + } +} +``` \ No newline at end of file diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..56c031de6 --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs @@ -0,0 +1,123 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddMasaDbContext( + this IServiceCollection services, + Action? optionsBuilder = null, + ServiceLifetime contextLifetime = ServiceLifetime.Scoped, + ServiceLifetime optionsLifetime = ServiceLifetime.Scoped) + where TDbContextImplementation : MasaDbContext, IMasaDbContext + => services.AddMasaDbContext(optionsBuilder, contextLifetime, optionsLifetime); + + public static IServiceCollection AddMasaDbContext( + this IServiceCollection services, + Action? optionsBuilder = null, + ServiceLifetime contextLifetime = ServiceLifetime.Scoped, + ServiceLifetime optionsLifetime = ServiceLifetime.Scoped) + where TDbContextImplementation : MasaDbContext, IMasaDbContext + where TUserId : IComparable + => services + .AddDbContext(contextLifetime, optionsLifetime) + .AddCoreServices(optionsBuilder, optionsLifetime); + + private static IServiceCollection AddCoreServices( + this IServiceCollection services, + Action? optionsBuilder, + ServiceLifetime optionsLifetime) + where TDbContextImplementation : MasaDbContext, IMasaDbContext + where TUserId : IComparable + { + services.TryAddConfigure(); + + MasaDbContextBuilder masaBuilder = new(services, typeof(TDbContextImplementation), typeof(TUserId)); + optionsBuilder?.Invoke(masaBuilder); + return services.AddCoreServices((serviceProvider, efDbContextOptionsBuilder) => + { + masaBuilder.Builder.Invoke(serviceProvider, efDbContextOptionsBuilder.DbContextOptionsBuilder); + }, masaBuilder.EnableSoftDelete, optionsLifetime); + } + + private static IServiceCollection AddCoreServices( + this IServiceCollection services, + Action? optionsBuilder, + bool enableSoftDelete, + ServiceLifetime optionsLifetime) + where TDbContextImplementation : MasaDbContext, IMasaDbContext + where TUserId : IComparable + { + services.TryAddSingleton(); + services.TryAddScoped(); + services.TryAddSingleton(); + + services.TryAdd( + new ServiceDescriptor( + typeof(MasaDbContextOptions), + serviceProvider => CreateMasaDbContextOptions(serviceProvider, optionsBuilder, enableSoftDelete), + optionsLifetime)); + + services.TryAdd( + new ServiceDescriptor( + typeof(MasaDbContextOptions), + serviceProvider => serviceProvider.GetRequiredService>(), + optionsLifetime)); + + services.TryAddEnumerable(new ServiceDescriptor(typeof(ISaveChangesFilter), + typeof(SaveChangeFilter), ServiceLifetime.Scoped)); + return services; + } + + private static MasaDbContextOptions CreateMasaDbContextOptions( + IServiceProvider serviceProvider, + Action? optionsBuilder, + bool enableSoftDelete) + where TDbContextImplementation : MasaDbContext, IMasaDbContext + { + var masaDbContextOptionsBuilder = new MasaDbContextOptionsBuilder(serviceProvider, enableSoftDelete); + optionsBuilder?.Invoke(serviceProvider, masaDbContextOptionsBuilder); + + return masaDbContextOptionsBuilder.MasaOptions; + } + + private static IServiceCollection TryAddConfigure( + this IServiceCollection services) + where TOptions : class + => services.TryAddConfigure(ConnectionStrings.DEFAULT_SECTION); + + /// + /// Only consider using MasaConfiguration and database configuration using local configuration + /// When using MasaConfiguration and the database configuration is stored in ConfigurationApi, you need to specify the mapping relationship in Configuration by yourself + /// + /// + /// + /// + /// + private static IServiceCollection TryAddConfigure( + this IServiceCollection services, + string sectionName) + where TOptions : class + { + services.AddOptions(); + var serviceProvider = services.BuildServiceProvider(); + IConfiguration? configuration = serviceProvider.GetService()?.Local ?? + serviceProvider.GetService(); + if (configuration == null) + return services; + + string name = Microsoft.Extensions.Options.Options.DefaultName; + var configurationSection = configuration.GetSection(sectionName); + if (!configurationSection.Exists()) + return services; + + services.TryAddSingleton>( + new ConfigurationChangeTokenSource(name, configuration)); + services.TryAddSingleton>(new NamedConfigureFromConfigurationOptions(name, + configuration, _ => + { + })); + return services; + } +} diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs new file mode 100644 index 000000000..be8768eeb --- /dev/null +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Configuration; +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; +global using Masa.BuildingBlocks.Data.Options; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; +global using Masa.BuildingBlocks.Ddd.Domain.Events; +global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Data.EntityFrameworkCore.Filters; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.ChangeTracking; +global using Microsoft.EntityFrameworkCore.Infrastructure; +global using Microsoft.EntityFrameworkCore.Metadata; +global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Options; +global using System.Linq.Expressions; +global using System.Reflection; diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs new file mode 100644 index 000000000..b6d21ebc7 --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs @@ -0,0 +1,37 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.UoW.EF; + +public class DefaultConnectionStringProvider : IConnectionStringProvider +{ + private readonly IUnitOfWorkAccessor _unitOfWorkAccessor; + private readonly IOptionsMonitor _options; + private readonly ILogger? _logger; + + public DefaultConnectionStringProvider( + IUnitOfWorkAccessor unitOfWorkAccessor, + IOptionsMonitor options, + ILogger? logger = null) + { + _unitOfWorkAccessor = unitOfWorkAccessor; + _options = options; + _logger = logger; + } + + public Task GetConnectionStringAsync(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) => Task.FromResult(GetConnectionString(name)); + + public string GetConnectionString(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) + { + if (_unitOfWorkAccessor.CurrentDbContextOptions != null) + return _unitOfWorkAccessor.CurrentDbContextOptions.ConnectionString; + + var connectionStrings = _options.CurrentValue.ConnectionStrings; + var connectionString = string.IsNullOrEmpty(name) ? connectionStrings.DefaultConnection : connectionStrings.GetConnectionString(name); + if (string.IsNullOrEmpty(connectionString)) + _logger?.LogError("Failed to get database connection string, please check whether the configuration of IOptionsSnapshot is abnormal"); + + _unitOfWorkAccessor.CurrentDbContextOptions = new MasaDbContextConfigurationOptions(connectionString); + return connectionString; + } +} diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs new file mode 100644 index 000000000..dfd338586 --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs @@ -0,0 +1,84 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.UoW.EF; + +public static class DispatcherOptionsExtensions +{ + public static IEventBusBuilder UseUoW( + this IEventBusBuilder eventBusBuilder, + Action? optionsBuilder = null, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + => eventBusBuilder.UseUoW(optionsBuilder, disableRollbackOnFailure, useTransaction); + + public static IEventBusBuilder UseUoW( + this IEventBusBuilder eventBusBuilder, + Action? optionsBuilder = null, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + where TUserId : IComparable + { + eventBusBuilder.Services.UseUoW(nameof(eventBusBuilder.Services), optionsBuilder, disableRollbackOnFailure, + useTransaction); + return eventBusBuilder; + } + + public static IDispatcherOptions UseUoW( + this IDispatcherOptions options, + Action? optionsBuilder = null, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + => options.UseUoW(optionsBuilder, disableRollbackOnFailure, useTransaction); + + public static IDispatcherOptions UseUoW( + this IDispatcherOptions options, + Action? optionsBuilder = null, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + where TUserId : IComparable + { + options.Services.UseUoW(nameof(options.Services), optionsBuilder, disableRollbackOnFailure, useTransaction); + return options; + } + + private static IServiceCollection UseUoW( + this IServiceCollection services, + string paramName, + Action? optionsBuilder = null, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + where TUserId : IComparable + { + if (services == null) + throw new ArgumentNullException(paramName); + + if (services.Any(service => service.ImplementationType == typeof(UoWProvider))) + return services; + + services.AddSingleton(); + services.TryAddScoped(); + services.TryAddSingleton>(); + services.TryAddScoped(); + + services.AddScoped(serviceProvider => new UnitOfWork(serviceProvider) + { + DisableRollbackOnFailure = disableRollbackOnFailure, + UseTransaction = useTransaction + }); + if (services.All(service => service.ServiceType != typeof(MasaDbContextOptions))) + services.AddMasaDbContext(optionsBuilder); + + services.AddScoped(); + return services; + } + + private class UoWProvider + { + } +} diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Internal/Const.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Internal/Const.cs new file mode 100644 index 000000000..7c0b9d177 --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Internal/Const.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.UoW.EF.Internal; + +internal class Const +{ + public const string DEFAULT_SECTION = "ConnectionStrings"; +} diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj new file mode 100644 index 000000000..30305bdae --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.md b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.md new file mode 100644 index 000000000..002778c9a --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.md @@ -0,0 +1,25 @@ +[中](README.zh-CN.md) | EN + +## UoW.EF + +Example: + +```C# +Install-Package Masa.Contrib.Dispatcher.Events +Install-Package Masa.Contrib.Data.UoW.EF +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. Configure appsettings.json +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity" + } +} +``` + +2. Use UoW +```C# +builder.Services.AddEventBus(eventBusBuilder => eventBusBuilder.UseUoW(dbOptions => dbOptions.UseSqlServer())); +``` \ No newline at end of file diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.zh-CN.md b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.zh-CN.md new file mode 100644 index 000000000..d2af8dc5c --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.zh-CN.md @@ -0,0 +1,25 @@ +中 | [EN](README.md) + +## UoW.EF + +用例: + +```C# +Install-Package Masa.Contrib.Dispatcher.Events +Install-Package Masa.Contrib.Data.UoW.EF +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. 配置appsettings.json +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity" + } +} +``` + +2. 使用UoW +```C# +builder.Services.AddEventBus(eventBusBuilder => eventBusBuilder.UseUoW(dbOptions => dbOptions.UseSqlServer())); +``` diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Transaction.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Transaction.cs new file mode 100644 index 000000000..664d8c2e7 --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Transaction.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.UoW.EF; + +public class Transaction : ITransaction +{ + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + public Transaction(IUnitOfWork unitOfWork) => UnitOfWork = unitOfWork; +} diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs new file mode 100644 index 000000000..bba189c70 --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs @@ -0,0 +1,109 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.UoW.EF; + +public class UnitOfWork : IUnitOfWork where TDbContext : MasaDbContext, IMasaDbContext +{ + public IServiceProvider ServiceProvider { get; } + + private DbContext? _context; + + protected DbContext Context => _context ??= ServiceProvider.GetRequiredService(); + + public DbTransaction Transaction + { + get + { + if (!UseTransaction) + throw new NotSupportedException("Doesn't support transaction opening"); + + if (TransactionHasBegun) + return Context.Database.CurrentTransaction!.GetDbTransaction(); + + return Context.Database.BeginTransaction().GetDbTransaction(); + } + } + + public bool TransactionHasBegun => Context.Database.CurrentTransaction != null; + + public bool DisableRollbackOnFailure { get; set; } + + public EntityState EntityState { get; set; } = EntityState.UnChanged; + + public CommitState CommitState { get; set; } = CommitState.Commited; + + public bool UseTransaction { get; set; } = true; + + public UnitOfWork(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; + + public async Task SaveChangesAsync(CancellationToken cancellationToken = default) + { + if (EntityState == EntityState.UnChanged) + return; + + await Context.SaveChangesAsync(cancellationToken); + EntityState = EntityState.UnChanged; + } + + public async Task CommitAsync(CancellationToken cancellationToken = default) + { + var domainEventBus = GetDomainEventBus(); + while (domainEventBus != null && await domainEventBus.AnyQueueAsync()) + { + await domainEventBus.PublishQueueAsync(); + + await SaveChangesAsync(cancellationToken); + } + + if (UseTransaction && TransactionHasBegun && CommitState == CommitState.UnCommited) + { + await Context.Database.CommitTransactionAsync(cancellationToken); + CommitState = CommitState.Commited; + } + } + + public async Task RollbackAsync(CancellationToken cancellationToken = default) + { + if (!UseTransaction || !TransactionHasBegun) + return; + + if (TransactionHasBegun) + { + DetachAll(); + await Context.Database.RollbackTransactionAsync(cancellationToken); + } + } + + /// + /// Release entity tracking, prevent pre-submit exceptions, be processed by other Handlers and continue execution + /// + private void DetachAll() + { + var entityEntrys = Context.ChangeTracker.Entries(); + foreach (var entry in entityEntrys) + { + if (entry != null) + { + entry.State = Microsoft.EntityFrameworkCore.EntityState.Detached; + } + } + } + + public Task AddDomainEventAsync(TDomainEvent @event) where TDomainEvent : class + { + var domainEventBus = GetDomainEventBus(); + if (domainEventBus == null || @event is not IDomainEvent domainEvent) + return Task.CompletedTask; + + domainEventBus.Enqueue(domainEvent); + return Task.CompletedTask; + } + + public async ValueTask DisposeAsync() => await (_context?.DisposeAsync() ?? ValueTask.CompletedTask); + + public void Dispose() => _context?.Dispose(); + + private IDomainEventBus? GetDomainEventBus() + => ServiceProvider.GetService(); +} diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs new file mode 100644 index 000000000..9f25b6e13 --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.UoW.EF; + +public class UnitOfWorkAccessor : IUnitOfWorkAccessor +{ + public MasaDbContextConfigurationOptions? CurrentDbContextOptions { get; set; } +} diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs new file mode 100644 index 000000000..39b9a2ad0 --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs @@ -0,0 +1,39 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.UoW.EF; + +public class UnitOfWorkManager : IUnitOfWorkManager where TDbContext : MasaDbContext, IMasaDbContext +{ + private readonly IServiceProvider _serviceProvider; + + public UnitOfWorkManager(IServiceProvider serviceProvider) => _serviceProvider = serviceProvider; + + /// + /// Create new DbContext + /// We create DbContext with lazy loading enabled by default + /// + /// Deferred creation of DbContext, easy to specify tenant or environment by yourself, which is very effective for physical isolation + /// + public IUnitOfWork CreateDbContext(bool lazyLoading = true) + { + var scope = _serviceProvider.CreateAsyncScope(); + if (!lazyLoading) + scope.ServiceProvider.GetRequiredService(); + + return scope.ServiceProvider.GetRequiredService(); + } + + public IUnitOfWork CreateDbContext(MasaDbContextConfigurationOptions options) + { + ArgumentNullException.ThrowIfNull(options, nameof(options)); + if (string.IsNullOrEmpty(options.ConnectionString)) + throw new ArgumentException($"Invalid {nameof(options)}"); + + var scope = _serviceProvider.CreateAsyncScope(); + var unitOfWorkAccessor = scope.ServiceProvider.GetRequiredService(); + unitOfWorkAccessor.CurrentDbContextOptions = options; + + return scope.ServiceProvider.GetRequiredService(); + } +} diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/_Imports.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/_Imports.cs new file mode 100644 index 000000000..87fb70f0c --- /dev/null +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/_Imports.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.Options; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Ddd.Domain.Events; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Data.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Storage; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using System.Data.Common; +global using System.Text.Json.Serialization; +global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs new file mode 100644 index 000000000..380088173 --- /dev/null +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.UoW.EF.Tests; + +public class CustomDbContext : MasaDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) { } + + public DbSet User { get; set; } + + protected override void OnModelCreatingExecuting(ModelBuilder builder) + { + builder.Entity(ConfigureUserEntry); + } + + void ConfigureUserEntry(EntityTypeBuilder builder) + { + builder.ToTable("Users"); + + builder.HasKey(e => e.Id); + + builder.Property(e => e.Id) + .IsRequired(); + + builder.Property(e => e.Name) + .HasMaxLength(6) + .IsRequired(); + } +} + +public class Users +{ + public Guid Id { get; private set; } + + public string Name { get; set; } = default!; + + public Users() + { + this.Id = Guid.NewGuid(); + } +} diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj new file mode 100644 index 000000000..f44ea2b43 --- /dev/null +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj @@ -0,0 +1,45 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + Always + + + + + + + + + + diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs new file mode 100644 index 000000000..8b06e74be --- /dev/null +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Data.UoW.EF.Tests; + +public class TestBase +{ + protected readonly string _connectionString = "DataSource=:memory:"; + protected readonly SqliteConnection Connection; + + protected TestBase() + { + Connection = new SqliteConnection(_connectionString); + Connection.Open(); + } + + public void Dispose() + { + Connection.Close(); + } +} diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs new file mode 100644 index 000000000..f3400d93b --- /dev/null +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs @@ -0,0 +1,279 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Microsoft.Extensions.Options; +using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; + +namespace Masa.Contrib.Data.UoW.EF.Tests; + +[TestClass] +public class TestUnitOfWork : TestBase +{ + private Mock _options; + + [TestInitialize] + public void Initialize() + { + _options = new(); + _options.Setup(option => option.Services).Returns(new ServiceCollection()).Verifiable(); + } + + [TestMethod] + public void TestAddUoWAndNullServices() + { + var options = new Mock(); + Assert.ThrowsException(() => options.Object.UseUoW()); + } + + [TestMethod] + public void TestAddUoWAndUseSqlLite() + { + _options.Object.UseUoW(options => options.UseTestSqlite(_connectionString)); + var serviceProvider = _options.Object.Services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetRequiredService()); + } + + [TestMethod] + public void TestAddMultUoW() + { + _options.Object + .UseUoW(options => options.UseTestSqlite(_connectionString)) + .UseUoW(options => options.UseTestSqlite(_connectionString)); + + var serviceProvider = _options.Object.Services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestTransaction() + { + Mock uoW = new(); + Assert.IsTrue(new Transaction(uoW.Object).UnitOfWork!.Equals(uoW.Object)); + } + + [TestMethod] + public async Task TestUseTranscationAsync() + { + _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); + var serviceProvider = _options.Object.Services.BuildServiceProvider(); + var dbContext = serviceProvider.GetRequiredService(); + await dbContext.Database.EnsureCreatedAsync(); + var uoW = serviceProvider.GetRequiredService(); + + var transaction = uoW.Transaction; + Users user = new Users() + { + Name = Guid.NewGuid().ToString() + }; + dbContext.Add(user); + uoW.EntityState = EntityState.Changed; + await uoW.SaveChangesAsync(); + uoW.CommitState = CommitState.UnCommited; + await uoW.RollbackAsync(); + + Assert.IsTrue(!dbContext.User.ToList().Any()); + } + + [TestMethod] + public async Task TestCommitAsync() + { + _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); + var serviceProvider = _options.Object.Services.BuildServiceProvider(); + var dbContext = serviceProvider.GetRequiredService(); + await dbContext.Database.EnsureCreatedAsync(); + var uoW = new UnitOfWork(serviceProvider); + var user = new Users() + { + Name = "Tom" + }; + var transcation = uoW.Transaction; + dbContext.User.Add(user); + uoW.EntityState = EntityState.Changed; + await uoW.SaveChangesAsync(); + uoW.CommitState = CommitState.UnCommited;//todo: Using Repository does not require manual changes to Commit status + await uoW.CommitAsync(); + + Assert.IsTrue(dbContext.User.ToList().Count == 1); + } + + [TestMethod] + public async Task TestOpenRollbackAsync() + { + _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); + var serviceProvider = _options.Object.Services.BuildServiceProvider(); + var dbContext = serviceProvider.GetRequiredService(); + await dbContext.Database.EnsureCreatedAsync(); + var uoW = serviceProvider.GetRequiredService(); + var user = new Users(); + var transcation = uoW.Transaction; + dbContext.User.Add(user); + await uoW.CommitAsync(); + + Assert.IsTrue(!await dbContext.User.AnyAsync()); + } + + [TestMethod] + public async Task TestAddLoggerAndOpenRollbackAsync() + { + _options.Object.Services.AddLogging(); + _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); + var serviceProvider = _options.Object.Services.BuildServiceProvider(); + var dbContext = serviceProvider.GetRequiredService(); + await dbContext.Database.EnsureCreatedAsync(); + var uoW = serviceProvider.GetRequiredService(); + var user = new Users(); + var transcation = uoW.Transaction; + dbContext.User.Add(user); + await uoW.CommitAsync(); + + Assert.IsTrue(!await dbContext.User.AnyAsync()); + } + + [TestMethod] + public void TestDataConnectionString() + { + IConfiguration configuration = new ConfigurationManager(); + _options.Object.Services.AddSingleton(_ => configuration); + _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); + var serviceProvider = _options.Object.Services.BuildServiceProvider(); + var dataConnectionStringProvider = serviceProvider.GetRequiredService(); + Assert.IsTrue(dataConnectionStringProvider.DbContextOptionsList.Count == 1 && + dataConnectionStringProvider.DbContextOptionsList.Any(option => option.ConnectionString == _connectionString)); + } + + [TestMethod] + public void TestUnitOfWorkManager() + { + _options.Object.UseUoW(options => options.UseTestSqlite(Connection)); + var serviceProvider = _options.Object.Services.BuildServiceProvider(); + var unitOfWorkManager = serviceProvider.GetRequiredService(); + var unitOfWork = serviceProvider.GetRequiredService(); + var dbContext = serviceProvider.GetRequiredService(); + var dbContext2 = serviceProvider.GetRequiredService(); + Assert.IsTrue(dbContext.Equals(dbContext2)); + + var newUnitOfWork = + unitOfWorkManager.CreateDbContext( + new MasaDbContextConfigurationOptions(_connectionString)); + Assert.IsFalse(newUnitOfWork.Equals(unitOfWork)); + var newDbContext = newUnitOfWork.ServiceProvider.GetRequiredService(); + Assert.IsFalse(dbContext.Equals(newDbContext)); + + Assert.ThrowsException(() + => unitOfWorkManager.CreateDbContext(new MasaDbContextConfigurationOptions(""))); + } + + [TestMethod] + public async Task TestUnitOfWorkAccessorAsync() + { + var services = new ServiceCollection(); + services.Configure(options => + { + options.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = _connectionString + }; + }); + _options.Setup(option => option.Services).Returns(services).Verifiable(); + _options.Object.UseUoW(options => options.UseSqlite()); + var serviceProvider = _options.Object.Services.BuildServiceProvider(); + var unitOfWorkAccessor = serviceProvider.GetService(); + Assert.IsTrue(unitOfWorkAccessor is { CurrentDbContextOptions: null }); + var unitOfWork = serviceProvider.GetRequiredService(); + Assert.IsNotNull(unitOfWork); + Assert.IsTrue(!unitOfWork.TransactionHasBegun); + unitOfWorkAccessor = serviceProvider.GetService(); + Assert.IsTrue(unitOfWorkAccessor!.CurrentDbContextOptions != null && unitOfWorkAccessor.CurrentDbContextOptions.ConnectionString == + _connectionString); + + var unitOfWorkManager = serviceProvider.GetRequiredService(); + var unitOfWorkNew = unitOfWorkManager.CreateDbContext(false); + var unitOfWorkAccessorNew = unitOfWorkNew.ServiceProvider.GetService(); + Assert.IsTrue(unitOfWorkAccessorNew!.CurrentDbContextOptions != null && + unitOfWorkAccessorNew.CurrentDbContextOptions.ConnectionString == + _connectionString); + + var unitOfWorkNew2 = + unitOfWorkManager.CreateDbContext(new MasaDbContextConfigurationOptions("test")); + var unitOfWorkAccessorNew2 = unitOfWorkNew2.ServiceProvider.GetService(); + Assert.IsTrue(unitOfWorkAccessorNew2!.CurrentDbContextOptions != null && + unitOfWorkAccessorNew2.CurrentDbContextOptions.ConnectionString == "test"); + + var connectionString = + await unitOfWorkNew2.ServiceProvider.GetRequiredService().GetConnectionStringAsync(); + Assert.IsTrue(connectionString == "test"); + } + + [TestMethod] + public void TestUnitOfWorkByEventBusBuilder() + { + var services = new ServiceCollection(); + services.Configure(options => + { + options.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = _connectionString + }; + }); + Mock eventBuilder = new(); + eventBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + eventBuilder.Object.UseUoW(options => options.UseSqlite()); + + var serviecProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviecProvider.GetService()); + Assert.IsNotNull(serviecProvider.GetService()); + Assert.IsNotNull(serviecProvider.GetService()); + } + + [TestMethod] + public void TestUnitOfWorkAndAddMasaConfiguationReturnUnitOfWorkIsNotNull() + { + var builder = WebApplication.CreateBuilder(); + builder.AddMasaConfiguration(); + Mock eventBuilder = new(); + eventBuilder.Setup(eb => eb.Services).Returns(builder.Services).Verifiable(); + eventBuilder.Object.UseUoW(options => options.UseSqlite()); + + var serviecProvider = builder.Services.BuildServiceProvider(); + Assert.IsNotNull(serviecProvider.GetService()); + Assert.IsNotNull(serviecProvider.GetService()); + Assert.IsNotNull(serviecProvider.GetService()); + + var customDbContext = serviecProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(customDbContext) == + serviecProvider.GetRequiredService().Local[ + "ConnectionStrings:DefaultConnection"]); + } + + [TestMethod] + public async Task TestGetConnectionStringAndCurrentDbContextOptionsAsyncReturnTest1() + { + Mock unitOfWorkAccessor = new(); + string connectionString = "Test1"; + unitOfWorkAccessor.Setup(accessor => accessor.CurrentDbContextOptions) + .Returns(new MasaDbContextConfigurationOptions(connectionString)); + var connectionStringProvider = new DefaultConnectionStringProvider(unitOfWorkAccessor.Object, null!); + Assert.IsTrue(await connectionStringProvider.GetConnectionStringAsync() == connectionString); + } + + [TestMethod] + public async Task TestGetConnectionStringAsyncReturnTest1() + { + Mock unitOfWorkAccessor = new(); + string connectionString = "Test1"; + IServiceCollection services = new ServiceCollection(); + services.Configure(options => + { + options.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = connectionString + }; + }); + var serviceProvider = services.BuildServiceProvider(); + var connectionStringProvider = new DefaultConnectionStringProvider(unitOfWorkAccessor.Object, + serviceProvider.GetRequiredService>()); + Assert.IsTrue(await connectionStringProvider.GetConnectionStringAsync() == connectionString); + } + + private string GetDataBaseConnectionString(CustomDbContext dbContext) => dbContext.Database.GetConnectionString()!; +} diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs new file mode 100644 index 000000000..0640ec664 --- /dev/null +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Configuration; +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.Options; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Data.EntityFrameworkCore; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Data.Sqlite; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; +global using System.Threading.Tasks; diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json new file mode 100644 index 000000000..de2c1c208 --- /dev/null +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json @@ -0,0 +1,5 @@ +{ + "ConnectionStrings": { + "DefaultConnection": "DataSource=:memory:" + } +} \ No newline at end of file diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs new file mode 100644 index 000000000..bb6151953 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Repository.EF; + +public static class DispatcherOptionsExtensions +{ + public static IDispatcherOptions UseRepository( + this IDispatcherOptions options) + where TDbContext : DbContext + { + if (options.Services == null) + throw new ArgumentNullException(nameof(options.Services)); + + if (options.Services.Any(service => service.ImplementationType == typeof(RepositoryProvider))) + return options; + + options.Services.AddSingleton(); + + if (options.Services.All(service => service.ServiceType != typeof(IUnitOfWork))) + throw new Exception("Please add UoW first."); + + options.Services.TryAddRepository(options.Assemblies); + return options; + } + + private class RepositoryProvider + { + + } +} diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs new file mode 100644 index 000000000..262255fc0 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs @@ -0,0 +1,96 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Repository.EF.Internal; + +internal static class LinqExtensions +{ + public static IQueryable GetQueryable(this IQueryable query, Dictionary fields) where TEntity : class + { + foreach (var field in fields) + { + query = query.GetQueryable(field.Key, field.Value); + } + return query; + } + + private static IQueryable GetQueryable(this IQueryable query, string field, object val) where TEntity : class + { + Type type = typeof(TEntity); + var parameter = Expression.Parameter(type, "entity"); + + PropertyInfo property = type.GetProperty(field)!; + Expression expProperty = Expression.Property(parameter, property.Name); + + Expression> valueLamda = () => val; + Expression expValue = Expression.Convert(valueLamda.Body, property.PropertyType); + Expression expression = Expression.Equal(expProperty, expValue); + Expression> filter = (Expression>)Expression.Lambda(expression, parameter); + return query.Where(filter); + } + + public static IQueryable OrderBy(this IQueryable query, Dictionary fields) where TEntity : class + { + var index = 0; + foreach (var field in fields) + { + if (index == 0) + query = query.OrderBy(field.Key, field.Value); + else + query = query.ThenBy(field.Key, field.Value); + index++; + } + + return query; + } + + internal static IQueryable OrderBy(this IQueryable query, string field, bool desc) where TEntity : class + { + ParameterExpression parameterExpression = Expression.Parameter(typeof(TEntity)); + Expression key = Expression.Property(parameterExpression, field); + var propertyInfo = GetPropertyInfo(typeof(TEntity), field); + var orderExpression = GetOrderExpression(typeof(TEntity), propertyInfo); + if (desc) + { + var method = typeof(Queryable).GetMethods().FirstOrDefault(m => m.Name == "OrderByDescending" && m.GetParameters().Length == 2); + var genericMethod = method!.MakeGenericMethod(typeof(TEntity), propertyInfo.PropertyType); + return (genericMethod.Invoke(null, new object[] { query, orderExpression }) as IQueryable)!; + } + else + { + var method = typeof(Queryable).GetMethods().FirstOrDefault(m => m.Name == "OrderBy" && m.GetParameters().Length == 2); + var genericMethod = method!.MakeGenericMethod(typeof(TEntity), propertyInfo.PropertyType); + return (IQueryable)genericMethod.Invoke(null, new object[] { query, orderExpression })!; + } + } + + private static IQueryable ThenBy(this IQueryable query, string field, bool desc) where T : class + { + ParameterExpression parameterExpression = Expression.Parameter(typeof(T)); + Expression key = Expression.Property(parameterExpression, field); + var propertyInfo = GetPropertyInfo(typeof(T), field); + var orderExpression = GetOrderExpression(typeof(T), propertyInfo); + if (desc) + { + var method = typeof(Queryable).GetMethods().FirstOrDefault(m => m.Name == "ThenByDescending" && m.GetParameters().Length == 2); + var genericMethod = method!.MakeGenericMethod(typeof(T), propertyInfo.PropertyType); + return (genericMethod.Invoke(null, new object[] { query, orderExpression }) as IQueryable)!; + } + else + { + var method = typeof(Queryable).GetMethods().FirstOrDefault(m => m.Name == "ThenBy" && m.GetParameters().Length == 2); + var genericMethod = method!.MakeGenericMethod(typeof(T), propertyInfo.PropertyType); + return (IQueryable)genericMethod.Invoke(null, new object[] { query, orderExpression })!; + } + } + + private static PropertyInfo GetPropertyInfo(Type entityType, string field) + => entityType.GetProperties().FirstOrDefault(p => p.Name.Equals(field, StringComparison.OrdinalIgnoreCase))!; + + private static LambdaExpression GetOrderExpression(Type entityType, PropertyInfo propertyInfo) + { + var parametersExpression = Expression.Parameter(entityType); + var fieldExpression = Expression.PropertyOrField(parametersExpression, propertyInfo.Name); + return Expression.Lambda(fieldExpression, parametersExpression); + } +} diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs new file mode 100644 index 000000000..2dae71cb8 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs @@ -0,0 +1,73 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Repository.EF.Internal; + +internal static class ServiceCollectionRepositoryExtensions +{ + public static IServiceCollection TryAddRepository( + this IServiceCollection services, + params Assembly[] assemblies) + where TDbContext : DbContext + { + if (assemblies == null || assemblies.Length == 0) + { + throw new ArgumentNullException(nameof(assemblies)); + } + + var allTypes = assemblies.SelectMany(assembly => assembly.GetTypes()).ToList(); + var entityTypes = allTypes.Where(type => type.IsEntity()); + foreach (var entityType in entityTypes) + { + var repositoryInterfaceType = typeof(IRepository<>).MakeGenericType(entityType); + services.TryAddAddDefaultRepository(repositoryInterfaceType, GetRepositoryImplementationType(typeof(TDbContext), entityType)); + services.TryAddCustomRepository(repositoryInterfaceType, allTypes); + + if (typeof(IEntity<>).IsGenericInterfaceAssignableFrom(entityType)) + { + var fieldType = entityType.GetProperty("Id")!.PropertyType; + repositoryInterfaceType = typeof(IRepository<,>).MakeGenericType(entityType, fieldType); + services.TryAddAddDefaultRepository(repositoryInterfaceType, + GetRepositoryImplementationType(typeof(TDbContext), entityType, fieldType)); + services.TryAddCustomRepository(repositoryInterfaceType, allTypes); + } + } + + return services; + } + + private static bool IsEntity(this Type type) + => type.IsClass && !type.IsGenericType && !type.IsAbstract && typeof(IEntity).IsAssignableFrom(type); + + private static void TryAddCustomRepository(this IServiceCollection services, Type repositoryInterfaceType, List allTypes) + { + var customerRepositoryInterfaceTypes = allTypes.Where(type + => type.GetInterfaces().Any(t => t == repositoryInterfaceType) && type.IsInterface && !type.IsGenericType); + foreach (var customerRepositoryInterfaceType in customerRepositoryInterfaceTypes) + { + var customerRepositoryImplementationTypes = + allTypes.Where(type => type.IsClass && customerRepositoryInterfaceType.IsAssignableFrom(type)).ToList(); + if (customerRepositoryImplementationTypes.Count != 1) + { + throw new NotSupportedException( + $"The number of types of {customerRepositoryInterfaceType.FullName} implementation classes must be 1"); + } + services.TryAddScoped(customerRepositoryInterfaceType, customerRepositoryImplementationTypes.FirstOrDefault()!); + } + } + + private static void TryAddAddDefaultRepository(this IServiceCollection services, Type repositoryInterfaceType, + Type repositoryImplementationType) + { + if (repositoryInterfaceType.IsAssignableFrom(repositoryImplementationType)) + { + services.TryAddScoped(repositoryInterfaceType, repositoryImplementationType); + } + } + + private static Type GetRepositoryImplementationType(Type dbContextType, Type entityType) + => typeof(Repository<,>).MakeGenericType(dbContextType, entityType); + + private static Type GetRepositoryImplementationType(Type dbContextType, Type entityType, Type keyType) + => typeof(Repository<,,>).MakeGenericType(dbContextType, entityType, keyType); +} diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs new file mode 100644 index 000000000..50746c304 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Repository.EF.Internal; + +internal static class TypeExtensions +{ + public static bool IsConcrete(this Type type) => !type.GetTypeInfo().IsAbstract && !type.GetTypeInfo().IsInterface; + + public static bool IsGenericInterfaceAssignableFrom(this Type eventHandlerType, Type type) => + type.IsConcrete() && + type.GetInterfaces().Any(t => t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == eventHandlerType); +} diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj new file mode 100644 index 000000000..92f9c2eff --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.md new file mode 100644 index 000000000..08c0f8c37 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.md @@ -0,0 +1,71 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Ddd.Domain.Repository.EF + +Example: + +```c# +Install-Package Masa.Contrib.Ddd.Domain.Repository.EF +``` + +> Advantages: The EF version of IRepository provides basic CRUD + +1. Add Repository.EF + +```c# +builder.Services +.AddDomainEventBus(options => +{ + options.UseRepository();//Use the EF version of Repository to achieve +} +``` + +2. How to use + +```C# +public class ProductItem +{ + public string Name { get; set; } +} + +public class DemoService : ServiceBase +{ + public CatalogService(IServiceCollection services) : base(services) + { + + } + + public async Task CreateProduct(ProductItem product,[FromService]IRepository repository) + { + await repository.AddAsync(product); + await repository.UnitOfWork.SaveChangesAsync(); + } +} +``` + +If the method defined by IRepository is not enough to support the business, you can custom the Repository + +```C# +public interface IProductRepository : IRepository +{ + Task> ItemsWithNameAsync(string name); +} + +public class ProductRepository : Repository, IProductRepository +{ + public Task> ItemsWithNameAsync(string name) + { + //Todo + } +} +``` + +In use: + +```C# +public async Task> ItemsWithNameAsync(string name, [FromService] IProductRepository productRepository) +{ + return await productRepository.ItemsWithNameAsync(name); +} +``` + diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md new file mode 100644 index 000000000..4770e9e1c --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md @@ -0,0 +1,71 @@ +中 | [EN](README.md) + +## Masa.Contrib.Ddd.Domain.Repository.EF + +用例: + +```c# +Install-Package Masa.Contrib.Ddd.Domain.Repository.EF +``` + +> 优势:IRepository的EF版实现,提供了基础的CRUD + +1. 添加Repository.EF + +```c# +builder.Services +.AddDomainEventBus(options => +{ + options.UseRepository();//使用Repository的EF版实现 +} +``` + +2. 如何使用 + +```C# +public class ProductItem +{ + public string Name { get; set; } +} + +public class DemoService : ServiceBase +{ + public CatalogService(IServiceCollection services) : base(services) + { + + } + + public async Task CreateProduct(ProductItem product,[FromService]IRepository repository) + { + await repository.AddAsync(product); + await repository.UnitOfWork.SaveChangesAsync(); + } +} +``` + +如果IRepository定义的方法不足以支撑业务,则可以自定义Repository + +```C# +public interface IProductRepository : IRepository +{ + Task> ItemsWithNameAsync(string name); +} + +public class ProductRepository : Repository, IProductRepository +{ + public Task> ItemsWithNameAsync(string name) + { + //Todo + } +} +``` + +在使用上: + +```C# +public async Task> ItemsWithNameAsync(string name, [FromService] IProductRepository productRepository) +{ + return await productRepository.ItemsWithNameAsync(name); +} +``` + diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs new file mode 100644 index 000000000..08d615825 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs @@ -0,0 +1,227 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Repository.EF; + +public class Repository : + BaseRepository + where TEntity : class, IEntity + where TDbContext : DbContext +{ + protected TDbContext Context { get; } + + public Repository(TDbContext context, IUnitOfWork unitOfWork) : base(unitOfWork.ServiceProvider) + { + Context = context; + UnitOfWork = unitOfWork; + } + + public override IUnitOfWork UnitOfWork { get; } + + public override EntityState EntityState + { + get => UnitOfWork.EntityState; + set + { + UnitOfWork.EntityState = value; + if (value == EntityState.Changed) + CheckAndOpenTransaction(); + } + } + + public override async ValueTask AddAsync( + TEntity entity, + CancellationToken cancellationToken = default) + { + var response = (await Context.AddAsync(entity, cancellationToken).AsTask()).Entity; + EntityState = EntityState.Changed; + return response; + } + + public override async Task AddRangeAsync( + IEnumerable entities, + CancellationToken cancellationToken = default) + { + await Context.AddRangeAsync(entities, cancellationToken); + EntityState = EntityState.Changed; + } + + public override Task FindAsync( + IEnumerable> keyValues, + CancellationToken cancellationToken = default) + { + Dictionary fields = new(keyValues); + return Context.Set().IgnoreQueryFilters().GetQueryable(fields).FirstOrDefaultAsync(cancellationToken); + } + + public override Task FindAsync( + Expression> predicate, + CancellationToken cancellationToken = default) + => Context.Set().Where(predicate).FirstOrDefaultAsync(cancellationToken); + + public override async Task GetCountAsync(CancellationToken cancellationToken = default) + => await Context.Set().LongCountAsync(cancellationToken); + + public override Task GetCountAsync( + Expression> predicate, + CancellationToken cancellationToken = default) + => Context.Set().LongCountAsync(predicate, cancellationToken); + + public override async Task> GetListAsync(CancellationToken cancellationToken = default) + => await Context.Set().ToListAsync(cancellationToken); + + public override async Task> GetListAsync(string sortField, bool isDescending = true, + CancellationToken cancellationToken = default) + => await Context.Set().OrderBy(sortField, isDescending).ToListAsync(cancellationToken); + + public override async Task> GetListAsync( + Expression> predicate, + CancellationToken cancellationToken = default) + => await Context.Set().Where(predicate).ToListAsync(cancellationToken); + + public override async Task> GetListAsync( + Expression> predicate, + string sortField, + bool isDescending = true, + CancellationToken cancellationToken = default) + => await Context.Set().OrderBy(sortField, isDescending).Where(predicate).ToListAsync(cancellationToken); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + public override Task> GetPaginatedListAsync(int skip, int take, string sortField, bool isDescending, + CancellationToken cancellationToken = default) + => Context.Set().OrderBy(sortField, isDescending).Skip(skip).Take(take).ToListAsync(cancellationToken); + + /// + /// Get a paginated list after sorting according to skip and take + /// + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + public override Task> GetPaginatedListAsync( + int skip, + int take, + Dictionary? sorting = null, + CancellationToken cancellationToken = default) + { + sorting ??= new Dictionary(); + + return Context.Set().OrderBy(sorting).Skip(skip).Take(take).ToListAsync(cancellationToken); + } + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Sort field name + /// true descending order, false ascending order, default: true + /// + /// + public override Task> GetPaginatedListAsync(Expression> predicate, int skip, int take, + string sortField, + bool isDescending = true, CancellationToken cancellationToken = default) + => Context.Set().Where(predicate).OrderBy(sortField, isDescending).Skip(skip).Take(take).ToListAsync(cancellationToken); + + /// + /// Get a paginated list after sorting by condition + /// + /// A function to test each element for a condition + /// The number of elements to skip before returning the remaining elements + /// The number of elements to return + /// Key: sort field name, Value: true descending order, false ascending order + /// + /// + public override Task> GetPaginatedListAsync( + Expression> predicate, + int skip, + int take, + Dictionary? sorting = null, + CancellationToken cancellationToken = default) + { + sorting ??= new Dictionary(); + + return Context.Set().Where(predicate).OrderBy(sorting).Skip(skip).Take(take).ToListAsync(cancellationToken); + } + + public override Task RemoveAsync(TEntity entity, CancellationToken cancellationToken = default) + { + Context.Set().Remove(entity); + EntityState = EntityState.Changed; + return Task.FromResult(entity); + } + + public override async Task RemoveAsync(Expression> predicate, CancellationToken cancellationToken = default) + { + var entities = await GetListAsync(predicate, cancellationToken); + EntityState = EntityState.Changed; + Context.Set().RemoveRange(entities); + } + + public override Task RemoveRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) + { + Context.Set().RemoveRange(entities); + EntityState = EntityState.Changed; + return Task.CompletedTask; + } + + public override Task UpdateAsync(TEntity entity, CancellationToken cancellationToken = default) + { + Context.Set().Update(entity); + EntityState = EntityState.Changed; + return Task.FromResult(entity); + } + + public override Task UpdateRangeAsync(IEnumerable entities, CancellationToken cancellationToken = default) + { + Context.Set().UpdateRange(entities); + EntityState = EntityState.Changed; + return Task.CompletedTask; + } + + /// + /// When additions, deletions and changes are made through the Repository and the transaction is currently allowed and the transaction is not opened, the transaction is started + /// + private void CheckAndOpenTransaction() + { + if (!UnitOfWork.UseTransaction) + return; + + if (!UnitOfWork.TransactionHasBegun) + { + _ = UnitOfWork.Transaction; // Open the transaction + } + CommitState = CommitState.UnCommited; + } +} + +public class Repository : + Repository, + IRepository + where TEntity : class, IEntity + where TDbContext : DbContext + where TKey : IComparable +{ + public Repository(TDbContext context, IUnitOfWork unitOfWork) : base(context, unitOfWork) + { + } + + public virtual Task FindAsync(TKey id, CancellationToken cancellationToken = default) + => Context.Set().FirstOrDefaultAsync(entity => entity.Id.Equals(id), cancellationToken); + + public virtual Task RemoveAsync(TKey id, CancellationToken cancellationToken = default) + => base.RemoveAsync(entity => entity.Id.Equals(id), cancellationToken); + + public virtual Task RemoveRangeAsync(IEnumerable ids, CancellationToken cancellationToken = default) + => base.RemoveAsync(entity => ids.Contains(entity.Id), cancellationToken); +} diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs new file mode 100644 index 000000000..5fea19f73 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Ddd.Domain.Repository.EF.Internal; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Storage; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using System.Data.Common; +global using System.Linq.Expressions; +global using System.Reflection; +global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; +global using System.Runtime.CompilerServices; diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainEventBus.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainEventBus.cs new file mode 100644 index 000000000..fa7ac6dc7 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainEventBus.cs @@ -0,0 +1,79 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain; + +public class DomainEventBus : IDomainEventBus +{ + private readonly IEventBus _eventBus; + private readonly IIntegrationEventBus _integrationEventBus; + private readonly IUnitOfWork _unitOfWork; + private readonly DispatcherOptions _options; + + private readonly ConcurrentQueue _eventQueue = new(); + + public DomainEventBus( + IEventBus eventBus, + IIntegrationEventBus integrationEventBus, + IUnitOfWork unitOfWork, + IOptions options) + { + _eventBus = eventBus; + _integrationEventBus = integrationEventBus; + _unitOfWork = unitOfWork; + _options = options.Value; + } + + public async Task PublishAsync(TEvent @event) where TEvent : IEvent + { + if (@event is IDomainEvent domainEvent && !IsAssignableFromDomainQuery(@event.GetType())) + { + domainEvent.UnitOfWork = _unitOfWork; + } + if (@event is IIntegrationEvent integrationEvent) + { + integrationEvent.UnitOfWork ??= _unitOfWork; + await _integrationEventBus.PublishAsync(integrationEvent); + } + else + { + await _eventBus.PublishAsync(@event); + } + + bool IsAssignableFromDomainQuery(Type? type) + { + if (type == null) + return false; + + if (!type.IsGenericType) + { + return IsAssignableFromDomainQuery(type.BaseType); + } + return type.GetInterfaces().Any(type => type.GetGenericTypeDefinition() == typeof(IDomainQuery<>)); + } + } + + public Task Enqueue(TDomainEvent @event) where TDomainEvent : IDomainEvent + { + _eventQueue.Enqueue(@event); + return Task.CompletedTask; + } + + public async Task PublishQueueAsync() + { + while (_eventQueue.TryDequeue(out IDomainEvent? @event)) + { + await PublishAsync(@event); + } + } + + public Task AnyQueueAsync() + { + return Task.FromResult(_eventQueue.Count > 0); + } + + public async Task CommitAsync(CancellationToken cancellationToken = default) + => await _unitOfWork.CommitAsync(cancellationToken); + + public IEnumerable GetAllEventTypes() => _options.AllEventTypes.Concat(_eventBus.GetAllEventTypes()).Distinct(); +} diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainService.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainService.cs new file mode 100644 index 000000000..488f0c13a --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/DomainService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain; + +public class DomainService : IDomainService +{ + public IDomainEventBus EventBus { get; } + + public DomainService(IDomainEventBus eventBus) => EventBus = eventBus; +} diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj new file mode 100644 index 000000000..667fa1fbb --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/Masa.Contrib.Ddd.Domain.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs new file mode 100644 index 000000000..576290ace --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/Options/DispatcherOptions.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Options; + +public class DispatcherOptions : IDistributedDispatcherOptions +{ + public IServiceCollection Services { get; } + + public Assembly[] Assemblies { get; } + + private bool IsAggregateRootEntity(Type type) + => type.IsClass && !type.IsGenericType && !type.IsAbstract && type != typeof(AggregateRoot) && + typeof(IAggregateRoot).IsAssignableFrom(type); + + private IEnumerable Types { get; set; } + + private IEnumerable GetTypes(Type type) => Types.Where(t => t.IsClass && type.IsAssignableFrom(t)); + + internal List AllEventTypes { get; private set; } + + internal List AllDomainServiceTypes { get; private set; } + + internal List AllAggregateRootTypes { get; private set; } + + private DispatcherOptions(IServiceCollection services) => Services = services; + + public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) + : this(services) + { + if (assemblies == null || assemblies.Length == 0) + throw new ArgumentException(nameof(assemblies)); + + Assemblies = assemblies; + Types = assemblies.SelectMany(assembly => assembly.GetTypes()); + AllEventTypes = GetTypes(typeof(IEvent)).ToList(); + AllDomainServiceTypes = GetTypes(typeof(DomainService)).ToList(); + AllAggregateRootTypes = GetTypes(typeof(IAggregateRoot)).Where(IsAggregateRootEntity).ToList(); + } +} diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md new file mode 100644 index 000000000..673abbee7 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md @@ -0,0 +1,125 @@ +[中](README.zh-CN.md) | EN + +### DomainEventBus + +Example: + +```c# +Install-Package Masa.Contrib.Ddd.Domain +Install-Package Masa.Contrib.Ddd.Domain.Repository.EF + +Install-Package Masa.Contrib.Dispatcher.Events + +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +Install-Package Masa.Contrib.Data.UoW.EF +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. Add DomainEventBus + +```C# +builder.Services +.AddDomainEventBus(options => +{ + options.UseIntegrationEventBus(opt => + { + opt.UseDapr(); + opt.UseEventLog();//Use cross-process events + }); + options + // .UseEventBus(eventBuilder => eventBuilder.UseMiddleware(typeof(ValidatorMiddleware<>))) // Use in-process events and use middleware + .UseEventBus() // Use in-process events + .UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=idientity")) + .UseRepository();//Use the EF version of Repository to achieve +}) +``` + +2. Add DomainCommand + +```C# +public class RegisterUserDomainCommand : DomainCommand +{ + public string User { get; set; } = default!; + + public string Password { get; set; } = default!; + + public string PhoneNumber { get; set; } = default!; +} +``` +> DomainQuery refers to Query in Cqrs + +3. Add Handler (in process) + +```C# +public class UserHandler +{ + [EventHandler] + public Task RegisterUserHandlerAsync(RegisterUserDomainCommand command) + { + //TODO Registered user business + } +} +``` + +4. Send DomainCommand + +```C# +IDomainEventBus eventBus;//Get IDomainEventBus through DI +await eventBus.PublishAsync(new RegisterUserDomainCommand());//Send DomainCommand +``` + +5. Define domain events + +```C# +public class RegisterUserSucceededIntegrationEvent : IntegrationDomainEvent +{ + public override string Topic { get; set; } = nameof(RegisterUserSucceededIntegrationEvent); + + public string Account { get; set; } = default!; +} + +public class RegisterUserSucceededEvent : DomainEvent +{ + public string Account { get; set; } = default!; +} +``` + +6. Define domain services + +```C# +public class UserDomainService : DomainService +{ + public UserDomainService(IDomainEventBus eventBus) : base(eventBus) + { + } + + public async Task RegisterSucceededAsync(string account) + { + await EventBus.Enqueue(new RegisterUserSucceededIntegrationEvent() { Account = account }); + await EventBus.Enqueue(new RegisterUserSucceededEvent() { Account = account }); + await EventBus.PublishQueueAsync(); + } +} +``` + +> DomainEvent (in-process) and IntegrationDomainEvent (cross-process) can be inherited as needed +> +> If you only need to send a domain event, you can directly use EventBus.PublishQueueAsync(new RegisterUserSucceededEvent()) +> +> If you want to send in a unified way, you can send it through EventBus.Enqueue() and finally call EventBus.PublishQueueAsync() + +Tip: + +> 1. The use of DomainEventBus must require the implementation of IEventBus and IIntegrationEventBus and IUnitOfWork +> 2. EventBus only supports in-process scheduling, cross-process scheduling is not supported, and the sending order is consistent with the enqueue order, but the actual execution order is unknown + +7. Cross-process event subscription + +```C# +[Topic("pubsub", nameof(RegisterUserSucceededIntegrationEvent))] +public async Task RegisterUserSucceededHandlerAsync(RegisterUserSucceededIntegrationEvent @event) +{ + //todo +} +``` diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md new file mode 100644 index 000000000..f8af90b57 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md @@ -0,0 +1,125 @@ +中 | [EN](README.md) + +### DomainEventBus + +用例: + +```c# +Install-Package Masa.Contrib.Ddd.Domain +Install-Package Masa.Contrib.Ddd.Domain.Repository.EF + +Install-Package Masa.Contrib.Dispatcher.Events + +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +Install-Package Masa.Contrib.Data.UoW.EF +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. 添加DomainEventBus + +```C# +builder.Services +.AddDomainEventBus(options => +{ + options.UseIntegrationEventBus(opt => + { + opt.UseDapr(); + opt.UseEventLog();//使用跨进程事件 + }); + options + // .UseEventBus(eventBuilder => eventBuilder.UseMiddleware(typeof(ValidatorMiddleware<>))) // 使用进程内事件并使用中间件 + .UseEventBus()//使用进程内事件 + .UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=idientity")) + .UseRepository();//使用Repository的EF版实现 +}) +``` + +2. 添加DomainCommand + +```C# +public class RegisterUserDomainCommand : DomainCommand +{ + public string User { get; set; } = default!; + + public string Password { get; set; } = default!; + + public string PhoneNumber { get; set; } = default!; +} +``` +> DomainQuery参考Cqrs中的Query + +3. 添加Handler(进程内) + +```C# +public class UserHandler +{ + [EventHandler] + public Task RegisterUserHandlerAsync(RegisterUserDomainCommand command) + { + //TODO 注册用户业务 + } +} +``` + +4. 发送DomainCommand + +```C# +IDomainEventBus eventBus;//通过DI得到IDomainEventBus +await eventBus.PublishAsync(new RegisterUserDomainCommand());//发送DomainCommand +``` + +5. 定义领域事件 + +```C# +public class RegisterUserSucceededIntegrationEvent : IntegrationDomainEvent +{ + public override string Topic { get; set; } = nameof(RegisterUserSucceededIntegrationEvent); + + public string Account { get; set; } = default!; +} + +public class RegisterUserSucceededEvent : DomainEvent +{ + public string Account { get; set; } = default!; +} +``` + +6. 定义领域服务 + +```C# +public class UserDomainService : DomainService +{ + public UserDomainService(IDomainEventBus eventBus) : base(eventBus) + { + } + + public async Task RegisterSucceededAsync(string account) + { + await EventBus.Enqueue(new RegisterUserSucceededIntegrationEvent() { Account = account }); + await EventBus.Enqueue(new RegisterUserSucceededEvent() { Account = account }); + await EventBus.PublishQueueAsync(); + } +} +``` + +> 可根据需要继承DomainEvent(进程内)、IntegrationDomainEvent(跨进程) +> +> 如果只需要发送一个领域事件,则可以直接使用EventBus.PublishQueueAsync(new RegisterUserSucceededEvent())即可 +> +> 如果希望统一发送,则可以通过EventBus.Enqueue()、最后调用EventBus.PublishQueueAsync()发送 + +提示: + +> 1. 使用DomainEventBus必须要求实现IEventBus以及IIntegrationEventBus以及IUnitOfWork +> 2. EventBus只支持进程内编排、跨进程不支持编排,发送顺序与入队顺序一致,但实际执行顺序未知 + +7. 跨进程事件订阅 + +```C# +[Topic("pubsub", nameof(RegisterUserSucceededIntegrationEvent))] +public async Task RegisterUserSucceededHandlerAsync(RegisterUserSucceededIntegrationEvent @event) +{ + //todo +} +``` diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..38a459fc6 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/ServiceCollectionExtensions.cs @@ -0,0 +1,64 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddDomainEventBus( + this IServiceCollection services, + Action? options = null) + => services.AddDomainEventBus(AppDomain.CurrentDomain.GetAssemblies(), options); + + public static IServiceCollection AddDomainEventBus( + this IServiceCollection services, + Assembly[] assemblies, + Action? options = null) + { + if (services.Any(service => service.ImplementationType == typeof(DomainEventBusProvider))) + return services; + + services.AddSingleton(); + + var dispatcherOptions = new DispatcherOptions(services, assemblies); + options?.Invoke(dispatcherOptions); + services.AddSingleton(typeof(IOptions), _ => Microsoft.Extensions.Options.Options.Create(dispatcherOptions)); + + if (services.All(service => service.ServiceType != typeof(IEventBus))) + throw new Exception("Please add EventBus first."); + + if (services.All(service => service.ServiceType != typeof(IUnitOfWork))) + throw new Exception("Please add UoW first."); + + if (services.All(service => service.ServiceType != typeof(IIntegrationEventBus))) + throw new Exception("Please add IntegrationEventBus first."); + + services.CheckAggregateRootRepositories(dispatcherOptions.AllAggregateRootTypes); + + foreach (var domainServiceType in dispatcherOptions.AllDomainServiceTypes) + { + services.TryAddScoped(domainServiceType); + } + + services.TryAddScoped(); + services.TryAddScoped(); + return services; + } + + private static void CheckAggregateRootRepositories(this IServiceCollection services, List aggregateRootRepositoryTypes) + { + foreach (var aggregateRootRepositoryType in aggregateRootRepositoryTypes) + { + var serviceType = GetServiceRepositoryType(aggregateRootRepositoryType); + if (services.All(service => service.ServiceType != serviceType)) + throw new NotImplementedException($"The number of types of {serviceType.FullName} implementation class must be 1."); + } + } + + private static Type GetServiceRepositoryType(Type entityType) => typeof(IRepository<>).MakeGenericType(entityType); + + private class DomainEventBusProvider + { + + } +} diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/_Imports.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/_Imports.cs new file mode 100644 index 000000000..67bae5cf5 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/_Imports.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Events; +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; +global using Masa.BuildingBlocks.Ddd.Domain.Services; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.Contrib.Ddd.Domain; +global using Masa.Contrib.Ddd.Domain.Options; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Options; +global using System.Collections.Concurrent; +global using System.Reflection; diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs new file mode 100644 index 000000000..174a0114d --- /dev/null +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; + +public class Address : ValueObject +{ + public string Street { get; set; } + + public string City { get; set; } + + public string State { get; set; } + + public string Country { get; set; } + + public string ZipCode { get; set; } + + protected override IEnumerable GetEqualityValues() + { + yield return Street; + yield return City; + yield return State; + yield return Country; + yield return ZipCode; + } +} diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs new file mode 100644 index 000000000..0ce6f25bd --- /dev/null +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; + +public class OrderItem : Entity +{ + public Guid OrderId { get; set; } + + public int ProductId { get; set; } + + public string ProductName { get; set; } + + public decimal UnitPrice { get; set; } + + public int Units { get; set; } + + public string PictureUrl { get; set; } +} diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs new file mode 100644 index 000000000..9660fdbe6 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; + +public class Orders : AuditAggregateRoot +{ + public int OrderNumber { get; set; } + + public DateTime OrderDate { get; private set; } + + public string OrderStatus { get; private set; } + + public string Description { get; set; } = default!; + + public List OrderItems { get; set; } + + public Orders(int id) + { + this.OrderDate = DateTime.UtcNow; + this.OrderItems = new(); + this.OrderStatus = "Submitted"; + base.Id = id; + } + + /// + /// Joint primary key, when this method does not exist, the primary key is Id + /// + /// + public override IEnumerable<(string Name, object Value)> GetKeys() + { + return new List<(string Name, object value)> + { + ("Id", Id), + ("OrderNumber", OrderNumber) + }; + } +} diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj new file mode 100644 index 000000000..7eb4970a0 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj @@ -0,0 +1,25 @@ + + + + net6.0 + enable + false + enable + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs new file mode 100644 index 000000000..5c71a7669 --- /dev/null +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs @@ -0,0 +1,232 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests; + +[TestClass] +public class RepositoryTest +{ + [TestInitialize] + public void Initialize() + { + } + + [TestMethod] + public async Task TestAddRangeReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.AddRangeAsync(It.IsAny(), default)) + .Verifiable(); + + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + + var orders = new List() + { + new(9999) + }; + await repository.AddRangeAsync(orders); + dbContext.Verify(context => context.AddRangeAsync(It.IsAny>(), default), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); + } + + [TestMethod] + public async Task TestAddRangeAndUseTransactionReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.AddRangeAsync(It.IsAny(), default)) + .Verifiable(); + + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); + + var orders = new List() + { + new(9999) + }; + await repository.AddRangeAsync(orders); + dbContext.Verify(context => context.AddRangeAsync(It.IsAny>(), default), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); + } + + [TestMethod] + public async Task TestUpdateRangeReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().UpdateRange(It.IsAny>())) + .Verifiable(); + + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + + var orders = new List() + { + new(9999) + }; + await repository.UpdateRangeAsync(orders); + dbContext.Verify(context => context.Set().UpdateRange(It.IsAny>()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); + } + + [TestMethod] + public async Task TestUpdateRangeAndUseTransactionReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().UpdateRange(It.IsAny>())) + .Verifiable(); + + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); + + var orders = new List() + { + new(9999) + }; + await repository.UpdateRangeAsync(orders); + dbContext.Verify(context => context.Set().UpdateRange(It.IsAny>()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); + } + + [TestMethod] + public async Task TestUpdateReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().Update(It.IsAny())) + .Verifiable(); + + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + + var order = new Orders(999); + await repository.UpdateAsync(order); + dbContext.Verify(context => context.Set().Update(It.IsAny()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); + } + + [TestMethod] + public async Task TestUpdateAndUseTransactionReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().Update(It.IsAny())) + .Verifiable(); + + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); + + var order = new Orders(999); + await repository.UpdateAsync(order); + dbContext.Verify(context => context.Set().Update(It.IsAny()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); + } + + [TestMethod] + public async Task TestRemoveRangeReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().RemoveRange(It.IsAny>())) + .Verifiable(); + + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + + var orders = new List() + { + new(9999) + }; + await repository.RemoveRangeAsync(orders); + dbContext.Verify(context => context.Set().RemoveRange(It.IsAny>()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); + } + + [TestMethod] + public async Task TestRemoveRangeAndUseTransactionReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().RemoveRange(It.IsAny>())) + .Verifiable(); + + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); + + var orders = new List() + { + new(9999) + }; + await repository.RemoveRangeAsync(orders); + dbContext.Verify(context => context.Set().RemoveRange(It.IsAny>()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); + } + + + [TestMethod] + public async Task TestRemoveReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().Remove(It.IsAny())) + .Verifiable(); + + Mock unitOfWork = new(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + + var order = new Orders(999); + await repository.RemoveAsync(order); + dbContext.Verify(context => context.Set().Remove(It.IsAny()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Never); + } + + [TestMethod] + public async Task TestRemoveAndUseTransactionReturnEntityStateEqualChangedAsync() + { + Mock dbContext = new(); + dbContext + .Setup(context => context.Set().Remove(It.IsAny())) + .Verifiable(); + + Mock unitOfWork = new(); + unitOfWork.Setup(uoW => uoW.UseTransaction).Returns(true).Verifiable(); + var repository = new Repository(dbContext.Object, unitOfWork.Object); + Assert.IsTrue(repository.EntityState == EntityState.UnChanged); + Assert.IsTrue(repository.UnitOfWork.UseTransaction); + + var order = new Orders(999); + await repository.RemoveAsync(order); + dbContext.Verify(context => context.Set().Remove(It.IsAny()), Times.Once); + unitOfWork.VerifySet(uoW => uoW.EntityState = EntityState.Changed, Times.Once); + unitOfWork.VerifySet(uoW => uoW.CommitState = CommitState.UnCommited, Times.Once); + } +} diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs new file mode 100644 index 000000000..74b5a26bc --- /dev/null +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Reflection; +global using Microsoft.EntityFrameworkCore; +global using Moq; +global using Masa.BuildingBlocks.Ddd.Domain.Entities; +global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; +global using Masa.BuildingBlocks.Ddd.Domain.Values; +global using Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; +global using Masa.BuildingBlocks.Data.UoW; +global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs new file mode 100644 index 000000000..cee186833 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/DispatcherOptionsExtensions.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; + +public static class DispatcherOptionsExtensions +{ + private const string DAPR_PUBSUB_NAME = "pubsub"; + + public static IDispatcherOptions UseDapr( + this Masa.Contrib.Dispatcher.IntegrationEvents.Options.DispatcherOptions dispatcherOptions, + string daprPubSubName = DAPR_PUBSUB_NAME, + Action? builder = null) + { + dispatcherOptions.Services.TryAddSingleton(serviceProvider => new Publisher(serviceProvider, daprPubSubName)); + dispatcherOptions.Services.AddDaprClient(builder); + return dispatcherOptions; + } + + #region Obsolete + + [Obsolete("Use UseIntegrationEventBus(opt => opt.UseDapr())")] + public static IDistributedDispatcherOptions UseDaprEventBus( + this IDistributedDispatcherOptions dispatcherOptions, + string daprPubSubName) + where TIntegrationEventLogService : class, IIntegrationEventLogService + => dispatcherOptions.UseDaprEventBus(option => option.PubSubName = daprPubSubName); + + + [Obsolete("Use UseIntegrationEventBus(opt => opt.UseDapr())")] + public static IDistributedDispatcherOptions UseDaprEventBus( + this IDistributedDispatcherOptions dispatcherOptions, + Action? optionAction = null) + where TIntegrationEventLogService : class, IIntegrationEventLogService + => dispatcherOptions.UseDaprEventBus(optionAction, null); + + [Obsolete("Use UseIntegrationEventBus(opt => opt.UseDapr())")] + public static IDistributedDispatcherOptions UseDaprEventBus( + this IDistributedDispatcherOptions dispatcherOptions, + Action? optionAction, + Action? builder) + where TIntegrationEventLogService : class, IIntegrationEventLogService + { + ArgumentNullException.ThrowIfNull(dispatcherOptions.Services, nameof(dispatcherOptions.Services)); + + dispatcherOptions.Services.TryAddDaprEventBus(dispatcherOptions.Assemblies, option => + { + option.PubSubName = DAPR_PUBSUB_NAME; + optionAction?.Invoke(option); + }, builder); + return dispatcherOptions; + } + + #endregion + +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj new file mode 100644 index 000000000..bcac2ff6e --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs new file mode 100644 index 000000000..e430860a9 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Options/DispatcherOptions.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Options; + +[Obsolete("Later versions will be changed to Internal")] +public class DispatcherOptions : Masa.Contrib.Dispatcher.IntegrationEvents.Options.DispatcherOptions +{ + private string _pubSubName = "pubsub"; + + public string PubSubName + { + get => _pubSubName; + set + { + if (string.IsNullOrWhiteSpace(value)) + throw new ArgumentNullException(nameof(PubSubName)); + + _pubSubName = value; + } + } + + public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) + : base(services, assemblies) + { + } + + [Obsolete("Later versions will be deleted")] + internal void CopyTo(Masa.Contrib.Dispatcher.IntegrationEvents.Options.DispatcherOptions dispatcherOptions) + { + dispatcherOptions.LocalRetryTimes = LocalRetryTimes; + dispatcherOptions.MaxRetryTimes = MaxRetryTimes; + dispatcherOptions.FailedRetryInterval = FailedRetryInterval; + dispatcherOptions.MinimumRetryInterval = MinimumRetryInterval; + dispatcherOptions.LocalFailedRetryInterval = LocalFailedRetryInterval; + dispatcherOptions.RetryBatchSize = RetryBatchSize; + dispatcherOptions.CleaningLocalQueueExpireInterval = CleaningLocalQueueExpireInterval; + dispatcherOptions.CleaningExpireInterval = CleaningExpireInterval; + dispatcherOptions.PublishedExpireTime = PublishedExpireTime; + dispatcherOptions.DeleteBatchCount = DeleteBatchCount; + dispatcherOptions.GetCurrentTime = GetCurrentTime; + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs new file mode 100644 index 000000000..b470fd72a --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/Publisher.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; + +public class Publisher : IPublisher +{ + private readonly IServiceProvider _serviceProvider; + private DaprClient? _daprClient; + public DaprClient DaprClient => _daprClient ??= _serviceProvider.GetRequiredService(); + private readonly string _pubSubName; + + public Publisher(IServiceProvider serviceProvider, string pubSubName) + { + _serviceProvider = serviceProvider; + _pubSubName = pubSubName; + } + + public async Task PublishAsync(string topicName, T @event, CancellationToken stoppingToken = default) where T : IIntegrationEvent + { + await DaprClient.PublishEventAsync(_pubSubName, topicName, @event, stoppingToken); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md new file mode 100644 index 000000000..89e48253f --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md @@ -0,0 +1,71 @@ +[中](README.zh-CN.md) | EN + +## IntegrationEvents.Dapr + +Example: + +```C# +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //Use cross-process +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //Send cross-process messages +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //Record cross-process message logs +Install-Package Masa.Contrib.Data.UoW.EF //Use UnitOfWork +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // Use SqlServer +``` + +1. Add IIntegrationEventBus + +```C# +builder.Services + .AddIntegrationEventBus(options=> + { + options.UseDapr(); + options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity")) + .UseEventLog(); + }); +``` + +> CustomerDbContext needs to inherit MasaDbContext + +2. Custom IntegrationEvent + +```C# +public class DemoIntegrationEvent : IntegrationEvent +{ + public override string Topic { get; set; } = nameof(DemoIntegrationEvent);//dapr topic name + + //todo Custom attribute parameters +} +``` + +3. Custom CustomDbContext + +```C# +public class CustomDbContext : MasaDbContext +{ + public DbSet Users { get; set; } = null!; + + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + + } +} +``` + +4. Send Event + +```C# +IIntegrationEventBus eventBus;//Get IIntegrationEventBus through DI +await eventBus.PublishAsync(new DemoIntegrationEvent());//Send cross-process events +``` + +5. Subscribe to events + +```C# +[Topic("pubsub", nameof(DomeIntegrationEvent))] +public async Task DomeIntegrationEventHandleAsync(DomeIntegrationEvent @event) +{ + //todo +} +``` + +> Implement pub/sub capability based on Dapr \ No newline at end of file diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md new file mode 100644 index 000000000..d99cdfc64 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md @@ -0,0 +1,71 @@ +中 | [EN](README.md) + +## IntegrationEvents.Dapr + +用例: + +```C# +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //使用跨进程事件 +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //通过dapr完成跨进程事件 +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //记录跨进程消息日志 +Install-Package Masa.Contrib.Data.UoW.EF //使用工作单元 +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // 使用SqlServer +``` + +1. 添加IIntegrationEventBus + +```C# +builder.Services + .AddIntegrationEventBus(options=> + { + options.UseDapr(); + options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//使用工作单元,推荐使用 + .UseEventLog(); + }); +``` + +> CustomerDbContext 需要继承MasaDbContext + +2. 自定义 IntegrationEvent + +```C# +public class DemoIntegrationEvent : IntegrationEvent +{ + public override string Topic { get; set; } = nameof(DemoIntegrationEvent);//dapr topic name + + //todo 自定义属性参数 +} +``` + +3. 自定义CustomDbContext + +```C# +public class CustomDbContext : MasaDbContext +{ + public DbSet Users { get; set; } = null!; + + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + + } +} +``` + +4. 发送 Event + +```C# +IIntegrationEventBus eventBus;//通过DI得到IIntegrationEventBus +await eventBus.PublishAsync(new DemoIntegrationEvent());//发送跨进程事件 +``` + +5. 订阅事件 + +```C# +[Topic("pubsub", nameof(DomeIntegrationEvent))] +public async Task DomeIntegrationEventHandleAsync(DomeIntegrationEvent @event) +{ + //todo +} +``` + +> 基于Dapr实现pub/sub能力 \ No newline at end of file diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..ecda874d4 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs @@ -0,0 +1,55 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + #region Obsolete + + [Obsolete("Use AddIntegrationEventBus instead")] + public static IServiceCollection AddDaprEventBus( + this IServiceCollection services, + Action? options = null) + where TIntegrationEventLogService : class, IIntegrationEventLogService + => services.AddDaprEventBus(AppDomain.CurrentDomain.GetAssemblies(), options); + + [Obsolete("Use AddIntegrationEventBus instead")] + public static IServiceCollection AddDaprEventBus( + this IServiceCollection services, + Assembly[] assemblies, + Action? options = null, + Action? builder = null) + where TIntegrationEventLogService : class, IIntegrationEventLogService + => services.TryAddDaprEventBus(assemblies, options, builder); + + internal static IServiceCollection TryAddDaprEventBus( + this IServiceCollection services, + Assembly[] assemblies, + Action? options, + Action? builder = null) + where TIntegrationEventLogService : class, IIntegrationEventLogService + { + if (services.Any(service => service.ImplementationType == typeof(IntegrationEventBusProvider))) + return services; + + services.AddSingleton(); + + services.AddDaprClient(builder); + + return services.AddIntegrationEventBus(assemblies, opt => + { + DispatcherOptions daprDispatcherOptions = new DispatcherOptions(opt.Services, opt.Assemblies); + options?.Invoke(daprDispatcherOptions); + services.TryAddSingleton(serviceProvider=> new Publisher(serviceProvider,daprDispatcherOptions.PubSubName)); + + daprDispatcherOptions.CopyTo(opt); + }); + } + + private class IntegrationEventBusProvider + { + } + + #endregion +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs new file mode 100644 index 000000000..b46e749ce --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/_Imports.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Dapr.Client; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; +global using Masa.Contrib.Dispatcher.IntegrationEvents; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Options; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using System.Reflection; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs new file mode 100644 index 000000000..ed85e1da8 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; + +public static class DispatcherOptionsExtensions +{ + /// + /// User database with IntegrationEventLogContext merge + /// User-defined DbContext need IntegrationEventLogContext inheritance + /// + /// + /// + /// + public static IDispatcherOptions UseEventLog( + this IDispatcherOptions options) where TDbContext : MasaDbContext, IMasaDbContext + { + if (options.Services == null) + throw new ArgumentNullException(nameof(options.Services)); + + if (options.Services.Any(service => service.ImplementationType == typeof(EventLogProvider))) return options; + + options.Services.AddSingleton(); + + options.Services.TryAddScoped(); + + //Add local message table model mapping + options.Services.TryAddEnumerable(new ServiceDescriptor(typeof(IModelCreatingProvider), + typeof(IntegrationEventLogModelCreatingProvider), ServiceLifetime.Singleton)); + options.Services.TryAddScoped(typeof(IntegrationEventLogContext), + serviceProvider => new IntegrationEventLogContext(serviceProvider.GetRequiredService())); + return options; + } + + private class EventLogProvider + { + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs new file mode 100644 index 000000000..b9321e39d --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; + +public class IntegrationEventLogContext +{ + public readonly DbContext DbContext; + + public IntegrationEventLogContext(DbContext dbContext) => DbContext = dbContext; + + public DbSet EventLogs => DbContext.Set(); +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs new file mode 100644 index 000000000..118d0936c --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; + +public class IntegrationEventLogEntityTypeConfiguration: IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("IntegrationEventLog"); + + builder.HasKey(e => e.Id); + + builder.Property(e => e.Id) + .IsRequired(); + + builder.Property(e => e.Content) + .IsRequired(); + + builder.Property(e => e.CreationTime) + .IsRequired(); + + builder.Property(e => e.ModificationTime) + .IsRequired(); + + builder.Property(e => e.State) + .IsRequired(); + + builder.Property(e => e.TimesSent) + .IsRequired(); + + builder.Property(nameof(IHasConcurrencyStamp.RowVersion)) + .IsConcurrencyToken() + .HasMaxLength(36) + .HasColumnName(nameof(IHasConcurrencyStamp.RowVersion)); + + builder.Property(e => e.EventTypeName) + .IsRequired(); + + builder.HasIndex(e => new { e.State, e.ModificationTime }, "index_state_modificationtime"); + builder.HasIndex(e => new { e.State, e.TimesSent, e.ModificationTime }, "index_state_timessent_modificationtime"); + builder.HasIndex(e => new { e.EventId, e.RowVersion }, "index_eventid_version"); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs new file mode 100644 index 000000000..ab4d49be3 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; + +public class IntegrationEventLogModelCreatingProvider : IModelCreatingProvider +{ + public void Configure(ModelBuilder modelBuilder) + { + var integrationEventLogEntityTypeConfiguration = new IntegrationEventLogEntityTypeConfiguration(); + modelBuilder.Entity(integrationEventLogEntityTypeConfiguration.Configure); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs new file mode 100644 index 000000000..f8c21ddfd --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs @@ -0,0 +1,166 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; + +public class IntegrationEventLogService : IIntegrationEventLogService +{ + private readonly IntegrationEventLogContext _eventLogContext; + private readonly IServiceProvider _serviceProvider; + private readonly Logger? _logger; + private IEnumerable? _eventTypes; + + public IntegrationEventLogService( + IntegrationEventLogContext eventLogContext, + IServiceProvider serviceProvider, + Logger? logger = null) + { + _eventLogContext = eventLogContext; + _serviceProvider = serviceProvider; + _logger = logger; + } + + /// + /// Get messages to retry + /// + /// maximum number of retries per retry + /// + /// default: 60s + /// + public async Task> RetrieveEventLogsFailedToPublishAsync(int retryBatchSize = 200, + int maxRetryTimes = 10, int minimumRetryInterval = 60) + { + //todo: Subsequent acquisition of the current time needs to be uniformly replaced with the unified time method provided by the framework, which is convenient for subsequent uniform replacement to UTC time or other urban time. The default setting here is Utc time. + var time = DateTime.UtcNow.AddSeconds(-minimumRetryInterval); + var result = await _eventLogContext.EventLogs + .Where(e => (e.State == IntegrationEventStates.PublishedFailed || e.State == IntegrationEventStates.InProgress) && + e.TimesSent <= maxRetryTimes && + e.ModificationTime < time) + .OrderBy(o => o.CreationTime) + .Take(retryBatchSize) + .ToListAsync(); + + if (result.Any()) + { + _eventTypes ??= _serviceProvider.GetRequiredService().GetAllEventTypes() + .Where(type => typeof(IIntegrationEvent).IsAssignableFrom(type)); + + return result.OrderBy(o => o.CreationTime) + .Select(e => e.DeserializeJsonContent(_eventTypes.First(t => t.Name == e.EventTypeShortName))); + } + + return result; + } + + public async Task SaveEventAsync(IIntegrationEvent @event, DbTransaction transaction) + { + if (transaction == null) + throw new ArgumentNullException(nameof(transaction)); + + if (_eventLogContext.DbContext.Database.CurrentTransaction == null) + await _eventLogContext.DbContext.Database.UseTransactionAsync(transaction, Guid.NewGuid()); + + var eventLogEntry = new IntegrationEventLog(@event, _eventLogContext.DbContext.Database.CurrentTransaction!.TransactionId); + await _eventLogContext.EventLogs.AddAsync(eventLogEntry); + await _eventLogContext.DbContext.SaveChangesAsync(); + + CheckAndDetached(eventLogEntry); + } + + public Task MarkEventAsPublishedAsync(Guid eventId) + { + return UpdateEventStatus(eventId, IntegrationEventStates.Published, eventLog => + { + if (eventLog.State != IntegrationEventStates.InProgress) + { + _logger?.LogWarning( + "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", + IntegrationEventStates.Published, eventLog.State, eventLog.Id); + throw new UserFriendlyException( + $"Failed to modify the state of the local message table to {IntegrationEventStates.Published}, the current State is {eventLog.State}, Id: {eventLog.Id}"); + } + }); + } + + public Task MarkEventAsInProgressAsync(Guid eventId) + { + return UpdateEventStatus(eventId, IntegrationEventStates.InProgress, eventLog => + { + if (eventLog.State != IntegrationEventStates.NotPublished && eventLog.State != IntegrationEventStates.PublishedFailed) + { + _logger?.LogWarning( + "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", + IntegrationEventStates.InProgress, eventLog.State, eventLog.Id); + throw new UserFriendlyException( + $"Failed to modify the state of the local message table to {IntegrationEventStates.InProgress}, the current State is {eventLog.State}, Id: {eventLog.Id}"); + } + }); + } + + public Task MarkEventAsFailedAsync(Guid eventId) + { + return UpdateEventStatus(eventId, IntegrationEventStates.PublishedFailed, eventLog => + { + if (eventLog.State != IntegrationEventStates.InProgress) + { + _logger?.LogWarning( + "Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", + IntegrationEventStates.PublishedFailed, eventLog.State, eventLog.Id); + throw new UserFriendlyException( + $"Failed to modify the state of the local message table to {IntegrationEventStates.PublishedFailed}, the current State is {eventLog.State}, Id: {eventLog.Id}"); + } + }); + } + + public async Task DeleteExpiresAsync(DateTime expiresAt, int batchCount = 1000, CancellationToken token = default) + { + var eventLogs = _eventLogContext.EventLogs.Where(e => e.ModificationTime < expiresAt && e.State == IntegrationEventStates.Published) + .OrderBy(e => e.CreationTime).Take(batchCount); + _eventLogContext.EventLogs.RemoveRange(eventLogs); + await _eventLogContext.DbContext.SaveChangesAsync(token); + + if (_eventLogContext.DbContext.ChangeTracker.QueryTrackingBehavior != QueryTrackingBehavior.TrackAll) + { + foreach (var log in eventLogs) + _eventLogContext.DbContext.Entry(log).State = EntityState.Detached; + } + } + + private async Task UpdateEventStatus(Guid eventId, IntegrationEventStates status, Action? action = null) + { + var eventLogEntry = _eventLogContext.EventLogs.FirstOrDefault(e => e.EventId == eventId); + if (eventLogEntry == null) + throw new ArgumentException(nameof(eventId)); + + action?.Invoke(eventLogEntry); + + eventLogEntry.State = status; + eventLogEntry.ModificationTime = eventLogEntry.GetCurrentTime(); + + if (status == IntegrationEventStates.InProgress) + eventLogEntry.TimesSent++; + + _eventLogContext.EventLogs.Update(eventLogEntry); + + try + { + await _eventLogContext.DbContext.SaveChangesAsync(); + } + catch (DbUpdateConcurrencyException ex) + { + _logger?.LogWarning( + ex, + "Concurrency error, Failed to modify the state of the local message table to {OptState}, the current State is {State}, Id: {Id}", + status, eventLogEntry.State, eventLogEntry.Id); + throw new UserFriendlyException("Concurrency conflict, update exception"); + } + + CheckAndDetached(eventLogEntry); + } + + private void CheckAndDetached(IntegrationEventLog integrationEvent) + { + if (_eventLogContext.DbContext.ChangeTracker.QueryTrackingBehavior != QueryTrackingBehavior.TrackAll) + _eventLogContext.DbContext.Entry(integrationEvent).State = EntityState.Detached; + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj new file mode 100644 index 000000000..65352bc9e --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md new file mode 100644 index 000000000..2b144ed68 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md @@ -0,0 +1,24 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF + +> Provide support for sending IntegrationEvent + +Example: + +```C# +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +``` + +1. Add EventLogs.EF + +```C# +.AddIntegrationEventBus(options => +{ + options + // TODO + .UseEventLog(); +} +``` + +> Tip: CustomDbContext needs to inherit MasaDbContext \ No newline at end of file diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md new file mode 100644 index 000000000..e994ab67f --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md @@ -0,0 +1,24 @@ +中 | [EN](README.md) + +## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF + +> 为发送IntegrationEvent提供支持 + +用例: + +```C# +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +``` + +1. 使用EventLogs.EF + +```C# +.AddIntegrationEventBus(options => +{ + options + // TODO + .UseEventLog(); +} +``` + +> 提示:CustomDbContext需要继承MasaDbContext diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs new file mode 100644 index 000000000..745ce1fb5 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; +global using Masa.Contrib.Data.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using System; +global using System.Collections.Generic; +global using System.Data.Common; +global using System.Linq; +global using System.Threading.Tasks; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs new file mode 100644 index 000000000..f6abb9fd2 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/DispatcherOptionsExtensions.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents; + +public static class DispatcherOptionsExtensions +{ + public static IDistributedDispatcherOptions UseIntegrationEventBus( + this IDistributedDispatcherOptions dispatcherOptions, + Action? optionAction = null) + { + ArgumentNullException.ThrowIfNull(dispatcherOptions.Services, nameof(dispatcherOptions.Services)); + + dispatcherOptions.Services.TryAddIntegrationEventBus(dispatcherOptions.Assemblies, option => optionAction?.Invoke(option)); + return dispatcherOptions; + } + + public static IDistributedDispatcherOptions UseIntegrationEventBus( + this IDistributedDispatcherOptions dispatcherOptions, + Action? optionAction = null) + where TIntegrationEventLogService : class, IIntegrationEventLogService + { + ArgumentNullException.ThrowIfNull(dispatcherOptions.Services, nameof(dispatcherOptions.Services)); + + dispatcherOptions.Services.TryAddIntegrationEventBus(dispatcherOptions.Assemblies, + option => optionAction?.Invoke(option)); + return dispatcherOptions; + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs new file mode 100644 index 000000000..c1adf03f0 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessingServer.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents; + +public interface IProcessingServer +{ + Task ExecuteAsync(CancellationToken stoppingToken); +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs new file mode 100644 index 000000000..67872a256 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IProcessor.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents; + +public interface IProcessor +{ + Task ExecuteAsync(CancellationToken stoppingToken); + + /// + /// Easy to switch between background tasks + /// + /// unit: seconds + /// + Task DelayAsync(int delay); +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs new file mode 100644 index 000000000..fd92ff4bf --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IPublisher.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents; + +public interface IPublisher +{ + Task PublishAsync(string topicName, T @event, CancellationToken stoppingToken = default) where T : IIntegrationEvent; +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs new file mode 100644 index 000000000..23740d315 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventBus.cs @@ -0,0 +1,107 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents; + +public class IntegrationEventBus : IIntegrationEventBus +{ + private readonly DispatcherOptions _dispatcherOptions; + private readonly IPublisher _publisher; + private readonly ILogger? _logger; + private readonly IIntegrationEventLogService? _eventLogService; + private readonly IOptionsMonitor? _appConfig; + private readonly IEventBus? _eventBus; + private readonly IUnitOfWork? _unitOfWork; + + public IntegrationEventBus(IOptions options, + IPublisher publisher, + IIntegrationEventLogService? eventLogService = null, + IOptionsMonitor? appConfig = null, + ILogger? logger = null, + IEventBus? eventBus = null, + IUnitOfWork? unitOfWork = null) + { + _dispatcherOptions = options.Value; + _publisher = publisher; + _eventLogService = eventLogService; + _appConfig = appConfig; + _logger = logger; + _eventBus = eventBus; + _unitOfWork = unitOfWork; + } + + public IEnumerable GetAllEventTypes() => + _eventBus == null + ? _dispatcherOptions.AllEventTypes + : _dispatcherOptions.AllEventTypes.Concat(_eventBus.GetAllEventTypes()).Distinct(); + + public async Task PublishAsync(TEvent @event) + where TEvent : IEvent + { + if (@event is IIntegrationEvent integrationEvent) + { + await PublishIntegrationAsync(integrationEvent); + } + else if (_eventBus != null) + { + await _eventBus.PublishAsync(@event); + } + else + { + throw new NotSupportedException(nameof(@event)); + } + } + + private async Task PublishIntegrationAsync(TEvent @event) + where TEvent : IIntegrationEvent + { + if (@event.UnitOfWork == null && _unitOfWork != null) + @event.UnitOfWork = _unitOfWork; + + var topicName = @event.Topic; + if (@event.UnitOfWork is { UseTransaction: true } && _eventLogService != null) + { + try + { + _logger?.LogDebug("----- Saving changes and integrationEvent: {IntegrationEventId}", @event.GetEventId()); + await _eventLogService.SaveEventAsync(@event, @event.UnitOfWork!.Transaction); + + _logger?.LogDebug( + "----- Publishing integration event: {IntegrationEventIdPublished} from {AppId} - ({IntegrationEvent})", + @event.GetEventId(), + _appConfig?.CurrentValue.AppId ?? string.Empty, @event); + + await _eventLogService.MarkEventAsInProgressAsync(@event.GetEventId()); + + _logger?.LogDebug("Publishing event {Event} to {TopicName}", @event, topicName); + await _publisher.PublishAsync(topicName, (dynamic)@event); + + await _eventLogService.MarkEventAsPublishedAsync(@event.GetEventId()); + } + catch (Exception ex) + { + _logger?.LogError(ex, "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", + @event.GetEventId(), _appConfig?.CurrentValue.AppId ?? string.Empty, @event); + LocalQueueProcessor.Default.AddJobs(new IntegrationEventLogItem(@event.GetEventId(), @event.Topic, @event)); + await _eventLogService.MarkEventAsFailedAsync(@event.GetEventId()); + } + } + else + { + _logger?.LogDebug( + "----- Publishing integration event (don't use local message): {IntegrationEventIdPublished} from {AppId} - ({IntegrationEvent})", + @event.GetEventId(), + _appConfig?.CurrentValue.AppId ?? string.Empty, @event); + + await _publisher.PublishAsync(topicName, (dynamic)@event); + } + } + + public async Task CommitAsync(CancellationToken cancellationToken = default) + { + if (_unitOfWork is null) + throw new ArgumentNullException(nameof(IUnitOfWork), "You need to UseUoW when adding services"); + + await _unitOfWork.CommitAsync(cancellationToken); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs new file mode 100644 index 000000000..9956d8d58 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/IntegrationEventHostedService.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Microsoft.Extensions.Hosting; + +namespace Masa.Contrib.Dispatcher.IntegrationEvents; + +public class IntegrationEventHostedService : BackgroundService +{ + private readonly ILogger? _logger; + private readonly IProcessingServer _processingServer; + + public IntegrationEventHostedService(IProcessingServer processingServer, ILogger? logger = null) + { + _logger = logger; + _processingServer = processingServer; + } + + protected override Task ExecuteAsync(CancellationToken stoppingToken) + { + _logger?.LogDebug("----- IntegrationEvent background task is starting"); + + return _processingServer.ExecuteAsync(stoppingToken); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs new file mode 100644 index 000000000..a66d617fd --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/IntegrationEventLogItem.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Internal; + +/// +/// Use the local queue to retry sending failed messages +/// +internal class IntegrationEventLogItem +{ + public Guid EventId { get; } + + public string Topic { get; } + + public DateTime CreationTime { get; } + + public int RetryCount { get; private set; } + + public IIntegrationEvent Event { get; private set; } + + public IntegrationEventLogItem(Guid eventId, string topic, IIntegrationEvent @event) + { + EventId = eventId; + Topic = topic; + RetryCount = 0; + CreationTime = DateTime.UtcNow; + Event = @event; + } + + public void Retry() + { + this.RetryCount++; + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs new file mode 100644 index 000000000..5d262d8d7 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Internal/LocalQueueProcessor.cs @@ -0,0 +1,63 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Internal; + +internal class LocalQueueProcessor +{ + private readonly ConcurrentDictionary _retryEventLogs; + + public static ILogger? Logger; + public static readonly LocalQueueProcessor Default = new(); + + public LocalQueueProcessor() => _retryEventLogs = new(); + + public static void SetLogger(IServiceCollection services) + { + Logger = services.BuildServiceProvider().GetService>(); + } + + public void AddJobs(IntegrationEventLogItem items) + => _retryEventLogs.TryAdd(items.EventId, items); + + public void RemoveJobs(Guid eventId) + => _retryEventLogs.TryRemove(eventId, out _); + + public void RetryJobs(Guid eventId) + { + if (_retryEventLogs.TryGetValue(eventId, out IntegrationEventLogItem? item)) + { + item.Retry(); + } + } + + public bool IsExist(Guid eventId) + => _retryEventLogs.ContainsKey(eventId); + + public void Delete(int maxRetryTimes) + { + var eventLogItems = _retryEventLogs.Values.Where(log => log.RetryCount >= maxRetryTimes - 1).ToList(); + eventLogItems.ForEach(item => RemoveJobs(item.EventId)); + } + + public List RetrieveEventLogsFailedToPublishAsync(int maxRetryTimes, int retryBatchSize) + { + try + { + return _retryEventLogs + .Select(item => item.Value) + .Where(log => log.RetryCount < maxRetryTimes) + .OrderBy(log => log.RetryCount) + .ThenBy(log => log.CreationTime) + .Take(retryBatchSize) + .ToList(); + } + catch (Exception ex) + { + Logger?.LogWarning(ex, "... getting local retry queue error"); + + Thread.Sleep(TimeSpan.FromSeconds(2)); + return new List(); + } + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj new file mode 100644 index 000000000..14b7bf1d2 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs new file mode 100644 index 000000000..383659973 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Options/DispatcherOptions.cs @@ -0,0 +1,212 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Options; + +public class DispatcherOptions : IDispatcherOptions +{ + public IServiceCollection Services { get; } + + public Assembly[] Assemblies { get; } + + private int _localRetryTimes = 3; + + /// + /// Local queue maximum number of retries + /// + public int LocalRetryTimes + { + get => _localRetryTimes; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(LocalRetryTimes)); + + _localRetryTimes = value; + } + } + + private int _maxRetryTimes = 10; + + /// + /// maximum number of retries + /// Default is 10 + /// + public int MaxRetryTimes + { + get => _maxRetryTimes; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(MaxRetryTimes)); + + _maxRetryTimes = value; + } + } + + private int _failedRetryInterval = 60; + + /// + /// The interval at which db polls for failure messages. + /// Default is 60 seconds. + /// unit: seconds + /// + public int FailedRetryInterval + { + get => _failedRetryInterval; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(FailedRetryInterval)); + + _failedRetryInterval = value; + } + } + + private int _minimumRetryInterval = 60; + + /// + /// Minimum execution retry interval + /// Default is 60 seconds. + /// + public int MinimumRetryInterval + { + get => _minimumRetryInterval; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(MinimumRetryInterval)); + + _minimumRetryInterval = value; + } + } + + private int _localFailedRetryInterval = 3; + + /// + /// The interval at which the local queue is polled for failed messages. + /// Local queue does not rebuild after service crash + /// Default is 3 seconds. + /// unit: seconds + /// + public int LocalFailedRetryInterval + { + get => _localFailedRetryInterval; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(LocalFailedRetryInterval)); + + _localFailedRetryInterval = value; + } + } + + private int _retryBatchSize = 100; + + /// + /// maximum number of retries per retry + /// + public int RetryBatchSize + { + get => _retryBatchSize; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(RetryBatchSize)); + + _retryBatchSize = value; + } + } + + private int _cleaningLocalQueueExpireInterval = 60; + + /// + /// Delete local queue expired event interval + /// Default is 60 seconds + /// unit: seconds + /// + public int CleaningLocalQueueExpireInterval + { + get => _cleaningLocalQueueExpireInterval; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(CleaningLocalQueueExpireInterval)); + + _cleaningLocalQueueExpireInterval = value; + } + } + + private int _cleaningExpireInterval = 300; + + /// + /// Delete expired event interval + /// Default is 300 seconds. + /// unit: seconds + /// + public int CleaningExpireInterval + { + get => _cleaningExpireInterval; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(CleaningExpireInterval)); + + _cleaningExpireInterval = value; + } + } + + private long _publishedExpireTime = 24 * 3600; + + /// + /// Expiration time, when the message status is successful and has expired, it will be deleted by the scheduled task + /// Default: ( 24 * 3600 )s + /// + public long PublishedExpireTime + { + get => _publishedExpireTime; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(PublishedExpireTime)); + + _publishedExpireTime = value; + } + } + + private int _deleteBatchCount = 1000; + + /// + /// Bulk delete expired messages + /// + public int DeleteBatchCount + { + get => _deleteBatchCount; + set + { + if (value <= 0) + throw new ArgumentException("must be greater than 0", nameof(DeleteBatchCount)); + + _deleteBatchCount = value; + } + } + + public Func? GetCurrentTime { get; set; } + + public List AllEventTypes { get; } + + private DispatcherOptions(IServiceCollection services) => Services = services; + + public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) + : this(services) + { + if (assemblies == null || assemblies.Length == 0) + throw new ArgumentException(nameof(assemblies)); + + Assemblies = assemblies; + AllEventTypes = assemblies + .SelectMany(assembly => assembly.GetTypes()) + .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) + .ToList(); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs new file mode 100644 index 000000000..c2e0fa40d --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeleteLocalQueueExpiresProcessor.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; + +public class DeleteLocalQueueExpiresProcessor : ProcessorBase +{ + private readonly IOptions _options; + + public override int Delay => _options.Value.CleaningLocalQueueExpireInterval; + + public DeleteLocalQueueExpiresProcessor(IOptions options) : base(null) + { + _options = options; + } + + /// + /// Delete expired events + /// + /// + protected override void Executing() + { + LocalQueueProcessor.Default.Delete(_options.Value.LocalRetryTimes); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs new file mode 100644 index 000000000..0f7e3635b --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/DeletePublishedExpireEventProcessor.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; + +public class DeletePublishedExpireEventProcessor : ProcessorBase +{ + private readonly IOptions _options; + + public override int Delay => _options.Value.CleaningExpireInterval; + + public DeletePublishedExpireEventProcessor(IServiceProvider serviceProvider, IOptions options) + : base(serviceProvider) + { + _options = options; + } + + /// + /// Delete expired events + /// + /// + /// + protected override async Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) + { + var logService = serviceProvider.GetRequiredService(); + var expireDate = (_options.Value.GetCurrentTime?.Invoke() ?? DateTime.UtcNow).AddSeconds(-_options.Value.PublishedExpireTime); + await logService.DeleteExpiresAsync(expireDate, _options.Value.DeleteBatchCount, stoppingToken); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs new file mode 100644 index 000000000..bdbca3659 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/InfiniteLoopProcessor.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; + +public class InfiniteLoopProcessor : ProcessorBase +{ + private readonly IProcessor _processor; + private readonly ILogger? _logger; + + public InfiniteLoopProcessor(IServiceProvider serviceProvider, IProcessor processor) + : base(serviceProvider) + { + _processor = processor; + _logger = serviceProvider.GetService>(); + } + + public override async Task ExecuteAsync(CancellationToken stoppingToken) + { + while (!stoppingToken.IsCancellationRequested) + { + try + { + await _processor.ExecuteAsync(stoppingToken); + await DelayAsync(((ProcessorBase)_processor).Delay); + } + catch (OperationCanceledException ex) + { + //ignore + _logger?.LogWarning("Operation canceled", ex); + } + catch (Exception ex) + { + _logger?.LogWarning(ex, "Processor '{ProcessorName}' failed", _processor.ToString()); + + await DelayAsync(2); + } + } + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs new file mode 100644 index 000000000..944229d6f --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/ProcessorBase.cs @@ -0,0 +1,46 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; + +public abstract class ProcessorBase : IProcessor +{ + protected readonly IServiceProvider? ServiceProvider; + + /// + /// Task delay time, unit: seconds + /// + public virtual int Delay { get; } + + protected ProcessorBase(IServiceProvider? serviceProvider) => ServiceProvider = serviceProvider; + + public virtual async Task ExecuteAsync(CancellationToken stoppingToken) + { + if (ServiceProvider != null) + { + var unitOfWorkManager = ServiceProvider.GetRequiredService(); + var dataConnectionStringProvider = ServiceProvider.GetRequiredService(); + var optionsList = dataConnectionStringProvider.DbContextOptionsList; + foreach (var option in optionsList) + { + await using var unitOfWork = unitOfWorkManager.CreateDbContext(option); + await ExecuteAsync(unitOfWork.ServiceProvider, stoppingToken); + } + } + else + { + Executing(); + } + } + + // /// + // /// Easy to switch between background tasks + // /// + /// unit: seconds + // /// + public Task DelayAsync(int delay) => Task.Delay(TimeSpan.FromSeconds(delay)); + + protected virtual Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) => Task.CompletedTask; + + protected virtual void Executing() { } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs new file mode 100644 index 000000000..e75b0da5e --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByDataProcessor.cs @@ -0,0 +1,72 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; + +public class RetryByDataProcessor : ProcessorBase +{ + private readonly IServiceProvider _serviceProvider; + private readonly IOptions _options; + private readonly IOptionsMonitor? _appConfig; + private readonly ILogger? _logger; + + public override int Delay => _options.Value.FailedRetryInterval; + + public RetryByDataProcessor( + IServiceProvider serviceProvider, + IOptions options, + IOptionsMonitor? appConfig = null, + ILogger? logger = null) : base(serviceProvider) + { + _serviceProvider = serviceProvider; + _appConfig = appConfig; + _options = options; + _logger = logger; + } + + protected override async Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) + { + var unitOfWork = serviceProvider.GetService(); + if (unitOfWork != null) + unitOfWork.UseTransaction = false; + + var publisher = serviceProvider.GetRequiredService(); + var eventLogService = serviceProvider.GetRequiredService(); + + var retrieveEventLogs = + await eventLogService.RetrieveEventLogsFailedToPublishAsync(_options.Value.RetryBatchSize, _options.Value.MaxRetryTimes, + _options.Value.MinimumRetryInterval); + + foreach (var eventLog in retrieveEventLogs) + { + try + { + if (LocalQueueProcessor.Default.IsExist(eventLog.EventId)) + continue; // The local queue is retrying, no need to retry + + await eventLogService.MarkEventAsInProgressAsync(eventLog.EventId); + + _logger?.LogDebug("Publishing integration event {Event} to {TopicName}", + eventLog, + eventLog.Event.Topic); + + await publisher.PublishAsync(eventLog.Event.Topic, eventLog.Event, stoppingToken); + + LocalQueueProcessor.Default.RemoveJobs(eventLog.EventId); + + await eventLogService.MarkEventAsPublishedAsync(eventLog.EventId); + } + catch (UserFriendlyException) + { + //Update state due to multitasking contention, no processing required + } + catch (Exception ex) + { + _logger?.LogError(ex, + "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", + eventLog.EventId, _appConfig?.CurrentValue.AppId ?? string.Empty, eventLog); + await eventLogService.MarkEventAsFailedAsync(eventLog.EventId); + } + } + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs new file mode 100644 index 000000000..eca5e4715 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Processor/RetryByLocalQueueProcessor.cs @@ -0,0 +1,71 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Processor; + +public class RetryByLocalQueueProcessor : ProcessorBase +{ + private readonly IOptionsMonitor? _appConfig; + private readonly IOptions _options; + private readonly ILogger? _logger; + + public override int Delay => _options.Value.LocalFailedRetryInterval; + + public RetryByLocalQueueProcessor( + IServiceProvider serviceProvider, + IOptions options, + IOptionsMonitor? appConfig = null, + ILogger? logger = null) : base(serviceProvider) + { + _appConfig = appConfig; + _options = options; + _logger = logger; + } + + protected override async Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken stoppingToken) + { + var unitOfWork = serviceProvider.GetService(); + if (unitOfWork != null) + unitOfWork.UseTransaction = false; + + var publisher = serviceProvider.GetRequiredService(); + var eventLogService = serviceProvider.GetRequiredService(); + + var retrieveEventLogs = + LocalQueueProcessor.Default.RetrieveEventLogsFailedToPublishAsync(_options.Value.LocalRetryTimes, + _options.Value.RetryBatchSize); + + foreach (var eventLog in retrieveEventLogs) + { + try + { + LocalQueueProcessor.Default.RetryJobs(eventLog.EventId); + + await eventLogService.MarkEventAsInProgressAsync(eventLog.EventId); + + _logger?.LogDebug( + "Publishing integration event {Event} to {TopicName}", + eventLog, + eventLog.Topic); + + await publisher.PublishAsync(eventLog.Topic, eventLog.Event, stoppingToken); + + await eventLogService.MarkEventAsPublishedAsync(eventLog.EventId); + + LocalQueueProcessor.Default.RemoveJobs(eventLog.EventId); + } + catch (UserFriendlyException) + { + //Update state due to multitasking contention + LocalQueueProcessor.Default.RemoveJobs(eventLog.EventId); + } + catch (Exception ex) + { + _logger?.LogError(ex, + "Error Publishing integration event: {IntegrationEventId} from {AppId} - ({IntegrationEvent})", + eventLog.EventId, _appConfig?.CurrentValue.AppId ?? string.Empty, eventLog); + await eventLogService.MarkEventAsFailedAsync(eventLog.EventId); + } + } + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md new file mode 100644 index 000000000..fd7da4bf1 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md @@ -0,0 +1,119 @@ +[中](README.zh-CN.md) | EN + +## IntegrationEventBus + +Example: + +``` C# +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //Use cross-process +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //For example, use dapr to provide pub and sub capabilities, or you can choose other implementations by yourself +Install-Package Masa.Contrib.Data.UoW.EF //Use UnitOfWork +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // Use SqlServer +``` + +1. Add IIntegrationEventBus + +1.1 Specify the local message service + +``` C# +builder.Services + .AddIntegrationEventBus(options=> + { + options.UseDapr();//Use Dapr to provide pub/sub capabilities, or you can choose other + options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//Use unit of work, recommended; + }); +``` + +> CustomIntegrationEventLogService (custom local message service) needs to inherit IIntegrationEventLogService, and the parameters in the constructor must support getting from CI + +1.2 Use the provided EF version of the local message service + +Install `Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF` + +``` C# +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //Record cross-process message log +``` + +``` C# +builder.Services + .AddIntegrationEventBus(options=> + { + options.UseDapr();//Use Dapr to provide pub/sub capabilities, or you can choose other + options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//Use unit of work, recommended + .UseEventLog(); + }); +``` + +> CustomerDbContext needs to inherit MasaDbContext + +2. Custom IntegrationEvent + +``` C# +public class DemoIntegrationEvent : IntegrationEvent +{ + public override string Topic { get; set; } = nameof(DemoIntegrationEvent);//dapr topic name + + //todo Custom attribute parameters +} +``` + +3. Custom CustomDbContext + +``` C# +public class CustomDbContext : MasaDbContext +{ + public DbSet Users { get; set; } = null!; + + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + + } +} +``` + +4. Send Event + +``` C# +IIntegrationEventBus eventBus;//Get IIntegrationEventBus through DI +await eventBus.PublishAsync(new DemoIntegrationEvent());//Send cross-process events +``` + +### retry policy + +```C# +builder.Services + .AddIntegrationEventBus(options=> + { + options.UseDapr();//Use Dapr to provide pub/sub capabilities, or you can choose other + // options.MaxRetryTimes = 50;//Maximum number of retries, default: 50 + // options.RetryBatchSize = 100;//Number of single retry events, used to get retry events from persistent data source, default 100 + // options.FailedRetryInterval = 60;//Persistent data source retry pause interval, default 60s + // options.CleaningExpireInterval = 300;//Clearing expired event pause interval, unit: s, default 300s + // options.ExpireDate = 24 * 3600;//Expiration time, CreationTime + ExpireDate = Expiration time, default 1 day + + // options.LocalFailedRetryInterval = 3;//Local queue retry pause interval, default 3s + // options.CleaningLocalQueueExpireInterval = 60;//Clearing local queue expired event pause interval, unit: s, default 60s + }); +``` + +Retry is divided into local queue retry and retry from persistent data source: + +local queue: + +Features: +- Short retry interval, support second-level retry interval +- Get data from memory, faster +- After the system crashes, the previous local queue will not be rebuilt, and will be automatically demoted to the persistent queue to retry the task + +Persistent data source queue: + +Features: + +- After the system crashes, the retry queue can be obtained from db or other persistent sources to ensure 100% retry of events +- As a downgrade solution for local memory queues, lower pressure on db or other data sources + +In the case of a single copy, the tasks of the two queues will only be executed in a single queue, and there will be no simultaneous execution of the two queues. +In the case of multiple copies, the same task may be executed by multiple copies. Although we have made idempotent, but the delivery guarantee is At Least Once, it is still possible that the event publishing is successful, but the state change fails. +At this point, the event may be re-sent. We recommend that the task executor retry across events. + +> At present, the standardized Sub capability is not supported, and the native writing method of the implementer is temporarily used. \ No newline at end of file diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md new file mode 100644 index 000000000..f5f1810b2 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md @@ -0,0 +1,119 @@ +中 | [EN](README.md) + +## IntegrationEventBus + +用例: + +```C# +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //使用跨进程事件 +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //例如使用dapr提供pub、sub能力,也可自行选择其他实现 +Install-Package Masa.Contrib.Data.UoW.EF //使用工作单元 +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // 使用SqlServer +``` + +1. 添加IIntegrationEventBus + +1.1 指定本地消息服务 + +```C# +builder.Services + .AddIntegrationEventBus(options=> + { + options.UseDapr();//使用Dapr提供pub/sub能力,也可以自行选择其他的 + options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//使用工作单元,推荐使用; + }); +``` + +> CustomIntegrationEventLogService(自定义本地消息服务)需继承IIntegrationEventLogService,并且构造函数中的参数必须支持从CI获取 + +1.2 使用提供的EF版的本地消息服务 + +安装`Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF` + +``` C# +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //记录跨进程消息日志 +``` + +```C# +builder.Services + .AddIntegrationEventBus(options=> + { + options.UseDapr();//使用Dapr提供pub/sub能力,也可以自行选择其他的 + options.UseUoW(dbOptions => dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity"))//使用工作单元,推荐使用 + .UseEventLog(); + }); +``` + +> CustomerDbContext 需要继承MasaDbContext + +2. 自定义 IntegrationEvent + +```C# +public class DemoIntegrationEvent : IntegrationEvent +{ + public override string Topic { get; set; } = nameof(DemoIntegrationEvent);//dapr topic name + + //todo 自定义属性参数 +} +``` + +3. 自定义CustomDbContext + +```C# +public class CustomDbContext : MasaDbContext +{ + public DbSet Users { get; set; } = null!; + + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + + } +} +``` + +4. 发送 Event + +```C# +IIntegrationEventBus eventBus;//通过DI得到IIntegrationEventBus +await eventBus.PublishAsync(new DemoIntegrationEvent());//发送跨进程事件 +``` + +### 重试策略 + +```C# +builder.Services + .AddIntegrationEventBus(options=> + { + options.UseDapr();//使用Dapr提供pub/sub能力,也可以自行选择其他的 + // options.MaxRetryTimes = 50;//最大重试次数, 默认:50 + // options.RetryBatchSize = 100;//单次重试事件数量, 用于从持久化数据源获取待重试事件, 默认100 + // options.FailedRetryInterval = 60;//持久化数据源重试停歇间隔, 默认60s + // options.CleaningExpireInterval = 300;//清除已过期事件停歇间隔,单位:s, 默认 300s + // options.ExpireDate = 24 * 3600;//过期时间,CreationTime + ExpireDate = 过期时间, 默认1天 + + // options.LocalFailedRetryInterval = 3;//本地队列重试停歇间隔, 默认3s + // options.CleaningLocalQueueExpireInterval = 60;//清除本地队列已过期事件停歇间隔,单位:s, 默认 60s + }); +``` + +重试分为本地队列重试以及从持久化数据源重试两种: + +本地队列: + +特点: +- 重试间隔短,支持秒级别重试间隔 +- 从内存获取数据,速度更快 +- 系统崩溃后,之前的本地队列不会重建,自动降级到持久化队列中重试任务 + +持久化数据源队列: + +特点: + +- 系统崩溃后,可以从db或者其他持久化源获取重试队列,确保事件100%重试 +- 作为本地内存队列的降级方案,对db或者其他数据源压力更低 + +在单副本情况下,两种队列的任务仅会在单个队列中执行,不会存在两个队列同时执行的情况。 +在多副本情况下,同一个任务可能会被多个副本所执行,虽然我们有做幂等,但为交付保证是 At Least Once,仍然有可能出现事件发布成功,但状态更改失败的情况, +此时事件可能会重发,我们建议任务执行者做好对跨事件的重试 + +> 目前还未支持标准化的Sub能力,暂时使用实现方原生的写法 diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs new file mode 100644 index 000000000..42f70b04e --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/Servers/DefaultHostedService.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Servers; + +public class DefaultHostedService : IProcessingServer +{ + private readonly IServiceProvider _serviceProvider; + private readonly IEnumerable _processors; + + public DefaultHostedService(IServiceProvider serviceProvider, IEnumerable processors) + { + _serviceProvider = serviceProvider; + _processors = processors; + } + + public Task ExecuteAsync(CancellationToken stoppingToken) + { + if (_serviceProvider.GetService() == null) + return Task.CompletedTask; + + var processorTasks = _processors.Select(processor => new InfiniteLoopProcessor(_serviceProvider, processor)) + .Select(process => process.ExecuteAsync(stoppingToken)); + return Task.WhenAll(processorTasks); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..f4617dae6 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/ServiceCollectionExtensions.cs @@ -0,0 +1,90 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddIntegrationEventBus( + this IServiceCollection services, + Action? options = null) + => services.AddIntegrationEventBus(AppDomain.CurrentDomain.GetAssemblies(), options); + + public static IServiceCollection AddIntegrationEventBus( + this IServiceCollection services, + Assembly[] assemblies, + Action? options = null) + => services.TryAddIntegrationEventBus(assemblies, options); + + public static IServiceCollection AddIntegrationEventBus( + this IServiceCollection services, + Action? options = null) + where TIntegrationEventLogService : class, IIntegrationEventLogService + => services.AddIntegrationEventBus(AppDomain.CurrentDomain.GetAssemblies(), options); + + public static IServiceCollection AddIntegrationEventBus( + this IServiceCollection services, + Assembly[] assemblies, + Action? options = null) + where TIntegrationEventLogService : class, IIntegrationEventLogService + => services.TryAddIntegrationEventBus(assemblies, options); + + internal static IServiceCollection TryAddIntegrationEventBus( + this IServiceCollection services, + Assembly[] assemblies, + Action? options) + where TIntegrationEventLogService : class, IIntegrationEventLogService + { + return services.TryAddIntegrationEventBus(assemblies, options, () => + { + services.AddScoped(); + }); + } + + internal static IServiceCollection TryAddIntegrationEventBus( + this IServiceCollection services, + Assembly[] assemblies, + Action? options, + Action? action = null) + { + if (services.Any(service => service.ImplementationType == typeof(IntegrationEventBusProvider))) + return services; + + services.AddSingleton(); + + var dispatcherOptions = new DispatcherOptions(services, assemblies); + options?.Invoke(dispatcherOptions); + + services.TryAddSingleton(typeof(IOptions), + serviceProvider => Microsoft.Extensions.Options.Options.Create(dispatcherOptions)); + + LocalQueueProcessor.SetLogger(services); + services.AddScoped(); + action?.Invoke(); + + if (services.Any(d => d.ServiceType == typeof(IIntegrationEventLogService))) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + } + services.TryAddSingleton(); + + services.AddHostedService(); + if (services.All(service => service.ServiceType != typeof(IUnitOfWork))) + { + var logger = services.BuildServiceProvider().GetService>(); + logger?.LogDebug("UoW is not enabled or add delay, UoW is not used will affect 100% delivery of the message"); + } + + if (services.All(d => d.ServiceType != typeof(IPublisher))) + throw new NotSupportedException($"{nameof(IPublisher)} has no implementing"); + + return services; + } + + private class IntegrationEventBusProvider + { + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs new file mode 100644 index 000000000..5b99e8c77 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/_Imports.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; +global using Masa.Contrib.Dispatcher.IntegrationEvents; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Internal; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Options; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Processor; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Servers; +global using Masa.Utils.Models.Config; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using System.Collections.Concurrent; +global using System.Reflection; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs new file mode 100644 index 000000000..3fd775ccc --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs @@ -0,0 +1,55 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests; + +[TestClass] +public class DispatcherOptionTest +{ + private DispatcherOptions _options; + + [TestInitialize] + public void Initialize() + { + var services = new ServiceCollection(); + _options = new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies()); + } + + [TestMethod] + public void TestEmptyPubSub() + { + Assert.ThrowsException(() => _options.PubSubName = ""); + } + + [TestMethod] + public void TestSetPubSub() + { + Assert.IsTrue(_options.PubSubName == "pubsub"); + _options.PubSubName = "pubsub2"; + Assert.IsTrue(_options.PubSubName == "pubsub2"); + } + + [TestMethod] + public void UseDaprEventBus() + { + Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); + var services = new ServiceCollection(); + Mock distributedDispatcherOptions = new(); + distributedDispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); + distributedDispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies).Verifiable(); + distributedDispatcherOptions.Object.UseDaprEventBus("pubsub2"); + var serviceProvider = services.BuildServiceProvider(); + + var integrationEventBus = serviceProvider.GetService(); + Assert.IsNotNull(integrationEventBus); + + var publisher = serviceProvider.GetService(); + Assert.IsNotNull(publisher); + + var field = publisher.GetType().GetField("_pubSubName", BindingFlags.Instance | BindingFlags.NonPublic); + Assert.IsNotNull(field); + var fieldValue = field.GetValue(publisher); + Assert.IsNotNull(fieldValue); + Assert.IsTrue(fieldValue.ToString() == "pubsub2"); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs new file mode 100644 index 000000000..71376914e --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs @@ -0,0 +1,142 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests; + +[TestClass] +public class IntegrationEventBusTest +{ + private Mock _options; + private Mock> _dispatcherOptions; + private Mock _eventLog; + private Mock> _appConfig; + private Mock _uoW; + + [TestInitialize] + public void Initialize() + { + _options = new(); + _options.Setup(option => option.Services).Returns(new ServiceCollection()).Verifiable(); + _dispatcherOptions = new(); + _dispatcherOptions + .Setup(option => option.Value) + .Returns(() => new DispatcherOptions(_options.Object.Services, AppDomain.CurrentDomain.GetAssemblies())); + _eventLog = new(); + _eventLog.Setup(eventLog => eventLog.SaveEventAsync(It.IsAny(), null!)).Verifiable(); + _eventLog.Setup(eventLog => eventLog.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); + _eventLog.Setup(eventLog => eventLog.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); + _eventLog.Setup(eventLog => eventLog.MarkEventAsFailedAsync(It.IsAny())).Verifiable(); + _appConfig = new(); + _appConfig.Setup(appConfig => appConfig.CurrentValue).Returns(() => new AppConfig() + { + AppId = "Test" + }); + _uoW = new(); + _uoW.Setup(uoW => uoW.CommitAsync(default)).Verifiable(); + _uoW.Setup(uoW => uoW.Transaction).Returns(() => null!); + _uoW.Setup(uoW => uoW.UseTransaction).Returns(true); + } + + [TestMethod] + public void TestDispatcherOption() + { + var services = new ServiceCollection(); + DispatcherOptions options; + + Assert.ThrowsException(() => + { + options = new DispatcherOptions(services, null!); + }); + Assert.ThrowsException(() => + { + options = new DispatcherOptions(services, Array.Empty()); + }); + options = new DispatcherOptions(services, new[] { typeof(IntegrationEventBusTest).Assembly }); + Assert.IsTrue(options.Services.Equals(services)); + var allEventTypes = new[] { typeof(IntegrationEventBusTest).Assembly }.SelectMany(assembly => assembly.GetTypes()) + .Where(type => type.IsClass && type != typeof(IntegrationEvent) && typeof(IEvent).IsAssignableFrom(type)).ToList(); + Assert.IsTrue(options.AllEventTypes.Count == allEventTypes.Count()); + } + + [TestMethod] + public void TestAddMultDaprEventBus() + { + var services = new ServiceCollection(); + Mock distributedDispatcherOptions = new(); + distributedDispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); + distributedDispatcherOptions.Setup(option => option.Assemblies).Returns(AppDomain.CurrentDomain.GetAssemblies()).Verifiable(); + distributedDispatcherOptions.Object + .UseDaprEventBus() + .UseDaprEventBus(); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestAddDaprEventBus() + { + IServiceCollection services = new ServiceCollection(); + services.AddDaprEventBus(); + var serviceProvider = services.BuildServiceProvider(); + var integrationEventBus = serviceProvider.GetRequiredService(); + Assert.IsNotNull(integrationEventBus); + } + + [TestMethod] + public void TestNotUseLoggerAndUoW() + { + IServiceCollection services = new ServiceCollection(); + services.AddLogging(); + services + .AddDaprEventBus< + CustomIntegrationEventLogService>(); //The logger cannot be mocked and cannot verify that the logger is executed only once + + var serviceProvider = services.BuildServiceProvider(); + var integrationEventBus = serviceProvider.GetRequiredService(); + Assert.IsNotNull(integrationEventBus); + } + + [TestMethod] + public void TestUseLogger() + { + IServiceCollection services = new ServiceCollection(); + + services.AddDaprEventBus(AppDomain.CurrentDomain.GetAssemblies(), option => + { + option.PubSubName = "pubsub"; + }); + var serviceProvider = services.BuildServiceProvider(); + var integrationEventBus = serviceProvider.GetRequiredService(); + Assert.IsNotNull(integrationEventBus); + } + + [TestMethod] + public void TestAddDaprEventBusAndNullServicesAsync() + { + IServiceCollection services = null!; + Mock distributedDispatcherOptions = new(); + distributedDispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); + distributedDispatcherOptions.Setup(option => option.Assemblies).Returns(AppDomain.CurrentDomain.GetAssemblies()).Verifiable(); + Assert.ThrowsException(() => + distributedDispatcherOptions.Object.UseDaprEventBus(), + $"Value cannot be null. (Parameter '{nameof(_options.Object.Services)}')"); + } + + [TestMethod] + public void TestUseDaprReturnNotNull() + { + var services = new ServiceCollection(); + services.AddIntegrationEventBus(opt => + { + opt.UseDapr(); + }); + Mock eventLogService = new(); + services.AddScoped(_ => eventLogService.Object); + + var serviceProvider = services.BuildServiceProvider(); + var publisher = serviceProvider.GetService(); + Assert.IsNotNull(publisher); + var integrationEventBus = serviceProvider.GetService(); + Assert.IsNotNull(integrationEventBus); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj new file mode 100644 index 000000000..deff0817d --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj @@ -0,0 +1,32 @@ + + + + net6.0 + enable + enable + + false + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs new file mode 100644 index 000000000..6a3920cf1 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs @@ -0,0 +1,128 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests; + +[TestClass] +public class ProcessorTest +{ + private IServiceProvider _serviceProvider; + private IOptions _options; + + [TestInitialize] + public void Initialize() + { + var services = new ServiceCollection(); + services.AddDaprEventBus(); + _serviceProvider = services.BuildServiceProvider(); + _options = Microsoft.Extensions.Options.Options.Create(new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies())); + } + + [TestMethod] + public async Task DeletePublishedExpireEventProcessorExecuteTestAsync() + { + Mock integrationEventLogService = new(); + integrationEventLogService.Setup(service => service.DeleteExpiresAsync(It.IsAny(), It.IsAny(), default)) + .Verifiable(); + _options.Value.Services.AddScoped(_ => integrationEventLogService.Object); + + Mock uoW = new(); + uoW.Setup(uow => uow.ServiceProvider).Returns(_options.Value.Services.BuildServiceProvider()).Verifiable(); + + Mock unitOfWorkManager = new(); + unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) + .Verifiable(); + _options.Value.Services.AddSingleton(_ => unitOfWorkManager.Object); + + Mock dataConnectionStringProvider = new(); + dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List() + { + new(string.Empty) + }).Verifiable(); + _options.Value.Services.AddSingleton(_ => dataConnectionStringProvider.Object); + + var processor = new DeletePublishedExpireEventProcessor(_options.Value.Services.BuildServiceProvider(), _options); + await processor.ExecuteAsync(default); + + integrationEventLogService.Verify(service => service.DeleteExpiresAsync(It.IsAny(), It.IsAny(), default), + Times.Once); + } + + [TestMethod] + public async Task InfiniteLoopProcessorExecuteTestAsync() + { + Mock processor = new(); + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(3000); + processor.Setup(pro => pro.ExecuteAsync(cancellationTokenSource.Token)).Verifiable(); + + InfiniteLoopProcessor infiniteLoopProcessor = new InfiniteLoopProcessor(_serviceProvider, processor.Object); + await infiniteLoopProcessor.ExecuteAsync(cancellationTokenSource.Token); + + processor.Verify(pro => pro.ExecuteAsync(cancellationTokenSource.Token), Times.AtLeastOnce); + } + + [TestMethod] + public async Task InfiniteLoopProcessorExecuteAndUseLoggerTestAsync() + { + Mock processor = new(); + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(3000); + processor.Setup(pro => pro.ExecuteAsync(cancellationTokenSource.Token)).Verifiable(); + + InfiniteLoopProcessor infiniteLoopProcessor = + new InfiniteLoopProcessor(_serviceProvider, processor.Object); + await infiniteLoopProcessor.ExecuteAsync(cancellationTokenSource.Token); + + processor.Verify(pro => pro.ExecuteAsync(cancellationTokenSource.Token), Times.AtLeastOnce); + } + + [TestMethod] + public async Task DefaultHostedServiceTestAsync() + { + var services = new ServiceCollection(); + Mock unitOfWorkManager = new(); + services.AddSingleton(_ => unitOfWorkManager.Object); + services.AddScoped(); + services.AddDaprEventBus(opt => + { + opt.CleaningLocalQueueExpireInterval = 1; + opt.CleaningExpireInterval = 1; + opt.FailedRetryInterval = 1; + opt.LocalFailedRetryInterval = 1; + }); + var serviceProvider = services.BuildServiceProvider(); + var hostedService = serviceProvider.GetService(); + Assert.IsNotNull(hostedService); + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(5000); + await hostedService.ExecuteAsync(cancellationTokenSource.Token); + + Assert.IsTrue(CustomProcessor.Times > 0); + } + + [TestMethod] + public async Task DefaultHostedServiceAndUseLoggerTestAsync() + { + var services = new ServiceCollection(); + Mock unitOfWorkManager = new(); + services.AddSingleton(_ => unitOfWorkManager.Object); + services.AddLogging(); + services.AddScoped(); + services.AddDaprEventBus(opt => + { + opt.CleaningLocalQueueExpireInterval = 1; + opt.CleaningExpireInterval = 1; + opt.FailedRetryInterval = 1; + opt.LocalFailedRetryInterval = 1; + }); + var serviceProvider = services.BuildServiceProvider(); + var hostedService = serviceProvider.GetService(); + Assert.IsNotNull(hostedService); + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(5000); + await hostedService.ExecuteAsync(cancellationTokenSource.Token); + + Assert.IsTrue(CustomProcessor.Times > 0); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs new file mode 100644 index 000000000..30d002d09 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/_Imports.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.Options; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Options; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Processor; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; +global using Masa.Utils.Models.Config; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Reflection; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs new file mode 100644 index 000000000..b83c9b1fe --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Domain.Entities; + +public class User +{ + public string Id { get; set; } + + public string Name { get; set; } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs new file mode 100644 index 000000000..f7403095a --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Events; + +public abstract record IntegrationEvent : IIntegrationEvent +{ + public Guid Id { get; set; } + + public DateTime CreationTime { get; set; } + + [JsonIgnore] + public IUnitOfWork? UnitOfWork { get; set; } + + public abstract string Topic { get; set; } + + public IntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public IntegrationEvent(Guid Id, DateTime CreationTime) + { + this.Id = Id; + this.CreationTime = CreationTime; + } + + public Guid GetEventId() => Id; + + public void SetEventId(Guid eventId) => Id = eventId; + + public DateTime GetCreationTime() => CreationTime; + + public void SetCreationTime(DateTime creationTime) => CreationTime = creationTime; +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs new file mode 100644 index 000000000..93ff694be --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Events; + +internal record OrderPaymentSucceededIntegrationEvent : IntegrationEvent +{ + public string OrderId { get; set; } + + public long PaymentTime { get; set; } + + public override string Topic { get; set; } = nameof(OrderPaymentSucceededIntegrationEvent); +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs new file mode 100644 index 000000000..b76ea0101 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Infrastructure; + +internal class CustomDbContext : MasaDbContext +{ + public DbSet Users { get; set; } = null!; + + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs new file mode 100644 index 000000000..f19970b41 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs @@ -0,0 +1,61 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests; + +[TestClass] +public class IntegrationEventLogContextTest : TestBase +{ + [TestMethod] + public void TestCreateDbContext() + { + var services = new ServiceCollection(); + services.AddMasaDbContext(builder => builder.UseSqlite(ConnectionString)); + var distributedDispatcherOptions = CreateDispatcherOptions(services); + distributedDispatcherOptions.UseEventLog(); + var serviceProvider = services.BuildServiceProvider(); + + var customDbContext = serviceProvider.GetRequiredService(); + var entity = customDbContext.Model.GetEntityTypes() + .FirstOrDefault(entityType => entityType.Name == typeof(IntegrationEventLog).FullName)!; + + Assert.IsTrue(entity.GetTableName() == "IntegrationEventLog"); + var properties = entity.GetProperties().ToList(); + Assert.IsTrue(properties.Where(x => x.Name == "Id").Select(x => x.IsPrimaryKey()).FirstOrDefault()); + Assert.IsFalse(properties.Where(x => x.Name == "Id").Select(x => x.IsNullable).FirstOrDefault()); + Assert.IsFalse(properties.Where(x => x.Name == "Content").Select(x => x.IsNullable).FirstOrDefault()); + Assert.IsFalse(properties.Where(x => x.Name == "CreationTime").Select(x => x.IsNullable).FirstOrDefault()); + Assert.IsFalse(properties.Where(x => x.Name == "State").Select(x => x.IsNullable).FirstOrDefault()); + Assert.IsFalse(properties.Where(x => x.Name == "TimesSent").Select(x => x.IsNullable).FirstOrDefault()); + Assert.IsFalse(properties.Where(x => x.Name == "EventTypeName").Select(x => x.IsNullable).FirstOrDefault()); + + var integrationEventLogDbContext = serviceProvider.GetRequiredService(); + Assert.IsTrue(customDbContext == integrationEventLogDbContext.DbContext); + } + + [TestMethod] + public void TestAddDbContext() + { + var services = new ServiceCollection(); + services.AddDbContext(options => options.UseSqlite(Connection)); + var serviceProvider = services.BuildServiceProvider(); + + var dbContext = serviceProvider.GetService(); + Assert.IsTrue(dbContext == null); + + Assert.ThrowsException(() => serviceProvider.GetService()); + } + + [TestMethod] + public void TestUseEventLog() + { + var distributedDispatcherOptions = CreateDispatcherOptions(new ServiceCollection()); + distributedDispatcherOptions.Services.AddDbContext(options => options.UseSqlite(Connection)); + distributedDispatcherOptions.UseEventLog(); + var serviceProvider = distributedDispatcherOptions.Services.BuildServiceProvider(); + + Assert.ThrowsException(() => serviceProvider.GetService()); + + Assert.ThrowsException(() => serviceProvider.GetService()); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs new file mode 100644 index 000000000..71c610d92 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs @@ -0,0 +1,296 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests; + +[TestClass] +public class IntegrationEventLogServiceTest : TestBase +{ + [TestMethod] + public async Task TestNullDbTransactionAsync() + { + var services = new ServiceCollection(); + services.AddMasaDbContext(builder => builder.UseTestSqlite(ConnectionString)) + .AddScoped(); + IDispatcherOptions dispatcherOptions = CreateDispatcherOptions(services); + dispatcherOptions.UseEventLog(); + var serviceProvider = services.BuildServiceProvider(); + + DbTransaction transaction = null!; + var @event = new OrderPaymentSucceededIntegrationEvent() + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + + var eventLogService = serviceProvider.GetRequiredService(); + await Assert.ThrowsExceptionAsync(async () => await eventLogService.SaveEventAsync(@event, transaction)); + } + + [TestMethod] + public void TestNullServices() + { + var dispatcherOptions = CreateDispatcherOptions(null!); + + Assert.ThrowsException(() => + { + dispatcherOptions.UseEventLog(); + }); + } + + [TestMethod] + public void TestAddMultEventLog() + { + var services = new ServiceCollection(); + IDispatcherOptions dispatcherOptions = CreateDispatcherOptions(services); + dispatcherOptions.UseEventLog().UseEventLog(); + Assert.IsTrue(services.Count(service => service.ImplementationType == typeof(IntegrationEventLogModelCreatingProvider)) == 1); + Assert.IsTrue(services.Count(service => service.ServiceType == typeof(IntegrationEventLogContext)) == 1); + } + + [TestMethod] + public async Task TestRetrieveEventLogsFailedToPublishAsync() + { + var dispatcherOptions = CreateDispatcherOptions(new ServiceCollection()); + dispatcherOptions.UseEventLog(); + dispatcherOptions.Services.AddMasaDbContext(option => option.UseTestSqlite(Connection)); + dispatcherOptions.Services.AddScoped(); + var serviceProvider = dispatcherOptions.Services.BuildServiceProvider(); + await serviceProvider.GetRequiredService().Database.EnsureCreatedAsync(); + var logService = serviceProvider.GetRequiredService(); + var list = await logService.RetrieveEventLogsFailedToPublishAsync(); + Assert.IsTrue(!list.Any()); + } + + [TestMethod] + public async Task TestRetrieveEventLogsFailedToPublish2Async() + { + var response = await InitializeAsync(); + + #region Initialization data + + var logs = await response.CustomDbContext.Set().ToListAsync(); + response.CustomDbContext.Set().RemoveRange(logs); + + var @event = new OrderPaymentSucceededIntegrationEvent + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await response.CustomDbContext.Set().AddAsync(new IntegrationEventLog(@event, Guid.NewGuid()) + { + State = IntegrationEventStates.InProgress, + ModificationTime = DateTime.UtcNow.AddSeconds(-120), + }); + await response.CustomDbContext.SaveChangesAsync(); + + #endregion + + var logService = response.ServiceProvider.GetRequiredService(); + var list = (await logService.RetrieveEventLogsFailedToPublishAsync()).ToList(); + Assert.IsTrue(list.Count == 1); + + var eventLog = list.Select(log => log.Event).FirstOrDefault()!; + Assert.IsTrue(eventLog.Equals(@event)); + } + + [TestMethod] + public async Task TestSaveEventAsync() + { + var response = await InitializeAsync(); + + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); + + await using (var transcation = await response.CustomDbContext.Database.BeginTransactionAsync()) + { + var logService = response.ServiceProvider.GetRequiredService(); + var @event = new OrderPaymentSucceededIntegrationEvent + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); + await transcation.CommitAsync(); + } + + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 1); + + Assert.IsTrue(await response.CustomDbContext.Set() + .CountAsync(log => log.State == IntegrationEventStates.NotPublished) == 1); + } + + [TestMethod] + public async Task TestSaveEventByExceptionAsync() + { + var response = await InitializeAsync(); + + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); + + await Assert.ThrowsExceptionAsync(async () => + { + await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); + var logService = response.ServiceProvider.GetRequiredService(); + var @event = new OrderPaymentSucceededIntegrationEvent + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); + throw new Exception("custom exception"); + }, "custom exception"); + + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); + } + + [TestMethod] + public async Task TestMarkEventAsInProgressAsync() + { + var response = await InitializeAsync(); + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); + + await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); + var logService = response.ServiceProvider.GetRequiredService(); + var @event = new OrderPaymentSucceededIntegrationEvent + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); + + await logService.MarkEventAsInProgressAsync(@event.Id); + Assert.IsTrue(await response.CustomDbContext.Set() + .CountAsync(log => log.State == IntegrationEventStates.InProgress) == 1); + await transcation.CommitAsync(); + + Assert.IsTrue(await response.CustomDbContext.Set() + .CountAsync(log => log.State == IntegrationEventStates.InProgress) == 1); + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 1); + } + + [TestMethod] + public async Task TestMarkEventAsInProgress2Async() + { + var response = await InitializeAsync(); + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); + + await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); + var logService = response.ServiceProvider.GetRequiredService(); + + + var @event = new OrderPaymentSucceededIntegrationEvent + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await response.CustomDbContext.Set().AddAsync(new IntegrationEventLog(@event, Guid.NewGuid()) + { + State = IntegrationEventStates.Published + }); + + await response.CustomDbContext.SaveChangesAsync(); + + await Assert.ThrowsExceptionAsync(async () => await logService.MarkEventAsInProgressAsync(@event.Id)); + } + + [TestMethod] + public async Task TestMarkEventAsPublishedAsync() + { + var response = await InitializeAsync(); + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); + + await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); + var logService = response.ServiceProvider.GetRequiredService(); + var @event = new OrderPaymentSucceededIntegrationEvent + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); + + await logService.MarkEventAsInProgressAsync(@event.Id); + + await logService.MarkEventAsPublishedAsync(@event.Id); + + await transcation.CommitAsync(); + + Assert.IsTrue(await response.CustomDbContext.Set() + .CountAsync(log => log.State == IntegrationEventStates.Published) == 1); + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 1); + } + + [TestMethod] + public async Task TestMarkEventAsPublished2Async() + { + var response = await InitializeAsync(); + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); + + await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); + var logService = response.ServiceProvider.GetRequiredService(); + var @event = new OrderPaymentSucceededIntegrationEvent + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); + + await Assert.ThrowsExceptionAsync(async () => await logService.MarkEventAsPublishedAsync(@event.Id)); + } + + [TestMethod] + public async Task TestMarkEventAsFailedAsync() + { + var response = await InitializeAsync(); + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); + + await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); + var logService = response.ServiceProvider.GetRequiredService(); + var @event = new OrderPaymentSucceededIntegrationEvent + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); + await logService.MarkEventAsInProgressAsync(@event.Id); + await logService.MarkEventAsFailedAsync(@event.Id); + await transcation.CommitAsync(); + + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync(log => log.State == IntegrationEventStates.PublishedFailed) == 1); + } + + [TestMethod] + public async Task TestMarkEventAsFailed2Async() + { + var response = await InitializeAsync(); + Assert.IsTrue(await response.CustomDbContext.Set().CountAsync() == 0); + + await using var transcation = await response.CustomDbContext.Database.BeginTransactionAsync(); + var logService = response.ServiceProvider.GetRequiredService(); + var @event = new OrderPaymentSucceededIntegrationEvent + { + OrderId = "1234567890123", + PaymentTime = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await logService.SaveEventAsync(@event, transcation.GetDbTransaction()); + await Assert.ThrowsExceptionAsync(async () => await logService.MarkEventAsFailedAsync(@event.Id)); + } + + private async Task<(CustomDbContext CustomDbContext, IServiceProvider ServiceProvider)> InitializeAsync() + { + var dispatcherOptions = CreateDispatcherOptions(new ServiceCollection()); + dispatcherOptions.UseEventLog(); + dispatcherOptions.Services.AddMasaDbContext(option => + option.UseTestSqlite(Connection)); + dispatcherOptions.Services.AddScoped(); + Mock integrationEventBus = new(); + var types = AppDomain.CurrentDomain.GetAssemblies() + .SelectMany(assembly => assembly.GetTypes()) + .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) + .ToList(); + integrationEventBus.Setup(eventBus => eventBus.GetAllEventTypes()).Returns(types).Verifiable(); + dispatcherOptions.Services.AddScoped(_ => integrationEventBus.Object); + var serviceProvider = dispatcherOptions.Services.BuildServiceProvider(); + var customDbContext = serviceProvider.GetRequiredService(); + await customDbContext.Database.EnsureCreatedAsync(); + return new(customDbContext, serviceProvider); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj new file mode 100644 index 000000000..1f2a52fee --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj @@ -0,0 +1,31 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs new file mode 100644 index 000000000..1808bb4e2 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests; + +public class TestBase : IDisposable +{ + protected readonly string ConnectionString = "DataSource=:memory:"; + protected readonly SqliteConnection Connection; + + protected TestBase() + { + Connection = new SqliteConnection(ConnectionString); + Connection.Open(); + } + + public void Dispose() + { + Connection.Close(); + } + + protected IDispatcherOptions CreateDispatcherOptions(IServiceCollection services, Assembly[]? assemblies = null) + { + Mock dispatcherOptions = new(); + dispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); + dispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies ?? AppDomain.CurrentDomain.GetAssemblies()) + .Verifiable(); + return dispatcherOptions.Object; + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs new file mode 100644 index 000000000..ee23b3b12 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; +global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Domain.Entities; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Events; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Infrastructure; +global using Microsoft.Data.Sqlite; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Storage; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Data.Common; +global using System.Reflection; +global using System.Text.Json.Serialization; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs new file mode 100644 index 000000000..99bb21525 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/BackgroundServiceTest.cs @@ -0,0 +1,37 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests; + +[TestClass] +public class BackgroundServiceTest +{ + [TestInitialize] + public void Initialize() + { + } + + [TestMethod] + public async Task IntegrationEventHostedServiceTask() + { + Mock processingServer = new(); + processingServer.Setup(service => service.ExecuteAsync(default)).Verifiable(); + + var integrationEventHostedService = new CustomIntegrationEventHostedService(processingServer.Object); + await integrationEventHostedService.TestExecuteAsync(default); + + processingServer.Verify(service => service.ExecuteAsync(default), Times.Once); + } + + [TestMethod] + public async Task IntegrationEventHostedServiceAndUseLoggerTask() + { + Mock processingServer = new(); + processingServer.Setup(service => service.ExecuteAsync(default)).Verifiable(); + + var integrationEventHostedService = new CustomIntegrationEventHostedService(processingServer.Object, new NullLoggerFactory()); + await integrationEventHostedService.TestExecuteAsync(default); + + processingServer.Verify(service => service.ExecuteAsync(default), Times.Once); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs new file mode 100644 index 000000000..79a51335e --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/DispatcherOptionTest.cs @@ -0,0 +1,125 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests; + +[TestClass] +public class DispatcherOptionTest +{ + private DispatcherOptions _options; + + [TestInitialize] + public void Initialize() + { + var services = new ServiceCollection(); + _options = new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies()); + } + + [TestMethod] + public void TestSetLocalRetryTimes() + { + Assert.IsTrue(_options.LocalRetryTimes == 3); + _options.LocalRetryTimes = 5; + Assert.IsTrue(_options.LocalRetryTimes == 5); + + Assert.ThrowsException(() => _options.LocalRetryTimes = 0); + } + + [TestMethod] + public void TestSetMaxRetryTimes() + { + Assert.IsTrue(_options.MaxRetryTimes == 10); + _options.MaxRetryTimes = 5; + Assert.IsTrue(_options.MaxRetryTimes == 5); + + Assert.ThrowsException(() => _options.MaxRetryTimes = 0); + } + + [TestMethod] + public void TestSetFailedRetryInterval() + { + Assert.IsTrue(_options.FailedRetryInterval == 60); + _options.FailedRetryInterval = 5; + Assert.IsTrue(_options.FailedRetryInterval == 5); + + Assert.ThrowsException(() => _options.FailedRetryInterval = 0); + } + + [TestMethod] + public void TestSetMinimumRetryInterval() + { + Assert.IsTrue(_options.MinimumRetryInterval == 60); + _options.MinimumRetryInterval = 5; + Assert.IsTrue(_options.MinimumRetryInterval == 5); + + Assert.ThrowsException(() => _options.MinimumRetryInterval = 0); + } + + [TestMethod] + public void TestSetLocalFailedRetryInterval() + { + Assert.IsTrue(_options.LocalFailedRetryInterval == 3); + _options.LocalFailedRetryInterval = 5; + Assert.IsTrue(_options.LocalFailedRetryInterval == 5); + + Assert.ThrowsException(() => _options.LocalFailedRetryInterval = -1); + } + + [TestMethod] + public void TestSetRetryBatchSize() + { + Assert.IsTrue(_options.RetryBatchSize == 100); + _options.RetryBatchSize = 5; + Assert.IsTrue(_options.RetryBatchSize == 5); + + Assert.ThrowsException(() => _options.RetryBatchSize = -1); + } + + [TestMethod] + public void TestSetCleaningLocalQueueExpireInterval() + { + Assert.IsTrue(_options.CleaningLocalQueueExpireInterval == 60); + _options.CleaningLocalQueueExpireInterval = 5; + Assert.IsTrue(_options.CleaningLocalQueueExpireInterval == 5); + + Assert.ThrowsException(() => _options.CleaningLocalQueueExpireInterval = 0); + } + + [TestMethod] + public void TestSetCleaningExpireInterval() + { + Assert.IsTrue(_options.CleaningExpireInterval == 300); + _options.CleaningExpireInterval = 5; + Assert.IsTrue(_options.CleaningExpireInterval == 5); + + Assert.ThrowsException(() => _options.CleaningExpireInterval = 0); + } + + [TestMethod] + public void TestSetPublishedExpireTime() + { + Assert.IsTrue(_options.PublishedExpireTime == 24 * 3600); + _options.PublishedExpireTime = 24 * 3 * 3600; + Assert.IsTrue(_options.PublishedExpireTime == 24 * 3 * 3600); + + Assert.ThrowsException(() => _options.PublishedExpireTime = 0); + } + + [TestMethod] + public void TestSetDeleteBatchCount() + { + Assert.IsTrue(_options.DeleteBatchCount == 1000); + _options.DeleteBatchCount = 100; + Assert.IsTrue(_options.DeleteBatchCount == 100); + + Assert.ThrowsException(() => _options.DeleteBatchCount = 0); + } + + [TestMethod] + public void TestGetCurrentTime() + { + Assert.IsTrue(_options.GetCurrentTime == null); + _options.GetCurrentTime = () => DateTime.UtcNow; + Assert.IsTrue((_options.GetCurrentTime.Invoke() - DateTime.UtcNow).Minutes == 0); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs new file mode 100644 index 000000000..b464641f5 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/CreateUserEvent.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; + +public record CreateUserEvent : IEvent +{ + public string Name { get; set; } + + public Guid Id { get; set; } + + public DateTime CreationTime { get; set; } + + public CreateUserEvent() + { + this.Id = Guid.NewGuid(); + this.CreationTime = DateTime.UtcNow; + } + + public CreateUserEvent(string name) : this() + { + this.Name = name; + } + + public Guid GetEventId() => Id; + + public void SetEventId(Guid eventId) => Id = eventId; + + public DateTime GetCreationTime() => CreationTime; + + public void SetCreationTime(DateTime creationTime) => CreationTime = creationTime; +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs new file mode 100644 index 000000000..92ad97308 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/PaySuccessedIntegrationEvent.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; + +public record PaySuccessedIntegrationEvent() : IntegrationEvent() +{ + public string OrderNo { get; set; } + + public override string Topic { get; set; } = nameof(PaySuccessedIntegrationEvent); + + public PaySuccessedIntegrationEvent(string orderNo) : this() + { + OrderNo = orderNo; + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs new file mode 100644 index 000000000..a530cdefb --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Events/RegisterUserIntegrationEvent.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; + +public record RegisterUserIntegrationEvent : IntegrationEvent +{ + public string Account { get; set; } + + public string Password { get; set; } + + public override string Topic { get; set; } = nameof(RegisterUserIntegrationEvent); +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs new file mode 100644 index 000000000..9fa0c9967 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventHostedService.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; + +public class CustomIntegrationEventHostedService : IntegrationEventHostedService +{ + public CustomIntegrationEventHostedService( + IProcessingServer processingServer, ILoggerFactory? loggerFactory = null) : + base(processingServer, loggerFactory?.CreateLogger()) + { + } + + public Task TestExecuteAsync(CancellationToken stoppingToken) + { + return ExecuteAsync(stoppingToken); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs new file mode 100644 index 000000000..2403d0ee1 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomIntegrationEventLogService.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; + +public class CustomIntegrationEventLogService : IIntegrationEventLogService +{ + public Task MarkEventAsFailedAsync(Guid eventId) + { + return Task.CompletedTask; + } + + public Task DeleteExpiresAsync(DateTime expiresAt, int batchCount = 1000, CancellationToken token = new CancellationToken()) + { + throw new NotImplementedException(); + } + + public Task MarkEventAsInProgressAsync(Guid eventId) + { + return Task.CompletedTask; + } + + public Task MarkEventAsPublishedAsync(Guid eventId) + { + return Task.CompletedTask; + } + + public Task> RetrieveEventLogsFailedToPublishAsync( + int retryBatchSize = 200, + int maxRetryTimes = 10, + int minimumRetryInterval = 60) + { + return Task.FromResult(new List().AsEnumerable()); + } + + public Task SaveEventAsync(IIntegrationEvent @event, DbTransaction transaction) + { + return Task.CompletedTask; + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs new file mode 100644 index 000000000..1e8129489 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Infrastructure/CustomProcessor.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; + +public class CustomProcessor : ProcessorBase +{ + public static int Times = 0; + + public override int Delay => 2; + + public CustomProcessor(IServiceProvider? serviceProvider) : base(serviceProvider) + { + } + + public override Task ExecuteAsync(CancellationToken stoppingToken) + { + Times++; + return Task.CompletedTask; + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs new file mode 100644 index 000000000..d48518d04 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/IntegrationEventBusTest.cs @@ -0,0 +1,394 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests; + +[TestClass] +public class IntegrationEventBusTest +{ + private Mock _options; + private Mock> _dispatcherOptions; + private Mock _publisher; + private Mock> _logger; + private Mock _eventLog; + private Mock> _appConfig; + private Mock _eventBus; + private Mock _uoW; + + [TestInitialize] + public void Initialize() + { + _options = new(); + _options.Setup(option => option.Services).Returns(new ServiceCollection()).Verifiable(); + _dispatcherOptions = new(); + _dispatcherOptions + .Setup(option => option.Value) + .Returns(() => new DispatcherOptions(_options.Object.Services, AppDomain.CurrentDomain.GetAssemblies())); + _publisher = new(); + _logger = new(); + _eventLog = new(); + _eventLog.Setup(eventLog => eventLog.SaveEventAsync(It.IsAny(), null!)).Verifiable(); + _eventLog.Setup(eventLog => eventLog.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); + _eventLog.Setup(eventLog => eventLog.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); + _eventLog.Setup(eventLog => eventLog.MarkEventAsFailedAsync(It.IsAny())).Verifiable(); + _appConfig = new(); + _appConfig.Setup(appConfig => appConfig.CurrentValue).Returns(() => new AppConfig() + { + AppId = "Test" + }); + _eventBus = new(); + _uoW = new(); + _uoW.Setup(uoW => uoW.CommitAsync(default)).Verifiable(); + _uoW.Setup(uoW => uoW.Transaction).Returns(() => null!); + _uoW.Setup(uoW => uoW.UseTransaction).Returns(true); + } + + [TestMethod] + public void TestDispatcherOption() + { + var services = new ServiceCollection(); + DispatcherOptions options; + + Assert.ThrowsException(() => + { + options = new DispatcherOptions(services, null!); + }); + Assert.ThrowsException(() => + { + options = new DispatcherOptions(services, Array.Empty()); + }); + options = new DispatcherOptions(services, new[] { typeof(IntegrationEventBusTest).Assembly }); + Assert.IsTrue(options.Services.Equals(services)); + var allEventTypes = new[] { typeof(IntegrationEventBusTest).Assembly }.SelectMany(assembly => assembly.GetTypes()) + .Where(type => type.IsClass && type != typeof(IntegrationEvent) && typeof(IEvent).IsAssignableFrom(type)).ToList(); + Assert.IsTrue(options.AllEventTypes.Count == allEventTypes.Count()); + } + + [TestMethod] + public async Task TestPublishIntegrationEventAsync() + { + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + _eventBus.Object, + _uoW.Object); + RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() + { + Account = "lisa", + Password = "123456" + }; + _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) + .Verifiable(); + await integrationEventBus.PublishAsync(@event); + + _publisher.Verify(pub => pub.PublishAsync(@event.Topic, @event, default), + Times.Once); + } + + [TestMethod] + public async Task TestNotUseUoWAndLoggerAsync() + { + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + null, + _eventBus.Object); + RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() + { + Account = "lisa", + Password = "123456" + }; + _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) + .Verifiable(); + await integrationEventBus.PublishAsync(@event); + + _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Never); + _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), + Times.Once); + _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Never); + _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Never); + } + + [TestMethod] + public async Task TestNotUseTransactionAsync() + { + _uoW.Setup(uoW => uoW.UseTransaction).Returns(false); + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + _eventBus.Object, + _uoW.Object); + RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() + { + Account = "lisa", + Password = "123456" + }; + _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) + .Verifiable(); + await integrationEventBus.PublishAsync(@event); + + _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Never); + _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), + Times.Once); + _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Never); + _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Never); + } + + [TestMethod] + public async Task TestUseTranscationAndNotUseLoggerAsync() + { + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + null, + _eventBus.Object, + _uoW.Object); + RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() + { + Account = "lisa", + Password = "123456" + }; + _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) + .Verifiable(); + await integrationEventBus.PublishAsync(@event); + + _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Once); + _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), + Times.Once); + _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Once); + _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Never); + } + + [TestMethod] + public async Task TestSaveEventFailedAndNotUseLoggerAsync() + { + _eventLog.Setup(eventLog => eventLog.SaveEventAsync(It.IsAny(), null!)) + .Callback(() => throw new Exception("custom exception")); + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + null, + _eventBus.Object, + _uoW.Object); + RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() + { + Account = "lisa", + Password = "123456" + }; + _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) + .Verifiable(); + await integrationEventBus.PublishAsync(@event); + + _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Never); + _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), + Times.Never); + _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Never); + _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Once); + } + + [TestMethod] + public async Task TestPublishIntegrationEventAndFailedAsync() + { + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + _eventBus.Object, + _uoW.Object); + RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() + { + Account = "lisa", + Password = "123456" + }; + _eventLog.Setup(eventLog => eventLog.MarkEventAsPublishedAsync(It.IsAny())).Throws(); + _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) + .Verifiable(); + await integrationEventBus.PublishAsync(@event); + + _eventLog.Verify(eventLog => eventLog.MarkEventAsInProgressAsync(@event.GetEventId()), Times.Once); + _publisher.Verify(client => client.PublishAsync(@event.Topic, @event, default), + Times.Once); + _eventLog.Verify(eventLog => eventLog.MarkEventAsPublishedAsync(@event.GetEventId()), Times.Once); + _eventLog.Verify(eventLog => eventLog.MarkEventAsFailedAsync(@event.GetEventId()), Times.Once); + } + + [TestMethod] + public async Task TestPublishIntegrationEventAndNotUoWAsync() + { + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + _eventBus.Object, + _uoW.Object); + RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent() + { + Account = "lisa", + Password = "123456", + UnitOfWork = _uoW.Object + }; + _publisher.Setup(client => client.PublishAsync(@event.Topic, @event, default)) + .Verifiable(); + await integrationEventBus.PublishAsync(@event); + + _publisher.Verify(pub => pub.PublishAsync(@event.Topic, @event, default), + Times.Once); + } + + [TestMethod] + public async Task TestPublishEventAsync() + { + _eventBus.Setup(eventBus => eventBus.PublishAsync(It.IsAny())).Verifiable(); + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + _eventBus.Object, + _uoW.Object); + CreateUserEvent @event = new CreateUserEvent() + { + Name = "Tom" + }; + await integrationEventBus.PublishAsync(@event); + + _eventBus.Verify(eventBus => eventBus.PublishAsync(It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestPublishEventAndNotEventBusAsync() + { + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + null, + _uoW.Object); + CreateUserEvent @event = new CreateUserEvent() + { + Name = "Tom" + }; + await Assert.ThrowsExceptionAsync(async () => + { + await integrationEventBus.PublishAsync(@event); + }); + } + + [TestMethod] + public async Task TestCommitAsync() + { + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + _eventBus.Object, + _uoW.Object); + + await integrationEventBus.CommitAsync(default); + _uoW.Verify(uoW => uoW.CommitAsync(default), Times.Once); + } + + [TestMethod] + public async Task TestNotUseUowCommitAsync() + { + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + _eventBus.Object, + null); + + await Assert.ThrowsExceptionAsync(async () => await integrationEventBus.CommitAsync()); + } + + [TestMethod] + public void TestGetAllEventTypes() + { + _dispatcherOptions + .Setup(option => option.Value) + .Returns(() => new DispatcherOptions(_options.Object.Services, new[] { typeof(IntegrationEventBusTest).Assembly })); + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + null, + null); + + Assert.IsTrue(integrationEventBus.GetAllEventTypes().Count() == _dispatcherOptions.Object.Value.AllEventTypes.Count()); + } + + [TestMethod] + public void TestUseEventBusGetAllEventTypes() + { + var defaultAssembly = new System.Reflection.Assembly[1] { typeof(IntegrationEventBusTest).Assembly }; + _dispatcherOptions + .Setup(option => option.Value) + .Returns(() => new DispatcherOptions(_options.Object.Services, defaultAssembly)); + var allEventType = defaultAssembly + .SelectMany(assembly => assembly.GetTypes()) + .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) + .ToList(); + _eventBus.Setup(eventBus => eventBus.GetAllEventTypes()).Returns(() => allEventType).Verifiable(); + var integrationEventBus = new IntegrationEventBus( + _dispatcherOptions.Object, + _publisher.Object, + _eventLog.Object, + _appConfig.Object, + _logger.Object, + _eventBus.Object, + null); + + Assert.IsTrue(integrationEventBus.GetAllEventTypes().Count() == _dispatcherOptions.Object.Value.AllEventTypes.Count()); + Assert.IsTrue(integrationEventBus.GetAllEventTypes().Count() == allEventType.Count()); + } + + [TestMethod] + public void TestAddIntegrationEventBusReturnThrowNoImplementing() + { + var services = new ServiceCollection(); + Assert.ThrowsException(() => services.AddIntegrationEventBus()); + } + + [TestMethod] + public void TestAddMultiIntegrationEventBusReturnIntegrationEventBusCountEqual1() + { + var services = new ServiceCollection(); + services.AddIntegrationEventBus(dispatcherOptions => + { + Mock publisher = new(); + dispatcherOptions.Services.TryAddSingleton(publisher.Object); + }).AddIntegrationEventBus(dispatcherOptions => + { + Mock publisher = new(); + dispatcherOptions.Services.TryAddSingleton(publisher.Object); + }); + var serviceProvider = services.BuildServiceProvider(); + var integrationEventBuses = serviceProvider.GetServices(); + Assert.IsTrue(integrationEventBuses.Count() == 1); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj new file mode 100644 index 000000000..797d2a112 --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj @@ -0,0 +1,29 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs new file mode 100644 index 000000000..a2b26ac9b --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/ProcessorTest.cs @@ -0,0 +1,398 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; +using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; + +namespace Masa.Contrib.Dispatcher.IntegrationEvents.Tests; + +[TestClass] +public class ProcessorTest +{ + private IServiceProvider _serviceProvider; + private IOptions _options; + + [TestInitialize] + public void Initialize() + { + var services = new ServiceCollection(); + MockPublisher(services); + services.AddIntegrationEventBus(); + _serviceProvider = services.BuildServiceProvider(); + _options = _serviceProvider.GetRequiredService>(); + } + + [TestMethod] + public void DeleteLocalQueueExpiresProcessorDelayTestAsync() + { + ProcessorBase processor = new DeleteLocalQueueExpiresProcessor(_options); + Assert.IsTrue(processor.Delay == _options.Value.CleaningLocalQueueExpireInterval); + } + + [TestMethod] + public void DeletePublishedExpireEventDelayTestAsync() + { + ProcessorBase processor = new DeletePublishedExpireEventProcessor(_serviceProvider, _options); + Assert.IsTrue(processor.Delay == _options.Value.CleaningExpireInterval); + } + + [TestMethod] + public void RetryByDataProcessorDelayTestAsync() + { + ProcessorBase processor = new RetryByDataProcessor(_serviceProvider, _options); + Assert.IsTrue(processor.Delay == _options.Value.FailedRetryInterval); + } + + [TestMethod] + public async Task RetryByDataProcessorExecuteTestAsync() + { + var services = new ServiceCollection(); + services.AddLogging(); + + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(1000); + + Mock publisher = new(); + publisher.Setup(client + => client.PublishAsync(It.IsAny(), It.IsAny(), cancellationTokenSource.Token)); + services.AddScoped(_ => publisher.Object); + + Mock integrationEventLogService = new(); + RegisterUserIntegrationEvent @event = new RegisterUserIntegrationEvent(); + + integrationEventLogService.Setup(service => service.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); + integrationEventLogService.Setup(service => service.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); + + List list = new List() + { + new(@event, Guid.Empty), + new(@event, Guid.Empty) + }; + list.ForEach(item => + { + item.DeserializeJsonContent(typeof(RegisterUserIntegrationEvent)); + }); + integrationEventLogService.Setup(service => + service.RetrieveEventLogsFailedToPublishAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(() => list) + .Verifiable(); + services.AddScoped(_ => integrationEventLogService.Object); + + Mock uoW = new(); + uoW.Setup(u => u.CommitAsync(cancellationTokenSource.Token)).Verifiable(); + uoW.Setup(u => u.ServiceProvider).Returns(services.BuildServiceProvider()).Verifiable(); + services.AddScoped(_ => uoW.Object); + + Mock unitOfWorkManager = new(); + unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) + .Verifiable(); + services.AddSingleton(_ => unitOfWorkManager.Object); + + Mock dataConnectionStringProvider = new(); + dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List + { + new(string.Empty) + }).Verifiable(); + services.AddSingleton(_ => dataConnectionStringProvider.Object); + + Mock> options = new(); + options.Setup(opt => opt.Value).Returns(new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies())); + AppConfig appConfig = new() + { + AppId = "test" + }; + + var serviceProvider = services.BuildServiceProvider(); + RetryByDataProcessor retryByDataProcessor = new( + serviceProvider, + options.Object, + Mock.Of>(a => a.CurrentValue == appConfig), + serviceProvider.GetService>()); + await retryByDataProcessor.ExecuteAsync(cancellationTokenSource.Token); + + integrationEventLogService.Verify(service => service.MarkEventAsInProgressAsync(It.IsAny()), Times.Exactly(2)); + integrationEventLogService.Verify(service => service.MarkEventAsPublishedAsync(It.IsAny()), Times.Exactly(2)); + } + + [TestMethod] + public async Task RetryByDataProcessorExecute2TestAsync() + { + var services = new ServiceCollection(); + services.AddLogging(); + + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(1000); + + Mock integrationEventLogService = new(); + integrationEventLogService.Setup(service => service.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); + integrationEventLogService.Setup(service => service.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); + integrationEventLogService.Setup(service => service.MarkEventAsFailedAsync(It.IsAny())).Verifiable(); + + List list = new List() + { + new(new RegisterUserIntegrationEvent(), Guid.Empty), + new(new PaySuccessedIntegrationEvent(Guid.NewGuid().ToString()), Guid.Empty) + }; + for (int index = 0; index < list.Count; index++) + { + if (index == 0) + list[index].DeserializeJsonContent(typeof(RegisterUserIntegrationEvent)); + else + list[index].DeserializeJsonContent(typeof(PaySuccessedIntegrationEvent)); + } + + Mock publisher = new(); + publisher.Setup(client + => client.PublishAsync(nameof(RegisterUserIntegrationEvent), It.IsAny(), + cancellationTokenSource.Token)) + .Throws(new Exception("custom exception")); + publisher.Setup(client + => client.PublishAsync(nameof(PaySuccessedIntegrationEvent), It.IsAny(), + cancellationTokenSource.Token)) + .Throws(new UserFriendlyException("custom exception")); + services.AddScoped(_ => publisher.Object); + + integrationEventLogService.Setup(service => + service.RetrieveEventLogsFailedToPublishAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(() => list) + .Verifiable(); + services.AddScoped(_ => integrationEventLogService.Object); + + Mock uoW = new(); + uoW.Setup(u => u.CommitAsync(cancellationTokenSource.Token)).Verifiable(); + uoW.Setup(u => u.ServiceProvider).Returns(services.BuildServiceProvider()).Verifiable(); + services.AddScoped(_ => uoW.Object); + + Mock unitOfWorkManager = new(); + unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) + .Verifiable(); + services.AddSingleton(_ => unitOfWorkManager.Object); + + Mock dataConnectionStringProvider = new(); + dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List + { + new(string.Empty) + }).Verifiable(); + services.AddSingleton(_ => dataConnectionStringProvider.Object); + + Mock> options = new(); + options.Setup(opt => opt.Value).Returns(new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies())); + AppConfig appConfig = new() + { + AppId = "test" + }; + + var serviceProvider = services.BuildServiceProvider(); + RetryByDataProcessor retryByDataProcessor = new( + serviceProvider, + options.Object, + Mock.Of>(a => a.CurrentValue == appConfig), + serviceProvider.GetService>()); + await retryByDataProcessor.ExecuteAsync(cancellationTokenSource.Token); + + integrationEventLogService.Verify(service => service.MarkEventAsInProgressAsync(It.IsAny()), Times.Exactly(2)); + integrationEventLogService.Verify(service => service.MarkEventAsPublishedAsync(It.IsAny()), Times.Never); + integrationEventLogService.Verify(service => service.MarkEventAsFailedAsync(It.IsAny()), Times.Exactly(1)); + } + + [TestMethod] + public async Task RetryByDataProcessorExecute2AndNotUseLoggerTestAsync() + { + var services = new ServiceCollection(); + + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(1000); + + Mock integrationEventLogService = new(); + integrationEventLogService.Setup(service => service.MarkEventAsInProgressAsync(It.IsAny())).Verifiable(); + integrationEventLogService.Setup(service => service.MarkEventAsPublishedAsync(It.IsAny())).Verifiable(); + integrationEventLogService.Setup(service => service.MarkEventAsFailedAsync(It.IsAny())).Verifiable(); + + List list = new List() + { + new(new RegisterUserIntegrationEvent(), Guid.Empty), + new(new PaySuccessedIntegrationEvent(Guid.NewGuid().ToString()), Guid.Empty) + }; + for (int index = 0; index < list.Count; index++) + { + if (index == 0) + list[index].DeserializeJsonContent(typeof(RegisterUserIntegrationEvent)); + else + list[index].DeserializeJsonContent(typeof(PaySuccessedIntegrationEvent)); + } + + Mock publisher = new(); + publisher.Setup(client + => client.PublishAsync(nameof(RegisterUserIntegrationEvent), It.IsAny(), + cancellationTokenSource.Token)) + .Throws(new Exception("custom exception")); + publisher.Setup(client + => client.PublishAsync(nameof(PaySuccessedIntegrationEvent), It.IsAny(), + cancellationTokenSource.Token)) + .Throws(new UserFriendlyException("custom exception")); + services.AddScoped(_ => publisher.Object); + + integrationEventLogService.Setup(service => + service.RetrieveEventLogsFailedToPublishAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(() => list) + .Verifiable(); + services.AddScoped(_ => integrationEventLogService.Object); + + Mock> options = new(); + options.Setup(opt => opt.Value).Returns(new DispatcherOptions(services, AppDomain.CurrentDomain.GetAssemblies())); + AppConfig appConfig = new() + { + AppId = "test" + }; + + Mock uoW = new(); + uoW.Setup(u => u.CommitAsync(cancellationTokenSource.Token)).Verifiable(); + uoW.Setup(u => u.ServiceProvider).Returns(services.BuildServiceProvider()).Verifiable(); + services.AddScoped(_ => uoW.Object); + + Mock unitOfWorkManager = new(); + unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) + .Verifiable(); + services.AddSingleton(_ => unitOfWorkManager.Object); + + Mock dataConnectionStringProvider = new(); + dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List() + { + new(string.Empty) + }).Verifiable(); + services.AddSingleton(_ => dataConnectionStringProvider.Object); + + var serviceProvider = services.BuildServiceProvider(); + RetryByDataProcessor retryByDataProcessor = new( + serviceProvider, + options.Object, + Mock.Of>(a => a.CurrentValue == appConfig), + serviceProvider.GetService>()); + await retryByDataProcessor.ExecuteAsync(cancellationTokenSource.Token); + + integrationEventLogService.Verify(service => service.MarkEventAsInProgressAsync(It.IsAny()), Times.Exactly(2)); + integrationEventLogService.Verify(service => service.MarkEventAsPublishedAsync(It.IsAny()), Times.Never); + integrationEventLogService.Verify(service => service.MarkEventAsFailedAsync(It.IsAny()), Times.Exactly(1)); + } + + [TestMethod] + public void RetryByLocalQueueProcessorDelayTestAsync() + { + ProcessorBase processor = new RetryByLocalQueueProcessor(_serviceProvider, _options); + Assert.IsTrue(processor.Delay == _options.Value.LocalFailedRetryInterval); + } + + [TestMethod] + public async Task DeletePublishedExpireEventProcessorExecuteTestAsync() + { + Mock integrationEventLogService = new(); + integrationEventLogService.Setup(service => service.DeleteExpiresAsync(It.IsAny(), It.IsAny(), default)) + .Verifiable(); + _options.Value.Services.AddScoped(_ => integrationEventLogService.Object); + + Mock uoW = new(); + uoW.Setup(uow => uow.ServiceProvider).Returns(_options.Value.Services.BuildServiceProvider()).Verifiable(); + + Mock unitOfWorkManager = new(); + unitOfWorkManager.Setup(uoWManager => uoWManager.CreateDbContext(It.IsAny())).Returns(uoW.Object) + .Verifiable(); + _options.Value.Services.AddSingleton(_ => unitOfWorkManager.Object); + + Mock dataConnectionStringProvider = new(); + dataConnectionStringProvider.Setup(provider => provider.DbContextOptionsList).Returns(new List() + { + new(string.Empty) + }).Verifiable(); + _options.Value.Services.AddSingleton(_ => dataConnectionStringProvider.Object); + + var processor = new DeletePublishedExpireEventProcessor(_options.Value.Services.BuildServiceProvider(), _options); + await processor.ExecuteAsync(default); + + integrationEventLogService.Verify(service => service.DeleteExpiresAsync(It.IsAny(), It.IsAny(), default), + Times.Once); + } + + [TestMethod] + public async Task InfiniteLoopProcessorExecuteTestAsync() + { + Mock processor = new(); + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(3000); + processor.Setup(pro => pro.ExecuteAsync(cancellationTokenSource.Token)).Verifiable(); + + InfiniteLoopProcessor infiniteLoopProcessor = new InfiniteLoopProcessor(_serviceProvider, processor.Object); + await infiniteLoopProcessor.ExecuteAsync(cancellationTokenSource.Token); + + processor.Verify(pro => pro.ExecuteAsync(cancellationTokenSource.Token), Times.AtLeastOnce); + } + + [TestMethod] + public async Task InfiniteLoopProcessorExecuteAndUseLoggerTestAsync() + { + Mock processor = new(); + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(3000); + processor.Setup(pro => pro.ExecuteAsync(cancellationTokenSource.Token)).Verifiable(); + + InfiniteLoopProcessor infiniteLoopProcessor = + new InfiniteLoopProcessor(_serviceProvider, processor.Object); + await infiniteLoopProcessor.ExecuteAsync(cancellationTokenSource.Token); + + processor.Verify(pro => pro.ExecuteAsync(cancellationTokenSource.Token), Times.AtLeastOnce); + } + + [TestMethod] + public async Task DefaultHostedServiceTestAsync() + { + var services = new ServiceCollection(); + MockPublisher(services); + Mock unitOfWorkManager = new(); + services.AddSingleton(_ => unitOfWorkManager.Object); + services.AddScoped(); + services.AddIntegrationEventBus(opt => + { + opt.CleaningLocalQueueExpireInterval = 1; + opt.CleaningExpireInterval = 1; + opt.FailedRetryInterval = 1; + opt.LocalFailedRetryInterval = 1; + }); + var serviceProvider = services.BuildServiceProvider(); + var hostedService = serviceProvider.GetService(); + Assert.IsNotNull(hostedService); + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(5000); + await hostedService.ExecuteAsync(cancellationTokenSource.Token); + + Assert.IsTrue(CustomProcessor.Times > 0); + } + + [TestMethod] + public async Task DefaultHostedServiceAndUseLoggerTestAsync() + { + var services = new ServiceCollection(); + MockPublisher(services); + Mock unitOfWorkManager = new(); + services.AddSingleton(_ => unitOfWorkManager.Object); + services.AddLogging(); + services.AddScoped(); + services.AddIntegrationEventBus(opt => + { + opt.CleaningLocalQueueExpireInterval = 1; + opt.CleaningExpireInterval = 1; + opt.FailedRetryInterval = 1; + opt.LocalFailedRetryInterval = 1; + }); + var serviceProvider = services.BuildServiceProvider(); + var hostedService = serviceProvider.GetService(); + Assert.IsNotNull(hostedService); + CancellationTokenSource cancellationTokenSource = new(); + cancellationTokenSource.CancelAfter(5000); + await hostedService.ExecuteAsync(cancellationTokenSource.Token); + + Assert.IsTrue(CustomProcessor.Times > 0); + } + + private void MockPublisher(IServiceCollection services) + { + Mock publisher = new(); + publisher.Setup(p => p.PublishAsync(It.IsAny(), It.IsAny(), default)).Verifiable(); + services.AddSingleton(publisher.Object); + } +} diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs new file mode 100644 index 000000000..9dc39e12a --- /dev/null +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Tests/_Imports.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.Options; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Options; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Processor; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Events; +global using Masa.Contrib.Dispatcher.IntegrationEvents.Tests.Infrastructure; +global using Masa.Utils.Models.Config; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Logging.Abstractions; +global using Microsoft.Extensions.Options; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Data.Common; +global using System.Reflection; diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs new file mode 100644 index 000000000..ca2d8a69e --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/DefaultExceptionStrategyProvider.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events; + +public class DefaultExceptionStrategyProvider : IExceptionStrategyProvider +{ + private readonly ILogger? _logger; + + public DefaultExceptionStrategyProvider(ILogger? logger = null) + => _logger = logger; + + /// + /// Default UserFriendlyException does not support retry + /// + /// + /// + public bool SupportRetry(Exception? exception) + { + return exception is not UserFriendlyException; + } + + public void LogWrite(LogLevel logLevel, Exception? exception, string? message, params object?[] args) + { + if (exception is not UserFriendlyException) + _logger?.Log(logLevel, exception, message, args); + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs new file mode 100644 index 000000000..4393028a0 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/DispatcherOptionsExtensions.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events; + +public static class DispatcherOptionsExtensions +{ + public static IDispatcherOptions UseEventBus( + this IDispatcherOptions options) + => options.UseEventBus(ServiceLifetime.Scoped); + + public static IDispatcherOptions UseEventBus( + this IDispatcherOptions options, + Action eventBusBuilder) + => options.UseEventBus(eventBusBuilder, ServiceLifetime.Scoped); + + public static IDispatcherOptions UseEventBus( + this IDispatcherOptions options, + ServiceLifetime lifetime) + => options.UseEventBus(null, lifetime); + + public static IDispatcherOptions UseEventBus( + this IDispatcherOptions options, + Action? eventBusBuilder, + ServiceLifetime lifetime) + { + ArgumentNullException.ThrowIfNull(options.Services, nameof(options.Services)); + + options.Services.AddEventBus(options.Assemblies, lifetime, eventBusBuilder); + return options; + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs new file mode 100644 index 000000000..2dadcc33f --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Enums/FailureLevels.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Enums; + +public enum FailureLevels +{ + Throw = 1, + + ThrowAndCancel, + + Ignore +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs new file mode 100644 index 000000000..6edf6115b --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBus.cs @@ -0,0 +1,71 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events; + +public class EventBus : IEventBus +{ + private readonly IServiceProvider _serviceProvider; + + private readonly Internal.Dispatch.Dispatcher _dispatcher; + + private readonly DispatcherOptions _options; + + private readonly IUnitOfWork? _unitOfWork; + + private readonly string LoadEventHelpLink = "https://github.com/masastack/Masa.Contrib/tree/main/docs/LoadEvent.md"; + + public readonly IInitializeServiceProvider _initializeServiceProvider; + + public EventBus(IServiceProvider serviceProvider, + IOptions options, + IInitializeServiceProvider initializeServiceProvider, + IUnitOfWork? unitOfWork = null) + { + _serviceProvider = serviceProvider; + _dispatcher = serviceProvider.GetRequiredService(); + _options = options.Value; + _initializeServiceProvider = initializeServiceProvider; + _unitOfWork = unitOfWork; + } + + public async Task PublishAsync(TEvent @event) where TEvent : IEvent + { + ArgumentNullException.ThrowIfNull(@event, nameof(@event)); + var eventType = @event.GetType(); + + var middlewares = _serviceProvider.GetRequiredService>>(); + if (!_options.UnitOfWorkRelation.ContainsKey(eventType)) + { + throw new NotSupportedException( + $"Getting \"{eventType.Name}\" relationship chain failed, see {LoadEventHelpLink} for details. "); + } + + if (_options.UnitOfWorkRelation[eventType]) + { + ITransaction transactionEvent = (ITransaction)@event; + transactionEvent.UnitOfWork = _unitOfWork; + } + + if (_initializeServiceProvider.IsInitialize) + middlewares = middlewares.Where(middleware => middleware.SupportRecursive); + + _initializeServiceProvider.Initialize(); + + EventHandlerDelegate eventHandlerDelegate = async () => + { + await _dispatcher.PublishEventAsync(_serviceProvider, @event); + }; + await middlewares.Reverse().Aggregate(eventHandlerDelegate, (next, middleware) => () => middleware.HandleAsync(@event, next))(); + } + + public IEnumerable GetAllEventTypes() => _options.AllEventTypes; + + public async Task CommitAsync(CancellationToken cancellationToken = default) + { + if (_unitOfWork is null) + throw new ArgumentNullException("You need to UseUoW when adding services"); + + await _unitOfWork.CommitAsync(cancellationToken); + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs new file mode 100644 index 000000000..fc00ed4c0 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventBusBuilder.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events; + +public class EventBusBuilder : IEventBusBuilder +{ + public IServiceCollection Services { get; } + + public EventBusBuilder(IServiceCollection services) => Services = services; + + public IEventBusBuilder UseMiddleware(Type middleware, ServiceLifetime middlewareLifetime = ServiceLifetime.Transient) + { + if (!typeof(IMiddleware<>).IsGenericInterfaceAssignableFrom(middleware)) + throw new ArgumentException($"{middleware.Name} doesn't implement IMiddleware<>"); + + var descriptor = new ServiceDescriptor(typeof(IMiddleware<>), middleware, middlewareLifetime); + Services.TryAddEnumerable(descriptor); + return this; + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs new file mode 100644 index 000000000..f975bc9da --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/EventHandlerAttribute.cs @@ -0,0 +1,165 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events; + +[AttributeUsage(AttributeTargets.Method)] +public class EventHandlerAttribute : Attribute +{ + public EventHandlerAttribute() : this(DefaultOrder) + { + } + + public EventHandlerAttribute(int order) : this(order, false) + { + + } + + public EventHandlerAttribute(int order, bool enableRetry) : this(order, enableRetry, enableRetry ? DefaultRetryCount : 0) + { + + } + + public EventHandlerAttribute(int order, FailureLevels failureLevels) : this(order, failureLevels, false) + { + + } + + public EventHandlerAttribute(int order, bool enableRetry, int retryTimes) : this(order, FailureLevels.Throw, enableRetry, retryTimes) + { + + } + + public EventHandlerAttribute(int order, bool enableRetry, bool isCancel) : this(order, enableRetry, isCancel, + enableRetry ? DefaultRetryCount : 0) + { + + } + + public EventHandlerAttribute(int order, bool enableRetry, bool isCancel, int retryTimes) : this(order, FailureLevels.Throw, enableRetry, + retryTimes, isCancel) + { + + } + + public EventHandlerAttribute(int order, FailureLevels failureLevels, bool enableRetry) : this(order, failureLevels, enableRetry, + enableRetry ? DefaultRetryCount : 0) + { + + } + + public EventHandlerAttribute(int order, FailureLevels failureLevels, bool enableRetry, bool isCancel) : this(order, failureLevels, + enableRetry, enableRetry ? DefaultRetryCount : 0, isCancel) + { + + } + + public EventHandlerAttribute(int order, FailureLevels failureLevels, bool enableRetry, int retryTimes, bool isCancel = false) + { + Order = order; + FailureLevels = failureLevels; + EnableRetry = enableRetry; + RetryTimes = enableRetry ? retryTimes : 0; + IsCancel = isCancel; + } + + /// + /// The default number of retry attempts. + /// + private const int DefaultRetryCount = 3; + + private const int DefaultOrder = int.MaxValue; + + private int _order; + + /// + /// Used to control the order in which methods are executed, in ascending order. default is int.MaxValue + /// Must be greater than or equal to 0 + /// + public int Order + { + get => _order; + set + { + if (value < 0) + throw new ArgumentOutOfRangeException("The order must be greater than or equal to 0"); + + _order = value; + } + } + + public FailureLevels FailureLevels { get; set; } + + public bool EnableRetry { get; set; } + + /// + /// The default value is 3,EnableRetry must be true to take effect + /// + public int RetryTimes { get; set; } + + /// + /// Used to cancel or compensate + /// + public bool IsCancel { get; set; } + + internal MethodInfo ActionMethodInfo { get; set; } + + internal Type InstanceType { get; set; } + + internal Type EventType { get; set; } + + internal int ActualRetryTimes => EnableRetry ? RetryTimes : 0; + + internal TaskInvokeDelegate? InvokeDelegate { get; private set; } + + private object Instance { get; set; } = default!; + + private object? EventHandler { get; set; } + + internal bool IsEventHandler => FailureLevels == FailureLevels.Throw || FailureLevels == FailureLevels.ThrowAndCancel; + + internal void BuildExpression() + { + InvokeDelegate = InvokeBuilder.Build(ActionMethodInfo, InstanceType); + } + + internal async Task ExcuteAction(IServiceProvider serviceProvider, TEvent @event) where TEvent : IEvent + { + if (InvokeDelegate != null) + { + Instance = serviceProvider.GetRequiredService(InstanceType); + await InvokeDelegate.Invoke(Instance, @event); + } + else + { + await ExcuteSagaAction(serviceProvider, @event); + } + } + + private async Task ExcuteSagaAction(IServiceProvider serviceProvider, TEvent @event) where TEvent : IEvent + { + if (!IsCancel) + { + if (EventHandler == null) + { + var handlers = serviceProvider.GetServices>(); + var handler = handlers.FirstOrDefault(x => x.GetType() == InstanceType)!; + EventHandler = handler; + } + await ((IEventHandler)EventHandler).HandleAsync(@event); + } + else + { + if (EventHandler == null) + { + var handlers = serviceProvider.GetServices>(); + var handler = handlers.FirstOrDefault(x => x.GetType() == InstanceType)!; + EventHandler = handler; + } + await ((ISagaEventHandler)EventHandler).CancelAsync(@event); + } + } + + internal bool IsHandlerMissing(int maxCancelOrder) => FailureLevels == FailureLevels.ThrowAndCancel && Order < maxCancelOrder || + FailureLevels == FailureLevels.Throw && Order <= maxCancelOrder; +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs new file mode 100644 index 000000000..2c4eebad1 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/IExceptionStrategyProvider.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events; + +public interface IExceptionStrategyProvider +{ + bool SupportRetry(Exception? exception); + + void LogWrite(LogLevel logLevel, Exception? exception, string? message, params object?[] args); +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs new file mode 100644 index 000000000..3d6404220 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/IInitializeServiceProvider.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events; + +/// +/// Used to filter EventBus middleware that does not support recursion +/// +public interface IInitializeServiceProvider +{ + /// + /// Get the initialization state. If it has been initialized, the middleware that does not support recursion is no longer executed. + /// + bool IsInitialize { get; } + + /// + /// service has been initialized + /// + void Initialize(); + + /// + /// reset initialization state + /// + void Reset(); +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs new file mode 100644 index 000000000..5007b94ef --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatchRelationNetwork.cs @@ -0,0 +1,102 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Internal.Dispatch; + +internal class DispatchRelationNetwork +{ + public Dictionary> RelationNetwork { get; set; } = new(); + + public Dictionary> HandlerRelationNetwork { get; set; } = new(); + + public Dictionary> CancelRelationNetwork { get; set; } = new(); + + private readonly ILogger? _logger; + + public DispatchRelationNetwork(ILogger? logger) => _logger = logger; + + public void Add(Type keyEventType, EventHandlerAttribute handler) + { + Add(keyEventType, handler, !handler.IsCancel ? HandlerRelationNetwork : CancelRelationNetwork); + } + + /// + /// If the relationship does not exist in the network, add it + /// + /// + /// + /// + private void Add(Type keyEventType, + EventHandlerAttribute handlers, + Dictionary> dispatchRelativeNetwork) + { + if (!dispatchRelativeNetwork.ContainsKey(keyEventType)) + { + dispatchRelativeNetwork.Add(keyEventType, new List()); + } + + if (!dispatchRelativeNetwork[keyEventType].Any(x => x.ActionMethodInfo.Equals(handlers.ActionMethodInfo) && x.InstanceType == handlers.InstanceType)) + { + dispatchRelativeNetwork[keyEventType].Add(handlers); + } + } + + public void Build() + { + Sort(); + CheckConstraints(); + RelationNetwork = HandlerRelationNetwork.ToDictionary(relationNetwork => relationNetwork.Key, + relationNetwork => relationNetwork.Value.Select(handler => new DispatchRelationOptions(handler)).ToList()); + + foreach (var relation in RelationNetwork) + { + foreach (var relationOption in RelationNetwork[relation.Key]!) + { + if (CancelRelationNetwork.TryGetValue(relation.Key, out List? cancelRelations)) + { + var cancelHandlers = cancelRelations.TakeWhile(cancelHandler => relationOption.IsCancelHandler(cancelHandler)).Reverse().ToList(); + relationOption.AddCancelHandler(cancelHandlers); + } + } + } + } + + private void Sort() + { + HandlerRelationNetwork = Sort(HandlerRelationNetwork); + CancelRelationNetwork = Sort(CancelRelationNetwork); + } + + private Dictionary> Sort(Dictionary> dispatchRelatives) + where TDispatchHandlerAttribute : EventHandlerAttribute + { + return dispatchRelatives.ToDictionary( + dispatchRelative => dispatchRelative.Key, + dispatchRelative => dispatchRelative.Value.OrderBy(attr => attr.Order).ToList() + ); + } + + /// + /// Checking scheduling Relationships + /// Throw an exception for a Handler that only has Cancel + /// and warn a Handler that the Cancel will never perform because the Order is improperly set + /// + private void CheckConstraints() + { + foreach (var cancelRelation in CancelRelationNetwork) + { + if (HandlerRelationNetwork.All(relation => relation.Key != cancelRelation.Key)) + { + throw new NotSupportedException($"{cancelRelation.Key.Name} is only have a cancel handler, it must have an event handler."); + } + + var maxCancelOrder = cancelRelation.Value.Max(handler => handler.Order); + var maxHandlerOrder = HandlerRelationNetwork[cancelRelation.Key].Where(handler => handler.IsEventHandler).OrderByDescending(handler => handler.Order).ThenByDescending(handler => handler.FailureLevels).FirstOrDefault(); + if (maxHandlerOrder == null || maxHandlerOrder.IsHandlerMissing(maxCancelOrder)) + { + var methodName = cancelRelation.Value.Select(x => x.ActionMethodInfo.Name).LastOrDefault(); + _logger?.LogWarning($"The {methodName} method is meaningless, because its Order attribute is too large, and no handler corresponding to the Order can be triggered. It is suggested to lower the Order attribute of {methodName} or add a matching handler - {cancelRelation.Value.Select(x => x.InstanceType.FullName).LastOrDefault()}"); + } + } + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs new file mode 100644 index 000000000..3fdedfebe --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/Dispatcher.cs @@ -0,0 +1,72 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Internal.Dispatch; + +internal class Dispatcher : DispatcherBase +{ + public Dispatcher(IServiceCollection services, Assembly[] assemblies, bool forceInit = false) : base(services, assemblies, forceInit) + { + } + + public Dispatcher Build(ServiceLifetime lifetime) + { + foreach (var assembly in Assemblies) + { + AddRelationNetwork(assembly); + } + foreach (var dispatchInstance in GetAddServiceTypeList()) + { + Services.Add(dispatchInstance, dispatchInstance, lifetime); + } + Build(); + return this; + } + + private void AddRelationNetwork(Assembly assembly) + { + foreach (var type in assembly.GetTypes()) + { + if (!type.IsConcrete()) + { + continue; //Handler and Cancel must be normal classes, not abstract classes or interfaces + } + + foreach (var method in type.GetMethods()) + { + AddRelationNetwork(type, method); + } + } + } + + private void AddRelationNetwork(Type type, MethodInfo method) + { + try + { + var attribute = method.GetCustomAttributes(typeof(EventHandlerAttribute), true).FirstOrDefault(); + if (attribute is not null && attribute is EventHandlerAttribute handler) + { + var parameters = method.GetParameters(); + + if (parameters == null || parameters.Length != 1 || + !parameters.Any(parameter => typeof(IEvent).IsAssignableFrom(parameter.ParameterType))) + throw new ArgumentOutOfRangeException($"[{method.Name}] must have only one argument and inherit from Event"); + + if (IsSagaMode(type, method)) + return; + + var parameter = parameters.FirstOrDefault()!; + handler.ActionMethodInfo = method; + handler.InstanceType = type; + handler.EventType = parameter.ParameterType; + handler.BuildExpression(); + AddRelationNetwork(parameter.ParameterType, handler); + } + } + catch (Exception ex) + { + Logger?.LogError($"Dispatcher: Failed to get EventBus network, type name: [{type.FullName ?? type.Name}], method: [{method.Name}]", ex); + throw; + } + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs new file mode 100644 index 000000000..25b3ff9b6 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/DispatcherBase.cs @@ -0,0 +1,127 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Internal.Dispatch; + +internal class DispatcherBase +{ + protected static DispatchRelationNetwork? SharingRelationNetwork; + + protected readonly IServiceCollection Services; + + protected readonly Assembly[] Assemblies; + + protected readonly ILogger? Logger; + + public DispatcherBase(IServiceCollection services, Assembly[] assemblies, bool forceInit) + { + Services = services; + Assemblies = assemblies; + var serviceProvider = services.BuildServiceProvider(); + if (SharingRelationNetwork == null || forceInit) + { + SharingRelationNetwork = new DispatchRelationNetwork(serviceProvider.GetService>()); + } + Logger = serviceProvider.GetService>(); + } + + public async Task PublishEventAsync(IServiceProvider serviceProvider, TEvent @event) + where TEvent : IEvent + { + ArgumentNullException.ThrowIfNull(@event, nameof(@event)); + var eventType = @event.GetType(); + if (!SharingRelationNetwork!.RelationNetwork.TryGetValue(eventType, out List? dispatchRelations)) + { + if (@event is IIntegrationEvent) + { + Logger?.LogError($"Dispatcher: The current event is an out-of-process event. You should use IIntegrationEventBus or IDomainEventBus to send it"); + throw new ArgumentNullException($"The current event is an out-of-process event. You should use IIntegrationEventBus or IDomainEventBus to send it"); + } + + Logger?.LogError($"Dispatcher: The {eventType.FullName} Handler method was not found. Check to see if the EventHandler feature is added to the method and if the Assembly is specified when using EventBus"); + throw new ArgumentNullException($"The {eventType.FullName} Handler method was not found. Check to see if the EventHandler feature is added to the method and if the Assembly is specified when using EventBus"); + } + await ExecuteEventHandlerAsync(serviceProvider, dispatchRelations, @event); + } + + private async Task ExecuteEventHandlerAsync(IServiceProvider serviceProvider, + List dispatchRelations, + TEvent @event) + where TEvent : IEvent + { + var executionStrategy = serviceProvider.GetRequiredService(); + StrategyOptions strategyOptions = new StrategyOptions(); + bool isCancel = false; + EventHandlerAttribute dispatchHandler; + foreach (var dispatchRelation in dispatchRelations) + { + if (isCancel) return; + dispatchHandler = dispatchRelation.Handler; + + strategyOptions.SetStrategy(dispatchHandler); + + await executionStrategy.ExecuteAsync(strategyOptions, @event, async (@event) => + { + Logger?.LogDebug("----- Publishing event {@Event}: message id: {messageId} -----", @event, @event.GetEventId()); + await dispatchHandler.ExcuteAction(serviceProvider, @event); + }, async (@event, ex, failureLevels) => + { + if (failureLevels != FailureLevels.Ignore) + { + isCancel = true; + if (dispatchRelation.CancelHandlers.Any()) + await ExecuteEventCanceledHandlerAsync(serviceProvider, Logger, executionStrategy, dispatchRelation.CancelHandlers, @event); + else + ex.ThrowException(); + } + else + { + Logger?.LogError("----- Publishing event {@Event} error rollback is ignored: message id: {messageId} -----", @event, @event.GetEventId()); + } + }); + } + } + + private async Task ExecuteEventCanceledHandlerAsync(IServiceProvider serviceProvider, + ILogger? logger, + IExecutionStrategy executionStrategy, + IEnumerable cancelHandlers, + TEvent @event) + where TEvent : IEvent + { + StrategyOptions strategyOptions = new StrategyOptions(); + foreach (var cancelHandler in cancelHandlers) + { + strategyOptions.SetStrategy(cancelHandler); + await executionStrategy.ExecuteAsync(strategyOptions, @event, async @event => + { + logger?.LogDebug("----- Publishing event {@Event} rollback start: message id: {messageId} -----", @event, @event.GetEventId()); + await cancelHandler.ExcuteAction(serviceProvider, @event); + }, (@event, ex, failureLevels) => + { + if (failureLevels != FailureLevels.Ignore) + ex.ThrowException(); + + logger?.LogError("----- Publishing event {@Event} rollback error ignored: message id: {messageId} -----", @event, @event.GetEventId()); + return Task.CompletedTask; + }); + } + } + + protected void AddRelationNetwork(Type parameterType, EventHandlerAttribute handler) + { + SharingRelationNetwork!.Add(parameterType, handler); + } + + protected IEnumerable GetAddServiceTypeList() => SharingRelationNetwork!.HandlerRelationNetwork + .Concat(SharingRelationNetwork.CancelRelationNetwork) + .SelectMany(relative => relative.Value) + .Where(dispatchHandler => dispatchHandler.InvokeDelegate != null) + .Select(dispatchHandler => dispatchHandler.InstanceType).Distinct(); + + protected void Build() => SharingRelationNetwork!.Build(); + + protected bool IsSagaMode(Type handlerType, MethodInfo method) => + typeof(IEventHandler<>).IsGenericInterfaceAssignableFrom(handlerType) && method.Name.Equals(nameof(IEventHandler.HandleAsync)) || + typeof(ISagaEventHandler<>).IsGenericInterfaceAssignableFrom(handlerType) && method.Name.Equals(nameof(ISagaEventHandler.CancelAsync)); +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs new file mode 100644 index 000000000..fe8cb36e5 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Dispatch/SagaDispatcher.cs @@ -0,0 +1,112 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Internal.Dispatch; + +internal class SagaDispatcher : DispatcherBase +{ + public SagaDispatcher(IServiceCollection services, Assembly[] assemblies, bool forceInit = false) : base(services, assemblies, forceInit) { } + + public SagaDispatcher Build(ServiceLifetime lifetime) + { + AddSagaDispatchRelation(Services, typeof(IEventHandler<>), lifetime); + AddSagaDispatchRelation(Services, typeof(ISagaEventHandler<>), lifetime); + return this; + } + + private IServiceCollection AddSagaDispatchRelation(IServiceCollection services, Type eventBusHandlerType, ServiceLifetime lifetime) + { + foreach (var item in GetAddSagaServices(eventBusHandlerType)) + { + services.Add(item.ServiceType, item.ImplementationType, lifetime); + AddSagaRelationNetwork(item.ImplementationType); + } + return services; + } + + private void AddSagaRelationNetwork(Type eventBusHandlerType) + { + var eventHandlers = GetSagaHandlers(eventBusHandlerType); + var eventHandler = eventHandlers.FirstOrDefault(x => x.Order != int.MaxValue); + var actualOrder = eventHandler?.Order ?? int.MaxValue; + + foreach (var handler in eventHandlers) + { + if (actualOrder != handler.Order) + { + handler.Order = actualOrder; + } + AddRelationNetwork(handler.EventType, handler); + } + } + + private List GetSagaHandlers(Type eventBusHandlerType) + { + var methods = eventBusHandlerType.GetMethods(); + Type? eventType = null!; + List eventHandlers = new(); + foreach (var method in methods) + { + var parameters = method.GetParameters(); + if (parameters.Length == 1 && parameters.All(parameter => typeof(IEvent).IsAssignableFrom(parameter.ParameterType) && !typeof(IIntegrationEvent).IsAssignableFrom(parameter.ParameterType)) && IsSagaMode(eventBusHandlerType, method)) + { + var attribute = method.GetCustomAttributes(typeof(EventHandlerAttribute), true).FirstOrDefault(); + var handler = attribute as EventHandlerAttribute; + eventType ??= parameters.Select(x => x.ParameterType).FirstOrDefault()!; + + handler ??= new EventHandlerAttribute(); + handler.ActionMethodInfo = method; + handler.InstanceType = eventBusHandlerType; + handler.EventType = eventType; + handler.IsCancel = method.Name.Equals(nameof(ISagaEventHandler.CancelAsync)); + eventHandlers.Add(handler); + } + } + + //In saga mode, when the user sets an Order for either HandlerAsync or CancelAsync + //the default int.MaxValue Order will be overridden + //but when the Order of HandlerAsync and CancelAsync are inconsistent + //an error will be displayed + if (eventHandlers.Where(handler => handler.Order != int.MaxValue).Select(handler => handler.Order).Distinct().Count() > 1) + { + throw new ArgumentException($"In saga mode {nameof(IEventHandler.HandleAsync)} needs to be the same as {nameof(ISagaEventHandler.CancelAsync)} Order"); + } + return eventHandlers; + } + + private List<(Type ServiceType, Type ImplementationType)> GetAddSagaServices(Type eventBusHandlerType) + { + List<(Type ServiceType, Type ImplementationType)> list = new(); + var serviceTypeAndImplementationInfo = GetSagaServiceTypeAndImplementations(eventBusHandlerType); + foreach (var serviceType in serviceTypeAndImplementationInfo.ServiceTypeList) + { + var implementationTypes = serviceTypeAndImplementationInfo.ImplementationType.Where(implementationType => serviceType.IsAssignableFrom(implementationType)).ToList(); + + foreach (var implementationType in implementationTypes) + { + list.Add((serviceType, implementationType)); + } + } + + return list; + } + + private (List ServiceTypeList, List ImplementationType) GetSagaServiceTypeAndImplementations(Type eventBusHandlerType) + { + var concretions = new List(); + var interfaces = new List(); + foreach (var type in Assemblies.SelectMany(a => a.DefinedTypes).Where(t => !t.IsGeneric())) + { + if (type.IsConcrete()) + { + concretions.Add(type); + } + + if (eventBusHandlerType.IsGenericInterfaceAssignableFrom(type) && !interfaces.Contains(type)) + { + interfaces.AddRange(type.GetInterfaces()); + } + } + return (interfaces, concretions); + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs new file mode 100644 index 000000000..44661d8ba --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/DispatcherExtensions.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Internal; + +internal static class DispatcherExtensions +{ + public static IServiceCollection Add(this IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime) + { + services.Add(new ServiceDescriptor(serviceType, implementationType, lifetime)); + return services; + } + + public static IServiceCollection TryAdd(this IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime) + { + services.TryAdd(new ServiceDescriptor(serviceType, implementationType, lifetime)); + return services; + } + + public static IServiceCollection TryAdd(this IServiceCollection services, Type serviceType, Func factory, ServiceLifetime lifetime) + { + services.TryAdd(new ServiceDescriptor(serviceType, factory, lifetime)); + return services; + } + + public static bool IsGeneric(this Type type) => type.GetTypeInfo().IsGenericTypeDefinition || type.GetTypeInfo().ContainsGenericParameters; + + public static bool IsConcrete(this Type type) => !type.GetTypeInfo().IsAbstract && !type.GetTypeInfo().IsInterface; + + public static bool IsGenericInterfaceAssignableFrom(this Type eventHandlerType, Type type) => + type.IsConcrete() && + type.GetInterfaces().Any(t => t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == eventHandlerType); + + /// + /// Keep the original stack information and throw an exception + /// + /// + public static void ThrowException(this Exception exception) + { + ExceptionDispatchInfo.Capture(exception).Throw(); + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs new file mode 100644 index 000000000..b60befc5e --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Expressions/InvokeBuilder.cs @@ -0,0 +1,59 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Internal.Expressions; + +internal delegate Task TaskInvokeDelegate(object target, params object[] parameters); + +internal delegate void VoidInvokeDelegate(object target, object[] parameters); + +internal class InvokeBuilder +{ + public static TaskInvokeDelegate Build(MethodInfo methodInfo, Type targetType) + { + // Parameters to executor + var targetParameter = Expression.Parameter(typeof(object), "target"); + var parametersParameter = Expression.Parameter(typeof(object[]), "parameters"); + + // Build parameter list + var parameters = new List(); + var paramInfos = methodInfo.GetParameters(); + for (var i = 0; i < paramInfos.Length; i++) + { + var paramInfo = paramInfos[i]; + var valueObj = Expression.ArrayIndex(parametersParameter, Expression.Constant(i)); + var valueCast = Expression.Convert(valueObj, paramInfo.ParameterType); + + // valueCast is "(Ti) parameters[i]" + parameters.Add(valueCast); + } + + // Call method + var instanceCast = Expression.Convert(targetParameter, targetType); + var methodCall = Expression.Call(instanceCast, methodInfo, parameters); + + // methodCall is "((Ttarget) target) method((T0) parameters[0], (T1) parameters[1], ...)" + // Create function + if (methodCall.Type == typeof(void)) + { + var lambda = Expression.Lambda(methodCall, targetParameter, parametersParameter); + var voidExecutor = lambda.Compile(); + return delegate (object target, object[] parameters) + { + voidExecutor(target, parameters); + return Task.CompletedTask; + }; + } + else if (methodCall.Type == typeof(Task)) + { + // must coerce methodCall to match ActionExecutor signature + var castMethodCall = Expression.Convert(methodCall, typeof(Task)); + var lambda = Expression.Lambda(castMethodCall, targetParameter, parametersParameter); + return lambda.Compile(); + } + else + { + throw new NotSupportedException($"The return type of the [{methodInfo.Name}] method must be Task or void"); + } + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs new file mode 100644 index 000000000..e90c2f1ff --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/InitializeServiceProvider.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Internal; + +internal class InitializeServiceProvider : IInitializeServiceProvider +{ + private bool _initialized; + + public bool IsInitialize => _initialized; + + public InitializeServiceProvider() + { + _initialized = false; + } + + public void Initialize() + { + _initialized = true; + } + + public void Reset() + { + _initialized = false; + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs new file mode 100644 index 000000000..d225d9e65 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Internal/Middleware/TransactionMiddleware.cs @@ -0,0 +1,46 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Internal.Middleware; + +internal class TransactionMiddleware : Middleware + where TEvent : IEvent +{ + private readonly IInitializeServiceProvider _initializeServiceProvider; + private readonly IUnitOfWork? _unitOfWork; + + public override bool SupportRecursive => false; + + public TransactionMiddleware(IInitializeServiceProvider initializeServiceProvider, IUnitOfWork? unitOfWork = null) + { + _initializeServiceProvider = initializeServiceProvider; + _unitOfWork = unitOfWork; + } + + public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) + { + try + { + await next(); + + if (_unitOfWork != null) + { + await _unitOfWork.SaveChangesAsync(); + await _unitOfWork.CommitAsync(); + } + } + catch (Exception) + { + if (_unitOfWork is { DisableRollbackOnFailure: false }) + { + await _unitOfWork!.RollbackAsync(); + } + + throw; + } + finally + { + _initializeServiceProvider.Reset(); + } + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj new file mode 100644 index 000000000..d6bfc36ec --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Masa.Contrib.Dispatcher.Events.csproj @@ -0,0 +1,23 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs new file mode 100644 index 000000000..cab6842d7 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatchRelationOptions.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Options; + +public class DispatchRelationOptions +{ + public EventHandlerAttribute Handler { get; set; } = new(); + + public IEnumerable CancelHandlers { get; set; } = new List(); + + public DispatchRelationOptions() { } + + public DispatchRelationOptions(EventHandlerAttribute handler) : this() => Handler = handler; + + public void AddCancelHandler(IEnumerable cancelHandlers) + => CancelHandlers = cancelHandlers; + + public bool IsCancelHandler(EventHandlerAttribute cancelHandler) + { + return Handler.FailureLevels == FailureLevels.ThrowAndCancel && cancelHandler.Order <= Handler.Order + || Handler.FailureLevels == FailureLevels.Throw && cancelHandler.Order < Handler.Order; + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs new file mode 100644 index 000000000..d0067205a --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Options/DispatcherOptions.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Options; + +public class DispatcherOptions +{ + private IServiceCollection Services { get; } + + private Assembly[] Assemblies { get; } + + private bool IsSupportUnitOfWork(Type eventType) + => typeof(ITransaction).IsAssignableFrom(eventType) && !typeof(IDomainQuery<>).IsGenericInterfaceAssignableFrom(eventType); + + internal Dictionary UnitOfWorkRelation { get; } = new(); + + public IEnumerable AllEventTypes { get; } + + private DispatcherOptions(IServiceCollection services) => Services = services; + + public DispatcherOptions(IServiceCollection services, Assembly[] assemblies) + : this(services) + { + if (assemblies == null || assemblies.Length == 0) + throw new ArgumentException(nameof(assemblies)); + + Assemblies = assemblies; + AllEventTypes = assemblies + .SelectMany(assembly => assembly.GetTypes()) + .Where(type => type.IsClass && typeof(IEvent).IsAssignableFrom(type)) + .ToList(); + UnitOfWorkRelation = AllEventTypes.ToDictionary(type => type, IsSupportUnitOfWork); + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md new file mode 100644 index 000000000..f34381cfc --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md @@ -0,0 +1,218 @@ +[中](README.zh-CN.md) | EN + +## EventBus + +Example: + +```c# +Install-Package Masa.Contrib.Dispatcher.Events +``` + +##### Basic usage: + +1. Add EventBus + +```c# +var builder = WebApplication.CreateBuilder(args); +var app = builder.Services + .AddEventBus() + //TODO +``` + +2. Custom Event + +```C# +public class TransferEvent : Event +{ + public string Account { get; set; } = default!; + + public string ReceiveAccount { get; set; } = default!; + + public decimal Money{ get; set; } +} +``` + +3. Send Event + +```C# +IEventBus eventBus;//Get IEventBus through DI +await eventBus.PublishAsync(new TransferEvent());//Send Event +``` + +4. Define Handler + +```C# +public class TransferHandler +{ + [EventHandler] + public Task TransferAsync(TransferEvent @event) + { + //TODO Simulated transfer business + } +} +``` + +Or use the way to implement the interface: + +```C# +public class TransferHandler : IEventHandler +{ + public Task HandleAsync(TransferEvent @event) + { + //TODO Simulated transfer business + } +} +``` + +##### Advanced usage: + +1. Handler arrangement: + +```C# +public class TransferHandler +{ + [EventHandler(1)] + public Task CheckBalanceAsync(TransferEvent @event) + { + //TODO Simulate check balance + } + + [EventHandler(2)] + public Task DeductionBalanceAsync(RegisterUserEvent @event) + { + //TODO Simulated deduction balance + } +} +``` + +2. Support Saga mode + +If there is an error in sending the deducted balance, try again 3 times. If it still fails, check whether the balance is deducted and ensure that there is no deduction and notify the transfer failure + +```C# +public class TransferHandler +{ + [EventHandler(1)] + public Task CheckBalanceAsync(TransferEvent @event) + { + //TODO Simulate check balance + } + + [EventHandler(1, FailureLevels.Ignore, false, true)] + public Task NotificationTransferFailedAsync(TransferEvent @event) + { + //TODO Simulation notification transfer failed + } + + [EventHandler(2, FailureLevels.ThrowAndCancel, true, 3)] + public Task DeductionBalanceAsync(TransferEvent @event) + { + //TODO Simulated deduction balance + throw new Exception("Failed to deduct balance"); + } + + [EventHandler(2, FailureLevels.Ignore, false, true)] + public Task CancelDeductionBalanceAsync(TransferEvent @event) + { + //TODO Idempotent check to ensure that the balance has not been deducted + } +} +``` + +> Execution order: CheckBalanceAsync -> DeductionBalanceAsync (execute 1 time, retry 3 times) -> CancelDeductionBalanceAsync -> NotificationTransferFailedAsync + +Or use the way to implement the interface + +```C# +public class TransferHandler : ISagaEventHandler +{ + [EventHandler(1, FailureLevels.ThrowAndCancel, true, 3)] + public Task HandleAsync(TransferEvent @event) + { + //TODO Simulate check balance deduction balance + } + + [EventHandler(1, FailureLevels.Ignore, false, true)] + public Task CancelAsync(TransferEvent @event) + { + //TODO Idempotent verification and notification of transfer failure + } +} +``` + +> Tip: +> The method where the Handler is located only supports one parameter +> The return type of the method where the Handler is located only supports Task or void two types +> The parameters of the constructor of the class where the Handler is located must support getting from DI + +3. Support Middleware + + 1. Custom Middleware +```C# +public class LoggingMiddleware + : IMiddleware where TEvent : notnull, IEvent +{ + private readonly ILogger> _logger; + public LoggingMiddleware(ILogger> logger) => _logger = logger; + + public async Task HandleAsync(TEvent @event, EventHandlerDelegate next) + { + _logger.LogInformation("----- Handling command {EventName} ({@Event})", typeof(TEvent).FullName, @event); + await next(); + } +} +``` + 2. Enable custom Middleware + + +```C# +builder.Services.AddEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(ValidatorMiddleware<>))); +``` + +4. Support Transaction + +> Used in conjunction with Contracts.EF and UnitOfWork, when Event implements ITransaction, the transaction will be automatically opened after the first CUD is executed, and the transaction will be submitted after all Handlers are executed. When an exception occurs in the transaction, the transaction will be automatically rolled back. + +##### Performance Testing + +BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) +11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores +.NET SDK=7.0.100-preview.4.22252.9 + [Host] : .NET 6.0.6 (6.0.622.26707), X64 RyuJIT DEBUG + Job-MHJZJL : .NET 6.0.6 (6.0.622.26707), X64 RyuJIT + +Runtime=.NET 6.0 IterationCount=100 RunStrategy=ColdStart + +| Method | Mean | Error | StdDev | Median | Min | Max | +|------------------------------- |----------:|----------:|------------:|---------:|---------:|------------:| +| SendCouponByDirect | 18.10 us | 47.19 us | 139.13 us | 3.600 us | 3.000 us | 1,395.4 us | +| SendCouponByEventBus | 126.16 us | 374.20 us | 1,103.33 us | 9.950 us | 8.100 us | 11,043.7 us | +| AddShoppingCartByEventBusAsync | 124.80 us | 346.93 us | 1,022.94 us | 8.650 us | 6.500 us | 10,202.4 us | +| AddShoppingCartByMediatRAsync | 110.57 us | 306.47 us | 903.64 us | 7.500 us | 5.300 us | 9,000.1 us | + +##### Summarize + +IEventBus is the core of the event bus. It can be used with Cqrs, Uow, Masa.Contrib.Ddd.Domain.Repository.EF to automatically execute SaveChange (enable UoW) and Commit (enable UoW without closing transaction) operations after sending Command, And support to roll back the transaction after an exception occurs + +> Question 1. Publishing events through eventBus, Handler error -> and handler throw exception + + > 1. Check custom events or inherited classes to make sure ITransaction is implemented + > 2. Confirm that UoW is used + > 3. Make sure the UseTransaction property of UnitOfWork is false + > 4. Make sure that the DisableRollbackOnFailure property of UnitOfWork is true + +> Question 2. Under what circumstances will SaveChange be automatically saved -> When auto call SaveChange? + + > Use UoW and Masa.Contrib.Ddd.Domain.Repository.EF, and use the Add, Update, Delete operations provided by IRepository, publish events through EventBus, and automatically execute SaveChange after executing EventHandler + +> Question 3. If the SaveChange method of UoW is manually called in EventHandler to save, will the framework also save automatically? + + > If the SaveChange method of UoW is manually called in the EventHandler to save, and the Add, Update, and Delete operations provided by IRepository are not used afterward, the SaveChange operation will not be executed twice after the EventHandler execution ends, but if the UoW is manually called. After the SaveChange method is saved and continue to use the Add, Update, and Delete operations provided by IRepository, the framework will call the SaveChange operation again to ensure that the data is saved successfully. + +> Question 4. Why is exception retry enabled but not executed? + + > The default `UserFriendlyException` does not support retries, if you need to support retries, you need to reimplement `IExceptionStrategyProvider` + +> Question 5. Is EventBus thread safe? + + > EventBus is not thread-safe. If multiple threads execute EventBus.PublishAsync() concurrently, exceptions such as data unsubmitted may occur \ No newline at end of file diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md new file mode 100644 index 000000000..e69033f44 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md @@ -0,0 +1,217 @@ +中 | [EN](README.md) + +## EventBus + +用例: + +```c# +Install-Package Masa.Contrib.Dispatcher.Events +``` + +##### 基本用法: + +1. 添加EventBus + +```c# +var builder = WebApplication.CreateBuilder(args); +var app = builder.Services + .AddEventBus() + //TODO +``` + +2. 自定义Event + +```C# +public class TransferEvent : Event +{ + public string Account { get; set; } = default!; + + public string ReceiveAccount { get; set; } = default!; + + public decimal Money{ get; set; } +} +``` + +3. 发送Event + +```C# +IEventBus eventBus;//通过DI得到IEventBus +await eventBus.PublishAsync(new TransferEvent());//发送Event +``` + +4. 定义Handler + +```C# +public class TransferHandler +{ + [EventHandler] + public Task TransferAsync(TransferEvent @event) + { + //TODO 模拟转账业务 + } +} +``` + +或使用实现接口的方式: + +```C# +public class TransferHandler : IEventHandler +{ + public Task HandleAsync(TransferEvent @event) + { + //TODO 模拟转账业务 + } +} +``` + +##### 高级用法: + +1. Handler编排: + +```C# +public class TransferHandler +{ + [EventHandler(1)] + public Task CheckBalanceAsync(TransferEvent @event) + { + //TODO 模拟检查余额 + } + + [EventHandler(2)] + public Task DeductionBalanceAsync(RegisterUserEvent @event) + { + //TODO 模拟扣减余额 + } +} +``` + +2. 支持Saga模式 + +假如扣减余额发送出错,则重试3次,如果仍然失败则校验余额是否扣减,确保无扣减后通知转账失败 + +```C# +public class TransferHandler +{ + [EventHandler(1)] + public Task CheckBalanceAsync(TransferEvent @event) + { + //TODO 模拟检查余额 + } + + [EventHandler(1, FailureLevels.Ignore, false, true)] + public Task NotificationTransferFailedAsync(TransferEvent @event) + { + //TODO 模拟通知转账失败 + } + + [EventHandler(2, FailureLevels.ThrowAndCancel, true, 3)] + public Task DeductionBalanceAsync(TransferEvent @event) + { + //TODO 模拟扣减余额 + throw new Exception("扣减余额失败"); + } + + [EventHandler(2, FailureLevels.Ignore, false, true)] + public Task CancelDeductionBalanceAsync(TransferEvent @event) + { + //TODO 幂等校验,确保余额未扣减 + } +} +``` + +> 执行顺序: CheckBalanceAsync -> DeductionBalanceAsync (执行1次,重试3次)-> CancelDeductionBalanceAsync -> NotificationTransferFailedAsync + +或者使用实现接口的方式 + +```C# +public class TransferHandler : ISagaEventHandler +{ + [EventHandler(1, FailureLevels.ThrowAndCancel, true, 3)] + public Task HandleAsync(TransferEvent @event) + { + //TODO 模拟检查余额扣减余额 + } + + [EventHandler(1, FailureLevels.Ignore, false, true)] + public Task CancelAsync(TransferEvent @event) + { + //TODO 幂等校验并通知转账失败 + } +} +``` + +> 注意: +> Handler所在的方法仅支持一个参数 +> Handler所在的方法返回类型仅支持Task或void两种类型 +> Handler所在的类的构造函数的参数必须支持从DI中获取 + +3. 支持Middleware + + 1. 自定义Middleware +```C# +public class LoggingMiddleware + : IMiddleware where TEvent : notnull, IEvent +{ + private readonly ILogger> _logger; + public LoggingMiddleware(ILogger> logger) => _logger = logger; + + public async Task HandleAsync(TEvent @event, EventHandlerDelegate next) + { + _logger.LogInformation("----- Handling command {EventName} ({@Event})", typeof(TEvent).FullName, @event); + await next(); + } +} +``` + 2. 启用自定义Middleware + +```C# +builder.Services.AddEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(ValidatorMiddleware<>))); +``` + +4. 支持Transaction + +> 配合MASA.Contrib.Ddd.Domain.Repository.EF.Repository、UnitOfWork使用,当Event实现了ITransaction,会在执行Add、Update、Delete方法时自动开启事务,且在Handler全部执行后提交事务,当事务出现异常后,会自动回滚事务 + +##### 性能测试 + +BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1023 (21H1/May2021Update) +11th Gen Intel Core i7-11700 2.50GHz, 1 CPU, 16 logical and 8 physical cores +.NET SDK=7.0.100-preview.4.22252.9 + [Host] : .NET 6.0.6 (6.0.622.26707), X64 RyuJIT DEBUG + Job-MHJZJL : .NET 6.0.6 (6.0.622.26707), X64 RyuJIT + +Runtime=.NET 6.0 IterationCount=100 RunStrategy=ColdStart + +| Method | Mean | Error | StdDev | Median | Min | Max | +|------------------------------- |----------:|----------:|------------:|---------:|---------:|------------:| +| SendCouponByDirect | 18.10 us | 47.19 us | 139.13 us | 3.600 us | 3.000 us | 1,395.4 us | +| SendCouponByEventBus | 126.16 us | 374.20 us | 1,103.33 us | 9.950 us | 8.100 us | 11,043.7 us | +| AddShoppingCartByEventBusAsync | 124.80 us | 346.93 us | 1,022.94 us | 8.650 us | 6.500 us | 10,202.4 us | +| AddShoppingCartByMediatRAsync | 110.57 us | 306.47 us | 903.64 us | 7.500 us | 5.300 us | 9,000.1 us | + +##### 总结 + +IEventBus是事件总线的核心,配合Cqrs、Uow、Masa.Contrib.Ddd.Domain.Repository.EF使用,可实现自动执行SaveChange(启用UoW)与Commit(启用UoW且无关闭事务)操作,并支持出现异常后,回滚事务 + +> 问题1. 通过eventBus发布事件,Handler出错,但数据依然保存到数据库中,事务并未回滚 + + > 1. 检查自定义事件或继承类,确保已经实现ITransaction + > 2. 确认已使用UoW + > 3. 确认UnitOfWork的UseTransaction属性为false + > 4. 确认UnitOfWork的DisableRollbackOnFailure属性为true + +> 问题2. 什么时候自动调用SaveChanges + + > 使用UoW且使用了MASA.Contrib.Ddd.Domain.Repository.EF,并且使用IRepository提供的Add、Update、Delete操作,通过EventBus发布事件,在执行EventHandler后会自动执行SaveChange + +> 问题3. 如果在EventHandler中手动调用UoW的SaveChange方法保存,那框架还会自动保存吗? + + > 如果在EventHandler中手动调用了UoW的SaveChange方法保存,且之后并未再使用IRepository提供的Add、Update、Delete操作,则在EventHandler执行结束后不会二次执行SaveChange操作,但如果在手动调用UoW的SaveChange方法保存后又继续使用IRepository提供的Add、Update、Delete操作,则框架会再次调用SaveChange操作以确保数据保存成功 + +> 问题4. 为什么开启了异常重试却未执行重试? + + > 默认`UserFriendlyException`不支持重试,如果需要支持重试,则需要重新实现`IExceptionStrategyProvider` + +> 问题5. EventBus是线程安全的吗? + + > EventBus不是线程安全的,如果多线程并发执行EventBus.PublishAsync(),则可能会出现数据未提交等异常 \ No newline at end of file diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..13fdf894c --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/ServiceCollectionExtensions.cs @@ -0,0 +1,76 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddEventBus( + this IServiceCollection services, + Action? eventBusBuilder = null) + => services.AddEventBus(AppDomain.CurrentDomain.GetAssemblies(), eventBusBuilder); + + public static IServiceCollection AddEventBus( + this IServiceCollection services, + Assembly[] assemblies, + Action? eventBusBuilder = null) + => services.AddEventBus(assemblies, ServiceLifetime.Scoped, eventBusBuilder); + + public static IServiceCollection AddEventBus( + this IServiceCollection services, + Assembly[] assemblies, + ServiceLifetime lifetime, + Action? eventBusBuilder = null) + { + if (services.Any(service => service.ImplementationType == typeof(EventBusProvider))) + return services; + + services.AddSingleton(); + + var builder = new EventBusBuilder(services); + eventBusBuilder?.Invoke(builder); + + DispatcherOptions dispatcherOptions = new DispatcherOptions(services, assemblies); + services.AddSingleton(typeof(IOptions), + _ => Microsoft.Extensions.Options.Options.Create(dispatcherOptions)); + services.AddSingleton(new SagaDispatcher(services, assemblies).Build(lifetime)); + services.AddSingleton(new Dispatcher(services, assemblies).Build(lifetime)); + services.TryAddSingleton(); + services.TryAdd(typeof(IExecutionStrategy), typeof(ExecutionStrategy), ServiceLifetime.Singleton); + services.TryAddScoped(); + services.AddTransient(typeof(IMiddleware<>), typeof(TransactionMiddleware<>)); + services.AddScoped(typeof(IEventBus), typeof(EventBus)); + return services; + } + + public static IServiceCollection AddTestEventBus( + this IServiceCollection services, + Assembly[] assemblies, + ServiceLifetime lifetime, + Action? eventBusBuilder = null) + { + if (services.Any(service => service.ImplementationType == typeof(EventBusProvider))) + return services; + + services.AddSingleton(); + + eventBusBuilder?.Invoke(new EventBusBuilder(services)); + + DispatcherOptions dispatcherOptions = new DispatcherOptions(services, assemblies); + services.AddSingleton(typeof(IOptions), + _ => Microsoft.Extensions.Options.Options.Create(dispatcherOptions)); + services.AddSingleton(new SagaDispatcher(services, assemblies, true).Build(lifetime)); + services.AddSingleton(new Dispatcher(services, assemblies).Build(lifetime)); + services.TryAddSingleton(); + services.TryAdd(typeof(IExecutionStrategy), typeof(ExecutionStrategy), ServiceLifetime.Singleton); + services.TryAddScoped(); + services.AddTransient(typeof(IMiddleware<>), typeof(TransactionMiddleware<>)); + services.AddScoped(typeof(IEventBus), typeof(EventBus)); + + return services; + } + + private class EventBusProvider + { + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs new file mode 100644 index 000000000..fa2d49086 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/ExecutionStrategy.cs @@ -0,0 +1,70 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Strategies; + +public class ExecutionStrategy : IExecutionStrategy +{ + private readonly IExceptionStrategyProvider _exceptionStrategyProvider; + private readonly ILogger? _logger; + + public ExecutionStrategy(IExceptionStrategyProvider exceptionStrategyProvider, ILogger? logger = null) + { + _exceptionStrategyProvider = exceptionStrategyProvider; + _logger = logger; + } + + public async Task ExecuteAsync(StrategyOptions strategyOptions, TEvent @event, Func func, + Func cancel) + where TEvent : IEvent + { + int retryTimes = 0; + + Exception? exception = null!; + while (strategyOptions.IsRetry(retryTimes)) + { + try + { + if (retryTimes > 0) + { + _exceptionStrategyProvider.LogWrite(LogLevel.Warning, + null, + "----- Error Publishing event {@Event} start: The {retries}th retrying consume a message failed. message id: {messageId} -----", + @event, retryTimes, @event.GetEventId()); + } + await func.Invoke(@event); + return; + } + catch (Exception? ex) + { + if (retryTimes > 0) + { + _exceptionStrategyProvider.LogWrite(LogLevel.Error, + ex, + "----- Error Publishing event {@Event} finish: The {retries}th retrying consume a message failed. message id: {messageId} -----", + @event, retryTimes, @event.GetEventId()); + } + else + { + _exceptionStrategyProvider.LogWrite(LogLevel.Error, + ex, + "----- Error Publishing event {@Event}: after {maxRetries}th executions and we will stop retrying. message id: {messageId} -----", + @event, strategyOptions.MaxRetryCount, @event.GetEventId()); + } + exception = ex; + if (_exceptionStrategyProvider.SupportRetry(exception)) + { + retryTimes++; + } + else + { + retryTimes = strategyOptions.MaxRetryCount + 1; + } + } + } + + //perform the cancel handler + + await cancel(@event, exception, strategyOptions.FailureLevels); + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs new file mode 100644 index 000000000..65234475f --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/IExecutionStrategy.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Strategies; + +public interface IExecutionStrategy +{ + Task ExecuteAsync(StrategyOptions strategyOptions, TEvent @event, Func func, Func cancel) + where TEvent : IEvent; +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs new file mode 100644 index 000000000..e56196996 --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/Strategies/StrategyOptions.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Strategies; + +public class StrategyOptions +{ + /// + /// The maximum number of retry attempts. + /// + public int MaxRetryCount { get; set; } + + public FailureLevels FailureLevels { get; set; } + + public bool IsRetry(int retryTimes) => retryTimes <= MaxRetryCount; + + public void SetStrategy(EventHandlerAttribute dispatchHandler) + { + MaxRetryCount = dispatchHandler.ActualRetryTimes; ; + FailureLevels = dispatchHandler.FailureLevels; + } +} diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs new file mode 100644 index 000000000..1287a75ca --- /dev/null +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/_Imports.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Ddd.Domain.Events; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.Contrib.Dispatcher.Events; +global using Masa.Contrib.Dispatcher.Events.Enums; +global using Masa.Contrib.Dispatcher.Events.Internal; +global using Masa.Contrib.Dispatcher.Events.Internal.Dispatch; +global using Masa.Contrib.Dispatcher.Events.Internal.Expressions; +global using Masa.Contrib.Dispatcher.Events.Internal.Middleware; +global using Masa.Contrib.Dispatcher.Events.Options; +global using Masa.Contrib.Dispatcher.Events.Strategies; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using System.Linq.Expressions; +global using System.Reflection; +global using System.Runtime.ExceptionServices; diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs new file mode 100644 index 000000000..b09f5a7cd --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs @@ -0,0 +1,64 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Benchmarks; + +[MarkdownExporter, AsciiDocExporter, HtmlExporter] +[SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100)] +[MinColumn, MaxColumn, MeanColumn, MedianColumn] +public class Benchmarks +{ + private RegisterUserEvent _userEvent; + private AddShoppingCartEvent _shoppingCartEvent; + private IServiceProvider _serviceProvider; + private IEventBus _eventBus; + private IMediator _mediator; + + [GlobalSetup] + public void GlobalSetup() + { + IServiceCollection services = new ServiceCollection(); + services.AddLogging(loggingBuilder => loggingBuilder.ClearProviders()); + services.AddMediatR(typeof(Benchmarks)); + services.AddEventBus(); + _serviceProvider = services.BuildServiceProvider(); + _eventBus = _serviceProvider.GetRequiredService(); + _mediator = _serviceProvider.GetRequiredService(); + _userEvent = new RegisterUserEvent() + { + Name = "tom", + PhoneNumber = "18888888888" + }; + _shoppingCartEvent = new AddShoppingCartEvent() + { + Count = 1, + GoodsId = "Microsoft" + }; + } + + [Benchmark(Baseline = true)] + public async Task SendCouponByDirect() + { + var _couponHandler = new CouponHandler(_serviceProvider); + await _couponHandler.SendCoupon(_userEvent); + await _couponHandler.SendNotice(_userEvent); + } + + [Benchmark] + public async Task SendCouponByEventBus() + { + await _eventBus.PublishAsync(_userEvent); + } + + [Benchmark] + public async Task AddShoppingCartByEventBusAsync() + { + await _eventBus.PublishAsync(_shoppingCartEvent); + } + + [Benchmark] + public async Task AddShoppingCartByMediatRAsync() + { + await _mediator.Send(_shoppingCartEvent); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs new file mode 100644 index 000000000..b788ac541 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; + +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; + +public class AddShoppingCartEventHandler : IRequestHandler +{ + [EventHandler] + public Task AddShoppingCartAsync(AddShoppingCartEvent @event) + => Task.CompletedTask; + + public Task Handle(AddShoppingCartEvent request, CancellationToken cancellationToken) + => Unit.Task; +} diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs new file mode 100644 index 000000000..87c019e6e --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs @@ -0,0 +1,55 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; + +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; + +public class CouponHandler +{ + private readonly ILogger? _logger; + + public CouponHandler(IServiceProvider serviceProvider) => _logger = serviceProvider.GetService>(); + + [EventHandler(Order = 10, FailureLevels = FailureLevels.ThrowAndCancel)] + public Task SendCoupon(RegisterUserEvent @event) + { + _logger?.LogInformation("------Send Coupon------"); + + var num = new Random().Next(1, 3); + if (num % 2 == 0) + { + //throw new Exception("Failed to send coupons"); + } + + return Task.CompletedTask; + } + + [EventHandler(Order = 20, FailureLevels = FailureLevels.Ignore)] + public Task SendNotice(RegisterUserEvent @event) + { + _logger?.LogInformation("------Send Coupon------"); + + var num = new Random().Next(1, 3); + if (num % 2 == 0) + { + //throw new Exception("Failed to send coupons"); + } + + return Task.CompletedTask; + } + + [EventHandler(Order = 10, RetryTimes = 5, IsCancel = true)] + public Task CancelSendCoupon(RegisterUserEvent @event) + { + _logger?.LogInformation("------Cancel Send Coupon------"); + + var num = new Random().Next(1, 3); + if (num % 2 == 0) + { + //throw new Exception("Failed to cancel send coupons"); + } + + return Task.CompletedTask; + } +} diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs new file mode 100644 index 000000000..4b92d5b9d --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; + +public record AddShoppingCartEvent : Event, IRequest +{ + public string GoodsId { get; set; } + + public int Count { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs new file mode 100644 index 000000000..c3c720563 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; + +public record RegisterUserEvent : Event +{ + public string Name { get; set; } + + public string PhoneNumber { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs new file mode 100644 index 000000000..9aed0a5bf --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Middleware; + +public class LoggingMiddleware : Middleware where TEvent : notnull, IEvent +{ + private readonly ILogger>? _logger; + public LoggingMiddleware(ILogger>? logger = null) => _logger = logger; + + public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) + { + var eventType = @event.GetType(); + _logger?.LogInformation("----- Handling command {CommandName} ({@Command})", eventType.FullName, @event); + + await next(); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj new file mode 100644 index 000000000..4b7f85420 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj @@ -0,0 +1,23 @@ + + + + Exe + net6.0 + AnyCPU + false + enable + false + enable + + + + + + + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs new file mode 100644 index 000000000..e1b4af502 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Benchmarks; + +class Program +{ + static void Main(string[] args) + { + var config = DefaultConfig.Instance + .AddValidator(ExecutionValidator.FailOnError) + .WithOptions(ConfigOptions.DisableOptimizationsValidator); + BenchmarkRunner.Run(config); + + Console.ReadLine(); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs new file mode 100644 index 000000000..cb2ba6dbc --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using BenchmarkDotNet.Attributes; +global using BenchmarkDotNet.Configs; +global using BenchmarkDotNet.Engines; +global using BenchmarkDotNet.Jobs; +global using BenchmarkDotNet.Running; +global using BenchmarkDotNet.Validators; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; +global using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; +global using Masa.Contrib.Dispatcher.Events.Enums; +global using MediatR; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using System; +global using System.Threading.Tasks; diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs new file mode 100644 index 000000000..104ff7d80 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/AssemblyResolutionTests.cs @@ -0,0 +1,108 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests; + +[TestClass] +public class AssemblyResolutionTests +{ + [TestMethod] + public void TestResolveEventBus() + { + var services = new ServiceCollection(); + services + .AddEventBus(eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(LoggingMiddleware<>))) + .AddLogging(loggingBuilder => loggingBuilder.AddConsole()); + var serviceProvider = services.BuildServiceProvider(); + var eventBus = serviceProvider.GetService(); + Assert.IsNotNull(eventBus, "Event bus injection failed"); + Assert.IsNotNull(eventBus.GetAllEventTypes()); + } + + [TestMethod] + public void TestAddNullAssembly() + { + var services = new ServiceCollection(); + services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); + Assert.ThrowsException(() => + { + Assembly[] assemblies = null!; + services.AddEventBus(assemblies!); + }); + } + + [TestMethod] + public void TestAddEmptyAssembly() + { + var services = new ServiceCollection(); + services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); + Assert.ThrowsException(() => + { + services.AddEventBus(Array.Empty()); + }); + } + + [TestMethod] + public void TestEventBusByAddNullAssembly() + { + var services = new ServiceCollection(); + services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); + Assert.ThrowsException(() => + { + services.AddTestEventBus(null!, ServiceLifetime.Scoped); + }); + } + + [TestMethod] + public void TestEventBus() + { + var services = new ServiceCollection(); + services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); + services.AddTestEventBus(AppDomain.CurrentDomain.GetAssemblies(), ServiceLifetime.Scoped,eventBusBuilder => eventBusBuilder.UseMiddleware(typeof(LoggingMiddleware<>))); + var serviceProvider = services.BuildServiceProvider(); + var eventBus = serviceProvider.GetService(); + Assert.IsNotNull(eventBus, "Event bus injection failed"); + Assert.IsNotNull(eventBus.GetAllEventTypes()); + } + + [TestMethod] + public void TestUseEventBus() + { + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + var services = new ServiceCollection(); + services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); + Mock dispatcherOptions = new(); + dispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies).Verifiable(); + dispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); + dispatcherOptions.Object.UseEventBus(eventBuilder => eventBuilder.UseMiddleware(typeof(LoggingMiddleware<>))); + var eventBus = services.BuildServiceProvider().GetService(); + Assert.IsNotNull(eventBus); + } + + [TestMethod] + public void TestAddMultEventBus() + { + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + var services = new ServiceCollection(); + services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); + Mock dispatcherOptions = new(); + dispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies).Verifiable(); + dispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); + dispatcherOptions.Object + .UseEventBus() + .UseEventBus(); + + Assert.IsTrue(services.BuildServiceProvider().GetServices().Count() == 1); + } + + [TestMethod] + public void TestUseEventBusAndNullServices() + { + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + IServiceCollection services = null!; + Mock dispatcherOptions = new(); + dispatcherOptions.Setup(option => option.Assemblies).Returns(assemblies).Verifiable(); + dispatcherOptions.Setup(option => option.Services).Returns(services).Verifiable(); + Assert.ThrowsException(() => dispatcherOptions.Object.UseEventBus()); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs new file mode 100644 index 000000000..1a55607e3 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/ChoreTest.cs @@ -0,0 +1,105 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests; + +[TestClass] +public class ChoreTest : TestBase +{ + private readonly IEventBus _eventBus; + public ChoreTest() + { + _eventBus = _serviceProvider.GetRequiredService(); + } + + [DataTestMethod] + [DataRow("jordan", "19999999999", 1, "A very ordinary boy who likes code")] + [DataRow("tom", "18888888888", 0, "A girl who likes to dance")] + public async Task TestNotHandler(string account, string phone, int gender, string abstracts) + { + AddUserEvent @event = new AddUserEvent() + { + Account = account, + Phone = phone, + Gender = gender == 1, + Abstract = abstracts + }; + await Assert.ThrowsExceptionAsync(async () => + { + await _eventBus.PublishAsync(@event); + }); + } + + [TestMethod] + public void TestDispatchHandlerConstructor() + { + var dispatchHandler = new EventHandlerAttribute(); + Assert.IsTrue(dispatchHandler.Order.Equals(int.MaxValue)); + + dispatchHandler = new EventHandlerAttribute(1); + Assert.IsTrue(dispatchHandler.Order.Equals(1)); + + dispatchHandler = new EventHandlerAttribute(1, true); + Assert.IsTrue(dispatchHandler.Order.Equals(1)); + Assert.IsTrue(dispatchHandler.EnableRetry.Equals(true)); + + dispatchHandler = new EventHandlerAttribute(2, FailureLevels.Ignore); + Assert.IsTrue(dispatchHandler.Order.Equals(2)); + Assert.IsTrue(dispatchHandler.EnableRetry.Equals(false)); + Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.Ignore)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(0)); + + dispatchHandler = new EventHandlerAttribute(10, true, false); + Assert.IsTrue(dispatchHandler.Order.Equals(10)); + Assert.IsTrue(dispatchHandler.EnableRetry.Equals(true)); + Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(3)); + + dispatchHandler = new EventHandlerAttribute(10, true, false, 5); + Assert.IsTrue(dispatchHandler.Order.Equals(10)); + Assert.IsTrue(dispatchHandler.EnableRetry.Equals(true)); + Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(5)); + + dispatchHandler = new EventHandlerAttribute(10, false, false, 5); + Assert.IsTrue(dispatchHandler.Order.Equals(10)); + Assert.IsTrue(dispatchHandler.EnableRetry.Equals(false)); + Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(0)); + + dispatchHandler = new EventHandlerAttribute(10, FailureLevels.ThrowAndCancel, true); + Assert.IsTrue(dispatchHandler.Order.Equals(10)); + Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.ThrowAndCancel)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(3)); + + dispatchHandler = new EventHandlerAttribute(10, FailureLevels.Ignore, true, false); + Assert.IsTrue(dispatchHandler.Order.Equals(10)); + Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.Ignore)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(3)); + Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); + + dispatchHandler = new EventHandlerAttribute(10, FailureLevels.Ignore, false, true); + Assert.IsTrue(dispatchHandler.Order.Equals(10)); + Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.Ignore)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(0)); + Assert.IsTrue(dispatchHandler.IsCancel.Equals(true)); + + dispatchHandler = new EventHandlerAttribute(10, FailureLevels.ThrowAndCancel, true, 10); + Assert.IsTrue(dispatchHandler.Order.Equals(10)); + Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.ThrowAndCancel)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(10)); + Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); + + dispatchHandler = new EventHandlerAttribute(10, FailureLevels.ThrowAndCancel, false, 10); + Assert.IsTrue(dispatchHandler.Order.Equals(10)); + Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.ThrowAndCancel)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(0)); + Assert.IsTrue(dispatchHandler.IsCancel.Equals(false)); + + dispatchHandler = new EventHandlerAttribute(10, FailureLevels.ThrowAndCancel, true, 5, true); + Assert.IsTrue(dispatchHandler.Order.Equals(10)); + Assert.IsTrue(dispatchHandler.FailureLevels.Equals(FailureLevels.ThrowAndCancel)); + Assert.IsTrue(dispatchHandler.RetryTimes.Equals(5)); + Assert.IsTrue(dispatchHandler.IsCancel.Equals(true)); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs new file mode 100644 index 000000000..1d74baa70 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ChangePasswordEventHandler.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; + +public class ChangePasswordEventHandler : ISagaEventHandler +{ + private readonly ILogger? _logger; + public ChangePasswordEventHandler(ILogger? logger=null) => _logger = logger; + + [EventHandler(10, FailureLevels.ThrowAndCancel)] + public Task HandleAsync(ChangePasswordEvent @event) + { + if (@event.Content.Contains("@")) + { + throw new ArgumentException("Invalid content parameter"); + } + return Task.CompletedTask; + } + + public Task CancelAsync(ChangePasswordEvent @event) + { + if (@event.Account.Equals("mark")) + { + throw new ArgumentException("System error, please try again later"); + } + _logger?.LogInformation("cancel success"); + return Task.CompletedTask; + } + + + [EventHandler(0, FailureLevels.Ignore, IsCancel = true)] + public Task AddCancelLogs(ChangePasswordEvent @event) + { + if (@event.Account.Equals("roller")) + { + throw new ArgumentException("System error, please try again later"); + } + _logger?.LogInformation("cancel success"); + return Task.CompletedTask; + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs new file mode 100644 index 000000000..41a0c0d5d --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/MarketingEventHandler.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; + +public class MarketingEventHandler +{ + [EventHandler(10, true, false)] + public void Discount(ComputeEvent computeEvent) + { + var discountRate = 0.7m; + computeEvent.DiscountAmount = computeEvent.Amount * (1 - discountRate); + computeEvent.PayAmount = computeEvent.Amount * discountRate; + } + + [EventHandler(20)] + public void FullReduction(ComputeEvent computeEvent) + { + var discounts = 0; + if (computeEvent.PayAmount > 200) + { + discounts = 50; + computeEvent.DiscountAmount += discounts; + } + computeEvent.PayAmount -= discounts; + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs new file mode 100644 index 000000000..9c2cbfb8c --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/OrderPaymentSucceededEventHandler.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; + +public class OrderPaymentSucceededEventHandler +{ + private readonly ILogger _logger; + public OrderPaymentSucceededEventHandler(ILogger logger) => _logger = logger; + + [EventHandler(10, FailureLevels.Ignore)] + public void AddTradeRecords(OrderPaymentSucceededEvent @event) + { + _logger.LogInformation("Order paid successfully, add transaction record"); + if (@event.OrderId.Length > 10) + { + throw new NotSupportedException("Wrong order number"); + } + } + + [EventHandler(10, FailureLevels = FailureLevels.Ignore, IsCancel = true)] + public void Cancel(OrderPaymentSucceededEvent @event) + { + _logger.LogInformation("Order paid successfully, rollback transaction record"); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs new file mode 100644 index 000000000..77c02b1f4 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/RegisterUserEventHandler.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; + +public class RegisterUserEventHandler +{ + [EventHandler] + public void RegisterUser(RegisterUserEvent registerUserEvent) + { + throw new NotSupportedException(); + } +} + diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs new file mode 100644 index 000000000..75e08dda4 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShipOrderEventHandler.cs @@ -0,0 +1,58 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; + +public class ShipOrderEventHandler : ISagaEventHandler +{ + private int ExecCount { get; set; } + + private readonly ILogger? _logger; + + public ShipOrderEventHandler(ILogger? logger = null) + { + _logger = logger; + ExecCount = 0; + } + + [EventHandler(10, FailureLevels.ThrowAndCancel, true)] + public Task HandleAsync(ShipOrderEvent @event) + { + ExecCount++; + if (ExecCount - 1 <= 1) + { + throw new Exception("try again"); + } + + _logger?.LogInformation("update express information"); + if (@event.OrderId.Length > 8) + { + @event.Message = "the delivery failure"; + throw new Exception("the delivery failure"); + } + @event.Message = "the delivery success"; + return Task.CompletedTask; + } + + [EventHandler(10, false, true)] + public Task CancelAsync(ShipOrderEvent @event) + { + @event.Message = "the delivery failed, rolling back success"; + _logger?.LogInformation("the delivery failed, rolling back success"); + return Task.CompletedTask; + } +} + +public class ShipOrderAndNoticeHandler : IEventHandler +{ + private readonly ILogger? _logger; + public ShipOrderAndNoticeHandler(ILogger? logger = null) => _logger = logger; + + [EventHandler(20)] + public Task HandleAsync(ShipOrderEvent @event) + { + @event.Message = "the delivery and notice success"; + _logger?.LogInformation("order delivered successfully"); + return Task.CompletedTask; + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs new file mode 100644 index 000000000..78c8302d0 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/ShoppingCardEventHandler.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; + +public class ShoppingCardEventHandler +{ + private readonly ILogger _logger; + public ShoppingCardEventHandler(ILogger logger) => _logger = logger; + + [EventHandler(FailureLevels = FailureLevels.Ignore)] + public void AddShoppingCard(AddShoppingCartEvent @event) + { + _logger.LogInformation($"add shopping card log,GoodsId:{@event.GoodsId},Count:{@event.Count}"); + throw new ArgumentException(nameof(@event)); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs new file mode 100644 index 000000000..6aa41c3d4 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/EventHandlers/TransferEventHandler.cs @@ -0,0 +1,83 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.EventHandlers; + +public class TransferEventHandler : ISagaEventHandler +{ + private readonly List _blackAccount = new List() { "roller", "thomas" }; + + private readonly ILogger? _logger; + private readonly IEventBus _eventBus; + + public TransferEventHandler(IEventBus eventBus, ILogger? logger = null) + { + _logger = logger; + _eventBus = eventBus; + } + + [EventHandler(EnableRetry = true, RetryTimes = 3)] + public Task HandleAsync(TransferEvent @event) + { + if (_blackAccount.Contains(@event.Account)) + { + throw new NotSupportedException("System error, please try again later"); + } + _logger?.LogInformation("deduct account balance {event}", @event.ToString()); + return Task.CompletedTask; + } + + [EventHandler(EnableRetry = true, RetryTimes = 3)] + public Task CancelAsync(TransferEvent @event) + { + if (@event.Price > 1000000) + { + throw new NotSupportedException("Large transfer returns are not supported."); + } + else + { + return Task.CompletedTask; + } + } + + [EventHandler] + public async Task DeductionMoneyHandler(DeductionMoneyEvent @event) + { + // TODO: The simulated deduction is successful + + IncreaseMoneyEvent increaseMoneyEvent = new IncreaseMoneyEvent() + { + Account = @event.PayeeAccount, + TransferAccount = @event.Account, + Money = @event.Money + }; + await _eventBus.PublishAsync(increaseMoneyEvent); + } + + [EventHandler] + public Task IncreaseMoneyHandler(IncreaseMoneyEvent @event) + { + // TODO: Succeeded in simulated increase + return Task.CompletedTask; + } +} + +public class ReceiveTransferHandler +{ + private readonly List _blackAccount = new List() { "clark", "evan" }; + + private readonly ILogger _logger; + + public ReceiveTransferHandler(ILogger logger) => _logger = logger; + + [EventHandler(EnableRetry = true, RetryTimes = 3, FailureLevels = FailureLevels.ThrowAndCancel)] + public Task HandleAsync(TransferEvent @event) + { + if (_blackAccount.Contains(@event.OptAccount)) + { + throw new NotSupportedException("System error, please try again later"); + } + _logger.LogInformation("add opt account balance"); + return Task.CompletedTask; + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs new file mode 100644 index 000000000..b5a129556 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/AddShoppingCartEvent.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public record AddShoppingCartEvent : Event +{ + public string GoodsId { get; set; } + + public int Count { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs new file mode 100644 index 000000000..7f744f5de --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/AddUserEvent.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +/// +/// Just event, not handler, so let's see what happens when you publish an event +/// +public record AddUserEvent : Event +{ + public string Account { get; set; } + + public string Phone { get; set; } + + public bool Gender { get; set; } + + public string Abstract { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs new file mode 100644 index 000000000..476dc95ce --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ChangePasswordEvent.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public class ChangePasswordEvent : IEvent +{ + public string Account { get; set; } + + public string Content { get; set; } + + public Guid Id { get; set; } = Guid.NewGuid(); + + public DateTime CreationTime { get; set; } = DateTime.UtcNow; + + public Guid GetEventId() => Id; + + public void SetEventId(Guid eventId) => Id = eventId; + + public DateTime GetCreationTime() => CreationTime; + + public void SetCreationTime(DateTime creationTime) => CreationTime = creationTime; +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs new file mode 100644 index 000000000..16f2c817e --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ComputeEvent.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public record ComputeEvent : Event +{ + /// + /// the unit price + /// + public decimal Price { get; set; } + + public int Count { get; set; } + + /// + /// original price + /// + public decimal Amount => Price * Count; + + /// + /// preferential price + /// + public decimal DiscountAmount { get; set; } + + /// + /// actual amount paid + /// + public decimal PayAmount { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs new file mode 100644 index 000000000..85b915f8a --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/DeductionMoneyEvent.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public record DeductionMoneyEvent : Event, ITransaction +{ + public IUnitOfWork? UnitOfWork { get; set; } + + public string Account { get; set; } + + public string PayeeAccount { get; set; } + + public decimal Money { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs new file mode 100644 index 000000000..40761b570 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/IncreaseMoneyEvent.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public record IncreaseMoneyEvent : Event, ITransaction +{ + public IUnitOfWork? UnitOfWork { get; set; } + + public string Account { get; set; } + + public string TransferAccount { get; set; } + + public decimal Money { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs new file mode 100644 index 000000000..c5b237504 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentFailedIntegrationEvent.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public class OrderPaymentFailedIntegrationEvent : IIntegrationEvent +{ + public Guid Id { get; set; } + + public DateTime CreationTime { get; set; } + + public string Topic { get; set; } = nameof(OrderPaymentFailedIntegrationEvent); + + public IUnitOfWork? UnitOfWork { get; set; } + + public string OrderId { get; set; } + + public OrderPaymentFailedIntegrationEvent() : this(Guid.NewGuid(), DateTime.UtcNow) { } + + public OrderPaymentFailedIntegrationEvent(Guid id, DateTime creationTime) + { + this.Id = id; + this.CreationTime = creationTime; + } + + public Guid GetEventId() => Id; + + public void SetEventId(Guid eventId) => Id = eventId; + + public DateTime GetCreationTime() => CreationTime; + + public void SetCreationTime(DateTime creationTime) => CreationTime = creationTime; +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs new file mode 100644 index 000000000..040cf6a97 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/OrderPaymentSucceededEvent.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public record OrderPaymentSucceededEvent : Event +{ + public string OrderId { get; set; } + + public long Timespan { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs new file mode 100644 index 000000000..dbd1d9ce3 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/RegisterUserEvent.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public record RegisterUserEvent(string Name) : Event +{ +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs new file mode 100644 index 000000000..1b471ed27 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/SendCouponEvent.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public record SendCouponEvent : Event +{ + public string CouponCode { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs new file mode 100644 index 000000000..61b4a8f11 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/ShipOrderEvent.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public record ShipOrderEvent : Event +{ + public string OrderId { get; set; } + + public string OrderState { get; set; } + + public string Message { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs new file mode 100644 index 000000000..bb9ee0b94 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Events/TransferEvent.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Events; + +public record TransferEvent : Event +{ + public string Account { get; set; } + + public string OptAccount { get; set; } + + public decimal Price { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs new file mode 100644 index 000000000..4f804f982 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs @@ -0,0 +1,380 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests; + +[TestClass] +public class FeaturesTest : TestBase +{ + private readonly IEventBus _eventBus; + + public FeaturesTest() : base() + { + _eventBus = _serviceProvider.GetRequiredService(); + } + + [TestMethod] + public async Task TestMethodsReturnType() + { + await Assert.ThrowsExceptionAsync(async () => + { + try + { + ResetMemoryEventBus(typeof(AddBasketEvent).Assembly); + } + catch (Exception) + { + ResetMemoryEventBus(typeof(FeaturesTest).Assembly); + throw; + } + await Task.CompletedTask; + }); + } + + [TestMethod] + public async Task TestNotImplementationIEvent() + { + await Assert.ThrowsExceptionAsync(async () => + { + try + { + ResetMemoryEventBus(typeof(AddCatalogEvent).Assembly); + } + catch (Exception) + { + ResetMemoryEventBus(typeof(FeaturesTest).Assembly); + throw; + } + await Task.CompletedTask; + }); + } + + [TestMethod] + public async Task TestMultiParameter() + { + await Assert.ThrowsExceptionAsync(async () => + { + try + { + ResetMemoryEventBus(typeof(AddGoodsEvent).Assembly); + } + catch (Exception) + { + ResetMemoryEventBus(typeof(FeaturesTest).Assembly); + throw; + } + await Task.CompletedTask; + }); + } + + [TestMethod] + public async Task TestCorrectEventBus() + { + AddShoppingCartEvent @event = new AddShoppingCartEvent() + { + GoodsId = Guid.NewGuid().ToString(), + Count = 1 + }; + await _eventBus.PublishAsync(@event); + } + + [TestMethod] + public async Task TestNullEvent() + { + AddShoppingCartEvent? @event = null; + await Assert.ThrowsExceptionAsync(async () => await _eventBus.PublishAsync(@event!)); + } + + [DataTestMethod] + [DataRow("50", 2, "30", "70")] + [DataRow("60", 5, "140", "160")] + public async Task TestMultiHandler(string price, int count, string discountAmount, string payAmount) + { + ComputeEvent @event = new ComputeEvent() + { + Price = Convert.ToDecimal(price), + Count = count + }; + await _eventBus.PublishAsync(@event); + Assert.IsTrue(@event.DiscountAmount == Convert.ToDecimal(discountAmount) && @event.PayAmount == Convert.ToDecimal(payAmount)); + } + + [TestMethod] + public async Task TestNotParameter() + { + await Assert.ThrowsExceptionAsync(async () => + { + try + { + ResetMemoryEventBus(typeof(DeleteGoodsEvent).Assembly); + } + catch (Exception) + { + ResetMemoryEventBus(typeof(FeaturesTest).Assembly); + throw; + } + await Task.CompletedTask; + }); + } + + [TestMethod] + public Task TestOnlyCancelHandler() + { + Assert.ThrowsException(() => + { + try + { + ResetMemoryEventBus(typeof(OnlyCancelHandler.Tests.Events.BindPhoneNumberEvent).Assembly); + } + catch (NotSupportedException) + { + ResetMemoryEventBus(typeof(FeaturesTest).Assembly); + throw; + } + }); + return Task.CompletedTask; + } + + [TestMethod] + public async Task TestHandlerIsIgnore() + { + var @event = new OrderPaymentSucceededEvent() + { + OrderId = "123456789012", + Timespan = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds + }; + await _eventBus.PublishAsync(@event); + } + + [TestMethod] + public async Task TestPublishIntegrationEvent() + { + var @event = new OrderPaymentFailedIntegrationEvent() + { + OrderId = "123456789012", + }; + await Assert.ThrowsExceptionAsync(async () => + { + await _eventBus.PublishAsync(@event); + }); + } + + [TestMethod] + public async Task TestPublishIntegrationEventAndUseUoW() + { + base.ResetMemoryEventBus(services => + { + var unitOfWork = new Mock(); + services.AddScoped(serviceProvider => unitOfWork.Object); + return services; + }, true, typeof(AssemblyResolutionTests).Assembly); + var @event = new OrderPaymentFailedIntegrationEvent() + { + OrderId = "123456789012", + }; + await Assert.ThrowsExceptionAsync(async () => + { + await _services.BuildServiceProvider().GetRequiredService().PublishAsync(@event); + }); + } + + [TestMethod] + public async Task TestTransferEventAndOpenTransaction() + { + base.ResetMemoryEventBus(services => + { + var uoW = new Mock(); + uoW.Setup(x => x.TransactionHasBegun).Returns(true); + uoW.Setup(e => e.CommitAsync(CancellationToken.None)).Verifiable(); + services.AddScoped(serviceProvider => uoW.Object); + return services; + }, true, typeof(AssemblyResolutionTests).Assembly); + var @event = new DeductionMoneyEvent() + { + Account = "tom", + PayeeAccount = "Jim", + Money = 100 + }; + await _services.BuildServiceProvider().GetRequiredService().PublishAsync(@event); + } + + [TestMethod] + public async Task TestCommitAsync() + { + base.ResetMemoryEventBus(services => + { + return services; + }, true, typeof(AssemblyResolutionTests).Assembly); + var @event = new DeductionMoneyEvent() + { + Account = "tom", + PayeeAccount = "Jim", + Money = 100 + }; + var serviceProvider = _services.BuildServiceProvider(); + var eventBus = serviceProvider.GetRequiredService(); + + await Assert.ThrowsExceptionAsync(async () => await eventBus.CommitAsync(default)); + } + + [TestMethod] + public async Task TestUseUoWCommitAsync() + { + var uoW = new Mock(); + base.ResetMemoryEventBus(services => + { + uoW.Setup(e => e.CommitAsync(CancellationToken.None)).Verifiable(); + services.AddScoped(serviceProvider => uoW.Object); + return services; + }, true, typeof(AssemblyResolutionTests).Assembly); + var @event = new DeductionMoneyEvent() + { + Account = "tom", + PayeeAccount = "Jim", + Money = 100 + }; + var serviceProvider = _services.BuildServiceProvider(); + var eventBus = serviceProvider.GetRequiredService(); + await eventBus.PublishAsync(@event); + + uoW.Verify(u => u.CommitAsync(default), Times.Once); + } + + [DataTestMethod] + [DataRow(1, 2, -1)] + [DataRow(5, 4, 24)] + public async Task TestEventBusCancelOrder(int parameterA, int parameterB, int result) + { + IServiceCollection services = new ServiceCollection(); + services.AddTestEventBus(new[] { typeof(CalculateEvent).Assembly }, ServiceLifetime.Scoped); + var @event = new CalculateEvent() + { + ParameterA = parameterA, + ParameterB = parameterB + }; + var eventBus = services.BuildServiceProvider().GetRequiredService(); + await eventBus.PublishAsync(@event); + Assert.IsTrue(@event.Result == result); + } + + [DataTestMethod] + public void TestEventHandler() + { + var order = 1; + bool enableRetry = true; + var failureLevels = FailureLevels.ThrowAndCancel; + bool isCancel = true; + int retryTimes = 5; + int defaultRetryTimes = 3; + + var eventAttribute = new EventHandlerAttribute(order); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry == false && + eventAttribute.RetryTimes == 0 && + eventAttribute.FailureLevels == FailureLevels.Throw && + eventAttribute.IsCancel == false + ); + + eventAttribute = new EventHandlerAttribute(order, failureLevels); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry == false && + eventAttribute.RetryTimes == 0 && + eventAttribute.FailureLevels == failureLevels && + eventAttribute.IsCancel == false + ); + + eventAttribute = new EventHandlerAttribute(order, failureLevels, enableRetry); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry == enableRetry && + eventAttribute.RetryTimes == defaultRetryTimes && + eventAttribute.FailureLevels == failureLevels && + eventAttribute.IsCancel == false + ); + + eventAttribute = new EventHandlerAttribute(order, failureLevels, enableRetry, isCancel); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry == enableRetry && + eventAttribute.RetryTimes == defaultRetryTimes && + eventAttribute.FailureLevels == failureLevels && + eventAttribute.IsCancel == isCancel + ); + + eventAttribute = new EventHandlerAttribute(order, failureLevels, enableRetry, retryTimes); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry == enableRetry && + eventAttribute.RetryTimes == retryTimes && + eventAttribute.FailureLevels == failureLevels && + eventAttribute.IsCancel == false + ); + + eventAttribute = new EventHandlerAttribute(order, failureLevels, enableRetry, retryTimes, isCancel); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry == enableRetry && + eventAttribute.RetryTimes == retryTimes && + eventAttribute.FailureLevels == failureLevels && + eventAttribute.IsCancel == isCancel + ); + + eventAttribute = new EventHandlerAttribute(order, enableRetry); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry && + eventAttribute.RetryTimes == defaultRetryTimes && + eventAttribute.FailureLevels == FailureLevels.Throw && + eventAttribute.IsCancel == false + ); + + eventAttribute = new EventHandlerAttribute(order, enableRetry, retryTimes); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry && + eventAttribute.RetryTimes == retryTimes && + eventAttribute.FailureLevels == FailureLevels.Throw && + eventAttribute.IsCancel == false + ); + + eventAttribute = new EventHandlerAttribute(order, enableRetry, isCancel); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry && + eventAttribute.RetryTimes == defaultRetryTimes && + eventAttribute.FailureLevels == FailureLevels.Throw && + eventAttribute.IsCancel == isCancel + ); + + eventAttribute = new EventHandlerAttribute(order, enableRetry, isCancel, retryTimes); + Assert.IsTrue( + eventAttribute.Order == order && + eventAttribute.EnableRetry && + eventAttribute.RetryTimes == retryTimes && + eventAttribute.FailureLevels == FailureLevels.Throw && + eventAttribute.IsCancel == isCancel + ); + + } + + [TestMethod] + public void TestOrderLessThanZero() + { + Assert.ThrowsException(() => + { + _ = new EventHandlerAttribute(-10); + }, "The order must be greater than or equal to 0"); + } + + [TestMethod] + public async Task TestEventBusExceptionAsync() + { + var services = new ServiceCollection(); + services.AddTestEventBus(new Assembly[] { typeof(FeaturesTest).Assembly }, ServiceLifetime.Scoped); + var registerUserEvent = new RegisterUserEvent("Jim"); + var eventBus = services.BuildServiceProvider().GetRequiredService(); + await Assert.ThrowsExceptionAsync(async () => await eventBus.PublishAsync(registerUserEvent)); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj new file mode 100644 index 000000000..01241149b --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj @@ -0,0 +1,39 @@ + + + + net6.0 + false + enable + Full + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs new file mode 100644 index 000000000..708bd1e19 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Middleware/LoggingMiddleware.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests.Middleware; + +public class LoggingMiddleware : Middleware where TEvent : IEvent +{ + private readonly ILogger>? _logger; + public LoggingMiddleware(ILogger>? logger = null) => _logger = logger; + + public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) + { + var eventType = @event.GetType(); + _logger?.LogInformation("----- Handling command {FullName} ({event})", eventType.FullName, @event); + await next(); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs new file mode 100644 index 000000000..b2ffcc365 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs @@ -0,0 +1,98 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests; + +[TestClass] +public class SagaTest : TestBase +{ + private readonly IEventBus _eventBus; + public SagaTest() : base() + { + _eventBus = _serviceProvider.GetRequiredService(); + } + + [DataTestMethod] + [DataRow("60040012", "success", "the delivery and notice success")] + [DataRow("601454112", "error", "the delivery failed, rolling back success")] + public async Task TestExecuteAbnormalExit(string orderId, string orderState, string result) + { + ShipOrderEvent @event = new ShipOrderEvent() + { + OrderId = orderId, + OrderState = orderState + }; + await _eventBus.PublishAsync(@event); + Assert.IsTrue(@event.Message == result); + } + + [DataTestMethod] + [DataRow("roller", "change password notcices", 0)] + [DataRow("mark", "change password notcices @", 1)] + [DataRow("roller", "change password notcices @", 0)] + [DataRow("jordan", "change password notcices @", 0)] + public async Task TestLastCancelError(string account, string content, int isError) + { + ResetMemoryEventBus(false, null!); + ChangePasswordEvent @event = new ChangePasswordEvent() + { + Account = account, + Content = content + }; + if (isError == 1) + { + await Assert.ThrowsExceptionAsync(async () => + { + await _eventBus.PublishAsync(@event); + }); + } + else + { + await _eventBus.PublishAsync(@event); + } + } + + [DataTestMethod] + [DataRow("smith", "alice", "1000", 0)] + [DataRow("roller", "alice", "1000", 1)] + [DataRow("eddie", "clark", "2000", 0)] + [DataRow("eddie", "clark", "20000000", 1)] + public async Task TestMultiHandlerBySaga(string account, string optAccount, string price, int isError) + { + TransferEvent @event = new TransferEvent() + { + Account = account, + OptAccount = optAccount, + Price = Convert.ToDecimal(price) + }; + if (isError == 1) + { + await Assert.ThrowsExceptionAsync(async () => await _eventBus.PublishAsync(@event)); + } + else + { + await _eventBus.PublishAsync(@event); + } + } + + [TestMethod] + public async Task TestMultiOrderBySaga() + { + IEventBus? eventBus = null; + Assert.ThrowsException(() => + { + ResetMemoryEventBus(false, typeof(SagaTest).Assembly, typeof(EditCategoryEvent).Assembly); + eventBus = _serviceProvider.GetRequiredService(); + }); + EditCategoryEvent @event = new EditCategoryEvent() + { + CategoryId = new Random().Next(100, 10000).ToString(), + CategoryName = "Name" + }; + if (eventBus != null) + { + await eventBus.PublishAsync(@event); + } + ResetMemoryEventBus(false, null!); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs new file mode 100644 index 000000000..867348885 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/TestBase.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.Tests; + +[TestClass] +public class TestBase +{ + protected IServiceProvider _serviceProvider { get; private set; } + + protected IServiceCollection _services { get; private set; } + + public TestBase() : this(null) + { + + } + + public TestBase(Func? func = null) => ResetMemoryEventBus(func, false, null); + + protected void ResetMemoryEventBus(Func? func = null, bool isAddLog = true, params Assembly[]? assemblies) + { + _services = new ServiceCollection(); + if (isAddLog) + { + _services.AddLogging(loggingBuilder => loggingBuilder.AddConsole()); + } + else + { + _services.AddLogging(loggingBuilder => + { + loggingBuilder.ClearProviders(); + loggingBuilder.Services.RemoveAll(typeof(ILogger<>)); + }); + } + + _services.AddTransient(typeof(IMiddleware<>), typeof(LoggingMiddleware<>)); + func?.Invoke(_services); + _services = assemblies == null ? _services.AddTestEventBus(_defaultAssemblies, ServiceLifetime.Scoped) : _services.AddTestEventBus(assemblies, ServiceLifetime.Scoped); + _serviceProvider = _services.BuildServiceProvider(); + } + + private static Assembly[] _defaultAssemblies => new Assembly[1] { typeof(TestBase).Assembly }; + + protected void ResetMemoryEventBus(params Assembly[] assemblies) => ResetMemoryEventBus(null, true, assemblies); + + protected void ResetMemoryEventBus(bool isAddLog, params Assembly[] assemblies) => ResetMemoryEventBus(null, true, assemblies); +} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs new file mode 100644 index 000000000..85935366e --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; +global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.Enums; +global using Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Middleware; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Reflection; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs new file mode 100644 index 000000000..09709123a --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.EventHandlers; + +public class AddGoodsHandler +{ + [EventHandler] + public void AddGoods(AddGoodsEvent @event, ILogger? logger) + { + logger?.LogInformation($"add goods log,GoodsId:{@event.GoodsId},GoodsName:{@event.GoodsName},CategoryId:{@event.CategoryId}"); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs new file mode 100644 index 000000000..ae2a19a2e --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.Dispatcher.Events; + +namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; + +public record AddGoodsEvent : Event +{ + public string GoodsId { get; set; } + + public string CategoryId { get; set; } + + public string GoodsName { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj new file mode 100644 index 000000000..ab1764f07 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + false + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs new file mode 100644 index 000000000..9ec9d05db --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; +global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs new file mode 100644 index 000000000..a3dcbeb12 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.EventHandlers; + +public class DeleteGoodsHandler +{ + [EventHandler] + public void DeleteGoods() + { + + } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs new file mode 100644 index 000000000..c13bf9475 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.Dispatcher.Events; + +namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.Events; + +public record DeleteGoodsEvent : Event +{ + public string GoodsId { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj new file mode 100644 index 000000000..72169caea --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + false + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs new file mode 100644 index 000000000..2b37cc14c --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs @@ -0,0 +1,2 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs new file mode 100644 index 000000000..23b84d3d9 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.EventHandlers; + +public class AddCatalogHandler +{ + /// + /// The method name of this method can be named according to the actual business + /// but we recommend HandlerAsync or CancelAsync if the business is single + /// + /// + /// + [EventHandler] + public Task HandleAsync(AddCatalogEvent @event) + { + return Task.FromResult("success"); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs new file mode 100644 index 000000000..58bf51f55 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; + +public class AddCatalogEvent +{ + public string GoodsId { get; set; } + + public int Count { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj new file mode 100644 index 000000000..72169caea --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + false + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs new file mode 100644 index 000000000..1b7958315 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs new file mode 100644 index 000000000..a815ac47b --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.EventHandlers; + +public class AddBasketHandler +{ + private readonly ILogger? _logger; + public AddBasketHandler(ILogger? logger) => _logger = logger; + + [EventHandler] + public Task AddLog(AddBasketEvent @event) + { + _logger?.LogInformation($"add basket log:GoogdsId:{@event.GoodsId},count:{@event.Count}"); + return Task.FromResult("success"); + } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs new file mode 100644 index 000000000..c865aba59 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.Events; + +public record AddBasketEvent : Event +{ + public string GoodsId { get; set; } + + public int Count { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj new file mode 100644 index 000000000..72169caea --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + false + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs new file mode 100644 index 000000000..26c080239 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.Events; +global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs new file mode 100644 index 000000000..0191f09c5 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs @@ -0,0 +1,51 @@ +using Masa.Contrib.Dispatcher.Events.Enums; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.EventHandlers; + +public class Handler +{ + [EventHandler(Order = 1)] + public void First(CalculateEvent @event) + { + @event.Result = @event.ParameterA + @event.ParameterB; + if (@event.Result % 2 == 0) + throw new Exception("result is even"); + } + + [EventHandler(Order = 2, IsCancel = true)] + public void SecondCancal(CalculateEvent @event) + { + @event.Result = @event.Result - 2; + } + + [EventHandler(Order = 2, FailureLevels = FailureLevels.Throw)] + public void Second(CalculateEvent @event) + { + @event.Result *= 3; + + if (@event.Result / 12 > 0) + throw new Exception("result must not be greater than 11"); + } + + [EventHandler(Order = 3, FailureLevels = FailureLevels.ThrowAndCancel)] + public void Third(CalculateEvent @event) + { + if (@event.Result == 9) + throw new Exception("result is not equal to 9"); + } + + [EventHandler(Order = 3, IsCancel = true)] + public void ThirdCancel(CalculateEvent @event) + { + @event.Result -= 5; + } + + [EventHandler(Order = 1, IsCancel = true)] + public void FirstCancal(CalculateEvent @event) + { + @event.Result -= 3; + } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs new file mode 100644 index 000000000..3e3a17fc4 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.Dispatcher.Events; + +namespace Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; + +public record CalculateEvent : Event +{ + public int ParameterA { get; set; } + + public int ParameterB { get; set; } + + public int Result { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj new file mode 100644 index 000000000..72169caea --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + false + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs new file mode 100644 index 000000000..2cca0d35a --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs new file mode 100644 index 000000000..d464a50e6 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.EventHandlers; + +public class UserEventHandler +{ + [EventHandler(IsCancel = true)] + public void BindPhoneNumber(BindPhoneNumberEvent @event) + { + + } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs new file mode 100644 index 000000000..dc27c12ae --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.Dispatcher.Events; + +namespace Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.Events; + +public record BindPhoneNumberEvent : Event +{ + public string AccountId { get; set; } + + public string PhoneNumber { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj new file mode 100644 index 000000000..72169caea --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + false + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs new file mode 100644 index 000000000..f456f264e --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.Events; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs new file mode 100644 index 000000000..0fe1cf865 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.EventHandlers; + +public class EditCategoryHandler : ISagaEventHandler +{ + private readonly ILogger? _logger; + public EditCategoryHandler(ILogger? logger = null) => _logger = logger; + + [EventHandler(10)] + public Task CancelAsync(EditCategoryEvent @event) + { + _logger?.LogInformation($"cancel edit category log,CategoryId:{@event.CategoryId},Name:{@event.CategoryName}"); + return Task.CompletedTask; + } + + [EventHandler(20)] + public Task HandleAsync(EditCategoryEvent @event) + { + _logger?.LogInformation($"edit category log,CategoryId:{@event.CategoryId},Name:{@event.CategoryName}"); + return Task.CompletedTask; + } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs new file mode 100644 index 000000000..42a82b0c5 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.Events; + +public record EditCategoryEvent : Event +{ + public string CategoryId { get; set; } + + public string CategoryName { get; set; } +} diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj new file mode 100644 index 000000000..72169caea --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + false + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs new file mode 100644 index 000000000..753bdd870 --- /dev/null +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.Events; +global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs new file mode 100644 index 000000000..56c624c3e --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/EnvironmentContext.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiEnvironment; + +public class EnvironmentContext : IEnvironmentContext, IEnvironmentSetter +{ + public string CurrentEnvironment { get; private set; } = string.Empty; + + public void SetEnvironment(string environment) => CurrentEnvironment = environment; +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs new file mode 100644 index 000000000..ab0824a76 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/IsolationBuilderExtensions.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiEnvironment; + +public static class IsolationBuilderExtensions +{ + public const string DEFAULT_ENVIRONMENT_NAME = "ASPNETCORE_ENVIRONMENT"; + + public static IIsolationBuilder UseMultiEnvironment(this IIsolationBuilder isolationBuilder) + => isolationBuilder.UseMultiEnvironment(DEFAULT_ENVIRONMENT_NAME); + + public static IIsolationBuilder UseMultiEnvironment(this IIsolationBuilder isolationBuilder, List? parserProviders) + => isolationBuilder.UseMultiEnvironment(DEFAULT_ENVIRONMENT_NAME, parserProviders); + + public static IIsolationBuilder UseMultiEnvironment(this IIsolationBuilder isolationBuilder, string environmentName, List? parserProviders = null) + { + if (isolationBuilder.Services.Any(service => service.ImplementationType == typeof(EnvironmentProvider))) + return isolationBuilder; + + isolationBuilder.Services.AddSingleton(); + + isolationBuilder.Services.AddScoped(serviceProvider => new MultiEnvironmentMiddleware(serviceProvider, environmentName, parserProviders)); + isolationBuilder.Services.TryAddScoped(); + isolationBuilder.Services.TryAddScoped(typeof(IEnvironmentContext), serviceProvider => serviceProvider.GetRequiredService()); + isolationBuilder.Services.TryAddScoped(typeof(IEnvironmentSetter), serviceProvider => serviceProvider.GetRequiredService()); + return isolationBuilder; + } + + private class EnvironmentProvider + { + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj new file mode 100644 index 000000000..d4ac1dd9a --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs new file mode 100644 index 000000000..487f31c46 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Middleware/MultiEnvironmentMiddleware.cs @@ -0,0 +1,77 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiEnvironment.Middleware; + +public class MultiEnvironmentMiddleware : IIsolationMiddleware +{ + private readonly IServiceProvider _serviceProvider; + private readonly ILogger? _logger; + private readonly IEnumerable _parserProviders; + private readonly IEnvironmentContext _environmentContext; + private readonly IEnvironmentSetter _environmentSetter; + private readonly IMultiEnvironmentUserContext? _environmentUserContext; + private readonly string _environmentKey; + private bool _handled; + + public MultiEnvironmentMiddleware( + IServiceProvider serviceProvider, + string environmentKey, + IEnumerable? parserProviders) + { + _serviceProvider = serviceProvider; + _environmentKey = environmentKey; + _parserProviders = parserProviders ?? GetDefaultParserProviders(); + _logger = _serviceProvider.GetService>(); + _environmentContext = _serviceProvider.GetRequiredService(); + _environmentSetter = _serviceProvider.GetRequiredService(); + _environmentUserContext = _serviceProvider.GetService(); + } + + public async Task HandleAsync() + { + if (_handled) + return; + + if (!string.IsNullOrEmpty(_environmentContext.CurrentEnvironment)) + { + _logger?.LogDebug($"The environment is successfully resolved, and the resolver is: empty"); + return; + } + + if (_environmentUserContext is { IsAuthenticated: true, Environment: { } }) + { + _environmentSetter.SetEnvironment(_environmentUserContext.Environment); + return; + } + + List parsers = new(); + foreach (var environmentParserProvider in _parserProviders) + { + parsers.Add(environmentParserProvider.Name); + if (await environmentParserProvider.ResolveAsync(_serviceProvider, _environmentKey, + environment => _environmentSetter.SetEnvironment(environment))) + { + _logger?.LogDebug("The environment is successfully resolved, and the resolver is: {Resolvers}", string.Join("、 ", parsers)); + _handled = true; + return; + } + } + _logger?.LogDebug("Failed to resolve environment, and the resolver is: {Resolvers}", string.Join("、 ", parsers)); + _handled = true; + } + + private List GetDefaultParserProviders() + { + return new List + { + new HttpContextItemParserProvider(), + new QueryStringParserProvider(), + new FormParserProvider(), + new RouteParserProvider(), + new HeaderParserProvider(), + new CookieParserProvider(), + new EnvironmentVariablesParserProvider() + }; + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md new file mode 100644 index 000000000..e4a5dd061 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md @@ -0,0 +1,96 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Isolation.MultiEnvironment + +Example: + +```C# +Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Isolation.MultiEnvironment +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. Configure `appsettings.json` +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + "IsolationConnectionStrings": [ + { + "Environment": "development", + "ConnectionString": "server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + { + "Environment": "staging", + "ConnectionString": "server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity;" + } + ] +} +``` +* 1.1 When the current environment is development: database address: server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; +* 1.2 When the current environment is staging: database address: server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; +* 1.3 When the current environment is another environment: database address: server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; + +2. Using Isolation.UoW.EF +```` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiEnvironment(), + dbOptions => dbOptions.UseSqlServer()); +}); +```` + +3. DbContext needs to inherit IsolationDbContext + +```` C# +public class CustomDbContext : IsolationDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + } +} +```` + +4. The class corresponding to the isolated table needs to implement IMultiEnvironment + +You can also choose not to implement IMultiEnvironment when using physical isolation + +##### Summarize + +* How is the environment resolved in the controller or MinimalAPI? + * The environment provides 7 parsers by default, and the execution order is: HttpContextItemParserProvider、 QueryStringParserProvider、 FormParserProvider、 RouteParserProvider、 HeaderParserProvider、 CookieParserProvider、 EnvironmentVariablesParserProvider (Get the parameters in the system environment variables, the parameters of the default environment isolation: ASPNETCORE_ENVIRONMENT) + * HttpContextItemParserProvider: Get environment information through the Items property of the requested HttpContext + * QueryStringParserProvider: Get environment information through the requested QueryString + * https://github.com/masastack?ASPNETCORE_ENVIRONMENT=development (environment information is development) + * FormParserProvider: Get environment information through Form form + * RouteParserProvider: Get environment information through routing + * HeaderParserProvider: Get environment information through request headers + * CookieParserProvider: Get environmental information through cookies + * EnvironmentVariablesParserProvider: Get environment information through system environment variables +* If the parser fails to resolve the environment, what is the last database used? + * If the parsing environment fails, return DefaultConnection directly +* How to change the default environment parameter name + +```` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiEnvironment("env"),// Use environment isolation + dbOptions => dbOptions.UseSqlServer()); +}); +```` +* How to change the parser + +```` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiEnvironment("env", new List() + { + new EnvironmentVariablesParserProvider() //By default, environment information in environment isolation is obtained from system environment variables + }), + dbOptions => dbOptions.UseSqlServer());// Use environment isolation +}); +```` \ No newline at end of file diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md new file mode 100644 index 000000000..4aa69480c --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md @@ -0,0 +1,97 @@ +中 | [EN](README.md) + +## Masa.Contrib.Isolation.MultiEnvironment + +用例: + +```C# +Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Isolation.MultiEnvironment +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. 配置`appsettings.json` +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + "IsolationConnectionStrings": [ + { + "Environment": "development", + "ConnectionString": "server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + { + "Environment": "staging", + "ConnectionString": "server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity;" + } + ] +} +``` + +* 1.1 当前环境是development时:数据库地址:server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; +* 1.2 当前环境是staging时:数据库地址:server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; +* 1.3 当前环境是其他环境时:数据库地址:server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; + +2. 使用Isolation.UoW.EF +``` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiEnvironment(), + dbOptions => dbOptions.UseSqlServer()); +}); +``` + +3. DbContext需要继承IsolationDbContext + +``` C# +public class CustomDbContext : IsolationDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + } +} +``` + +4. 隔离的表对应的类需要实现IMultiEnvironment + +采用物理隔离时也可以选择不实现IMultiEnvironment + +##### 总结 + +* 控制器或MinimalAPI中环境如何解析? + * 环境默认提供了7个解析器,执行顺序为:HttpContextItemParserProvider、QueryStringParserProvider、FormParserProvider、RouteParserProvider、HeaderParserProvider、CookieParserProvider、EnvironmentVariablesParserProvider (获取系统环境变量中的参数,默认环境隔离的参数:ASPNETCORE_ENVIRONMENT) + * HttpContextItemParserProvider: 通过请求的HttpContext的Items属性获取环境信息 + * QueryStringParserProvider: 通过请求的QueryString获取环境信息 + * https://github.com/masastack?ASPNETCORE_ENVIRONMENT=development (环境信息是development) + * FormParserProvider: 通过Form表单获取环境信息 + * RouteParserProvider: 通过路由获取环境信息 + * HeaderParserProvider: 通过请求头获取环境信息 + * CookieParserProvider: 通过Cookie获取环境信息 + * EnvironmentVariablesParserProvider: 通过系统环境变量获取环境信息 +* 如果解析器解析环境失败,那最后使用的数据库是? + * 若解析环境失败,则直接返回DefaultConnection +* 如何更改默认环境参数名 + +``` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiEnvironment("env"),// 使用环境隔离 + dbOptions => dbOptions.UseSqlServer()); +}); +``` +* 如何更改解析器 + +``` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiEnvironment("env", new List() + { + new EnvironmentVariablesParserProvider() // 默认从系统环境变量中获取环境隔离中的环境信息 + }), + dbOptions => dbOptions.UseSqlServer());// 使用环境隔离 +}); +``` \ No newline at end of file diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs new file mode 100644 index 000000000..b185df42d --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Isolation; +global using Masa.BuildingBlocks.Isolation.Environment; +global using Masa.BuildingBlocks.Isolation.Middleware; +global using Masa.BuildingBlocks.Isolation.Parser; +global using Masa.Contrib.Isolation.MultiEnvironment.Middleware; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs new file mode 100644 index 000000000..38f781c2d --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/ConvertProvider.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiTenant; + +public class ConvertProvider : IConvertProvider +{ + public object ChangeType(string value, Type conversionType) + { + var result = conversionType == typeof(Guid) ? Guid.Parse(value) : Convert.ChangeType(value, conversionType); + return result; + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs new file mode 100644 index 000000000..b3fea58c5 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/IsolationBuilderExtensions.cs @@ -0,0 +1,37 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiTenant; + +public static class IsolationBuilderExtensions +{ + public const string DEFAULT_TENANT_NAME = "__tenant"; + + public static IIsolationBuilder UseMultiTenant(this IIsolationBuilder isolationBuilder) + => isolationBuilder.UseMultiTenant(DEFAULT_TENANT_NAME); + + public static IIsolationBuilder UseMultiTenant(this IIsolationBuilder isolationBuilder, string tenantName) + => isolationBuilder.UseMultiTenant(tenantName, null); + + public static IIsolationBuilder UseMultiTenant(this IIsolationBuilder isolationBuilder, List? parserProviders) + => isolationBuilder.UseMultiTenant(DEFAULT_TENANT_NAME, parserProviders); + + public static IIsolationBuilder UseMultiTenant(this IIsolationBuilder isolationBuilder, string tenantName, List? parserProviders) + { + if (isolationBuilder.Services.Any(service => service.ImplementationType == typeof(MultiTenantProvider))) + return isolationBuilder; + + isolationBuilder.Services.AddSingleton(); + + isolationBuilder.Services.AddScoped(serviceProvider => new MultiTenantMiddleware(serviceProvider, tenantName, parserProviders)); + isolationBuilder.Services.TryAddSingleton(); + isolationBuilder.Services.TryAddScoped(); + isolationBuilder.Services.TryAddScoped(typeof(ITenantContext), serviceProvider => serviceProvider.GetRequiredService()); + isolationBuilder.Services.TryAddScoped(typeof(ITenantSetter), serviceProvider => serviceProvider.GetRequiredService()); + return isolationBuilder; + } + + private class MultiTenantProvider + { + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj new file mode 100644 index 000000000..d4ac1dd9a --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs new file mode 100644 index 000000000..a1f388a62 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Middleware/MultiTenantMiddleware.cs @@ -0,0 +1,77 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiTenant.Middleware; + +public class MultiTenantMiddleware : IIsolationMiddleware +{ + private readonly IServiceProvider _serviceProvider; + private readonly ILogger? _logger; + private readonly IEnumerable _parserProviders; + private readonly ITenantContext _tenantContext; + private readonly ITenantSetter _tenantSetter; + private readonly IMultiTenantUserContext? _tenantUserContext; + private readonly string _tenantKey; + private bool _handled; + + public MultiTenantMiddleware( + IServiceProvider serviceProvider, + string tenantKey, + IEnumerable? parserProviders) + { + _serviceProvider = serviceProvider; + _tenantKey = tenantKey; + _parserProviders = parserProviders ?? GetDefaultParserProviders(); + _logger = _serviceProvider.GetService>(); + _tenantContext = _serviceProvider.GetRequiredService(); + _tenantSetter = _serviceProvider.GetRequiredService(); + _tenantUserContext = _serviceProvider.GetService(); + } + + public async Task HandleAsync() + { + if (_handled) + return; + + if (_tenantContext.CurrentTenant != null && !string.IsNullOrEmpty(_tenantContext.CurrentTenant.Id)) + { + _logger?.LogDebug($"The tenant is successfully resolved, and the resolver is: empty"); + return; + } + + if (_tenantUserContext is { IsAuthenticated: true, TenantId: { } }) + { + var tenant = new Tenant(_tenantUserContext.TenantId); + _tenantSetter.SetTenant(tenant); + return; + } + + List parsers = new(); + foreach (var tenantParserProvider in _parserProviders) + { + parsers.Add(tenantParserProvider.Name); + if (await tenantParserProvider.ResolveAsync(_serviceProvider, _tenantKey, + tenantId => _tenantSetter.SetTenant(new Tenant(tenantId)))) + { + _logger?.LogDebug("The tenant is successfully resolved, and the resolver is: {Resolvers}", string.Join("、 ", parsers)); + _handled = true; + return; + } + } + _logger?.LogDebug("Failed to resolve tenant, and the resolver is: {Resolvers}", string.Join("、 ", parsers)); + _handled = true; + } + + private List GetDefaultParserProviders() + { + return new List + { + new HttpContextItemParserProvider(), + new QueryStringParserProvider(), + new FormParserProvider(), + new RouteParserProvider(), + new HeaderParserProvider(), + new CookieParserProvider() + }; + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs new file mode 100644 index 000000000..6978310ff --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/MultiTenantOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiTenant; + +public class MultiTenantOptions +{ + public string TenantKey { get; set; } + + public List ParserProviders { get; set; } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md new file mode 100644 index 000000000..b5c366fd9 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md @@ -0,0 +1,99 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Isolation.MultiTenant + +Example: + +```C# +Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Isolation.MultiTenant +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. Configure `appsettings.json` +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + "IsolationConnectionStrings": [ + { + "TenantId": "00000000-0000-0000-0000-000000000002", + "ConnectionString": "server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + { + "TenantId": "00000000-0000-0000-0000-000000000003", + "ConnectionString": "server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity;" + } + ] +} +``` + +* 1.1 When the current tenant is 00000000-0000-0000-0000-000000000002: database address: server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; +* 1.2 When the current tenant is 00000000-0000-0000-0000-000000000003: database address: server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; +* 1.3 Other tenants or hosts: database address: server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; + +2. Using Isolation.UoW.EF +```` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiTenant(),// Use tenant isolation + dbOptions => dbOptions.UseSqlServer()); +}); +```` + +3. DbContext needs to inherit IsolationDbContext + +```` C# +public class CustomDbContext : IsolationDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + } +} +```` + +4. The class corresponding to the isolated table needs to implement IMultiTenant + +You can also choose not to implement IMultiTenant when using physical isolation + +> The tenant id type can be specified by yourself, the default Guid type +> * For example: Implement IMultiTenant to implement IMultiTenant, UseIsolationUoW() to UseIsolationUoW() + +##### Summarize + +* How to resolve the tenant in the controller or MinimalAPI? + * The tenant provides 6 parsers by default, the execution order is: HttpContextItemParserProvider、QueryStringParserProvider、FormParserProvider、RouteParserProvider、HeaderParserProvider、CookieParserProvider (tenant parameter default: __tenant) + * HttpContextItemParserProvider: Obtain tenant information through the Items property of the requested HttpContext + * QueryStringParserProvider: Get tenant information through the requested QueryString + * https://github.com/masastack?__tenant=1 (tenant id is 1) + * FormParserProvider: Get tenant information through the Form form + * RouteParserProvider: Get tenant information through routing + * HeaderParserProvider: Get tenant information through request headers + * CookieParserProvider: Get tenant information through cookies +* If the resolver fails to resolve the tenant, what is the last database used? + * If the resolution of the tenant fails, return the DefaultConnection directly +* How to change the default tenant parameter name + +```` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiTenant("tenant"), + dbOptions => dbOptions.UseSqlServer());// Use tenant isolation +}); +```` +* The default parser is not easy to use, want to change the default parser? + +```` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiTenant("tenant", new List() + { + new QueryStringTenantParserProvider() // only use QueryStringTenantParserProvider, other parsers are removed + }), + dbOptions => dbOptions.UseSqlServer());// Use tenant isolation +}); +```` diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md new file mode 100644 index 000000000..65a69b8fb --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md @@ -0,0 +1,100 @@ +中 | [EN](README.md) + +## Masa.Contrib.Isolation.MultiTenant + +用例: + +```C# +Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Isolation.MultiTenant +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. 配置`appsettings.json` +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + "IsolationConnectionStrings": [ + { + "TenantId": "00000000-0000-0000-0000-000000000002", + "ConnectionString": "server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + { + "TenantId": "00000000-0000-0000-0000-000000000003", + "ConnectionString": "server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity;" + } + ] +} +``` + +* 1.1 当前租户为00000000-0000-0000-0000-000000000002时:数据库地址:server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; +* 1.2 当前租户为00000000-0000-0000-0000-000000000003时:数据库地址:server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; +* 1.3 其他租户或宿主:数据库地址:server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; + +2. 使用Isolation.UoW.EF +``` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiTenant(),// 使用租户隔离 + dbOptions => dbOptions.UseSqlServer()); +}); +``` + +3. DbContext需要继承IsolationDbContext + +``` C# +public class CustomDbContext : IsolationDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + } +} +``` + +4. 隔离的表对应的类需要实现IMultiTenant + +采用物理隔离时也可以选择不实现IMultiTenant + +> 租户id类型支持自行指定,默认Guid类型 +> * 如:实现IMultiTenant改为实现IMultiTenant,UseIsolationUoW()改为UseIsolationUoW() + +##### 总结 + +* 控制器或MinimalAPI中租户如何解析? + * 租户默认提供了6个解析器,执行顺序分别为:HttpContextItemParserProvider、QueryStringParserProvider、FormParserProvider、RouteParserProvider、HeaderParserProvider、CookieParserProvider (租户参数默认:__tenant) + * HttpContextItemParserProvider: 通过请求的HttpContext的Items属性获取租户信息 + * QueryStringParserProvider: 通过请求的QueryString获取租户信息 + * https://github.com/masastack?__tenant=1 (租户id为1) + * FormParserProvider: 通过Form表单获取租户信息 + * RouteParserProvider: 通过路由获取租户信息 + * HeaderParserProvider: 通过请求头获取租户信息 + * CookieParserProvider: 通过Cookie获取租户信息 +* 如果解析器解析租户失败,那最后使用的数据库是? + * 若解析租户失败,则直接返回DefaultConnection +* 如何更改默认租户参数名 + +``` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiTenant("tenant"),// 使用租户隔离 + dbOptions => dbOptions.UseSqlServer()); +}); +``` +* 默认解析器不好用,希望更改默认解析器? + +``` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiTenant("tenant", new List() + { + new QueryStringTenantParserProvider() // 只使用QueryStringTenantParserProvider, 其它解析器移除掉 + }), + dbOptions => dbOptions.UseSqlServer());// 使用租户隔离 +}); +``` + diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs new file mode 100644 index 000000000..4a203ac3d --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/TenantContext.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiTenant; + +public class TenantContext : ITenantContext, ITenantSetter +{ + public Tenant? CurrentTenant { get; private set; } + + public void SetTenant(Tenant? tenant) => CurrentTenant = tenant; +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs new file mode 100644 index 000000000..d6e1c98f6 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Isolation; +global using Masa.BuildingBlocks.Isolation.Middleware; +global using Masa.BuildingBlocks.Isolation.MultiTenant; +global using Masa.BuildingBlocks.Isolation.Parser; +global using Masa.Contrib.Isolation.MultiTenant.Middleware; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using System.Linq; diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs new file mode 100644 index 000000000..c7d630b9c --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/DefaultIsolationConnectionStringProvider.cs @@ -0,0 +1,96 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation; + +public class DefaultDbIsolationConnectionStringProvider : IConnectionStringProvider +{ + private readonly IUnitOfWorkAccessor _unitOfWorkAccessor; + private readonly IOptionsSnapshot _options; + private readonly IEnvironmentContext? _environmentContext; + private readonly ITenantContext? _tenantContext; + private readonly ILogger? _logger; + + public DefaultDbIsolationConnectionStringProvider( + IUnitOfWorkAccessor unitOfWorkAccessor, + IOptionsSnapshot options, + IEnvironmentContext? environmentContext = null, + ITenantContext? tenantContext = null, + ILogger? logger = null) + { + _unitOfWorkAccessor = unitOfWorkAccessor; + _options = options; + _environmentContext = environmentContext; + _tenantContext = tenantContext; + _logger = logger; + } + + public Task GetConnectionStringAsync(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) => Task.FromResult(GetConnectionString(name)); + + public string GetConnectionString(string name = ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME) + { + if (_unitOfWorkAccessor.CurrentDbContextOptions != null) + return _unitOfWorkAccessor.CurrentDbContextOptions.ConnectionString; //todo: UnitOfWork does not currently support multi-context versions + + Expression> condition = option + => name != ConnectionStrings.DEFAULT_CONNECTION_STRING_NAME ? option.Name == name : option.Name == name || option.Name == string.Empty; + + if (_tenantContext != null) + { + if (_tenantContext.CurrentTenant == null) + _logger?.LogDebug( + $"Tenant resolution failed, the currently used ConnectionString is [{nameof(_options.Value.ConnectionStrings.DefaultConnection)}]"); + + condition = condition.And(option => option.TenantId == "*" || (_tenantContext.CurrentTenant != null && + _tenantContext.CurrentTenant.Id.Equals(option.TenantId, StringComparison.CurrentCultureIgnoreCase))); + } + + if (_environmentContext != null) + { + if (string.IsNullOrEmpty(_environmentContext.CurrentEnvironment)) + { + _logger?.LogDebug( + $"Environment resolution failed, the currently used ConnectionString is [{nameof(_options.Value.ConnectionStrings.DefaultConnection)}]"); + } + + condition = condition.And(option + => option.Environment == "*" || + option.Environment.Equals(_environmentContext.CurrentEnvironment, StringComparison.CurrentCultureIgnoreCase)); + } + + string? connectionString; + var list = _options.Value.IsolationConnectionStrings.Where(condition.Compile()).ToList(); + if (list.Count >= 1) + { + connectionString = list.OrderByDescending(option => option.Score).Select(option => option.ConnectionString).FirstOrDefault()!; + if (list.Count > 1) + _logger?.LogInformation( + "{Message}, Matches multiple available database link strings, the currently used ConnectionString is [{ConnectionString}]", + GetMessage(), connectionString); + } + else + { + connectionString = _options.Value.ConnectionStrings.DefaultConnection; + _logger?.LogDebug("{Message}, the currently used ConnectionString is [{ConnectionString}]", GetMessage(), + nameof(_options.Value.ConnectionStrings.DefaultConnection)); + } + return SetConnectionString(connectionString); + } + + private string SetConnectionString(string? connectionString = null) + { + _unitOfWorkAccessor.CurrentDbContextOptions = + new MasaDbContextConfigurationOptions(connectionString ?? _options.Value.ConnectionStrings.DefaultConnection); + return _unitOfWorkAccessor.CurrentDbContextOptions.ConnectionString; + } + + private string GetMessage() + { + List messages = new List(); + if (_environmentContext != null) + messages.Add($"Environment: [{_environmentContext.CurrentEnvironment ?? ""}]"); + if (_tenantContext != null) + messages.Add($"Tenant: [{_tenantContext.CurrentTenant?.Id ?? ""}]"); + return string.Join(", ", messages); + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs new file mode 100644 index 000000000..dbec9efec --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/DispatcherOptionsExtensions.cs @@ -0,0 +1,89 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation; + +public static class DispatcherOptionsExtensions +{ + /// + /// It is not recommended to use directly here, please use UseIsolationUoW + /// + /// + /// + /// + public static IEventBusBuilder UseIsolation(this IEventBusBuilder eventBusBuilder, Action isolationBuilder) + { + eventBusBuilder.Services.AddIsolation(isolationBuilder); + return eventBusBuilder; + } + + /// + /// It is not recommended to use directly here, please use UseIsolationUoW + /// + /// + /// + /// + public static IDispatcherOptions UseIsolation(this IDispatcherOptions options, Action isolationBuilder) + { + options.Services.AddIsolation(isolationBuilder); + return options; + } + + private static void AddIsolation(this IServiceCollection services, Action isolationBuilder) + { + ArgumentNullException.ThrowIfNull(services); + ArgumentNullException.ThrowIfNull(isolationBuilder); + + if (services.Any(service => service.ImplementationType == typeof(IsolationProvider))) + return; + + services.AddSingleton(); + + IsolationBuilder builder = new IsolationBuilder(services); + isolationBuilder.Invoke(builder); + + if (services.Count(service => + service.ServiceType == typeof(ITenantContext) || + service.ServiceType == typeof(IEnvironmentContext)) < 1) + throw new NotSupportedException("Tenant isolation and environment isolation use at least one"); + + services.AddHttpContextAccessor(); + + services + .TryAddConfigure() + .AddTransient(typeof(IMiddleware<>), typeof(IsolationMiddleware<>)) + .TryAddSingleton(); + + if (services.Any(service => service.ServiceType == typeof(IConnectionStringProvider))) + services.Replace(new ServiceDescriptor(typeof(IConnectionStringProvider), typeof(DefaultDbIsolationConnectionStringProvider), ServiceLifetime.Scoped)); + else + services.TryAddScoped(); + } + + private static IServiceCollection TryAddConfigure( + this IServiceCollection services) + where TOptions : class + { + services.AddOptions(); + var serviceProvider = services.BuildServiceProvider(); + IConfiguration? configuration = serviceProvider.GetService()?.Local ?? + serviceProvider.GetService(); + + if (configuration == null) + return services; + + string name = Options.DefaultName; + services.TryAddSingleton>( + new ConfigurationChangeTokenSource(name, configuration)); + services.TryAddSingleton>(new NamedConfigureFromConfigurationOptions( + name, + configuration, _ => + { + })); + return services; + } + + private class IsolationProvider + { + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs new file mode 100644 index 000000000..867e239ac --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationBuilder.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation; + +public class IsolationBuilder : IIsolationBuilder +{ + public IServiceCollection Services { get; } + + public IsolationBuilder(IServiceCollection services) + { + Services = services; + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs new file mode 100644 index 000000000..ca410d787 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationBuilderExtensions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Builder; + +public static class IsolationBuilderExtensions +{ + public static TApplicationBuilder UseIsolation(this TApplicationBuilder app) where TApplicationBuilder : IApplicationBuilder + { + app.UseMiddleware(); + return app; + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs new file mode 100644 index 000000000..6f13962b9 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/IsolationDbContextProvider.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation; + +public class IsolationDbContextProvider : BaseDbConnectionStringProvider +{ + private readonly IOptionsMonitor _options; + + public IsolationDbContextProvider(IOptionsMonitor options) => _options = options; + + protected override List GetDbContextOptionsList() + { + var connectionStrings = _options.CurrentValue.IsolationConnectionStrings + .Select(connectionString => connectionString.ConnectionString) + .Distinct() + .ToList(); + if (!connectionStrings.Contains(_options.CurrentValue.ConnectionStrings.DefaultConnection)) + connectionStrings.Add(_options.CurrentValue.ConnectionStrings.DefaultConnection); + + return connectionStrings.Select(connectionString => new MasaDbContextConfigurationOptions(connectionString)).ToList(); + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj b/src/Contrib/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj new file mode 100644 index 000000000..d15953e8e --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/Masa.Contrib.Isolation.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs new file mode 100644 index 000000000..20ca0c518 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/Middleware/IsolationMiddleware.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.Middleware; + +public class IsolationMiddleware : Middleware where TEvent : IEvent +{ + private readonly IEnumerable _middlewares; + + public IsolationMiddleware(IEnumerable middlewares) + { + _middlewares = middlewares; + } + + public override async Task HandleAsync(TEvent @event, EventHandlerDelegate next) + { + foreach (var middleware in _middlewares) + { + await middleware.HandleAsync(); + } + + await next(); + } +} + +public class IsolationMiddleware +{ + private readonly RequestDelegate _next; + + public IsolationMiddleware(RequestDelegate next) + { + _next = next; + } + + public async Task InvokeAsync(HttpContext httpContext, IEnumerable middlewares) + { + foreach (var middleware in middlewares) + { + await middleware.HandleAsync(); + } + + await _next(httpContext); + } +} diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md new file mode 100644 index 000000000..01ddc5466 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md @@ -0,0 +1,5 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Isolation + +The core library of Masa.Contrib.Isolation provides database address selection and parser for Isolation. It does not support stand-alone use yet. It needs to be used through Masa.Contrib.Isolation.UoW.EF. [View usage](../Masa.Contrib.Isolation.UoW.EF/README.md) \ No newline at end of file diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md new file mode 100644 index 000000000..cee55a777 --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md @@ -0,0 +1,5 @@ +中 | [EN](README.md) + +## Masa.Contrib.Isolation + +Masa.Contrib.Isolation核心库,为Isolation提供数据库地址选择以及解析器,暂不支持单独使用,需要通过Masa.Contrib.Isolation.UoW.EF来使用,[查看用法](../Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md) \ No newline at end of file diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/_Imports.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation/_Imports.cs new file mode 100644 index 000000000..85a7c4dad --- /dev/null +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/_Imports.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Configuration; +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.Options; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Isolation; +global using Masa.BuildingBlocks.Isolation.Environment; +global using Masa.BuildingBlocks.Isolation.Middleware; +global using Masa.BuildingBlocks.Isolation.MultiTenant; +global using Masa.BuildingBlocks.Isolation.Options; +global using Masa.Contrib.Isolation.Middleware; +global using Microsoft.AspNetCore.Http; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using System.Linq.Expressions; diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj new file mode 100644 index 000000000..8452f40bf --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj @@ -0,0 +1,29 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs new file mode 100644 index 000000000..ec091afca --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestEnvironment.cs @@ -0,0 +1,71 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiEnvironment.Tests; + +[TestClass] +public class TestEnvironment +{ + [TestMethod] + public void TestSetEnvironment() + { + var services = new ServiceCollection(); + Mock isolationBuilder = new(); + isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + isolationBuilder.Object.UseMultiEnvironment(); + + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(string.IsNullOrEmpty(serviceProvider.GetRequiredService().CurrentEnvironment)); + + serviceProvider.GetRequiredService().SetEnvironment("dev"); + Assert.IsTrue(serviceProvider.GetRequiredService().CurrentEnvironment == "dev"); + } + + [TestMethod] + public void TestUseMultiEnvironment() + { + IServiceCollection services = new ServiceCollection(); + Mock options = new(); + options.Setup(option => option.Services).Returns(services).Verifiable(); + options.Object.UseMultiEnvironment(); + + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetService() != null); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + Assert.IsTrue(serviceProvider.GetService() != null); + Assert.IsTrue(serviceProvider.GetService() != null); + Assert.IsTrue(serviceProvider.GetService() != null); + } + + [TestMethod] + public void TestUseMultiEnvironment2() + { + IServiceCollection services = new ServiceCollection(); + Mock options = new(); + options.Setup(option => option.Services).Returns(services).Verifiable(); + options.Object.UseMultiEnvironment().UseMultiEnvironment(); + + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetService() != null); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + Assert.IsTrue(serviceProvider.GetService() != null); + Assert.IsTrue(serviceProvider.GetService() != null); + Assert.IsTrue(serviceProvider.GetService() != null); + } + + [TestMethod] + public void TestUseMultiEnvironment3() + { + IServiceCollection services = new ServiceCollection(); + Mock options = new(); + options.Setup(option => option.Services).Returns(services).Verifiable(); + options.Object.UseMultiEnvironment(new List() { }); + + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetService() != null); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + Assert.IsTrue(serviceProvider.GetService() != null); + Assert.IsTrue(serviceProvider.GetService() != null); + Assert.IsTrue(serviceProvider.GetService() != null); + } +} diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs new file mode 100644 index 000000000..f34a13880 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/TestMiddleware.cs @@ -0,0 +1,147 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiEnvironment.Tests; + +[TestClass] +public class TestMiddleware +{ + [TestMethod] + public async Task TestMultiEnvironmentMiddlewareAsync() + { + var services = new ServiceCollection(); + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("").Verifiable(); + services.AddScoped(_ => environmentContext.Object); + + Mock environmentSetter = new(); + environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); + services.AddScoped(_ => environmentSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider + => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + List parserProviders = new List + { + parserProvider.Object + }; + string environmentKey = "env"; + var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, parserProviders); + await middleware.HandleAsync(); + parserProvider.Verify( + provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Once); + } + + [TestMethod] + public async Task TestMultiEnvironmentMiddleware2Async() + { + var services = new ServiceCollection(); + services.AddLogging(); + + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("").Verifiable(); + services.AddScoped(_ => environmentContext.Object); + + Mock environmentSetter = new(); + environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); + services.AddScoped(_ => environmentSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())).Verifiable(); + List parserProviders = new List + { + parserProvider.Object + }; + string environmentKey = "env"; + var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, parserProviders); + await middleware.HandleAsync(); + parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Once); + } + + [TestMethod] + public async Task TestMultiEnvironmentMiddleware3Async() + { + var services = new ServiceCollection(); + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("dev").Verifiable(); + services.AddScoped(_ => environmentContext.Object); + + Mock environmentSetter = new(); + environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); + services.AddScoped(_ => environmentSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider + => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + List parserProviders = new List + { + parserProvider.Object + }; + string environmentKey = "env"; + var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, parserProviders); + await middleware.HandleAsync(); + parserProvider.Verify( + provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); + } + + [TestMethod] + public async Task TestMultiEnvironmentMiddleware4Async() + { + var services = new ServiceCollection(); + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("").Verifiable(); + services.AddScoped(_ => environmentContext.Object); + + Mock environmentSetter = new(); + environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); + services.AddScoped(_ => environmentSetter.Object); + + services.AddHttpContextAccessor(); + string environmentKey = "env"; + var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; + httpContextAccessor = new HttpContextAccessor + { + HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { environmentKey, "dev" } + } + } + }; + var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, null); + await middleware.HandleAsync(); + environmentSetter.Verify(setter => setter.SetEnvironment(It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestMultiEnvironmentMiddleware5Async() + { + var services = new ServiceCollection(); + services.AddLogging(); + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("").Verifiable(); + services.AddScoped(_ => environmentContext.Object); + + Mock environmentSetter = new(); + environmentSetter.Setup(context => context.SetEnvironment(It.IsAny())).Verifiable(); + services.AddScoped(_ => environmentSetter.Object); + + services.AddHttpContextAccessor(); + string environmentKey = "env"; + var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; + httpContextAccessor = new HttpContextAccessor + { + HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { environmentKey, "dev" } + } + } + }; + var middleware = new MultiEnvironmentMiddleware(services.BuildServiceProvider(), environmentKey, null); + await middleware.HandleAsync(); + environmentSetter.Verify(setter => setter.SetEnvironment(It.IsAny()), Times.Once); + } +} diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs new file mode 100644 index 000000000..fad417443 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiEnvironment.Tests/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Isolation; +global using Masa.BuildingBlocks.Isolation.Environment; +global using Masa.BuildingBlocks.Isolation.Middleware; +global using Masa.Contrib.Isolation.MultiEnvironment.Middleware; +global using Microsoft.AspNetCore.Http; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj new file mode 100644 index 000000000..64e0818e1 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/Masa.Contrib.Isolation.MultiTenant.Tests.csproj @@ -0,0 +1,29 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs new file mode 100644 index 000000000..5e304d375 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/TestMiddleware.cs @@ -0,0 +1,359 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiTenant.Tests; + +[TestClass] +public class TestMiddleware +{ + [TestMethod] + public async Task TestMultiTenantMiddlewareAsync() + { + var services = new ServiceCollection(); + Mock tenantContext = new(); + Tenant tenant = null!; + tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); + services.AddScoped(_ => tenantContext.Object); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider + => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + List parserProviders = new List + { + parserProvider.Object + }; + string tenantKey = "tenant"; + var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, parserProviders); + await middleware.HandleAsync(); + parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Once); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware2Async() + { + var services = new ServiceCollection(); + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("1")).Verifiable(); + services.AddScoped(_ => tenantContext.Object); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider + => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + List parserProviders = new List + { + parserProvider.Object + }; + string tenantKey = "tenant"; + var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, parserProviders); + await middleware.HandleAsync(); + parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware3Async() + { + var services = new ServiceCollection(); + Mock tenantContext = new(); + Tenant tenant = null!; + tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); + services.AddScoped(_ => tenantContext.Object); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; + httpContextAccessor = new HttpContextAccessor + { + HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { tenantKey, "1" } + } + } + }; + var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, null); + await middleware.HandleAsync(); + tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware4Async() + { + var services = new ServiceCollection(); + Mock isolationBuilder = new(); + isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + string tenantKey = "tenant"; + + isolationBuilder.Object.UseMultiTenant(tenantKey); + + Mock parserProvider = new(); + parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + + services.AddHttpContextAccessor(); + var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; + httpContextAccessor = new HttpContextAccessor + { + HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { tenantKey, "1" } + } + } + }; + + var middleware = services.BuildServiceProvider().GetRequiredService(); + await middleware.HandleAsync(); + tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); + + await middleware.HandleAsync(); + tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware5Async() + { + var services = new ServiceCollection(); + Mock isolationBuilder = new(); + isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + isolationBuilder.Object.UseMultiTenant(); + + Mock parserProvider = new(); + parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + + services.AddHttpContextAccessor(); + var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; + httpContextAccessor = new HttpContextAccessor + { + HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { "__tenant", "1" } + } + } + }; + + var middleware = services.BuildServiceProvider().GetRequiredService(); + await middleware.HandleAsync(); + tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); + + await middleware.HandleAsync(); + tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware6Async() + { + var services = new ServiceCollection(); + Mock isolationBuilder = new(); + isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + isolationBuilder.Object.UseMultiTenant(new List()); + + Mock parserProvider = new(); + parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + + services.AddHttpContextAccessor(); + var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; + httpContextAccessor = new HttpContextAccessor + { + HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { "__tenant", "1" } + } + } + }; + + var middleware = services.BuildServiceProvider().GetRequiredService(); + await middleware.HandleAsync(); + tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Never); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware7Async() + { + var services = new ServiceCollection(); + services.AddLogging(); + Mock tenantContext = new(); + Tenant tenant = null!; + tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); + services.AddScoped(_ => tenantContext.Object); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider + => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + List parserProviders = new List + { + parserProvider.Object + }; + string tenantKey = "tenant"; + var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, parserProviders); + await middleware.HandleAsync(); + parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Once); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware8Async() + { + var services = new ServiceCollection(); + Mock tenantContext = new(); + Tenant tenant = null!; + tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); + services.AddScoped(_ => tenantContext.Object); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; + httpContextAccessor = new HttpContextAccessor + { + HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { tenantKey, "1" } + } + } + }; + var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, null); + await middleware.HandleAsync(); + tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware9Async() + { + var services = new ServiceCollection(); + services.AddLogging(); + Mock isolationBuilder = new(); + isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + isolationBuilder.Object.UseMultiTenant(new List()); + + Mock parserProvider = new(); + parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + + services.AddHttpContextAccessor(); + var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; + httpContextAccessor = new HttpContextAccessor + { + HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { "__tenant", "1" } + } + } + }; + + var middleware = services.BuildServiceProvider().GetRequiredService(); + await middleware.HandleAsync(); + tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Never); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware10Async() + { + var services = new ServiceCollection(); + services.AddLogging(); + Mock tenantContext = new(); + Tenant tenant = null!; + tenantContext.Setup(context => context.CurrentTenant).Returns(tenant).Verifiable(); + services.AddScoped(_ => tenantContext.Object); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var httpContextAccessor = services.BuildServiceProvider().GetRequiredService()!; + httpContextAccessor = new HttpContextAccessor + { + HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { tenantKey, "1" } + } + } + }; + var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, null); + await middleware.HandleAsync(); + tenantSetter.Verify(setter => setter.SetTenant(It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestMultiTenantMiddleware11Async() + { + var services = new ServiceCollection(); + services.AddLogging(); + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("1")).Verifiable(); + services.AddScoped(_ => tenantContext.Object); + + Mock tenantSetter = new(); + tenantSetter.Setup(context => context.SetTenant(It.IsAny())).Verifiable(); + services.AddScoped(_ => tenantSetter.Object); + + Mock parserProvider = new(); + parserProvider.Setup(provider + => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>())); + List parserProviders = new List + { + parserProvider.Object + }; + string tenantKey = "tenant"; + var middleware = new MultiTenantMiddleware(services.BuildServiceProvider(), tenantKey, parserProviders); + await middleware.HandleAsync(); + parserProvider.Verify(provider => provider.ResolveAsync(It.IsAny(), It.IsAny(), It.IsAny>()), Times.Never); + } +} diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs new file mode 100644 index 000000000..45b5347c1 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/TestTenant.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.MultiTenant.Tests; + +[TestClass] +public class TestEnvironment +{ + [TestMethod] + public void TestSetTenant() + { + var services = new ServiceCollection(); + Mock isolationBuilder = new(); + isolationBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + isolationBuilder.Object.UseMultiTenant(); + + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetRequiredService().CurrentTenant == null); + + var tenant = new Tenant("1"); + serviceProvider.GetRequiredService().SetTenant(tenant); + Assert.IsTrue(serviceProvider.GetRequiredService().CurrentTenant == tenant); + } + + [TestMethod] + public void TestChangeType() + { + var convertProvider = new ConvertProvider(); + object result = convertProvider.ChangeType("1", typeof(int)); + Assert.IsTrue(result.Equals(1)); + + var guid = Guid.NewGuid(); + result = convertProvider.ChangeType(guid.ToString(), typeof(Guid)); + Assert.IsTrue(result.Equals(guid)); + + var str = "dev"; + result = convertProvider.ChangeType(str, typeof(string)); + Assert.IsTrue(result.Equals(str)); + + result = convertProvider.ChangeType("1.1", typeof(decimal)); + Assert.IsTrue(result.Equals((decimal)1.1)); + + result = convertProvider.ChangeType("1.2", typeof(float)); + Assert.IsTrue(result.Equals((float)1.2)); + + result = convertProvider.ChangeType("1.3", typeof(double)); + Assert.IsTrue(result.Equals(1.3d)); + + result = convertProvider.ChangeType("1", typeof(ushort)); + Assert.IsTrue(result.Equals((ushort)1)); + + bool isProduction = true; + result = convertProvider.ChangeType(isProduction.ToString(), typeof(bool)); + Assert.IsTrue(result.Equals(isProduction)); + } +} diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs new file mode 100644 index 000000000..3d800e35a --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.MultiTenant.Tests/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Isolation; +global using Masa.BuildingBlocks.Isolation.Middleware; +global using Masa.BuildingBlocks.Isolation.MultiTenant; +global using Masa.Contrib.Isolation.MultiTenant.Middleware; +global using Microsoft.AspNetCore.Http; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj new file mode 100644 index 000000000..7abbd52b1 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/Masa.Contrib.Isolation.Tests.csproj @@ -0,0 +1,31 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs new file mode 100644 index 000000000..2329421c9 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/RequestCookieCollection.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.Tests; + +public class RequestCookieCollection : Dictionary, IRequestCookieCollection +{ + public new ICollection Keys { get; } +} diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs new file mode 100644 index 000000000..67e394dd9 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestDbIsolationConnectionStringProvider.cs @@ -0,0 +1,533 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.Tests; + +[TestClass] +public class TestDbIsolationConnectionStringProvider +{ + private IServiceCollection _services; + + [TestInitialize] + public void Initialize() + { + _services = new ServiceCollection(); + _services.AddScoped(); + } + + [TestMethod] + public async Task TestGetConnectionStringAsync() + { + string defaultConnectionString = "data source=test1;"; + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + unitOfWorkAccessor.CurrentDbContextOptions = new MasaDbContextConfigurationOptions(defaultConnectionString); + var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, null!); + + Assert.IsTrue(await provider.GetConnectionStringAsync() == defaultConnectionString); + } + + [TestMethod] + public async Task TestGetConnectionString2Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + + var options = _services.BuildServiceProvider().GetRequiredService>(); + var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options); + Assert.IsTrue(await provider.GetConnectionStringAsync() == connectionStrings.DefaultConnection); + } + + [TestMethod] + public async Task TestGetConnectionString3Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + Environment = "dev", + ConnectionString = "data source=test2;" + }, + new() + { + Environment = "pro", + ConnectionString = "data source=test3;" + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("pro").Verifiable(); + var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test3;"); + } + + [TestMethod] + public async Task TestGetConnectionString4Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + Environment = "dev", + ConnectionString = "data source=test2;" + }, + new() + { + Environment = "pro", + ConnectionString = "data source=test3;" + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("Staging").Verifiable(); + var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test1;"); + } + + [TestMethod] + public async Task TestGetConnectionString5Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + TenantId = "1", + ConnectionString = "data source=test2;" + }, + new() + { + TenantId = "2", + ConnectionString = "data source=test3;" + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("1")).Verifiable(); + var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, null, tenantContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test2;"); + } + + [TestMethod] + public async Task TestGetConnectionString6Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + TenantId = "1", + ConnectionString = "data source=test2;" + }, + new() + { + TenantId = "2", + ConnectionString = "data source=test3;" + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("2")).Verifiable(); + var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, null, tenantContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test3;"); + } + + [TestMethod] + public async Task TestGetConnectionString7Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + TenantId = "1", + ConnectionString = "data source=test2;" + }, + new() + { + TenantId = "2", + ConnectionString = "data source=test3;" + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("11")).Verifiable(); + var provider = new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, null, tenantContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test1;"); + } + + [TestMethod] + public async Task TestGetConnectionString8Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + TenantId = "1", + Environment = "dev", + ConnectionString = "data source=test2;" + }, + new() + { + TenantId = "2", + Environment = "dev", + ConnectionString = "data source=test3;" + }, + new() + { + TenantId = "2", + Environment = "pro", + ConnectionString = "data source=test4;" + }, + new() + { + TenantId = "*", + Environment = "pro", + ConnectionString = "data source=test5;", + Score = 99 + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("Staging").Verifiable(); + + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("11")).Verifiable(); + var provider = + new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test1;"); + } + + [TestMethod] + public async Task TestGetConnectionString9Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + TenantId = "1", + Environment = "dev", + ConnectionString = "data source=test2;" + }, + new() + { + TenantId = "2", + Environment = "dev", + ConnectionString = "data source=test3;" + }, + new() + { + TenantId = "2", + Environment = "pro", + ConnectionString = "data source=test4;" + }, + new() + { + TenantId = "*", + Environment = "pro", + ConnectionString = "data source=test5;", + Score = 99 + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("dev").Verifiable(); + + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("1")).Verifiable(); + var provider = + new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test2;"); + } + + [TestMethod] + public async Task TestGetConnectionString10Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + TenantId = "1", + Environment = "dev", + ConnectionString = "data source=test2;" + }, + new() + { + TenantId = "2", + Environment = "dev", + ConnectionString = "data source=test3;" + }, + new() + { + TenantId = "2", + Environment = "pro", + ConnectionString = "data source=test4;" + }, + new() + { + TenantId = "*", + Environment = "pro", + ConnectionString = "data source=test5;", + Score = 99 + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("dev").Verifiable(); + + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("2")).Verifiable(); + var provider = + new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test3;"); + } + + [TestMethod] + public async Task TestGetConnectionString11Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + TenantId = "1", + Environment = "dev", + ConnectionString = "data source=test2;" + }, + new() + { + TenantId = "2", + Environment = "dev", + ConnectionString = "data source=test3;" + }, + new() + { + TenantId = "2", + Environment = "pro", + ConnectionString = "data source=test4;" + }, + new() + { + TenantId = "*", + Environment = "pro", + ConnectionString = "data source=test5;", + Score = 99 + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("pro").Verifiable(); + + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("2")).Verifiable(); + var provider = + new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test4;"); + } + + [TestMethod] + public async Task TestGetConnectionString12Async() + { + _services.AddLogging(); + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + TenantId = "1", + Environment = "dev", + ConnectionString = "data source=test2;" + }, + new() + { + TenantId = "2", + Environment = "dev", + ConnectionString = "data source=test3;" + }, + new() + { + TenantId = "2", + Environment = "pro", + ConnectionString = "data source=test4;" + }, + new() + { + TenantId = "*", + Environment = "pro", + ConnectionString = "data source=test5;", + Score = 99 + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("pro").Verifiable(); + + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("2")).Verifiable(); + var provider = + new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test4;"); + } + + [TestMethod] + public async Task TestGetConnectionString13Async() + { + var connectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test1;" + }; + _services.Configure(option => option.ConnectionStrings = connectionStrings); + var unitOfWorkAccessor = _services.BuildServiceProvider().GetService()!; + _services.Configure(option => + { + option.ConnectionStrings = connectionStrings; + option.IsolationConnectionStrings = new List + { + new() + { + TenantId = "1", + Environment = "dev", + ConnectionString = "data source=test2;" + }, + new() + { + TenantId = "2", + Environment = "dev", + ConnectionString = "data source=test3;" + }, + new() + { + TenantId = "2", + Environment = "pro", + ConnectionString = "data source=test4;" + }, + new() + { + TenantId = "*", + Environment = "pro", + ConnectionString = "data source=test5;", + Score = 99 + } + }; + }); + var options = _services.BuildServiceProvider().GetRequiredService>(); + + Mock environmentContext = new(); + environmentContext.Setup(context => context.CurrentEnvironment).Returns("pro").Verifiable(); + + Mock tenantContext = new(); + tenantContext.Setup(context => context.CurrentTenant).Returns(new Tenant("10")).Verifiable(); + var provider = + new DefaultDbIsolationConnectionStringProvider(unitOfWorkAccessor, options, environmentContext.Object, tenantContext.Object); + Assert.IsTrue(await provider.GetConnectionStringAsync() == "data source=test5;"); + } + +} diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestIsolation.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestIsolation.cs new file mode 100644 index 000000000..a9061928c --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestIsolation.cs @@ -0,0 +1,158 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.Tests; + +[TestClass] +public class TestIsolation +{ + [TestMethod] + public void TestGetDbContextOptionsList() + { + var services = new ServiceCollection(); + services.Configure(option => + { + option.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test2" + }; + option.IsolationConnectionStrings = new() + { + new() + { + Environment = "dev", + ConnectionString = "data source=test3" + }, + new() + { + Environment = "pro", + ConnectionString = "data source=test4" + } + }; + }); + services.AddSingleton(); + var serviceProvider = services.BuildServiceProvider(); + var provider = serviceProvider.GetRequiredService(); + Assert.IsTrue(provider.DbContextOptionsList.Distinct().Count() == 3); + } + + [TestMethod] + public void TestUseIsolation() + { + var services = new ServiceCollection(); + Mock eventBuilder = new(); + eventBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + Assert.ThrowsException(() => + { + eventBuilder.Object.UseIsolation(isolationBuilder => + { + }); + }, "Tenant isolation and environment isolation use at least one"); + } + + [TestMethod] + public void TestUseIsolation2() + { + IServiceCollection services = null!; + Mock eventBuilder = new(); + eventBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + Assert.ThrowsException(() => + { + eventBuilder.Object.UseIsolation(isolationBuilder => + { + }); + }); + } + + [TestMethod] + public void TestUseIsolation3() + { + IServiceCollection services = null!; + Mock options = new(); + options.Setup(option => option.Services).Returns(services).Verifiable(); + Assert.ThrowsException(() => + { + options.Object.UseIsolation(isolationBuilder => + { + }); + }); + } + + [TestMethod] + public void TestUseIsolation4() + { + IServiceCollection services = new ServiceCollection(); + Mock eventBuilder = new(); + eventBuilder.Setup(builder => builder.Services).Returns(services).Verifiable(); + Assert.ThrowsException(() => + { + eventBuilder.Object.UseIsolation(null!); + }); + } + + [TestMethod] + public void TestUseIsolation5() + { + IServiceCollection services = new ServiceCollection(); + Mock options = new(); + options.Setup(option => option.Services).Returns(services).Verifiable(); + Assert.ThrowsException(() => + { + options.Object.UseIsolation(null!); + }); + } + + [TestMethod] + public void TestUseIsolation6() + { + IServiceCollection services = new ServiceCollection(); + Mock options = new(); + options.Setup(option => option.Services).Returns(services).Verifiable(); + options.Object.UseIsolation(isolationBuilder => isolationBuilder.UseMultiEnvironment()); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(services.Count(service => service.ServiceType == typeof(IIsolationMiddleware)) == 1); + + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + Assert.IsTrue(!serviceProvider.GetServices().Any()); + } + + [TestMethod] + public void TestUseIsolation7() + { + IServiceCollection services = new ServiceCollection(); + Mock options = new(); + options.Setup(option => option.Services).Returns(services).Verifiable(); + + options.Object.UseIsolation(isolationBuilder => isolationBuilder.UseMultiTenant()); + + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(services.Count(service => service.ServiceType == typeof(IIsolationMiddleware)) == 1); + + Assert.IsTrue(!serviceProvider.GetServices().Any()); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestUseIsolation8() + { + IServiceCollection services = new ServiceCollection(); + Mock options = new(); + options.Setup(option => option.Services).Returns(services).Verifiable(); + options.Object.UseIsolation(isolationBuilder + => isolationBuilder.UseMultiTenant().UseMultiEnvironment()); + options.Object.UseIsolation(isolationBuilder + => isolationBuilder.UseMultiTenant().UseMultiEnvironment()); + + var serviceProvider = services.BuildServiceProvider(); + Assert.IsTrue(services.Count(service => service.ServiceType == typeof(IIsolationMiddleware)) == 2); + + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestUseIsolation9() + { + + } +} diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestParserProvider.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestParserProvider.cs new file mode 100644 index 000000000..6e49fdb35 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/TestParserProvider.cs @@ -0,0 +1,377 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.Tests; + +[TestClass] +public class TestParserProvider +{ + [TestMethod] + public async Task TestCookieParserAsync() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = + { + Cookies = new RequestCookieCollection + { + { + tenantKey, "1" + } + } + } + }; + var provider = new CookieParserProvider(); + Assert.IsTrue(provider.Name == "Cookie"); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => + { + Assert.IsTrue(tenantId == "1"); + }); + Assert.IsTrue(handler); + } + + [TestMethod] + public async Task TestCookieParser2Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = + { + Cookies = new RequestCookieCollection() + } + }; + var provider = new CookieParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => { }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestCookieParser3Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var provider = new CookieParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => { }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestFormParserAsync() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = + { + Form = new FormCollection(new Dictionary + { + { tenantKey, "1" } + } + ) + } + }; + var provider = new FormParserProvider(); + Assert.IsTrue(provider.Name == "Form"); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => + { + Assert.IsTrue(tenantId == "1"); + }); + Assert.IsTrue(handler); + } + + [TestMethod] + public async Task TestFormParser2Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = + { + Form = new FormCollection(new Dictionary()) + } + }; + var provider = new FormParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => + { + }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestFormParser3Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = + { + QueryString = QueryString.Create(tenantKey, "1") + } + }; + var provider = new FormParserProvider(); + Assert.IsTrue(provider.Name == "Form"); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => + { + }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestHeaderParserAsync() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = + { + Headers = + { + { tenantKey, "1" } + } + } + }; + var provider = new HeaderParserProvider(); + Assert.IsTrue(provider.Name == "Header"); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => + { + Assert.IsTrue(tenantId == "1"); + }); + Assert.IsTrue(handler); + } + + [TestMethod] + public async Task TestHeaderParser2Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = + { + Headers = { } + } + }; + var provider = new HeaderParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => + { + }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestHttpContextItemParserAsync() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Items = new Dictionary + { + { tenantKey, "1" } + } + }; + var provider = new HttpContextItemParserProvider(); + Assert.IsTrue(provider.Name == "Items"); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => + { + Assert.IsTrue(tenantId == "1"); + }); + Assert.IsTrue(handler); + } + + [TestMethod] + public async Task TestHttpContextItemParser2Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Items = new Dictionary() + }; + var provider = new HttpContextItemParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => + { + }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestHttpContextItemParser3Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var provider = new HttpContextItemParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => + { + }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestQueryStringParserAsync() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = { QueryString = QueryString.Create(tenantKey, "1") } + }; + var provider = new QueryStringParserProvider(); + Assert.IsTrue(provider.Name == "QueryString"); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => + { + Assert.IsTrue(tenantId == "1"); + }); + Assert.IsTrue(handler); + } + + [TestMethod] + public async Task TestQueryStringParser2Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = { QueryString = new QueryString() } + }; + var provider = new QueryStringParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => + { + }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestQueryStringParser3Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var provider = new QueryStringParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => + { + }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestRouteParserAsync() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = + { + RouteValues = new RouteValueDictionary + { + { tenantKey, "1" } + } + } + }; + var provider = new RouteParserProvider(); + Assert.IsTrue(provider.Name == "Route"); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, tenantId => + { + Assert.IsTrue(tenantId == "1"); + }); + Assert.IsTrue(handler); + } + + [TestMethod] + public async Task TestRouteParser2Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var serviceProvider = services.BuildServiceProvider(); + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext + { + Request = + { + RouteValues = new RouteValueDictionary() + } + }; + var provider = new RouteParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => + { + }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestRouteParser3Async() + { + var services = new ServiceCollection(); + services.AddHttpContextAccessor(); + string tenantKey = "tenant"; + var provider = new RouteParserProvider(); + var handler = await provider.ResolveAsync(services.BuildServiceProvider(), tenantKey, _ => + { + }); + Assert.IsFalse(handler); + } + + [TestMethod] + public async Task TestEnvironmentVariablesParserAsync() + { + var services = new ServiceCollection(); + string environmentKey = "env"; + System.Environment.SetEnvironmentVariable(environmentKey, "dev"); + var serviceProvider = services.BuildServiceProvider(); + var environmentVariablesParserProvider = new EnvironmentVariablesParserProvider(); + var handler = await environmentVariablesParserProvider.ResolveAsync(serviceProvider, environmentKey, environment => + { + Assert.IsTrue(environment == "dev"); + }); + Assert.IsTrue(environmentVariablesParserProvider.Name == "EnvironmentVariables"); + Assert.IsTrue(handler); + } +} diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs new file mode 100644 index 000000000..2b9d6c1d2 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/UnitOfWorkAccessor.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.Data.Options; + +namespace Masa.Contrib.Isolation.Tests; + +public class UnitOfWorkAccessor: IUnitOfWorkAccessor +{ + public MasaDbContextConfigurationOptions? CurrentDbContextOptions { get; set; } +} diff --git a/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/_Imports.cs b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/_Imports.cs new file mode 100644 index 000000000..8dc426a07 --- /dev/null +++ b/src/Contrib/Isolation/Tests/Masa.Contrib.Isolation.Tests/_Imports.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.Options; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Isolation.Environment; +global using Masa.BuildingBlocks.Isolation.Middleware; +global using Masa.BuildingBlocks.Isolation.MultiTenant; +global using Masa.BuildingBlocks.Isolation.Options; +global using Masa.BuildingBlocks.Isolation.Parser; +global using Masa.Contrib.Isolation.MultiEnvironment; +global using Masa.Contrib.Isolation.MultiTenant; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Routing; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using Microsoft.Extensions.Primitives; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; +global using System.Linq; diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs new file mode 100644 index 000000000..73bb2f01a --- /dev/null +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF; + +public static class DispatcherOptionsExtensions +{ + public static IEventBusBuilder UseIsolationUoW( + this IEventBusBuilder eventBusBuilder, + Action isolationBuilder, + Action? optionsBuilder, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + => eventBusBuilder.UseIsolationUoW(isolationBuilder, optionsBuilder, disableRollbackOnFailure, useTransaction); + + public static IEventBusBuilder UseIsolationUoW( + this IEventBusBuilder eventBusBuilder, + Action isolationBuilder, + Action? optionsBuilder, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + where TTenantId : IComparable + => eventBusBuilder.UseIsolationUoW(isolationBuilder, optionsBuilder, disableRollbackOnFailure, + useTransaction); + + public static IEventBusBuilder UseIsolationUoW( + this IEventBusBuilder eventBusBuilder, + Action isolationBuilder, + Action? optionsBuilder, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + where TTenantId : IComparable + where TUserId : IComparable + { + eventBusBuilder.Services.UseIsolationUoW(); + return eventBusBuilder.UseIsolation(isolationBuilder) + .UseUoW(optionsBuilder, disableRollbackOnFailure, useTransaction); + } + + public static IDispatcherOptions UseIsolationUoW( + this IDispatcherOptions options, + Action isolationBuilder, + Action? optionsBuilder, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + => options.UseIsolationUoW(isolationBuilder, optionsBuilder, disableRollbackOnFailure, useTransaction); + + public static IDispatcherOptions UseIsolationUoW( + this IDispatcherOptions options, + Action isolationBuilder, + Action? optionsBuilder, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + where TTenantId : IComparable + => options.UseIsolationUoW(isolationBuilder, optionsBuilder, disableRollbackOnFailure, + useTransaction); + + public static IDispatcherOptions UseIsolationUoW( + this IDispatcherOptions options, + Action isolationBuilder, + Action? optionsBuilder, + bool disableRollbackOnFailure = false, + bool useTransaction = true) + where TDbContext : MasaDbContext, IMasaDbContext + where TTenantId : IComparable + where TUserId : IComparable + { + options.Services.UseIsolationUoW(); + return options.UseIsolation(isolationBuilder) + .UseUoW(optionsBuilder, disableRollbackOnFailure, useTransaction); + } + + private static void UseIsolationUoW(this IServiceCollection services) where TTenantId : IComparable + => services.TryAddEnumerable(new ServiceDescriptor(typeof(ISaveChangesFilter), typeof(IsolationSaveChangesFilter), + ServiceLifetime.Scoped)); +} diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs new file mode 100644 index 000000000..6a2bbec3b --- /dev/null +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Internal; + +internal static class TypeExtensions +{ + static bool IsConcrete(this Type type) => !type.GetTypeInfo().IsAbstract && !type.GetTypeInfo().IsInterface; + + public static bool IsGenericInterfaceAssignableFrom(this Type genericType, Type type) => + type.IsConcrete() && + type.GetInterfaces().Any(t => t.GetTypeInfo().IsGenericType && t.GetGenericTypeDefinition() == genericType); +} diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs new file mode 100644 index 000000000..bc054d6b1 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF; + +/// +/// DbContext providing isolation +/// +/// tenant id type +/// +public abstract class IsolationDbContext : IsolationDbContext + where TKey : IComparable + where TDbContext : DbContext, IMasaDbContext +{ + protected IsolationDbContext(MasaDbContextOptions options) : base(options) + { + } +} + +/// +/// DbContext providing isolation +/// +/// tenant id type +public abstract class IsolationDbContext : IsolationDbContext +{ + protected IsolationDbContext(MasaDbContextOptions options) : base(options) + { + } +} + +/// +/// DbContext providing isolation +/// +/// tenant id type +public abstract class IsolationDbContext : MasaDbContext + where TKey : IComparable +{ + private readonly IEnvironmentContext? _environmentContext; + private readonly ITenantContext? _tenantContext; + + public IsolationDbContext(MasaDbContextOptions options) : base(options) + { + _environmentContext = options.ServiceProvider?.GetService(); + _tenantContext = options.ServiceProvider?.GetService(); + } + + protected override Expression>? CreateFilterExpression() + where TEntity : class + { + Expression>? expression = null; + + if (typeof(IMultiTenant<>).IsGenericInterfaceAssignableFrom(typeof(TEntity)) && _tenantContext != null) + { + string defaultTenantId = default(TKey)?.ToString() ?? string.Empty; + Expression> tenantFilter = entity => !IsTenantFilterEnabled || + (Microsoft.EntityFrameworkCore.EF.Property(entity, nameof(IMultiTenant.TenantId)).ToString() ?? string.Empty) + .Equals(_tenantContext.CurrentTenant != null ? _tenantContext.CurrentTenant.Id : defaultTenantId); + + expression = ExpressionExtensions.And(tenantFilter, expression != null, expression); + } + + if (typeof(IMultiEnvironment).IsAssignableFrom(typeof(TEntity)) && _environmentContext != null) + { + Expression> envFilter = entity => !IsEnvironmentFilterEnabled || + Microsoft.EntityFrameworkCore.EF.Property(entity, nameof(IMultiEnvironment.Environment)) + .Equals(_environmentContext != null ? _environmentContext.CurrentEnvironment : default); + expression = ExpressionExtensions.And(envFilter, expression != null, expression); + } + + var secondExpression = base.CreateFilterExpression(); + if (secondExpression != null) + expression = ExpressionExtensions.And(secondExpression, expression != null, expression); + + return expression; + } + + protected virtual bool IsEnvironmentFilterEnabled => DataFilter?.IsEnabled() ?? false; + + protected virtual bool IsTenantFilterEnabled => DataFilter?.IsEnabled>() ?? false; +} diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs new file mode 100644 index 000000000..43be7b9a1 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF; + +public class IsolationSaveChangesFilter : ISaveChangesFilter where TTenantId : IComparable +{ + private readonly ITenantContext? _tenantContext; + private readonly IConvertProvider? _convertProvider; + private readonly IEnvironmentContext? _environmentContext; + + public IsolationSaveChangesFilter(IServiceProvider serviceProvider) + { + _tenantContext = serviceProvider.GetService(); + _convertProvider = serviceProvider.GetService(); + _environmentContext = serviceProvider.GetService(); + } + + public void OnExecuting(ChangeTracker changeTracker) + { + changeTracker.DetectChanges(); + var entries = changeTracker.Entries().Where(entry => entry.State == EntityState.Added); + foreach (var entity in entries) + { + if (entity.Entity is IMultiTenant && _tenantContext != null) + { + if (_tenantContext.CurrentTenant != null && !string.IsNullOrEmpty(_tenantContext.CurrentTenant.Id)) + { + ArgumentNullException.ThrowIfNull(_convertProvider, nameof(_convertProvider)); + object tenantId = _convertProvider.ChangeType(_tenantContext.CurrentTenant.Id, typeof(TTenantId)); + entity.CurrentValues[nameof(IMultiTenant.TenantId)] = tenantId; + } + else + { + entity.CurrentValues[nameof(IMultiTenant.TenantId)] = default(TTenantId); + } + } + + if (entity.Entity is IMultiEnvironment && _environmentContext != null) + { + entity.CurrentValues[nameof(IMultiEnvironment.Environment)] = _environmentContext.CurrentEnvironment; + } + } + } +} diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj new file mode 100644 index 000000000..062853028 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.md b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.md new file mode 100644 index 000000000..2ec875fb9 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.md @@ -0,0 +1,76 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Isolation.UoW.EF + +Example: + +```C# +Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Data.Contracts.EF +Install-Package Masa.Contrib.Isolation.MultiEnvironment // Environmental isolation Quote on demand +Install-Package Masa.Contrib.Isolation.MultiTenant // Multi-tenant isolation On-demand reference +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. Configure `appsettings.json` +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + "IsolationConnectionStrings": [ + { + "TenantId": "*",//match all tenants + "Environment": "development", + "ConnectionString": "server=localhost,1434;uid=sa;pwd=P@ssw0rd;database=identity;", + "Score": 99 //When multiple environments are matched according to the conditions, the highest one is selected as the link address of the current DbContext according to the descending order of scores. The default Score is 100. + }, + { + "TenantId": "00000000-0000-0000-0000-000000000002", + "Environment": "development", + "ConnectionString": "server=localhost,1435;uid=sa;pwd=P@ssw0rd;database=identity;" + } + ] +} +``` + +* 1.1 When the current environment is equal to development: + * When the tenant is equal to 00000000-0000-0000-0000-000000000002, the database address: server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; + * When the tenant is not equal to 00000000-0000-0000-0000-000000000002, the database address: server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; + +* 1.2 When the environment is not equal to development: + * No tenant distinction, database address: server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; + +2. 使用Isolation.UoW.EF +``` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiEnvironment().UseMultiTenant(),// Select usage environment or tenant isolation as needed + dbOptions => dbOptions.UseFilter().UseSqlServer()); +}); +``` + +3. DbContext needs to inherit IsolationDbContext + +``` C# +public class CustomDbContext : IsolationDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + } +} +``` + +4. The class corresponding to the isolated table needs to implement IMultiTenant or IMultiEnvironment + +Tenant isolation implements IMultiTenant, and environment isolation implements IMultiEnvironment + +##### Summarize +* How many kinds of parser are currently supported? + * Currently two kinds of parsers are supported, one is [Environment Parser](../Masa.Contrib.Isolation.MultiEnvironment/README.md), the other is [Tenant Parser](../Masa.Contrib.Isolation.MultiTenant/README.md) +* How is the parser used? + * After publishing events through EventBus, EventBus will automatically call the parser middleware to trigger the environment and tenant parser to parse and assign values according to the isolation usage + * For scenarios where EventBus is not used, `app.UseIsolation();` needs to be added to Program.cs. After the request is initiated, it will first pass through the AspNetCore middleware provided by Isolation, and trigger the environment and tenant resolvers to parse and assign values. When the request arrives at the specified controller or Minimal method, the parsing is complete +* What does the parser do? + * Obtain the current environment and tenant information through the parser to provide data support for isolation, which needs to be called and executed before creating DbContext \ No newline at end of file diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md new file mode 100644 index 000000000..4eb2bc41b --- /dev/null +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md @@ -0,0 +1,76 @@ +中 | [EN](README.md) + +## Masa.Contrib.Isolation.UoW.EF + +用例: + +```C# +Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Data.Contracts.EF +Install-Package Masa.Contrib.Isolation.MultiEnvironment // 环境隔离 按需引用 +Install-Package Masa.Contrib.Isolation.MultiTenant // 多租户隔离 按需引用 +Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +``` + +1. 配置`appsettings.json` +``` appsettings.json +{ + "ConnectionStrings": { + "DefaultConnection": "server=localhost;uid=sa;pwd=P@ssw0rd;database=identity;" + }, + "IsolationConnectionStrings": [ + { + "TenantId": "*",//匹配所有租户 + "Environment": "development", + "ConnectionString": "server=localhost,1434;uid=sa;pwd=P@ssw0rd;database=identity;", + "Score": 99 //当根据条件匹配到多个环境时,根据分值降序选择其中最高的作为当前DbContext的链接地址,Score默认为100 + }, + { + "TenantId": "00000000-0000-0000-0000-000000000002", + "Environment": "development", + "ConnectionString": "server=localhost,1435;uid=sa;pwd=P@ssw0rd;database=identity;" + } + ] +} +``` + +* 1.1 当前环境等于development时: + * 当租户等于00000000-0000-0000-0000-000000000002时,数据库地址:server=localhost,1674;uid=sa;pwd=P@ssw0rd;database=identity; + * 当租户不等于00000000-0000-0000-0000-000000000002时,数据库地址:server=localhost,1672;uid=sa;pwd=P@ssw0rd;database=identity; + +* 1.2 当环境不等于development时: + * 不区分租户,数据库地址:server=localhost;uid=sa;pwd=P@ssw0rd;database=identity; + +2. 使用Isolation.UoW.EF +``` C# +builder.Services.AddEventBus(eventBusBuilder => +{ + eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiEnvironment().UseMultiTenant(),// 按需选择使用环境或者租户隔离 + dbOptions => dbOptions.UseFilter().UseSqlServer()); +}); +``` + +3. DbContext需要继承IsolationDbContext + +``` C# +public class CustomDbContext : IsolationDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) + { + } +} +``` + +4. 隔离的表对应的类需要实现IMultiTenant或IMultiEnvironment + +租户隔离实现IMultiTenant、环境隔离实现IMultiEnvironment + +##### 总结 +* 解析器目前支持几种? + * 目前支持两种解析器,一个是[环境解析器](../Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md)、一个是[租户解析器](../Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md) +* 解析器如何使用? + * 通过EventBus发布事件后,EventBus会自动调用解析器中间件,根据隔离性使用情况触发环境、租户解析器进行解析并赋值 + * 针对未使用EventBus的场景,需要在Program.cs中添加`app.UseIsolation();`,在请求发起后会先经过Isolation提供的AspNetCore中间件,并触发环境、租户解析器进行解析并赋值,当请求到达指定的控制器或者Minimal的方法时已经解析完成 +* 解析器的作用? + * 通过解析器获取当前的环境以及租户信息,为隔离提供数据支撑,需要在创建DbContext之前被调用执行 \ No newline at end of file diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/_Imports.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/_Imports.cs new file mode 100644 index 000000000..0c716833b --- /dev/null +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/_Imports.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Isolation; +global using Masa.BuildingBlocks.Isolation.Environment; +global using Masa.BuildingBlocks.Isolation.MultiTenant; +global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Data.EntityFrameworkCore.Filters; +global using Masa.Contrib.Data.UoW.EF; +global using Masa.Contrib.Isolation.UoW.EF.Internal; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.ChangeTracking; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using System.Linq.Expressions; +global using System.Reflection; diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs new file mode 100644 index 000000000..c0e8e0624 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs @@ -0,0 +1,58 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Tests; + +public class CustomDbContext : MasaDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) { } + + public DbSet User { get; set; } + + public DbSet Tag { get; set; } + + protected override void OnModelCreatingExecuting(ModelBuilder builder) + { + builder.Entity(ConfigureUserEntry); + } + + void ConfigureUserEntry(EntityTypeBuilder builder) + { + builder.ToTable("Users"); + + builder.HasKey(e => e.Id); + + builder.Property(e => e.Id) + .IsRequired(); + + builder.Property(e => e.Name) + .HasMaxLength(6) + .IsRequired(); + } +} + +public class User +{ + public Guid Id { get; private set; } + + public string Name { get; set; } = default!; + + public User() + { + this.Id = Guid.NewGuid(); + } +} + +public class Tag : ISoftDelete +{ + public Guid Id { get; private set; } + + public string Name { get; set; } = default!; + + public bool IsDeleted { get; protected set; } + + public Tag() + { + this.Id = Guid.NewGuid(); + } +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj new file mode 100644 index 000000000..d4f60e986 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj @@ -0,0 +1,40 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + Always + + + + + + + + + + + + + diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs new file mode 100644 index 000000000..2a37498ed --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Tests; + +public class TestBase : IDisposable +{ + protected readonly string _connectionString = "DataSource=:memory:"; + protected readonly SqliteConnection Connection; + + protected TestBase() + { + Connection = new SqliteConnection(_connectionString); + Connection.Open(); + } + + public void Dispose() + { + Connection.Close(); + } +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs new file mode 100644 index 000000000..16e21e12a --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs @@ -0,0 +1,371 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Tests; + +[TestClass] +public class TestIsolation : TestBase +{ + private IServiceCollection _services; + + [TestInitialize] + public void Initialize() + { + _services = new ServiceCollection(); + } + + [TestMethod] + public void TestUseIsolationUoW() + { + Mock eventBuilder = new(); + eventBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + Assert.ThrowsException(() => + { + eventBuilder.Object.UseIsolationUoW(_ => + { + }, dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); + }, "Tenant isolation and environment isolation use at least one"); + } + + [TestMethod] + public void TestUseIsolationUoW2() + { + Mock eventBuilder = new(); + eventBuilder.Setup(builder => builder.Services).Returns(_services).Verifiable(); + Assert.ThrowsException(() => + { + eventBuilder.Object.UseIsolationUoW(null!, + dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); + }); + } + + [TestMethod] + public void TestUseIsolationUoW3() + { + Mock dispatcherOption = new(); + dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); + Assert.ThrowsException(() => + { + dispatcherOption.Object.UseIsolationUoW(_ => + { + }, dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); + }, "Tenant isolation and environment isolation use at least one"); + } + + [TestMethod] + public void TestUseIsolationUoW4() + { + Mock dispatcherOption = new(); + dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); + Assert.ThrowsException(() => + { + dispatcherOption.Object.UseIsolationUoW(null!, dbOptionBuilder => dbOptionBuilder.UseSqlite()); + }); + } + + [TestMethod] + public void TestUseIsolationUoWByUseEnvironment() + { + Mock dispatcherOption = new(); + dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); + dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiEnvironment(), + dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); + + var serviceProvider = dispatcherOption.Object.Services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService()); + Assert.IsNotNull(serviceProvider.GetService()); + } + + [TestMethod] + public void TestUseIsolationUoWByUseMultiEnvironment() + { + Mock dispatcherOption = new(); + dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); + dispatcherOption.Object.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiEnvironment().UseMultiEnvironment(), + dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); + + var serviceProvider = dispatcherOption.Object.Services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestUseIsolationUoWByUseTenant() + { + Mock dispatcherOption = new(); + dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); + dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiTenant(), + dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); + + var serviceProvider = dispatcherOption.Object.Services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService()); + Assert.IsNotNull(serviceProvider.GetService()); + } + + [TestMethod] + public void TestUseIsolationUoWByUseMultiTenant() + { + Mock dispatcherOption = new(); + dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); + dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiTenant().UseMultiTenant(), + dbOptionBuilder => dbOptionBuilder.UseTestSqlite(_connectionString)); + + var serviceProvider = dispatcherOption.Object.Services.BuildServiceProvider(); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestUseIsolation() + { + var configurationRoot = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", true, true) + .Build(); + _services.AddSingleton(configurationRoot); + Mock dispatcherOption = new(); + dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); + dispatcherOption.Object.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiTenant().UseMultiEnvironment(), dbOptionBuilder => dbOptionBuilder.UseSqlite()); + var serviceProvider = _services.BuildServiceProvider(); + var customDbContext = serviceProvider.GetRequiredService(); + var unitOfWorkAccessor = serviceProvider.GetRequiredService(); + var currentDbContextOptions = unitOfWorkAccessor.CurrentDbContextOptions; + Assert.IsNotNull(currentDbContextOptions); + Assert.IsTrue(currentDbContextOptions.ConnectionString == "data source=test1"); + + var unitOfWorkManager = serviceProvider.GetRequiredService(); + var unifOfWorkNew = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew = unifOfWorkNew.ServiceProvider.GetRequiredService(); + + Assert.IsNull(unitOfWorkAccessorNew.CurrentDbContextOptions); + + Assert.IsTrue(unifOfWorkNew.ServiceProvider.GetRequiredService().CurrentTenant == null); + + Assert.IsTrue(string.IsNullOrEmpty(unifOfWorkNew.ServiceProvider.GetRequiredService().CurrentEnvironment)); + + unifOfWorkNew.ServiceProvider.GetRequiredService().SetTenant(new Tenant("00000000-0000-0000-0000-000000000002")); + Assert.IsTrue(unifOfWorkNew.ServiceProvider.GetRequiredService().CurrentTenant!.Id == + "00000000-0000-0000-0000-000000000002"); + unifOfWorkNew.ServiceProvider.GetRequiredService().SetEnvironment("dev"); + + Assert.IsTrue(unifOfWorkNew.ServiceProvider.GetRequiredService().CurrentEnvironment == "dev"); + + var dbContext = unifOfWorkNew.ServiceProvider.GetRequiredService(); + + Assert.IsTrue(GetDataBaseConnectionString(dbContext) == "data source=test1" && + unitOfWorkAccessorNew.CurrentDbContextOptions!.ConnectionString == "data source=test1"); + + var unifOfWorkNew2 = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); + unifOfWorkNew2.ServiceProvider.GetRequiredService().SetEnvironment("development"); + var dbContext2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(dbContext2) == "data source=test2" && + unitOfWorkAccessorNew2.CurrentDbContextOptions!.ConnectionString == "data source=test2"); + + var unifOfWorkNew3 = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); + unifOfWorkNew3.ServiceProvider.GetRequiredService().SetTenant(new Tenant("00000000-0000-0000-0000-000000000002")); + unifOfWorkNew3.ServiceProvider.GetRequiredService().SetEnvironment("development"); + var dbContext3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(dbContext3) == "data source=test2" && + unitOfWorkAccessorNew3.CurrentDbContextOptions!.ConnectionString == "data source=test2"); + + var unifOfWorkNew4 = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); + unifOfWorkNew4.ServiceProvider.GetRequiredService().SetTenant(new Tenant("00000000-0000-0000-0000-000000000002")); + unifOfWorkNew4.ServiceProvider.GetRequiredService().SetEnvironment("production"); + var dbContext4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(dbContext4) == "data source=test3" && + unitOfWorkAccessorNew4.CurrentDbContextOptions!.ConnectionString == "data source=test3"); + } + + [TestMethod] + public void TestUseMultiEnvironment() + { + _services.Configure(option => + { + option.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test4" + }; + option.IsolationConnectionStrings = new List + { + new() + { + ConnectionString = "data source=test5", + Environment = "dev" + }, + new() + { + ConnectionString = "data source=test6", + Environment = "pro" + } + }; + }); + Mock dispatcherOption = new(); + dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); + dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiEnvironment(), + dbOptionBuilder => dbOptionBuilder.UseSqlite()); + var serviceProvider = _services.BuildServiceProvider(); + var customDbContext = serviceProvider.GetRequiredService(); + var unitOfWorkAccessor = serviceProvider.GetRequiredService(); + var currentDbContextOptions = unitOfWorkAccessor.CurrentDbContextOptions; + Assert.IsNotNull(currentDbContextOptions); + Assert.IsTrue(currentDbContextOptions.ConnectionString == "data source=test4"); + + var unitOfWorkManager = serviceProvider.GetRequiredService(); + + var unifOfWorkNew2 = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); + unifOfWorkNew2.ServiceProvider.GetRequiredService().SetEnvironment("dev"); + var dbContext2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(dbContext2) == "data source=test5" && + unitOfWorkAccessorNew2.CurrentDbContextOptions!.ConnectionString == "data source=test5"); + + var unifOfWorkNew3 = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); + unifOfWorkNew3.ServiceProvider.GetRequiredService().SetEnvironment("pro"); + var dbContext3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(dbContext3) == "data source=test6" && + unitOfWorkAccessorNew3.CurrentDbContextOptions!.ConnectionString == "data source=test6"); + + var unifOfWorkNew4 = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); + unifOfWorkNew4.ServiceProvider.GetRequiredService().SetEnvironment("staging"); + var dbContext4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(dbContext4) == "data source=test4" && + unitOfWorkAccessorNew4.CurrentDbContextOptions!.ConnectionString == "data source=test4"); + } + + [TestMethod] + public void TestUseMultiTenant() + { + _services.Configure(option => + { + option.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = "data source=test7" + }; + option.IsolationConnectionStrings = new List + { + new() + { + ConnectionString = "data source=test8", + TenantId = "1" + }, + new() + { + ConnectionString = "data source=test9", + TenantId = "2" + } + }; + }); + Mock dispatcherOption = new(); + dispatcherOption.Setup(builder => builder.Services).Returns(_services).Verifiable(); + dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiTenant(), + dbOptionBuilder => dbOptionBuilder.UseSqlite()); + var serviceProvider = _services.BuildServiceProvider(); + var customDbContext = serviceProvider.GetRequiredService(); + var unitOfWorkAccessor = serviceProvider.GetRequiredService(); + var currentDbContextOptions = unitOfWorkAccessor.CurrentDbContextOptions; + Assert.IsNotNull(currentDbContextOptions); + Assert.IsTrue(currentDbContextOptions.ConnectionString == "data source=test7"); + + var unitOfWorkManager = serviceProvider.GetRequiredService(); + + var unifOfWorkNew2 = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); + unifOfWorkNew2.ServiceProvider.GetRequiredService().SetTenant(new Tenant("1")); + var dbContext2 = unifOfWorkNew2.ServiceProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(dbContext2) == "data source=test8" && + unitOfWorkAccessorNew2.CurrentDbContextOptions!.ConnectionString == "data source=test8"); + + var unifOfWorkNew3 = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); + unifOfWorkNew3.ServiceProvider.GetRequiredService().SetTenant(new Tenant("2")); + var dbContext3 = unifOfWorkNew3.ServiceProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(dbContext3) == "data source=test9" && + unitOfWorkAccessorNew3.CurrentDbContextOptions!.ConnectionString == "data source=test9"); + + var unifOfWorkNew4 = unitOfWorkManager.CreateDbContext(true); + var unitOfWorkAccessorNew4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); + unifOfWorkNew4.ServiceProvider.GetRequiredService().SetTenant(null!); + var dbContext4 = unifOfWorkNew4.ServiceProvider.GetRequiredService(); + Assert.IsTrue(GetDataBaseConnectionString(dbContext4) == "data source=test7" && + unitOfWorkAccessorNew4.CurrentDbContextOptions!.ConnectionString == "data source=test7"); + } + + [TestMethod] + public void TestUseMultiTenantAndAddMasaConfiguration() + { + var builder = WebApplication.CreateBuilder(); + builder.AddMasaConfiguration(); + Mock dispatcherOption = new(); + dispatcherOption.Setup(opt => opt.Services).Returns(builder.Services).Verifiable(); + dispatcherOption.Object.UseIsolationUoW(isolationBuilder => isolationBuilder.UseMultiEnvironment(), + dbOptionBuilder => dbOptionBuilder.UseSqlite()); + var serviceProvider = builder.Services.BuildServiceProvider(); + var customDbContext = serviceProvider.GetRequiredService(); + var unitOfWorkAccessor = serviceProvider.GetRequiredService(); + var currentDbContextOptions = unitOfWorkAccessor.CurrentDbContextOptions; + Assert.IsNotNull(currentDbContextOptions); + Assert.IsTrue(currentDbContextOptions.ConnectionString == "data source=test1"); + } + + [TestMethod] + public async Task TestUseMultiTenantAndUseFilterAsync() + { + var services = new ServiceCollection(); + services.Configure(option => + { + option.ConnectionStrings = new ConnectionStrings() + { + DefaultConnection = $"data source=test_{Guid.NewGuid()}" + }; + option.IsolationConnectionStrings = new List + { + new() + { + ConnectionString = $"data source=test_{Guid.NewGuid()}", + TenantId = "1" + } + }; + }); + Mock dispatcherOption = new(); + dispatcherOption.Setup(opt => opt.Services).Returns(services).Verifiable(); + dispatcherOption.Object.UseIsolationUoW(isolationBuilder => + isolationBuilder.UseMultiTenant(), + dbOptionBuilder => dbOptionBuilder.UseSqlite().UseFilter().UseFilter()); + + var serviceProvider = services.BuildServiceProvider(); + var customDbContext = serviceProvider.GetRequiredService(); + await customDbContext.Database.EnsureCreatedAsync(); + var tag = new Tag() + { + Name = "Tom" + }; + await customDbContext.Set().AddAsync(tag); + await customDbContext.SaveChangesAsync(); + + Assert.IsTrue(await customDbContext.Set().CountAsync() == 1); + + tag = await customDbContext.Set().FirstOrDefaultAsync(t => t.Id == tag.Id); + Assert.IsNotNull(tag); + + customDbContext.Set().Remove(tag); + await customDbContext.SaveChangesAsync(); + Assert.IsTrue(await customDbContext.Set().CountAsync() == 0); + + var dataFilter = serviceProvider.GetRequiredService(); + using (dataFilter.Disable()) + { + Assert.IsTrue(await customDbContext.Set().CountAsync() == 1); + tag = await customDbContext.Set().FirstOrDefaultAsync(t => t.Id == tag.Id); + Assert.IsNotNull(tag); + } + } + + private string GetDataBaseConnectionString(CustomDbContext dbContext) => dbContext.Database.GetConnectionString()!; +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs new file mode 100644 index 000000000..39f2e841b --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data; +global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; +global using Masa.BuildingBlocks.Data.UoW; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Isolation.Environment; +global using Masa.BuildingBlocks.Isolation.MultiTenant; +global using Masa.BuildingBlocks.Isolation.Options; +global using Masa.Contrib.Data.Contracts.EF; +global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Isolation.MultiEnvironment; +global using Masa.Contrib.Isolation.MultiTenant; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Data.Sqlite; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; +global using System.IO; +global using System.Linq; diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json new file mode 100644 index 000000000..dbbc90933 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json @@ -0,0 +1,18 @@ +{ + "ConnectionStrings": { + "DefaultConnection": "data source=test1" + }, + "IsolationConnectionStrings": [ + { + "TenantId": "*", + "Environment": "development", + "ConnectionString": "data source=test2", + "Score": 99 + }, + { + "TenantId": "00000000-0000-0000-0000-000000000002", + "Environment": "production", + "ConnectionString": "data source=test3" + } + ] +} \ No newline at end of file diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs new file mode 100644 index 000000000..645ea5c6a --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs @@ -0,0 +1,92 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests; + +public class CustomDbContext : IsolationDbContext +{ + public CustomDbContext(MasaDbContextOptions options) : base(options) { } + + public DbSet User { get; set; } + + public DbSet Role { get; set; } + + protected override void OnModelCreatingExecuting(ModelBuilder builder) + { + builder.Entity(ConfigureUserEntry); + builder.Entity(ConfigureRoleEntry); + } + + void ConfigureUserEntry(EntityTypeBuilder builder) + { + builder.ToTable("Users"); + + builder.HasKey(user => user.Id); + + builder.Property(user => user.Id) + .IsRequired(); + + builder.Property(user => user.Account) + .HasMaxLength(20) + .IsRequired(); + + builder.Property(user => user.Account) + .HasMaxLength(50) + .IsRequired(); + } + + void ConfigureRoleEntry(EntityTypeBuilder builder) + { + builder.ToTable("Roles"); + + builder.HasKey(role => role.Id); + + builder.Property(e => e.Id) + .IsRequired(); + + builder.Property(e => e.Name) + .HasMaxLength(20) + .IsRequired(); + + builder.Property(e => e.Quantity) + .IsRequired(); + } +} + +public class User : IIsolation +{ + public Guid Id { get; private set; } + + public string Account { get; set; } = default!; + + public string Password { get; set; } = default!; + + public int TenantId { get; set; } + + public string Environment { get; set; } + + public User() + { + this.Id = Guid.NewGuid(); + } +} + +public class Role : IIsolation, ISoftDelete +{ + public Guid Id { get; private set; } + + public string Name { get; set; } + + public int Quantity { get; set; } + + public bool IsDeleted { get; set; } + + public int TenantId { get; set; } + + public string Environment { get; set; } + + public Role() + { + this.Id = Guid.NewGuid(); + } +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs new file mode 100644 index 000000000..1e4407e15 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests; + +[TestClass] +public class EdgeDriverTest +{ + private IServiceCollection _services; + + [TestInitialize] + public void Initialize() + { + var configurationRoot = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", true, true) + .Build(); + _services = new ServiceCollection(); + _services.AddSingleton(configurationRoot); + _services.AddEventBus(eventBusBuilder => eventBusBuilder.UseIsolationUoW( + isolationBuilder => isolationBuilder.UseMultiTenant("tenant").UseMultiEnvironment("env"), dbOptions => dbOptions.UseFilter().UseSqlite())); + System.Environment.SetEnvironmentVariable("env", "pro"); + } + + [TestMethod] + public async Task TestTenantAsync() + { + var serviceProvider = _services.BuildServiceProvider(); + + #region Manually assign values to tenants and environments, and in real scenarios, automatically parse and assign values based on the current HttpContext + + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext(); + httpContextAccessor.HttpContext.Items = new Dictionary + { + { "tenant", "2" } + }; + + #endregion + + var registerUserEvent = new RegisterUserEvent("jim", "123456"); + var eventBus = serviceProvider.GetRequiredService(); + await eventBus.PublishAsync(registerUserEvent); + } + + [TestMethod] + public async Task TestTenant2Async() + { + var serviceProvider = _services.BuildServiceProvider(); + + #region Manually assign values to tenants and environments, and in real scenarios, automatically parse and assign values based on the current HttpContext + + var httpContextAccessor = serviceProvider.GetRequiredService(); + httpContextAccessor.HttpContext = new DefaultHttpContext(); + httpContextAccessor.HttpContext.Items = new Dictionary + { + { "tenant", "1" } + }; + + #endregion + + var addRoleEvent = new AddRoleEvent("Admin", 1); + var eventBus = serviceProvider.GetRequiredService(); + await eventBus.PublishAsync(addRoleEvent); + } +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs new file mode 100644 index 000000000..9f3922a82 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs @@ -0,0 +1,53 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.EventHandlers; + +public class AddRoleEventHandler +{ + private readonly CustomDbContext _customDbContext; + private readonly IDataFilter _dataFilter; + private readonly IEnvironmentSetter _environmentSetter; + private readonly IEnvironmentContext _environmentContext; + + public AddRoleEventHandler(CustomDbContext customDbContext, IDataFilter dataFilter, IEnvironmentSetter environmentSetter, + IEnvironmentContext environmentContext) + { + _customDbContext = customDbContext; + _dataFilter = dataFilter; + _environmentSetter = environmentSetter; + _environmentContext = environmentContext; + } + + [EventHandler] + public async Task AddRoleAsync(AddRoleEvent @event) + { + await _customDbContext.Database.EnsureCreatedAsync(); + Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test1"); + var role = new Role + { + Name = @event.Name, + Quantity = @event.Quantity + }; + await _customDbContext.Set().AddAsync(role); + await _customDbContext.SaveChangesAsync(); + + var role2 = await _customDbContext.Set().FirstOrDefaultAsync(); + Assert.IsTrue(role2!.Name == @event.Name); + Assert.IsTrue(role2.IsDeleted == false); + + _environmentSetter.SetEnvironment("dev"); //In EventHandler, physical isolation is not retriggered if a new DbContext is not recreated, it can only be used to filter changes + Assert.IsTrue(_environmentContext.CurrentEnvironment == "dev"); + Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test1"); + + var role3 = await _customDbContext.Set().FirstOrDefaultAsync(); + Assert.IsNull(role3); + + using (_dataFilter.Disable()) + { + Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test1"); + var role4 = await _customDbContext.Set().FirstOrDefaultAsync(); + Assert.IsNotNull(role4); + } + } +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs new file mode 100644 index 000000000..d8ecd5d51 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.EventHandlers; + +public class RegisterUserEventHandler +{ + private readonly CustomDbContext _customDbContext; + private readonly IDataFilter _dataFilter; + private readonly IEnvironmentSetter _environmentSetter; + private readonly IEnvironmentContext _environmentContext; + + public RegisterUserEventHandler(CustomDbContext customDbContext, IDataFilter dataFilter, IEnvironmentSetter environmentSetter, + IEnvironmentContext environmentContext) + { + _customDbContext = customDbContext; + _dataFilter = dataFilter; + _environmentSetter = environmentSetter; + _environmentContext = environmentContext; + } + + [EventHandler] + public async Task RegisterUserAsync(RegisterUserEvent @event) + { + await _customDbContext.Database.EnsureCreatedAsync(); + Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test3"); + var user = new User + { + Account = @event.Account, + Password = MD5Utils.Encrypt(@event.Password, @event.Password) + }; + await _customDbContext.Set().AddAsync(user); + await _customDbContext.SaveChangesAsync(); + + var user2 = await _customDbContext.Set().FirstOrDefaultAsync(); + Assert.IsTrue(user2!.Account == @event.Account); + Assert.IsTrue(user2.Environment == "pro"); + Assert.IsTrue(user2.TenantId == 2); + + _environmentSetter.SetEnvironment("dev"); //In EventHandler, physical isolation is not retriggered if a new DbContext is not recreated, it can only be used to filter changes + Assert.IsTrue(_environmentContext.CurrentEnvironment == "dev"); + Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test3"); + + var user3 = await _customDbContext.Set().FirstOrDefaultAsync(); + Assert.IsNull(user3); + + using (_dataFilter.Disable()) + { + Assert.IsTrue(_customDbContext.Database.GetConnectionString() == "data source=test3"); + var user4 = await _customDbContext.Set().FirstOrDefaultAsync(); + Assert.IsNotNull(user4); + } + } +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs new file mode 100644 index 000000000..c52982224 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.Events; + +public record AddRoleEvent(string Name,int Quantity) : Event +{ +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs new file mode 100644 index 000000000..5e8aca201 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.Events; + +public record RegisterUserEvent(string Account,string Password) : Event +{ +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj new file mode 100644 index 000000000..3a012fca1 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj @@ -0,0 +1,35 @@ + + + + net6.0 + enable + false + enable + + + + + + + + + + + + + Always + + + + + + + + + + + + + + + diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs new file mode 100644 index 000000000..8e2d90ed5 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests; + +public class TestBase : IDisposable +{ + protected readonly string _connectionString = "DataSource=:memory:"; + protected readonly SqliteConnection Connection; + + protected TestBase() + { + Connection = new SqliteConnection(_connectionString); + Connection.Open(); + } + + public void Dispose() + { + Connection.Close(); + } +} diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs new file mode 100644 index 000000000..1b483b585 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.Isolation; +global using Masa.BuildingBlocks.Isolation.Environment; +global using Masa.Contrib.Data.Contracts.EF; +global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Dispatcher.Events; +global using Masa.Contrib.Isolation.MultiEnvironment; +global using Masa.Contrib.Isolation.MultiTenant; +global using Masa.Contrib.Isolation.UoW.EF.Web.Tests.Events; +global using Masa.Utils.Security.Cryptography; +global using Microsoft.AspNetCore.Http; +global using Microsoft.Data.Sqlite; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System; +global using System.Collections.Generic; +global using System.IO; +global using System.Threading.Tasks; diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json new file mode 100644 index 000000000..478264b26 --- /dev/null +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json @@ -0,0 +1,18 @@ +{ + "ConnectionStrings": { + "DefaultConnection": "data source=test1" + }, + "IsolationConnectionStrings": [ + { + "TenantId": "1", + "Environment": "dev", + "ConnectionString": "data source=test2", + "Score": 99 + }, + { + "TenantId": "2", + "Environment": "pro", + "ConnectionString": "data source=test3" + } + ] +} \ No newline at end of file diff --git a/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs new file mode 100644 index 000000000..46acfac6d --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Commands/CommandHandler.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Commands; + +public abstract class CommandHandler : ICommandHandler, ISagaEventHandler + where TCommand : ICommand +{ + public abstract Task HandleAsync(TCommand @event); + + public virtual Task CancelAsync(TCommand @event) + { + return Task.CompletedTask; + } +} diff --git a/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj new file mode 100644 index 000000000..8c49b4e24 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs new file mode 100644 index 000000000..df6cd1861 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Queries; + +public abstract class QueryHandler : IQueryHandler + where TQuery : IQuery + where TResult : notnull +{ + public abstract Task HandleAsync(TQuery @event); +} diff --git a/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md new file mode 100644 index 000000000..0fd550e09 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md @@ -0,0 +1,86 @@ +[中](README.zh-CN.md) | EN + +## Cqrs + +Example: + +1. Define Command and Query base classes +2. Support the Handler of Saga mode, and provide the basic implementation of CommandHandler + + ```C# + Install-Package Masa.Contrib.ReadWriteSpliting.Cqrs + ``` + +##### Query: + +1. Define Query + + ```C# + public class CatalogItemQuery : Query> + { + public string Name { get; set; } = default!; + + public override List Result { get; set; } = default!; + } + ``` + +2. Define QueryHandler + + ```C# + public class CatalogQueryHandler : QueryHandler> + { + private readonly ICatalogItemRepository _catalogItemRepository; + + public CatalogQueryHandler(ICatalogItemRepository catalogItemRepository) => _catalogItemRepository = catalogItemRepository; + + public async Task HandleAsync(CatalogItemQuery query) + { + query.Result = await _catalogItemRepository.GetListAsync(query.Name); + } + } + ``` + +3. Send Query + + ```c# + IEventBus eventBus;//Get IEventBus through DI + await eventBus.PublishAsync(new CatalogItemQuery() { Name = "Rolex" }); + ``` + + > Tip: The generic type after Query is consistent with the return type of Result. You need to assign a value to Result in Handler so that the caller can get the result. + +##### Command + +1. Define Command + + ```c# + public class CreateCatalogItemCommand : Command + { + public string Name { get; set; } = default!; + + //todo + } + ``` + +2. Add CommandHandler + + ```c# + public class CatalogCommandHandler : CommandHandler + { + private readonly ICatalogItemRepository _catalogItemRepository; + + public CatalogCommandHandler(ICatalogItemRepository catalogItemRepository) => _catalogItemRepository = catalogItemRepository; + + public async Task HandleAsync(CreateCatalogItemCommand command) + { + //todo + } + } + ``` + +3. Send Command + + ```C# + IEventBus eventBus;//Get IEventBus through DI + await eventBus.PublishAsync(new CreateCatalogItemCommand()); + ``` \ No newline at end of file diff --git a/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md new file mode 100644 index 000000000..0cf2b9384 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md @@ -0,0 +1,87 @@ +中 | [EN](README.md) + +## Cqrs + +用例: + +1. 定义了Command与Query基类 +2. 支持Saga模式的Handler,并提供CommandHandler基础实现 + + ```C# + Install-Package Masa.Contrib.ReadWriteSpliting.Cqrs + ``` + +##### Query: + +1. 定义Query + + ```C# + public class CatalogItemQuery : Query> + { + public string Name { get; set; } = default!; + + public override List Result { get; set; } = default!; + } + ``` + +2. 定义QueryHandler + + ```C# + public class CatalogQueryHandler : QueryHandler> + { + private readonly ICatalogItemRepository _catalogItemRepository; + + public CatalogQueryHandler(ICatalogItemRepository catalogItemRepository) + => _catalogItemRepository = catalogItemRepository; + + public async Task HandleAsync(CatalogItemQuery query) + { + query.Result = await _catalogItemRepository.GetListAsync(query.Name); + } + } + ``` + +3. 发送Query + + ```c# + IEventBus eventBus;//通过DI得到IEventBus + await eventBus.PublishAsync(new CatalogItemQuery() { Name = "Rolex" }); + ``` + + > 提示:Query后的泛型与Result的返回类型保持一致,需要再Handler中为Result赋值,以便调用方得到结果 + +##### Command + +1. 定义 Command + + ```c# + public class CreateCatalogItemCommand : Command + { + public string Name { get; set; } = default!; + + //todo + } + ``` + +2. 添加 CommandHandler + + ```c# + public class CatalogCommandHandler : CommandHandler + { + private readonly ICatalogItemRepository _catalogItemRepository; + + public CatalogCommandHandler(ICatalogItemRepository catalogItemRepository) => _catalogItemRepository = catalogItemRepository; + + public async Task HandleAsync(CreateCatalogItemCommand command) + { + //todo + } + } + ``` + +3. 发送 Command + + ```C# + IEventBus eventBus;//通过DI得到IEventBus + await eventBus.PublishAsync(new CreateCatalogItemCommand()); + ``` diff --git a/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs new file mode 100644 index 000000000..9690a40df --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; +global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs new file mode 100644 index 000000000..15c7908f5 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; + +namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Commands; + +public record CreateProductionCommand : Command +{ + public string Name { get; set; } + + public int Count { get; set; } +} diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs new file mode 100644 index 000000000..cf3bb5c12 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CqrsTest.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests; + +[TestClass] +public class CQRSTest +{ + private IServiceCollection _services; + private IServiceProvider _serviceProvider; + private IEventBus _eventBus; + + [TestInitialize] + public void Initialize() + { + _services = new ServiceCollection(); + _services.AddEventBus(); + _serviceProvider = _services.BuildServiceProvider(); + _eventBus = _serviceProvider.GetRequiredService(); + } + + + [DataTestMethod] + [DataRow("")] + [DataRow("tom")] + public void TestCommand(string name) + { + var command = new CreateProductionCommand() + { + Name = name, + Count = 0 + }; + _eventBus.PublishAsync(command); + if (string.IsNullOrEmpty(name)) + { + Assert.IsTrue(command.Count == 2); + } + else + { + Assert.IsTrue(command.Count == 1); + } + } + + [TestMethod] + public void TestQuery() + { + var query = new ProductionItemQuery() + { + ProductionId = "1" + }; + _eventBus.PublishAsync(query); + Assert.IsTrue(query.Result == "Apple"); + } +} diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs new file mode 100644 index 000000000..675fc7ba2 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/CreateProductionCommandHandler.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests; + +public class CreateProductionCommandHandler : CommandHandler +{ + [EventHandler(1, Dispatcher.Events.Enums.FailureLevels.ThrowAndCancel, false)] + public override Task HandleAsync(CreateProductionCommand @event) + { + @event.Count++; + if (string.IsNullOrEmpty(@event.Name)) + throw new ArgumentNullException(nameof(@event)); + + if (@event.GetEventId() == default(Guid) || @event.GetCreationTime() > DateTime.UtcNow) + throw new ArgumentNullException(nameof(@event)); + + return Task.CompletedTask; + } + + [EventHandler(1)] + public override Task CancelAsync(CreateProductionCommand @event) + { + @event.Count++; + return base.CancelAsync(@event); + } +} diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj new file mode 100644 index 000000000..b8598c80a --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.csproj @@ -0,0 +1,30 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs new file mode 100644 index 000000000..f863a4769 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/ProductionQueryHandler.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests; + +public class ProductionQueryHandler : QueryHandler +{ + public override Task HandleAsync(ProductionItemQuery @event) + { + if (string.IsNullOrEmpty(@event.ProductionId)) + throw new ArgumentNullException(nameof(@event)); + + if (@event.GetEventId() == default(Guid) || @event.GetCreationTime() > DateTime.UtcNow) + throw new ArgumentNullException(nameof(@event)); + + if (@event.ProductionId == "1") + @event.Result = "Apple"; + + return Task.CompletedTask; + } +} diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs new file mode 100644 index 000000000..491ddb173 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; + +namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Queries; + +public record ProductionItemQuery : Query +{ + public override string Result { get; set; } + + public string ProductionId { get; set; } +} diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs new file mode 100644 index 000000000..0ec013682 --- /dev/null +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Dispatcher.Events; +global using Masa.Contrib.ReadWriteSpliting.Cqrs.Commands; +global using Masa.Contrib.ReadWriteSpliting.Cqrs.Queries; +global using Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Commands; +global using Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Queries; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs new file mode 100644 index 000000000..4b5e5f1d9 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteClient.cs @@ -0,0 +1,196 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.SearchEngine.AutoComplete; + +public class AutoCompleteClient : BaseAutoCompleteClient +{ + private readonly IElasticClient _elasticClient; + private readonly IMasaElasticClient _client; + private readonly string _indexName; + private readonly Operator _defaultOperator; + private readonly SearchType _defaultSearchType; + private readonly bool _enableMultipleCondition; + + public AutoCompleteClient( + IElasticClient elasticClient, + IMasaElasticClient client, + string indexName, + Operator defaultOperator, + SearchType defaultSearchType, + bool enableMultipleCondition) + { + _elasticClient = elasticClient; + _client = client; + _indexName = indexName; + _defaultOperator = defaultOperator; + _defaultSearchType = defaultSearchType; + _enableMultipleCondition = enableMultipleCondition; + } + + public override async Task> GetBySpecifyDocumentAsync( + string keyword, + AutoCompleteOptions? options = null, + CancellationToken cancellationToken = default) + { + var newOptions = options ?? new(_defaultSearchType); + var searchType = newOptions.SearchType ?? _defaultSearchType; + + keyword = keyword.Trim(); + + if (string.IsNullOrEmpty(keyword)) + return new Masa.BuildingBlocks.SearchEngine.AutoComplete.Response.GetResponse(true, string.Empty, new List()); + + if (searchType == SearchType.Fuzzy) + { + var ret = await _client.GetPaginatedListAsync( + new PaginatedOptions( + _indexName, + GetFuzzyKeyword(keyword), + newOptions.Field, + newOptions.Page, + newOptions.PageSize, + _defaultOperator) + , cancellationToken); + return new Masa.BuildingBlocks.SearchEngine.AutoComplete.Response.GetResponse(ret.IsValid, ret.Message) + { + Total = ret.Total, + TotalPages = ret.TotalPages, + Data = ret.Data + }; + } + else + { + var ret = await _elasticClient.SearchAsync(s => s + .Index(_indexName) + .From((newOptions.Page - 1) * newOptions.PageSize) + .Size(newOptions.PageSize) + .Query(q => GetQueryDescriptor(q, newOptions.Field, keyword.ToLower())) + , cancellationToken + ); + return new Masa.BuildingBlocks.SearchEngine.AutoComplete.Response.GetResponse(ret.IsValid, + ret.ServerError?.ToString() ?? "") + { + Data = ret.Hits.Select(hit => hit.Source).ToList(), + Total = ret.Total, + TotalPages = (int)Math.Ceiling(ret.Total / (decimal)newOptions.PageSize) + }; + } + } + + private string GetFuzzyKeyword(string keyword) + { + if (_enableMultipleCondition) + return string.Join(' ', keyword.Split(' ').Select(CompleteKeyword)); + + if (!keyword.Contains(" ")) + return CompleteKeyword(keyword); + + return $"\"{keyword}\""; //Content contains spaces and is treated as a phrase for search + } + + private string CompleteKeyword(string keyword) + { + if (keyword.Equals("*")) + return keyword; + + keyword = keyword.Trim('*'); + return $"({keyword} OR *{keyword} OR {keyword}*)"; + } + + private QueryContainer GetQueryDescriptor(QueryContainerDescriptor queryContainerDescriptor, string field, string keyword) + where T : class + { + var queryContainer = _defaultOperator == Operator.And ? + queryContainerDescriptor.Bool(boolQueryDescriptor => GetBoolQueryDescriptor(boolQueryDescriptor, field, keyword)) : + queryContainerDescriptor.Terms(descriptor + => descriptor.Field(field).Terms(_enableMultipleCondition ? keyword.Split(' ') : new[] { keyword })); + return queryContainer; + } + + private BoolQueryDescriptor GetBoolQueryDescriptor(BoolQueryDescriptor boolQueryDescriptor, string field, string keyword) + where T : class + { + if (!_enableMultipleCondition) + return boolQueryDescriptor.Must(queryContainerDescriptor => queryContainerDescriptor.Term(field, keyword)); + + foreach (var item in keyword.Split(' ')) + { + boolQueryDescriptor = boolQueryDescriptor.Must(queryContainerDescriptor => queryContainerDescriptor.Term(field, item)); + } + return boolQueryDescriptor; + } + + + public override Task SetBySpecifyDocumentAsync(IEnumerable documents, + SetOptions? options = null, + CancellationToken cancellationToken = default) + { + SetOptions newOptions = options ?? new(); + if (newOptions.IsOverride) + return SetMultiAsync(documents, cancellationToken); + + return SetByNotOverrideAsync(documents, cancellationToken); + } + + /// + /// Set documents in batches + /// add them if they don’t exist, update them if they exist + /// + /// + /// + /// + /// + private async Task SetMultiAsync( + IEnumerable documents, + CancellationToken cancellationToken = default) + where TDocument : AutoCompleteDocument + { + var request = new SetDocumentRequest(_indexName); + foreach (var document in documents) + request.AddDocument(document, document.GetDocumentId()); + + var ret = await _client.SetDocumentAsync(request, cancellationToken); + return new SetResponse(ret.IsValid, ret.Message) + { + Items = ret.Items.Select(item => new SetResponseItems(item.Id, item.IsValid, item.Message)).ToList() + }; + } + + /// + /// Set documents in batches + /// Update if it does not exist, skip if it exists + /// + /// + /// + /// + /// + private async Task SetByNotOverrideAsync( + IEnumerable documents, + CancellationToken cancellationToken = default) + where TDocument : AutoCompleteDocument + { + var request = new CreateMultiDocumentRequest(_indexName); + foreach (var document in documents) + request.AddDocument(document, document.GetDocumentId()); + + var ret = await _client.CreateMultiDocumentAsync(request, cancellationToken); + return new SetResponse(ret.IsValid, ret.Message) + { + Items = ret.Items.Select(item => new SetResponseItems(item.Id, item.IsValid, item.Message)).ToList() + }; + } + + public override async Task DeleteAsync(string id, CancellationToken cancellationToken = default) + { + var response = await _client.DeleteDocumentAsync(new DeleteDocumentRequest(_indexName, id), cancellationToken); + return new DeleteResponse(response.IsValid, response.Message); + } + + public override async Task DeleteAsync(IEnumerable ids, CancellationToken cancellationToken = default) + { + var response = await _client.DeleteMultiDocumentAsync(new DeleteMultiDocumentRequest(_indexName, ids.ToArray()), cancellationToken); + return new DeleteMultiResponse(response.IsValid, response.Message, + response.Data.Select(item => new DeleteRangeResponseItems(item.Id, item.IsValid, item.Message))); + } +} diff --git a/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs new file mode 100644 index 000000000..66e5e685a --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/AutoCompleteFactory.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.SearchEngine.AutoComplete; + +public class AutoCompleteFactory : IAutoCompleteFactory +{ + private readonly List _relations; + + public AutoCompleteFactory(AutoCompleteRelationsOptions options) => _relations = options.Relations; + + public IAutoCompleteClient CreateClient() + { + var item = _relations.SingleOrDefault(r => r.IsDefault) ?? _relations.FirstOrDefault(); + ArgumentNullException.ThrowIfNull(item, "You should use AddAutoComplete before the project starts"); + return new AutoCompleteClient( + item.ElasticClient, + item.MasaElasticClient, + item.RealIndexName, + item.DefaultOperator, + item.DefaultSearchType, + item.EnableMultipleCondition); + } + + /// + /// Create a client corresponding to the index + /// + /// indexName or alias + /// + public IAutoCompleteClient CreateClient(string name) + { + var item = _relations.FirstOrDefault(relation => relation.IndexName == name || relation.Alias == name); + ArgumentNullException.ThrowIfNull(item, nameof(name)); + return new AutoCompleteClient( + item.ElasticClient, + item.MasaElasticClient, + item.RealIndexName, + item.DefaultOperator, + item.DefaultSearchType, + item.EnableMultipleCondition); + } +} diff --git a/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj new file mode 100644 index 000000000..dc09a1533 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + Masa.Contrib.SearchEngine.AutoComplete + + + + + + + + + + + + diff --git a/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs new file mode 100644 index 000000000..0871382e5 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteOptions.cs @@ -0,0 +1,86 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.SearchEngine.AutoComplete.Options; + +public class AutoCompleteOptions + where TDocument : AutoCompleteDocument +{ + internal string IndexName { get; private set; } + + internal string? Alias { get; private set; } + + internal bool IsDefault { get; private set; } + + internal SearchType DefaultSearchType { get; private set; } = SearchType.Fuzzy; + + internal Operator DefaultOperator { get; private set; } = Operator.Or; + + internal bool EnableMultipleCondition { get; private set; } = true; + + internal Action>? Action { get; private set; } + + internal Action? IndexSettingAction { get; private set; } + + public AutoCompleteOptions UseIndexName(string indexName) + { + IndexName = indexName; + return this; + } + + /// + /// Set index alias + /// + /// When it is null, no alias is set + /// + public AutoCompleteOptions UseAlias(string alias) + { + Alias = alias; + return this; + } + + /// + /// Set the default AutoComplete + /// + /// + public AutoCompleteOptions UseDefault() + { + IsDefault = true; + return this; + } + + public AutoCompleteOptions UseDefaultSearchType(SearchType defaultSearchType) + { + DefaultSearchType = defaultSearchType; + return this; + } + + /// + /// custom mapping + /// + /// + /// + public AutoCompleteOptions Mapping(Action> action) + { + Action = action; + return this; + } + + public AutoCompleteOptions IndexSettings(Action indexSettingAction) + { + IndexSettingAction = indexSettingAction; + return this; + } + + public AutoCompleteOptions UseDefaultOperator(Operator defaultOperator) + { + DefaultOperator = defaultOperator; + return this; + } + + public AutoCompleteOptions UseMultipleConditions(bool enableMultipleCondition = true) + { + EnableMultipleCondition = enableMultipleCondition; + return this; + } +} diff --git a/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs new file mode 100644 index 000000000..d7cef1d31 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/Options/AutoCompleteRelationsOptions.cs @@ -0,0 +1,57 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.SearchEngine.AutoComplete.Options; + +public class AutoCompleteRelationsOptions +{ + internal List Relations = new(); + + public AutoCompleteRelationsOptions AddRelation(AutoCompleteRelations options) + { + Relations.Add(options); + return this; + } +} + +public class AutoCompleteRelations +{ + internal bool IsDefault { get; } + + internal string IndexName { get; } + + internal string? Alias { get; } + + internal string RealIndexName { get; } + + internal Operator DefaultOperator { get; } + + internal bool EnableMultipleCondition { get; } + + internal IElasticClient ElasticClient { get; } + + internal IMasaElasticClient MasaElasticClient { get; } + + internal SearchType DefaultSearchType { get; } + + internal AutoCompleteRelations( + IElasticClient elasticClient, + IMasaElasticClient masaElasticClient, + string indexName, + string? alias, + bool isDefault, + Operator defaultOperator, + SearchType defaultSearchType, + bool enableMultipleCondition) + { + ElasticClient = elasticClient; + MasaElasticClient = masaElasticClient; + IndexName = indexName; + Alias = alias; + RealIndexName = alias ?? indexName; + IsDefault = isDefault; + DefaultOperator = defaultOperator; + DefaultSearchType = defaultSearchType; + EnableMultipleCondition = enableMultipleCondition; + } +} diff --git a/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md new file mode 100644 index 000000000..19a8fc36c --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.md @@ -0,0 +1,186 @@ +[中](README.zh-CN.md) | EN + +## AutoComplete.ElasticSearch + +Example: + +``` c# +Install-Package Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch +``` + +Basic usage: + +Using AutoComplete + +* Use the default model `AutoCompleteDocument`, where TValue does not support classes + +``` C# +string userIndexName = "user_index_01"; +string userAlias = "user_index"; +builder.Services + .AddElasticsearchClient("es", option => option.UseNodes("http://localhost:9200").UseDefault()) + .AddAutoComplete(option => option.UseIndexName(userIndexName).UseAlias(userAlias)); +``` + +* Use a custom model, eg: `UserDocument` + +``` C# +string userIndexName = "user_index_01"; +string userAlias = "user_index"; +builder.Services + .AddElasticsearchClient("es", option => option.UseNodes("http://localhost:9200").UseDefault()) + .AddAutoCompleteBySpecifyDocument(option => option.UseIndexName(userIndexName).UseAlias(userAlias)); + +public class User : AutoCompleteDocument +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string Phone { get; set; } + + protected override string GetText() + { + return $"{Name}:{Phone}"; + } + + /// + /// If you want the id to be unique + /// + /// + public override string GetDocumentId() => Id.ToString(); +} +``` + +##### Setting data (SetAsync) + +1. Set up a single document: + +1.1. Using the default model (key-value model): + + ``` C# + public async Task SetAsync([FromServices] IAutoCompleteClient client) + { + await client.SetAsync(new AutoCompleteDocument("Edward Adam Davis", 1)); + } + ``` + +1.2 Using a custom model + + ``` C# + public async Task SetAsync([FromServices] IAutoCompleteClient client) + { + await client.SetBySpecifyDocumentAsync(new User + { + Id = 1, + Name = "Tony", + Phone = "13999999999" + }); + } + ``` + +2. Set up multiple documents: + +2.1 Use the default model (key-value model): + + ``` C# + public async Task SetAsync([FromServices] IAutoCompleteClient client) + { + await client.SetAsync(new AutoCompleteDocument[] + { + new("Edward Adam Davis", 1), + new("Edward Jim", 1) + }); + } + ``` + +2.2 Using a custom model + + ``` C# + public async Task SetAsync([FromServices] IAutoCompleteClient client) + { + await client.SetBySpecifyDocumentAsync(new User[] + { + new() + { + Id = 1, + Name = "Jim", + Phone = "13999999999" + }, + new() + { + Id = 2, + Name = "Tony", + Phone = "13888888888" + } + }); + } + ``` + +##### Get data (GetAsync) + +1. Search by keyword: + +1.1 Use the default model (key-value model): + + ``` C# + public async Task GetAsync([FromServices] IAutoCompleteClient client) + { + var response = await client.GetAsync("Edward Adam Davis"); + return System.Text.Json.JsonSerializer.Serialize(response); + } + ``` + +1.2 Using a custom model + + ``` + public async Task GetAsync([FromServices] IAutoCompleteClient client) + { + var response = await client.GetBySpecifyDocumentAsync("Tony"); + return System.Text.Json.JsonSerializer.Serialize(response); + } + ``` + +##### Delete document (DeleteAsync) + +1. To delete a single document: + + ```` C# + public async Task DeleteAsync([FromServices] IAutoCompleteClient client) + { + var response = await client.DeleteAsync(1); + return System.Text.Json.JsonSerializer.Serialize(response); + } + ```` + +2. To delete multiple documents: + + ```` C# + public async Task DeleteAsync([FromServices] IAutoCompleteClient client) + { + var response = await client.DeleteAsync(new long[] { 1, 2 }); + return System.Text.Json.JsonSerializer.Serialize(response); + } + ```` + +Plugins that need to be added by default: + +> https://github.com/medcl/elasticsearch-analysis-ik +> +> https://github.com/medcl/elasticsearch-analysis-pinyin + +## FAQ + +1. The error message is: `"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` + + We enable the compatibility mode by default, namely `EnableApiVersioningHeader(true)`, which supports the 8.* version very well, but will cause errors in some 7.*, in this case, you need to manually turn off the compatibility mode, that is, `EnableApiVersioningHeader(false)`. + + ```` C# + service.AddElasticsearchClient("es", option => + { + option.UseNodes("http://localhost:9200") + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); + }); + ```` + +[Why turn on compatibility mode? ](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md new file mode 100644 index 000000000..0e05d2e20 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/README.zh-CN.md @@ -0,0 +1,186 @@ +中 | [EN](README.md) + +## AutoComplete.ElasticSearch + +用例: + +```c# +Install-Package Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch +``` + +基本用法: + +使用AutoComplete + +* 使用默认模型`AutoCompleteDocument`,其中TValue仅支持简单类型 + +``` C# +string userIndexName = "user_index_01"; +string userAlias = "user_index"; +builder.Services + .AddElasticsearchClient("es", option => option.UseNodes("http://localhost:9200").UseDefault()) + .AddAutoComplete(option => option.UseIndexName(userIndexName).UseAlias(userAlias)); +``` + +* 使用自定义模型,例如: `UserDocument` + +``` C# +string userIndexName = "user_index_01"; +string userAlias = "user_index"; +builder.Services + .AddElasticsearchClient("es", option => option.UseNodes("http://localhost:9200").UseDefault()) + .AddAutoCompleteBySpecifyDocument(option => option.UseIndexName(userIndexName).UseAlias(userAlias)); + +public class User : AutoCompleteDocument +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string Phone { get; set; } + + protected override string GetText() + { + return $"{Name}:{Phone}"; + } + + /// + /// 如果希望id是唯一标识 + /// + /// + public override string GetDocumentId() => Id.ToString(); +} +``` + +##### 设置数据 (SetAsync) + +1. 设置单个文档: + +1.1. 使用默认模型(键值模型): + + ``` C# + public async Task SetAsync([FromServices] IAutoCompleteClient client) + { + await client.SetAsync(new AutoCompleteDocument("Edward Adam Davis", 1)); + } + ``` + +1.2 使用自定义模型 + + ``` C# + public async Task SetAsync([FromServices] IAutoCompleteClient client) + { + await client.SetBySpecifyDocumentAsync(new User + { + Id = 1, + Name = "托尼", + Phone = "13999999999" + }); + } + ``` + +2. 设置多个文档: + +2.1 使用默认模型(键值模型): + + ``` C# + public async Task SetAsync([FromServices] IAutoCompleteClient client) + { + await client.SetAsync(new AutoCompleteDocument[] + { + new("Edward Adam Davis", 1), + new("Edward Jim", 1) + }); + } + ``` + +2.2 使用自定义模型 + + ``` C# + public async Task SetAsync([FromServices] IAutoCompleteClient client) + { + await client.SetBySpecifyDocumentAsync(new User[] + { + new() + { + Id = 1, + Name = "吉姆", + Phone = "13999999999" + }, + new() + { + Id = 2, + Name = "托尼", + Phone = "13888888888" + } + }); + } + ``` + +##### 获取数据 (GetAsync) + +1. 根据关键字搜索: + +1.1 使用默认模型(键值模型): + + ``` C# + public async Task GetAsync([FromServices] IAutoCompleteClient client) + { + var response = await client.GetAsync("Edward Adam Davis"); + return System.Text.Json.JsonSerializer.Serialize(response); + } + ``` + +1.2 使用自定义模型 + + ``` + public async Task GetAsync([FromServices] IAutoCompleteClient client) + { + var response = await client.GetBySpecifyDocumentAsync("托尼"); + return System.Text.Json.JsonSerializer.Serialize(response); + } + ``` + +##### 删除文档 (DeleteAsync) + +1. 删除单个文档: + + ``` C# + public async Task DeleteAsync([FromServices] IAutoCompleteClient client) + { + var response = await client.DeleteAsync(1); + return System.Text.Json.JsonSerializer.Serialize(response); + } + ``` + +2. 删除多个文档: + + ``` C# + public async Task DeleteAsync([FromServices] IAutoCompleteClient client) + { + var response = await client.DeleteAsync(new long[] { 1, 2 }); + return System.Text.Json.JsonSerializer.Serialize(response); + } + ``` + +默认需要添加的插件: + +> https://github.com/medcl/elasticsearch-analysis-ik +> +> https://github.com/medcl/elasticsearch-analysis-pinyin + +## 常见问题 + +1. 出错提示为:`"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` + + 我们默认启用兼容模式,即`EnableApiVersioningHeader(true)`,这样对8.*版本支持很好,但在部分7.*会导致错误,此时需要手动关闭兼容模式,即`EnableApiVersioningHeader(false)`。 + + ``` C# + service.AddElasticsearchClient("es", option => + { + option.UseNodes("http://localhost:9200") + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); + }); + ``` + +[为何开启兼容模式?](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..d3273e6b7 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/ServiceCollectionExtensions.cs @@ -0,0 +1,201 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static MasaElasticsearchBuilder AddAutoComplete(this MasaElasticsearchBuilder builder) + => builder.AddAutoComplete(); + + public static MasaElasticsearchBuilder AddAutoComplete( + this MasaElasticsearchBuilder builder) where TValue : notnull + { + var indexName = builder.ElasticClient.ConnectionSettings.DefaultIndex; + if (string.IsNullOrEmpty(indexName)) + throw new ArgumentNullException( + nameof(builder.ElasticClient.ConnectionSettings.DefaultIndex), + "The default IndexName is not set"); + + return builder.AddAutoComplete>(option => option.UseIndexName(indexName)); + } + + public static MasaElasticsearchBuilder AddAutoComplete(this MasaElasticsearchBuilder builder, + Action>>? action) + => builder.AddAutoComplete(action); + + public static MasaElasticsearchBuilder AddAutoComplete( + this MasaElasticsearchBuilder builder, + Action>>? action) where TValue : notnull + { + if (typeof(TValue).IsClass) + throw new ArgumentException($"TValue does not support Class, please use AddAutoCompleteBySpecifyDocument"); + + AutoCompleteOptions> options = new AutoCompleteOptions>(); + action?.Invoke(options); + builder.Services.AddAutoCompleteCore(builder.ElasticClient, builder.Client, options); + return builder; + } + + [Obsolete($"{nameof(AddAutoComplete)} expired, please use {nameof(AddAutoCompleteBySpecifyDocument)}")] + public static MasaElasticsearchBuilder AddAutoComplete( + this MasaElasticsearchBuilder builder) + where TDocument : AutoCompleteDocument + where TValue : notnull + => builder.AddAutoCompleteBySpecifyDocument(); + + [Obsolete($"{nameof(AddAutoComplete)} expired, please use {nameof(AddAutoCompleteBySpecifyDocument)}")] + public static MasaElasticsearchBuilder AddAutoComplete( + this MasaElasticsearchBuilder builder, + Action>? action) + where TDocument : AutoCompleteDocument + where TValue : notnull + => builder.AddAutoCompleteBySpecifyDocument(action); + + public static MasaElasticsearchBuilder AddAutoCompleteBySpecifyDocument( + this MasaElasticsearchBuilder builder) + where TDocument : AutoCompleteDocument + { + var indexName = builder.ElasticClient.ConnectionSettings.DefaultIndex; + if (string.IsNullOrEmpty(indexName)) + throw new ArgumentNullException( + nameof(builder.ElasticClient.ConnectionSettings.DefaultIndex), + "The default IndexName is not set"); + + return builder.AddAutoCompleteBySpecifyDocument(option => option.UseIndexName(indexName)); + } + + public static MasaElasticsearchBuilder AddAutoCompleteBySpecifyDocument( + this MasaElasticsearchBuilder builder, + Action>? action) + where TDocument : AutoCompleteDocument + { + AutoCompleteOptions options = new AutoCompleteOptions(); + action?.Invoke(options); + builder.Services.AddAutoCompleteCore(builder.ElasticClient, builder.Client, options); + return builder; + } + + private static void AddAutoCompleteCore(this IServiceCollection services, + IElasticClient elasticClient, + IMasaElasticClient client, + AutoCompleteOptions option) + where TDocument : AutoCompleteDocument + { + ArgumentNullException.ThrowIfNull(services); + + ArgumentNullException.ThrowIfNull(option.IndexName, nameof(option.IndexName)); + + services.TryAddSingleton(new AutoCompleteRelationsOptions()); + + var autoCompleteRelations = new AutoCompleteRelations( + elasticClient, + client, + option.IndexName, + option.Alias, + option.IsDefault, + option.DefaultOperator, + option.DefaultSearchType, + option.EnableMultipleCondition); + services.TryAddAutoCompleteRelation(autoCompleteRelations); + + services.TryAddSingleton(); + services.TryAddSingleton(serviceProvider => serviceProvider.GetRequiredService().CreateClient()); + client.TryCreateIndexAsync(services.BuildServiceProvider().GetService>(), option); + } + + private static void TryAddAutoCompleteRelation(this IServiceCollection services, AutoCompleteRelations relation) + { + var serviceProvider = services.BuildServiceProvider(); + var relationsOptions = serviceProvider.GetRequiredService(); + + if (relationsOptions.Relations.Any(r => r.Alias == relation.Alias || r.IndexName == relation.IndexName)) + throw new ArgumentException($"indexName or alias exists"); + + if (relation.IsDefault && relationsOptions.Relations.Any(r => r.IsDefault)) + throw new ArgumentException("ElasticClient can only have one default", nameof(ElasticsearchRelations.IsDefault)); + + relationsOptions.AddRelation(relation); + } + + private static void TryCreateIndexAsync( + this IMasaElasticClient client, + ILogger? logger, + AutoCompleteOptions option) + where TDocument : AutoCompleteDocument + { + IAliases? aliases = null; + if (option.Alias != null) + { + aliases = new Aliases(); + aliases.Add(option.Alias, new Alias()); + } + + var existsResponse = client.IndexExistAsync(option.IndexName, CancellationToken.None).ConfigureAwait(false).GetAwaiter() + .GetResult(); + if (!existsResponse.IsValid || existsResponse.Exists) + { + if (!existsResponse.IsValid) + logger?.LogError("AutoComplete: Initialization index is abnormal, {Message}", existsResponse.Message); + + return; + } + + client.CreateIndex(logger, option.IndexName, aliases, option); + } + + private static void CreateIndex( + this IMasaElasticClient client, + ILogger? logger, + string indexName, + IAliases? aliases, + AutoCompleteOptions option) + where TDocument : AutoCompleteDocument + { + IAnalysis analysis = new AnalysisDescriptor(); + analysis.Analyzers = new Analyzers(); + analysis.TokenFilters = new TokenFilters(); + IIndexSettings indexSettings = new IndexSettings() + { + Analysis = analysis + }; + string analyzer = "ik_max_word_pinyin"; + if (option.IndexSettingAction != null) + option.IndexSettingAction.Invoke(indexSettings); + else + { + string pinyinFilter = "pinyin"; + string wordDelimiterFilter = "word_delimiter"; + indexSettings.Analysis.Analyzers.Add(analyzer, new CustomAnalyzer() + { + Filter = new[] { pinyinFilter, wordDelimiterFilter, "lowercase" }, + Tokenizer = "ik_max_word" + }); + indexSettings.Analysis.TokenFilters.Add(pinyinFilter, new PinYinTokenFilterDescriptor()); + } + + TypeMappingDescriptor mapping = new TypeMappingDescriptor(); + if (option.Action != null) + option.Action.Invoke(mapping); + else + { + mapping = mapping + .AutoMap() + .Properties(ps => + ps.Text(s => + s.Name(n => n.Text) + .Analyzer(analyzer) + ) + ); + } + + var createIndexResponse = client.CreateIndexAsync(indexName, new CreateIndexOptions() + { + Aliases = aliases, + Mappings = mapping, + IndexSettings = indexSettings + }).ConfigureAwait(false).GetAwaiter().GetResult(); + if (!createIndexResponse.IsValid) + logger?.LogError("AutoComplete: Initialization index is abnormal, {Message}", createIndexResponse.Message); + } +} diff --git a/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs new file mode 100644 index 000000000..0b99cb8a5 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch/_Imports.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.SearchEngine.AutoComplete; +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Response; +global using Masa.Contrib.SearchEngine.AutoComplete; +global using Masa.Contrib.SearchEngine.AutoComplete.Options; +global using Masa.Utils.Data.Elasticsearch; +global using Masa.Utils.Data.Elasticsearch.Analysis.TokenFilters; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Create; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Delete; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Query; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Set; +global using Masa.Utils.Data.Elasticsearch.Options.Index; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Nest; +global using DeleteResponse = Masa.BuildingBlocks.SearchEngine.AutoComplete.Response.DeleteResponse; diff --git a/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs new file mode 100644 index 000000000..2844fe306 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs @@ -0,0 +1,679 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests; + +[TestClass] +public class AutoCompleteTest +{ + private IServiceCollection _services; + + [TestInitialize] + public void Initialize() + { + _services = new ServiceCollection(); + } + + [TestMethod] + public void TestAddAutoCompleteAndNoIndexName() + { + var builder = _services.AddElasticsearchClient(); + Assert.ThrowsException(() + => builder.AddAutoComplete(option => option.UseDefaultSearchType(SearchType.Precise).UseDefaultOperator(Operator.And))); + } + + [TestMethod] + public void TestAddAutoComplete() + { + _services.AddElasticsearchClient("es", option => + { + option.UseConnectionSettings(setting => + { + setting.EnableApiVersioningHeader(false); + setting.DefaultIndex("user_index"); + }); + }).AddAutoComplete(option + => option.UseIndexName("user_index").UseDefaultSearchType(SearchType.Precise).UseDefaultOperator(Operator.And)); + var serviceProvider = _services.BuildServiceProvider(); + var autoCompleteClient = serviceProvider.GetService(); + Assert.IsNotNull(autoCompleteClient); + + var autoCompleteFactory = serviceProvider.GetService(); + Assert.IsNotNull(autoCompleteFactory); + + var autoCompleteClient2 = autoCompleteFactory.CreateClient(); + Assert.IsNotNull(autoCompleteClient2); + + var elasticClientField = typeof(AutoCompleteClient).GetField("_elasticClient", BindingFlags.Instance | BindingFlags.NonPublic)!; + Assert.IsTrue(elasticClientField.GetValue(autoCompleteClient) == elasticClientField.GetValue(autoCompleteClient2)); + } + + [TestMethod] + public void TestAddMultiAutoComplete() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services + .AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))) + .AddAutoComplete(option + => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And)); + Assert.ThrowsException(() => builder.AddAutoComplete(option + => option.UseIndexName(userIndexName).UseDefaultSearchType(SearchType.Precise).UseDefaultOperator(Operator.And))); + } + + [TestMethod] + public void TestAddMultiDefaultAutoComplete() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services + .AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))) + .AddAutoComplete(option + => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefault().UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And)); + Assert.ThrowsException(() + => builder.AddAutoComplete(option + => option.UseIndexName("employee_index").UseDefault().UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And))); + } + + [TestMethod] + public async Task TestGetAsync() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services + .AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + + await builder.Client.DeleteIndexByAliasAsync(userAlias); + + builder.AddAutoComplete(option + => option.UseIndexName(userIndexName) + .UseAlias(userAlias) + .UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And)); + + var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); + var autoCompleteClient = autoCompleteFactory.CreateClient(userIndexName); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new("张三", 1), + new("李四", 2), + new("张丽", 3) + }); + + Thread.Sleep(1000); + + var response = await autoCompleteClient.GetAsync("张三"); + Assert.IsTrue(response.IsValid && response.Total == 1); + + response = await autoCompleteClient.GetAsync("三"); + Assert.IsTrue(response.IsValid && response.Total == 1); + + response = await autoCompleteClient.GetAsync("zs"); + Assert.IsTrue(response.IsValid && response.Total == 1); + + response = await autoCompleteClient.GetAsync("zhang"); + Assert.IsTrue(response.IsValid && response.Total == 2); + + response = await autoCompleteClient.GetAsync("li"); + Assert.IsTrue(response.IsValid && response.Total == 2); + + response = await autoCompleteClient.GetAsync("si", new AutoCompleteOptions(SearchType.Fuzzy)); + Assert.IsTrue(response.IsValid && response.Total == 1); + + response = await autoCompleteClient.GetAsync("zhang", new AutoCompleteOptions(SearchType.Fuzzy)); + Assert.IsTrue(response.IsValid && response.Total == 2); + + response = await autoCompleteClient.GetAsync("", new AutoCompleteOptions(SearchType.Fuzzy)); + Assert.IsTrue(response.IsValid && response.Total == 0); + } + + [TestMethod] + public async Task TestMultiConditionsAsyncReturnTotalIs2() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services + .AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + + await builder.Client.DeleteIndexByAliasAsync(userAlias); + + builder.AddAutoComplete(option + => option.UseIndexName(userIndexName) + .UseAlias(userAlias)); + + var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); + var autoCompleteClient = autoCompleteFactory.CreateClient(userIndexName); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new("张三", 1), + new("张丽", 2), + new("李四", 3) + }); + + Thread.Sleep(1000); + + var response = await autoCompleteClient.GetAsync("张三 ls"); + Assert.IsTrue(response.Total == 3); + Assert.IsTrue(response.Data[0].Value == 1); + Assert.IsTrue(response.Data[1].Value == 3); + Assert.IsTrue(response.Data[2].Value == 2); + + await builder.Client.DeleteIndexByAliasAsync(userAlias); + } + + + [TestMethod] + public async Task TestMultiConditionsAsyncReturnTotalIs1() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services + .AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + + await builder.Client.DeleteIndexByAliasAsync(userAlias); + + builder.AddAutoComplete(option + => option.UseIndexName(userIndexName) + .UseAlias(userAlias) + .UseDefaultOperator(Operator.And)); + + var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); + var autoCompleteClient = autoCompleteFactory.CreateClient(userIndexName); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new("张三", 1), + new("李四", 2), + new("张丽", 3) + }); + + Thread.Sleep(1000); + + var response = await autoCompleteClient.GetAsync("张 li"); + Assert.IsTrue(response.Total == 1); + Assert.IsTrue(response.Data[0].Value == 3); + + await builder.Client.DeleteIndexByAliasAsync(userAlias); + } + + [TestMethod] + public async Task TestDisableMultiConditionsAsyncReturnTotalIs0() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services + .AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + + await builder.Client.DeleteIndexByAliasAsync(userAlias); + + builder.AddAutoComplete(option + => option.UseIndexName(userIndexName) + .UseAlias(userAlias) + .UseDefaultOperator(Operator.And) + .UseMultipleConditions(false)); + + var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); + var autoCompleteClient = autoCompleteFactory.CreateClient(userIndexName); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new("张三", 1), + new("李四", 2), + new("张丽", 3), + new("唐伯虎", 4), + }); + + Thread.Sleep(1000); + + var response = await autoCompleteClient.GetAsync("唐 虎"); + Assert.IsTrue(response.Total == 0); + + var response2 = await autoCompleteClient.GetAsync("唐"); + Assert.IsTrue(response2.Total == 1); + + var response3 = await autoCompleteClient.GetAsync("zs"); + Assert.IsTrue(response3.Total == 1); + + var response4 = await autoCompleteClient.GetAsync("tang"); + Assert.IsTrue(response4.Total == 1); + + await builder.Client.DeleteIndexByAliasAsync(userAlias); + } + + [TestMethod] + public async Task TestCustomModelAsync() + { + string employeeIndexName = $"employee_index_{Guid.NewGuid()}"; + string employeeAlias = $"employee_index_{Guid.NewGuid()}"; + var builder = _services.AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + + await builder.Client.DeleteIndexByAliasAsync(employeeAlias); + + string analyzer = "ik_max_word_pinyin"; + builder.AddAutoCompleteBySpecifyDocument(option => option + .UseIndexName(employeeIndexName) + .UseAlias(employeeAlias) + .UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And) + .Mapping(descriptor => + { + descriptor.AutoMap() + .Properties(ps => + ps.Text(s => + s.Name(n => n.Text) + .Analyzer(analyzer) + ) + ) + .Properties(ps => + ps.Text(s => + s.Name(n => n.Phone) + .Analyzer(analyzer) + ) + ) + .Properties(ps => + ps.Text(s => + s.Name(n => n.Name) + .Analyzer(analyzer) + ) + ); + })); + + var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); + var employeeClient = autoCompleteFactory.CreateClient(employeeAlias); + await employeeClient.SetBySpecifyDocumentAsync(new Employee[] + { + new() + { + Name = "吉姆", + Id = 1, + Phone = "13999999999" + }, + new() + { + Name = "托尼", + Id = 2, + Phone = "13888888888" + } + }); + + Thread.Sleep(1000); + + var employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("吉姆"); + Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 1); + + employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("139"); + Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 0); + + employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("139*", new AutoCompleteOptions(SearchType.Fuzzy) + { + Field = "phone" + }); + Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 1); + + employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("*", new AutoCompleteOptions(SearchType.Fuzzy)); + Assert.IsTrue(employeeResponse.Data.All(employee => employee.Phone == "13999999999" || employee.Phone == "13888888888")); + + await employeeClient.SetBySpecifyDocumentAsync(new Employee + { + Name = "吉姆", + Id = 1, + Phone = "13777777777" + }); + + Thread.Sleep(1000); + + employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("*", new AutoCompleteOptions(SearchType.Fuzzy)); + Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 2); + Assert.IsTrue(employeeResponse.Data.Any(employee => employee.Phone == "13777777777")); + + await employeeClient.SetBySpecifyDocumentAsync(new Employee + { + Name = "吉姆", + Id = 1, + Phone = "13999999999" + }, new SetOptions() + { + IsOverride = false + }); + + Thread.Sleep(1000); + + employeeResponse = await employeeClient.GetBySpecifyDocumentAsync("*", new AutoCompleteOptions(SearchType.Fuzzy)); + Assert.IsTrue(employeeResponse.Data.Any(employee => employee.Phone == "13777777777")); + } + + [TestMethod] + public async Task TestPreciseAsync() + { + string employeeIndexName = $"employee_index_{Guid.NewGuid()}"; + string employeeAlias = $"employee_index_{Guid.NewGuid()}"; + var builder = _services.AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + + await builder.Client.DeleteIndexByAliasAsync(employeeAlias); + builder.AddAutoComplete(option => option + .UseIndexName(employeeIndexName) + .UseAlias(employeeAlias) + .UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And)); + + var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); + var employeeClient = autoCompleteFactory.CreateClient(employeeAlias); + var res = await employeeClient.SetAsync(new[] + { + new Employee() + { + Name = "吉姆", + Id = 1, + Phone = "13999999999" + }, + new Employee() + { + Name = "托尼", + Id = 2, + Phone = "13888888888" + } + }); + + Thread.Sleep(1000); + + var employeeResponse = await employeeClient.GetAsync("ji*", new(SearchType.Fuzzy)); + Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 1); + + employeeResponse = await employeeClient.GetAsync("13999999999", new() + { + Field = "phone" + }); + Assert.IsTrue(employeeResponse.IsValid && employeeResponse.Total == 1 && + employeeResponse.Data.Any(employee => employee.Id == 1)); + } + + [TestMethod] + public async Task TestOperatorAndAsync() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services + .AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))) + .AddAutoComplete(option => + option.UseIndexName(userIndexName) + .UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise).UseDefaultOperator(Operator.And)); + + await builder.Client.ClearDocumentAsync(userAlias); + + var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); + var autoCompleteClient = autoCompleteFactory.CreateClient(userAlias); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new() + { + Text = "Edward Adam Davis", + Value = 1 + }, + new() + { + Text = "Edward Jim", + Value = 2 + } + }); + + Thread.Sleep(1000); + + var response = await autoCompleteClient.GetAsync("Edward Adam Davis"); + Assert.IsTrue(response.IsValid && response.Total == 1); + } + + [TestMethod] + public async Task TestOperatorOrAsync() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services + .AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + + await builder.Client.DeleteIndexAsync(userIndexName); + + builder.AddAutoComplete(option => + option.UseIndexName(userIndexName) + .UseAlias(userAlias) + .UseDefaultOperator(Operator.Or) + .UseDefaultSearchType(SearchType.Precise)); + + var autoCompleteFactory = builder.Services.BuildServiceProvider().GetRequiredService(); + var autoCompleteClient = autoCompleteFactory.CreateClient(userAlias); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new() + { + Text = "Edward Adam Davis", + Value = 1 + }, + new() + { + Text = "Edward Jim", + Value = 2 + } + }); + + Thread.Sleep(1000); + + var response = await autoCompleteClient.GetAsync("Edward Adam Davis", new(SearchType.Fuzzy)); + Assert.IsTrue(response.IsValid && response.Total == 2); + } + + [TestMethod] + public void TestNullIndexName() + { + var builder = _services.AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + + string analyzer = "ik_max_word_pinyin"; + + Assert.ThrowsException(() => builder.AddAutoCompleteBySpecifyDocument(option => option + .UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And) + .Mapping(descriptor => + { + descriptor.AutoMap() + .Properties(ps => + ps.Text(s => + s.Name(n => n.Text) + .Analyzer(analyzer) + ) + ) + .Properties(ps => + ps.Text(s => + s.Name(n => n.Phone) + .Analyzer(analyzer) + ) + ); + }))); + } + + [TestMethod] + public async Task DeleteAsyncReturnDocumentIsNotExist() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + var builder = _services.AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + await builder.Client.DeleteIndexAsync(userIndexName); + + builder.AddAutoComplete(option + => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And)); + var serviceProvider = builder.Services.BuildServiceProvider(); + var autoCompleteClient = serviceProvider.GetRequiredService(); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new() + { + Text = "张三", + Value = 1 + }, + new() + { + Text = "李四", + Value = 2 + } + }); + Thread.Sleep(1000); + + var response = await autoCompleteClient.DeleteAsync(10); + Assert.IsTrue(!response.IsValid); + } + + [TestMethod] + public async Task DeleteAsyncReturnDeleteSuccess() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + var builder = _services.AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + await builder.Client.DeleteIndexAsync(userIndexName); + + builder.AddAutoComplete(option + => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And)); + var serviceProvider = builder.Services.BuildServiceProvider(); + var autoCompleteClient = serviceProvider.GetRequiredService(); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new() + { + Text = "张三", + Value = 1 + }, + new() + { + Text = "李四", + Value = 2 + } + }); + Thread.Sleep(1000); + + var response = await autoCompleteClient.DeleteAsync(1); + Assert.IsTrue(response.IsValid); + } + + [TestMethod] + public async Task DeleteUserReturnEmpty() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services.AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + await builder.Client.DeleteIndexAsync(userIndexName); + + builder.AddAutoComplete(option + => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And)); + var serviceProvider = builder.Services.BuildServiceProvider(); + var autoCompleteClient = serviceProvider.GetRequiredService(); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new() + { + Text = "张三", + Value = 1 + }, + new() + { + Text = "李四", + Value = 2 + } + }); + + Thread.Sleep(1000); + + var getResponse = await autoCompleteClient.GetAsync("张三"); + Assert.IsTrue(getResponse.IsValid && getResponse.Total == 1); + + var deleteResponse = await autoCompleteClient.DeleteAsync(new[] { 1 }); + Assert.IsTrue(deleteResponse.IsValid); + + Thread.Sleep(1000); + + getResponse = await autoCompleteClient.GetAsync("张三"); + Assert.IsTrue(getResponse.IsValid && getResponse.Total == 0); + } + + [TestMethod] + public async Task DeleteMultiUserReturnEmpty() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string userAlias = $"user_index_{Guid.NewGuid()}"; + + var builder = _services.AddElasticsearchClient("es", + option => option.UseNodes("http://localhost:9200").UseDefault() + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false))); + await builder.Client.DeleteIndexAsync(userIndexName); + + builder.AddAutoComplete(option + => option.UseIndexName(userIndexName).UseAlias(userAlias).UseDefaultSearchType(SearchType.Precise) + .UseDefaultOperator(Operator.And)); + var serviceProvider = builder.Services.BuildServiceProvider(); + var autoCompleteClient = serviceProvider.GetRequiredService(); + await autoCompleteClient.SetAsync(new AutoCompleteDocument[] + { + new() + { + Text = "张三", + Value = 1 + }, + new() + { + Text = "李四", + Value = 2 + } + }); + + Thread.Sleep(1000); + + var getResponse = await autoCompleteClient.GetAsync("张三"); + Assert.IsTrue(getResponse.IsValid && getResponse.Total == 1); + + getResponse = await autoCompleteClient.GetAsync("李四"); + Assert.IsTrue(getResponse.IsValid && getResponse.Total == 1); + + var deleteMultiResponse = await autoCompleteClient.DeleteAsync(new List() { 1, 2, 3 }); + Assert.IsTrue(deleteMultiResponse.IsValid && + deleteMultiResponse.Data.Count == 3 && + deleteMultiResponse.Data.Count(r => r.IsValid) == 2); //todo: Masa.Utils.Data.Elasticsearch response information error + + Thread.Sleep(1000); + + getResponse = await autoCompleteClient.GetAsync("张三"); + Assert.IsTrue(getResponse.IsValid && getResponse.Total == 0); + } +} diff --git a/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj new file mode 100644 index 000000000..ed41a78ff --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.csproj @@ -0,0 +1,29 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs new file mode 100644 index 000000000..252a2fc77 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/Model/Employee.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.Model; + +public class Employee : AutoCompleteDocument +{ + public int Id { get; set; } + + public string Name { get; set; } + + public string Phone { get; set; } + + protected override string GetText() => Name; + + public override string GetDocumentId() => Id.ToString(); +} diff --git a/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs new file mode 100644 index 000000000..0c4931e22 --- /dev/null +++ b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.SearchEngine.AutoComplete; +global using Masa.BuildingBlocks.SearchEngine.AutoComplete.Options; +global using Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests.Model; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Nest; +global using System.Reflection; diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs new file mode 100644 index 000000000..b8ec0057a --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/CallerOptionsExtensions.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.DaprClient; + +public static class CallerOptionsExtensions +{ + public static DefaultDaprClientBuilder UseDapr(this CallerOptions callerOptions, Func clientBuilder) + { + if (clientBuilder == null) + throw new ArgumentNullException(nameof(clientBuilder)); + + MasaDaprClientBuilder builder = clientBuilder.Invoke(); + if (clientBuilder == null) + throw new ArgumentNullException(nameof(clientBuilder)); + + callerOptions.Services.AddDaprClient(daprClientBuilder => + { + if (callerOptions.JsonSerializerOptions != null) + daprClientBuilder.UseJsonSerializationOptions(callerOptions.JsonSerializerOptions); + + builder.Configure?.Invoke(daprClientBuilder); + }); + + AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, + serviceProvider => new DaprCaller(serviceProvider, builder.Name, builder.AppId)); + return new DefaultDaprClientBuilder(callerOptions.Services, builder.Name); + } + + public static DefaultDaprClientBuilder UseDapr(this CallerOptions callerOptions, Action clientBuilder) + { + if (clientBuilder == null) + throw new ArgumentNullException(nameof(clientBuilder)); + + MasaDaprClientBuilder builder = new MasaDaprClientBuilder(); + clientBuilder.Invoke(builder); + + return callerOptions.UseDapr(() => builder); + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs new file mode 100644 index 000000000..41feb8b4f --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCaller.cs @@ -0,0 +1,91 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.DaprClient; + +public class DaprCaller : AbstractCaller +{ + private Dapr.Client.DaprClient? _daprClient; + private Dapr.Client.DaprClient DaprClient => _daprClient ??= ServiceProvider.GetRequiredService(); + private readonly CallerDaprClientOptions _callerDaprClientOptions; + protected readonly string AppId; + + public DaprCaller(IServiceProvider serviceProvider, string name, string appId) + : base(serviceProvider) + { + var optionsFactory = serviceProvider.GetRequiredService>(); + _callerDaprClientOptions = optionsFactory.Create(name); + AppId = appId; + } + + public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + where TResponse : default + { + var response = await DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); + return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + } + + public override async Task CreateRequestAsync(HttpMethod method, string? methodName) + { + var httpRequestMessage = + await RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName)); + + DealRequestMessage(Action); + + return httpRequestMessage; + + async void Action(IDaprRequestMessage requestMessage) + { + await requestMessage.ProcessHttpRequestMessageAsync(httpRequestMessage); + } + } + + public override async Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) + { + var httpRequestMessage = + await RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName), data); + + DealRequestMessage(Action); + + return httpRequestMessage; + + async void Action(IDaprRequestMessage requestMessage) + { + await requestMessage.ProcessHttpRequestMessageAsync(httpRequestMessage); + } + } + + private void DealRequestMessage(Action action) + { + foreach (var httpRequestMessageAction in _callerDaprClientOptions.HttpRequestMessageActions) + { + MasaHttpMessageHandlerBuilder masaHttpMessageHandlerBuilder = new MasaHttpMessageHandlerBuilder(ServiceProvider); + httpRequestMessageAction.Invoke(masaHttpMessageHandlerBuilder); + + foreach (var requestMessage in masaHttpMessageHandlerBuilder.RequestMessages) + { + action.Invoke(requestMessage); + } + } + } + + public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + { + return await DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); + } + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); + + public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, request, cancellationToken); + + public override Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs new file mode 100644 index 000000000..5c271fb4d --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DaprCallerBase.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.DaprClient; + +public abstract class DaprCallerBase : CallerBase +{ + protected abstract string AppId { get; set; } + + public virtual Action? Configure { get; set; } = null; + + protected DaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public override void UseCallerExtension() => UseDapr(); + + protected virtual DefaultDaprClientBuilder UseDapr() + { + CallerOptions.UseDapr(opt => + { + opt.Name = Name; + opt.AppId = AppId; + if (Configure != null) + { + opt.Configure = Configure; + } + }); + return new DefaultDaprClientBuilder(CallerOptions.Services, Name); + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs new file mode 100644 index 000000000..562cd81af --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/DefaultDaprClientBuilder.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.DaprClient; + +public class DefaultDaprClientBuilder +{ + public IServiceCollection Services { get; private set; } + + public string Name { get; private set; } + + public DefaultDaprClientBuilder(IServiceCollection services, string name) + { + Services = services; + Name = name; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs new file mode 100644 index 000000000..6f49049ad --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/HttpMessageHandlerBuilder.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.DaprClient; + +public class MasaHttpMessageHandlerBuilder +{ + public IList RequestMessages { get; } = new List(); + + public virtual IServiceProvider ServiceProvider { get; } + + public MasaHttpMessageHandlerBuilder(IServiceProvider serviceProvider) + => ServiceProvider = serviceProvider; +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs new file mode 100644 index 000000000..2ebec9009 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/IDaprRequestMessage.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.DaprClient; + +public interface IDaprRequestMessage +{ + Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage); +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj new file mode 100644 index 000000000..66ed078a9 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Masa.Contrib.Service.Caller.DaprClient.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs new file mode 100644 index 000000000..e06b48a26 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilder.cs @@ -0,0 +1,70 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.DaprClient; + +public class MasaDaprClientBuilder +{ + private string _appId = default!; + + public string AppId + { + get + { + return _appId; + } + set + { + if (string.IsNullOrEmpty(value)) + throw new ArgumentNullException(nameof(AppId)); + + _appId = value; + } + } + + private string _name = default!; + + public string Name + { + get + { + return _name; + } + set + { + if (value is null) + throw new ArgumentNullException(nameof(Name)); + + _name = value; + } + } + + public bool IsDefault { get; set; } = false; + + public Action? Configure { get; set; } + + internal MasaDaprClientBuilder() + { + this.Name = string.Empty; + } + + public MasaDaprClientBuilder(string appid) + : this(appid, "dapr") { } + + public MasaDaprClientBuilder(string appid, string name) + : this(appid, name, null) + { + } + + public MasaDaprClientBuilder(string appid, string name, Action? configure) : this(appid, name, configure, false) + { + } + + public MasaDaprClientBuilder(string appid, string name, Action? configure, bool isDefault) + { + AppId = appid; + Name = name; + Configure = configure; + IsDefault = isDefault; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs new file mode 100644 index 000000000..ad91b3a03 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/MasaDaprClientBuilderExtensions.cs @@ -0,0 +1,48 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.DaprClient; + +public static class MasaDaprClientBuilderExtensions +{ + public static DefaultDaprClientBuilder AddHttpRequestMessage( + this DefaultDaprClientBuilder builder) + where TRequestMessage : class, IDaprRequestMessage + { + ArgumentNullException.ThrowIfNull(builder); + + builder.Services.TryAddEnumerable(new ServiceDescriptor( + typeof(IDaprRequestMessage), + typeof(TRequestMessage), + ServiceLifetime.Singleton)); + + builder.Services.Configure(builder.Name, option => + { + option.HttpRequestMessageActions.Add(b + => b.RequestMessages.Add( + b.ServiceProvider + .GetServices() + .FirstOrDefault(d => d.GetType() == typeof(TRequestMessage))!)); + }); + return builder; + } + + public static IHttpClientBuilder AddHttpRequestMessage( + this IHttpClientBuilder builder, + Func configureHandler) + where TRequestMessage : class, IDaprRequestMessage + { + ArgumentNullException.ThrowIfNull(nameof(builder)); + + ArgumentNullException.ThrowIfNull(configureHandler); + + builder.Services.TryAddEnumerable(new ServiceDescriptor(typeof(IDaprRequestMessage), configureHandler, ServiceLifetime.Singleton)); + + builder.Services.Configure(builder.Name, options => + { + options.HttpRequestMessageActions.Add(b => b.RequestMessages.Add(configureHandler.Invoke(b.ServiceProvider))); + }); + + return builder; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs new file mode 100644 index 000000000..a8c890bbb --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/Options/CallerDaprClientOptions.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.DaprClient.Options; + +public class CallerDaprClientOptions +{ + public IList> HttpRequestMessageActions { get; } = new List>(); +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md new file mode 100644 index 000000000..8da3bdadf --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.md @@ -0,0 +1,102 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Service.Caller.DaprClient + +## Example: + +````c# +Install-Package Masa.Contrib.Service.Caller +Install-Package Masa.Contrib.Service.Caller.DaprClient +```` + +### Basic usage: + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one Provider, you can not assign a value to Name + clientBuilder.AppId = "" ;//AppID of the callee dapr + }); + }); + ```` + +2. How to use: + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICaller userCaller, string name) + => userCaller.GetAsync($"/Hello", new { Name = name })); + ```` + + > The interface address of the complete request is: http://localhost:3500/v1.0/invoke//method/Hello?Name={name} + +3. When there are multiple DaprClients, modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller"; + clientBuilder.AppId = "" ;//AppID of the callee User service Dapr + }); + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "OrderCaller"; + clientBuilder.AppId = "" ;//AppID of the callee Order service Dapr + }); + }); + ```` + +4. How to use UserCaller or OrderCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICaller userCaller, string name) + => userCaller.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var caller = callerFactory.CreateClient("OrderCaller"); + return caller.GetAsync($"/Hello", new { Name = name }); + }); + ```` + +> When multiple Callers are added, how to get the specified Caller? +>> Get the Caller of the specified alias through the `CreateClient` method of `CallerFactory` +> +> Why doesn't `userCaller` get the corresponding Caller through the `CreateClient` method of `CallerFactory`? +>> If no default ICaller is specified, the default Caller is the first one added in the `AddCaller` method + +### Recommended usage + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(); + ```` + +2. Add a new class `UserCaller` + + ```` C# + public class UserCaller: DaprCallerBase + { + protected override string AppId { get; set; } = ""; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => Caller.GetStringAsync($"/Hello", new { Name = name }); + } + ```` + +3. How to use UserCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ```` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md new file mode 100644 index 000000000..2aa8663a6 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md @@ -0,0 +1,102 @@ +中 | [EN](README.md) + +## Masa.Contrib.Service.Caller.DaprClient + +## 用例: + +```c# +Install-Package Masa.Contrib.Service.Caller +Install-Package Masa.Contrib.Service.Caller.DaprClient +``` + +### 基本用法: + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个Provider时,可以不对Name赋值 + clientBuilder.AppId = "" ;//被调用方dapr的AppID + }); + }); + ``` + +2. 如何使用: + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICaller userCaller, string name) + => userCaller.GetAsync($"/Hello", new { Name = name })); + ``` + + > 完整请求的接口地址是:http://localhost:3500/v1.0/invoke//method/Hello?Name={name} + +3. 当存在多个DaprClient时,则修改`Program.cs`为 + + ``` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller"; + clientBuilder.AppId = "" ;//被调用方User服务Dapr的AppID + }); + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "OrderCaller"; + clientBuilder.AppId = "" ;//被调用方Order服务Dapr的AppID + }); + }); + ``` + +4. 如何使用UserCaller或OrderCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICaller userCaller, string name) + => userCaller.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var caller = callerFactory.CreateClient("OrderCaller"); + return caller.GetAsync($"/Hello", new { Name = name }); + }); + ``` + +> 当多个Caller被添加时,如何获取指定的Caller? +>> 通过`CallerFactory`的`CreateClient`方法得到指定别名的Caller +> +> 为什么`userCaller`没有通过`CallerFactory`的`CreateClient`方法得到对应的Caller? +>> 如果未指定默认的ICaller,则在`AddCaller`方法中第一个被添加的就是默认的Caller + +### 推荐用法 + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(); + ``` + +2. 新增加类`UserCaller` + + ``` C# + public class UserCaller: DaprCallerBase + { + protected override string AppId { get; set; } = ""; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => Caller.GetStringAsync($"/Hello", new { Name = name }); + } + ``` + +3. 如何使用UserCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ``` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs new file mode 100644 index 000000000..37d02e325 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.DaprClient/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Dapr.Client; +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Masa.Contrib.Service.Caller.DaprClient.Options; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Options; diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs new file mode 100644 index 000000000..c06dd2997 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/CallerOptionsExtensions.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.HttpClient; + +public static class CallerOptionsExtensions +{ + public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Func? clientBuilder = null) + { + var builder = clientBuilder == null ? new MasaHttpClientBuilder() : clientBuilder.Invoke(); + var httpClientBuilder = callerOptions.Services.AddHttpClient(builder.Name, httpClient + => builder.ConfigureHttpClient(httpClient)); + + AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, serviceProvider + => new HttpClientCaller(serviceProvider, builder.Name, builder.Prefix)); + return httpClientBuilder; + } + + public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Action? clientBuilder) + { + MasaHttpClientBuilder builder = new MasaHttpClientBuilder(); + clientBuilder?.Invoke(builder); + + return callerOptions.UseHttpClient(() => builder); + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs new file mode 100644 index 000000000..474925301 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCaller.cs @@ -0,0 +1,72 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.HttpClient; + +public class HttpClientCaller : AbstractCaller +{ + private readonly System.Net.Http.HttpClient _httpClient; + private readonly string _prefix; + private readonly bool _prefixIsNullOrEmpty; + + public HttpClientCaller(IServiceProvider serviceProvider, string name, string prefix) + : base(serviceProvider) + { + _httpClient = serviceProvider.GetRequiredService().CreateClient(name); + _prefix = prefix; + _prefixIsNullOrEmpty = string.IsNullOrEmpty(_prefix); + } + + public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + where TResponse : default + { + var response = await _httpClient.SendAsync(request, cancellationToken); + return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + } + + public override Task CreateRequestAsync(HttpMethod method, string? methodName) + => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName))); + + public override Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) + => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName)), data); + + public override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + { + return _httpClient.SendAsync(request, cancellationToken); + } + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SendGrpcAsync(string methodName, TRequest request, + CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + protected virtual string GetRequestUri(string? methodName) + { + if (string.IsNullOrEmpty(methodName)) + return string.Empty; + + if (Uri.IsWellFormedUriString(methodName, UriKind.Absolute) || _prefixIsNullOrEmpty) + return methodName; + + if (_prefix.EndsWith("/")) + return $"{_prefix}{(methodName.StartsWith("/") ? methodName.Substring(1) : methodName)}"; + + return $"{_prefix}{(methodName.StartsWith("/") ? methodName : "/" + methodName)}"; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs new file mode 100644 index 000000000..efec26b02 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/HttpClientCallerBase.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.HttpClient; + +public abstract class HttpClientCallerBase : CallerBase +{ + protected abstract string BaseAddress { get; set; } + + protected virtual string Prefix { get; set; } = string.Empty; + + protected HttpClientCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public override void UseCallerExtension() => UseHttpClient(); + + protected virtual IHttpClientBuilder UseHttpClient() + { + return CallerOptions.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = Name; + httpClientBuilder.Prefix = Prefix; + httpClientBuilder.BaseAddress = BaseAddress; + httpClientBuilder.Configure = ConfigureHttpClient; + }); + } + + protected virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj new file mode 100644 index 000000000..dec7d1449 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/Masa.Contrib.Service.Caller.HttpClient.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs new file mode 100644 index 000000000..516d483c2 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/MasaHttpClientBuilder.cs @@ -0,0 +1,62 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.HttpClient; + +public class MasaHttpClientBuilder +{ + private string _name = default!; + + public string Name + { + get => _name; + set + { + if (value is null) + throw new ArgumentNullException(Name); + + _name = value; + } + } + + [Obsolete($"recommended to use {nameof(BaseAddress)}, {nameof(BaseApi)} has expired")] + public string BaseApi { get => BaseAddress; set => BaseAddress = value; } + + public string BaseAddress { get; set; } + + public string Prefix { get; set; } + + public bool IsDefault { get; set; } = false; + + public Action? Configure { get; set; } + + public MasaHttpClientBuilder() : this("http", null) + { + } + + public MasaHttpClientBuilder(string name, Action? configure) + : this(name, string.Empty, configure) + { + } + + public MasaHttpClientBuilder(string name, string baseAddress, Action? configure) + : this(name, baseAddress, string.Empty, configure) + { + } + + public MasaHttpClientBuilder(string name, string baseAddress, string prefix, Action? configure) + { + Name = name; + BaseAddress = baseAddress; + Prefix = prefix; + Configure = configure; + } + + public virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + if (!string.IsNullOrEmpty(BaseAddress)) + httpClient.BaseAddress = new Uri(BaseAddress); + + Configure?.Invoke(httpClient); + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md new file mode 100644 index 000000000..68e654fe2 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.md @@ -0,0 +1,111 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Service.Caller.HttpClient + +## Example: + +````c# +Install-Package Masa.Contrib.Service.Caller +Install-Package Masa.Contrib.Service.Caller.HttpClient +```` + +### Basic usage: + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one HttpClient, you can not assign a value to Name + clientBuilder.BaseAddress = "http://localhost:5000" ; + }); + }); + ```` + +2. How to use: + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICaller caller, string name) + => caller.GetAsync($"/Hello", new { Name = name })); + ```` + + > The interface address of the complete request is: http://localhost:5000/Hello?Name={name} + +3. When there are multiple HttpClients, modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "UserCaller"; + clientBuilder.BaseAddress = "http://localhost:5000" ; + }); + options.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "OrderCaller"; + clientBuilder.BaseAddress = "http://localhost:6000" ; + }); + }); + ```` + +4. How to use UserCaller or OrderCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICaller caller, string name) + => caller.GetAsync($"/Hello", new { Name = name }));// Get UserCaller + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var caller = callerFactory.Create("OrderCaller"); + return caller.GetAsync($"/Hello", new { Name = name }); + }); + ```` + +> When multiple Callers are added, how to get the specified Caller? +>> Get the Caller of the specified alias through the `Create` method of `CallerFactory` +> +> Why doesn't `caller` get the corresponding Caller through the `Create` method of `CallerFactory`? +>> If no default ICaller is specified, the default Caller is the first one added in the `AddCaller` method + +### Recommended usage + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(); + ```` + +2. Add a new class `UserCaller` + + ```` C# + public class UserCaller: HttpClientCallerBase + { + protected override string BaseAddress { get; set; } = "http://localhost:5000"; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => Caller.GetStringAsync($"/Hello", new { Name = name }); + + /// + /// There is no need to overload by default, and it can be overloaded when there are special requirements for httpClient + /// + /// + protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + httpClient.Timeout = TimeSpan.FromSeconds(5); + } + } + ```` + +3. How to use UserCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ```` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md new file mode 100644 index 000000000..c65988999 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md @@ -0,0 +1,111 @@ +中 | [EN](README.md) + +## Masa.Contrib.Service.Caller.HttpClient + +## 用例: + +```c# +Install-Package Masa.Contrib.Service.Caller +Install-Package Masa.Contrib.Service.Caller.HttpClient +``` + +### 基本用法: + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个HttpClient时,可以不对Name赋值 + clientBuilder.BaseAddress = "http://localhost:5000" ; + }); + }); + ``` + +2. 如何使用: + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICaller caller, string name) + => caller.GetAsync($"/Hello", new { Name = name })); + ``` + + > 完整请求的接口地址是:http://localhost:5000/Hello?Name={name} + +3. 当存在多个HttpClient时,则修改`Program.cs`为 + + ``` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "UserCaller"; + clientBuilder.BaseAddress = "http://localhost:5000" ; + }); + options.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "OrderCaller"; + clientBuilder.BaseAddress = "http://localhost:6000" ; + }); + }); + ``` + +4. 如何使用UserCaller或OrderCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICaller caller, string name) + => caller.GetAsync($"/Hello", new { Name = name })); // 获取到的是UserCaller + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var orderCaller = callerFactory.Create("OrderCaller"); + return orderCaller.GetAsync($"/Hello", new { Name = name }); + }); + ``` + +> 当多个Caller被添加时,如何获取指定的Caller? +>> 通过`CallerFactory`的`Create`方法得到指定别名的Caller +> +> 为什么`caller`没有通过`CallerFactory`的`Create`方法得到对应的Caller? +>> 如果未指定默认的ICallerProvider,则在`AddCaller`方法中第一个被添加的就是默认的Caller + +### 推荐用法 + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(); + ``` + +2. 新增加类`UserCaller` + + ``` C# + public class UserCaller: HttpClientCallerBase + { + protected override string BaseAddress { get; set; } = "http://localhost:5000"; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => Caller.GetStringAsync($"/Hello", new { Name = name }); + + /// + /// 默认不需要重载,对httpClient有特殊需求时可重载 + /// + /// + protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + httpClient.Timeout = TimeSpan.FromSeconds(5); + } + } + ``` + +3. 如何使用UserCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ``` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs new file mode 100644 index 000000000..9710f3e96 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller.HttpClient/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs new file mode 100644 index 000000000..b322c34fa --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultCallerFactory.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller; + +internal class DefaultCallerFactory : ICallerFactory +{ + private readonly IServiceProvider _serviceProvider; + private readonly List _callers; + + public DefaultCallerFactory(IServiceProvider serviceProvider, IOptions options) + { + _serviceProvider = serviceProvider; + _callers = options.Value.Callers; + } + + public ICaller Create() + { + var caller = _callers.SingleOrDefault(c => c.IsDefault) ?? _callers.FirstOrDefault()!; + return caller.Func.Invoke(_serviceProvider); + } + + public ICaller Create(string name) + { + var caller = _callers.SingleOrDefault(c => c.Name == name); + if (caller == null) + throw new NotSupportedException($"Please make sure you have used [{name}] Caller"); + + return caller.Func.Invoke(_serviceProvider); + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs new file mode 100644 index 000000000..2d8c44fe6 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultRequestMessage.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller; + +public abstract class DefaultRequestMessage +{ + protected readonly IServiceProvider ServiceProvider; + private readonly string _requestIdKey; + private readonly IHttpContextAccessor? _httpContextAccessor; + protected readonly CallerFactoryOptions? Options; + + public DefaultRequestMessage(IServiceProvider serviceProvider, + IOptions? options = null) + { + ServiceProvider = serviceProvider; + _httpContextAccessor = ServiceProvider.GetService(); + Options = options?.Value; + _requestIdKey = Options?.RequestIdKey ?? "Masa-Request-Id"; + } + + protected virtual void TrySetRequestId(HttpRequestMessage requestMessage) + { + var httpContext = _httpContextAccessor?.HttpContext; + if (httpContext == null) + return; + + if (!httpContext.Request.Headers.TryGetValue(_requestIdKey, out var requestId)) + requestId = Guid.NewGuid().ToString(); + + if (requestMessage.Headers.All(h => h.Key != _requestIdKey)) + requestMessage.Headers.Add(_requestIdKey, requestId.ToString()); + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs new file mode 100644 index 000000000..904125f57 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultResponseMessage.cs @@ -0,0 +1,92 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller; + +public class DefaultResponseMessage : IResponseMessage +{ + private readonly ILogger? _logger; + private readonly CallerFactoryOptions _options; + + public DefaultResponseMessage(IOptions options, ILogger? logger = null) + { + _options = options.Value; + _logger = logger; + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, + CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case HttpStatusCode.Accepted: + case HttpStatusCode.NoContent: + return default; + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + return (TResponse)Convert.ChangeType(content, typeof(TResponse)); + } + try + { + return await response.Content.ReadFromJsonAsync(_options.JsonSerializerOptions, cancellationToken) + ?? throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); + } + catch (Exception exception) + { + _logger?.LogWarning(exception, exception.Message); + ExceptionDispatchInfo.Capture(exception).Throw(); + return default; //This will never be executed, the previous line has already thrown an exception + } + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + return default; //never executed + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + return; + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + } + + public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.Content.Headers.ContentLength is > 0) + throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); + + throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs new file mode 100644 index 000000000..5d2d6e3ec --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/DefaultTypeConvertor.cs @@ -0,0 +1,98 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller; + +public class DefaultTypeConvertor : ITypeConvertor +{ + private static readonly ConcurrentDictionary> Dictionary = new(); + + protected readonly List NotNeedSerializeTypes = new() + { + typeof(String), + typeof(Guid), + typeof(DateTime), + typeof(Decimal), + typeof(Guid?), + typeof(DateTime?), + typeof(Decimal?) + }; + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + [Obsolete("Use ConvertToKeyValuePairs instead")] + public Dictionary ConvertToDictionary(TRequest request) where TRequest : class + => new(ConvertToKeyValuePairs(request)); + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + public IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class + { + if (request.Equals(null)) + return Array.Empty>(); + + if (request is Dictionary response) + return response; + + if (request is IEnumerable> keyValuePairs) + return keyValuePairs; + + var requestType = request.GetType(); + if (!Dictionary.TryGetValue(requestType, out List? members)) + { + members = GetMembers(request.GetType().GetProperties()); + Dictionary.TryAdd(requestType, members); + } + List> data = new List>(); + foreach (var member in members) + { + if (member.TryGetValue(request, out string value)) + data.Add(new KeyValuePair(member.Name, value)); + } + return data; + } + + private List GetMembers(PropertyInfo[] properties) + { + List members = new(); + foreach (var property in properties) + { + if (IsSkip(property)) continue; + + string name = GetPropertyName(property); + + members.Add(new PropertyInfoMember(property, name, IsNeedSerialize(property))); + } + return members; + } + + protected bool IsSkip(PropertyInfo property) + => !property.CanRead || + !property.PropertyType.IsPublic || + property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonIgnoreAttribute)); + + protected string GetPropertyName(PropertyInfo property) + { + if (property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))) + { + var customAttributeData = + property.CustomAttributes.FirstOrDefault(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))!; + var customAttribute = customAttributeData.ConstructorArguments.FirstOrDefault(); + return customAttribute.Value?.ToString() ?? + throw new NotSupportedException( + $"Parameter name: {property.Name}, But the JsonPropertyNameAttribute assignment name is empty"); + } + return property.Name; + } + + protected bool IsNeedSerialize(PropertyInfo property) + => !property.PropertyType.IsPrimitive && !NotNeedSerializeTypes.Contains(property.PropertyType); +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs new file mode 100644 index 000000000..0cec9b42a --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/CallerDependExtensions.cs @@ -0,0 +1,89 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Internal; + +/// +/// Caller dependency orchestration +/// +internal static class CallerDependExtensions +{ + /// + /// Caller dependency orchestration + /// + /// All Callers that inherit CallerBase + /// + /// + public static List Arrangement(this List callerTypes) + { + List types = GetCallerByNotDependCaller(callerTypes); + if (types.Count == 0) + throw new UserFriendlyException(ErrorMessages.CIRCULAR_DEPENDENCY); + + return callerTypes.CallersArrangement(types, 1); + } + + private static List CallersArrangement(this List allTypes, List existTypes, int executeTimes) + { + List types = existTypes; + var dependCallerTypes = allTypes.Except(existTypes); + foreach (var type in dependCallerTypes) + { + var constructorInfo = type.GetConstructors().MaxBy(con => con.GetParameters().Length)!; + bool isExist = true; + foreach (var parameter in constructorInfo.GetParameters()) + { + var parameterType = parameter.ParameterType; + if (typeof(CallerBase).IsAssignableFrom(parameterType) && !types.Contains(parameterType)) + { + isExist = false; + } + } + if (isExist) + types.Add(type); + } + + if (types.Count != allTypes.Count) + { + if (executeTimes >= allTypes.Count) + throw new UserFriendlyException(ErrorMessages.CIRCULAR_DEPENDENCY); + + return CallersArrangement(allTypes, types, ++executeTimes); + } + return types; + } + + /// + /// Get a Caller object that does not depend on other Callers + /// + /// + /// + private static List GetCallerByNotDependCaller(this List callerTypes) + { + List types = new(); + callerTypes.ForEach(type => + { + if (!type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).IsDependCaller()) + types.Add(type); + }); + return types; + } + + private static bool IsDependCaller(this ConstructorInfo[] constructorInfos) + { + var constructorInfo = constructorInfos.MaxBy(constructorInfo => constructorInfo.GetParameters().Length)!; + return constructorInfo.IsDependCaller(); + } + + private static bool IsDependCaller(this ConstructorInfo constructorInfo) + { + foreach (var parameter in constructorInfo.GetParameters()) + { + if (typeof(CallerBase).IsAssignableFrom(parameter.ParameterType)) + { + return true; + } + } + return false; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs new file mode 100644 index 000000000..37f82bb2b --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/ErrorMessages.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Internal; + +internal class ErrorMessages +{ + public const string CIRCULAR_DEPENDENCY = "Caller has a circular dependency, please check the constructor of Caller"; +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs new file mode 100644 index 000000000..e7f3ecb7f --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/Options/PropertyInfoMember.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Internal.Options; + +internal class PropertyInfoMember +{ + public PropertyInfo Property { get; } + + public string Name { get; } + + public bool NeedSerialize { get; } + + public PropertyInfoMember(PropertyInfo property, string name, bool needSerialize) + { + Property = property; + Name = name; + NeedSerialize = needSerialize; + } + + public bool TryGetValue(TRequest data, out string value) where TRequest : class + { + value = string.Empty; + var propertyValue = Property.GetValue(data); + if (propertyValue == null || (!NeedSerialize && propertyValue.ToString() == null)) + return false; + + value = !NeedSerialize ? propertyValue.ToString()! : JsonSerializer.Serialize(propertyValue); + return true; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs new file mode 100644 index 000000000..20f857473 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Internal/XmlUtils.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Internal; + +/// +/// Temporary use, later versions will be removed +/// +internal class XmlUtils +{ + public static string Serializer(object data) + { + MemoryStream ms = new MemoryStream(); + StreamWriter sw = new StreamWriter(ms, Encoding.UTF8); + XmlSerializer xz = new XmlSerializer(data.GetType()); + xz.Serialize(sw, data); + return Encoding.UTF8.GetString(ms.ToArray()); + } + + public static T Deserialize(string xml) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); + using MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml.ToCharArray())); + return (T)xmlSerializer.Deserialize(stream)!; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs new file mode 100644 index 000000000..96545ebdf --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/JsonRequestMessage.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller; + +public class JsonRequestMessage : DefaultRequestMessage, IRequestMessage +{ + private readonly JsonSerializerOptions? _jsonSerializerOptions; + + public JsonRequestMessage( + IServiceProvider serviceProvider, + IOptions? options = null) + : base(serviceProvider, options) + { + _jsonSerializerOptions = Options?.JsonSerializerOptions; + } + + public virtual Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) + { + TrySetRequestId(requestMessage); + return Task.FromResult(requestMessage); + } + + public virtual async Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) + { + requestMessage = await ProcessHttpRequestMessageAsync(requestMessage); + requestMessage.Content = JsonContent.Create(data, options: _jsonSerializerOptions); + return requestMessage; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj new file mode 100644 index 000000000..caebe44cc --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/Masa.Contrib.Service.Caller.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/README.md b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/README.md new file mode 100644 index 000000000..720e5df92 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/README.md @@ -0,0 +1,36 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Service.Caller + +Masa.Contrib.Service.Caller is the basic class library of Caller, which provides the abstraction of the following capabilities + +* `ICallerFactory`: Factory for creating `Caller` (Singleton) +* `ICaller`: Provides `Post`, `Delete`, `Patch`, `Put`, `Get`, `Send` capabilities (Scoped) +* `IRequestMessage`: Provides the ability to process request data (default implementation [`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) +* `IResponseMessage`: Provides the ability to handle response data (default implementation [`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) +* `ITypeConvertor`: Provides the ability to convert types, support for `Get` requests of `ICaller` (Singleton) + +## Summarize + +`Masa.Contrib.Service.Caller` is the basic class library of Caller, but it cannot be used alone. Currently, Caller supports two implementations: + +* Implementation based on HttpClient: [Masa.Contrib.Service.Caller.HttpClient](../Masa.Contrib.Service.Caller.HttpClient/README.md) +* Implementation based on DaprClient: [Masa.Contrib.Service.Caller.DaprClient](../Masa.Contrib.Service.Caller.DaprClient/README.md) + +> Q: What should I do if the callee uses xml instead of json? +> +> A: Rewrite IRequestMessage and add the custom RequestMessage to the IServiceCollection before calling AddCaller + + ```` C# + services.AddSingleton(); + services.AddCaller(); + ```` + +> Q: If you want to handle custom StatusCode and throw exception information +> +> A: Rewrite IResponseMessage, add custom ResponseMessage to IServiceCollection before calling AddCaller + + ```` C# + services.AddSingleton(); + services.AddCaller(); + ```` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md new file mode 100644 index 000000000..3c0768b5f --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/README.zh-CN.md @@ -0,0 +1,36 @@ +中 | [EN](README.md) + +## Masa.Contrib.Service.Caller + +Masa.Contrib.Service.Caller是Caller的基础类库,提供了以下能力的抽象 + +* `ICallerFactory`: 工厂,用于创建`Caller` (Singleton) +* `ICaller`: 提供`Post`、`Delete`、`Patch`、`Put`、`Get`、`Send`的能力 (Scoped) +* `IRequestMessage`: 提供对请求数据处理的能力 (默认实现[`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) +* `IResponseMessage`: 提供对响应数据处理的能力 (默认实现[`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) +* `ITypeConvertor`: 提供类型转换的能力,为`ICaller`的`Get`请求支撑 (Singleton) + +## 总结 + +`Masa.Contrib.Service.Caller`是Caller的基础类库,但不能单独使用,目前Caller支持了两种实现方式: + +* 基于HttpClient的实现: [Masa.Contrib.Service.Caller.HttpClient](../Masa.Contrib.Service.Caller.HttpClient/README.zh-CN.md) +* 基于DaprClient的实现: [Masa.Contrib.Service.Caller.DaprClient](../Masa.Contrib.Service.Caller.DaprClient/README.zh-CN.md) + +> Q: 如果被调用方使用的是数据格式为xml,而不是json,我应该怎么做? +> +> A: 重写IRequestMessage,在调用AddCaller之前先将自定义的RequestMessage添加到IServiceCollection中 + + ``` C# + services.AddSingleton(); + services.AddCaller(); + ``` + +> Q: 如果希望处理自定义的StatusCode,并抛出异常信息 +> +> A: 重写IResponseMessage,在调用AddCaller之前先将自定义的ResponseMessage添加到IServiceCollection中 + + ``` C# + services.AddSingleton(); + services.AddCaller(); + ``` \ No newline at end of file diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..a3d5a051d --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/ServiceCollectionExtensions.cs @@ -0,0 +1,107 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddCaller(this IServiceCollection services) + => services.AddCaller(AppDomain.CurrentDomain.GetAssemblies()); + + public static IServiceCollection AddCaller(this IServiceCollection services, params Assembly[] assemblies) + => services.AddCaller(options => options.Assemblies = assemblies); + + private static IServiceCollection AddCaller(this IServiceCollection services, + ServiceLifetime lifetime = ServiceLifetime.Scoped, + params Assembly[] assemblies) + => services.AddCaller(options => + { + options.Assemblies = assemblies; + options.CallerLifetime = lifetime; + }); + + public static IServiceCollection AddCaller(this IServiceCollection services, Action options) + { + CallerOptions callerOption = new CallerOptions(services); + options.Invoke(callerOption); + + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddScoped(serviceProvider => serviceProvider.GetRequiredService().Create()); + + services.TryAddSingleton(); + services.AddAutomaticCaller(callerOption); + TryOrUpdate(services, callerOption); + return services; + } + + private static void AddAutomaticCaller(this IServiceCollection services, CallerOptions callerOptions) + { + var callerTypes = callerOptions.Assemblies.SelectMany(x => x.GetTypes()) + .Where(type => typeof(CallerBase).IsAssignableFrom(type) && !type.IsAbstract).ToList(); + + callerTypes = callerTypes.Except(services.Select(d => d.ServiceType)).ToList(); + + if (callerTypes.Count == 0) + return; + + callerTypes.Arrangement().ForEach(type => + { + ServiceDescriptor serviceDescriptor = new ServiceDescriptor(type, serviceProvider => + { + var constructorInfo = type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) + .MaxBy(constructor => constructor.GetParameters().Length)!; + List parameters = new(); + foreach (var parameter in constructorInfo.GetParameters()) + { + parameters.Add(serviceProvider.GetRequiredService(parameter.ParameterType)); + } + var callerBase = (constructorInfo.Invoke(parameters.ToArray()) as CallerBase)!; + callerBase.SetCallerOptions(callerOptions, type.FullName ?? type.Name); + return callerBase; + }, callerOptions.CallerLifetime); + services.TryAdd(serviceDescriptor); + }); + + var serviceProvider = services.BuildServiceProvider(); + callerTypes.ForEach(type => + { + var callerBase = (CallerBase)serviceProvider.GetRequiredService(type); + callerBase.UseCallerExtension(); + }); + } + + private static IServiceCollection TryOrUpdate(this IServiceCollection services, CallerOptions options) + { + services.Configure(callerOptions => + { + options.Callers.ForEach(caller => + { + if (callerOptions.Callers.Any(relation => relation.Name == caller.Name)) + throw new ArgumentException($"The caller name already exists, please change the name, the repeat name is [{caller.Name}]"); + + if (callerOptions.Callers.Any(relation => relation.IsDefault && caller.IsDefault)) + { + string errorCallerNames = string.Join("、", callerOptions.Callers + .Where(relation => relation.IsDefault) + .Select(relation => relation.Name) + .Concat(options.Callers.Where(relation => relation.IsDefault).Select(relation => relation.Name)) + .Distinct()); + throw new ArgumentException( + $"There can only be at most one default Caller Provider, and now the following Caller Providers are found to be default: {errorCallerNames}"); + } + + callerOptions.Callers.Add(caller); + }); + + if (callerOptions.JsonSerializerOptions == null && options.JsonSerializerOptions != null) + callerOptions.JsonSerializerOptions = options.JsonSerializerOptions; + + if (callerOptions.RequestIdKey != null && options.RequestIdKey != null) + callerOptions.RequestIdKey = options.RequestIdKey; + }); + + return services; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs new file mode 100644 index 000000000..5790aa200 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/XmlRequestMessage.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller; + +public class XmlRequestMessage : DefaultRequestMessage, IRequestMessage +{ + public XmlRequestMessage( + IServiceProvider serviceProvider, + IOptions? options = null) + : base(serviceProvider, options) + { + } + + public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) + { + TrySetRequestId(requestMessage); + return Task.FromResult(requestMessage); + } + + public async Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) + { + requestMessage = await ProcessHttpRequestMessageAsync(requestMessage); + requestMessage.Content = new StringContent(XmlUtils.Serializer(data!)); + return requestMessage; + } +} diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs new file mode 100644 index 000000000..8b5980904 --- /dev/null +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Masa.Contrib.Service.Caller.Internal; +global using Masa.Contrib.Service.Caller.Internal.Options; +global using Masa.Utils.Exceptions; +global using Microsoft.AspNetCore.Http; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using System.Collections.Concurrent; +global using System.Net; +global using System.Net.Http.Json; +global using System.Reflection; +global using System.Runtime.ExceptionServices; +global using System.Text.Json; +global using System.Text.Json.Serialization; +global using System.Text; +global using System.Xml.Serialization; diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CallerTest.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CallerTest.cs new file mode 100644 index 000000000..17a01e538 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CallerTest.cs @@ -0,0 +1,138 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests; + +[TestClass] +public class CallerTest +{ + private WebApplicationBuilder _builder = default!; + + [TestInitialize] + public void EdgeDriverInitialize() + { + _builder = WebApplication.CreateBuilder(); + } + + [TestMethod] + public async Task TestGetAsync() + { + _builder.Services.AddCaller(callerOptions => + { + callerOptions.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Configure = builder => builder.Timeout = TimeSpan.FromSeconds(3); + httpClientBuilder.BaseAddress = "https://github.com/masastack"; + }); + }); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var githubCaller = serviceProvider.GetRequiredService(); + Assert.IsTrue(await GetAsync(githubCaller)); + } + + private async Task GetAsync(ICaller caller) + { + var res = await caller.GetAsync(""); + return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; + } + + [TestMethod] + public void TestConvertToDictionaryByDynamic() + { + var provider = new DefaultTypeConvertor(); + var dictionary = new Dictionary + { + { "account", "jim" }, + { "age", "18" } + }; + var request = new + { + account = "jim", + age = 18 + }; + var result = provider.ConvertToDictionary(request); + Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + } + + [TestMethod] + public void TestConvertToDictionaryByObject() + { + var provider = new DefaultTypeConvertor(); + var query = new UserListQuery("Jim"); + var dictionary = new Dictionary + { + { "name", query.Name } + }; + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + } + + [TestMethod] + public void TestConvertToDictionaryByObject2() + { + var provider = new DefaultTypeConvertor(); + var query = new UserDetailQuery("Jim", "Music", "Game"); + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(result.Count == 2); + Assert.IsTrue(result["name"] == query.Name); + Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + { + "Music", + "Game" + })); + } + + [TestMethod] + public void TestConvertToDictionaryByObject3() + { + var provider = new DefaultTypeConvertor(); + + List tags = null!; + var query = new UserDetailQuery("Jim", tags); + var result = provider.ConvertToDictionary(query); + + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["name"] == query.Name); + } + + [TestMethod] + public void TestConvertToDictionaryByObject4() + { + var provider = new DefaultTypeConvertor(); + var query = new UserDetailQuery(null!, "Music", "Game"); + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + { + "Music", + "Game" + })); + } + + [TestMethod] + public void TestConvertToDictionaryByObject5() + { + var provider = new DefaultTypeConvertor(); + var dic = new Dictionary() + { + { "Account", "Jim" } + }; + var result = provider.ConvertToDictionary(dic); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Account"] == "Jim"); + } + + [TestMethod] + public void TestConvertToDictionaryByObject6() + { + var provider = new DefaultTypeConvertor(); + var dic = new List>() + { + new("Account", "Jim") + }; + var result = provider.ConvertToDictionary(dic); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Account"] == "Jim"); + } +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs new file mode 100644 index 000000000..aeb1a890f --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CustomHttpClientCaller.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests; + +public class CustomHttpClientCaller : HttpClientCaller +{ + public CustomHttpClientCaller(IServiceProvider serviceProvider, string name, string baseApi) + : base(serviceProvider, name, baseApi) + { + } + + public string GetResult(string? methodName) => base.GetRequestUri(methodName); +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs new file mode 100644 index 000000000..50876a30a --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/DefaultXmlResponseMessage.cs @@ -0,0 +1,91 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests; + +public class DefaultXmlResponseMessage : IResponseMessage +{ + private readonly ILogger? _logger; + + public DefaultXmlResponseMessage(ILogger? logger = null) + { + _logger = logger; + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, + CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case HttpStatusCode.Accepted: + case HttpStatusCode.NoContent: + return default; + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + return (TResponse)Convert.ChangeType(content, typeof(TResponse)); + } + try + { + var res = await response.Content.ReadAsStringAsync(cancellationToken); + return XmlUtils.Deserialize(res) ?? + throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); + } + catch (Exception exception) + { + _logger?.LogWarning(exception, exception.Message); + ExceptionDispatchInfo.Capture(exception).Throw(); + return default; //This will never be executed, the previous line has already thrown an exception + } + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + return default; //never executed + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + return; + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + } + + public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.Content.Headers.ContentLength is > 0) + throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); + + throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); + } +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs new file mode 100644 index 000000000..e28b17156 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/HttpClientCallerTest.cs @@ -0,0 +1,128 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests; + +[TestClass] +public class HttpClientCallerTest +{ + [DataTestMethod] + [DataRow("https://github.com/", "/check/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com", "/check/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com", "check/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check", "healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check/", "healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check/", "/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check/", "/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com/check/", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com/check", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com", "", "")] + [DataRow("http://github.com", "", "")] + [DataRow("/v1/check", "healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("", "healthy", "healthy")] + [DataRow("", "/healthy?id=1", "/healthy?id=1")] + public void TestGetRequestUri(string prefix, string methods, string result) + { + var services = new ServiceCollection(); + services.AddCaller(opt => opt.UseHttpClient()); + var serviceProvider = services.BuildServiceProvider(); + var caller = new CustomHttpClientCaller(serviceProvider, string.Empty, prefix); + Assert.IsTrue(caller.GetResult(methods) == result); + } + + [TestMethod] + public async Task TestRequestDataIsXmlAsync() + { + var services = new ServiceCollection(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + Mock httpClientFactory = new(); + var handlerMock = new Mock(); + var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) + { + BaseAddress = new Uri("http://localhost:5000") + }; + var response = new BaseResponse("success"); + handlerMock + .Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny() + ) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent(XmlUtils.Serializer(response)) + }) + .Verifiable(); + + httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); + services.AddSingleton(httpClientFactory.Object); + var serviceProvider = services.BuildServiceProvider(); + string name = ""; + string prefix = ""; + var caller = new HttpClientCaller(serviceProvider, name, prefix); + + var res = await caller.PostAsync("Hello", new RegisterUser("Jim", "123456")); + Assert.IsNotNull(res); + Assert.IsTrue(res.Code == response.Code); + } + + [TestMethod] + public async Task TestRequestMessageReturnOnceAsync() + { + var services = new ServiceCollection(); + RegisterUser registerUser = new RegisterUser("Jim", "123456"); + + services.AddSingleton(); + Mock requestMessage = new(); + requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny())) + .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello")).Verifiable(); + requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello") + { + Content = JsonContent.Create(registerUser) + }).Verifiable(); + services.AddSingleton(_ => requestMessage.Object); + services.AddSingleton(); + Mock httpClientFactory = new(); + var handlerMock = new Mock(); + var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) + { + BaseAddress = new Uri("http://localhost:5000") + }; + var response = new BaseResponse("success"); + handlerMock + .Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny() + ) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent(XmlUtils.Serializer(response)) + }) + .Verifiable(); + + httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); + services.AddSingleton(httpClientFactory.Object); + var serviceProvider = services.BuildServiceProvider(); + string name = ""; + string prefix = ""; + var caller = new HttpClientCaller(serviceProvider, name, prefix); + + var res = await caller.PostAsync("Hello", registerUser); + Assert.IsNotNull(res); + Assert.IsTrue(res.Code == response.Code); + requestMessage.Verify(r => r.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny()), Times.Once); + } +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj new file mode 100644 index 000000000..954766209 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Masa.Contrib.Service.Caller.Tests.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs new file mode 100644 index 000000000..e4bf3d726 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Queries/UserDetailQuery.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests.Queries; + +public class UserDetailQuery +{ + public Guid? Id { get; set; } + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonIgnore] + public int Age { get; set; } + + public DateTime? DelTime { get; set; } + + public List? Tags { get; set; } + + public UserDetailQuery() + { + this.Id = Guid.NewGuid(); + } + + public UserDetailQuery(string name, params string[] tags) : this(name, tags.ToList()) + { + } + + public UserDetailQuery(string name, List tags) + { + Name = name; + Tags = tags; + } +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs new file mode 100644 index 000000000..1d10b319d --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Queries/UserListQuery.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests.Queries; + +public class UserListQuery +{ + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonIgnore] + public int Age { get; set; } + + public UserListQuery(string name) + { + Name = name; + } +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs new file mode 100644 index 000000000..c2797a77d --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Requesties/RegisterUser.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests.Requesties; + +[XmlRoot] +public class RegisterUser +{ + [XmlElement] + public string Account { get; set; } = default!; + + [XmlElement] + public string Password { get; set; } = default!; + + public RegisterUser() { } + + public RegisterUser(string account, string password) : this() + { + Account = account; + Password = password; + } +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs new file mode 100644 index 000000000..9b51b19b2 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Response/BaseResponse.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests.Response; + +[Serializable] +[XmlRoot] +public class BaseResponse +{ + [XmlElement] + public string Code { get; set; } = default!; + + public BaseResponse() { } + + public BaseResponse(string code) { Code = code; } +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs new file mode 100644 index 000000000..8260181d5 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/TypeConvertTest.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests; + +[TestClass] +public class TypeConvertTest +{ + [TestMethod] + public void TestConvertToKeyValuePairs() + { + var defaultTypeConvertProvider = new DefaultTypeConvertor(); + var result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new + { + id = 1, + name = "masa" + }).ToList(); + Assert.AreEqual(2, result.Count()); + Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "1")); + Assert.IsTrue(result.Any(x => x.Key == "name" && x.Value == "masa")); + + result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new + { + id = 2, + text = "masa" + }).ToList(); + Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "2")); + Assert.IsTrue(result.Any(x => x.Key == "text" && x.Value == "masa")); + } +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs new file mode 100644 index 000000000..497e57960 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/Utils/XmlUtils.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.Tests; + +/// +/// Temporary use, later versions will be removed +/// +internal class XmlUtils +{ + public static string Serializer(object data) + { + MemoryStream ms = new MemoryStream(); + StreamWriter sw = new StreamWriter(ms, Encoding.UTF8); + XmlSerializer xz = new XmlSerializer(data.GetType()); + xz.Serialize(sw, data); + return Encoding.UTF8.GetString(ms.ToArray()); + } + + public static T Deserialize(string xml) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); + using MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml.ToCharArray())); + return (T)xmlSerializer.Deserialize(stream)!; + } +} diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/_Imports.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/_Imports.cs new file mode 100644 index 000000000..a406d75ab --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/_Imports.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Contrib.Service.Caller.Tests.Queries; +global using Masa.Contrib.Service.Caller.Tests.Requesties; +global using Masa.Contrib.Service.Caller.Tests.Response; +global using Masa.Utils.Exceptions; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using Moq.Protected; +global using System.Net; +global using System.Net.Http.Json; +global using System.Runtime.ExceptionServices; +global using System.Text; +global using System.Text.Json.Serialization; +global using System.Xml.Serialization; diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs new file mode 100644 index 000000000..621ac7bfd --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/AutomaticCallerTest.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests; + +[TestClass] +public class AutomaticCallerTest +{ + private WebApplicationBuilder _builder = default!; + + [TestInitialize] + public void EdgeDriverInitialize() + { + _builder = WebApplication.CreateBuilder(); + } + + [TestMethod] + public async Task TestGetAsync() + { + _builder.Services.AddCaller(); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var githubCaller = serviceProvider.GetRequiredService(); + Assert.IsTrue(await githubCaller.GetAsync()); + } + + [TestMethod] + public void TestDaprCallerReturnCallerProviderIsNotNull() + { + _builder.Services.AddCaller(); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var caller = serviceProvider.GetRequiredService(); + Assert.IsTrue(caller.CallerProviderIsNotNull()); + } + + [TestMethod] + public void TestCustomDaprBaseReturnAppIdIsEqualUserService() + { + _builder.Services.AddCaller(); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var roleCaller = serviceProvider.GetRequiredService(); + var userCaller = serviceProvider.GetRequiredService(); + Assert.IsTrue(roleCaller.GetAppId() == "User-Service" && userCaller.GetAppId() == "User-Service"); + } +} diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs new file mode 100644 index 000000000..d06e3220e --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/CallerTest.cs @@ -0,0 +1,214 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests; + +[TestClass] +public class CallerTest +{ + [TestMethod] + public void TestCallerProviderServiceLifetime() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "http"; + clientBuilder.IsDefault = true; + clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + var callerProvider1 = serviceProvider.GetRequiredService(); + var callerProvider2 = serviceProvider.GetRequiredService(); + Assert.IsTrue(callerProvider1 == callerProvider2); + } + + [TestMethod] + public void TestCaller() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "http"; + clientBuilder.IsDefault = true; + clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; + }); + opt.UseDapr(clientBuilder => + { + clientBuilder.Name = "dapr"; + clientBuilder.IsDefault = false; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + var caller = serviceProvider.GetRequiredService(); + Assert.IsNotNull(caller); + + caller = serviceProvider.GetRequiredService().Create(); + var daprCaller = serviceProvider.GetRequiredService().Create("dapr"); + var httpCaller = serviceProvider.GetRequiredService().Create("http"); + + Assert.IsTrue(caller.GetType().FullName != daprCaller.GetType().FullName); + Assert.IsTrue(caller.GetType().FullName == httpCaller.GetType().FullName); + } + + [TestMethod] + public void TestMultiDefaultCaller() + { + IServiceCollection services = new ServiceCollection(); + + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + opt.UseHttpClient(builder => + { + builder.Name = "gitee"; + builder.BaseAddress = "https://gitee.com/masastack"; + builder.IsDefault = true; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + Assert.ThrowsException(() => + { + var optionsFactory = serviceProvider.GetRequiredService>(); + optionsFactory.Create(Options.DefaultName); + }); + } + + [TestMethod] + public void TestMultiDefaultCaller2() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "gitee"; + builder.BaseAddress = "https://gitee.com/masastack"; + builder.IsDefault = true; + }); + }); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + Assert.ThrowsException(() => + { + var optionsFactory = serviceProvider.GetRequiredService>(); + optionsFactory.Create(Options.DefaultName); + }); + } + + [TestMethod] + public void TestRepeatCallerName() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestRepeatCallerName2() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + Assert.ThrowsException(() => + { + var optionsFactory = serviceProvider.GetRequiredService>(); + optionsFactory.Create(Options.DefaultName); + }); + } + + [TestMethod] + public void TestRepeatCallerName3() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = typeof(GithubCaller).FullName!; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestAddMultiCaller() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "masastack"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "masastack2"; + builder.BaseAddress = "https://github.com/masastack"; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetRequiredService().Create("masastack")); + Assert.IsNotNull(serviceProvider.GetRequiredService().Create("masastack2")); + } +} diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs new file mode 100644 index 000000000..81e897073 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/DaprCaller.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; + +public class DaprCaller : DaprCallerBase +{ + public DaprCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + AppId = "DaprCaller"; + } + + protected override string AppId { get; set; } + + public bool CallerProviderIsNotNull() => Caller != null; +} diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs new file mode 100644 index 000000000..be4b15673 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/GithubCaller.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; + +public class GithubCaller : HttpClientCallerBase +{ + public GithubCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + BaseAddress = "https://github.com/masastack"; + } + + protected override string BaseAddress { get; set; } + + public async Task GetAsync() + { + var res = await Caller.GetAsync(""); + return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; + } +} diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs new file mode 100644 index 000000000..be679e60c --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/RoleCaller.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; + +public class RoleCaller: UserDaprCallerBase +{ + public RoleCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } +} diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs new file mode 100644 index 000000000..6bfbbd7ae --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserCaller.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; + +public class UserCaller : UserDaprCallerBase +{ + public UserCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } +} diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs new file mode 100644 index 000000000..9bb72570a --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Callers/UserDaprCallerBase.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; + +public abstract class UserDaprCallerBase : DaprCallerBase +{ + protected override string AppId { get; set; } = "User-Service"; + + protected UserDaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public string GetAppId() => AppId; + + protected override DefaultDaprClientBuilder UseDapr() + { + return base.UseDapr().AddHttpRequestMessage(); + } +} diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs new file mode 100644 index 000000000..256586aa2 --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/DefaultDaprRequestMessage.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.Caller.AutomaticCaller.Tests; + +public class DefaultDaprRequestMessage : IDaprRequestMessage +{ + public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) + { + requestMessage.Headers.Add("test", "test"); + return Task.FromResult(requestMessage); + } +} diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj new file mode 100644 index 000000000..4140437cd --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/Masa.Contrib.Service.Caller.AutomaticCaller.Tests.csproj @@ -0,0 +1,28 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + diff --git a/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs new file mode 100644 index 000000000..ffe46821b --- /dev/null +++ b/src/Contrib/Service/Caller/Tests/Scenes/Masa.Contrib.Service.Caller.AutomaticCaller.Tests/_Imports.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers; +global using Masa.Contrib.Service.Caller.DaprClient; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System.Net; +global using DaprCaller = Masa.Contrib.Service.Caller.AutomaticCaller.Tests.Callers.DaprCaller; diff --git a/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj new file mode 100644 index 000000000..3d9a134b5 --- /dev/null +++ b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/Masa.Contrib.Service.MinimalAPIs.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + + + + + + + + + + + + + diff --git a/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/README.md b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/README.md new file mode 100644 index 000000000..08c62d7ce --- /dev/null +++ b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/README.md @@ -0,0 +1,53 @@ +[中](README.zh-CN.md) | EN + +## MinimalAPI + +Original usage: + +```C# +var builder = WebApplication.CreateBuilder(args); +var app = builder.Build(); +app.MapGet("/api/v1/helloworld", ()=>"Hello World"); +app.Run(); +``` + +Example: + +```c# +Install-Package Masa.Contrib.Service.MinimalAPIs +``` + +1. Add MinimalAPI + +```c# +var builder = WebApplication.CreateBuilder(args); +var app = builder.Services + .AddServices(builder); +``` + +2. Custom Service and inherit ServiceBase + +```c# +public class IntegrationEventService : ServiceBase +{ + public IntegrationEventService(IServiceCollection services) : base(services) + { + App.MapGet("/api/v1/payment/HelloWorld", HelloWorld); + } + + public string HelloWorld() + { + return "Hello World"; + } +} +``` + +> Tip: The service that inherits ServiceBase is registered in singleton mode, if you need to obtain it from DI + +```C# +public async Task DeleteBasketByIdAsync(string id, [FromServices] IBasketRepository repository) +{ + await repository.DeleteBasketAsync(id); +} +``` + diff --git a/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md new file mode 100644 index 000000000..294d0cab0 --- /dev/null +++ b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md @@ -0,0 +1,53 @@ +中 | [EN](README.md) + +## MinimalAPI + +原始用法: + +```C# +var builder = WebApplication.CreateBuilder(args); +var app = builder.Build(); +app.MapGet("/api/v1/helloworld", ()=>"Hello World"); +app.Run(); +``` + +用例: + +```c# +Install-Package Masa.Contrib.Service.MinimalAPIs +``` + +1. 添加MinimalAPI + +```c# +var builder = WebApplication.CreateBuilder(args); +var app = builder.Services + .AddServices(builder); +``` + +2. 自定义Service并继承ServiceBase,如: + +```c# +public class IntegrationEventService : ServiceBase +{ + public IntegrationEventService(IServiceCollection services) : base(services) + { + App.MapGet("/api/v1/payment/HelloWorld", HelloWorld); + } + + public string HelloWorld() + { + return "Hello World"; + } +} +``` + +> 提示:继承ServiceBase的服务为单例模式注册,如果需要从DI获取获取 + +```C# +public async Task DeleteBasketByIdAsync(string id, [FromServices] IBasketRepository repository) +{ + await repository.DeleteBasketAsync(id); +} +``` + diff --git a/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs new file mode 100644 index 000000000..c60b80030 --- /dev/null +++ b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/ServiceBase.cs @@ -0,0 +1,122 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.MinimalAPIs; + +public abstract class ServiceBase : IService +{ + private ServiceProvider _serviceProvider = default!; + + public WebApplication App => _serviceProvider.GetRequiredService(); + + public string BaseUri { get; } + + public IServiceCollection Services { get; protected set; } + + public ServiceBase(IServiceCollection services) + { + Services = services; + _serviceProvider = services.BuildServiceProvider(); + } + + public ServiceBase(IServiceCollection services, string baseUri) + { + BaseUri = baseUri; + Services = services; + _serviceProvider = services.BuildServiceProvider(); + } + + public TService? GetService() => _serviceProvider.GetService(); + + public TService GetRequiredService() + where TService : notnull + => Services.BuildServiceProvider().GetRequiredService(); + + #region Map GET,POST,PUT,DELETE + + /// + /// Adds a to the that matches HTTP GET requests + /// for the specified pattern, a combination of and or name. + /// + /// The delegate executed when the endpoint is matched. It's name is a part of pattern if is null. + /// The custom uri. It is a part of pattern if it is not null. + /// Determines whether to remove the string 'Async' at the end. + /// A that can be used to further customize the endpoint. + protected RouteHandlerBuilder MapGet(Delegate handler, string? customUri = null, bool trimEndAsync = true) + { + customUri ??= FormatAction(handler.Method.Name, trimEndAsync); + + var pattern = CombineUris(BaseUri, customUri); + + return App.MapGet(pattern, handler); + } + + /// + /// Adds a to the that matches HTTP POST requests + /// for the specified pattern, a combination of and or name. + /// + /// The delegate executed when the endpoint is matched. It's name is a part of pattern if is null. + /// The custom uri. It is a part of pattern if it is not null. + /// Determines whether to remove the string 'Async' at the end. + /// A that can be used to further customize the endpoint. + protected RouteHandlerBuilder MapPost(Delegate handler, string? customUri = null, bool trimEndAsync = true) + { + customUri ??= FormatAction(handler.Method.Name, trimEndAsync); + + var pattern = CombineUris(BaseUri, customUri); + + return App.MapPost(pattern, handler); + } + + /// + /// Adds a to the that matches HTTP PUT requests + /// for the specified pattern, a combination of and or name. + /// + /// The delegate executed when the endpoint is matched. It's name is a part of pattern if is null. + /// The custom uri. It is a part of pattern if it is not null. + /// Determines whether to remove the string 'Async' at the end. + /// A that can be used to further customize the endpoint. + protected RouteHandlerBuilder MapPut(Delegate handler, string? customUri = null, bool trimEndAsync = true) + { + customUri ??= FormatAction(handler.Method.Name, trimEndAsync); + + var pattern = CombineUris(BaseUri, customUri); + + return App.MapPut(pattern, handler); + } + + /// + /// Adds a to the that matches HTTP DELETE requests + /// for the specified pattern, a combination of and or name. + /// + /// The delegate executed when the endpoint is matched. It's name is a part of pattern if is null. + /// The custom uri. It is a part of pattern if it is not null. + /// Determines whether to remove the string 'Async' at the end. + /// A that can be used to further customize the endpoint. + protected RouteHandlerBuilder MapDelete(Delegate handler, string? customUri = null, bool trimEndAsync = true) + { + customUri ??= FormatAction(handler.Method.Name, trimEndAsync); + + var pattern = CombineUris(BaseUri, customUri); + + return App.MapDelete(pattern, handler); + } + + private static string FormatAction(string action, bool trimEndAsync) + { + if (trimEndAsync && action.EndsWith("Async")) + { + var i = action.LastIndexOf("Async", StringComparison.Ordinal); + action = action[..i]; + } + + return action; + } + + private static string CombineUris(params string[] uris) + { + return string.Join("/", uris.Select(u => u.Trim('/'))); + } + + #endregion +} diff --git a/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..0469952dd --- /dev/null +++ b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/ServiceCollectionExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + /// + /// Add all classes that inherit from ServiceBase to Microsoft.Extensions.DependencyInjection.IServiceCollection + /// Notice: this method must be last call. + /// + /// The Microsoft.AspNetCore.Builder.WebApplicationBuilder. + /// + public static WebApplication AddServices(this WebApplicationBuilder builder) + => builder.Services.AddServices(builder); + + /// + /// Add all classes that inherit from ServiceBase to Microsoft.Extensions.DependencyInjection.IServiceCollection + /// Notice: this method must be last call. + /// + /// The Microsoft.Extensions.DependencyInjection.IServiceCollection to add the service to. + /// The Microsoft.AspNetCore.Builder.WebApplicationBuilder. + /// + public static WebApplication AddServices(this IServiceCollection services, WebApplicationBuilder builder) + { + if (services.All(service => service.ImplementationType != typeof(MinimalApisMarkerService))) + { + services.AddSingleton(); + services.TryAddScoped(sp => services); + + services.AddSingleton(new Lazy(() => builder.Build(), LazyThreadSafetyMode.ExecutionAndPublication)) + .AddTransient(serviceProvider => serviceProvider.GetRequiredService>().Value); + + services.AddServices(true, AppDomain.CurrentDomain.GetAssemblies()); + } + + var serviceProvider = services.BuildServiceProvider(); + return serviceProvider.GetRequiredService(); + } + + private class MinimalApisMarkerService + { + + } +} diff --git a/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs new file mode 100644 index 000000000..2f5e7b791 --- /dev/null +++ b/src/Contrib/Service/Masa.Contrib.Service.MinimalAPIs/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Service.MinimalAPIs; +global using Masa.Contrib.Service.MinimalAPIs; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.AspNetCore.Routing; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using System; +global using System.Linq; +global using System.Threading; diff --git a/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj b/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj new file mode 100644 index 000000000..687557e70 --- /dev/null +++ b/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/Masa.Contrib.Service.MinimalAPIs.Tests.csproj @@ -0,0 +1,29 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs b/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs new file mode 100644 index 000000000..da53223af --- /dev/null +++ b/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/MinimalAPITest.cs @@ -0,0 +1,51 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.MinimalAPIs.Tests; + +[TestClass] +public class MinimalAPITest +{ + private WebApplicationBuilder _builder; + + [TestInitialize] + public void Initialize() + { + _builder = WebApplication.CreateBuilder(); + } + + [TestMethod] + public void TestAddMultiServices() + { + _builder.Services.AddServices(_builder); + _builder.Services.AddServices(_builder); + var servicePrvider = _builder.Services.BuildServiceProvider(); + Assert.IsTrue(servicePrvider.GetServices>().Count() == 1); + } + + [TestMethod] + public void AddService() + { + var app = _builder.AddServices(); + Assert.IsTrue(_builder.Services.Any(service => service.ServiceType == typeof(CustomService) && service.Lifetime == ServiceLifetime.Scoped)); + + var servicePrvider = _builder.Services.BuildServiceProvider(); + var customService = servicePrvider.GetService(); + Assert.IsNotNull(customService); + + Assert.ReferenceEquals(customService.App, app); + + Assert.ReferenceEquals(customService.Services, _builder.Services); + + Assert.IsNotNull(customService.GetRequiredService()); + Assert.IsNotNull(customService.GetService()); + + Assert.IsTrue(customService.Test() == 1); + + var newCustomService = servicePrvider.CreateScope().ServiceProvider.GetService(); + Assert.IsNotNull(newCustomService); + + Assert.IsTrue(newCustomService.Test() == 1); + + } +} diff --git a/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs b/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs new file mode 100644 index 000000000..6b5750293 --- /dev/null +++ b/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/Services/CustomService.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Service.MinimalAPIs.Tests.Services; + +public class CustomService : ServiceBase +{ + private int _times = 0; + + public CustomService(IServiceCollection services) : base(services) + { + _times++; + } + + public int Test() => _times; +} diff --git a/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs b/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs new file mode 100644 index 000000000..627c06045 --- /dev/null +++ b/src/Contrib/Service/Tests/Masa.Contrib.Service.MinimalAPIs.Tests/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Contrib.Service.MinimalAPIs.Tests.Services; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/AuthClient.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/AuthClient.cs new file mode 100644 index 000000000..8e068c579 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/AuthClient.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth; + +public class AuthClient : IAuthClient +{ + public AuthClient(ICaller caller, IMultiEnvironmentUserContext userContext) + { + UserService = new UserService(caller, userContext); + SubjectService = new SubjectService(caller); + TeamService = new TeamService(caller, userContext); + ProjectService = new ProjectService(caller, userContext); + PermissionService = new PermissionService(caller, userContext); + } + + public IUserService UserService { get; } + + public ISubjectService SubjectService { get; } + + public ITeamService TeamService { get; } + + public IPermissionService PermissionService { get; } + + public IProjectService ProjectService { get; } +} + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Constants.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Constants.cs new file mode 100644 index 000000000..6ccb1b334 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Constants.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Auth; + +internal class Constants +{ + public const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.auth"; + + public const string ENVIRONMENT_KEY = "env_key"; +} + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs new file mode 100644 index 000000000..16bcddfe1 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/EnvironmentProvider.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Auth; + +public class EnvironmentProvider : IEnvironmentProvider +{ + readonly IMultiEnvironmentUserContext _multiEnvironmentUserContext; + + public EnvironmentProvider(IMultiEnvironmentUserContext multiEnvironmentUserContext) + { + _multiEnvironmentUserContext = multiEnvironmentUserContext; + } + + public string GetEnvironment() + { + return _multiEnvironmentUserContext.Environment ?? ""; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs new file mode 100644 index 000000000..f3a585544 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/HttpEnvironmentDelegatingHandler.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Auth; + +public class HttpEnvironmentDelegatingHandler : DelegatingHandler +{ + readonly IHttpContextAccessor _httpContextAccessor; + readonly IEnvironmentProvider _environmentProvider; + + public HttpEnvironmentDelegatingHandler(IHttpContextAccessor httpContextAccessor, IEnvironmentProvider environmentProvider) + { + _httpContextAccessor = httpContextAccessor; + _environmentProvider = environmentProvider; + } + + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + var envClaim = _httpContextAccessor.HttpContext?.User.Claims.FirstOrDefault(c => c.Type == "env"); + if (envClaim != null) + { + _httpContextAccessor.HttpContext?.Items.TryAdd(ENVIRONMENT_KEY, _environmentProvider.GetEnvironment()); + request.Headers.Add(ENVIRONMENT_KEY, _environmentProvider.GetEnvironment()); + } + return await base.SendAsync(request, cancellationToken); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj new file mode 100644 index 000000000..8dce63758 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.md new file mode 100644 index 000000000..1002e93ed --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.md @@ -0,0 +1,46 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.StackSdks.Auth + +Injecting IAuthClient interface,cal the service to obtain the capabilities provided by the auth SDK. +SDK need to get current user ID dependency Masa.Contrib.Identity.IdentityModel(../../Identity/Masa.Contrib.Identity.IdentityModel/README.zh,Therefore,the identitymodel service needs to be added before use. + +### Service Introduction + +```c# +IAuthClient +├── UserService +├── SubjectService +├── TeamService +├── PermissionService +└── ProjectService +``` + +### Use Introduction + +#### Install dependent package + +```C# +Install-Package Masa.Contrib.StackSdks.Auth +``` + +#### Register auth service + +```C# +builder.Services.AddAuthClient("http://authservice.com"); +``` + +> `http://authservice.com` is auth service address + +#### Dependency injection IAuthClient + +```c# +var app = builder.Build(); + +app.MapGet("/GetTeams", ([FromServices] IAuthClient authClient) => +{ + return authClient.TeamService.GetAllAsync(); +}); + +app.Run(); +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md new file mode 100644 index 000000000..c96527330 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md @@ -0,0 +1,45 @@ +中 | [EN](README.md) + +## Masa.Contrib.StackSdks.Auth + +通过注入IAuthClient接口,调用对应Service获取Auth SDK 提供的能力。 +SDK获取当前用户ID依赖Masa.Contrib.Identity.IdentityModel(../../Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.zh,所以使用前需添加IdentityModel服务。 + +### 服务介绍 +```c# +IAuthClient +├── UserService 用户服务 +├── SubjectService 全局搜索用户、角色、团队、组织架构 +├── TeamService 团队服务 +├── PermissionService 权限、菜单服务 +└── ProjectService 全局导航服务 +``` + +### 使用介绍 + +#### 安装依赖包 + +```C# +Install-Package Masa.Contrib.StackSdks.Auth +``` + +#### 注册相关服务 + +```C# +builder.Services.AddAuthClient("http://authservice.com"); +``` + +> `http://authservice.com` 为Auth后台服务地址 + +#### 依赖注入IAuthClient + +```c# +var app = builder.Build(); + +app.MapGet("/GetTeams", ([FromServices] IAuthClient authClient) => +{ + return authClient.TeamService.GetAllAsync(); +}); + +app.Run(); +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs new file mode 100644 index 000000000..d842e5337 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/PermissionService.cs @@ -0,0 +1,75 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Auth.Service; + +public class PermissionService : IPermissionService +{ + readonly ICaller _caller; + readonly IUserContext _userContext; + + const string PART = "api/permission/"; + + public PermissionService(ICaller caller, IUserContext userContext) + { + _caller = caller; + _userContext = userContext; + } + + //todo remove userId param + public async Task AuthorizedAsync(string appId, string code) + { + var userId = _userContext.GetUserId(); + var requestUri = $"{PART}authorized?appId={appId}&code={code}&userId={userId}"; + return await _caller.GetAsync(requestUri); + } + + public async Task> GetMenusAsync(string appId) + { + var userId = _userContext.GetUserId(); + var requestUri = $"{PART}menus?appId={appId}&userId={userId}"; + return await _caller.GetAsync>(requestUri, default) ?? new(); + } + + public async Task> GetElementPermissionsAsync(string appId) + { + var userId = _userContext.GetUserId(); + var requestUri = $"{PART}element-permissions?appId={appId}&userId={userId}"; + return await _caller.GetAsync>(requestUri, default) ?? new(); + } + + public async Task AddFavoriteMenuAsync(Guid menuId) + { + try + { + var userId = _userContext.GetUserId(); + await _caller.PutAsync($"{PART}addFavoriteMenu?permissionId={menuId}&userId={userId}", null); + return true; + } + catch + { + return false; + } + } + + public async Task RemoveFavoriteMenuAsync(Guid menuId) + { + try + { + var userId = _userContext.GetUserId(); + await _caller.PutAsync($"{PART}removeFavoriteMenu?permissionId={menuId}&userId={userId}", null); + return true; + } + catch + { + return false; + } + } + + public async Task> GetFavoriteMenuListAsync() + { + var userId = _userContext.GetUserId(); + var requestUri = $"{PART}menu-favorite-list?userId={userId}"; + return await _caller.GetAsync>(requestUri, default) ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs new file mode 100644 index 000000000..56ad9f017 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/ProjectService.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Auth.Service; + +public class ProjectService : IProjectService +{ + readonly ICaller _caller; + readonly IMultiEnvironmentUserContext _multiEnvironmentUserContext; + + const string PARTY = "api/project/"; + + public ProjectService(ICaller caller, IMultiEnvironmentUserContext multiEnvironmentUserContext) + { + _caller = caller; + _multiEnvironmentUserContext = multiEnvironmentUserContext; + } + + public async Task> GetGlobalNavigations() + { + var userId = _multiEnvironmentUserContext.GetUserId(); + var environment = _multiEnvironmentUserContext.Environment ?? ""; + var requestUri = $"{PARTY}navigations?userId={userId}&environment={environment}"; + return await _caller.GetAsync>(requestUri) ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs new file mode 100644 index 000000000..951b1d275 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/SubjectService.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Auth.Service; + +public class SubjectService : ISubjectService +{ + readonly ICaller _caller; + + public SubjectService(ICaller caller) + { + _caller = caller; + } + + public async Task> GetListAsync(string filter) + { + var requestUri = $"api/subject/getList"; + return await _caller.GetAsync>(requestUri, new { filter }) ?? new(); + } +} + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs new file mode 100644 index 000000000..0be09d4ef --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/TeamService.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Auth.Service; + +public class TeamService : ITeamService +{ + readonly ICaller _caller; + readonly string _party = "api/team/"; + readonly IUserContext _userContext; + + public TeamService(ICaller caller, IUserContext userContext) + { + _caller = caller; + _userContext = userContext; + } + + public async Task GetDetailAsync(Guid id) + { + var requestUri = $"{_party}detail"; + return await _caller.GetAsync(requestUri, new { id }); + } + + public async Task> GetListAsync(Guid userId = default) + { + var requestUri = $"{_party}list"; + if (Guid.Empty != userId) + { + requestUri = $"{requestUri}?userId={userId}"; + } + return await _caller.GetAsync>(requestUri) ?? new(); + } + + public async Task> GetAllAsync() + { + var requestUri = $"{_party}list"; + return await _caller.GetAsync>(requestUri) ?? new(); + } + + public async Task> GetUserTeamsAsync() + { + var userId = _userContext.GetUserId(); + var requestUri = $"{_party}list?userId={userId}"; + return await _caller.GetAsync>(requestUri) ?? new(); + } +} + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs new file mode 100644 index 000000000..04f804f52 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Service/UserService.cs @@ -0,0 +1,172 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Auth.Service; + +public class UserService : IUserService +{ + readonly ICaller _caller; + readonly IUserContext _userContext; + + public UserService(ICaller caller, IUserContext userContext) + { + _caller = caller; + _userContext = userContext; + } + + public async Task AddAsync(AddUserModel user) + { + var requestUri = $"api/user/addExternal"; + return await _caller.PostAsync(requestUri, user); + } + + public async Task UpsertAsync(UpsertUserModel user) + { + var requestUri = $"api/user/upsertExternal"; + return await _caller.PostAsync(requestUri, user); + } + + public async Task> GetListByDepartmentAsync(Guid departmentId) + { + var requestUri = $"api/staff/getListByDepartment"; + return await _caller.GetAsync>(requestUri, new { id = departmentId }) ?? new(); + } + + public async Task> GetListByRoleAsync(Guid roleId) + { + var requestUri = $"api/staff/getListByRole"; + return await _caller.GetAsync>(requestUri, new { id = roleId }) ?? new(); + } + + public async Task> GetListByTeamAsync(Guid teamId) + { + var requestUri = $"api/staff/getListByTeam"; + return await _caller.GetAsync>(requestUri, new { id = teamId }) ?? new(); + } + + public async Task GetTotalByDepartmentAsync(Guid departmentId) + { + var requestUri = $"api/staff/getTotalByDepartment"; + return await _caller.GetAsync(requestUri, new { id = departmentId }); + } + + public async Task GetTotalByRoleAsync(Guid roleId) + { + var requestUri = $"api/staff/getTotalByRole"; + return await _caller.GetAsync(requestUri, new { id = roleId }); + } + + public async Task GetTotalByTeamAsync(Guid teamId) + { + var requestUri = $"api/staff/getTotalByTeam"; + return await _caller.GetAsync(requestUri, new { id = teamId }); + } + + public async Task ValidateCredentialsByAccountAsync(string account, string password, bool isLdap = false) + { + var requestUri = $"api/user/validateByAccount"; + return await _caller.PostAsync(requestUri, new { account, password, isLdap }); + } + + public async Task FindByAccountAsync(string account) + { + var requestUri = $"api/user/findByAccount"; + return await _caller.GetAsync(requestUri, new { account }) ?? new(); + } + + public async Task FindByPhoneNumberAsync(string phoneNumber) + { + var requestUri = $"api/user/findByPhoneNumber"; + return await _caller.GetAsync(requestUri, new { phoneNumber }); + } + + public async Task FindByEmailAsync(string email) + { + var requestUri = $"api/user/findByEmail"; + return await _caller.GetAsync(requestUri, new { email }); + } + + public async Task GetCurrentUserAsync() + { + var id = _userContext.GetUserId(); + var requestUri = $"api/user/findById"; + return await _caller.GetAsync(requestUri, new { id }) ?? new(); + } + + public async Task GetCurrentStaffAsync() + { + var userId = _userContext.GetUserId(); + var requestUri = $"api/staff/getExternalByUserId"; + return await _caller.GetAsync(requestUri, new { userId }); + } + + public async Task VisitedAsync(string url) + { + var userId = _userContext.GetUserId(); + var requestUri = $"api/user/visit"; + await _caller.PostAsync(requestUri, new { UserId = userId, Url = url }, true); + } + + public async Task> GetVisitedListAsync() + { + var userId = _userContext.GetUserId(); + var requestUri = $"api/user/visitedList"; + return (await _caller.GetAsync>(requestUri, new { userId = userId })) ?? new(); + } + + public async Task UpdatePasswordAsync(UpdateUserPasswordModel user) + { + if (user.Id == Guid.Empty) + { + user.Id = _userContext.GetUserId(); + } + var requestUri = $"api/user/updatePassword"; + await _caller.PutAsync(requestUri, user); + } + + public async Task UpdateBasicInfoAsync(UpdateUserBasicInfoModel user) + { + if (user.Id == Guid.Empty) + { + user.Id = _userContext.GetUserId(); + } + var requestUri = $"api/user/updateBasicInfo"; + await _caller.PutAsync(requestUri, user); + } + + public async Task> GetUserPortraitsAsync(params Guid[] userIds) + { + var requestUri = $"api/user/portraits"; + return await _caller.PostAsync>(requestUri, userIds) ?? new(); + } + + public async Task SaveUserSystemDataAsync(string systemId, T data) + { + var userId = _userContext.GetUserId(); + var requestUri = $"api/user/UserSystemData"; + await _caller.PostAsync(requestUri, + new { UserId = userId, SystemId = systemId, Data = JsonSerializer.Serialize(data) }, + true); + } + + public async Task GetUserSystemDataAsync(string systemId) + { + var userId = _userContext.GetUserId(); + var requestUri = $"api/user/GetUserSystemData"; + var data = await _caller.GetAsync(requestUri, new { userId = userId, systemId = systemId }); + return JsonSerializer.Deserialize(data); + } + + public async Task DisableUserAsync(DisableUserModel user) + { + var requestUri = $"api/user/disable"; + return await _caller.PutAsync(requestUri, user); + } + + public async Task> GetListByAccountAsync(IEnumerable accounts) + { + var requestUri = $"api/user/GetListByAccount"; + return await _caller.GetAsync>(requestUri, new { accounts }) ?? new(); + } +} + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..806af9775 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/ServiceCollectionExtensions.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddAuthClient(this IServiceCollection services, string authServiceBaseAddress) + { + ArgumentNullException.ThrowIfNull(authServiceBaseAddress, nameof(authServiceBaseAddress)); + return services.AddAuthClient(callerOptions => + { + callerOptions.UseHttpClient(builder => + { + builder.Name = DEFAULT_CLIENT_NAME; + builder.Configure = opt => opt.BaseAddress = new Uri(authServiceBaseAddress); + }).AddHttpMessageHandler(); + }); + } + + public static IServiceCollection AddAuthClient(this IServiceCollection services, Action callerOptions) + { + ArgumentNullException.ThrowIfNull(callerOptions, nameof(callerOptions)); + + if (services.All(service => service.ServiceType != typeof(IMultiEnvironmentUserContext))) + throw new Exception("Please add IMultiEnvironmentUserContext first."); + + services.AddHttpContextAccessor(); + services.AddScoped(); + services.AddScoped(); + services.AddCaller(callerOptions); + + services.AddScoped(serviceProvider => + { + var userContext = serviceProvider.GetRequiredService(); + var callProvider = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); + var authClient = new AuthClient(callProvider, userContext); + return authClient; + }); + + return services; + } +} + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs new file mode 100644 index 000000000..20f702dd3 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Auth; +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; +global using Masa.BuildingBlocks.StackSdks.Auth.Service; +global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Masa.Contrib.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Contrib.StackSdks.Auth; +global using Microsoft.AspNetCore.Http; +global using System.Text.Json; +global using static Masa.Contrib.StackSdks.Auth.Constants; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/DccClient.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/DccClient.cs new file mode 100644 index 000000000..51cb140f6 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/DccClient.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Dcc.Service; + +namespace Masa.Contrib.StackSdks.Dcc; + +public class DccClient : IDccClient +{ + public DccClient(IDistributedCacheClient distributedCacheClient) + { + LabelService = new LabelService(distributedCacheClient); + } + + public ILabelService LabelService { get; } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs new file mode 100644 index 000000000..34bd828b5 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Internal/Constants.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Dcc.Internal +{ + internal class Constants + { + internal const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.dcc"; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj new file mode 100644 index 000000000..957d8ca85 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Masa.Contrib.StackSdks.Dcc.csproj @@ -0,0 +1,16 @@ + + + + net6.0 + enable + enable + + + + + + + + + + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md new file mode 100644 index 000000000..7761d2106 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/README.md @@ -0,0 +1,54 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.StackSdks.Dcc + +Effect: + +Obtain relevant data of Dcc service through DccClient,If you need to use the configuration related capabilities, please refer to the[document](../../Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md) + +```c# +IDccClient +├── LabelService Label service +``` + +Example: + +```C# +Install-Package Masa.Contrib.StackSdks.Dcc +``` + +appsettings.json + +```json +{ + "DccOptions": { + "RedisOptions": { + "Servers": [ + { + "Host": "localhost", + "Port": 8889 + } + ], + "DefaultDatabase": 0, + "Password": "" + } + } +} +``` + +```C# +builder.Services.AddDccClient(); +``` + +How to use: + +```c# +var app = builder.Build(); + +app.MapGet("/GetProjectTypes", ([FromServices] IDccClient dccClient, string typeCode) => +{ + return dccClient.LabelService.GetListByTypeCodeAsync(typeCode); +}); + +app.Run(); +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md new file mode 100644 index 000000000..aa18c6961 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/README.zh-CN.md @@ -0,0 +1,54 @@ +中 | [EN](README.md) + +## Masa.Contrib.StackSdks.Dcc + +作用: + +通过DccClient获取Dcc服务的相关数据,如需使用配置相关能力请查看[文档](../../Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md) + +```c# +IDccClient +├── LabelService 标签服务 +``` + +用例: + +```C# +Install-Package Masa.Contrib.StackSdks.Dcc +``` + +appsettings.json + +```json +{ + "DccOptions": { + "RedisOptions": { + "Servers": [ + { + "Host": "localhost", + "Port": 8889 + } + ], + "DefaultDatabase": 0, + "Password": "" + } + } +} +``` + +```C# +builder.Services.AddDccClient(); +``` + +如何使用: + +```c# +var app = builder.Build(); + +app.MapGet("/GetProjectTypes", ([FromServices] IDccClient dccClient, string typeCode) => +{ + return dccClient.LabelService.GetListByTypeCodeAsync(typeCode); +}); + +app.Run(); +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs new file mode 100644 index 000000000..2027a94d8 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/Service/LabelService.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Dcc.Service; + +public class LabelService : ILabelService +{ + private readonly IDistributedCacheClient _distributedCacheClient; + + public LabelService(IDistributedCacheClient distributedCacheClient) + { + _distributedCacheClient = distributedCacheClient; + } + + public async Task> GetListByTypeCodeAsync(string typeCode) + { + var result = await _distributedCacheClient.GetAsync>(typeCode); + + return result ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..ed7d4fddf --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/ServiceCollectionExtensions.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static void AddDccClient(this IServiceCollection services) + { + var options = AppSettings.GetModel("DccOptions:RedisOptions"); + services.AddMasaRedisCache(DEFAULT_CLIENT_NAME, options); + + services.AddSingleton(serviceProvider => + { + var client = serviceProvider.GetRequiredService() + .CreateClient(DEFAULT_CLIENT_NAME); + + return new DccClient(client); + }); + } + + public static void AddDccClient(this IServiceCollection services, Action options) + { + services.AddMasaRedisCache(DEFAULT_CLIENT_NAME, options); + + services.AddSingleton(serviceProvider => + { + var client = serviceProvider.GetRequiredService() + .CreateClient(DEFAULT_CLIENT_NAME); + + return new DccClient(client); + }); + } + + public static void AddDccClient(this IServiceCollection services, RedisConfigurationOptions options) + { + services.AddMasaRedisCache(DEFAULT_CLIENT_NAME, options); + + services.AddSingleton(serviceProvider => + { + var client = serviceProvider.GetRequiredService() + .CreateClient(DEFAULT_CLIENT_NAME); + + return new DccClient(client); + }); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs new file mode 100644 index 000000000..d6da4100d --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Dcc/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Dcc; +global using Masa.BuildingBlocks.StackSdks.Dcc.Model; +global using Masa.BuildingBlocks.StackSdks.Dcc.Service; +global using Masa.Contrib.StackSdks.Dcc; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Redis.Models; +global using Masa.Utils.Configuration.Json; +global using static Masa.Contrib.StackSdks.Dcc.Internal.Constants; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Constants.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Constants.cs new file mode 100644 index 000000000..303977772 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Constants.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc; + +internal class Constants +{ + public const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.mc"; +} + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs new file mode 100644 index 000000000..c332463de --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/HttpClientAuthorizationDelegatingHandler.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc; + +public class HttpClientAuthorizationDelegatingHandler : DelegatingHandler +{ + private readonly IHttpContextAccessor _httpContextAccessor; + + public HttpClientAuthorizationDelegatingHandler(IHttpContextAccessor httpContextAccessor) + { + _httpContextAccessor = httpContextAccessor; + } + + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + if (_httpContextAccessor.HttpContext != null) + { + var accessToken = await _httpContextAccessor.HttpContext.GetTokenAsync("access_token"); + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken); + } + return await base.SendAsync(request, cancellationToken); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs new file mode 100644 index 000000000..189f232c5 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/DictionaryExtensions.cs @@ -0,0 +1,118 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc.Infrastructure.Extensions; + +/// +/// Extension methods for Dictionary. +/// +public static class DictionaryExtensions +{ + /// + /// This method is used to try to get a value in a dictionary if it does exists. + /// + /// Type of the value + /// The collection object + /// Key + /// Value of the key (or default value if key not exists) + /// True if key does exists in the dictionary + internal static bool TryGetValue(this IDictionary dictionary, string key, out T value) + { + object valueObj; + if (dictionary.TryGetValue(key, out valueObj) && valueObj is T) + { + value = (T)valueObj; + return true; + } + + value = default; + return false; + } + + /// + /// Gets a value from the dictionary with given key. Returns default value if can not find. + /// + /// Dictionary to check and get + /// Key to find the value + /// Type of the key + /// Type of the value + /// Value if found, default if can not found. + public static TValue? GetOrDefault(this IDictionary dictionary, TKey key) + { + return dictionary.TryGetValue(key, out var obj) ? obj : default; + } + + /// + /// Gets a value from the dictionary with given key. Returns default value if can not find. + /// + /// Dictionary to check and get + /// Key to find the value + /// Type of the key + /// Type of the value + /// Value if found, default if can not found. + public static TValue? GetOrDefault(this IReadOnlyDictionary dictionary, TKey key) + { + return dictionary.TryGetValue(key, out var obj) ? obj : default; + } + + /// + /// Gets a value from the dictionary with given key. Returns default value if can not find. + /// + /// Dictionary to check and get + /// Key to find the value + /// Type of the key + /// Type of the value + /// Value if found, default if can not found. + public static TValue? GetOrDefault(this ConcurrentDictionary dictionary, TKey key) + { + return dictionary.TryGetValue(key, out var obj) ? obj : default; + } + + /// + /// Gets a value from the dictionary with given key. Returns default value if can not find. + /// + /// Dictionary to check and get + /// Key to find the value + /// A factory method used to create the value if not found in the dictionary + /// Type of the key + /// Type of the value + /// Value if found, default if can not found. + public static TValue GetOrAdd(this IDictionary dictionary, [NotNull] TKey key, Func factory) + { + TValue obj; + if (dictionary.TryGetValue(key, out obj)) + { + return obj; + } + + return dictionary[key] = factory(key); + } + + /// + /// Gets a value from the dictionary with given key. Returns default value if can not find. + /// + /// Dictionary to check and get + /// Key to find the value + /// A factory method used to create the value if not found in the dictionary + /// Type of the key + /// Type of the value + /// Value if found, default if can not found. + public static TValue GetOrAdd(this IDictionary dictionary, [NotNull] TKey key, Func factory) + { + return dictionary.GetOrAdd(key, k => factory()); + } + + /// + /// Gets a value from the concurrent dictionary with given key. Returns default value if can not find. + /// + /// Concurrent dictionary to check and get + /// Key to find the value + /// A factory method used to create the value if not found in the dictionary + /// Type of the key + /// Type of the value + /// Value if found, default if can not found. + public static TValue GetOrAdd(this ConcurrentDictionary dictionary, [NotNull] TKey key, Func factory) + { + return dictionary.GetOrAdd(key, k => factory()); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs new file mode 100644 index 000000000..0af3e10dd --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Extensions/ExtraPropertiesExtensions.cs @@ -0,0 +1,61 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc.Infrastructure.Extensions; + +public static class ExtraPropertiesExtensions +{ + public static bool HasProperty(this ExtraPropertyDictionary source, string name) + { + return source.ContainsKey(name); + } + + public static object GetProperty(this ExtraPropertyDictionary source, string name, object defaultValue = null) + { + return source.GetOrDefault(name) + ?? defaultValue; + } + + public static TProperty GetProperty(this ExtraPropertyDictionary source, string name, TProperty defaultValue = default) + { + var value = source.GetProperty(name); + if (value == null) + { + return defaultValue; + } + + if (TypeHelper.IsPrimitiveExtended(typeof(TProperty), includeEnums: true)) + { + var conversionType = typeof(TProperty); + if (TypeHelper.IsNullable(conversionType)) + { + conversionType = conversionType.GetFirstGenericArgumentIfNullable(); + } + + if (conversionType == typeof(Guid)) + { + return (TProperty)TypeDescriptor.GetConverter(conversionType).ConvertFromInvariantString(value.ToString()); + } + + if (conversionType == typeof(DateTimeOffset)) + { + return (TProperty)TypeDescriptor.GetConverter(conversionType).ConvertFromInvariantString(value.ToString()); + } + + return (TProperty)Convert.ChangeType(value?.ToString(), conversionType, CultureInfo.InvariantCulture); + } + + throw new Exception("GetProperty does not support non-primitive types. Use non-generic GetProperty method and handle type casting manually."); + } + + public static TSource SetProperty( + this TSource source, + string name, + object value) + where TSource : ExtraPropertyDictionary + { + source[name] = value; + + return source; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs new file mode 100644 index 000000000..9c62f2d6e --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Infrastructure/Helper/TypeHelper.cs @@ -0,0 +1,170 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc.Infrastructure.Helper; + +public static class TypeHelper +{ + private static readonly HashSet FloatingTypes = new HashSet + { + typeof(float), + typeof(double), + typeof(decimal) + }; + + private static readonly HashSet NonNullablePrimitiveTypes = new HashSet + { + typeof(byte), + typeof(short), + typeof(int), + typeof(long), + typeof(sbyte), + typeof(ushort), + typeof(uint), + typeof(ulong), + typeof(bool), + typeof(float), + typeof(decimal), + typeof(DateTime), + typeof(DateTimeOffset), + typeof(TimeSpan), + typeof(Guid) + }; + + public static bool IsNonNullablePrimitiveType(Type type) + { + return NonNullablePrimitiveTypes.Contains(type); + } + + public static bool IsFunc(object obj) + { + if (obj == null) + { + return false; + } + + var type = obj.GetType(); + if (!type.GetTypeInfo().IsGenericType) + { + return false; + } + + return type.GetGenericTypeDefinition() == typeof(Func<>); + } + + public static bool IsFunc(object obj) + { + return obj != null && obj.GetType() == typeof(Func); + } + + public static bool IsPrimitiveExtended(Type type, bool includeNullables = true, bool includeEnums = false) + { + if (IsPrimitiveExtendedInternal(type, includeEnums)) + { + return true; + } + + if (includeNullables && IsNullable(type) && type.GenericTypeArguments.Any()) + { + return IsPrimitiveExtendedInternal(type.GenericTypeArguments[0], includeEnums); + } + + return false; + } + + public static bool IsNullable(Type type) + { + return type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); + } + + public static Type GetFirstGenericArgumentIfNullable(this Type t) + { + if (t.GetGenericArguments().Length > 0 && t.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return t.GetGenericArguments().FirstOrDefault(); + } + + return t; + } + + private static bool IsPrimitiveExtendedInternal(Type type, bool includeEnums) + { + if (type.IsPrimitive) + { + return true; + } + + if (includeEnums && type.IsEnum) + { + return true; + } + + return type == typeof(string) || + type == typeof(decimal) || + type == typeof(DateTimeOffset) || + type == typeof(DateTimeOffset) || + type == typeof(TimeSpan) || + type == typeof(Guid); + } + + public static T? GetDefaultValue() + { + return default; + } + + public static object? GetDefaultValue(Type type) + { + if (type.IsValueType) + { + return Activator.CreateInstance(type); + } + + return null; + } + + public static bool IsFloatingType(Type type, bool includeNullable = true) + { + if (FloatingTypes.Contains(type)) + { + return true; + } + + if (includeNullable && + IsNullable(type) && + FloatingTypes.Contains(type.GenericTypeArguments[0])) + { + return true; + } + + return false; + } + + public static object ConvertFrom(object value) + { + return ConvertFrom(typeof(TTargetType), value); + } + + public static object ConvertFrom(Type targetType, object value) + { + return TypeDescriptor + .GetConverter(targetType) + .ConvertFrom(value); + } + + public static Type StripNullable(Type type) + { + return IsNullable(type) + ? type.GenericTypeArguments[0] + : type; + } + + public static bool IsDefaultValue(object obj) + { + if (obj == null) + { + return true; + } + + return obj.Equals(GetDefaultValue(obj.GetType())); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj new file mode 100644 index 000000000..83550a77c --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Masa.Contrib.StackSdks.Mc.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/McClient.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/McClient.cs new file mode 100644 index 000000000..fc89ba5c5 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/McClient.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc; + +public class McClient: IMcClient +{ + public McClient(ICaller caller) + { + ChannelService = new ChannelService(caller); + MessageTaskService = new MessageTaskService(caller); + MessageTemplateService = new MessageTemplateService(caller); + ReceiverGroupService = new ReceiverGroupService(caller); + WebsiteMessageService = new WebsiteMessageService(caller); + } + + public IChannelService ChannelService { get; } + + public IMessageTaskService MessageTaskService { get; } + + public IMessageTemplateService MessageTemplateService { get; } + + public IReceiverGroupService ReceiverGroupService { get; } + + public IWebsiteMessageService WebsiteMessageService { get; } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs new file mode 100644 index 000000000..b4698a133 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ChannelService.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc.Service; + +public class ChannelService : IChannelService +{ + readonly ICaller _caller; + readonly string _party = "api/channel"; + + public ChannelService(ICaller caller) + { + _caller = caller; + } + + public async Task GetAsync(Guid id) + { + var requestUri = $"{_party}/{id}"; + return await _caller.GetAsync(requestUri); + } + + public async Task> GetListAsync(GetChannelModel options) + { + var requestUri = $"{_party}"; + return await _caller.GetAsync>(requestUri, options) ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs new file mode 100644 index 000000000..d467c7041 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTaskService.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc.Service; + +public class MessageTaskService : IMessageTaskService +{ + readonly ICaller _caller; + readonly string _party = "api/message-task"; + + public MessageTaskService(ICaller caller) + { + _caller = caller; + } + + public async Task GetAsync(Guid id) + { + var requestUri = $"{_party}/{id}"; + return await _caller.GetAsync(requestUri); + } + + public async Task SendOrdinaryMessageAsync(SendOrdinaryMessageModel options) + { + var requestUri = $"{_party}/SendOrdinaryMessage"; + await _caller.PostAsync(requestUri, options); + } + + public async Task SendTemplateMessageAsync(SendTemplateMessageModel options) + { + var requestUri = $"{_party}/SendTemplateMessage"; + await _caller.PostAsync(requestUri, options); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs new file mode 100644 index 000000000..514e10c31 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/MessageTemplateService.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc.Service; + +public class MessageTemplateService : IMessageTemplateService +{ + readonly ICaller _caller; + readonly string _party = "api/message-template"; + + public MessageTemplateService(ICaller caller) + { + _caller = caller; + } + + public async Task GetAsync(Guid id) + { + var requestUri = $"{_party}/{id}"; + return await _caller.GetAsync(requestUri); + } + + public async Task> GetListAsync(GetMessageTemplateModel options) + { + var requestUri = $"{_party}"; + return await _caller.GetAsync>(requestUri, options) ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs new file mode 100644 index 000000000..500b1b8b2 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/ReceiverGroupService.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc.Service; + +public class ReceiverGroupService : IReceiverGroupService +{ + readonly ICaller _caller; + readonly string _party = "api/receiver-group"; + + public ReceiverGroupService(ICaller caller) + { + _caller = caller; + } + + public async Task GetAsync(Guid id) + { + var requestUri = $"{_party}/{id}"; + return await _caller.GetAsync(requestUri); + } + + public async Task> GetListAsync(GetReceiverGroupModel options) + { + var requestUri = $"{_party}"; + return await _caller.GetAsync>(requestUri, options) ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs new file mode 100644 index 000000000..50d900667 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/Service/WebsiteMessageService.cs @@ -0,0 +1,72 @@ +namespace Masa.Contrib.StackSdks.Mc.Service; + +public class WebsiteMessageService : IWebsiteMessageService +{ + readonly ICaller _caller; + readonly string _party = "api/website-message"; + + public WebsiteMessageService(ICaller caller) + { + _caller = caller; + } + + public async Task CheckAsync() + { + var requestUri = $"{_party}/Check"; + await _caller.PostAsync(requestUri, null); + } + + public async Task DeleteAsync(Guid id) + { + var requestUri = $"{_party}/{id}"; + await _caller.DeleteAsync(requestUri, null); + } + + public async Task GetAsync(Guid id) + { + var requestUri = $"{_party}/{id}"; + return await _caller.GetAsync(requestUri); + } + + public async Task> GetChannelListAsync() + { + var requestUri = $"{_party}/GetChannelList"; + return await _caller.GetAsync>(requestUri)??new(); + } + + public async Task> GetListAsync(GetWebsiteMessageModel options) + { + var requestUri = $"{_party}"; + return await _caller.GetAsync>(requestUri, options) ?? new(); + } + + public async Task> GetNoticeListAsync(GetNoticeListModel options) + { + var requestUri = $"{_party}/GetNoticeList"; + return await _caller.GetAsync>(requestUri, options) ?? new(); + } + + public async Task ReadAsync(ReadWebsiteMessageModel options) + { + var requestUri = $"{_party}/Read"; + await _caller.PostAsync(requestUri, options); + } + + public async Task SetAllReadAsync(ReadAllWebsiteMessageModel options) + { + var requestUri = $"{_party}/SetAllRead"; + await _caller.PostAsync(requestUri, options); + } + + public async Task SendCheckNotificationAsync() + { + var requestUri = $"{_party}/SendCheckNotification"; + await _caller.PostAsync(requestUri, null); + } + + public async Task SendGetNotificationAsync(List userIds) + { + var requestUri = $"{_party}/SendGetNotification"; + await _caller.PostAsync(requestUri, userIds); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..6d039e5eb --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/ServiceCollectionExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddMcClient(this IServiceCollection services, string mcServiceBaseAddress) + { + if (string.IsNullOrWhiteSpace(mcServiceBaseAddress)) + { + throw new ArgumentNullException(nameof(mcServiceBaseAddress)); + } + + return services.AddMcClient(callerOptions => + { + callerOptions.UseHttpClient(builder => + { + builder.Name = DEFAULT_CLIENT_NAME; + builder.Configure = opt => opt.BaseAddress = new Uri(mcServiceBaseAddress); + }).AddHttpMessageHandler(); + }); + } + + public static IServiceCollection AddMcClient(this IServiceCollection services, Action callerOptions) + { + ArgumentNullException.ThrowIfNull(callerOptions, nameof(callerOptions)); + + if (services.Any(service => service.ServiceType == typeof(IMcClient))) + return services; + + services.AddHttpContextAccessor(); + services.AddScoped(); + services.AddCaller(callerOptions); + + services.AddScoped(serviceProvider => + { + var callProvider = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); + var mcCaching = new McClient(callProvider); + return mcCaching; + }); + + return services; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs new file mode 100644 index 000000000..5d3a074ce --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Mc; +global using Masa.BuildingBlocks.StackSdks.Mc.Model; +global using Masa.BuildingBlocks.StackSdks.Mc.Service; +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Masa.Contrib.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Contrib.StackSdks.Mc; +global using Masa.Contrib.StackSdks.Mc.Infrastructure.Helper; +global using Microsoft.AspNetCore.Authentication; +global using Microsoft.AspNetCore.Http; +global using System.Collections.Concurrent; +global using System.ComponentModel; +global using System.Diagnostics.CodeAnalysis; +global using System.Globalization; +global using System.Reflection; +global using static Masa.Contrib.StackSdks.Mc.Constants; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Constants.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Constants.cs new file mode 100644 index 000000000..38ebfe1e9 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Constants.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Pm; + +public class Constants +{ + internal const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.pm"; +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj new file mode 100644 index 000000000..da976202f --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Masa.Contrib.StackSdks.Pm.csproj @@ -0,0 +1,18 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/PmClient.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/PmClient.cs new file mode 100644 index 000000000..2c90caf79 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/PmClient.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm; +using Masa.BuildingBlocks.StackSdks.Pm.Service; +using Masa.Contrib.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm; + +public class PmClient : IPmClient +{ + public PmClient(ICaller caller) + { + EnvironmentService = new EnvironmentService(caller); + ClusterService = new ClusterService(caller); + ProjectService = new ProjectService(caller); + AppService = new AppService(caller); + } + + public IProjectService ProjectService { get; init; } + + public IEnvironmentService EnvironmentService { get; init; } + + public IClusterService ClusterService { get; init; } + + public IAppService AppService { get; init; } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/README.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/README.md new file mode 100644 index 000000000..65f5356d1 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/README.md @@ -0,0 +1,38 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.StackSdks.Pm + +Effect: + +Obtain relevant data of Pm service through pmclient + +```c# +IPmClient +├── EnvironmentService Environment service +├── ClusterService Cluster service +├── ProjectService Project service +├── AppService App service +``` + +Example: + +```C# +Install-Package Masa.Contrib.StackSdks.Pm +``` + +```C# +builder.Services.AddPmClient("Pm service address"); +``` + +How to use: + +```c# +var app = builder.Build(); + +app.MapGet("/GetProjectApps", ([FromServices] IPmClient pmClient) => +{ + return pmClient.ProjectService.GetProjectAppsAsync("development"); +}); + +app.Run(); +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md new file mode 100644 index 000000000..d0d654591 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/README.zh-CN.md @@ -0,0 +1,38 @@ +中 | [EN](README.md) + +## Masa.Contrib.StackSdks.Pm + +作用: + +通过PmClient获取Pm服务的相关数据 + +```c# +IPmClient +├── EnvironmentService 环境服务 +├── ClusterService 集群服务 +├── ProjectService 项目服务 +├── AppService 应用服务 +``` + +用例: + +```C# +Install-Package Masa.Contrib.StackSdks.Pm +``` + +```C# +builder.Services.AddPmClient("Pm服务地址"); +``` + +如何使用: + +```c# +var app = builder.Build(); + +app.MapGet("/GetProjectApps", ([FromServices] IPmClient pmClient) => +{ + return pmClient.ProjectService.GetProjectAppsAsync("development"); +}); + +app.Run(); +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/AppService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/AppService.cs new file mode 100644 index 000000000..43bbd29ac --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/AppService.cs @@ -0,0 +1,57 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm.Service; + +public class AppService : IAppService +{ + private readonly ICaller _caller; + + public AppService(ICaller caller) + { + _caller = caller; + } + + public async Task GetAsync(int id) + { + var requestUri = $"api/v1/app/{id}"; + var result = await _caller.GetAsync(requestUri); + + return result ?? new(); + } + + public async Task GetByIdentityAsync(string identity) + { + var requestUri = $"open-api/app/{identity}"; + var result = await _caller.GetAsync(requestUri); + + return result ?? new(); + } + + public async Task> GetListAsync() + { + var requestUri = $"api/v1/app"; + var result = await _caller.GetAsync>(requestUri); + + return result ?? new(); + } + + public async Task> GetListByProjectIdsAsync(List projectIds) + { + var requestUri = $"api/v1/projects/app"; + var result = await _caller.PostAsync, List>(requestUri, projectIds); + + return result ?? new(); + } + + public async Task GetWithEnvironmentClusterAsync(int id) + { + var requestUri = $"api/v1/appWhitEnvCluster/{id}"; + var result = await _caller.GetAsync(requestUri); + + return result ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs new file mode 100644 index 000000000..0f967212d --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ClusterService.cs @@ -0,0 +1,49 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm.Service; + +public class ClusterService : IClusterService +{ + private readonly ICaller _caller; + + public ClusterService(ICaller caller) + { + _caller = caller; + } + + public async Task GetAsync(int id) + { + var requestUri = $"api/v1/cluster/{id}"; + var result = await _caller.GetAsync(requestUri); + + return result ?? new(); + } + + public async Task> GetEnvironmentClustersAsync() + { + var requestUri = $"api/v1/envClusters"; + var result = await _caller.GetAsync>(requestUri); + + return result ?? new(); + } + + public async Task> GetListAsync() + { + var requestUri = $"api/v1/cluster"; + var result = await _caller.GetAsync>(requestUri); + + return result ?? new(); + } + + public async Task> GetListByEnvIdAsync(int envId) + { + var requestUri = $"api/v1/{envId}/cluster"; + var result = await _caller.GetAsync>(requestUri); + + return result ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs new file mode 100644 index 000000000..c84048516 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/EnvironmentService.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm.Service; + +public class EnvironmentService : IEnvironmentService +{ + private readonly ICaller _caller; + + public EnvironmentService(ICaller caller) + { + _caller = caller; + } + + public async Task GetAsync(int id) + { + var requestUri = $"api/v1/env/{id}"; + var result = await _caller.GetAsync(requestUri); + + return result ?? new(); + } + + public async Task> GetListAsync() + { + var requestUri = $"api/v1/env"; + var result = await _caller.GetAsync>(requestUri); + + return result ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs new file mode 100644 index 000000000..32602236d --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/Service/ProjectService.cs @@ -0,0 +1,65 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; +using Masa.BuildingBlocks.StackSdks.Pm.Service; + +namespace Masa.Contrib.StackSdks.Pm.Service; + +public class ProjectService : IProjectService +{ + private readonly ICaller _caller; + + public ProjectService(ICaller caller) + { + _caller = caller; + } + + public async Task> GetProjectAppsAsync(string envName) + { + var requestUri = $"api/v1/projectwithapps/{envName}"; + var result = await _caller.GetAsync>(requestUri); + + return result ?? new(); + } + + public async Task GetAsync(int id) + { + var requestUri = $"api/v1/project/{id}"; + var result = await _caller.GetAsync(requestUri); + + return result ?? new(); + } + + public async Task GetByIdentityAsync(string identity) + { + var requestUri = $"open-api/project/{identity}"; + var result = await _caller.GetAsync(requestUri); + + return result ?? new(); + } + + public async Task> GetListByEnvironmentClusterIdAsync(int envClusterId) + { + var requestUri = $"api/v1/{envClusterId}/project"; + var result = await _caller.GetAsync>(requestUri); + + return result ?? new(); + } + + public async Task> GetListByTeamIdsAsync(List teamIds) + { + var requestUri = $"api/v1/project/teamProjects"; + var result = await _caller.PostAsync>(requestUri, teamIds); + + return result ?? new(); + } + + public async Task> GetProjectTypesAsync() + { + var requestUri = $"api/v1/project/projectType"; + var result = await _caller.GetAsync>(requestUri); + + return result ?? new(); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..c516b59e2 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/ServiceCollectionExtensions.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm; + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddPmClient(this IServiceCollection services, string pmServiceBaseAddress) + { + if (string.IsNullOrWhiteSpace(pmServiceBaseAddress)) + { + throw new ArgumentNullException(nameof(pmServiceBaseAddress)); + } + + return services.AddPmClient(callerOptions => + { + callerOptions.UseHttpClient(builder => + { + builder.Name = DEFAULT_CLIENT_NAME; + builder.Configure = opt => opt.BaseAddress = new Uri(pmServiceBaseAddress); + }); + }); + } + + public static IServiceCollection AddPmClient(this IServiceCollection services, Action callerOptions) + { + ArgumentNullException.ThrowIfNull(callerOptions, nameof(callerOptions)); + + if (services.Any(service => service.ServiceType == typeof(IPmClient))) + return services; + + services.AddCaller(callerOptions.Invoke); + + services.AddSingleton(serviceProvider => + { + var callProvider = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); + var pmCaching = new PmClient(callProvider); + return pmCaching; + }); + + return services; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/_Imports.cs new file mode 100644 index 000000000..65e519dcd --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Pm/_Imports.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Masa.Contrib.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Contrib.StackSdks.Pm; +global using static Masa.Contrib.StackSdks.Pm.Constants; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Constants.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Constants.cs new file mode 100644 index 000000000..f1cca0b64 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Constants.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Scheduler; + +internal class Constants +{ + internal const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.scheduler"; + internal const string ENVIRONMENT_KEY = "env_key"; +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs new file mode 100644 index 000000000..07ca11efa --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/HttpClientAuthorizationDelegatingHandler.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Scheduler; + +public class HttpClientAuthorizationDelegatingHandler : DelegatingHandler +{ + readonly IHttpContextAccessor _httpContextAccessor; + + public HttpClientAuthorizationDelegatingHandler(IHttpContextAccessor httpContextAccessor) + { + _httpContextAccessor = httpContextAccessor; + } + + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + if (_httpContextAccessor.HttpContext != null) + { + var accessToken = await _httpContextAccessor.HttpContext.GetTokenAsync("access_token"); + request.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken); + } + return await base.SendAsync(request, cancellationToken); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj new file mode 100644 index 000000000..6c325cfb1 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md new file mode 100644 index 000000000..b89680e04 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.md @@ -0,0 +1,41 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.StackSdks.Scheduler + +Effect: + +Operate API of scheduler service through scheduler client + +```c# +ISchedulerClient +├── SchedulerJobService Scheduler Job service +├── SchedulerTaskService Scheduler Task service +``` + +Example: + +```C# +Install-Package Masa.Contrib.StackSdks.Scheduler +``` + +```C# +builder.Services.AddSchedulerClient("Scheduler service address"); +``` + +How to use: + +```c# +var app = builder.Build(); + +app.MapGet("/startjob", ([FromServices] ISchedulerClient schedulerClient) => +{ + var request = new BaseSchedulerJobRequest() + { + JobId = new Guid("39351BF4-0E58-463F-5C96-08DA42DF67D6"), + OperatorId = new Guid("15905535-C90F-4BCA-467B-08DA42E0A2C0") + }; + return schedulerClient.SchedulerJobService.StartAsync(request); +}); + +app.Run(); +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md new file mode 100644 index 000000000..85cff55be --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/README.zh-CN.md @@ -0,0 +1,41 @@ +中 | [EN](README.md) + +## Masa.Contrib.StackSdks.Scheduler + +作用: + +通过Scheduler Client 操作Scheduler服务的API + +```c# +ISchedulerClient +├── SchedulerJobService Job服务 +├── SchedulerTaskService Task服务 +``` + +用例: + +```C# +Install-Package Masa.Contrib.StackSdks.Scheduler +``` + +```C# +builder.Services.AddSchedulerClient("Scheduler service address"); +``` + +如何使用: + +```c# +var app = builder.Build(); + +app.MapGet("/startjob", ([FromServices] ISchedulerClient schedulerClient) => +{ + var request = new BaseSchedulerJobRequest() + { + JobId = new Guid("39351BF4-0E58-463F-5C96-08DA42DF67D6"), + OperatorId = new Guid("15905535-C90F-4BCA-467B-08DA42E0A2C0") + }; + return schedulerClient.SchedulerJobService.StartAsync(request); +}); + +app.Run(); +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs new file mode 100644 index 000000000..4d0da0a96 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/SchedulerClient.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Scheduler; +using Masa.BuildingBlocks.StackSdks.Scheduler.Service; + +namespace Masa.Contrib.StackSdks.Scheduler; + +public class SchedulerClient : ISchedulerClient +{ + public ISchedulerJobService SchedulerJobService { get; } + + public ISchedulerTaskService SchedulerTaskService { get; } + + public SchedulerClient(ICaller caller, ILoggerFactory? loggerFactory = null) + { + SchedulerJobService = new SchedulerJobService(caller, loggerFactory); + SchedulerTaskService = new SchedulerTaskService(caller, loggerFactory); + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..0f295327b --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/ServiceCollectionExtensions.cs @@ -0,0 +1,53 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Scheduler; + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddSchedulerClient(this IServiceCollection services, string schedulerServiceBaseAddress) + { + if (string.IsNullOrWhiteSpace(schedulerServiceBaseAddress)) + { + throw new ArgumentNullException(nameof(schedulerServiceBaseAddress)); + } + + return services.AddSchedulerClient(callerOptions => + { + callerOptions.UseHttpClient(builder => + { + builder.Name = DEFAULT_CLIENT_NAME; + builder.Configure = opt => opt.BaseAddress = new Uri(schedulerServiceBaseAddress); + }).AddHttpMessageHandler(); + }); + } + + public static IServiceCollection AddSchedulerClient(this IServiceCollection services, Action callerOptions) + { + ArgumentNullException.ThrowIfNull(callerOptions, nameof(callerOptions)); + + if (services.Any(service => service.ImplementationType == typeof(SchedulerProvider))) + return services; + + services.AddSingleton(); + services.AddScoped(); + services.AddHttpContextAccessor(); + services.AddCaller(callerOptions); + + services.AddScoped(serviceProvider => + { + var callProvider = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); + var loggerFactory = serviceProvider.GetService(); + var schedulerClient = new SchedulerClient(callProvider, loggerFactory); + return schedulerClient; + }); + + return services; + } + + private class SchedulerProvider + { + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs new file mode 100644 index 000000000..d6f9953e8 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerJobService.cs @@ -0,0 +1,127 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; +using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +using Masa.BuildingBlocks.StackSdks.Scheduler.Service; + +namespace Masa.Contrib.StackSdks.Scheduler.Services; + +public class SchedulerJobService : ISchedulerJobService +{ + const string API = "/api/scheduler-job"; + + readonly ICaller _caller; + readonly ILogger? _logger; + + public SchedulerJobService(ICaller caller, ILoggerFactory? loggerFactory = null) + { + _caller = caller; + _logger = loggerFactory?.CreateLogger(); + } + + public async Task AddAsync(AddSchedulerJobRequest request) + { + if (string.IsNullOrWhiteSpace(request.ProjectIdentity)) + { + throw new ArgumentNullException(nameof(request.ProjectIdentity)); + } + + switch (request.JobType) + { + case JobTypes.JobApp: + ArgumentNullException.ThrowIfNull(request.JobAppConfig, nameof(request.JobAppConfig)); + break; + case JobTypes.Http: + ArgumentNullException.ThrowIfNull(request.HttpConfig, nameof(request.HttpConfig)); + break; + case JobTypes.DaprServiceInvocation: + ArgumentNullException.ThrowIfNull(request.DaprServiceInvocationConfig, nameof(request.DaprServiceInvocationConfig)); + break; + } + + try + { + var requestUri = $"{API}/addSchedulerJobBySdk"; + return await _caller.PostAsync(requestUri, request); + } + catch (Exception ex) + { + _logger?.LogError(ex, "AddSchedulerJobAsync Error"); + return Guid.Empty; + } + + } + + public async Task DisableAsync(BaseSchedulerJobRequest request) + { + try + { + var requestData = new ChangeEnabledStatusRequest() + { + JobId = request.JobId, + OperatorId = request.OperatorId, + Enabled = false + }; + var requestUri = $"{API}/changeEnableStatus"; + await _caller.PutAsync(requestUri, requestData); + return true; + } + catch (Exception ex) + { + _logger?.LogError(ex, "DisableSchedulerJob Error"); + return false; + } + } + + public async Task EnableAsync(BaseSchedulerJobRequest request) + { + try + { + var requestData = new ChangeEnabledStatusRequest() + { + JobId = request.JobId, + OperatorId = request.OperatorId, + Enabled = true + }; + var requestUri = $"{API}/changeEnableStatus"; + await _caller.PutAsync(requestUri, requestData); + return true; + } + catch (Exception ex) + { + _logger?.LogError(ex, "EnableSchedulerJob Error"); + return false; + } + } + + public async Task RemoveAsync(BaseSchedulerJobRequest request) + { + try + { + var requestUri = $"{API}"; + await _caller.DeleteAsync(requestUri, request); + return true; + } + catch (Exception ex) + { + _logger?.LogError(ex, "RemoveSchedulerJobAsync Error"); + return false; + } + } + + public async Task StartAsync(BaseSchedulerJobRequest request) + { + try + { + var requestUri = $"{API}/startJob"; + await _caller.PutAsync(requestUri, request); + return true; + } + catch (Exception ex) + { + _logger?.LogError(ex, "StartSchedulerJobAsync Error"); + return false; + } + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs new file mode 100644 index 000000000..e7db74b1d --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Services/SchedulerTaskService.cs @@ -0,0 +1,58 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +using Masa.BuildingBlocks.StackSdks.Scheduler.Service; + +namespace Masa.Contrib.StackSdks.Scheduler.Services; + +public class SchedulerTaskService : ISchedulerTaskService +{ + const string API = "/api/scheduler-task"; + + readonly ICaller _caller; + readonly ILogger? _logger; + + public SchedulerTaskService(ICaller caller, ILoggerFactory? loggerFactory) + { + _caller = caller; + _logger = loggerFactory?.CreateLogger(); + } + + public async Task StopAsync(BaseSchedulerTaskRequest request) + { + try + { + var requestUri = $"{API}/stop"; + await _caller.PutAsync(requestUri, request); + return true; + } + catch (Exception ex) + { + _logger?.LogError(ex, "StopSchedulerTaskAsync Error"); + return false; + } + } + + public async Task StartAsync(BaseSchedulerTaskRequest request) + { + try + { + var requestData = new StartSchedulerTaskRequest() + { + TaskId = request.TaskId, + OperatorId = request.OperatorId, + IsManual = true + }; + + var requestUri = $"{API}/start"; + await _caller.PutAsync(requestUri, requestData); + return true; + } + catch (Exception ex) + { + _logger?.LogError(ex, "StopSchedulerTaskAsync Error"); + return false; + } + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs new file mode 100644 index 000000000..57d942dd5 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; +global using Masa.Contrib.StackSdks.Scheduler; +global using Masa.Contrib.StackSdks.Scheduler.Services; +global using Masa.Contrib.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Microsoft.AspNetCore.Authentication; +global using Microsoft.AspNetCore.Http; +global using Microsoft.Extensions.Logging; +global using static Masa.Contrib.StackSdks.Scheduler.Constants; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs new file mode 100644 index 000000000..9175c268c --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/CallerProviderExtensions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +[assembly: InternalsVisibleTo("Masa.Contrib.StackSdks.Tsc.Tests")] +namespace Masa.Contrib.Service.Caller; + +internal static class CallerProviderExtensions +{ + public static async Task GetByBodyAsync(this ICaller caller, string url, object? body) where TResult : class + { + var request = new HttpRequestMessage(HttpMethod.Get, url); + if (body is not null) + { + request.Content = new StringContent(System.Text.Json.JsonSerializer.Serialize(body), Encoding.UTF8, "application/json"); + } + return (await caller.SendAsync(request))!; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs new file mode 100644 index 000000000..978cfe506 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/ServiceExtensions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +[assembly: InternalsVisibleTo("Masa.Contrib.StackSdks.Tsc.Tests")] +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceExtensions +{ + private const string DEFAULT_CLIENT_NAME = "masa.contrib.basicability.tsc"; + + public static IServiceCollection AddTscClient(this IServiceCollection services, string tscServiceBaseUri) + { + ArgumentNullException.ThrowIfNull(tscServiceBaseUri, nameof(tscServiceBaseUri)); + + if (services.Any(service => service.ServiceType == typeof(ITscClient))) + return services; + + services.AddCaller(builder => + { + builder.UseHttpClient(options => + { + options.BaseAddress = tscServiceBaseUri; + options.Name = DEFAULT_CLIENT_NAME; + }); + }); + + services.AddSingleton(serviceProvider => + { + var caller = serviceProvider.GetRequiredService().Create(DEFAULT_CLIENT_NAME); + var pmCaching = new TscClient(caller); + return pmCaching; + }); + + return services; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs new file mode 100644 index 000000000..b8d3a5fc5 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Extensions/StreamExtensions.cs @@ -0,0 +1,48 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace System.IO; + +public static class StreamExtensions +{ + private static readonly Encoding _defaultEncoding = Encoding.UTF8; + + public static async Task ReadAsStringAsync(this Stream stream, Encoding? encoding = null) + { + if (stream == null) + return null; + + if (!stream.CanRead) + return "cann't read"; + + if (!stream.CanSeek) + return "cann't seek"; + + var start = (int)stream.Position; + List data = new(); + var buffer = new byte[1024]; + do + { + var count = await stream.ReadAsync(buffer, 0, buffer.Length); + if (count <= 0) + break; + if (buffer.Length - count == 0) + { + data.AddRange(buffer); + } + else + { + data.AddRange(buffer[0..count]); + break; + } + } while (true); + + if (data.Count > 0) + { + stream.Seek(start, SeekOrigin.Begin); + return (encoding ?? _defaultEncoding).GetString(data.ToArray()); + } + + return null; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs new file mode 100644 index 000000000..44b412f39 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Logging/OpenTelemetryLoggingExtensions.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.Logging; + +public static class OpenTelemetryLoggingExtensions +{ + public static ILoggingBuilder AddMasaOpenTelemetry(this ILoggingBuilder builder, Action configure) + { + builder.AddOpenTelemetry(options => + { + options.IncludeScopes = true; + options.IncludeFormattedMessage = true; + options.ParseStateValues = true; + if (configure != null) + configure.Invoke(options); + }); + + return builder; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj new file mode 100644 index 000000000..f649dd2e2 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Masa.Contrib.StackSdks.Tsc.csproj @@ -0,0 +1,28 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs new file mode 100644 index 000000000..b97e729c6 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/MasaObservableOptions.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Tsc; + +public class MasaObservableOptions +{ + public string ProjectName { get; set; } + + public string ServiceName { get; set; } + + public string ServiceNameSpace { get; set; } + + public string ServiceInstanceId { get; set; } + + public string ServiceVersion { get; set; } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs new file mode 100644 index 000000000..36a3a25bb --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Metrics/MasaServiceExtensions.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static partial class MasaServiceExtensions +{ + public static IServiceCollection AddMasaMetrics(this IServiceCollection services, Action? configure = null) + { + services.AddOpenTelemetryMetrics(builder => + { + if (configure != null) + configure.Invoke(builder); + + builder.AddRuntimeMetrics() + .AddAspNetCoreInstrumentation() + .AddHttpClientInstrumentation(); + }); + return services; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs new file mode 100644 index 000000000..0958eca3c --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTelemetryAttributeName.cs @@ -0,0 +1,146 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Tsc; + +/// +/// Constants for semantic attribute names outlined by the OpenTelemetry specifications. +/// . +/// +internal sealed class OpenTelemetryAttributeName +{ + /// + /// Constants for deployment semantic attribute names outlined by the OpenTelemetry specifications. + /// . + /// + internal class Deployment + { + /// + /// The name of the deployment environment (aka deployment tier). + /// + /// staging; production. + public const string ENVIRONMENT = "deployment.environment"; + } + + /// + /// Constants for end user semantic attribute names outlined by the OpenTelemetry specifications. + /// . + /// + internal class EndUser + { + /// + /// Username or client_id extracted from the access token or Authorization header in the inbound request from outside the system. + /// + /// E.g. username. + public const string ID = "enduser.id"; + + /// + /// Actual/assumed role the client is making the request under extracted from token or application security context. + /// + /// E.g. admin. + public const string ROLE = "enduser.role"; + + /// + /// Scopes or granted authorities the client currently possesses extracted from token or application security context. + /// The value would come from the scope associated with an OAuth 2.0 Access Token or an attribute value in a SAML 2.0 Assertion. + /// + /// E.g. read:message,write:files. + public const string SCOPE = "enduser.scope"; + + /// + /// custom attr + /// + public const string USER_NICK_NAME = "enduser.nick_name"; + } + + /// + /// Constants for HTTP semantic attribute names outlined by the OpenTelemetry specifications. + /// . + /// + internal class Http + { + /// + /// The URI scheme identifying the used protocol. + /// + /// E.g. http or https. + public const string SCHEME = "http.scheme"; + + /// + /// Kind of HTTP protocol used. + /// + /// E.g. 1.0, 1.1, 2.0, SPDY or QUIC. + public const string FLAVOR = "http.flavor"; + + /// + /// The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). + /// + /// E.g. 83.164.160.102. + public const string CLIENT_IP = "http.client_ip"; + + /// + /// The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, + /// but not always, present as the Content-Length header. For requests using transport encoding, this should be the + /// compressed size. + /// + /// E.g. 3495. + public const string REQUEST_CONTENT_LENGTH = "http.request_content_length"; + + /// + /// custom attr + /// + public const string REQUEST_CONTENT_BODY = "http.request_content_body"; + + /// + /// The content type of the request body. + /// + /// E.g. application/json. + public const string REQUEST_CONTENT_TYPE = "http.request_content_type"; + + /// + /// The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, + /// but not always, present as the Content-Length header. For requests using transport encoding, this should be the + /// compressed size. + /// + /// E.g. 3495. + public const string RESPONSE_CONTENT_LENGTH = "http.response_content_length"; + + /// + /// The content type of the response body. + /// + /// E.g. application/json. + public const string RESPONSE_CONTENT_TYPE = "http.response_content_type"; + + /// + /// custom attr + /// + public const string RESPONSE_CONTENT_BODY = "http.response_content_body"; + } + + /// + /// Constants for host semantic attribute names outlined by the OpenTelemetry specifications. + /// . + /// + internal static class Host + { + /// + /// Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, + /// or another name specified by the user. + /// + /// E.g. opentelemetry-test. + public const string NAME = "host.name"; + } + + /// + /// Constants for service semantic attribute names outlined by the OpenTelemetry specifications. + /// . + /// + internal class Service + { + public const string NAME = "service.name"; + + /// + /// custom attr + /// + public const string PROJECT_NAME = "service.project.name"; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs new file mode 100644 index 000000000..23fff56c4 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/OpenTemetry/ResourceBuilderExtenstions.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace OpenTelemetry.Resources; + +public static class ResourceBuilderExtenstions +{ + public static ResourceBuilder AddMasaService( + this ResourceBuilder resourceBuilder, + MasaObservableOptions options, Action? action = null) + { + ArgumentNullException.ThrowIfNull(options, nameof(options)); + + resourceBuilder = resourceBuilder.AddService(options.ServiceName, options.ServiceNameSpace, options.ServiceVersion, true, options.ServiceInstanceId); + + if (!string.IsNullOrEmpty(options.ProjectName)) + resourceBuilder.AddAttributes(new Dictionary { { OpenTelemetryAttributeName.Service.PROJECT_NAME, options.ProjectName } }); + + resourceBuilder.AddTelemetrySdk(); + + if (action != null) + action.Invoke(resourceBuilder); + + return resourceBuilder; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md new file mode 100644 index 000000000..ec4fb286a --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/README.md @@ -0,0 +1,56 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.StackSdks.Tsc + +effect: + +The tracking telemetry data adopts the Opentelemetry standard and integrates the OpenTelemetry SDK to report the telemetry tracking data to the OpenTelemetry-Collector collector, and then export and store the collected data Logging, Tracing, and Metrics through the Exporter + +Example: + + +```C# +Install-Package Masa.Contrib.StackSdks.Tsc +``` + +how to use: + + +```c# +// create and config ResourceBuilder instance +var resources = ResourceBuilder.CreateDefault(); +resources.AddMasaService(new MasaObservableOptions +{ + ServiceName = "example.api" +}); + +//metrics +builder.Services.AddMasaMetrics(builder => { + builder.SetResourceBuilder(resources); + builder.AddOtlpExporter(); +}); + +//trcaing +builder.Services.AddMasaTracing(options => +{ + //api exclude swagger and healthy request + options.AspNetCoreInstrumentationOptions.AppendDefaultFilter(options); + + //blazor exclude blazor resources request + //options.AspNetCoreInstrumentationOptions.AppendBlazorFilter(options); + + options.BuildTraceCallback = builder => + { + builder.SetResourceBuilder(resources); + builder.AddOtlpExporter(); + }; +}); + +//logging +builder.Logging.AddMasaOpenTelemetry(builder => +{ + builder.SetResourceBuilder(resources); + builder.AddOtlpExporter(); +}); + +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md new file mode 100644 index 000000000..76f1c5a14 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/README.zh-CN.md @@ -0,0 +1,56 @@ +中 | [EN](README.md) + +## Masa.Contrib.StackSdks.Tsc + +作用: + +追踪遥测数据采用Opentelemetry标准,并集成了OpenTelemetry SDK,将遥测追踪数据上报到OpenTelemetry-Collector采集器, +再将采集数据Logging、Tracing和Metrics经过Exporter导出存储 + +用例: + +```C# +Install-Package Masa.Contrib.StackSdks.Tsc +``` + +如何使用: + +```c# + +// create and config ResourceBuilder instance +var resources = ResourceBuilder.CreateDefault(); +resources.AddMasaService(new MasaObservableOptions +{ + ServiceName = "example.api" +}); + +//metrics +builder.Services.AddMasaMetrics(builder => { + builder.SetResourceBuilder(resources); + builder.AddOtlpExporter(); +}); + +//trcaing +builder.Services.AddMasaTracing(options => +{ + //api exclude swagger and healthy request + options.AspNetCoreInstrumentationOptions.AppendDefaultFilter(options); + + //blazor exclude blazor resources request + //options.AspNetCoreInstrumentationOptions.AppendBlazorFilter(options); + + options.BuildTraceCallback = builder => + { + builder.SetResourceBuilder(resources); + builder.AddOtlpExporter(); + }; +}); + +//logging +builder.Logging.AddMasaOpenTelemetry(builder => +{ + builder.SetResourceBuilder(resources); + builder.AddOtlpExporter(); +}); + +``` diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs new file mode 100644 index 000000000..b8b9473ef --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/LogService.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Tsc.Service; + +public class LogService : ILogService +{ + private readonly ICaller _caller; + internal const string AGGREGATION_URI = "/api/log/aggregation"; + internal const string LATEST_URI = "/api/log/latest"; + internal const string FIELD_URI = "/api/log/field"; + + public LogService(ICaller caller) + { + _caller = caller; + } + + public async Task>> GetAggregationAsync(LogAggregationRequest query) + { + return (await _caller.GetAsync>>(AGGREGATION_URI, query))!; + } + + public async Task> GetFieldsAsync() + { + return (await _caller.GetAsync>(FIELD_URI))!; + } + + public async Task GetLatestAsync(LogLatestRequest query) + { + return (await _caller.GetAsync(LATEST_URI, query))!; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs new file mode 100644 index 000000000..85aff1e37 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Service/MetricService.cs @@ -0,0 +1,46 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Tsc.Service; + +internal class MetricService : IMetricService +{ + private readonly ICaller _caller; + internal const string RANGEVALUES_URL = "/api/metric/range-values"; + internal const string NAMES_URI = "/api/metric/names"; + internal const string LABELVALUES_URI = "/api/metric/label-values"; + + public MetricService(ICaller caller) + { + _caller = caller; + } + + public async Task> GetNamesAsync(IEnumerable? matches = default) + { + string param = default!; + if (matches != null && matches.Any()) + { + param = string.Join(',', matches); + } + return (await _caller.GetAsync>(NAMES_URI, new Dictionary { { "match", param } }))!; + } + + public async Task>> GetLabelValuesAsync(LableValuesRequest query) + { + var data = await _caller.GetByBodyAsync>>>(LABELVALUES_URI, query); + if (data == null || !data.ContainsKey(query.Match)) + return new Dictionary>(); + + return data[query.Match]; + } + + public async Task GetValuesAsync(ValuesRequest query) + { + if (query.Lables != null && !string.IsNullOrEmpty(query.Match)) + { + query.Match = $"{query.Match}{{{string.Join(',', query.Lables)}}}"; + } + + return (await _caller.GetByBodyAsync(RANGEVALUES_URL, query))!; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs new file mode 100644 index 000000000..0c6bcb0bc --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/ActivityExtensions.cs @@ -0,0 +1,101 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace System.Diagnostics; + +public static class ActivityExtension +{ + public static async Task AddMasaSupplement(this Activity activity, HttpRequest httpRequest) + { + if (activity is null) return null; + + activity.SetTag(OpenTelemetryAttributeName.Http.FLAVOR, httpRequest.Protocol); + activity.SetTag(OpenTelemetryAttributeName.Http.SCHEME, httpRequest.Scheme); + activity.SetTag(OpenTelemetryAttributeName.Http.CLIENT_IP, httpRequest.HttpContext?.Connection.RemoteIpAddress); + activity.SetTag(OpenTelemetryAttributeName.Http.REQUEST_CONTENT_LENGTH, httpRequest.ContentLength); + activity.SetTag(OpenTelemetryAttributeName.Http.REQUEST_CONTENT_TYPE, httpRequest.ContentType); + if (httpRequest.Body != null) + { + if (!httpRequest.Body.CanSeek) + httpRequest.EnableBuffering(); + activity.SetTag(OpenTelemetryAttributeName.Http.REQUEST_CONTENT_BODY, await httpRequest.Body.ReadAsStringAsync(GetHttpRequestEncoding(httpRequest))); + } + activity.SetTag(OpenTelemetryAttributeName.Host.NAME, Dns.GetHostName()); + + return activity; + } + + private static Encoding? GetHttpRequestEncoding(HttpRequest httpRequest) + { + if (httpRequest.Body != null) + { + var contentType = httpRequest.HttpContext.Request.ContentType; + if (!string.IsNullOrEmpty(contentType)) + { + var attr = MediaTypeHeaderValue.Parse(contentType); + if (attr != null && !string.IsNullOrEmpty(attr.CharSet)) + return Encoding.GetEncoding(attr.CharSet); + } + } + + return null; + } + + public static Activity? AddMasaSupplement(this Activity activity, HttpResponse httpResponse) + { + if (activity is null) return null; + + activity.SetTag(OpenTelemetryAttributeName.Http.RESPONSE_CONTENT_LENGTH, httpResponse.ContentLength); + activity.SetTag(OpenTelemetryAttributeName.Http.RESPONSE_CONTENT_TYPE, httpResponse.ContentType); + activity.SetTag(OpenTelemetryAttributeName.Host.NAME, Dns.GetHostName()); + + if ((httpResponse.HttpContext.User?.Claims.Count() ?? 0) > 0) + { + activity.AddTag(OpenTelemetryAttributeName.EndUser.ID, httpResponse.HttpContext.User?.FindFirst("sub")?.Value ?? string.Empty); + activity.AddTag(OpenTelemetryAttributeName.EndUser.USER_NICK_NAME, httpResponse.HttpContext.User?.FindFirst("https://masastack.com/security/authentication/MasaNickName")?.Value ?? string.Empty); + } + + return activity; + } + + public static async Task AddMasaSupplement(this Activity activity, HttpRequestMessage httpRequest) + { + if (activity is null) return null; + + activity.SetTag(OpenTelemetryAttributeName.Http.SCHEME, httpRequest.RequestUri?.Scheme); + activity.SetTag(OpenTelemetryAttributeName.Host.NAME, Dns.GetHostName()); + + if (httpRequest.Content is not null) + { + var st = await httpRequest.Content.ReadAsStreamAsync(); + activity.SetTag(OpenTelemetryAttributeName.Http.REQUEST_CONTENT_BODY, await st.ReadAsStringAsync(GetHttpRequestMessageEncoding(httpRequest))); + } + + return activity; + } + + private static Encoding? GetHttpRequestMessageEncoding(HttpRequestMessage httpRequest) + { + if (httpRequest.Content is not null) + { + var encodeStr = httpRequest.Content.Headers?.ContentType?.CharSet; + + if (!string.IsNullOrEmpty(encodeStr)) + { + return Encoding.GetEncoding(encodeStr); + } + } + + return null; + } + + public static Activity? AddMasaSupplement(this Activity activity, HttpResponseMessage httpResponse) + { + if (activity is null) return null; + + activity.SetTag(OpenTelemetryAttributeName.Host.NAME, Dns.GetHostName()); + + return activity; + } + +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs new file mode 100644 index 000000000..1cdf430d4 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/AspNetCoreInstrumentationOptionsExtensions.cs @@ -0,0 +1,74 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class AspNetCoreInstrumentationOptionsExtensions +{ + private static List _lstDefaultFilterIgnorePrefix = new() + { + "/swagger", + "/healthz", + }; + + private static List _lstBlazorFilterIgnorePrefix = new() + { + "/swagger", + "/healthz", + "/_blazor", + "/_content", + }; + + private static List _lstBlazorFilterIgnoreSuffix = new() + { + ".js", + ".css", + "/negotiate", + ".ico", + ".png", + ".woff", + ".icon" + }; + + /// + /// The default filter ignore list includes swagger. + /// + /// + /// + public static void AppendDefaultFilter(this Action options, OpenTelemetryInstrumentationOptions openTelemetryInstrumentationOptions) + { + options += opt => + { + opt.Filter = httpContext => + { + return !_lstDefaultFilterIgnorePrefix.Any(prefix => !string.IsNullOrEmpty(httpContext.Request.Path.Value) && httpContext.Request.Path.Value.StartsWith(prefix)); + }; + }; + + openTelemetryInstrumentationOptions.AspNetCoreInstrumentationOptions = options; + } + + /// + /// The filter ignore list includes swagger and blazor and static files. + /// + /// + /// + public static void AppendBlazorFilter(this Action options, OpenTelemetryInstrumentationOptions openTelemetryInstrumentationOptions) + { + options += opt => + { + opt.Filter = httpContext => + { + if (_lstBlazorFilterIgnorePrefix.Any(prefix => !string.IsNullOrEmpty(httpContext.Request.Path.Value) && httpContext.Request.Path.Value.StartsWith(prefix))) + return false; + + if (_lstBlazorFilterIgnoreSuffix.Any(suffix => !string.IsNullOrEmpty(httpContext.Request.Path.Value) && httpContext.Request.Path.Value.EndsWith(suffix))) + return false; + + return true; + }; + }; + + openTelemetryInstrumentationOptions.AspNetCoreInstrumentationOptions = options; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs new file mode 100644 index 000000000..b752e8606 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/MasaServiceExtensions.cs @@ -0,0 +1,37 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static partial class MasaServiceExtensions +{ + public static IServiceCollection AddMasaTracing(this IServiceCollection services, Action? configure = null) + { + services.AddOpenTelemetryTracing((builder) => + { + builder.SetSampler(new AlwaysOnSampler()); + var option = new OpenTelemetryInstrumentationOptions(); + if (configure != null) + configure.Invoke(option); + + if (option.AspNetCoreInstrumentationOptions != null) + builder.AddAspNetCoreInstrumentation(option.AspNetCoreInstrumentationOptions); + + if (option.HttpClientInstrumentationOptions != null) + builder.AddHttpClientInstrumentation(option.HttpClientInstrumentationOptions); + + if (option.EntityFrameworkInstrumentationOptions != null) + builder.AddEntityFrameworkCoreInstrumentation(option.EntityFrameworkInstrumentationOptions); + + if (option.ElasticsearchClientInstrumentationOptions != null) + builder.AddElasticsearchClientInstrumentation(option.ElasticsearchClientInstrumentationOptions); + + if (option.StackExchangeRedisCallsInstrumentationOptions != null && option.Connection != null) + builder.AddRedisInstrumentation(option.Connection, option.StackExchangeRedisCallsInstrumentationOptions); + + option.BuildTraceCallback?.Invoke(builder); + }); + + return services; + } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs new file mode 100644 index 000000000..2282257eb --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/Tracing/OpenTelemetryInstrumentationOptions.cs @@ -0,0 +1,95 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the Apache License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public class OpenTelemetryInstrumentationOptions +{ + /// + /// Default record all data. You can replace it or set null + /// + public Action AspNetCoreInstrumentationOptions { get; set; } = options => + { + options.Enrich = async (activity, eventName, rawObject) => + { + if (eventName.Equals("OnStartActivity")) + { + if (rawObject is HttpRequest httpRequest) + { + await activity.AddMasaSupplement(httpRequest); + } + else if (rawObject is HttpRequestMessage httpRequestMessage) + { + await activity.AddMasaSupplement(httpRequestMessage); + } + } + else if (eventName.Equals("OnStopActivity")) + { + if (rawObject is HttpResponse httpResponse) + { + activity.AddMasaSupplement(httpResponse); + } + } + else if (eventName.Equals("OnException")) + { + if (rawObject is Exception exception) + { + activity.SetTag("stackTrace", exception.StackTrace); + } + } + }; + }; + + /// + /// Default record all data. You can replace it or set null + /// + public Action HttpClientInstrumentationOptions { get; set; } = options => + { + options.Enrich = async (activity, eventName, rawObject) => + { + if (eventName.Equals("OnStartActivity")) + { + if (rawObject is HttpRequestMessage httpRequest) + { + await activity.AddMasaSupplement(httpRequest); + } + } + else if (eventName.Equals("OnStopActivity")) + { + if (rawObject is HttpResponseMessage httpResponse) + { + activity.AddMasaSupplement(httpResponse); + } + } + else if (eventName.Equals("OnException")) + { + if (rawObject is Exception exception) + { + activity.SetTag("stackTrace", exception.StackTrace); + } + } + }; + }; + + /// + /// Default record db statement for text. You can replace it or set null + /// + public Action EntityFrameworkInstrumentationOptions { get; set; } = options => + { + options.SetDbStatementForText = true; + }; + + public Action ElasticsearchClientInstrumentationOptions { get; set; } = options => + { + options.ParseAndFormatRequest = true; + }; + + public Action StackExchangeRedisCallsInstrumentationOptions { get; set; } + + public IConnectionMultiplexer Connection { get; set; } + + /// + /// Build trace callback, allow to supplement the build process + /// + public Action BuildTraceCallback { get; set; } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/TscClient.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/TscClient.cs new file mode 100644 index 000000000..24ad7afae --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/TscClient.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Tsc.Service; + +[assembly: InternalsVisibleTo("Masa.Contrib.StackSdks.Tsc.Tests")] +namespace Masa.Contrib.StackSdks.Tsc; + +internal class TscClient : ITscClient +{ + public TscClient(ICaller caller) + { + LogService = new LogService(caller); + MetricService = new MetricService(caller); + } + + public ILogService LogService { get; } + + public IMetricService MetricService { get; } +} diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs new file mode 100644 index 000000000..c98d95f23 --- /dev/null +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Tsc; +global using Masa.BuildingBlocks.StackSdks.Tsc.Model; +global using Masa.BuildingBlocks.StackSdks.Tsc.Service; +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.Contrib.StackSdks.Tsc; +global using Masa.Contrib.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Microsoft.AspNetCore.Http; +global using Microsoft.Extensions.DependencyInjection; +global using OpenTelemetry.Contrib.Instrumentation.ElasticsearchClient; +global using OpenTelemetry.Contrib.Instrumentation.EntityFrameworkCore; +global using OpenTelemetry.Instrumentation.AspNetCore; +global using OpenTelemetry.Instrumentation.Http; +global using OpenTelemetry.Instrumentation.StackExchangeRedis; +global using OpenTelemetry.Logs; +global using OpenTelemetry.Metrics; +global using OpenTelemetry.Trace; +global using StackExchange.Redis; +global using System.Diagnostics; +global using System.Net; +global using System.Net.Http.Headers; +global using System.Runtime.CompilerServices; +global using System.Text; diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs new file mode 100644 index 000000000..2b27fb6b0 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/AuthClientTest.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Auth.Tests; + +[TestClass] +public class AuthClientTest +{ + [TestMethod] + public void TestAddAuthClient() + { + var services = new ServiceCollection(); + services.AddMasaIdentityModel(IdentityType.MultiEnvironment); + services.AddAuthClient("https://localhost:18102"); + var authClient = services.BuildServiceProvider().GetRequiredService(); + + Assert.IsNotNull(authClient); + } + + [TestMethod] + public void TestAddAuthClientNoAddMasaIdentity() + { + var services = new ServiceCollection(); + Assert.ThrowsException(() => services.AddAuthClient("https://localhost:18102"), + "Please add IMultiEnvironmentUserContext first."); + } + + [TestMethod] + public void TestAddAuthClientShouldThrowArgumentNullException() + { + var services = new ServiceCollection(); + Assert.ThrowsException(() => services.AddAuthClient(authServiceBaseAddress: null!)); + } + + [TestMethod] + public void TestAddAuthClientShouldThrowArgumentNullException2() + { + var services = new ServiceCollection(); + Assert.ThrowsException(() => services.AddAuthClient(callerOptions: null!)); + } +} + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj new file mode 100644 index 000000000..25dc4fe25 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj @@ -0,0 +1,26 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs new file mode 100644 index 000000000..fcc459f0c --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/PermissionServiceTest.cs @@ -0,0 +1,109 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; + +[TestClass] +public class PermissionServiceTest +{ + [TestMethod] + [DataRow("app1")] + public async Task TestGetMenusAsync(string appId) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var data = new List(); + var requestUri = $"api/permission/menus?appId={appId}&userId={userId}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var permissionService = new PermissionService(caller.Object, userContext.Object); + var result = await permissionService.GetMenusAsync(appId); + userContext.Verify(user => user.GetUserId(), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + [DataRow("app1", "code")] + public async Task TestAuthorizedAsync(string appId, string code) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var data = false; + var requestUri = $"api/permission/authorized?code={code}&userId={userId}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var permissionService = new PermissionService(caller.Object, userContext.Object); + var result = await permissionService.AuthorizedAsync(appId, code); + caller.Verify(provider => provider.GetAsync(It.IsAny(), default), Times.Once); + } + + [TestMethod] + [DataRow("app1")] + public async Task TestGetElementPermissionsAsync(string appId) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var data = new List(); + var requestUri = $"api/permission/element-permissions?appId={appId}&userId={userId}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var permissionService = new PermissionService(caller.Object, userContext.Object); + var result = await permissionService.GetElementPermissionsAsync(appId); + caller.Verify(provider => provider.GetAsync>(It.IsAny(), default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + [DataRow("225082D3-CC88-48D2-3C27-08DA3ED8F4B7")] + public async Task TestGetFavoriteMenuListAsync(string menuId) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var data = new List(); + var requestUri = $"api/permission/menu-favorite-list?userId={userId}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var permissionService = new PermissionService(caller.Object, userContext.Object); + var result = await permissionService.GetFavoriteMenuListAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + [DataRow("225082D3-CC88-48D2-3C27-08DA3ED8F4B7")] + public async Task TestAddFavoriteMenuAsync(string menuId) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var requestUri = $"api/permission/addFavoriteMenu?permissionId={Guid.Parse(menuId)}&userId={userId}"; + var caller = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, null, true, default)).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var permissionService = new PermissionService(caller.Object, userContext.Object); + var result = await permissionService.AddFavoriteMenuAsync(Guid.Parse(menuId)); + caller.Verify(provider => provider.PutAsync(requestUri, null, true, default), Times.Once); + Assert.IsTrue(result); + } + + [TestMethod] + [DataRow("225082D3-CC88-48D2-3C27-08DA3ED8F4B7")] + public async Task TestRemoveFavoriteMenuAsync(string menuId) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var requestUri = $"api/permission/removeFavoriteMenu?permissionId={Guid.Parse(menuId)}&userId={userId}"; + var caller = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, null, true, default)).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var permissionService = new PermissionService(caller.Object, userContext.Object); + var result = await permissionService.RemoveFavoriteMenuAsync(Guid.Parse(menuId)); + caller.Verify(provider => provider.PutAsync(requestUri, null, true, default), Times.Once); + Assert.IsTrue(result); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs new file mode 100644 index 000000000..ef19e7308 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/ProjectServiceTest.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; + +[TestClass] +public class ProjectServiceTest +{ + [TestMethod] + public async Task TestGetGlobalNavigationsAsync() + { + var data = new List() + { + new ProjectModel() + }; + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var requestUri = $"api/project/navigations?userId={userId}&environment=development"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + userContext.SetupGet(user => user.Environment).Returns("development"); + var projectService = new Mock(caller.Object, userContext.Object); + var result = await projectService.Object.GetGlobalNavigations(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + Assert.IsTrue(result.Count == 1); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs new file mode 100644 index 000000000..c510438ec --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/SubjectServiceTest.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; + +[TestClass] +public class SubjectServiceTest +{ + [TestMethod] + public async Task TestGetListAsync() + { + var data = new List() + { + new SubjectModel() + }; + string filter = "test"; + var requestUri = $"api/subject/getList"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var subjectService = new Mock(caller.Object); + var result = await subjectService.Object.GetListAsync(filter); + caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result.Count == 1); + } +} + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs new file mode 100644 index 000000000..f5c8561f0 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/TeamServiceTest.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; + +[TestClass] +public class TeamServiceTest +{ + [TestMethod] + public async Task TestGetDetailAsync() + { + var data = new TeamDetailModel(); + Guid teamId = Guid.NewGuid(); + var requestUri = $"api/team/detail"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var teamService = new Mock(caller.Object, userContext.Object); + var result = await teamService.Object.GetDetailAsync(teamId); + caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestGetAllAsync() + { + var data = new List(); + var requestUri = $"api/team/list"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var teamService = new Mock(caller.Object, userContext.Object); + var result = await teamService.Object.GetAllAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestGetUserTeamsAsync() + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var data = new List(); + var requestUri = $"api/team/list?userId={userId}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var teamService = new Mock(caller.Object, userContext.Object); + var result = await teamService.Object.GetUserTeamsAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + Assert.IsTrue(result is not null); + } +} + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs new file mode 100644 index 000000000..718c24c7d --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/UserServiceTest.cs @@ -0,0 +1,446 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Auth.Service; + +namespace Masa.Contrib.StackSdks.Auth.Tests; + +[TestClass] +public class UserServiceTest +{ + [TestMethod] + public async Task TestAddAsync() + { + var addUser = new AddUserModel(); + var user = new UserModel(); + var requestUri = $"api/user/addExternal"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, addUser, default)).ReturnsAsync(user).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.AddAsync(addUser); + caller.Verify(provider => provider.PostAsync(requestUri, addUser, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task UpsertAsync() + { + var upsertUser = new UpsertUserModel(); + var user = new UserModel(); + var requestUri = $"api/user/upsertExternal"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, upsertUser, default)).ReturnsAsync(user).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.UpsertAsync(upsertUser); + caller.Verify(provider => provider.PostAsync(requestUri, upsertUser, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestGetListByDepartmentAsync() + { + var data = new List() + { + new StaffModel() + }; + Guid departmentId = Guid.NewGuid(); + var requestUri = $"api/staff/getListByDepartment"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetListByDepartmentAsync(departmentId); + caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetListByTeamAsync() + { + var data = new List() + { + new StaffModel() + }; + Guid teamId = Guid.NewGuid(); + var requestUri = $"api/staff/getListByTeam"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetListByTeamAsync(teamId); + caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetListByRoleAsync() + { + var data = new List() + { + new StaffModel() + }; + Guid roleId = Guid.NewGuid(); + var requestUri = $"api/staff/getListByRole"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetListByRoleAsync(roleId); + caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetTotalByDepartmentAsync() + { + long data = 10; + Guid departmentId = Guid.NewGuid(); + var requestUri = $"api/staff/getTotalByDepartment"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetTotalByDepartmentAsync(departmentId); + caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result == data); + } + + [TestMethod] + public async Task TestGetTotalByByRoleAsync() + { + long data = 10; + Guid roleId = Guid.NewGuid(); + var requestUri = $"api/staff/getTotalByRole"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetTotalByRoleAsync(roleId); + caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result == data); + } + + [TestMethod] + public async Task TestGetTotalByTeamAsync() + { + long data = 10; + Guid teamId = Guid.NewGuid(); + var requestUri = $"api/staff/getTotalByTeam"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetTotalByTeamAsync(teamId); + caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result == data); + } + + [TestMethod] + [DataRow("account", "123456")] + public async Task TestValidateCredentialsByAccountAsync(string account, string password) + { + var data = false; + Guid departmentId = Guid.NewGuid(); + var requestUri = $"api/user/validateByAccount"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.ValidateCredentialsByAccountAsync(account, password); + caller.Verify(provider => provider.PostAsync(requestUri, It.IsAny(), default), Times.Once); + } + + [TestMethod] + [DataRow("authount")] + public async Task TestFindByAccountAsync(string account) + { + var data = new UserModel(); + var requestUri = $"api/user/findByAccount"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.FindByAccountAsync(account); + caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + [DataRow("15168440403")] + public async Task TestFindByPhoneNumberAsync(string phoneNumber) + { + var data = new UserModel() + { + PhoneNumber = phoneNumber + }; + var requestUri = $"api/user/findByPhoneNumber"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.FindByPhoneNumberAsync(phoneNumber); + caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result is not null && result.PhoneNumber == data.PhoneNumber); + } + + [TestMethod] + [DataRow("824255786@qq.com")] + public async Task TestFindByEmailAsync(string email) + { + var data = new UserModel(); + var requestUri = $"api/user/findByEmail"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.FindByEmailAsync(email); + caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result is not null && result.Email == data.Email); + } + + [TestMethod] + public async Task TestGetCurrentUserAsync() + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var data = new UserModel(); + var requestUri = $"api/user/findById"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetCurrentUserAsync(); + caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestGetCurrentStaffAsync() + { + var userId = Guid.NewGuid(); + var data = new StaffDetailModel(); + var requestUri = $"api/staff/getExternalByUserId"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetCurrentStaffAsync(); + caller.Verify(provider => provider.GetAsync(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + [DataRow("https://www.baidu.com/")] + public async Task TestVisitedAsync(string url) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var requestUri = $"api/user/visit"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, new { UserId = userId, Url = url }, true, default)).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var userService = new UserService(caller.Object, userContext.Object); + await userService.VisitedAsync(url); + caller.Verify(provider => provider.PostAsync(requestUri, It.IsAny(), true, default), Times.Once); + } + + [TestMethod] + public async Task TestGetVisitedListAsync() + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var data = new List() { + new UserVisitedModel + { + Name="baidu", + Url = "https://www.baidu.com/" + } + }; + var requestUri = $"api/user/visitedList"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetVisitedListAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestUpdatePasswordAsync() + { + var user = new UpdateUserPasswordModel + { + Id = Guid.NewGuid(), + NewPassword = "masa123", + OldPassword = "masa123" + }; + var requestUri = $"api/user/updatePassword"; + var caller = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, user, true, default)).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + await userService.UpdatePasswordAsync(user); + caller.Verify(provider => provider.PutAsync(requestUri, user, true, default), Times.Once); + } + + [TestMethod] + public async Task TestDisableUserAsync() + { + var user = new DisableUserModel("account"); + var requestUri = $"api/user/disable"; + var caller = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, user, default)).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + await userService.DisableUserAsync(user); + caller.Verify(provider => provider.PutAsync(requestUri, user, default), Times.Once); + } + + [TestMethod] + public async Task TestUpdateBasicInfoAsync() + { + var user = new UpdateUserBasicInfoModel + { + Id = Guid.NewGuid(), + DisplayName = "test", + Gender = GenderTypes.Male, + PhoneNumber = "15168440403" + }; + var requestUri = $"api/user/updateBasicInfo"; + var caller = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, user, true, default)).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + await userService.UpdateBasicInfoAsync(user); + caller.Verify(provider => provider.PutAsync(requestUri, user, true, default), Times.Once); + } + + [TestMethod] + public async Task GetUserPortraitsAsync() + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var userPortraits = new List { + new UserPortraitModel + { + Id = Guid.NewGuid(), + DisplayName = "DisplayName", + Account = "Account", + Name = "Name", + Avatar = "Avatar" + } + }; + var requestUri = $"api/user/portraits"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync>(requestUri, new Guid[] { userId }, default)) + .ReturnsAsync(userPortraits).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var data = await userService.GetUserPortraitsAsync(userId); + caller.Verify(provider => provider.PostAsync>(requestUri, new Guid[] { userId }, default), Times.Once); + Assert.IsTrue(data.Count == 1); + } + + [TestMethod] + [DataRow("masa-auth")] + public async Task TestIntGetUserSystemDataAsync(string systemId) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var data = 1; + var requestUri = $"api/user/GetUserSystemData"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)) + .ReturnsAsync(data.ToString()).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetUserSystemDataAsync(systemId); + Assert.IsTrue(result == 1); + } + + [TestMethod] + [DataRow("masa-auth")] + public async Task TestObjectGetUserSystemDataAsync(string systemId) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var data = new SystemData + { + Name = "name", + Value = "value" + }; + var requestUri = $"api/user/GetUserSystemData"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, It.IsAny(), default)) + .ReturnsAsync(JsonSerializer.Serialize(data)).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetUserSystemDataAsync(systemId); + Assert.IsTrue(result is not null); + } + + [TestMethod] + [DataRow("masa-auth")] + public async Task TestIntSaveUserSystemDataAsync(string systemId) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var requestUri = $"api/user/UserSystemData"; + var value = 1; + var data = new { UserId = userId, SystemId = systemId, Data = JsonSerializer.Serialize(value) }; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, data, true, default)).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var userService = new UserService(caller.Object, userContext.Object); + await userService.SaveUserSystemDataAsync(systemId, value); + caller.Verify(provider => provider.PostAsync(requestUri, It.IsAny(), true, default), Times.Once); + } + + [TestMethod] + [DataRow("masa-auth")] + public async Task TestObjectSaveUserSystemDataAsync(string systemId) + { + var userId = Guid.Parse("A9C8E0DD-1E9C-474D-8FE7-8BA9672D53D1"); + var requestUri = $"api/user/UserSystemData"; + var value = new SystemData + { + Name = "name", + Value = "value" + }; + var data = new { UserId = userId, SystemId = systemId, Data = JsonSerializer.Serialize(value) }; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, data, true, default)).Verifiable(); + var userContext = new Mock(); + userContext.Setup(user => user.GetUserId()).Returns(userId).Verifiable(); + var userService = new UserService(caller.Object, userContext.Object); + await userService.SaveUserSystemDataAsync(systemId, value); + caller.Verify(provider => provider.PostAsync(requestUri, It.IsAny(), true, default), Times.Once); + } + + [TestMethod] + public async Task TestGetListByAccountAsync() + { + var data = new List() + { + new UserSimpleModel(Guid.NewGuid(), "account", "displayName") + }; + var accounts = new List { "account" }; + var requestUri = $"api/user/GetListByAccount"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var userContext = new Mock(); + var userService = new UserService(caller.Object, userContext.Object); + var result = await userService.GetListByAccountAsync(accounts); + caller.Verify(provider => provider.GetAsync>(requestUri, It.IsAny(), default), Times.Once); + Assert.IsTrue(result.Count == 1); + } +} + +class SystemData +{ + public string Name { get; set; } + public string Value { get; set; } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs new file mode 100644 index 000000000..76252fde4 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Auth; +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; +global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Service.Caller; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Text.Json; diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs new file mode 100644 index 000000000..fe85d35f9 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/DccClientTest.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Dcc.Tests; + +[TestClass] +public class DccClientTest +{ + [TestMethod] + public void TestAddDccClient() + { + var services = new ServiceCollection(); + + services.AddDccClient(); + + var dccClient = services.BuildServiceProvider().GetRequiredService(); + Assert.IsNotNull(dccClient); + } + + [TestMethod] + public void TestAddDccClient2() + { + var services = new ServiceCollection(); + var options = AppSettings.GetModel("DccOptions:RedisOptions"); + + services.AddDccClient(options); + + var dccClient = services.BuildServiceProvider().GetRequiredService(); + Assert.IsNotNull(dccClient); + } + + [TestMethod] + public void TestAddDccClient3() + { + var services = new ServiceCollection(); + + services.AddDccClient(options => + { + options.Servers.Add(new RedisServerOptions("localhost", 8888)); + options.DefaultDatabase = 0; + options.Password = "xxxx"; + }); + + var dccClient = services.BuildServiceProvider().GetRequiredService(); + Assert.IsNotNull(dccClient); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs new file mode 100644 index 000000000..be35f83e3 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/LabelServiceTest.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Dcc.Tests; + +[TestClass] +public class LabelServiceTest +{ + [TestMethod] + [DataRow("status")] + public async Task TestGetListByTypeCodeAsync(string typeCode) + { + var data = new List + { + new LabelModel { Code = "normal" }, + new LabelModel { Code = "frozen" } + }; + + var distributedCacheClient = new Mock(); + distributedCacheClient.Setup(client => client.GetAsync>(typeCode)).ReturnsAsync(data).Verifiable(); + var dccClient = new DccClient(distributedCacheClient.Object); + + var result = await dccClient.LabelService.GetListByTypeCodeAsync(typeCode); + distributedCacheClient.Verify(client => client.GetAsync>(typeCode), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow("status")] + public async Task TestGetListByTypeCodeAsync2(string typeCode) + { + List? data = null; + + var distributedCacheClient = new Mock(); + distributedCacheClient.Setup(client => client.GetAsync>(It.IsAny())).ReturnsAsync(data).Verifiable(); + var dccClient = new DccClient(distributedCacheClient.Object); + + var result = await dccClient.LabelService.GetListByTypeCodeAsync(typeCode); + distributedCacheClient.Verify(client => client.GetAsync>(typeCode), Times.Once); + + Assert.IsFalse(result.Any()); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj new file mode 100644 index 000000000..9c967855f --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/Masa.Contrib.StackSdks.Dcc.Tests.csproj @@ -0,0 +1,35 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + Always + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs new file mode 100644 index 000000000..1bd727faa --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Dcc; +global using Masa.BuildingBlocks.StackSdks.Dcc.Model; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Redis.Models; +global using Masa.Utils.Configuration.Json; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json new file mode 100644 index 000000000..c0f6fc8f9 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Dcc.Tests/appsettings.json @@ -0,0 +1,14 @@ +{ + "DccOptions": { + "RedisOptions": { + "Servers": [ + { + "Host": "localhost", + "Port": 8888 + } + ], + "DefaultDatabase": 0, + "Password": "" + } + } +} \ No newline at end of file diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs new file mode 100644 index 000000000..f3770e583 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/ChannelServiceTest.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; + +[TestClass] +public class ChannelServiceTest +{ + [TestMethod] + public async Task TestGetAsync() + { + var data = new ChannelModel(); + Guid channelId = Guid.NewGuid(); + var requestUri = $"api/channel/{channelId}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var channelService = new Mock(caller.Object); + var result = await channelService.Object.GetAsync(channelId); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestGetListAsync() + { + var options = new GetChannelModel(); + var data = new PaginatedListModel(); + var requestUri = $"api/channel"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); + var channelService = new Mock(caller.Object); + var result = await channelService.Object.GetListAsync(options); + caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); + Assert.IsTrue(result is not null); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj new file mode 100644 index 000000000..412751077 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/Masa.Contrib.StackSdks.Mc.Tests.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + false + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs new file mode 100644 index 000000000..7add33b0f --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/McClientTest.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Mc.Tests; + +[TestClass] +public class McClientTest +{ + [TestMethod] + public void TestAddMcClient() + { + var services = new ServiceCollection(); + services.AddMcClient("https://localhost:18102"); + var mcClient = services.BuildServiceProvider().GetRequiredService(); + + Assert.IsNotNull(mcClient); + } + + [TestMethod] + public void TestAddMcClientShouldThrowArgumentNullException() + { + var services = new ServiceCollection(); + Assert.ThrowsException(() => services.AddMcClient(mcServiceBaseAddress: null!)); + } + + [TestMethod] + public void TestAddMcClientShouldThrowArgumentNullException2() + { + var services = new ServiceCollection(); + Assert.ThrowsException(() => services.AddMcClient(callerOptions: null!)); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs new file mode 100644 index 000000000..3b10fcf88 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/MessageTaskServiceTest.cs @@ -0,0 +1,48 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; + +[TestClass] +public class MessageTaskServiceTest +{ + [TestMethod] + public async Task TestGetAsync() + { + var data = new MessageTaskModel(); + Guid id = Guid.NewGuid(); + var requestUri = $"api/message-task/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var messageTaskService = new Mock(caller.Object); + var result = await messageTaskService.Object.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestSendOrdinaryMessageAsync() + { + var options = new SendOrdinaryMessageModel(); + var requestUri = $"api/message-task/SendOrdinaryMessage"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, options, true, default)).Verifiable(); + var messageTaskService = new Mock(caller.Object); + await messageTaskService.Object.SendOrdinaryMessageAsync(options); + caller.Verify(provider => provider.PostAsync(requestUri, options, true, default), Times.Once); + } + + [TestMethod] + public async Task TestSendTemplateMessageAsync() + { + var options = new SendTemplateMessageModel(); + var requestUri = $"api/message-task/SendTemplateMessage"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, options, true, default)).Verifiable(); + var messageTaskService = new Mock(caller.Object); + await messageTaskService.Object.SendTemplateMessageAsync(options); + caller.Verify(provider => provider.PostAsync(requestUri, options, true, default), Times.Once); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs new file mode 100644 index 000000000..bf36d9c4f --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/MessageTemplateServiceTest.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; + +[TestClass] +public class MessageTemplateServiceTest +{ + [TestMethod] + public async Task TestGetAsync() + { + var data = new MessageTemplateModel(); + Guid id = Guid.NewGuid(); + var requestUri = $"api/message-template/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var messageTemplateService = new Mock(caller.Object); + var result = await messageTemplateService.Object.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestGetListAsync() + { + var options = new GetMessageTemplateModel(); + var data = new PaginatedListModel(); + var requestUri = $"api/message-template"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); + var messageTemplateService = new Mock(caller.Object); + var result = await messageTemplateService.Object.GetListAsync(options); + caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); + Assert.IsTrue(result is not null); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs new file mode 100644 index 000000000..d4837f198 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/ReceiverGroupServiceTest.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; + +[TestClass] +public class ReceiverGroupServiceTest +{ + [TestMethod] + public async Task TestGetAsync() + { + var data = new ReceiverGroupModel(); + Guid id = Guid.NewGuid(); + var requestUri = $"api/receiver-group/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var receiverGroupService = new Mock(caller.Object); + var result = await receiverGroupService.Object.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestGetListAsync() + { + var options = new GetReceiverGroupModel(); + var data = new PaginatedListModel(); + var requestUri = $"api/receiver-group"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); + var receiverGroupService = new Mock(caller.Object); + var result = await receiverGroupService.Object.GetListAsync(options); + caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); + Assert.IsTrue(result is not null); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs new file mode 100644 index 000000000..3b46137aa --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/WebsiteMessageServiceTest.cs @@ -0,0 +1,112 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Mc.Service; + +namespace Masa.Contrib.StackSdks.Mc.Tests; + +[TestClass] +public class WebsiteMessageServiceTest +{ + [TestMethod] + public async Task TestGetAsync() + { + var data = new WebsiteMessageModel(); + Guid id = Guid.NewGuid(); + var requestUri = $"api/website-message/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var websiteMessageService = new Mock(caller.Object); + var result = await websiteMessageService.Object.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestGetListAsync() + { + var options = new GetWebsiteMessageModel(); + var data = new PaginatedListModel(); + var requestUri = $"api/website-message"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); + var websiteMessageService = new Mock(caller.Object); + var result = await websiteMessageService.Object.GetListAsync(options); + caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestCheckAsync() + { + var requestUri = $"api/website-message/Check"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, null, true, default)).Verifiable(); + var websiteMessageService = new Mock(caller.Object); + await websiteMessageService.Object.CheckAsync(); + caller.Verify(provider => provider.PostAsync(requestUri, null, true, default), Times.Once); + } + + [TestMethod] + public async Task TestDeleteAsync() + { + Guid id = Guid.NewGuid(); + var requestUri = $"api/website-message/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.DeleteAsync(requestUri, null, true, default)).Verifiable(); + var websiteMessageService = new Mock(caller.Object); + await websiteMessageService.Object.DeleteAsync(id); + caller.Verify(provider => provider.DeleteAsync(requestUri, null, true, default), Times.Once); + } + + [TestMethod] + public async Task TestGetChannelListAsync() + { + var data = new List(); + var requestUri = $"api/website-message/GetChannelList"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var websiteMessageService = new Mock(caller.Object); + var result = await websiteMessageService.Object.GetChannelListAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestGetNoticeListAsync() + { + var options = new GetNoticeListModel(); + var data = new List(); + var requestUri = $"api/website-message/GetNoticeList"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, options, default)).ReturnsAsync(data).Verifiable(); + var websiteMessageService = new Mock(caller.Object); + var result = await websiteMessageService.Object.GetNoticeListAsync(options); + caller.Verify(provider => provider.GetAsync>(requestUri, options, default), Times.Once); + Assert.IsTrue(result is not null); + } + + [TestMethod] + public async Task TestReadAsync() + { + var options = new ReadWebsiteMessageModel(); + var requestUri = $"api/website-message/Read"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, options, true, default)).Verifiable(); + var websiteMessageService = new Mock(caller.Object); + await websiteMessageService.Object.ReadAsync(options); + caller.Verify(provider => provider.PostAsync(requestUri, options, true, default), Times.Once); + } + + [TestMethod] + public async Task TestSetAllReadAsync() + { + var options = new ReadAllWebsiteMessageModel(); + var requestUri = $"api/website-message/SetAllRead"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, options, true, default)).Verifiable(); + var websiteMessageService = new Mock(caller.Object); + await websiteMessageService.Object.SetAllReadAsync(options); + caller.Verify(provider => provider.PostAsync(requestUri, options, true, default), Times.Once); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs new file mode 100644 index 000000000..d8723b800 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Mc; +global using Masa.BuildingBlocks.StackSdks.Mc.Model; +global using Masa.BuildingBlocks.Service.Caller; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; +global using System.Collections.Generic; +global using System.Threading.Tasks; diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs new file mode 100644 index 000000000..a362f262c --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/AppServiceTest.cs @@ -0,0 +1,184 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.Contrib.StackSdks.Pm.Tests; + +[TestClass] +public class AppServiceTest +{ + [TestMethod] + [DataRow(1)] + public async Task TestGetAsync(int id) + { + var data = new AppDetailModel(); + + var requestUri = $"api/v1/app/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGet1Async(int id) + { + AppDetailModel? data = null; + + var requestUri = $"api/v1/app/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow("identity")] + public async Task TestGetByIdentityAsync(string identity) + { + var data = new AppDetailModel(); + + var requestUri = $"open-api/app/{identity}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetByIdentityAsync(identity); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow("identity")] + public async Task TestGetByIdentity1Async(string identity) + { + AppDetailModel? data = null; + + var requestUri = $"open-api/app/{identity}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetByIdentityAsync(identity); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + public async Task TestGetListAsync() + { + var data = new List + { + new AppDetailModel() + }; + + var requestUri = $"api/v1/app"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetListAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetList1Async() + { + List? data = null; + + var requestUri = $"api/v1/app"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetListAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } + + [TestMethod] + public async Task TestGetListByProjectIdsAsync() + { + var data = new List + { + new AppDetailModel() + }; + var projectIds = new List { 1 }; + + var requestUri = $"api/v1/projects/app"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync, List>(requestUri, projectIds, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetListByProjectIdsAsync(projectIds); + caller.Verify(provider => provider.PostAsync, List>(requestUri, projectIds, default), Times.Once); + + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetListByProjectIds1Async() + { + List? data = null; + var projectIds = new List { 1 }; + + var requestUri = $"api/v1/projects/app"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync, List>(It.IsAny(), projectIds, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetListByProjectIdsAsync(projectIds); + caller.Verify(provider => provider.PostAsync, List>(requestUri, projectIds, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGetWithEnvironmentClusterAsync(int id) + { + var data = new AppDetailModel(); + + var requestUri = $"api/v1/appWhitEnvCluster/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetWithEnvironmentClusterAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGetWithEnvironmentCluster1Async(int id) + { + AppDetailModel? data = null; + + var requestUri = $"api/v1/appWhitEnvCluster/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.AppService.GetWithEnvironmentClusterAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs new file mode 100644 index 000000000..b25ef71d7 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/ClusterServiceTest.cs @@ -0,0 +1,151 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.Contrib.StackSdks.Pm.Tests; + +[TestClass] +public class ClusterServiceTest +{ + [TestMethod] + [DataRow(1)] + public async Task TestGetAsync(int id) + { + var data = new ClusterDetailModel(); + + var requestUri = $"api/v1/cluster/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ClusterService.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGetAsync1(int id) + { + ClusterDetailModel? data = null; + + var requestUri = $"api/v1/cluster/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ClusterService.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + public async Task TestGetEnvironmentClustersAsync() + { + var data = new List + { + new EnvironmentClusterModel { Id = 1 } + }; + + var requestUri = $"api/v1/envClusters"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ClusterService.GetEnvironmentClustersAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetEnvironmentClusters1Async() + { + List? data = null; + + var requestUri = $"api/v1/envClusters"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ClusterService.GetEnvironmentClustersAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } + + [TestMethod] + public async Task TestGetListAsync() + { + var data = new List + { + new ClusterModel { Id = 1 } + }; + + var requestUri = $"api/v1/cluster"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ClusterService.GetListAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetList1Async() + { + List? data = null; + + var requestUri = $"api/v1/cluster"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ClusterService.GetListAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGetListByEnvIdAsync(int envId) + { + var data = new List + { + new ClusterModel { Id = 1 } + }; + + var requestUri = $"api/v1/{envId}/cluster"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ClusterService.GetListByEnvIdAsync(envId); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGetListByEnvId1Async(int envId) + { + List? data = null; + + var requestUri = $"api/v1/{envId}/cluster"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ClusterService.GetListByEnvIdAsync(envId); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs new file mode 100644 index 000000000..dbfb3af8f --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/EnvironmentServiceTest.cs @@ -0,0 +1,79 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.Contrib.StackSdks.Pm.Tests; + +[TestClass] +public class EnvironmentServiceTest +{ + [TestMethod] + [DataRow(1)] + public async Task TestGetAsync(int id) + { + var data = new EnvironmentDetailModel(); + + var requestUri = $"api/v1/env/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default).Result).Returns(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.EnvironmentService.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGet1Async(int id) + { + EnvironmentDetailModel? data = null; + + var requestUri = $"api/v1/env/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.EnvironmentService.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + public async Task TestGetListAsync() + { + var data = new List + { + new EnvironmentModel { Id=1, Color="", Name="" } + }; + + var requestUri = $"api/v1/env"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.EnvironmentService.GetListAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetList1Async() + { + List? data = null; + + var requestUri = $"api/v1/env"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.EnvironmentService.GetListAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj new file mode 100644 index 000000000..0aa09f256 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/Masa.Contrib.StackSdks.Pm.Tests.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + false + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs new file mode 100644 index 000000000..91340da45 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/PmClientTest.cs @@ -0,0 +1,74 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm; + +namespace Masa.Contrib.StackSdks.Pm.Tests; + +[TestClass] +public class PmClientTest +{ + [TestMethod] + public void TestAddPmClient() + { + var services = new ServiceCollection(); + + services.AddPmClient(option => + { + option.UseHttpClient(builder => + { + builder.Name = "masa.contrib.basicability.pm"; + builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); + }); + }); + + var pmClient = services.BuildServiceProvider().GetRequiredService(); + Assert.IsNotNull(pmClient); + } + + [TestMethod] + public void TestAddPmClient1() + { + var services = new ServiceCollection(); + + services.AddPmClient("https://github.com"); + + var pmClient = services.BuildServiceProvider().GetRequiredService(); + Assert.IsNotNull(pmClient); + } + + [TestMethod] + public void TestAddPmClientShouldThrowArgumentNullException() + { + var services = new ServiceCollection(); + + Assert.ThrowsException(() => services.AddPmClient("")); + } + + [TestMethod] + public void TestAddMultiplePmClient() + { + var services = new ServiceCollection(); + + services.AddPmClient(option => + { + option.UseHttpClient(builder => + { + builder.Name = "masa.contrib.basicability.pm"; + builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); + }); + }); + + services.AddPmClient(option => + { + option.UseHttpClient(builder => + { + builder.Name = "masa.contrib.basicability.pm"; + builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); + }); + }); + + var pmClient = services.BuildServiceProvider().GetRequiredService(); + Assert.IsNotNull(pmClient); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs new file mode 100644 index 000000000..704b28e30 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/ProjectServiceTest.cs @@ -0,0 +1,216 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Pm.Model; + +namespace Masa.Contrib.StackSdks.Pm.Tests; + +[TestClass] +public class ProjectServiceTest +{ + [TestMethod] + public async Task TestGetProjectAppsAsync() + { + var data = new List() + { + new ProjectAppsModel(1, "", "", "", Guid.NewGuid()) + }; + string env = "development"; + var requestUri = $"api/v1/projectwithapps/{env}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetProjectAppsAsync(env); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetProjectApps2Async() + { + List? data = null; + string env = "development"; + var requestUri = $"api/v1/projectwithapps/{env}"; + var caller = new Mock(); + caller.Setup(provider => (provider.GetAsync>(It.IsAny(), default))).ReturnsAsync(data) + .Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetProjectAppsAsync(env); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGetAsync(int Id) + { + var data = new ProjectDetailModel(); + + var requestUri = $"api/v1/project/{Id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetAsync(Id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGet1Async(int id) + { + ProjectDetailModel? data = null; + + var requestUri = $"api/v1/project/{id}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetAsync(id); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow("identity")] + public async Task TestGetByIdentityAsync(string identity) + { + var data = new ProjectDetailModel(); + + var requestUri = $"open-api/project/{identity}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetByIdentityAsync(identity); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow("identity")] + public async Task TestGetByIdentity1Async(string identity) + { + ProjectDetailModel? data = null; + + var requestUri = $"open-api/project/{identity}"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetByIdentityAsync(identity); + caller.Verify(provider => provider.GetAsync(requestUri, default), Times.Once); + + Assert.IsNotNull(result); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGetListByEnvironmentClusterIdAsync(int envClusterId) + { + var data = new List() + { + new ProjectModel { Id = 1 } + }; + var requestUri = $"api/v1/{envClusterId}/project"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetListByEnvironmentClusterIdAsync(envClusterId); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + [DataRow(1)] + public async Task TestGetListByEnvironmentClusterId1Async(int envClusterId) + { + List? data = null; + var requestUri = $"api/v1/{envClusterId}/project"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetListByEnvironmentClusterIdAsync(envClusterId); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } + + [TestMethod] + public async Task TestGetListByTeamIdsAsync() + { + var data = new List() + { + new ProjectModel { Id = 1 } + }; + var teamIds = new List { Guid.NewGuid() }; + var requestUri = $"api/v1/project/teamProjects"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync>(requestUri, teamIds, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetListByTeamIdsAsync(teamIds); + caller.Verify(provider => provider.PostAsync>(requestUri, teamIds, default), Times.Once); + + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetListByTeamIds1Async() + { + List? data = null; + var teamIds = new List { Guid.NewGuid() }; + var requestUri = $"api/v1/project/teamProjects"; + var caller = new Mock(); + caller.Setup(provider => provider.PostAsync>(It.IsAny(), It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetListByTeamIdsAsync(teamIds); + caller.Verify(provider => provider.PostAsync>(requestUri, teamIds, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } + + [TestMethod] + public async Task TestGetProjectTypesAsync() + { + var data = new List() + { + new ProjectTypeModel { Id = 1 } + }; + var requestUri = $"api/v1/project/projectType"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(requestUri, default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetProjectTypesAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 1); + } + + [TestMethod] + public async Task TestGetProjectTypes1Async() + { + List? data = null; + var requestUri = $"api/v1/project/projectType"; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync>(It.IsAny(), default)).ReturnsAsync(data).Verifiable(); + var pmCaching = new PmClient(caller.Object); + + var result = await pmCaching.ProjectService.GetProjectTypesAsync(); + caller.Verify(provider => provider.GetAsync>(requestUri, default), Times.Once); + + Assert.IsTrue(result.Count == 0); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs new file mode 100644 index 000000000..5e7752b4e --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Pm.Tests/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; +global using System.Collections.Generic; +global using System.Threading.Tasks; diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj new file mode 100644 index 000000000..f465981f1 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/Masa.Contrib.StackSdks.Scheduler.Tests.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + false + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs new file mode 100644 index 000000000..8bf68e47e --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerClientTest.cs @@ -0,0 +1,54 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Scheduler; + +namespace Masa.Contrib.StackSdks.Scheduler.Tests; + +[TestClass] +public class SchedulerClientTest +{ + [TestMethod] + public void TestAddSchedulerClientByOptions() + { + var services = new ServiceCollection(); + + services.AddSchedulerClient(option => + { + option.UseHttpClient(builder => + { + builder.Name = "masa.contrib.basicability.scheduler"; + builder.Configure = opt => opt.BaseAddress = new Uri("https://github.com"); + }); + }); + + var schedulerClient = services.BuildServiceProvider().GetService(); + Assert.IsNotNull(schedulerClient); + } + + [TestMethod] + public void TestAddSchedulerClient() + { + var services = new ServiceCollection(); + services.AddSchedulerClient("https://github.com"); + var schedulerClient = services.BuildServiceProvider().GetService(); + Assert.IsNotNull(schedulerClient); + } + + [TestMethod] + public void TestAddSchedulerClientShouldThrowArgumentNullException() + { + var services = new ServiceCollection(); + + Assert.ThrowsException(() => services.AddSchedulerClient("")); + } + + [TestMethod] + public void TestAddSchedulerClientShouldThrowArgumentNullException2() + { + var services = new ServiceCollection(); + + Assert.ThrowsException(() => services.AddSchedulerClient(callerOptions: null!)); + } + +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs new file mode 100644 index 000000000..b13e932b5 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerJobServiceTest.cs @@ -0,0 +1,307 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Scheduler.Enum; +using Masa.BuildingBlocks.StackSdks.Scheduler.Model; +using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +using Masa.Contrib.StackSdks.Scheduler; + +namespace Masa.Contrib.StackSdks.Scheduler.Tests; + +[TestClass] +public class SchedulerJobServiceTest +{ + const string API = "/api/scheduler-job"; + + [TestMethod] + public async Task TestAddSchedulerHttpJobAsync() + { + var requestData = new AddSchedulerJobRequest() + { + Name = "TestJob", + JobType = JobTypes.Http, + ProjectIdentity = "MASA_MC", + CronExpression = "", + HttpConfig = new SchedulerJobHttpConfig() + { + RequestUrl = "www.baidu.com", + HttpVerifyType = HttpVerifyTypes.CustomStatusCode, + HttpBody = "", + HttpHeaders = new List>() + { + new KeyValuePair("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36") + }, + HttpMethod = HttpMethods.GET, + VerifyContent = "200", + HttpParameters = new List>() + { + new KeyValuePair("ie", "utf-8"), + } + }, + OperatorId = Guid.NewGuid(), + Description = "Test", + FailedRetryCount = 0, + FailedRetryInterval = 0, + IsAlertException = false, + RunTimeoutSecond = 30, + RunTimeoutStrategy = RunTimeoutStrategyTypes.IgnoreTimeout, + ScheduleBlockStrategy = ScheduleBlockStrategyTypes.Parallel, + ScheduleExpiredStrategy = ScheduleExpiredStrategyTypes.Ignore + }; + + var requestUri = $"{API}/addSchedulerJobBySdk"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + var result = await schedulerClient.SchedulerJobService.AddAsync(requestData); + caller.Verify(provider => provider.PostAsync(requestUri, requestData, default), Times.Once); + + Assert.AreNotEqual(Guid.Empty, result); + } + + [TestMethod] + public async Task TestAddSchedulerJobApp() + { + var requestData = new AddSchedulerJobRequest() + { + Name = "TestJob", + JobType = JobTypes.JobApp, + ProjectIdentity = "MASA_MC", + CronExpression = "", + JobAppConfig = new SchedulerJobAppConfig() + { + JobAppIdentity = "MASA_MC_SERVICE", + JobEntryAssembly = "Masa.Test.Job", + JobEntryClassName = "TestRunJob", + JobParams = "1;2;3", + Version = "" + }, + OperatorId = Guid.NewGuid(), + Description = "Test", + FailedRetryCount = 0, + FailedRetryInterval = 0, + IsAlertException = false, + RunTimeoutSecond = 30, + RunTimeoutStrategy = RunTimeoutStrategyTypes.IgnoreTimeout, + ScheduleBlockStrategy = ScheduleBlockStrategyTypes.Parallel, + ScheduleExpiredStrategy = ScheduleExpiredStrategyTypes.Ignore + }; + + var requestUri = $"{API}/addSchedulerJobBySdk"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + var result = await schedulerClient.SchedulerJobService.AddAsync(requestData); + caller.Verify(provider => provider.PostAsync(requestUri, requestData, default), Times.Once); + + Assert.AreNotEqual(Guid.Empty, result); + } + + [TestMethod] + public async Task TestAddSchedulerDaprServiceInvocationJob() + { + var requestData = new AddSchedulerJobRequest() + { + Name = "TestJob", + JobType = JobTypes.DaprServiceInvocation, + ProjectIdentity = "MASA_MC", + CronExpression = "", + DaprServiceInvocationConfig = new SchedulerJobDaprServiceInvocationConfig() + { + DaprServiceIdentity = "MASA_MC_DAPR_SERVICE", + Data = "Test", + HttpMethod = HttpMethods.POST, + MethodName = "TestMethod" + }, + OperatorId = Guid.NewGuid(), + Description = "Test", + FailedRetryCount = 0, + FailedRetryInterval = 0, + IsAlertException = false, + RunTimeoutSecond = 30, + RunTimeoutStrategy = RunTimeoutStrategyTypes.IgnoreTimeout, + ScheduleBlockStrategy = ScheduleBlockStrategyTypes.Parallel, + ScheduleExpiredStrategy = ScheduleExpiredStrategyTypes.Ignore + }; + + var requestUri = $"{API}/addSchedulerJobBySdk"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + var result = await schedulerClient.SchedulerJobService.AddAsync(requestData); + caller.Verify(provider => provider.PostAsync(requestUri, requestData, default), Times.Once); + + Assert.AreNotEqual(Guid.Empty, result); + } + + [TestMethod] + public async Task TestAddSchedulerJobArgumentNullException() + { + var requestData = new AddSchedulerJobRequest() + { + Name = "TestJob", + JobType = JobTypes.Http, + CronExpression = "", + HttpConfig = new SchedulerJobHttpConfig() + { + RequestUrl = "www.baidu.com", + HttpVerifyType = HttpVerifyTypes.CustomStatusCode, + HttpBody = "", + HttpHeaders = new List>() + { + new KeyValuePair("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36") + }, + HttpMethod = HttpMethods.GET, + VerifyContent = "200", + HttpParameters = new List>() + { + new KeyValuePair("ie", "utf-8"), + } + }, + OperatorId = Guid.NewGuid() + }; + + var requestUri = $"{API}/addSchedulerJobBySdk"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); + } + + [TestMethod] + public async Task TestAddSchedulerHttpJobArgumentNullException() + { + var requestData = new AddSchedulerJobRequest() + { + Name = "TestJob", + JobType = JobTypes.Http, + CronExpression = "", + OperatorId = Guid.NewGuid() + }; + + var requestUri = $"{API}/addSchedulerJobBySdk"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); + } + + [TestMethod] + public async Task TestAddSchedulerJobAppArgumentNullException() + { + var requestData = new AddSchedulerJobRequest() + { + Name = "TestJob", + JobType = JobTypes.JobApp, + CronExpression = "", + OperatorId = Guid.NewGuid() + }; + + var requestUri = $"{API}/addSchedulerJobBySdk"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); + } + + [TestMethod] + public async Task TestAddSchedulerDaprInvocationJobArgumentNullException() + { + var requestData = new AddSchedulerJobRequest() + { + Name = "TestJob", + JobType = JobTypes.DaprServiceInvocation, + CronExpression = "", + OperatorId = Guid.NewGuid() + }; + + var requestUri = $"{API}/addSchedulerJobBySdk"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PostAsync(requestUri, requestData, default)).ReturnsAsync(Guid.NewGuid()).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + await Assert.ThrowsExceptionAsync(async () => await schedulerClient.SchedulerJobService.AddAsync(requestData)); + } + + [TestMethod] + public async Task TestRemoveSchedulerJobAsync() + { + var requestData = new BaseSchedulerJobRequest() + { + JobId = Guid.NewGuid(), + OperatorId = Guid.NewGuid() + }; + + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.DeleteAsync(API, requestData, true, default)).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + var result = await schedulerClient.SchedulerJobService.RemoveAsync(requestData); + caller.Verify(provider => provider.DeleteAsync(API, requestData, true, default), Times.Once); + + Assert.IsTrue(result); + } + + [TestMethod] + public async Task TestStartSchedulerJobAsync() + { + var requestData = new BaseSchedulerJobRequest() + { + JobId = Guid.NewGuid(), + OperatorId = Guid.NewGuid() + }; + + var requestUri = $"{API}/startJob"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, requestData, true, default)).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + var result = await schedulerClient.SchedulerJobService.StartAsync(requestData); + caller.Verify(provider => provider.PutAsync(requestUri, requestData, true, default), Times.Once); + Assert.IsTrue(result); + } + + [TestMethod] + public async Task TestEnableSchedulerJob() + { + var requestData = new BaseSchedulerJobRequest() + { + JobId = Guid.NewGuid(), + OperatorId = Guid.NewGuid() + }; + + var requestUri = $"{API}/changeEnableStatus"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, It.IsAny(), true, default)).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + var result = await schedulerClient.SchedulerJobService.EnableAsync(requestData); + caller.Verify(provider => provider.PutAsync(requestUri, It.IsAny(), true, default), Times.Once); + Assert.IsTrue(result); + } + + [TestMethod] + public async Task TestDisableSchedulerJob() + { + var requestData = new BaseSchedulerJobRequest() + { + JobId = Guid.NewGuid(), + OperatorId = Guid.NewGuid() + }; + + var requestUri = $"{API}/changeEnableStatus"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, It.IsAny(), true, default)).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + var result = await schedulerClient.SchedulerJobService.DisableAsync(requestData); + caller.Verify(provider => provider.PutAsync(requestUri, It.IsAny(), true, default), Times.Once); + Assert.IsTrue(result); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs new file mode 100644 index 000000000..3a640a9cc --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/SchedulerTaskServiceTest.cs @@ -0,0 +1,51 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.BuildingBlocks.StackSdks.Scheduler.Request; +using Masa.Contrib.StackSdks.Scheduler; + +namespace Masa.Contrib.StackSdks.Scheduler.Tests; + +[TestClass] +public class SchedulerTaskServiceTest +{ + const string API = "/api/scheduler-task"; + + [TestMethod] + public async Task TestStopSchedulerTaskAsync() + { + var requestData = new BaseSchedulerTaskRequest() + { + TaskId = Guid.NewGuid(), + OperatorId = Guid.NewGuid() + }; + + var requestUri = $"{API}/stop"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, requestData, true, default)).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + var result = await schedulerClient.SchedulerTaskService.StopAsync(requestData); + caller.Verify(provider => provider.PutAsync(requestUri, requestData, true, default), Times.Once); + Assert.IsTrue(result); + } + + [TestMethod] + public async Task TestStartSchedulerTaskAsync() + { + var request = new BaseSchedulerTaskRequest() + { + TaskId = Guid.NewGuid(), + OperatorId = Guid.NewGuid() + }; + + var requestUri = $"{API}/start"; + var caller = new Mock(); + var loggerFactory = new Mock(); + caller.Setup(provider => provider.PutAsync(requestUri, It.IsAny(), true, default)).Verifiable(); + var schedulerClient = new SchedulerClient(caller.Object, loggerFactory.Object); + var result = await schedulerClient.SchedulerTaskService.StartAsync(request); + caller.Verify(provider => provider.PutAsync(requestUri, It.IsAny(), true, default), Times.Once); + Assert.IsTrue(result); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs new file mode 100644 index 000000000..1e55edbd1 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Scheduler.Tests/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.Contrib.Service.Caller.HttpClient; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; +global using System.Collections.Generic; +global using System.Threading.Tasks; diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs new file mode 100644 index 000000000..69d64d3c6 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Extensions/CallerProviderExtensionsTests.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.StackSdks.Tsc.Tests.Extensions; + +[TestClass] +public class CallerProviderExtensionsTests +{ + [TestMethod] + public async Task SendGetRequestWithBodyParameterAsyncTest() + { + var caller = new Mock(); + string url = "http://locahost:80/test"; + var param = new { name = "name" }; + var result = "ok"; + caller.Setup(provider => provider.SendAsync(It.IsAny(), default)).ReturnsAsync(result); + var str = await caller.Object.GetByBodyAsync(url, "name"); + Assert.IsNotNull(str); + Assert.AreEqual(result, str); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj new file mode 100644 index 000000000..4eff3394b --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Masa.Contrib.StackSdks.Tsc.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + false + + + + + + + + + + + + + + + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs new file mode 100644 index 000000000..db1f238fd --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Service/LogServiceTests.cs @@ -0,0 +1,100 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Tsc; +using Masa.Contrib.StackSdks.Tsc.Service; + +namespace Masa.Contrib.StackSdks.Tsc.Tests.Service; + +[TestClass] +public class LogServiceTests +{ + [TestMethod] + public async Task GetMappingFieldsAsyncTest() + { + var caller = new Mock(); + + var time = DateTime.Now; + var query = new LableValuesRequest + { + Match = "up", + Start = time.AddMinutes(-15), + End = time + }; + var data = new string[] + { + "@timestamp", + "container.instance.id", + "container.instance.name", + "Id" + }; + caller.Setup(provider => provider.GetAsync>(LogService.FIELD_URI, default)).ReturnsAsync(data).Verifiable(); + var client = new TscClient(caller.Object); + var result = await client.LogService.GetFieldsAsync(); + Assert.IsNotNull(result); + } + + [TestMethod] + public async Task GetAggregationAsyncTest() + { + var caller = new Mock(); + + var time = DateTime.Now; + var query = new LogAggregationRequest + { + Start = time.AddMinutes(-15), + End = time, + FieldMaps = new FieldAggregationRequest[] + { + new FieldAggregationRequest{ + Name="container.instance.id", + AggregationType= AggregationTypes.Count, + Alias="count1" + }, + new FieldAggregationRequest{ + Name="container.instance.name", + AggregationType= AggregationTypes.Count, + Alias="count2" + } + } + }; + var data = new Dictionary + { + {"count1","0" }, + { "count2","0"} + }; + caller.Setup(provider => provider.GetAsync>>(LogService.FIELD_URI, query, default)).ReturnsAsync(data).Verifiable(); + var client = new TscClient(caller.Object); + + var result = await client.LogService.GetAggregationAsync(query); + Assert.IsNotNull(result); + } + + [TestMethod] + public async Task GetLatestAsyncTest() + { + var caller = new Mock(); + + var time = DateTime.Now; + var query = new LogLatestRequest + { + Start = time.AddMinutes(-15), + End = time, + IsDesc = true, + Query = "\"term\": {\"Resource.service.name\": \"masa.tsc.api\"}" + }; + + var str = "{\"@timestamp\":\"2022-06-15T09:09:05.972899500Z\",\"Attributes.ProcessorName\":\"Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Processor.RetryByDataProcessor\",\"Attributes.exception.message\":\"SQLite Error 1: 'no such table: IntegrationEventLog'.\",\"Attributes.exception.type\":\"SqliteException\",\"Attributes.{OriginalFormat}\":\"Processor '{ProcessorName}' failed\",\"Body\":\"Processor 'Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Processor.RetryByDataProcessor' failed\",\"Resource.service.instance.id\":\"5d9d00e3-5bb0-40bc-bbb8-ef0b210f739d\",\"Resource.service.name\":\"masa.tsc.api\",\"Resource.service.namespace\":\"Development\",\"Resource.service.version\":\"0.1.0\",\"Resource.telemetry.sdk.language\":\"dotnet\",\"Resource.telemetry.sdk.name\":\"opentelemetry\",\"Resource.telemetry.sdk.version\":\"1.3.0.470\",\"SeverityNumber\":13,\"SeverityText\":\"Warning\",\"TraceFlags\":0}"; + var options = new JsonSerializerOptions() + { + PropertyNameCaseInsensitive = true, + }; + options.Converters.Add(new JsonStringEnumConverter()); + var data = JsonSerializer.Deserialize(str, options); + caller.Setup(provider => provider.GetAsync(LogService.LATEST_URI, query, default)).ReturnsAsync(data).Verifiable(); + var client = new TscClient(caller.Object); + + var result = await client.LogService.GetLatestAsync(query); + Assert.IsNotNull(result); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs new file mode 100644 index 000000000..ad339c2bf --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/Service/MetricServiceTests.cs @@ -0,0 +1,86 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Contrib.StackSdks.Tsc; +using Masa.Contrib.StackSdks.Tsc.Service; + +namespace Masa.Contrib.StackSdks.Tsc.Tests.Service; + +[TestClass] +public class MetricServiceTests +{ + [TestMethod] + [DataRow(null)] + [DataRow(new string[] { "up", "prometheus_http_requests_total", "prometheus_http_request_duration_seconds_count" })] + [DataRow(new string[] { "not_exists_test" })] + public async Task GetNamesAsyncTest(IEnumerable match) + { + var data = new string[] { "up", "prometheus_http_requests_total", "prometheus_http_request_duration_seconds_count" }; + var caller = new Mock(); + caller.Setup(provider => provider.GetAsync?>(MetricService.NAMES_URI, It.Is>(dic => dic == null || dic.ContainsKey("match")), default)) + .ReturnsAsync((string? url, Dictionary param, CancellationToken token) => + { + if (param == null || !param.ContainsKey("match") || param["match"] is null || !param["match"].Contains("not_exists_test")) + return data; + return default; + }).Verifiable(); + var client = new TscClient(caller.Object); + var result = await client.MetricService.GetNamesAsync(match); + + if (match != null && match.Any(s => s == "not_exists_test")) + { + Assert.IsNull(result); + } + else + { + Assert.IsNotNull(result); + Assert.IsTrue(result.Any()); + } + } + + [TestMethod] + [DataRow("up", "2022-07-01T09:00:00.000Z", "2022-07-05T22:00:00.000Z")] + public async Task GetLabelValuesAsyncTest(string match, string start, string end) + { + var caller = new Mock(); + caller.Setup(provider => provider.SendAsync>>>(It.IsNotNull(), default)) + .ReturnsAsync(new Dictionary>> { + {"up",new Dictionary>{ + {"name",new List{"name1","name2"} } + } } + }); + var client = new TscClient(caller.Object); + + DateTime startDateTime = DateTime.Parse(start); + DateTime endDateTime = DateTime.Parse(end); + var result = await client.MetricService.GetLabelValuesAsync(new LableValuesRequest + { + Match = match, + Start = startDateTime, + End = endDateTime + }); + + Assert.IsNotNull(result); + Assert.IsTrue(result.Any()); + } + + [TestMethod] + [DataRow("up", null, "2022-07-01T09:00:00.000Z", "2022-07-05T22:00:00.000Z")] + public async Task GetValuesAsyncTest(string match, IEnumerable labels, string start, string end) + { + var caller = new Mock(); + caller.Setup(provider => provider.SendAsync(It.IsNotNull(), default)).ReturnsAsync("1.0"); + var client = new TscClient(caller.Object); + + DateTime startDateTime = DateTime.Parse(start); + DateTime endDateTime = DateTime.Parse(end); + var result = await client.MetricService.GetValuesAsync(new ValuesRequest + { + Match = match, + Lables = labels, + End = endDateTime, + Start = startDateTime + }); + Assert.IsNotNull(result); + } +} diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs new file mode 100644 index 000000000..fc66f44d2 --- /dev/null +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.StackSdks.Tsc.Enums; +global using Masa.BuildingBlocks.StackSdks.Tsc.Model; +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.Contrib.Service.Caller; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Net.Http; +global using System.Text.Json; +global using System.Text.Json.Serialization; +global using System.Threading; +global using System.Threading.Tasks; diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs new file mode 100644 index 000000000..aab4cb5c5 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BaseClient.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; + +public abstract class BaseClient +{ + protected readonly ICredentialProvider CredentialProvider; + protected IAliyunStorageOptionProvider OptionProvider { get; } + protected AliyunStorageOptions Options => OptionProvider.GetOptions(); + + public BaseClient(ICredentialProvider credentialProvider, + IAliyunStorageOptionProvider optionProvider) + { + CredentialProvider = credentialProvider; + OptionProvider = optionProvider; + } + + public virtual IOss GetClient() + { + var credential = GetCredential(); + return new OssClient(Options.Endpoint, credential.AccessKeyId, credential.AccessKeySecret, credential.SecurityToken); + } + + public virtual (string AccessKeyId, string AccessKeySecret, string? SecurityToken) GetCredential() + { + if (OptionProvider.IncompleteStsOptions) + return new(Options.AccessKeyId, Options.AccessKeySecret, null); + + var securityToken = CredentialProvider.GetSecurityToken(); + return new(securityToken.AccessKeyId, securityToken.AccessKeySecret, securityToken.SessionToken); + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs new file mode 100644 index 000000000..262861402 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/BucketNameProvider.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; + +public class BucketNameProvider : IBucketNameProvider +{ + private readonly IOptionsMonitor _storageOptions; + + public BucketNameProvider(IOptionsMonitor storageOptions) + => _storageOptions = storageOptions; + + public string GetBucketName() + => _storageOptions.CurrentValue.BucketNames.DefaultBucketName; + + public string GetBucketName() where TContainer : class + => _storageOptions.CurrentValue.BucketNames.GetBucketName(BucketNameAttribute.GetName()); +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs new file mode 100644 index 000000000..b0e386ca9 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultCredentialProvider.cs @@ -0,0 +1,92 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; + +public class DefaultCredentialProvider : ICredentialProvider +{ + private readonly IOssClientFactory _ossClientFactory; + private readonly IAliyunStorageOptionProvider _optionProvider; + private readonly IMemoryCache _cache; + protected readonly ILogger? _logger; + + private AliyunStorageOptions Options => _optionProvider.GetOptions(); + + public DefaultCredentialProvider( + IOssClientFactory ossClientFactory, + IAliyunStorageOptionProvider optionProvider, + IMemoryCache cache, + ILogger? logger = null) + { + _ossClientFactory = ossClientFactory; + _optionProvider = optionProvider; + _cache = cache; + _logger = logger; + } + + /// + /// Obtain temporary authorization credentials through STS service + /// + /// + public virtual TemporaryCredentialsResponse GetSecurityToken() + { + if (!_cache.TryGetValue(Options.TemporaryCredentialsCacheKey, out TemporaryCredentialsResponse? temporaryCredentials)) + { + temporaryCredentials = GetTemporaryCredentials( + Options.Sts.RegionId!, + Options.AccessKeyId, + Options.AccessKeySecret, + Options.RoleArn, + Options.RoleSessionName, + Options.Policy, + Options.Sts.GetDurationSeconds()); + SetTemporaryCredentials(temporaryCredentials); + } + return temporaryCredentials!; + } + + public virtual TemporaryCredentialsResponse GetTemporaryCredentials( + string regionId, + string accessKeyId, + string accessKeySecret, + string roleArn, + string roleSessionName, + string policy, + long durationSeconds) + { + IAcsClient client = _ossClientFactory.GetAcsClient(accessKeyId, accessKeySecret, regionId); + var request = new AssumeRoleRequest + { + ContentType = AliyunFormatType.JSON, + RoleArn = roleArn, + RoleSessionName = roleSessionName, + DurationSeconds = durationSeconds + }; + if (!string.IsNullOrEmpty(policy)) + request.Policy = policy; + var response = client.GetAcsResponse(request); + // if (response.HttpResponse.isSuccess()) //todo: Get Sts response information is null, waiting for repair: https://github.com/aliyun/aliyun-openapi-net-sdk/pull/401 + // { + return new TemporaryCredentialsResponse( + response.Credentials.AccessKeyId, + response.Credentials.AccessKeySecret, + response.Credentials.SecurityToken, + DateTime.Parse(response.Credentials.Expiration)); + // } + + // string responseContent = Encoding.Default.GetString(response.HttpResponse.Content); + // string message = + // $"Aliyun.Client: Failed to obtain temporary credentials, RequestId: {response.RequestId}, Status: {response.HttpResponse.Status}, Message: {responseContent}"; + // _logger?.LogWarning( + // "Aliyun.Client: Failed to obtain temporary credentials, RequestId: {RequestId}, Status: {Status}, Message: {Message}", + // response.RequestId, response.HttpResponse.Status, responseContent); + // + // throw new Exception(message); + } + + public virtual void SetTemporaryCredentials(TemporaryCredentialsResponse credentials) + { + var timespan = (DateTime.UtcNow - credentials.Expiration!.Value).TotalSeconds - Options.Sts.GetEarlyExpires(); + if (timespan >= 0) _cache.Set(Options.TemporaryCredentialsCacheKey, credentials, TimeSpan.FromSeconds(timespan)); + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs new file mode 100644 index 000000000..fdcbb2036 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultOssClientFactory.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; + +public class DefaultOssClientFactory : IOssClientFactory +{ + public IOss GetClient(string accessKeyId, string accessKeySecret, string? securityToken, string endpoint) + => new OssClient(endpoint, accessKeyId, accessKeySecret, securityToken); + + public IAcsClient GetAcsClient(string accessKeyId, string accessKeySecret, string regionId) + { + IClientProfile profile = DefaultProfile.GetProfile(regionId, accessKeyId, accessKeySecret); + return new DefaultAcsClient(profile); + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs new file mode 100644 index 000000000..00dc3b101 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/DefaultStorageClient.cs @@ -0,0 +1,135 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; + +public class DefaultStorageClient : BaseClient, IClient +{ + private readonly ILogger? _logger; + + public DefaultStorageClient(ICredentialProvider credentialProvider, + IAliyunStorageOptionProvider optionProvider, + ILogger? logger = null) + : base(credentialProvider, optionProvider) => _logger = logger; + + /// + /// Obtain temporary authorization credentials through STS service + /// + /// + public TemporaryCredentialsResponse GetSecurityToken() + { + if (OptionProvider.IncompleteStsOptions) + throw new ArgumentException( + $"Sts options is imcomplete, {nameof(AliyunStsOptions.RegionId)} or {nameof(Options.RoleArn)} or {nameof(Options.RoleSessionName)} cannot be empty or null"); + + return CredentialProvider.GetSecurityToken(); + } + + /// + /// Obtain temporary request token through authorization service + /// Alibaba Cloud Oss does not support obtaining a temporary authorization token + /// + /// + public string GetToken() => throw new NotSupportedException("GetToken is not supported, please use GetSecurityToken"); + + public Task GetObjectAsync( + string bucketName, + string objectName, + Action callback, + CancellationToken cancellationToken = default) + { + var client = GetClient(); + var result = client.GetObject(bucketName, objectName); + callback.Invoke(result.Content); + return Task.CompletedTask; + } + + public Task GetObjectAsync( + string bucketName, + string objectName, + long offset, + long length, + Action callback, + CancellationToken cancellationToken = default) + { + if (length < 0 && length != -1) + throw new ArgumentOutOfRangeException(nameof(length), $"{length} should be greater than 0 or -1"); + + var client = GetClient(); + var request = new GetObjectRequest(bucketName, objectName); + request.SetRange(offset, length > 0 ? offset + length : length); + var result = client.GetObject(request); + callback.Invoke(result.Content); + return Task.CompletedTask; + } + + public Task PutObjectAsync( + string bucketName, + string objectName, + Stream data, + CancellationToken cancellationToken = default) + { + var client = GetClient(); + var objectMetadata = OptionProvider.SupportCallback ? BuildCallbackMetadata(Options.CallbackUrl, Options.CallbackBody) : null; + var result = !Options.EnableResumableUpload || Options.BigObjectContentLength > data.Length ? + client.PutObject(bucketName, objectName, data, objectMetadata) : + client.ResumableUploadObject(new UploadObjectRequest(bucketName, objectName, data) + { + PartSize = Options.PartSize, + Metadata = objectMetadata + }); + _logger?.LogDebug("----- Upload {ObjectName} from {BucketName} - ({Result})", + objectName, + bucketName, + new UploadObjectResponse(result)); + return Task.CompletedTask; + } + + protected virtual ObjectMetadata BuildCallbackMetadata(string callbackUrl, string callbackBody) + { + string callbackHeaderBuilder = new CallbackHeaderBuilder(callbackUrl, callbackBody).Build(); + var metadata = new ObjectMetadata(); + metadata.AddHeader(HttpHeaders.Callback, callbackHeaderBuilder); + return metadata; + } + + public Task ObjectExistsAsync( + string bucketName, + string objectName, + CancellationToken cancellationToken = default) + { + var client = GetClient(); + var exist = client.DoesObjectExist(bucketName, objectName); + return Task.FromResult(exist); + } + + public async Task DeleteObjectAsync( + string bucketName, + string objectName, + CancellationToken cancellationToken = default) + { + var client = GetClient(); + if (await ObjectExistsAsync(bucketName, objectName, cancellationToken) == false) + return; + + var result = client.DeleteObject(bucketName, objectName); + _logger?.LogDebug("----- Delete {ObjectName} from {BucketName} - ({Result})", + objectName, + bucketName, + result); + } + + public Task DeleteObjectAsync( + string bucketName, + IEnumerable objectNames, + CancellationToken cancellationToken = default) + { + var client = GetClient(); + var result = client.DeleteObjects(new DeleteObjectsRequest(bucketName, objectNames.ToList(), Options.Quiet)); + _logger?.LogDebug("----- Delete {ObjectNames} from {BucketName} - ({Result})", + objectNames, + bucketName, + result); + return Task.CompletedTask; + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs new file mode 100644 index 000000000..34dfb9c7c --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IAliyunStorageOptionProvider.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; + +public interface IAliyunStorageOptionProvider +{ + bool SupportCallback { get; } + + bool IncompleteStsOptions { get; } + + AliyunStorageOptions GetOptions(); +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs new file mode 100644 index 000000000..55f292b62 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ICredentialProvider.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; + +/// +/// For internal use, structure may change at any time +/// +public interface ICredentialProvider +{ + TemporaryCredentialsResponse GetSecurityToken(); +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs new file mode 100644 index 000000000..4e6b1dac7 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/IOssClientFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun; + +public interface IOssClientFactory +{ + IOss GetClient(string accessKeyId, string accessKeySecret, string? securityToken, string endpoint); + + IAcsClient GetAcsClient(string accessKeyId, string accessKeySecret, string regionId); +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs new file mode 100644 index 000000000..26f9e138e --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Const.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal; + +internal class Const +{ + public const string TEMPORARY_CREDENTIALS_CACHEKEY = "Aliyun.Storage.TemporaryCredentials"; + + public const string DEFAULT_SECTION = "Aliyun"; + + public const string INTERNAL_ENDPOINT_SUFFIX = "-internal.aliyuncs.com"; + + public const string PUBLIC_ENDPOINT_DOMAIN_SUFFIX = ".aliyuncs.com"; + + public const string ERROR_ENDPOINT_MESSAGE = "Unrecognized endpoint, failed to get RegionId"; + + public const int DEFAULT_DURATION_SECONDS = 3600; + + public const int DEFAULT_EARLY_EXPIRES = 10; +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs new file mode 100644 index 000000000..f57f8fe5b --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/DefaultAliyunStorageOptionProvider.cs @@ -0,0 +1,70 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal; + +internal class DefaultAliyunStorageOptionProvider : IAliyunStorageOptionProvider +{ + private AliyunStorageOptions _aliyunStorageOptions; + + public bool SupportCallback { get; private set; } + + public bool IncompleteStsOptions { get; private set; } + + public DefaultAliyunStorageOptionProvider(AliyunStorageOptions aliyunStorageOptions) + { + _aliyunStorageOptions = aliyunStorageOptions; + Refresh(); + } + + public DefaultAliyunStorageOptionProvider(IOptionsMonitor options) + : this(GetAliyunStorageOptions(options.CurrentValue)) + { + options.OnChange(aliyunStorageConfigureOptions => + { + _aliyunStorageOptions = GetAliyunStorageOptions(aliyunStorageConfigureOptions); + Refresh(); + }); + } + + public AliyunStorageOptions GetOptions() => _aliyunStorageOptions; + + private static AliyunStorageOptions GetAliyunStorageOptions(AliyunStorageConfigureOptions options) + { + AliyunStorageOptions aliyunStorageOptions = options.Storage; + aliyunStorageOptions.AccessKeyId = TryUpdate(options.Storage.AccessKeyId, options.AccessKeyId)!; + aliyunStorageOptions.AccessKeySecret = TryUpdate(options.Storage.AccessKeySecret, options.AccessKeySecret)!; + aliyunStorageOptions.Sts.RegionId = TryUpdate(options.Storage.Sts.RegionId, options.Sts.RegionId); + aliyunStorageOptions.Sts.DurationSeconds = TryUpdate(options.Storage.Sts.DurationSeconds, options.Sts.DurationSeconds) ?? + options.Sts.GetDurationSeconds(); + aliyunStorageOptions.Sts.EarlyExpires = + TryUpdate(options.Storage.Sts.EarlyExpires, options.Sts.EarlyExpires) ?? options.Sts.GetEarlyExpires(); + return aliyunStorageOptions; + } + + private static long? TryUpdate(long? source, long? destination) + { + if (source != null) + return source; + + return destination; + } + + private static string? TryUpdate(string? source, string? destination) + { + if (!string.IsNullOrWhiteSpace(source)) + return source; + + return destination; + } + + private void Refresh() + { + SupportCallback = !string.IsNullOrEmpty(_aliyunStorageOptions.CallbackBody) && + !string.IsNullOrEmpty(_aliyunStorageOptions.CallbackUrl); + + IncompleteStsOptions = string.IsNullOrEmpty(_aliyunStorageOptions.Sts.RegionId) || + string.IsNullOrEmpty(_aliyunStorageOptions.RoleArn) || + string.IsNullOrEmpty(_aliyunStorageOptions.RoleSessionName); + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs new file mode 100644 index 000000000..3c2e261f4 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/ObjectStorageExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal; + +internal class ObjectStorageExtensions +{ + internal static string CheckNullOrEmptyAndReturnValue(string? parameter, string parameterName) + { + if (string.IsNullOrEmpty(parameter)) + throw new ArgumentException($"{parameterName} cannot be null and empty string"); + + return parameter; + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs new file mode 100644 index 000000000..2874a5e71 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Internal/Response/UploadObjectResponse.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal.Response; + +internal class UploadObjectResponse +{ + public string ETag { get; set; } + + public string VersionId { get; set; } + + public string RequestId { get; set; } + + public HttpStatusCode HttpStatusCode { get; set; } + + public long ContentLength { get; set; } + + public string Response { get; set; } + + public IDictionary ResponseMetadata { get; set; } + + public UploadObjectResponse(PutObjectResult result) + { + ETag = result.ETag; + VersionId = result.VersionId; + HttpStatusCode = result.HttpStatusCode; + RequestId = result.RequestId; + ContentLength = result.ContentLength; + Response = GetCallbackResponse(result); + ResponseMetadata = result.ResponseMetadata; + } + + private string GetCallbackResponse(PutObjectResult putObjectResult) + { + using var stream = putObjectResult.ResponseStream; + if (stream == null) + return string.Empty; + + var buffer = new byte[4 * 1024]; + var bytesRead = stream.Read(buffer, 0, buffer.Length); + string callbackResponse = Encoding.Default.GetString(buffer, 0, bytesRead); + return callbackResponse; + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj new file mode 100644 index 000000000..d350e16f9 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Masa.Contrib.Storage.ObjectStorage.Aliyun.csproj @@ -0,0 +1,28 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs new file mode 100644 index 000000000..bccda4777 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; + +public class AliyunOptions +{ + public string AccessKeyId { get; set; } + + public string AccessKeySecret { get; set; } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs new file mode 100644 index 000000000..5a0893230 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageConfigureOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; + +public class AliyunStorageConfigureOptions : AliyunOptions +{ + public AliyunStorageOptions Storage { get; set; } = new(); + + public AliyunStsOptions Sts { get; set; } = new(); +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs new file mode 100644 index 000000000..ea920f0b8 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStorageOptions.cs @@ -0,0 +1,138 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; + +public class AliyunStorageOptions : AliyunOptions +{ + public AliyunStsOptions Sts { get; set; } = new(); + + private string _endpoint; + + public string Endpoint + { + get => _endpoint; + set => _endpoint = value?.Trim() ?? string.Empty; + } + + private string _temporaryCredentialsCacheKey = Const.TEMPORARY_CREDENTIALS_CACHEKEY; + + public string TemporaryCredentialsCacheKey + { + get => _temporaryCredentialsCacheKey; + set => _temporaryCredentialsCacheKey = + ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(value, nameof(TemporaryCredentialsCacheKey)); + } + + /// + /// If policy is empty, the user will get all permissions under this role + /// + public string Policy { get; set; } + + public string RoleArn { get; set; } + + public string RoleSessionName { get; set; } + + /// + /// The server address of the callback request + /// + public string CallbackUrl { get; set; } + + /// + /// The value of the request body when the callback is initiated + /// + public string CallbackBody { get; set; } + + /// + /// Large files enable resume after power failure + /// default: true + /// + public bool EnableResumableUpload { get; set; } + + /// + /// large file length + /// unit: Byte + /// default: 5GB + /// + public long BigObjectContentLength { get; set; } + + /// + /// Gets or sets the size of the part. + /// + /// The size of the part. + public long? PartSize { get; set; } + + /// + /// true: quiet mode; false: detail mode + /// default: true + /// + public bool Quiet { get; set; } + + public AliyunStorageOptions() + { + Quiet = true; + CallbackUrl = string.Empty; + CallbackBody = "bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}"; + EnableResumableUpload = true; + PartSize = null; + BigObjectContentLength = 5 * (long)Math.Pow(1024, 3); + } + + public AliyunStorageOptions(string accessKeyId, string accessKeySecret) : this() + { + AccessKeyId = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(accessKeyId, nameof(accessKeyId)); + AccessKeySecret = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(accessKeySecret, nameof(accessKeySecret)); + } + + public AliyunStorageOptions(string accessKeyId, string accessKeySecret, string endpoint) + : this(accessKeyId, accessKeySecret) + { + Endpoint = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(endpoint, nameof(endpoint)); + } + + public AliyunStorageOptions( + string accessKeyId, + string accessKeySecret, + string endpoint, + string roleArn, + string roleSessionName) + : this(accessKeyId, accessKeySecret, endpoint, roleArn, roleSessionName, null) + { + } + + public AliyunStorageOptions( + string accessKeyId, + string accessKeySecret, + string endpoint, + AliyunStsOptions? stsOptions) + : this(accessKeyId, accessKeySecret) + { + Sts = stsOptions ?? new(); + Endpoint = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(endpoint, nameof(endpoint)); + } + + public AliyunStorageOptions( + string accessKeyId, + string accessKeySecret, + string endpoint, + string roleArn, + string roleSessionName, + AliyunStsOptions? stsOptions) + : this(accessKeyId, accessKeySecret, endpoint, stsOptions) + { + RoleArn = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(roleArn, nameof(roleArn)); + RoleSessionName = ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(roleSessionName, nameof(roleSessionName)); + } + + public AliyunStorageOptions SetPolicy(string policy) + { + Policy = policy; + return this; + } + + public AliyunStorageOptions SetTemporaryCredentialsCacheKey(string temporaryCredentialsCacheKey) + { + TemporaryCredentialsCacheKey = temporaryCredentialsCacheKey; + return this; + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs new file mode 100644 index 000000000..3cdff636e --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/Options/AliyunStsOptions.cs @@ -0,0 +1,62 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; + +public class AliyunStsOptions +{ + /// + /// sts region id + /// If the RegionId is missing, the temporary Sts credential cannot be obtained. + /// https://help.aliyun.com/document_detail/371859.html + /// https://www.alibabacloud.com/help/en/resource-access-management/latest/endpoints#reference-sdg-3pv-xdb + /// + public string? RegionId { get; set; } + + private long? _durationSeconds = null; + + /// + /// Set the validity period of the temporary access credential, the minimum is 900, and the maximum is 43200. + /// default: 3600 + /// unit: second + /// + public long? DurationSeconds + { + get => _durationSeconds; + set + { + if (value < 900 || value > 43200) + throw new ArgumentOutOfRangeException(nameof(DurationSeconds), $"{nameof(DurationSeconds)} must be in range of 900-43200"); + + _durationSeconds = value; + } + } + + private long? _earlyExpires = null; + + /// + /// Voucher expires early + /// default: 10 + /// unit: second + /// + public long? EarlyExpires + { + get => _earlyExpires; + set + { + if (value < 0) + throw new ArgumentOutOfRangeException(nameof(EarlyExpires), $"{nameof(EarlyExpires)} must be Greater than 0"); + + _earlyExpires = value; + } + } + + public AliyunStsOptions(string? regionId = null) + { + RegionId = regionId; + } + + public long GetDurationSeconds() => DurationSeconds ?? Const.DEFAULT_DURATION_SECONDS; + + public long GetEarlyExpires() => EarlyExpires ?? Const.DEFAULT_EARLY_EXPIRES; +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md new file mode 100644 index 000000000..2e5998dbd --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md @@ -0,0 +1,147 @@ +[中](README.zh-CN.md) | EN + +## Masa.Contrib.Storage.ObjectStorage.Aliyun + +Example: + +````C# +Install-Package Masa.Contrib.Storage.ObjectStorage.Aliyun +```` + +support: +* GetSecurityToken: Gets the security token(Sts RegionId and RoleArn and RoleSessionName are required) +* GetObjectAsync: Gets the stream of object data +* PutObjectAsync: Upload objects via Stream +* ObjectExistsAsync: Determine whether the object exists +* DeleteObjectAsync: Delete object + +### Usage 1: + +1. Configure appsettings.json +```` C# +{ + "Aliyun": { + "AccessKeyId": "Replace-With-Your-AccessKeyId", + "AccessKeySecret": "Replace-With-Your-AccessKeySecret", + "Sts": :{ + "RegionId": "Replace-With-Your-RegionId",//https://www.alibabacloud.com/help/en/resource-access-management/latest/endpoints#reference-sdg-3pv-xdb + "DurationSeconds": 3600,//Temporary certificate validity period, default: 3600s + "EarlyExpires": 10//default: 10s + }, + "Storage": { + "Endpoint": "Replace-With-Your-Endpoint",//https://www.alibabacloud.com/help/en/object-storage-service/latest/regions-and-endpoints#section-plb-2vy-5db + "RoleArn": "Replace-With-Your-RoleArn", + "RoleSessionName": "Replace-With-Your-RoleSessionName", + "TemporaryCredentialsCacheKey": "Aliyun.Storage.TemporaryCredentials",//optional, default: Aliyun.Storage.TemporaryCredentials + "Policy": "",//optional + "BucketNames" : { + "DefaultBucketName" : "" + } + } + } +} +```` + +2. Add Aliyun Storage Service + +````C# +builder.Services.AddAliyunStorage(); +```` + +3. Get `IClient` from DI + + ```` C# + //upload files + var fileStream = File.OpenRead("D://favicon.png");//Replace the local file path + await serviceProvider.GetService().PutObjectAsync("storage1-test", "1.png", fileStream); + ```` + +### Usage 2: + +1. Add Aliyun Storage Service + +````C# +var configuration = builder.Configuration; +var aliyunStorageOptions = new AliyunStorageOptions( + configuration["Aliyun:AccessKeyId"], + configuration["Aliyun:AccessKeySecret"], + configuration["Aliyun:Endpoint"], + configuration["Aliyun:RoleArn"], + configuration["Aliyun:RoleSessionName"]) +{ + Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]); +}; +builder.Services.AddAliyunStorage(aliyunStorageOptions); +```` + +2. Get `IClient` from DI and use the corresponding method + +### Usage 3: + +1. Add Aliyun Storage Service + +````C# +var configuration = builder.Configuration; +builder.Services.AddAliyunStorage(() => +{ + return new AliyunStorageOptions( + configuration["Aliyun:AccessKeyId"], + configuration["Aliyun:AccessKeySecret"], + configuration["Aliyun:Endpoint"], + configuration["Aliyun:RoleArn"], + configuration["Aliyun:RoleSessionName"]) + { + Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]) + }; +}); +```` + +2. Get `IClient` from DI and use the corresponding method + +> The difference from usage 2 is to defer getting the configuration + +### Usage 4: + +1. Add Aliyun Storage Service + + 1.1. Sync + + ``` C# + builder.Services.AddAliyunStorage((serviceProvider) => + { + var configuration = serviceProvider.GetRequiredService(); + return new AliyunStorageOptions( + configuration["Aliyun:AccessKeyId"], + configuration["Aliyun:AccessKeySecret"], + configuration["Aliyun:Endpoint"], + configuration["Aliyun:RoleArn"], + configuration["Aliyun:RoleSessionName"]) + { + Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]) + }; + }); + ``` + + 1.2. Async + + ``` C# + builder.Services.AddAliyunStorage(async serviceProvider => + { + var daprClient = serviceProvider.GetRequiredService(); + var accessId = (await daprClient.GetSecretAsync("localsecretstore", "access_id")).First().Value; + var accessSecret = (await daprClient.GetSecretAsync("localsecretstore", "access_secret")).First().Value; + var endpoint = (await daprClient.GetSecretAsync("localsecretstore", "endpoint")).First().Value; + var roleArn = (await daprClient.GetSecretAsync("localsecretstore", "roleArn")).First().Value; + return new AliyunStorageOptions(accessId, accessSecret, endpoint, roleArn, "SessionTest") { + Sts = new AliyunStsOptions() { + RegionId = "cn-hangzhou" + } + }; + }); + ``` + +2. Get `IClient` from DI and use the corresponding method + +> The difference from usage 3 is that the service required for configuration can be obtained through serviceProvider, and finally the configuration object is returned + +> If you do not need to use temporary credentials, you can not configure the parameters of Sts and RoleArn and RoleSessionName. \ No newline at end of file diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md new file mode 100644 index 000000000..bb5c4079d --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.zh-CN.md @@ -0,0 +1,149 @@ +中 | [EN](README.md) + +## Masa.Contrib.Storage.ObjectStorage.Aliyun + +用例: + +```C# +Install-Package Masa.Contrib.Storage.ObjectStorage.Aliyun +``` + +支持: + +* GetSecurityToken: 获取安全令牌 (Sts RegionId、RoleArn、RoleSessionName是必须的) +* GetObjectAsync: 获取对象数据的流 +* PutObjectAsync: 通过Stream上传对象 +* ObjectExistsAsync: 判断对象是否存在 +* DeleteObjectAsync: 删除对象 + +### 用法1: + +1. 配置appsettings.json + +``` C# +{ + "Aliyun": { + "AccessKeyId": "Replace-With-Your-AccessKeyId", + "AccessKeySecret": "Replace-With-Your-AccessKeySecret", + "Sts": :{ + "RegionId":"Replace-With-Your-Sts-RegionId",//https://help.aliyun.com/document_detail/371859.html + "DurationSeconds":3600,//临时证书有效期, default: 3600秒 + "EarlyExpires":10//default: 10秒 + }, + "Storage": { + "Endpoint": "Replace-With-Your-Endpoint",//https://help.aliyun.com/document_detail/31837.html + "RoleArn": "Replace-With-Your-RoleArn", + "RoleSessionName": "Replace-With-Your-RoleSessionName", + "TemporaryCredentialsCacheKey": "Aliyun.Storage.TemporaryCredentials",//选填、默认: Aliyun.Storage.TemporaryCredentials + "Policy": "",//选填 + "BucketNames" : { + "DefaultBucketName" : "" + } + } + } +} +``` + +2. 添加阿里云存储服务 + +```C# +builder.Services.AddAliyunStorage(); +``` + +3. 从DI获取`IClient` + + ``` C# + //上传文件 + var fileStream = File.OpenRead("D://favicon.png");//更换本地文件路径 + await serviceProvider.GetService().PutObjectAsync("storage1-test", "1.png", fileStream); + ``` + +### 用法2: + +1. 添加阿里云存储服务 + +```C# +var configuration = builder.Configuration; +var aliyunStorageOptions = new AliyunStorageOptions( + configuration["Aliyun:AccessKeyId"], + configuration["Aliyun:AccessKeySecret"], + configuration["Aliyun:Endpoint"], + configuration["Aliyun:RoleArn"], + configuration["Aliyun:RoleSessionName"]) +{ + Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]); +}; +builder.Services.AddAliyunStorage(aliyunStorageOptions); +``` + +2. 从DI获取`IClient`,并使用相应的方法 + +### 用法3: + +1. 添加阿里云存储服务 + +```C# +var configuration = builder.Configuration; +builder.Services.AddAliyunStorage(() => +{ + return new AliyunStorageOptions( + configuration["Aliyun:AccessKeyId"], + configuration["Aliyun:AccessKeySecret"], + configuration["Aliyun:Endpoint"], + configuration["Aliyun:RoleArn"], + configuration["Aliyun:RoleSessionName"]) + { + Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]) + }; +}); +``` + +2. 从DI获取`IClient`,并使用相应的方法 + +> 与用法2的区别在于延缓获取配置 + +### 用法4: + +1. 添加阿里云存储服务 + + 1.1. 同步 + + ``` C# + builder.Services.AddAliyunStorage((serviceProvider) => + { + var configuration = serviceProvider.GetRequiredService(); + return new AliyunStorageOptions( + configuration["Aliyun:AccessKeyId"], + configuration["Aliyun:AccessKeySecret"], + configuration["Aliyun:Endpoint"], + configuration["Aliyun:RoleArn"], + configuration["Aliyun:RoleSessionName"]) + { + Sts = new AliyunStsOptions(configuration["Aliyun:RegionId"]) + }; + }); + ``` + + 1.2. 异步 + + ``` C# + builder.Services.AddAliyunStorage(async serviceProvider => + { + var daprClient = serviceProvider.GetRequiredService(); + var accessId = (await daprClient.GetSecretAsync("localsecretstore", "access_id")).First().Value; + var accessSecret = (await daprClient.GetSecretAsync("localsecretstore", "access_secret")).First().Value; + var endpoint = (await daprClient.GetSecretAsync("localsecretstore", "endpoint")).First().Value; + var roleArn = (await daprClient.GetSecretAsync("localsecretstore", "roleArn")).First().Value; + return new AliyunStorageOptions(accessId, accessSecret, endpoint, roleArn, "SessionTest") { + Sts = new AliyunStsOptions() { + RegionId = "cn-hangzhou" + } + }; + }); + ``` + +2. 从DI获取`IClient`,并使用相应的方法 + +> 与用法3的区别在于可以通过serviceProvider获取配置所需要的服务,最后返回配置对象 + +> 如果不需要使用临时凭证,可不配置Sts、RoleArn、RoleSessionName参数 \ No newline at end of file diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..7a7ae5f87 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/ServiceCollectionExtensions.cs @@ -0,0 +1,146 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + /// + /// Add Alibaba Cloud Storage + /// Load configuration information according to the specified SectionName node + /// + /// + /// node name, defaults to Aliyun + /// + /// + public static IServiceCollection AddAliyunStorage( + this IServiceCollection services, + string sectionName = Const.DEFAULT_SECTION) + { + if (string.IsNullOrEmpty(sectionName)) + throw new ArgumentException(sectionName, nameof(sectionName)); + + services.TryAddConfigure($"{sectionName}{ConfigurationPath.KeyDelimiter}{nameof(AliyunStorageConfigureOptions.Storage)}"); + services.TryAddConfigure(sectionName); + services.TryAddSingleton(serviceProvider + => new DefaultAliyunStorageOptionProvider(GetAliyunStorageConfigurationOption(serviceProvider))); + services.TryAddSingleton(serviceProvider + => new DefaultClientContainer(serviceProvider.GetRequiredService(), + serviceProvider.GetRequiredService().GetBucketName())); + return services.AddAliyunStorageCore(); + } + + public static IServiceCollection AddAliyunStorage( + this IServiceCollection services, + AliyunStorageOptions options, + string? defaultBucketName = null) + { + ArgumentNullException.ThrowIfNull(options, nameof(options)); + CheckAliYunStorageOptions(options); + + return services.AddAliyunStorage(() => options, defaultBucketName); + } + + public static IServiceCollection AddAliyunStorage( + this IServiceCollection services, + Func func, + string? defaultBucketName = null) + { + ArgumentNullException.ThrowIfNull(func, nameof(func)); + + services.TryAddSingleton(serviceProvider + => new DefaultAliyunStorageOptionProvider(func.Invoke(serviceProvider))); + return services.AddAliyunStorageCore(defaultBucketName); + } + + public static IServiceCollection AddAliyunStorage( + this IServiceCollection services, + Func> func, + string? defaultBucketName = null) + { + ArgumentNullException.ThrowIfNull(func, nameof(func)); + + services.TryAddSingleton(serviceProvider + => new DefaultAliyunStorageOptionProvider(func.Invoke(serviceProvider).ConfigureAwait(false).GetAwaiter().GetResult())); + return services.AddAliyunStorageCore(defaultBucketName); + } + + public static IServiceCollection AddAliyunStorage( + this IServiceCollection services, + Func func, + string? defaultBucketName = null) + { + ArgumentNullException.ThrowIfNull(func, nameof(func)); + + return services.AddAliyunStorage(_ => func.Invoke(), defaultBucketName); + } + + private static IServiceCollection AddAliyunStorageCore(this IServiceCollection services, string? defaultBucketName = null) + { + services.AddMemoryCache(); + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + if (defaultBucketName != null) + { + services.Configure(option => + { + option.BucketNames = new BucketNames(new List>() + { + new(BucketNames.DEFAULT_BUCKET_NAME, defaultBucketName) + }); + }); + services.TryAddSingleton(serviceProvider + => new DefaultClientContainer(serviceProvider.GetRequiredService(), defaultBucketName)); + } + + + services.TryAddSingleton(); + services.TryAddSingleton(typeof(IClientContainer<>), typeof(DefaultClientContainer<>)); + services.TryAddSingleton(); + return services; + } + + private static IServiceCollection TryAddConfigure( + this IServiceCollection services, + string sectionName) + where TOptions : class + { + var serviceProvider = services.BuildServiceProvider(); + IConfiguration? configuration = serviceProvider.GetService()?.Local ?? + serviceProvider.GetService(); + + if (configuration == null) + return services; + + string name = Microsoft.Extensions.Options.Options.DefaultName; + services.AddOptions(); + var configurationSection = configuration.GetSection(sectionName); + services.TryAddSingleton>( + new ConfigurationChangeTokenSource(name, configurationSection)); + services.TryAddSingleton>(new NamedConfigureFromConfigurationOptions(name, + configurationSection, _ => + { + })); + return services; + } + + private static IOptionsMonitor GetAliyunStorageConfigurationOption(IServiceProvider serviceProvider) + => serviceProvider.GetRequiredService>(); + + private static IAliyunStorageOptionProvider GetAliyunStorageOptionProvider(IServiceProvider serviceProvider) + => serviceProvider.GetRequiredService(); + + + private static void CheckAliYunStorageOptions(AliyunStorageOptions options) + { + ArgumentNullException.ThrowIfNull(options, nameof(options)); + + if (options.AccessKeyId == null && options.AccessKeySecret == null) + throw new ArgumentException( + $"{nameof(options.AccessKeyId)}, {nameof(options.AccessKeySecret)} are required and cannot be empty"); + + ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(options.AccessKeyId, nameof(options.AccessKeyId)); + ObjectStorageExtensions.CheckNullOrEmptyAndReturnValue(options.AccessKeySecret, nameof(options.AccessKeySecret)); + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs new file mode 100644 index 000000000..d66c10c4d --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Masa.Contrib.Storage.ObjectStorage.Aliyun/_Imports.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Aliyun.Acs.Core; +global using Aliyun.Acs.Core.Auth.Sts; +global using Aliyun.Acs.Core.Profile; +global using Aliyun.OSS; +global using Aliyun.OSS.Util; +global using Masa.BuildingBlocks.Configuration; +global using Masa.BuildingBlocks.Storage.ObjectStorage; +global using Masa.BuildingBlocks.Storage.ObjectStorage.Response; +global using Masa.Contrib.Storage.ObjectStorage.Aliyun; +global using Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal; +global using Masa.Contrib.Storage.ObjectStorage.Aliyun.Internal.Response; +global using Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; +global using Microsoft.Extensions.Caching.Memory; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using System.Net; +global using System.Text; +global using AliyunFormatType = Aliyun.Acs.Core.Http.FormatType; diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs new file mode 100644 index 000000000..a004463bf --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/BaseTest.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; + +[TestClass] +public class BaseTest +{ + protected AliyunStorageOptions _aLiYunStorageOptions; + protected const string HANG_ZHOUE_PUBLIC_ENDPOINT = "oss-cn-hangzhou.aliyuncs.com"; + + public BaseTest() + { + _aLiYunStorageOptions = new AliyunStorageOptions( + "AccessKeyId", + "AccessKeySecret", + HANG_ZHOUE_PUBLIC_ENDPOINT, + "RoleArn", + "RoleSessionName"); + } + + protected Mock MockOptionProvider(bool? incompleteStsOptions = null) + { + Mock optionProvider = new(); + if (incompleteStsOptions != null) + optionProvider.Setup(provider => provider.IncompleteStsOptions).Returns(incompleteStsOptions.Value); + optionProvider.Setup(provider => provider.GetOptions()).Returns(_aLiYunStorageOptions); + return optionProvider; + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs new file mode 100644 index 000000000..a3990698d --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomCredentialProvider.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; + +public class CustomCredentialProvider : DefaultCredentialProvider +{ + public readonly TemporaryCredentialsResponse TemporaryCredentials = new( + "accessKeyId", + "secretAccessKey", + "sessionToken", + DateTime.UtcNow.AddHours(-1)); + + public CustomCredentialProvider(IOssClientFactory ossClientFactory, + IAliyunStorageOptionProvider optionProvider, + IMemoryCache cache, + ILogger? logger) + : base(ossClientFactory, optionProvider, cache, logger) + { + } + + public override TemporaryCredentialsResponse GetTemporaryCredentials( + string regionId, + string accessKeyId, + string accessKeySecret, + string roleArn, + string roleSessionName, + string policy, + long durationSeconds) => TemporaryCredentials; + + public TemporaryCredentialsResponse TestGetTemporaryCredentials(string regionId, + string accessKeyId, + string accessKeySecret, + string roleArn, + string roleSessionName, + string policy, + long durationSeconds) + => base.GetTemporaryCredentials(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName, policy, durationSeconds); + + public void TestExpirationTimeLessThan10Second(int durationSeconds) + { + var expirationTime = DateTime.UtcNow.AddSeconds(-durationSeconds); + base.SetTemporaryCredentials(new TemporaryCredentialsResponse("accessKeyId", "secretAccessKey", "sessionToken", expirationTime)); + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs new file mode 100644 index 000000000..9d7b59734 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomNullClient.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; + +public class CustomNullClient : DefaultCredentialProvider +{ + public string Message = "You are not authorized to do this action. You should be authorized by RAM."; + + public override TemporaryCredentialsResponse GetTemporaryCredentials( + string regionId, + string accessKeyId, + string accessKeySecret, + string roleArn, + string roleSessionName, + string policy, + long durationSeconds) => throw new Exception(Message); + + + public CustomNullClient(IOssClientFactory ossClientFactory, + IAliyunStorageOptionProvider optionProvider, + IMemoryCache cache, + ILogger? logger = null) + : base(ossClientFactory, optionProvider, cache, logger) + { + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs new file mode 100644 index 000000000..d4ec8a68c --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/CustomizeClient.cs @@ -0,0 +1,76 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; + +public class CustomClient : DefaultStorageClient +{ + public Mock? Oss; + + public CustomClient(ICredentialProvider credentialProvider, + IAliyunStorageOptionProvider optionProvider, + ILogger? logger) + : base(credentialProvider, optionProvider, logger) + { + } + + public override IOss GetClient() + { + if (Oss != null) + return Oss.Object; + + Oss = new(); + Oss.Setup(c => c.GetObject(It.IsAny(), It.IsAny())).Returns(GetOssObject()).Verifiable(); + Oss.Setup(c => c.GetObject(It.IsAny())).Returns(GetOssObject()).Verifiable(); + Oss.Setup(c => c.PutObject(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) + .Returns(GetPutObjectResult()).Verifiable(); + Oss.Setup(c => c.ResumableUploadObject(It.IsAny())).Returns(GetPutObjectResult()).Verifiable(); + Oss.Setup(c => c.DoesObjectExist(It.IsAny(), "1.jpg")).Returns(false).Verifiable(); + Oss.Setup(c => c.DoesObjectExist(It.IsAny(), "2.jpg")).Returns(true).Verifiable(); + Oss.Setup(c => c.DeleteObject(It.IsAny(), "1.jpg")).Returns(GetDeleteFail()).Verifiable(); + Oss.Setup(c => c.DeleteObject(It.IsAny(), "2.jpg")).Returns(GetDeleteSuccess()).Verifiable(); + Oss.Setup(c => c.DeleteObjects(It.IsAny())).Returns(GetDeleteObjectsResult()).Verifiable(); + return Oss.Object; + } + + private OssObject GetOssObject() + { + string objectName = string.Empty; + var constructor = typeof(OssObject).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, new[] { typeof(string) })!; + OssObject ossObject = (constructor.Invoke(new object[] { objectName }) as OssObject)!; + ossObject.ResponseStream = null; + return ossObject; + } + + private PutObjectResult GetPutObjectResult() + { + var constructor = typeof(PutObjectResult).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes)!; + var result = (constructor.Invoke(Array.Empty()) as PutObjectResult)!; + result.ResponseStream = new MemoryStream(Encoding.Default.GetBytes("test")); + return result; + } + + private DeleteObjectResult GetDeleteFail() + { + var constructor = typeof(DeleteObjectResult).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes)!; + var result = (constructor.Invoke(Array.Empty()) as DeleteObjectResult)!; + result.HttpStatusCode = HttpStatusCode.NotFound; + return result; + } + + private DeleteObjectResult GetDeleteSuccess() + { + var constructor = typeof(DeleteObjectResult).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes)!; + var result = (constructor.Invoke(Array.Empty()) as DeleteObjectResult)!; + result.HttpStatusCode = HttpStatusCode.OK; + return result; + } + + private DeleteObjectsResult GetDeleteObjectsResult() + { + var constructor = typeof(DeleteObjectsResult).GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic, Type.EmptyTypes)!; + var result = (constructor.Invoke(Array.Empty()) as DeleteObjectsResult)!; + result.HttpStatusCode = HttpStatusCode.OK; + return result; + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj new file mode 100644 index 000000000..3c3f8aab6 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj @@ -0,0 +1,37 @@ + + + + net6.0 + enable + false + enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + Always + + + + + + + + diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs new file mode 100644 index 000000000..511d0989a --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/StorageContainer.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; + +[BucketName("test-bucket")] +public class StorageContainer +{ + +} diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs new file mode 100644 index 000000000..4861e61f6 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestALiYunStorageOptions.cs @@ -0,0 +1,139 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; + +[TestClass] +public class TestALiYunStorageOptions +{ + private const string HANG_ZHOUE_PUBLIC_ENDPOINT = "oss-cn-hangzhou.aliyuncs.com"; + private const string HANG_ZHOUE_INTERNAL_ENDPOINT = "oss-cn-hangzhou-internal.aliyuncs.com"; + private const string TEMPORARY_CREDENTIALS_CACHEKEY = "Aliyun.Storage.TemporaryCredentials"; + + [DataTestMethod] + [DataRow("", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName", "accessKeyId")] + [DataRow("AccessKeyId", "", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName", "accessKeySecret")] + [DataRow("AccessKeyId", "AccessKeySecret", "", "RoleArn", "RoleSessionName", "regionId")] + [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "", "RoleSessionName", "roleArn")] + [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "", "roleSessionName")] + public void TestErrorParameterThrowArgumentException( + string accessKeyId, + string accessKeySecret, + string regionId, + string roleArn, + string roleSessionName, + string parameterName) + { + Assert.ThrowsException(() => + new AliyunStorageOptions(accessKeyId, accessKeySecret, regionId, roleArn, roleSessionName), + $"{parameterName} cannot be empty"); + } + + [TestMethod] + public void TestDurationSecondsGreaterThan43200ReturnThrowArgumentOutOfRangeException() + { + var aliyunStsOptions = new AliyunStsOptions(); + Assert.ThrowsException(() => + aliyunStsOptions.DurationSeconds = 43201, + "DurationSeconds must be in range of 900-43200"); + } + + [TestMethod] + public void TestDurationSecondsLessThan900ReturnThrowArgumentOutOfRangeException() + { + var aliyunStsOptions = new AliyunStsOptions(); + Assert.ThrowsException(() => + aliyunStsOptions.DurationSeconds = 899, + "DurationSeconds must be in range of 900-43200"); + } + + [DataTestMethod] + [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName")] + [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_INTERNAL_ENDPOINT, "RoleArn", "RoleSessionName")] + public void TestSuccessParameterReturnInitializationSuccessful( + string accessKeyId, + string accessKeySecret, + string endpoint, + string roleArn, + string roleSessionName) + { + var options = new AliyunStorageOptions(accessKeyId, accessKeySecret, endpoint, roleArn, roleSessionName); + Assert.IsTrue(options.AccessKeyId == accessKeyId); + Assert.IsTrue(options.AccessKeySecret == accessKeySecret); + Assert.IsTrue(options.Sts.RegionId == null); + Assert.IsTrue(options.RoleArn == roleArn); + Assert.IsTrue(options.RoleSessionName == roleSessionName); + } + + [DataTestMethod] + [DataRow("", "temporaryCredentialsCacheKey")] + [DataRow(null, "temporaryCredentialsCacheKey")] + public void TestErrorTemporaryCredentialsCacheKeyReturnThrowArgumentException( + string temporaryCredentialsCacheKey, + string temporaryCredentialsCacheKeyName) + { + var options = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName"); + Assert.ThrowsException(() => + options.SetTemporaryCredentialsCacheKey(temporaryCredentialsCacheKey), + $"{temporaryCredentialsCacheKeyName} cannot be empty"); + } + + [DataTestMethod] + [DataRow("Aliyun.TemporaryCredentials")] + public void TestNotNullTemporaryCredentialsCacheKeyReturnSuccess(string temporaryCredentialsCacheKey) + { + var options = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName"); + options.SetTemporaryCredentialsCacheKey(temporaryCredentialsCacheKey); + Assert.IsTrue(options.TemporaryCredentialsCacheKey == temporaryCredentialsCacheKey); + } + + [DataTestMethod] + [DataRow("")] + [DataRow(null)] + [DataRow("Policy")] + public void TestSetPolicyReturnSuccess(string policy) + { + var options = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "RoleArn", "RoleSessionName"); + options.SetPolicy(policy); + Assert.IsTrue(options.Policy == policy); + } + + [DataTestMethod] + [DataRow("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT)] + public void TestNullRoleArnAndSessionNameReturnSessionNameIsNull( + string accessKeyId, + string accessKeySecret, + string endpoint) + { + var options = new AliyunStorageOptions(accessKeyId, accessKeySecret, endpoint); + Assert.IsTrue(options.Endpoint == HANG_ZHOUE_PUBLIC_ENDPOINT); + Assert.IsTrue(options.TemporaryCredentialsCacheKey == TEMPORARY_CREDENTIALS_CACHEKEY); + Assert.IsTrue(options.Quiet); + Assert.IsNotNull(options.CallbackBody); + Assert.IsTrue(options.EnableResumableUpload); + Assert.IsTrue(options.BigObjectContentLength == 5 * 1024L * 1024 * 1024); + Assert.IsNull(options.RoleArn); + Assert.IsNull(options.RoleSessionName); + + + } + + [TestMethod] + public void TestAliyunStsOptionsDefaultReturnDurationSecondsIs3600() + { + AliyunStsOptions stsOptions = new AliyunStsOptions(); + Assert.IsTrue(stsOptions.RegionId == null); + Assert.IsTrue(stsOptions.GetEarlyExpires() == 10); + Assert.IsTrue(stsOptions.GetDurationSeconds() == 3600); + } + + [TestMethod] + public void TestEarlyExpireLessThanZeroReturnThrowArgumentOutOfRangeException() + { + var options = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT); + Assert.ThrowsException(() => options.Sts = new AliyunStsOptions() + { + EarlyExpires = -1 + }); + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs new file mode 100644 index 000000000..77f36058c --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestClient.cs @@ -0,0 +1,137 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; + +[TestClass] +public class TestClient : BaseTest +{ + private CustomClient _client; + + [TestInitialize] + public void Initialize() + { + Mock credentialProvider = new Mock(); + Mock optionProvider = MockOptionProvider(true); + _client = new CustomClient(credentialProvider.Object, optionProvider.Object, NullLogger.Instance); + } + + [TestMethod] + public void TestGetTokenAndNullLoggerReturnFalse() + { + Mock credentialProvider = new(); + var client = new DefaultStorageClient(credentialProvider.Object, MockOptionProvider(false).Object, null); + Assert.ThrowsException(() => client.GetToken(), "GetToken is not supported, please use GetSecurityToken"); + } + + [TestMethod] + public void TestGetTokenAndNotNullLoggerReturnFalse() + { + Mock credentialProvider = new(); + var client = new DefaultStorageClient(credentialProvider.Object, MockOptionProvider().Object, NullLogger.Instance); + Assert.ThrowsException(() => client.GetToken(), "GetToken is not supported, please use GetSecurityToken"); + } + + [TestMethod] + public void TestGetSecurityTokenByCacheReturnSuccess() + { + Mock credentialProvider = new(); + TemporaryCredentialsResponse temporaryCredentials = new( + "accessKeyId", + "secretAccessKey", + "sessionToken", + DateTime.UtcNow.AddHours(-1)); + credentialProvider.Setup(provider => provider.GetSecurityToken()).Returns(temporaryCredentials); + var client = new DefaultStorageClient(credentialProvider.Object, MockOptionProvider(false).Object, NullLogger.Instance); + var responseBase = client.GetSecurityToken(); + Assert.IsTrue(responseBase == temporaryCredentials); + } + + [TestMethod] + public void TestEmptyRoleArnGetSecurityTokenReturnThrowArgumentException() + { + Mock credentialProvider = new(); + _aLiYunStorageOptions = new AliyunStorageOptions("AccessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT); + var client = new DefaultStorageClient(credentialProvider.Object, MockOptionProvider(true).Object, NullLogger.Instance); + Assert.ThrowsException(() => client.GetSecurityToken()); + } + + [TestMethod] + public async Task TestGetObjectAsyncReturnGetObjecVerifytOnce() + { + await _client.GetObjectAsync("bucketName", "objectName", stream => + { + Assert.IsTrue(stream == null); + }); + _client.Oss!.Verify(oss => oss.GetObject(It.IsAny(), It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestGetObjectAsyncByOffsetReturnGetObjecVerifytOnce() + { + await _client.GetObjectAsync("bucketName", "objectName", 1, 2, stream => + { + Assert.IsTrue(stream == null); + }); + _client.Oss!.Verify(oss => oss.GetObject(It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestGetObjectAsyncByLengthLessThan0AndNotEqualMinus1ReturnThrowArgumentOutOfRangeException() + { + await Assert.ThrowsExceptionAsync(async () + => await _client.GetObjectAsync("bucketName", "objectName", 1, -2, null!)); + } + + [TestMethod] + public async Task TestPutObjectAsyncReturnPutObjectVerifytOnce() + { + string str = "JIm"; + await _client.PutObjectAsync("bucketName", "objectName", new MemoryStream(Encoding.Default.GetBytes(str))); + _client.Oss!.Verify(oss => oss.PutObject(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), + Times.Once); + } + + [TestMethod] + public async Task TestPutObjectAsyncReturnResumableUploadObjectVerifytOnce() + { + _aLiYunStorageOptions.BigObjectContentLength = 2; + string str = "JIm"; + await _client.PutObjectAsync("bucketName", "objectName", new MemoryStream(Encoding.Default.GetBytes(str))); + _client.Oss!.Verify(oss => oss.ResumableUploadObject(It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestObjectExistsAsyncReturnNotFound() + { + Assert.IsFalse(await _client.ObjectExistsAsync("bucketName", "1.jpg")); + } + + [TestMethod] + public async Task TestObjectExistsAsyncReturnExist() + { + Assert.IsTrue(await _client.ObjectExistsAsync("bucketName", "2.jpg")); + } + + [TestMethod] + public async Task TestDeleteObjectAsyncReturnVerifytNever() + { + await _client.DeleteObjectAsync("bucketName", "1.jpg"); + _client.Oss!.Verify(oss => oss.DeleteObject(It.IsAny(), It.IsAny()), Times.Never); + } + + [TestMethod] + public async Task TestDeleteObjectAsyncReturnVerifytOnce() + { + await _client.DeleteObjectAsync("bucketName", "2.jpg"); + _client.Oss!.Verify(oss => oss.DoesObjectExist(It.IsAny(), It.IsAny()), Times.Once); + _client.Oss!.Verify(oss => oss.DeleteObject(It.IsAny(), It.IsAny()), Times.Once); + } + + [TestMethod] + public async Task TestDeleteMultiObjectAsyncReturnVerifytOnce() + { + await _client.DeleteObjectAsync("bucketName", new[] { "2.jpg", "1.jpg" }); + _client.Oss!.Verify(oss => oss.DeleteObjects(It.IsAny()), Times.Once); + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs new file mode 100644 index 000000000..e42235bfc --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestCredentialProvider.cs @@ -0,0 +1,124 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; + +[TestClass] +public class TestCredentialProvider : BaseTest +{ + [TestMethod] + public void TestGetSecurityTokenByCacheNotFoundReturnSuccess() + { + var services = new ServiceCollection(); + services.AddMemoryCache(); + services.AddSingleton(); + var serviceProvider = services.BuildServiceProvider(); + var memoryCache = serviceProvider.GetRequiredService(); + + var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), + MockOptionProvider().Object, + memoryCache, + NullLogger.Instance); + var securityToken = client.GetSecurityToken(); + Assert.IsTrue(securityToken.Expiration == client.TemporaryCredentials.Expiration && + securityToken.AccessKeyId == client.TemporaryCredentials.AccessKeyId && + securityToken.AccessKeySecret == client.TemporaryCredentials.AccessKeySecret && + securityToken.SessionToken == client.TemporaryCredentials.SessionToken); + Assert.IsNotNull(memoryCache.Get(_aLiYunStorageOptions.TemporaryCredentialsCacheKey)); + } + + [TestMethod] + public void TestGetSecurityTokenByCacheNotFoundAndGetTemporaryCredentialsIsNullReturnError() + { + var services = new ServiceCollection(); + services.AddMemoryCache(); + services.AddSingleton(); + var serviceProvider = services.BuildServiceProvider(); + var memoryCache = serviceProvider.GetRequiredService(); + var client = new CustomNullClient(serviceProvider.GetRequiredService(), + MockOptionProvider().Object, + memoryCache, + NullLogger.Instance); + Assert.ThrowsException(() => client.GetSecurityToken(), client.Message); + Assert.IsNull(memoryCache.Get(_aLiYunStorageOptions.TemporaryCredentialsCacheKey)); + } + + [TestMethod] + public void TestSetTemporaryCredentialsAndExpirationLessThan10SecondsReturnSkip() + { + var services = new ServiceCollection(); + services.AddMemoryCache(); + services.AddSingleton(); + var serviceProvider = services.BuildServiceProvider(); + var memoryCache = serviceProvider.GetRequiredService(); + var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), + MockOptionProvider().Object, + memoryCache, + NullLogger.Instance); + client.TestExpirationTimeLessThan10Second(5); + Assert.IsNull(memoryCache.Get(_aLiYunStorageOptions.TemporaryCredentialsCacheKey)); + } + + [DataTestMethod] + [DataRow(15)] + [DataRow(20)] + public void TestSetTemporaryCredentialsAndExpirationGreatherThanOrEqual10SecondsReturnSkip(int durationSeconds) + { + var services = new ServiceCollection(); + services.AddMemoryCache(); + services.AddSingleton(); + var serviceProvider = services.BuildServiceProvider(); + var memoryCache = serviceProvider.GetRequiredService(); + var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), + MockOptionProvider().Object, + memoryCache, + NullLogger.Instance); + client.TestExpirationTimeLessThan10Second(durationSeconds); + var res = memoryCache.Get(_aLiYunStorageOptions.TemporaryCredentialsCacheKey); + Assert.IsNotNull(res); + } + + [TestMethod] + public void TestGetTemporaryCredentialsReturnNull() + { + var services = new ServiceCollection(); + services.AddMemoryCache(); + services.AddSingleton(); + var serviceProvider = services.BuildServiceProvider(); + var memoryCache = serviceProvider.GetRequiredService(); + var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), + MockOptionProvider().Object, + memoryCache, + NullLogger.Instance); + Assert.ThrowsException(() => client.TestGetTemporaryCredentials( + "cn-shanghai", + "accessKeyId", + "accessKeySecret", + "roleArn", + "roleSessionName", + string.Empty, + 3600)); + } + + [TestMethod] + public void TestGetTemporaryCredentialsAndNullLoggerReturnThrowException() + { + var services = new ServiceCollection(); + services.AddMemoryCache(); + services.AddSingleton(); + var serviceProvider = services.BuildServiceProvider(); + var memoryCache = serviceProvider.GetRequiredService(); + var client = new CustomCredentialProvider(serviceProvider.GetRequiredService(), + MockOptionProvider().Object, + memoryCache, + NullLogger.Instance); + Assert.ThrowsException(() => client.TestGetTemporaryCredentials( + "cn-shanghai", + "accessKeyId", + "accessKeySecret", + "roleArn", + "roleSessionName", + "policy", + 3600)); + } +} diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs new file mode 100644 index 000000000..6549c55dd --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/TestStorage.cs @@ -0,0 +1,315 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests; + +[TestClass] +public class TestStorage : BaseTest +{ + [TestMethod] + public void TestAddAliyunStorageAndNotAddConfigurationReturnClientIsNotNull() + { + IServiceCollection services = new ServiceCollection(); + services.AddAliyunStorage(); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService()); + } + + [TestMethod] + public void TestAddAliyunStorageByEmptySectionReturnThrowArgumentException() + { + var services = new ServiceCollection(); + Assert.ThrowsException(() => services.AddAliyunStorage(string.Empty)); + } + + [TestMethod] + public void TestAddAliyunStorageReturnClientIsNotNull() + { + var services = new ServiceCollection(); + var configurationRoot = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", true, true) + .Build(); + services.AddSingleton(configurationRoot); + services.AddAliyunStorage(); + var serviceProvider = services.BuildServiceProvider(); + var client = serviceProvider.GetService(); + Assert.IsNotNull(client); + + var bucketProvider = serviceProvider.GetService(); + Assert.IsNotNull(bucketProvider); + + Assert.IsTrue(bucketProvider.GetBucketName() == "test-storage"); + Assert.IsTrue(bucketProvider.GetBucketName() == "test-storage2"); + } + + [TestMethod] + public void TestAddAliyunStorageByJsonReturnGetOptions() + { + var services = new ServiceCollection(); + var configurationRoot = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", true, true) + .Build(); + services.AddSingleton(configurationRoot); + services.AddAliyunStorage(); + var serviceProvider = services.BuildServiceProvider(); + var optionProvider = serviceProvider.GetService(); + Assert.IsNotNull(optionProvider); + Assert.IsFalse(optionProvider.SupportCallback); + Assert.IsFalse(optionProvider.IncompleteStsOptions); + + var aliyunStorageOptions = optionProvider.GetOptions(); + Assert.IsNotNull(aliyunStorageOptions); + + Assert.IsTrue(aliyunStorageOptions.AccessKeyId == "Replace-With-Your-AccessKeyId"); + Assert.IsTrue(aliyunStorageOptions.AccessKeySecret == "Replace-With-Your-AccessKeySecret"); + Assert.IsNotNull(aliyunStorageOptions.Sts); + Assert.IsTrue(aliyunStorageOptions.Sts.RegionId == "cn-hangzhou"); + Assert.IsTrue(aliyunStorageOptions.Sts.DurationSeconds == 900); + Assert.IsTrue(aliyunStorageOptions.Endpoint == "oss-cn-hangzhou.aliyuncs.com"); + Assert.IsTrue(aliyunStorageOptions.TemporaryCredentialsCacheKey == "Aliyun.Storage.TemporaryCredentials"); + Assert.IsTrue(aliyunStorageOptions.Policy == "Policy"); + Assert.IsTrue(aliyunStorageOptions.RoleArn == "Replace-With-Your-RoleArn"); + Assert.IsTrue(aliyunStorageOptions.RoleSessionName == "Replace-With-Your-RoleSessionName"); + } + + [TestMethod] + public void TestAddAliyunStorageByOptions() + { + var services = new ServiceCollection(); + services.AddAliyunStorage(_aLiYunStorageOptions); + + var serviceProvider = services.BuildServiceProvider(); + var optionProvider = serviceProvider.GetService(); + + Assert.IsNotNull(optionProvider); + Assert.IsFalse(optionProvider.SupportCallback); + Assert.IsTrue(optionProvider.IncompleteStsOptions); + + var options = optionProvider.GetOptions(); + Assert.IsTrue(options.AccessKeyId == _aLiYunStorageOptions.AccessKeyId); + Assert.IsTrue(options.AccessKeySecret == _aLiYunStorageOptions.AccessKeySecret); + Assert.IsTrue(options.Endpoint == _aLiYunStorageOptions.Endpoint); + Assert.IsTrue(options.RoleArn == _aLiYunStorageOptions.RoleArn); + Assert.IsTrue(options.RoleSessionName == _aLiYunStorageOptions.RoleSessionName); + } + + [TestMethod] + public void TestAddAliyunStorage() + { + var services = new ServiceCollection(); + services.Configure(option => + { + option.AccessKeyId = "AccessKeyId"; + option.AccessKeySecret = "AccessKeySecret"; + option.Sts = new AliyunStsOptions("RegionId") + { + DurationSeconds = 900, + EarlyExpires = 10, + }; + option.Storage = new AliyunStorageOptions() + { + Endpoint = "Endpoint", + TemporaryCredentialsCacheKey = "TemporaryCredentialsCacheKey", + Policy = "Policy", + RoleArn = "RoleArn", + RoleSessionName = "RoleSessionName", + CallbackUrl = "CallbackUrl", + CallbackBody = "CallbackBody", + EnableResumableUpload = true, + BigObjectContentLength = 200, + PartSize = 10, + Quiet = true + }; + }); + services.AddAliyunStorage(); + + var serviceProvider = services.BuildServiceProvider(); + var optionProvider = serviceProvider.GetService(); + + Assert.IsNotNull(optionProvider); + Assert.IsTrue(optionProvider.SupportCallback); + Assert.IsFalse(optionProvider.IncompleteStsOptions); + + var options = optionProvider.GetOptions(); + Assert.IsTrue(options.Sts.DurationSeconds == 900); + Assert.IsTrue(options.Sts.EarlyExpires == 10); + Assert.IsTrue(options.Sts.RegionId == "RegionId"); + Assert.IsTrue(options.AccessKeyId == "AccessKeyId"); + Assert.IsTrue(options.AccessKeySecret == "AccessKeySecret"); + Assert.IsTrue(options.Endpoint == "Endpoint"); + Assert.IsTrue(options.RoleArn == "RoleArn"); + Assert.IsTrue(options.RoleSessionName == "RoleSessionName"); + Assert.IsTrue(options.TemporaryCredentialsCacheKey == "TemporaryCredentialsCacheKey"); + Assert.IsTrue(options.Policy == "Policy"); + Assert.IsTrue(options.CallbackUrl == "CallbackUrl"); + Assert.IsTrue(options.CallbackBody == "CallbackBody"); + Assert.IsTrue(options.EnableResumableUpload == true); + Assert.IsTrue(options.BigObjectContentLength == 200); + Assert.IsTrue(options.PartSize == 10); + Assert.IsTrue(options.Quiet); + } + + [TestMethod] + public void TestAddAliyunStorage2() + { + var services = new ServiceCollection(); + services.Configure(option => + { + option.AccessKeyId = "AccessKeyId"; + option.AccessKeySecret = "AccessKeySecret"; + option.Sts = new AliyunStsOptions("RegionId") + { + DurationSeconds = 900, + EarlyExpires = 10, + }; + option.Storage = new AliyunStorageOptions() + { + Sts = new AliyunStsOptions() + { + DurationSeconds = 1200, + EarlyExpires = 100, + RegionId = "RegionId2" + }, + AccessKeyId = "AccessKeyId2", + AccessKeySecret = "AccessKeySecret2", + Endpoint = "Endpoint", + TemporaryCredentialsCacheKey = "TemporaryCredentialsCacheKey", + Policy = "Policy", + RoleArn = "RoleArn", + RoleSessionName = "RoleSessionName", + CallbackUrl = "CallbackUrl", + CallbackBody = "CallbackBody", + EnableResumableUpload = true, + BigObjectContentLength = 200, + PartSize = 10, + Quiet = true + }; + }); + services.AddAliyunStorage(); + + var serviceProvider = services.BuildServiceProvider(); + var optionProvider = serviceProvider.GetService(); + + Assert.IsNotNull(optionProvider); + Assert.IsTrue(optionProvider.SupportCallback); + Assert.IsFalse(optionProvider.IncompleteStsOptions); + + var options = optionProvider.GetOptions(); + Assert.IsTrue(options.Sts.DurationSeconds == 1200); + Assert.IsTrue(options.Sts.EarlyExpires == 100); + Assert.IsTrue(options.Sts.RegionId == "RegionId2"); + Assert.IsTrue(options.AccessKeyId == "AccessKeyId2"); + Assert.IsTrue(options.AccessKeySecret == "AccessKeySecret2"); + Assert.IsTrue(options.Endpoint == "Endpoint"); + Assert.IsTrue(options.RoleArn == "RoleArn"); + Assert.IsTrue(options.RoleSessionName == "RoleSessionName"); + Assert.IsTrue(options.TemporaryCredentialsCacheKey == "TemporaryCredentialsCacheKey"); + Assert.IsTrue(options.Policy == "Policy"); + Assert.IsTrue(options.CallbackUrl == "CallbackUrl"); + Assert.IsTrue(options.CallbackBody == "CallbackBody"); + Assert.IsTrue(options.EnableResumableUpload == true); + Assert.IsTrue(options.BigObjectContentLength == 200); + Assert.IsTrue(options.PartSize == 10); + Assert.IsTrue(options.Quiet); + } + + [TestMethod] + public void TestAddAliyunStorageAndNullALiYunStorageOptionsReturnThrowArgumentNullException() + { + var services = new ServiceCollection(); + AliyunStorageOptions aLiYunStorageOptions = null!; + Assert.ThrowsException(() => services.AddAliyunStorage(aLiYunStorageOptions)); + } + + [TestMethod] + public void TestAddAliyunStorageByEmptyAccessKeyIdReturnThrowArgumentNullException() + { + Assert.ThrowsException(() => new AliyunStorageOptions(null!, null!, null!)); + } + + [TestMethod] + public void TestAddAliyunStorageByALiYunStorageOptionsReturnClientNotNull() + { + var services = new ServiceCollection(); + services.AddAliyunStorage(new AliyunStorageOptions("accessKeyId", "AccessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "roleArn", + "roleSessionName")); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService()); + } + + [TestMethod] + public void TestAddMultiAliyunStorageReturnClientCountIs1() + { + var services = new ServiceCollection(); + AliyunStorageOptions options = + new AliyunStorageOptions("accessKeyId", "accessKeySecret", HANG_ZHOUE_PUBLIC_ENDPOINT, "roleArn", "roleSessionName"); + services.AddAliyunStorage(options).AddAliyunStorage(options); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService()); + Assert.IsTrue(serviceProvider.GetServices().Count() == 1); + } + + [TestMethod] + public void TestAddAliyunStorageAndNullALiYunStorageOptionsFuncReturnThrowArgumentNullException() + { + var services = new ServiceCollection(); + Func func = null!; + Assert.ThrowsException(() => services.AddAliyunStorage(func)); + } + + [TestMethod] + public void TestDefaultBucketNameReturnDefaultBucketNameEqualTest() + { + var services = new ServiceCollection(); + services.AddAliyunStorage(_aLiYunStorageOptions, "Test"); + var serviceProvider = services.BuildServiceProvider(); + var bucketNameProvider = serviceProvider.GetService(); + Assert.IsNotNull(bucketNameProvider); + Assert.IsTrue(bucketNameProvider.GetBucketName() == "Test"); + } + + [TestMethod] + public void TestClientContainer() + { + var services = new ServiceCollection(); + services.AddAliyunStorage(_aLiYunStorageOptions); + services.Configure(option => + { + option.BucketNames = new BucketNames(new List>() + { + new("test-bucket", "test") + }); + }); + var serviceProvider = services.BuildServiceProvider(); + var defaultClientContainer = serviceProvider.GetService(); + Assert.IsNull(defaultClientContainer); + + var bucketNameProvider = serviceProvider.GetService(); + Assert.IsNotNull(bucketNameProvider); + Assert.IsTrue(bucketNameProvider.GetBucketName() == "test"); + } + + [TestMethod] + public void TestClientFactory() + { + var services = new ServiceCollection(); + services.AddAliyunStorage(_aLiYunStorageOptions); + var serviceProvider = services.BuildServiceProvider(); + var defaultClientContainer = serviceProvider.GetService(); + Assert.IsNull(defaultClientContainer); + + var clientFactory = serviceProvider.GetService(); + Assert.IsNotNull(clientFactory); + + var clientContainer = clientFactory.Create("test-bucket2"); + + var fieldInfo = + typeof(DefaultClientContainer).GetField("_bucketName", + BindingFlags.Instance | BindingFlags.NonPublic); + var bucketName = fieldInfo!.GetValue(clientContainer); + Assert.IsNotNull(bucketName); + Assert.IsTrue(bucketName.ToString() == "test-bucket2"); + } +} \ No newline at end of file diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs new file mode 100644 index 000000000..e72fb8508 --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/_Imports.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Aliyun.Acs.Core.Exceptions; +global using Aliyun.OSS; +global using Masa.BuildingBlocks.Storage.ObjectStorage; +global using Masa.BuildingBlocks.Storage.ObjectStorage.Response; +global using Masa.Contrib.Storage.ObjectStorage.Aliyun.Options; +global using Microsoft.Extensions.Caching.Memory; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Logging.Abstractions; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Net; +global using System.Reflection; +global using System.Text; diff --git a/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json new file mode 100644 index 000000000..9e16ff57b --- /dev/null +++ b/src/Contrib/Storage/ObjectStorage/Tests/Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests/appsettings.json @@ -0,0 +1,21 @@ +{ + "Aliyun": { + "AccessKeyId": "Replace-With-Your-AccessKeyId", + "AccessKeySecret": "Replace-With-Your-AccessKeySecret", + "Sts": { + "RegionId": "cn-hangzhou", + "DurationSeconds": 900 + }, + "Storage": { + "RoleArn": "Replace-With-Your-RoleArn", + "RoleSessionName": "Replace-With-Your-RoleSessionName", + "TemporaryCredentialsCacheKey": "Aliyun.Storage.TemporaryCredentials", + "Policy": "Policy", + "Endpoint": "oss-cn-hangzhou.aliyuncs.com", + "BucketNames": { + "DefaultBucketName": "test-storage", + "test-bucket": "test-storage2" + } + } + } +} \ No newline at end of file diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs new file mode 100644 index 000000000..40cdef83b --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/DependencyInjection/RedisCacheClientFactoryServiceCollectionExtensions.cs @@ -0,0 +1,111 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +/// +/// Extensions methods to configure an for . +/// +public static class RedisCacheClientFactoryServiceCollectionExtensions +{ + /// + /// Adds the and related services to the . + /// + /// The . + /// A delegate that is used to configure an . + /// The . + public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, Action configureOptions) + { + services.TryAddSingleton(serviceProvider => + { + var factory = serviceProvider.GetRequiredService(); + return factory.CreateClient(string.Empty); + }); + + return services.AddMasaRedisCache(string.Empty, configureOptions); + } + + /// + /// Adds the and related services to the and configures a named . + /// + /// The . + /// The logical name of the to configure. + /// A delegate that is used to configure an . + /// The . + public static ICachingBuilder AddMasaRedisCache( + this IServiceCollection services, + string name, + Action configureOptions) + { + ArgumentNullException.ThrowIfNull(services, nameof(services)); + ArgumentNullException.ThrowIfNull(name, nameof(name)); + ArgumentNullException.ThrowIfNull(configureOptions, nameof(configureOptions)); + + services.TryAddSingleton(); + + var builder = new CachingBuilder(services, name); + + builder.ConfigureDistributedCacheClient(configureOptions); + + return builder; + } + + /// + /// Adds the and related services to the . + /// + /// The . + /// + /// The . + public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, IConfiguration configuration) + { + services.TryAddSingleton(serviceProvider => + { + var factory = serviceProvider.GetRequiredService(); + return factory.CreateClient(string.Empty); + }); + + return services.AddMasaRedisCache(string.Empty, configuration); + } + + /// + /// Adds the and related services to the and configures a named . + /// + /// The . + /// The logical name of the to configure. + /// + /// The . + public static ICachingBuilder AddMasaRedisCache( + this IServiceCollection services, + string name, + IConfiguration configuration) + { + ArgumentNullException.ThrowIfNull(services, nameof(services)); + ArgumentNullException.ThrowIfNull(name, nameof(name)); + ArgumentNullException.ThrowIfNull(configuration, nameof(configuration)); + + services.TryAddSingleton(); + + var builder = new CachingBuilder(services, name); + builder.ConfigureDistributedCacheClient(configuration); + return builder; + } + + /// + /// Adds the and related services to the . + /// + /// The . + /// The to configure an . + /// The . + public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, RedisConfigurationOptions options) + => services.AddMasaRedisCache(o => o.Initialize(options)); + + /// + /// Adds the and related services to the and configures a named . + /// + /// The . + /// The logical name of the to configure. + /// The to configure an . + /// The . + public static ICachingBuilder AddMasaRedisCache(this IServiceCollection services, string name, RedisConfigurationOptions options) + => services.AddMasaRedisCache(name, o => o.Initialize(options)); +} diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs new file mode 100644 index 000000000..081508623 --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Extensions/JsonSerializerExtensions.cs @@ -0,0 +1,558 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Extensions; + +/// +/// This class is intended as a sample for supporting the feature. +/// +/// +/// It requires a reference to the "System.Linq.Expressions" assembly. +/// +public static class JsonSerializerExtensions +{ + /// + /// Enable support for the feature. + /// Changes the default handling for types specified as from deserializing as + /// to instead deserializing as the one of the + /// -derived types including: + /// , + /// , + /// , + /// and + /// . + /// + /// + /// When deserializing , + /// is returned which implements . + /// When deserializing , + /// is returned which implements . + /// When deserializing , + /// is returned and supports an implicit cast to . + /// An explicit cast or assignment to other types, such as , + /// is supported provided there is a custom converter for that Type. + /// When deserializing , is returned. + /// An explicit cast or assignment is required to the appropriate number type, such as or . + /// When deserializing and , + /// is returned and supports an implicit cast to . + /// An explicit cast or assignment to other types is supported provided there is a custom converter for that type. + /// When deserializing , is returned. + /// + public static void EnableDynamicTypes(this JsonSerializerOptions options) + { + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + options.Converters.Add(new DynamicObjectConverter()); + } + + /// + /// The base class for all dynamic types supported by the serializer. + /// + public abstract class JsonDynamicType : DynamicObject + { + public JsonSerializerOptions Options { get; private set; } + + internal JsonDynamicType(JsonSerializerOptions options) + { + if (options == null) + { + throw new ArgumentNullException(nameof(options)); + } + + Options = options; + } + + public sealed override bool TryConvert(ConvertBinder binder, out object? result) + { + return TryConvert(binder.ReturnType, out result); + } + + public abstract T? GetValue(); + public abstract void SetValue(object value); + protected abstract bool TryConvert(Type returnType, out object? result); + + protected static bool TryConvertWithTypeConverter(object value, Type returnType, out object? result) + { + TypeConverter converter = TypeDescriptor.GetConverter(value.GetType()); + if (converter.CanConvertTo(returnType)) + { + result = converter.ConvertTo(value, returnType)!; + return true; + } + + converter = TypeDescriptor.GetConverter(returnType); + if (converter.CanConvertFrom(value.GetType())) + { + result = converter.ConvertFrom(value)!; + return true; + } + + result = null; + return false; + } + + internal abstract object Value { get; } + } + + /// + /// Supports dynamic strings. + /// + public sealed class JsonDynamicString : JsonDynamicType + { + private object _value; + private Type? _type; + + public JsonDynamicString(string value, JsonSerializerOptions options) : base(options) + { + _value = value; + _type = typeof(string); + } + + public override T? GetValue() where T : default + { + bool success = TryConvert(typeof(T), out object? result); + Debug.Assert(success); + return result is T ? (T) result : default; + } + + public override void SetValue(object value) + { + _value = value; + _type = value.GetType(); + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType == _type) + { + result = _value; // Return cached value, such as a DateTime. + return true; + } + + if (TryConvertWithTypeConverter(_value, returnType, out result)) + { + return true; + } + + result = _value = JsonSerializer.Deserialize($"\"{_value}\"", returnType, Options)!; + _type = result.GetType(); + return true; + } + + internal override object Value => _value; + + public static implicit operator string(JsonDynamicString obj) + { + bool success = obj.TryConvert(typeof(string), out object? result); + Debug.Assert(success); + return (string) result!; + } + } + + /// + /// Supports dynamic numbers. + /// + public sealed class JsonDynamicNumber : JsonDynamicType + { + private Type? _type; + private object _value; + private object? _lastValue = null; + + public JsonDynamicNumber(object? value, JsonSerializerOptions options) : base(options) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + public override T? GetValue() where T : default + { + if (TryConvert(typeof(T), out object? result)) + { + return result is T ? (T) result : default; + } + + throw new InvalidOperationException($"Cannot change type {_value.GetType()} to {typeof(T)}."); + } + + public override void SetValue(object value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + _value = _lastValue = value; + _type = value.GetType(); + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType == _type) + { + result = _lastValue; // Return cached value, such as a long or double. + return true; + } + + bool success = false; + result = null; + + if (!(_value is JsonElement jsonElement)) + { + return TryConvertWithTypeConverter(_value, returnType, out result); + } + + if (returnType == typeof(long)) + { + success = jsonElement.TryGetInt64(out long value); + result = value; + } + else if (returnType == typeof(double)) + { + success = jsonElement.TryGetDouble(out double value); + result = value; + } + else if (returnType == typeof(int)) + { + success = jsonElement.TryGetInt32(out int value); + result = value; + } + else if (returnType == typeof(short)) + { + success = jsonElement.TryGetInt16(out short value); + result = value; + } + else if (returnType == typeof(decimal)) + { + success = jsonElement.TryGetDecimal(out decimal value); + result = value; + } + else if (returnType == typeof(byte)) + { + success = jsonElement.TryGetByte(out byte value); + result = value; + } + else if (returnType == typeof(float)) + { + success = jsonElement.TryGetSingle(out float value); + result = value; + } + else if (returnType == typeof(uint)) + { + success = jsonElement.TryGetUInt32(out uint value); + result = value; + } + else if (returnType == typeof(ushort)) + { + success = jsonElement.TryGetUInt16(out ushort value); + result = value; + } + else if (returnType == typeof(ulong)) + { + success = jsonElement.TryGetUInt64(out ulong value); + result = value; + } + else if (returnType == typeof(sbyte)) + { + success = jsonElement.TryGetSByte(out sbyte value); + result = value; + } + + if (!success) + { + // Use the raw test which may be recognized by converters such as the Enum converter than can process numbers. + string rawText = jsonElement.GetRawText(); + result = JsonSerializer.Deserialize($"{rawText}", returnType, Options)!; + } + + _lastValue = result!; + _type = result!.GetType(); + return true; + } + + internal override object Value => _value; + } + + /// + /// Supports dynamic booleans. + /// + public sealed class JsonDynamicBoolean : JsonDynamicType + { + private object _value; + private Type? _type; + + public JsonDynamicBoolean(bool value, JsonSerializerOptions options) : base(options) + { + _value = value; + _type = typeof(bool); + } + + public override T? GetValue() where T : default + { + bool success = TryConvert(typeof(T), out object? result); + Debug.Assert(success); + return (T) result!; + } + + public override void SetValue(object value) + { + _value = value; + _type = value.GetType(); + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType == _value!.GetType()) + { + result = _value; // Return cached value. + return true; + } + + if (TryConvertWithTypeConverter(_value, returnType, out result)) + { + return true; + } + + result = _value = JsonSerializer.Deserialize($"\"{Value}\"", returnType, Options)!; + _type = result?.GetType()!; + return true; + } + + internal override object Value => _value; + + public static implicit operator bool(JsonDynamicBoolean obj) + { + bool success = obj.TryConvert(typeof(bool), out object? result); + Debug.Assert(success); + return (bool) result!; + } + } + + /// + /// Supports dynamic objects. + /// + public sealed class JsonDynamicObject : JsonDynamicType, IDictionary + { + private IDictionary _value; + + public JsonDynamicObject(JsonSerializerOptions options) + : base(options) + { + _value = new Dictionary(options.PropertyNameCaseInsensitive + ? StringComparer.OrdinalIgnoreCase + : StringComparer.Ordinal); + } + + public override bool TryGetMember(GetMemberBinder binder, out object? result) + { + if (_value.TryGetValue(binder.Name, out result)) + { + JsonDynamicObject? dynamicObj = result as JsonDynamicObject; + if (dynamicObj != null) + { + return dynamicObj.TryConvert(binder.ReturnType, out result); + } + + return true; + } + + // Return null for missing properties. + result = null; + return true; + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType.IsAssignableFrom(typeof(IDictionary))) + { + result = this; + return true; + } + + result = null; + return false; + } + + public override bool TrySetMember(SetMemberBinder binder, object? value) + { + _value[binder.Name] = value!; + return true; + } + + internal override object Value => _value; + + public override T? GetValue() where T : default => throw new NotSupportedException(); + public override void SetValue(object value) => throw new NotSupportedException(); + + // IDictionary members. + public void Add(string key, object value) => _value.Add(key, value!); + void ICollection>.Add(KeyValuePair item) => _value.Add(item!); + public void Clear() => _value.Clear(); + bool ICollection>.Contains(KeyValuePair item) => _value.Contains(item); + public bool ContainsKey(string key) => _value.ContainsKey(key); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) + => _value.CopyTo(array, arrayIndex); + + public IEnumerator> GetEnumerator() => _value.GetEnumerator(); + public bool Remove(string key) => _value.Remove(key); + bool ICollection>.Remove(KeyValuePair item) => _value.Remove(item); + + public object this[string key] + { + get => _value[key]; + set => _value[key] = value!; + } + + ICollection IDictionary.Keys => _value.Keys; + ICollection IDictionary.Values => _value.Values; + public int Count => _value.Count; + bool ICollection>.IsReadOnly => _value.IsReadOnly; + IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable) _value).GetEnumerator(); + public bool TryGetValue(string key, out object value) => _value.TryGetValue(key, out value!); + } + + /// + /// Supports dynamic arrays. + /// + public sealed class JsonDynamicArray : JsonDynamicType, IList + { + private IList _value; + + public JsonDynamicArray(JsonSerializerOptions options) : base(options) + { + _value = new List(); + } + + protected override bool TryConvert(Type returnType, out object? result) + { + if (returnType.IsAssignableFrom(typeof(IList))) + { + result = _value; + return true; + } + + result = null; + return false; + } + + internal override object Value => _value; + + public override T? GetValue() where T : default => throw new NotSupportedException(); + public override void SetValue(object value) => throw new NotSupportedException(); + + // IList members. + public object this[int index] + { + get => _value[index]; + set => _value[index] = value; + } + + public int Count => _value.Count; + bool ICollection.IsReadOnly => _value.IsReadOnly; + public void Add(object item) => _value.Add(item); + public void Clear() => _value.Clear(); + public bool Contains(object item) => _value.Contains(item); + void ICollection.CopyTo(object[] array, int arrayIndex) => _value.CopyTo(array, arrayIndex); + public IEnumerator GetEnumerator() => _value.GetEnumerator(); + public int IndexOf(object item) => _value.IndexOf(item); + public void Insert(int index, object item) => _value.Insert(index, item); + public bool Remove(object item) => _value.Remove(item); + public void RemoveAt(int index) => _value.RemoveAt(index); + IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable) _value).GetEnumerator(); + } + + /// + /// Supports deserialization of all -declared types, supporting . + /// supports serialization of all -derived types. + /// + private sealed class DynamicObjectConverter : JsonConverter + { + public override bool CanConvert(Type typeToConvert) + { + // For simplicity in adding the converter, we use a single converter instead of two. + return typeToConvert == typeof(object) || + typeof(JsonDynamicType).IsAssignableFrom(typeToConvert); + } + + public sealed override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + switch (reader.TokenType) + { + case JsonTokenType.String: + return new JsonDynamicString(reader.GetString() ?? string.Empty, options); + case JsonTokenType.StartArray: + var dynamicArray = new JsonDynamicArray(options); + ReadList(dynamicArray, ref reader, options); + return dynamicArray; + case JsonTokenType.StartObject: + var dynamicObject = new JsonDynamicObject(options); + ReadObject(dynamicObject, ref reader, options); + return dynamicObject; + case JsonTokenType.False: + return new JsonDynamicBoolean(false, options); + case JsonTokenType.True: + return new JsonDynamicBoolean(true, options); + case JsonTokenType.Number: + JsonElement jsonElement = JsonElement.ParseValue(ref reader); + return new JsonDynamicNumber(jsonElement, options); + case JsonTokenType.Null: + throw new NotSupportedException(nameof(reader.TokenType)); + default: + throw new JsonException("Unexpected token type."); + } + } + + public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions? options) + { + if (value is JsonDynamicType dynamicType) + { + value = dynamicType.Value; + } + + JsonSerializer.Serialize(writer, value, options); + } + + private void ReadList(JsonDynamicArray dynamicArray, ref Utf8JsonReader reader, JsonSerializerOptions options) + { + while (true) + { + reader.Read(); + if (reader.TokenType == JsonTokenType.EndArray) + { + break; + } + + object value = Read(ref reader, typeof(object), options); + dynamicArray.Add(value); + } + } + + private void ReadObject(JsonDynamicObject dynamicObject, ref Utf8JsonReader reader, JsonSerializerOptions options) + { + while (true) + { + reader.Read(); + if (reader.TokenType == JsonTokenType.EndObject) + { + break; + } + + if (reader.TokenType != JsonTokenType.PropertyName) + { + throw new JsonException(); + } + + string key = reader.GetString() ?? string.Empty; + + reader.Read(); + object? value = Read(ref reader, typeof(object), options); + dynamicObject.Add(key, value); + } + } + } +} diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs new file mode 100644 index 000000000..6024cfecd --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Extensions/RedisExtensions.cs @@ -0,0 +1,38 @@ +using StackExchange.Redis; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Extensions; + +/// +/// Reference from https://github.com/dotnet/aspnetcore/blob/3c79366674/src/Caching/StackExchangeRedis/src/RedisExtensions.cs +/// +internal static class RedisExtensions +{ + internal static RedisValue[] HashMemberGet(this IDatabase cache, string key, params string[] members) + { + // TODO: Error checking? + return cache.HashGet(key, GetRedisMembers(members)); + } + + internal static async Task HashMemberGetAsync( + this IDatabase cache, + string key, + params string[] members) + { + // TODO: Error checking? + return await cache.HashGetAsync(key, GetRedisMembers(members)).ConfigureAwait(false); + } + + private static RedisValue[] GetRedisMembers(params string[] members) + { + var redisMembers = new RedisValue[members.Length]; + for (int i = 0; i < members.Length; i++) + { + redisMembers[i] = members[i]; + } + + return redisMembers; + } +} diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs new file mode 100644 index 000000000..d03c716ad --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Helpers/RedisHelper.cs @@ -0,0 +1,122 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Caching.Redis.Internal.Enum; + +namespace Masa.Utils.Caching.Redis.Helpers; + +public static class RedisHelper +{ + public static T? ConvertToValue(RedisValue redisValue) + { + var type = typeof(T); + var compressMode = GetCompressMode(type); + + if (compressMode == CompressMode.None) + return (T?)Convert.ChangeType(redisValue, type); + + var byteValue = (byte[])redisValue; + if (byteValue == null || byteValue.Length == 0) + return default; + + var value = Decompress(byteValue); + + if (compressMode == CompressMode.Compress) + { + var valueString = Encoding.UTF8.GetString(value); + return (dynamic)valueString; + } + + var options = new JsonSerializerOptions(); + options.EnableDynamicTypes(); + + return JsonSerializer.Deserialize(value, options); + } + + public static RedisValue ConvertFromValue(T value) + { + var type = typeof(T); + dynamic redisValue; + switch (GetCompressMode(type)) + { + case CompressMode.None: + redisValue = value!; + break; + case CompressMode.Compress: + redisValue = Compress(Encoding.UTF8.GetBytes(value?.ToString() ?? string.Empty)); + break; + default: + var options = new JsonSerializerOptions(); + options.EnableDynamicTypes(); + + var jsonString = JsonSerializer.Serialize(value, options); + redisValue = Compress(Encoding.UTF8.GetBytes(jsonString)); + break; + } + return ConvertToRedisValue(type, redisValue); + } + + private static RedisValue ConvertToRedisValue(Type type, dynamic value) + { + if (type == typeof(byte) || type == typeof(ushort)) + return (long)value; + + if (type == typeof(decimal)) + return new RedisValue(value.ToString()); + + return value; + } + + public static byte[] Compress(byte[] data) + { + using (MemoryStream msGZip = new MemoryStream()) + using (GZipStream stream = new GZipStream(msGZip, CompressionMode.Compress, true)) + { + stream.Write(data, 0, data.Length); + stream.Close(); + return msGZip.ToArray(); + } + } + + public static byte[] Decompress(byte[] data) + { + using (MemoryStream ms = new MemoryStream(data)) + using (GZipStream stream = new GZipStream(ms, CompressionMode.Decompress)) + using (MemoryStream outBuffer = new MemoryStream()) + { + byte[] block = new byte[1024]; + while (true) + { + int bytesRead = stream.Read(block, 0, block.Length); + if (bytesRead <= 0) + break; + else + outBuffer.Write(block, 0, bytesRead); + } + return outBuffer.ToArray(); + } + } + + private static CompressMode GetCompressMode(this Type type) + { + switch (Type.GetTypeCode(type)) + { + case TypeCode.Byte: + case TypeCode.SByte: + case TypeCode.UInt16: + case TypeCode.UInt32: + case TypeCode.UInt64: + case TypeCode.Int16: + case TypeCode.Int32: + case TypeCode.Int64: + case TypeCode.Double: + case TypeCode.Single: + case TypeCode.Decimal: + return CompressMode.None; + case TypeCode.String: + return CompressMode.Compress; + default: + return CompressMode.SerializeAndCompress; + } + } +} diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs new file mode 100644 index 000000000..cb73be51d --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Internal/Enum/CompressMode.cs @@ -0,0 +1,19 @@ +namespace Masa.Utils.Caching.Redis.Internal.Enum; + +internal enum CompressMode +{ + /// + /// no compression + /// + None = 1, + + /// + /// Compress but not deserialize + /// + Compress, + + /// + /// serialize and compress + /// + SerializeAndCompress, +} diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj new file mode 100644 index 000000000..7033702c9 --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Masa.Utils.Caching.Redis.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs new file mode 100644 index 000000000..59b8dc550 --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Models/RedisConfigurationOptions.cs @@ -0,0 +1,87 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Models; + +/// +/// The redis configuration options. +/// +public class RedisConfigurationOptions : DistributedCacheEntryOptions +{ + /// + /// Gets the servers. + /// + public List Servers { get; set; } = new(); + + /// + /// Gets or sets whether connect/configuration timeouts should be explicitly notified via a TimeoutException. + /// + public bool AbortOnConnectFail { get; set; } + + /// + /// Indicates whether admin operations should be allowed. + /// + public bool AllowAdmin { get; set; } + + /// + /// The client name to use for all connections + /// + public string ClientName { get; set; } = default!; + + /// + /// Automatically encodes and decodes channels. + /// + public string ChannelPrefix { get; set; } = default!; + + /// + /// The number of times to repeat the initial connect cycle if no servers respond promptly. + /// + public int ConnectRetry { get; set; } = 3; + + /// + /// Specifies the time in milliseconds that should be allowed for connection (defaults to 5 seconds unless SyncTimeout is higher) + /// + public int ConnectTimeout { get; set; } = 5000; + + /// + /// Specifies the default database to be used when calling ConnectionMultiplexer.GetDatabase() without any parameters. + /// + public int DefaultDatabase { get; set; } + + /// + /// The password to use to authenticate with the server. + /// + public string Password { get; set; }= default!; + + /// + /// Type of proxy to use (if any); for example Proxy.Twemproxy. + /// + public Proxy Proxy { get; set; } = Proxy.None; + + /// + /// Indicates whether the connection should be encrypted. + /// + public bool Ssl { get; set; } + + /// + /// Specifies the time in milliseconds that the system should allow for synchronous operations (defaults to 5 seconds) + /// + public int SyncTimeout { get; set; } = 1000; + + public void Initialize(RedisConfigurationOptions options) + { + Servers = options.Servers; + ClientName = options.ClientName; + ChannelPrefix = options.ChannelPrefix; + ConnectRetry = options.ConnectRetry; + ConnectTimeout = options.ConnectTimeout; + DefaultDatabase = options.DefaultDatabase; + Password = options.Password; + Proxy = options.Proxy; + Ssl = options.Ssl; + SyncTimeout = options.SyncTimeout; + AbsoluteExpiration = options.AbsoluteExpiration; + AbsoluteExpirationRelativeToNow = options.AbsoluteExpirationRelativeToNow; + SlidingExpiration = options.SlidingExpiration; + } +} diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs new file mode 100644 index 000000000..3f2204471 --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/Models/RedisServerOptions.cs @@ -0,0 +1,73 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Models; + +/// +/// The redis configuration. +/// +public class RedisServerOptions +{ + private const int DEFAULT_REDIS_PORT = 6379; + + /// + /// Gets the host. + /// + public string Host { get; set; } = default!; + + /// + /// Gets the port. + /// + public int Port { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public RedisServerOptions() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The host. + public RedisServerOptions(string host) + { + if (string.IsNullOrWhiteSpace(host)) + { + throw new ArgumentNullException(nameof(host)); + } + + var lastIndex = host.LastIndexOf(':'); + if (lastIndex > 0 && host.Length > lastIndex + 1) + { + if (int.TryParse(host.Substring(lastIndex + 1), out var port)) + { + Host = host.Substring(0, lastIndex); + Port = port; + } + } + + if (string.IsNullOrEmpty(Host)) + { + Host = host; + Port = DEFAULT_REDIS_PORT; + } + } + + /// + /// Initializes a new instance of the class. + /// + /// The host. + /// The port. + public RedisServerOptions(string host, int port) + { + if (string.IsNullOrWhiteSpace(host)) + { + throw new ArgumentNullException(nameof(host)); + } + + Host = host; + Port = port; + } +} diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/RedisCacheClient.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/RedisCacheClient.cs new file mode 100644 index 000000000..51abdb6a1 --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/RedisCacheClient.cs @@ -0,0 +1,576 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis; + +/// +/// The redis cache client. +/// +public class RedisCacheClient : IDistributedCacheClient +{ + // Reference from https://github.com/dotnet/aspnetcore/blob/3c793666742cfc4c389292f3378d15e32f860dc9/src/Caching/StackExchangeRedis/src/RedisCache.cs#L372 + // KEYS[1] = = key + // ARGV[1] = absolute-expiration - ticks as long (-1 for none) + // ARGV[2] = sliding-expiration - ticks as long (-1 for none) + // ARGV[3] = relative-expiration (long, in seconds, -1 for none) - Min(absolute-expiration - Now, sliding-expiration) + // ARGV[4] = data - byte[] + // this order should not change LUA script depends on it + private const string SET_SCRIPT = @" + redis.call('HSET', KEYS[1], 'absexp', ARGV[1], 'sldexp', ARGV[2], 'data', ARGV[4]) + if ARGV[3] ~= '-1' then + redis.call('EXPIRE', KEYS[1], ARGV[3]) + end + return 1"; + + private const string SET_MULTIPLE_SCRIPT = @" + local count = 0 + for i, key in ipairs(KEYS) do + redis.call('HSET', key, 'absexp', ARGV[1], 'sldexp', ARGV[2], 'data', ARGV[i+3]) + if ARGV[3] ~= '-1' then + redis.call('EXPIRE', key, ARGV[3]) + end + count = count + 1 + end + return count"; + + private const string ABSOLUTE_EXPIRATION_KEY = "absexp"; + private const string SLIDING_EXPIRATION_KEY = "sldexp"; + private const string DATA_KEY = "data"; + private const long NOT_PRESENT = -1; + + internal static readonly RedisConfigurationOptions RedisConfiguration = new(); + + private readonly IConnectionMultiplexer? _connection; + private readonly IDatabase _db; + private readonly ISubscriber _subscriber; + + public RedisCacheClient(ConfigurationOptions options) + { + _connection = ConnectionMultiplexer.Connect(options); + _db = _connection.GetDatabase(); + _subscriber = _connection.GetSubscriber(); + } + + /// + public T? Get(string key) + { + var redisValue = GetAndRefresh(key, getData: true); + if (redisValue.HasValue && !redisValue.IsNullOrEmpty) + { + return ConvertToValue(redisValue); + } + + return default; + } + + /// + public async Task GetAsync(string key) + { + var redisValue = await GetAndRefreshAsync(key, getData: true); + if (redisValue.HasValue && !redisValue.IsNullOrEmpty) + { + return ConvertToValue(redisValue); + } + + return default; + } + + /// + public T? GetOrSet(string key, Func setter, CombinedCacheEntryOptions? options = null) + { + if (string.IsNullOrWhiteSpace(key)) + throw new ArgumentNullException(nameof(key)); + + if (setter == null) + throw new ArgumentNullException(nameof(setter)); + + T? value; + + var redisValue = GetAndRefresh(key, true); + + if (redisValue.HasValue && !redisValue.IsNullOrEmpty) + { + value = ConvertToValue(redisValue); + } + else + { + value = setter(); + + Set(key, value, options); + } + + return value; + } + + /// + public async Task GetOrSetAsync(string key, Func setter, CombinedCacheEntryOptions? options = null) + { + if (string.IsNullOrWhiteSpace(key)) + throw new ArgumentNullException(nameof(key)); + + if (setter == null) + throw new ArgumentNullException(nameof(setter)); + + T? value; + + var redisValue = await GetAndRefreshAsync(key, getData: true); + + if (redisValue.HasValue && !redisValue.IsNullOrEmpty) + { + value = ConvertToValue(redisValue); + } + else + { + value = setter(); + + await SetAsync(key, value, options); + } + + return value; + } + + /// + public IEnumerable GetList(string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + // TODO: whether need to check keys.length + + var redisValues = keys.Select(key => GetAndRefresh(key, getData: true)); + + return redisValues + .Where(v => v.HasValue && !v.IsNullOrEmpty) + .Select(ConvertToValue); + } + + /// + public async Task> GetListAsync(string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + // TODO: whether need to check keys.length + + var redisValues = await Task.WhenAll(keys.Select(key => GetAndRefreshAsync(key, getData: true))); + + return redisValues + .Where(v => v.HasValue && !v.IsNullOrEmpty) + .Select(ConvertToValue); + } + + /// + public void Remove(params string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + _db.KeyDelete(keys.Select(key => (RedisKey)key).ToArray()); + } + + /// + public async Task RemoveAsync(params string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + await _db.KeyDeleteAsync(keys.Select(key => (RedisKey)key).ToArray()); + } + + /// + public void Set(string key, T value, CombinedCacheEntryOptions? options = null) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + if (value == null) + throw new ArgumentNullException(nameof(value)); + + if (options == null) + options = new CombinedCacheEntryOptions(); + + var distributedCacheEntryOptions = options.DistributedCacheEntryOptions; + + var bytesValue = ConvertFromValue(value); + + var creationTime = DateTimeOffset.UtcNow; + var absoluteExpiration = GetAbsoluteExpiration(creationTime, distributedCacheEntryOptions); + + var redisKeys = new RedisKey[] { key }; + var redisValues = new RedisValue[] + { + absoluteExpiration?.Ticks ?? NOT_PRESENT, + distributedCacheEntryOptions?.SlidingExpiration?.Ticks ?? NOT_PRESENT, + GetExpirationInSeconds(creationTime, absoluteExpiration, distributedCacheEntryOptions) ?? NOT_PRESENT, + bytesValue + }; + + _db.ScriptEvaluate(SET_SCRIPT, redisKeys, redisValues); + } + + /// + public async Task SetAsync(string key, T value, CombinedCacheEntryOptions? options = null) + { + ArgumentNullException.ThrowIfNull(key, nameof(key)); + + ArgumentNullException.ThrowIfNull(value, nameof(value)); + + options ??= new CombinedCacheEntryOptions(); + + var bytesValue = ConvertFromValue(value); + + await _db.ScriptEvaluateAsync( + SET_SCRIPT, + new RedisKey[] { key }, + GetRedisValues(options.DistributedCacheEntryOptions, () => new[] { (RedisValue)bytesValue }) + ).ConfigureAwait(false); + } + + /// + public void SetList(Dictionary keyValues, CombinedCacheEntryOptions? options = null) + { + ArgumentNullException.ThrowIfNull(keyValues, nameof(keyValues)); + + options ??= new CombinedCacheEntryOptions(); + + var redisKeys = keyValues.Select(item => (RedisKey)item.Key).ToArray(); + var redisValues = keyValues.Select(item => ConvertFromValue(item.Value)).ToArray(); + + _db.ScriptEvaluate( + SET_MULTIPLE_SCRIPT, + redisKeys, + GetRedisValues(options.DistributedCacheEntryOptions, () => redisValues) + ); + } + + /// + public async Task SetListAsync(Dictionary keyValues, CombinedCacheEntryOptions? options = null) + { + if (keyValues == null) + throw new ArgumentNullException(nameof(keyValues)); + + options ??= new CombinedCacheEntryOptions(); + + var keys = keyValues.Select(item => (RedisKey)item.Key).ToArray(); + var redisValues = keyValues.Select(item => ConvertFromValue(item.Value)).ToArray(); + + await _db.ScriptEvaluateAsync( + SET_MULTIPLE_SCRIPT, + keys, + GetRedisValues(options.DistributedCacheEntryOptions, () => redisValues) + ).ConfigureAwait(false); + } + + private RedisValue[] GetRedisValues(DistributedCacheEntryOptions? distributedCacheEntryOptions, Func? func = null) + { + var creationTime = DateTimeOffset.UtcNow; + var absoluteExpiration = GetAbsoluteExpiration(creationTime, distributedCacheEntryOptions); + List redisValues = new() + { + absoluteExpiration?.Ticks ?? NOT_PRESENT, + distributedCacheEntryOptions?.SlidingExpiration?.Ticks ?? NOT_PRESENT, + GetExpirationInSeconds(creationTime, absoluteExpiration, distributedCacheEntryOptions) ?? NOT_PRESENT, + }; + if (func != null) + { + redisValues.AddRange(func.Invoke()); + } + return redisValues.ToArray(); + } + + /// + public bool Exists(string key) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + return _db.KeyExists(key); + } + + /// + public async Task ExistsAsync(string key) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + return await _db.KeyExistsAsync(key); + } + + /// + public void Refresh(string key) + { + GetAndRefresh(key, getData: false); + } + + /// + public async Task RefreshAsync(string key) + { + await GetAndRefreshAsync(key, getData: false); + } + + /// + public void Subscribe(string channel, Action> handler) + { + _subscriber.Subscribe(channel, (_, message) => + { + var options = JsonSerializer.Deserialize>(message); + handler(options!); + }); + } + + /// + public async Task SubscribeAsync(string channel, Action> handler) + { + await _subscriber.SubscribeAsync(channel, (_, message) => + { + var options = JsonSerializer.Deserialize>(message); + handler(options!); + }); + } + + /// + public void Publish(string channel, Action> setup) + { + if (channel == null) + throw new ArgumentNullException(nameof(channel)); + + if (setup == null) + throw new ArgumentNullException(nameof(setup)); + + var options = new SubscribeOptions(); + setup.Invoke(options); + + if (string.IsNullOrWhiteSpace(options.Key)) + throw new ArgumentNullException(nameof(options.Key)); + + var message = JsonSerializer.Serialize(options); + + _subscriber.Publish(channel, message); + } + + /// + public async Task PublishAsync(string channel, Action> setup) + { + if (channel == null) + throw new ArgumentNullException(nameof(channel)); + + if (setup == null) + throw new ArgumentNullException(nameof(setup)); + + var options = new SubscribeOptions(); + setup.Invoke(options); + + if (string.IsNullOrWhiteSpace(options.Key)) + throw new ArgumentNullException(nameof(options.Key)); + + var message = JsonSerializer.Serialize(options); + + await _subscriber.PublishAsync(channel, message); + } + + public async Task HashIncrementAsync(string key, long value = 1L) + { + return await _db.HashIncrementAsync(key, DATA_KEY, value); + } + + public async Task HashDecrementAsync(string key, long value = 1L) + { + var script = $@" +local result = redis.call('HGET', KEYS[1], KEYS[2]) +if tonumber(result) >= {value} then + result = redis.call('HINCRBY', KEYS[1], KEYS[2], {0 - value}) + return result +else + return -1 +end"; + var result = (long)await _db.ScriptEvaluateAsync(script, new RedisKey[] { key, DATA_KEY }); + + return result; + } + + private RedisValue GetAndRefresh(string key, bool getData) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + RedisValue[] results; + if (getData) + { + results = _db.HashMemberGet(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY, DATA_KEY); + } + else + { + results = _db.HashMemberGet(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY); + } + + if (results.Length >= 2) + { + MapMetadata(results, out DateTimeOffset? absExpr, out TimeSpan? sldExpr); + Refresh(key, absExpr, sldExpr); + } + + if (results.Length >= 3 && results[2].HasValue) + { + return results[2]; + } + + return RedisValue.Null; + } + + private async Task GetAndRefreshAsync(string key, bool getData) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + RedisValue[] results; + if (getData) + { + results = await _db.HashMemberGetAsync(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY, DATA_KEY).ConfigureAwait(false); + } + else + { + results = await _db.HashMemberGetAsync(key, ABSOLUTE_EXPIRATION_KEY, SLIDING_EXPIRATION_KEY).ConfigureAwait(false); + } + + // TODO: Error handling + if (results.Length >= 2) + { + MapMetadata(results, out DateTimeOffset? absExpr, out TimeSpan? sldExpr); + await RefreshAsync(key, absExpr, sldExpr).ConfigureAwait(false); + } + + if (results.Length >= 3 && results[2].HasValue) + { + return results[2]; + } + + return RedisValue.Null; + } + + private void Refresh(string key, DateTimeOffset? absExpr, TimeSpan? sldExpr) + { + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + // Note Refresh has no effect if there is just an absolute expiration (or neither). + if (sldExpr.HasValue) + { + TimeSpan? expr; + if (absExpr.HasValue) + { + var relExpr = absExpr.Value - DateTimeOffset.Now; + expr = relExpr <= sldExpr.Value ? relExpr : sldExpr; + } + else + { + expr = sldExpr; + } + + _db.KeyExpire(key, expr); + // TODO: Error handling + } + } + + private async Task RefreshAsync(string key, DateTimeOffset? absExpr, TimeSpan? sldExpr, CancellationToken token = default) + { + if (key == null) + { + throw new ArgumentNullException(nameof(key)); + } + + token.ThrowIfCancellationRequested(); + + // Note Refresh has no effect if there is just an absolute expiration (or neither). + if (sldExpr.HasValue) + { + TimeSpan? expr; + if (absExpr.HasValue) + { + var relExpr = absExpr.Value - DateTimeOffset.Now; + expr = relExpr <= sldExpr.Value ? relExpr : sldExpr; + } + else + { + expr = sldExpr; + } + + await _db.KeyExpireAsync(key, expr).ConfigureAwait(false); + // TODO: Error handling + } + } + + private static void MapMetadata(RedisValue[] results, out DateTimeOffset? absoluteExpiration, out TimeSpan? slidingExpiration) + { + absoluteExpiration = null; + slidingExpiration = null; + var absoluteExpirationTicks = (long?)results[0]; + if (absoluteExpirationTicks.HasValue && absoluteExpirationTicks.Value != NOT_PRESENT) + { + absoluteExpiration = new DateTimeOffset(absoluteExpirationTicks.Value, TimeSpan.Zero); + } + + var slidingExpirationTicks = (long?)results[1]; + if (slidingExpirationTicks.HasValue && slidingExpirationTicks.Value != NOT_PRESENT) + { + slidingExpiration = new TimeSpan(slidingExpirationTicks.Value); + } + } + + private static long? GetExpirationInSeconds( + DateTimeOffset creationTime, + DateTimeOffset? absoluteExpiration, + DistributedCacheEntryOptions? options) + { + if (options == null) + return null; + + if (absoluteExpiration.HasValue && options.SlidingExpiration.HasValue) + { + return (long)Math.Min( + (absoluteExpiration.Value - creationTime).TotalSeconds, + options.SlidingExpiration.Value.TotalSeconds); + } + + if (absoluteExpiration.HasValue) + { + return (long)(absoluteExpiration.Value - creationTime).TotalSeconds; + } + + if (options is { SlidingExpiration: { } }) + { + return (long)options.SlidingExpiration.Value.TotalSeconds; + } + + return null; + } + + private static DateTimeOffset? GetAbsoluteExpiration(DateTimeOffset creationTime, DistributedCacheEntryOptions? options) + { + if (options == null) + return null; + + if (options.AbsoluteExpiration.HasValue && options.AbsoluteExpiration <= creationTime) + { + throw new ArgumentOutOfRangeException( + nameof(DistributedCacheEntryOptions.AbsoluteExpiration), + options.AbsoluteExpiration.Value, + "The absolute expiration value must be in the future."); + } + + if (options.AbsoluteExpirationRelativeToNow.HasValue) + { + return creationTime + options.AbsoluteExpirationRelativeToNow; + } + + return options.AbsoluteExpiration; + } + + /// + public void Dispose() + { + if (_connection != null) + _connection.Dispose(); + } +} diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs new file mode 100644 index 000000000..3bd8918d5 --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/RedisCacheClientFactory.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis; + +public class RedisCacheClientFactory : DistributedCacheClientFactory +{ + public RedisCacheClientFactory(IOptionsMonitor optionsMonitor) : base(optionsMonitor) + { + + } + + protected override IDistributedCacheClient CreateClientHandler(string name) + { + var options = GetOptions(name); + + if (options == null) + { + throw new ArgumentException("No matching client found!"); + } + + var configurationOptions = new ConfigurationOptions + { + AbortOnConnectFail = options.AbortOnConnectFail, + AllowAdmin = options.AllowAdmin, + ChannelPrefix = options.ChannelPrefix, + ClientName = options.ClientName, + ConnectRetry = options.ConnectRetry, + ConnectTimeout = options.ConnectTimeout, + DefaultDatabase = options.DefaultDatabase, + Password = options.Password, + Proxy = options.Proxy, + Ssl = options.Ssl, + SyncTimeout = options.SyncTimeout + }; + + foreach (var server in options.Servers) + { + configurationOptions.EndPoints.Add(server.Host, server.Port); + } + + return new RedisCacheClient(configurationOptions); + } +} diff --git a/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/_Imports.cs b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/_Imports.cs new file mode 100644 index 000000000..b6b6321b1 --- /dev/null +++ b/src/Utils/Caching/Distributed/Masa.Utils.Caching.Redis/_Imports.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caching.Core; +global using Masa.Utils.Caching.Core.DependencyInjection; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Core.Models; +global using Masa.Utils.Caching.Redis; +global using Masa.Utils.Caching.Redis.Extensions; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.Extensions.Caching.Distributed; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Options; +global using StackExchange.Redis; +global using System.Collections; +global using System.ComponentModel; +global using System.Diagnostics; +global using System.Dynamic; +global using System.IO.Compression; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; +global using static Masa.Utils.Caching.Redis.Helpers.RedisHelper; diff --git a/src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs b/src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs new file mode 100644 index 000000000..f4b844ca7 --- /dev/null +++ b/src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/ConvertToValueTest.cs @@ -0,0 +1,115 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Redis.Tests; + +[TestClass] +public class ConvertToValueTest +{ + [TestMethod] + public void TestConvertByGuid() + { + Guid id = Guid.NewGuid(); + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByByte() + { + byte id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertBySByte() + { + sbyte id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByUShort() + { + ushort id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByUInt() + { + uint id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByULong() + { + ulong id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByShort() + { + short id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByInt() + { + int id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByLong() + { + long id = 1; + RedisValue obj = RedisHelper.ConvertFromValue(id); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == id); + } + + [TestMethod] + public void TestConvertByDouble() + { + double score = 1.1d; + RedisValue obj = RedisHelper.ConvertFromValue(score); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == score); + } + + [TestMethod] + public void TestConvertByFloat() + { + float score = 1.1f; + RedisValue obj = RedisHelper.ConvertFromValue(score); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == score); + } + + [TestMethod] + public void TestConvertByDecimal() + { + decimal score = 1.1m; + dynamic obj = RedisHelper.ConvertFromValue(score); + Assert.IsTrue(RedisHelper.ConvertToValue(obj) == score); + } + + [TestMethod] + public void TestConvertByDynamic() + { + dynamic user = new + { + Name = "Jim" + }; + RedisValue obj = RedisHelper.ConvertFromValue(user)!; + Assert.IsTrue(RedisHelper.ConvertToValue(obj)!.Name == user.Name); + } +} diff --git a/src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj b/src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj new file mode 100644 index 000000000..186857ac3 --- /dev/null +++ b/src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/Masa.Utils.Caching.Redis.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/_Imports.cs b/src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/_Imports.cs new file mode 100644 index 000000000..fe0e0105a --- /dev/null +++ b/src/Utils/Caching/Distributed/Tests/Masa.Utils.Caching.Redis.Tests/_Imports.cs @@ -0,0 +1,7 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caching.Redis.Helpers; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using StackExchange.Redis; +global using System; diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs new file mode 100644 index 000000000..b0584d3b7 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/CachingBuilder.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.DependencyInjection; + +public class CachingBuilder : ICachingBuilder +{ + /// + /// Initializes a new instance of the class. + /// + /// The to add services to. + /// + public CachingBuilder(IServiceCollection services, string name) + { + Services = services; + Name = name; + } + + /// + public IServiceCollection Services { get; private set; } + + /// + public string Name { get; private set; } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs new file mode 100644 index 000000000..20fbe7413 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/DistributedCacheClientBuilderExtensions.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.DependencyInjection; + +/// +/// Extension methods for configuring an +/// +public static class DistributedCacheClientBuilderExtensions +{ + /// + /// Adds a delegate that will be used to configure a named . + /// + /// The . + /// A delegate that is used to configure an . + /// An that can be used to configure the client. + public static ICachingBuilder ConfigureDistributedCacheClient(this ICachingBuilder builder, Action configureOptions) + where TOptions : class + { + ArgumentNullException.ThrowIfNull(builder, nameof(builder)); + ArgumentNullException.ThrowIfNull(configureOptions, nameof(configureOptions)); + + builder.Services.Configure(builder.Name, configureOptions); + return builder; + } + + /// + /// Adds a delegate that will be used to configure a named . + /// + /// The . + /// + /// An that can be used to configure the client. + public static ICachingBuilder ConfigureDistributedCacheClient(this ICachingBuilder builder, IConfiguration configuration) + where TOptions : class + { + ArgumentNullException.ThrowIfNull(builder, nameof(builder)); + ArgumentNullException.ThrowIfNull(configuration, nameof(configuration)); + + builder.Services.Configure(builder.Name, configuration); + return builder; + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs new file mode 100644 index 000000000..2cb999456 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/DependencyInjection/ICachingBuilder.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.DependencyInjection; + +/// +/// A builder for configuring named instances. +/// +public interface ICachingBuilder +{ + /// + /// Gets the application service collection. + /// + IServiceCollection Services { get; } + + /// + /// Gets the name of the client configured by this builder. + /// + string Name { get; } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs new file mode 100644 index 000000000..40622509a --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactory.cs @@ -0,0 +1,49 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core; + +public abstract class DistributedCacheClientFactory : IDistributedCacheClientFactory +{ + private readonly IOptionsMonitor _optionsMonitor; + + private readonly ConcurrentDictionary> _clients; + private readonly Func> _clientFactory; + + public DistributedCacheClientFactory(IOptionsMonitor optionsMonitor) + { + if (optionsMonitor == null) + { + throw new ArgumentNullException(nameof(optionsMonitor)); + } + + _optionsMonitor = optionsMonitor; + + _clients = new ConcurrentDictionary>(); + + _clientFactory = (name) => + { + return new Lazy(() => + { + return CreateClientHandler(name); + }); + }; + } + + // + public IDistributedCacheClient CreateClient(string name) + { + name ??= string.Empty; + + var client = _clients.GetOrAdd(name, _clientFactory); + + return client.Value; + } + + internal protected abstract IDistributedCacheClient CreateClientHandler(string name); + + protected TOptions GetOptions(string name) + { + return _optionsMonitor.Get(name); + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs new file mode 100644 index 000000000..df29f9f34 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/DistributedCacheClientFactoryExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core; + +/// +/// Extension methods for . +/// +public static class DistributedCacheClientFactoryExtensions +{ + /// + /// Creates a new using the default configuration. + /// + /// The . + /// An configured using the default configuration. + public static IDistributedCacheClient CreateClient(this IDistributedCacheClientFactory factory) + { + if (factory == null) + { + throw new ArgumentNullException(nameof(factory)); + } + + return factory.CreateClient(string.Empty); + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs new file mode 100644 index 000000000..4deea1873 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Helpers/SubscribeHelper.cs @@ -0,0 +1,57 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Helpers; + +/// +/// The subscribe helper. +/// +public static class SubscribeHelper +{ + /// + /// Formats the memory cache key. + /// + /// The key. + /// A string. + public static string FormatMemoryCacheKey(string key) + { + var type = typeof(T); + if (type.IsGenericType) + { + var dictType = typeof(Dictionary<,>); + if (type.GetGenericTypeDefinition() == dictType) + key += type.Name + "[" + type.GetGenericArguments()[1].Name + "]"; + else + key += type.Name + "[" + type.GetGenericArguments()[0].Name + "]"; + } + else + { + key += typeof(T).Name; + } + + return key; + } + + /// + /// Formats the subscribe channel. + /// + /// The key. + /// The type. + /// The prefix. + /// A string. + public static string FormatSubscribeChannel(string key, SubscribeKeyTypes type, string prefix = "") + { + var valueTypeFullName = typeof(T).FullName!; + switch (type) + { + case SubscribeKeyTypes.ValueTypeFullName: + return valueTypeFullName; + case SubscribeKeyTypes.ValueTypeFullNameAndKey: + return $"[{valueTypeFullName}]{key}"; + case SubscribeKeyTypes.SpecificPrefix: + return $"{prefix}{key}"; + default: + throw new NotImplementedException(); + } + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs new file mode 100644 index 000000000..b09ed34ca --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClient.cs @@ -0,0 +1,100 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Interfaces; + +/// +/// The interface for cache client. +/// +public interface ICacheClient : IDisposable +{ + /// + /// Gets a value with given key. + /// + /// A string identifying the request value. + /// The located value or null. + T? Get(string key); + + /// + /// Gets a value with given key. + /// + /// A string identifying the request value. + /// The that represents the asynchronous opertion, containing the located value or null. + Task GetAsync(string key); + + /// + /// Gets or sets a value with given key. + /// + /// A string identifying the request value. + /// The setter. + /// The . + /// The located value. + T? GetOrSet(string key, Func setter, CombinedCacheEntryOptions? options = null); + + /// + /// Gets or sets a value with given key. + /// + /// A string identifying the request value. + /// The setter. + /// The . + /// The that represents the asynchronous opertion, containing the located value. + Task GetOrSetAsync(string key, Func setter, CombinedCacheEntryOptions? options = null); + + /// + /// Gets a list of values with given keys. + /// + /// A list of string identifying the request value. + /// The located values without . + IEnumerable GetList(string[] keys); + + /// + /// Gets a list of values with given keys. + /// + /// A list of string identifying the request value. + /// The that represents the asynchronous opertion, containing the located values with . + Task> GetListAsync(string[] keys); + + /// + /// Removes a list of values with given keys. + /// + /// A list of string identifying the requested value. + void Remove(params string[] keys); + + /// + /// Removes a list of values with given keys. + /// + /// A list of string identifying the requested value. + Task RemoveAsync(params string[] keys); + + /// + /// Sets a value with given key. + /// + /// A string identifying the requested value. + /// The value to set int the cache. + /// The cache options for the value. + void Set(string key, T value, CombinedCacheEntryOptions? options = null); + + /// + /// Sets a value with given key. + /// + /// A string identifying the requested value. + /// The value to set int the cache. + /// The cache options for the value. + /// The that represents the asynchronous operation. + Task SetAsync(string key, T value, CombinedCacheEntryOptions? options = null); + + /// + /// Sets a list of cahce items contains key and value. + /// + /// The contains the cache key and cache value. + /// The cache options for the value. + void SetList(Dictionary keyValues, CombinedCacheEntryOptions? options = null); + + /// + /// Sets a list of cahce items contains key and value. + /// + /// The contains the cache key and cache value. + /// The cache options for the value. + /// The that represents the asynchronous operation. + Task SetListAsync(Dictionary keyValues, CombinedCacheEntryOptions? options = null); +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs new file mode 100644 index 000000000..745f573b4 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/ICacheClientFactory.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Interfaces; + +/// +/// A factory abstraction for a component that can create instances of type with custom +/// configuration for a given logical name. +/// +public interface ICacheClientFactory +{ + /// + /// Creates and configures an instance of type using the configuration that corresponds + /// to the logical name specified by . + /// + /// The logical name of the client to create. + /// A new instance of type. + TICacheClinet CreateClient(string name); +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs new file mode 100644 index 000000000..c772d52d3 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClient.cs @@ -0,0 +1,85 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Interfaces; + +/// +/// The interface for distributed cache client. +/// +public interface IDistributedCacheClient : ICacheClient +{ + /// + /// Refreshes a value's expiration with given key. + /// + /// A string identifying the requested value. + void Refresh(string key); + + /// + /// Refreshes a value's expiration with given key. + /// + /// A string identifying the requested value. + /// The that represents the asynchronous operation. + Task RefreshAsync(string key); + + /// + /// Checks whether a value exists with given key. + /// + /// A string identifying the requested value. + /// if the value exists, otherwise . + bool Exists(string key); + + /// + /// Checks whether a value exists with given key. + /// + /// A string identifying the requested value. + /// The that represents the asynchronous operation, containing the value if the value exists, otherwise . + Task ExistsAsync(string key); + + /// + /// Subscribes to perform some operation when a change to the perferred/active node is broadcast. + /// + /// The channel to subscribe to. + /// The handler to invoke when a message is received on channel. + void Subscribe(string channel, Action> handler); + + /// + /// Subscribes to perform some operation when a change to the perferred/active node is broadcast. + /// + /// The channel to subscribe to. + /// The handler to invoke when a message is received on channel. + /// The that represents the asynchronous operation. + Task SubscribeAsync(string channel, Action> handler); + + /// + /// Posts a message to the given channel. + /// + /// The channel to publish to. + /// The setup action to configure the . + void Publish(string channel, Action> setup); + + /// + /// Posts a message to the given channel. + /// + /// The channel to publish to. + /// The setup action to configure the . + /// The that represents the asynchronous operation. + Task PublishAsync(string channel, Action> setup); + + /// + /// !Destructive support in caching + /// Increments the number stored at field in the hash stored at key by increment + /// + /// The key + /// The increment number + /// + Task HashIncrementAsync(string key, long value = 1L); + + /// + /// !Destructive support in caching + /// Decrements the number stored at field in the hash stored at key by decrement. return -1 if decrement failed, otherwise return the result. + /// + /// The key + /// The decrement number + /// + Task HashDecrementAsync(string key, long value = 1L); +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs new file mode 100644 index 000000000..efdbffb52 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Interfaces/IDistributedCacheClientFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Interfaces; + +/// +/// A factory abstraction for a component that create instances with custom configuration for a given logical name. +/// +public interface IDistributedCacheClientFactory : ICacheClientFactory +{ +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj b/src/Utils/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj new file mode 100644 index 000000000..13928df95 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Masa.Utils.Caching.Core.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs new file mode 100644 index 000000000..1172a3a6a --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Models/CombinedCacheEntryOptions.cs @@ -0,0 +1,55 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Models; + +/// +/// The combined cache entry options. +/// +public class CombinedCacheEntryOptions +{ + /// + /// Gets or sets the memory cache entry options. + /// + public MemoryCacheEntryOptions? MemoryCacheEntryOptions { get; set; } + + /// + /// Gets or sets the distributed cache entry options. + /// + public DistributedCacheEntryOptions? DistributedCacheEntryOptions { get; set; } + + public CombinedCacheEntryOptions() + { + } + + public CombinedCacheEntryOptions(MemoryCacheEntryOptions? memoryCacheEntryOptions, DistributedCacheEntryOptions? distributedCacheEntryOptions) + { + MemoryCacheEntryOptions = memoryCacheEntryOptions; + DistributedCacheEntryOptions = distributedCacheEntryOptions; + } +} + +/// +/// The combined cache entry options. +/// +public class CombinedCacheEntryOptions +{ + public Action? ValueChanged { get; set; } + + /// + /// Gets or sets the memory cache entry options. + /// + public MemoryCacheEntryOptions? MemoryCacheEntryOptions { get; set; } + + /// + /// Gets or sets the distributed cache entry options. + /// + public DistributedCacheEntryOptions? DistributedCacheEntryOptions { get; set; } + + /// + /// Determines whether to ignore subscribe. + /// + public bool IgnoreSubscribe { get; set; } + + public CombinedCacheEntryOptions Standard => new(MemoryCacheEntryOptions, DistributedCacheEntryOptions); +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs new file mode 100644 index 000000000..91a12b1de --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeKeyTypes.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Models; + +/// +/// The subscribe key type. +/// +public enum SubscribeKeyTypes +{ + ValueTypeFullName = 1, + + ValueTypeFullNameAndKey = 2, + + SpecificPrefix = 3 +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs new file mode 100644 index 000000000..768191aac --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeOperation.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Models; + +/// +/// The subscribe operation. +/// +public enum SubscribeOperation +{ + Set = 1, + + Remove = 2 +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs new file mode 100644 index 000000000..a572e4dde --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/Models/SubscribeOptions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Core.Models; + +/// +/// The subscribe options. +/// +public class SubscribeOptions +{ + /// + /// Gets or sets the operation. + /// + public SubscribeOperation Operation { get; set; } + + /// + /// Gets or sets the key. + /// + public string Key { get; set; } = default!; + + /// + /// Gets or sets the value. + /// + public T? Value { get; set; } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Core/_Imports.cs b/src/Utils/Caching/Masa.Utils.Caching.Core/_Imports.cs new file mode 100644 index 000000000..b3099d7a7 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Core/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Core.Models; +global using Microsoft.Extensions.Caching.Distributed; +global using Microsoft.Extensions.Caching.Memory; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Options; +global using System.Collections.Concurrent; diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs new file mode 100644 index 000000000..948dfbbc5 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientBuilderExtensions.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.DependencyInjection; + +/// +/// Extension methods for configuring an +/// +public static class MemoryCacheClientBuilderExtensions +{ + /// + /// Adds a delegate that will be used to configure a named . + /// + /// The . + /// A delegate that is used to configure an . + /// An that can be used to configure the client. + public static ICachingBuilder ConfigureMemoryCacheClient(this ICachingBuilder builder, Action configureOptions) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + if (configureOptions == null) + { + throw new ArgumentNullException(nameof(configureOptions)); + } + + builder.Services.Configure(builder.Name, configureOptions); + + return builder; + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs new file mode 100644 index 000000000..a40aa6928 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/DependencyInjection/MemoryCacheClientFactoryCachingBuilderExtensions.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.DependencyInjection; + +/// +/// Extension methods to configure an for . +/// +public static class MemoryCacheClientFactoryCachingBuilderExtensions +{ + /// + /// Adds the and related services to the . + /// + /// The . + /// The . + public static ICachingBuilder AddMasaMemoryCache(this ICachingBuilder builder) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + var name = builder.Name; + + builder.Services.TryAddSingleton(); + + builder.Services.TryAddSingleton(serviceProvider => + { + var factory = serviceProvider.GetRequiredService(); + + return factory.CreateClient(name); + }); + + return builder; + } + + /// + /// Adds the and related services to the . + /// + /// The . + /// A delegate that is used to configure an . + /// The . + public static ICachingBuilder AddMasaMemoryCache(this ICachingBuilder builder, Action configureOptions) + { + if (configureOptions == null) + { + throw new ArgumentNullException(nameof(configureOptions)); + } + + builder.AddMasaMemoryCache(); + + builder.ConfigureMemoryCacheClient(configureOptions); + + return builder; + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs new file mode 100644 index 000000000..0654a9381 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClient.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.Interfaces; + +/// +/// The the interface memory cache client. +/// +public interface IMemoryCacheClient : ICacheClient +{ + /// + /// Gets a value with given key. + /// + /// A string identifying the request value. + /// The handler to invoke when the request value changed. + /// The located value or null. + T? Get(string key, Action valueChanged); + + /// + /// Gets a value with given key. + /// + /// A string identifying the request value. + /// The handler to invoke when the request value changed. + /// The that represents the asynchronous opertion, containing the located value or null. + Task GetAsync(string key, Action valueChanged); +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs new file mode 100644 index 000000000..a17f0c43f --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Interfaces/IMemoryCacheClientFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.Interfaces; + +/// +/// A factory abstraction for a component that create instances with custom configuration for a given logical name. +/// +public interface IMemoryCacheClientFactory : ICacheClientFactory +{ +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj new file mode 100644 index 000000000..9a852d2bd --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Masa.Utils.Caching.DistributedMemory.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs new file mode 100644 index 000000000..0aea93ee5 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClient.cs @@ -0,0 +1,407 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory; + +public class MemoryCacheClient : IMemoryCacheClient +{ + private readonly IMemoryCache _cache; + private readonly IDistributedCacheClient _distributedClient; + + private readonly SubscribeKeyTypes _subscribeKeyType; + private readonly string _subscribeKeyPrefix; + + private readonly object _locker = new(); + private readonly IList _subscribeChannels = new List(); + + /// + /// Initializes a new instance of the class. + /// + /// The cache. + /// The distributed client. + /// The type of subscribe key. + /// The prefix of subscribe key. + public MemoryCacheClient(IMemoryCache cache, IDistributedCacheClient distributedClient, SubscribeKeyTypes subscribeKeyType, + string subscribeKeyPrefix = "") + { + _cache = cache; + _distributedClient = distributedClient; + + _subscribeKeyType = subscribeKeyType; + _subscribeKeyPrefix = subscribeKeyPrefix; + } + + /// + public T? Get(string key) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = _distributedClient.Get(key); + + _cache.Set(formattedKey, value); + + var channel = FormatSubscribeChannel(key); + + Subscribe(channel); + } + + return value; + } + + /// + public async Task GetAsync(string key) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = await _distributedClient.GetAsync(key); + + _cache.Set(formattedKey, value); + + var channel = FormatSubscribeChannel(key); + + Subscribe(channel); + } + + return value; + } + + /// + public T? Get(string key, Action valueChanged) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = _distributedClient.Get(key); + + _cache.Set(formattedKey, value); + + var channel = FormatSubscribeChannel(key); + + Subscribe(channel, new CombinedCacheEntryOptions + { + ValueChanged = valueChanged + }); + } + + return value; + } + + /// + public async Task GetAsync(string key, Action valueChanged) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = await _distributedClient.GetAsync(key); + + _cache.Set(formattedKey, value); + + var channel = FormatSubscribeChannel(key); + + Subscribe(channel, new CombinedCacheEntryOptions + { + ValueChanged = valueChanged + }); + } + + return value; + } + + /// + public IEnumerable GetList(string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + // TODO: whether need to check keys.length + + return keys + .Where(k => !string.IsNullOrWhiteSpace(k)) + .Select(Get); + } + + /// + public async Task> GetListAsync(string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + return + await Task.WhenAll(keys + .Where(key => !string.IsNullOrWhiteSpace(key)) + .Select(GetAsync)); + } + + /// + public T? GetOrSet(string key, Func setter, CombinedCacheEntryOptions? options = null) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + if (setter == null) + throw new ArgumentNullException(nameof(setter)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(formattedKey, out T? value)) + { + value = _distributedClient.GetOrSet(key, setter, options); + + if (options == null) + { + _cache.Set(formattedKey, value); + } + else + { + _cache.Set(formattedKey, value, options.MemoryCacheEntryOptions); + } + + PubSub(key, SubscribeOperation.Set, value, options); + } + + return value; + } + + /// + public async Task GetOrSetAsync(string key, Func setter, CombinedCacheEntryOptions? options = null) + { + ArgumentNullException.ThrowIfNull(key, nameof(key)); + + ArgumentNullException.ThrowIfNull(setter, nameof(setter)); + + var formattedKey = FormatMemoryCacheKey(key); + + if (!_cache.TryGetValue(key, out T? value)) + { + value = await _distributedClient.GetOrSetAsync(key, setter, options); + + if (options == null) + { + _cache.Set(formattedKey, value); + } + else + { + _cache.Set(formattedKey, value, options.MemoryCacheEntryOptions); + } + + await PubSubAsync(key, SubscribeOperation.Set, value, options); + } + + return value; + } + + /// + public void Remove(params string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + Parallel.ForEach(keys, RemoveOne); + } + + /// + public Task RemoveAsync(params string[] keys) + { + if (keys == null) + throw new ArgumentNullException(nameof(keys)); + + return Task.WhenAll(keys.Select(RemoveOneAsync)); + } + + /// + public void Set(string key, T value, CombinedCacheEntryOptions? options = null) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + if (value == null) + throw new ArgumentNullException(nameof(value)); + + _distributedClient.Set(key, value, options); + + Set(key, value, options?.MemoryCacheEntryOptions); + + PubSub(key, SubscribeOperation.Set, value, options); + } + + /// + public async Task SetAsync(string key, T value, CombinedCacheEntryOptions? options = null) + { + if (key == null) + throw new ArgumentNullException(nameof(key)); + + if (value == null) + throw new ArgumentNullException(nameof(value)); + + await _distributedClient.SetAsync(key, value, options); + + Set(key, value, options?.MemoryCacheEntryOptions); + + await PubSubAsync(key, SubscribeOperation.Set, value, options); + } + + /// + public void SetList(Dictionary keyValues, CombinedCacheEntryOptions? options = null) + { + if (keyValues == null) + throw new ArgumentNullException(nameof(keyValues)); + + _distributedClient.SetList(keyValues, options); + + Parallel.ForEach(keyValues, item => PubSub(item.Key, SubscribeOperation.Set, item.Value, options)); + } + + /// + public async Task SetListAsync(Dictionary keyValues, CombinedCacheEntryOptions? options = null) + { + if (keyValues == null) + throw new ArgumentNullException(nameof(keyValues)); + + await _distributedClient.SetListAsync(keyValues, options); + + await Task.WhenAll(keyValues.Select(item => PubSubAsync(item.Key, SubscribeOperation.Set, item.Value, options))); + } + + private void RemoveOne(string key) + { + _distributedClient.Remove(key); + + Publish(key, SubscribeOperation.Remove); + } + + private async Task RemoveOneAsync(string key) + { + await _distributedClient.RemoveAsync(key); + + await PublishAsync(key, SubscribeOperation.Remove); + } + + private void Subscribe(string channel, CombinedCacheEntryOptions? options = null) + { + if (!_subscribeChannels.Contains(channel)) + { + lock (_locker) + { + if (!_subscribeChannels.Contains(channel)) + { + _distributedClient.Subscribe(channel, (subscribeOptions) => + { + switch (subscribeOptions.Operation) + { + case SubscribeOperation.Set: + options ??= new CombinedCacheEntryOptions(); + _cache.Set(subscribeOptions.Key, subscribeOptions.Value, options.MemoryCacheEntryOptions); + break; + case SubscribeOperation.Remove: + _cache.Remove(subscribeOptions.Key); + break; + default: + throw new NotImplementedException(); + } + + options?.ValueChanged?.Invoke(subscribeOptions.Value); + }); + + _subscribeChannels.Add(channel); + } + } + } + } + + private void Publish(string key, SubscribeOperation operation, T? value = default) + { + var channel = FormatSubscribeChannel(key); + _distributedClient.Publish(channel, subscribeOptions => + { + subscribeOptions.Key = FormatMemoryCacheKey(key); + subscribeOptions.Operation = operation; + subscribeOptions.Value = value; + }); + } + + private async Task PublishAsync(string key, SubscribeOperation operation, T? value = default) + { + var channel = FormatSubscribeChannel(key); + await _distributedClient.PublishAsync(channel, subscribeOptions => + { + subscribeOptions.Key = FormatMemoryCacheKey(key); + subscribeOptions.Operation = operation; + subscribeOptions.Value = value; + }); + } + + private void PubSub(string key, SubscribeOperation operation, T? value, CombinedCacheEntryOptions? options = null) + { + var channel = FormatSubscribeChannel(key); + + if (!options?.IgnoreSubscribe ?? true) + { + Subscribe(channel, options); + } + + _distributedClient.Publish(channel, subscribeOptions => + { + subscribeOptions.Key = FormatMemoryCacheKey(key); + subscribeOptions.Operation = operation; + subscribeOptions.Value = value; + }); + } + + private async Task PubSubAsync(string key, SubscribeOperation operation, T? value=default, + CombinedCacheEntryOptions? options = null) + { + var channel = FormatSubscribeChannel(key); + + Subscribe(channel, options); + + await _distributedClient.PublishAsync(channel, subscribeOptions => + { + subscribeOptions.Key = FormatMemoryCacheKey(key); + subscribeOptions.Operation = operation; + subscribeOptions.Value = value; + }); + } + + private string FormatMemoryCacheKey(string key) => SubscribeHelper.FormatMemoryCacheKey(key); + + private string FormatSubscribeChannel(string key) => + SubscribeHelper.FormatSubscribeChannel(key, _subscribeKeyType, _subscribeKeyPrefix); + + private void Set(string key, T value, MemoryCacheEntryOptions? options = null) + { + var formattedKey = FormatMemoryCacheKey(key); + if (options == null) + { + _cache.Set(formattedKey, value); + } + else + { + _cache.Set(formattedKey, value, options); + } + } + + /// + public void Dispose() + { + _cache.Dispose(); + _distributedClient.Dispose(); + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs new file mode 100644 index 000000000..981b2e2ea --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactory.cs @@ -0,0 +1,63 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory; + +public class MemoryCacheClientFactory : IMemoryCacheClientFactory +{ + private readonly IServiceProvider _services; + + private readonly IOptionsMonitor _optionsMonitor; + + private readonly ConcurrentDictionary> _clients; + + private readonly Func> _clientFactory; + + public MemoryCacheClientFactory(IServiceProvider services, IOptionsMonitor optionsMonitor) + { + ArgumentNullException.ThrowIfNull(services); + + ArgumentNullException.ThrowIfNull(optionsMonitor); + + _services = services; + + _optionsMonitor = optionsMonitor; + + _clients = new ConcurrentDictionary>(); + + _clientFactory = (name) => + { + return new Lazy(() => + { + return CreateClientHandler(name); + }); + }; + } + + public MemoryCacheClient CreateClient(string name) + { + ArgumentNullException.ThrowIfNull(name); + + var client = _clients.GetOrAdd(name, _clientFactory); + + return client.Value; + } + + internal MemoryCacheClient CreateClientHandler(string name) + { + var options = _optionsMonitor.Get(name); + + if (options == null) + { + throw new ArgumentException("No matching client found!"); + } + + var memoryCache = new MemoryCache(Options.Create(options)); + + var factory = _services.GetRequiredService(); + + var distributedCacheClient = factory.CreateClient(name); + + return new MemoryCacheClient(memoryCache, distributedCacheClient, options.SubscribeKeyType, options.SubscribeKeyPrefix); + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs new file mode 100644 index 000000000..864754853 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/MemoryCacheClientFactoryExtensions.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory; + +/// +/// Extension methods for . +/// +public static class MemoryCacheClientFactoryExtensions +{ + /// + /// Creates a new using the default configuration. + /// + /// The . + /// An configured using the default configuration. + public static IMemoryCacheClient CreateClient(this IMemoryCacheClientFactory factory) + { + if (factory == null) + { + throw new ArgumentNullException(nameof(factory)); + } + + return factory.CreateClient(string.Empty); + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs new file mode 100644 index 000000000..c645980ee --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/Models/MasaMemoryCacheOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.DistributedMemory.Models; + +/// +/// The MASA memory cache options. +/// +public class MasaMemoryCacheOptions : MemoryCacheOptions +{ + /// + /// Gets or sets the . + /// + public SubscribeKeyTypes SubscribeKeyType { get; set; } = SubscribeKeyTypes.ValueTypeFullNameAndKey; + + /// + /// Gets or sets the prefix of subscribe key. + /// + public string SubscribeKeyPrefix { get; set; } = string.Empty; +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs new file mode 100644 index 000000000..8b254372c --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.DistributedMemory/_Imports.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caching.Core.DependencyInjection; +global using Masa.Utils.Caching.Core.Helpers; +global using Masa.Utils.Caching.Core.Interfaces; +global using Masa.Utils.Caching.Core.Models; +global using Masa.Utils.Caching.DistributedMemory.Interfaces; +global using Masa.Utils.Caching.DistributedMemory.Models; +global using Microsoft.Extensions.Caching.Distributed; +global using Microsoft.Extensions.Caching.Memory; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Options; +global using System.Collections.Concurrent; diff --git a/src/Utils/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj b/src/Utils/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Memory/Masa.Utils.Caching.Memory.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs b/src/Utils/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs new file mode 100644 index 000000000..015e66240 --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Memory/MemoryCache.cs @@ -0,0 +1,110 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caching.Memory; + +public class MemoryCache : IDisposable where TKey : notnull +{ + private ConcurrentDictionary> _dicCache = new(); + + public TKey[] Keys + { + get + { + return _dicCache.Keys.ToArray(); + } + } + + public TValue[] Values + { + get + { + return _dicCache.Values.Select(value => value.Value).ToArray(); + } + } + + public bool Get(TKey key, out TValue? value) + { + bool result = _dicCache.TryGetValue(key, out var lazyValue); + value = lazyValue == null ? default : lazyValue.Value; + + return result; + } + + public bool TryGet(TKey key, out TValue? value) + { + var result = _dicCache.TryGetValue(key, out var lazyValue); + + if (result) + { + value = lazyValue == null ? default :lazyValue.Value; + } + else + { + value = default; + } + + return result; + } + + public bool TryAdd(TKey key, Func valueFactory) + { + return _dicCache.TryAdd(key, new Lazy(() => valueFactory(key), LazyThreadSafetyMode.ExecutionAndPublication)); + } + + public TValue GetOrAdd(TKey key, Func valueFactory) + { + if (!_dicCache.TryGetValue(key, out var lazyValue)) + { + lazyValue = _dicCache.GetOrAdd(key, k => new Lazy(() => valueFactory(k), LazyThreadSafetyMode.ExecutionAndPublication)); + } + + return lazyValue.Value; + } + + /// + /// Updates the value associated with key to newValue if the existing value with key is equal to comparisonValue. + /// + /// The key of the value that is compared with comparisonValue and possibly replaced. + /// The value that replaces the value of the element that has the specified key if the comparison results in equality. + /// The value that is compared with the value of the element that has the specified key. + /// true if the value with key was equal to comparisonValue and was replaced with newValue; otherwise, false. + public bool TryUpdate(TKey key, Func valueFactory, TValue comparisonValue) + { + return _dicCache.TryUpdate( + key, + new Lazy(() => valueFactory(key), LazyThreadSafetyMode.ExecutionAndPublication), + new Lazy(() => comparisonValue, LazyThreadSafetyMode.ExecutionAndPublication) + ); + } + + public TValue AddOrUpdate(TKey key, Func valueFactory) + { + return _dicCache.AddOrUpdate + ( + key, + k => new Lazy(() => valueFactory(k), LazyThreadSafetyMode.ExecutionAndPublication), + (oldkey, _) => new Lazy(() => valueFactory(oldkey), LazyThreadSafetyMode.ExecutionAndPublication) + ).Value; + } + + public bool Remove(TKey key) + { + return _dicCache.TryRemove(key, out _); + } + + public bool ContainsKey(TKey key) + { + return _dicCache.ContainsKey(key); + } + + public void Clear() + { + _dicCache.Clear(); + } + + public void Dispose() + { + _dicCache.Clear(); + } +} diff --git a/src/Utils/Caching/Masa.Utils.Caching.Memory/_Imports.cs b/src/Utils/Caching/Masa.Utils.Caching.Memory/_Imports.cs new file mode 100644 index 000000000..5b736fb9c --- /dev/null +++ b/src/Utils/Caching/Masa.Utils.Caching.Memory/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.Collections.Concurrent; diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs new file mode 100644 index 000000000..abf252544 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/AbstractCallerProvider.cs @@ -0,0 +1,391 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public abstract class AbstractCallerProvider : ICallerProvider +{ + private readonly ITypeConvertProvider _typeConvertProvider; + public readonly IServiceProvider ServiceProvider; + + private IRequestMessage? _requestMessage; + private IResponseMessage? _responseMessage; + protected IRequestMessage RequestMessage => _requestMessage ??= ServiceProvider.GetRequiredService(); + protected IResponseMessage ResponseMessage => _responseMessage ??= ServiceProvider.GetRequiredService(); + + public AbstractCallerProvider(IServiceProvider serviceProvider) + { + _typeConvertProvider = serviceProvider.GetRequiredService(); + ServiceProvider = serviceProvider; + } + + public virtual async Task SendAsync( + HttpRequestMessage request, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var response = await SendAsync(request, cancellationToken); + if (autoThrowUserFriendlyException) + await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + + return response; + } + + public abstract Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + public abstract Task CreateRequestAsync( + HttpMethod method, + string? methodName); + + public abstract Task CreateRequestAsync( + HttpMethod method, + string? methodName, + TRequest data); + + public abstract Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName); + request.Content = content; + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(method, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public abstract Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default); + + public abstract Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default) + where TResponse : IMessage, new(); + + public abstract Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage; + + public abstract Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage + where TResponse : IMessage, new(); + + public virtual async Task GetStringAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsStringAsync(cancellationToken); + } + + public virtual Task GetStringAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetStringAsync( + GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetStringAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetStringAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetByteArrayAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsByteArrayAsync(cancellationToken); + } + + public virtual Task GetByteArrayAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetByteArrayAsync( + GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetByteArrayAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetByteArrayAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetStreamAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + HttpResponseMessage content = await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + return await content.Content.ReadAsStreamAsync(cancellationToken); + } + + public virtual Task GetStreamAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class + => GetStreamAsync( + GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data)), + autoThrowUserFriendlyException, + cancellationToken); + + public virtual Task GetStreamAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetStreamAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual Task GetAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Get, methodName, null, autoThrowUserFriendlyException, cancellationToken); + + public virtual Task GetAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => GetAsync(GetUrl(methodName, data), autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task GetAsync( + string? methodName, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, methodName); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) where TRequest : class + { + HttpRequestMessage request = + await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data))); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = + await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, _typeConvertProvider.ConvertToKeyValuePairs(data))); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task GetAsync( + string? methodName, + Dictionary data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Get, GetUrl(methodName, data)); + return await SendAsync(request, cancellationToken); + } + + protected virtual string GetUrl(string? url, IEnumerable> properties) + { + url ??= string.Empty; + foreach (var property in properties) + { + string value = property.Value; + + url = !url.Contains("?") ? + $"{url}?{property.Key}={value}" : + $"{url}&{property.Key}={value}"; + } + + return url; + } + + public virtual Task PostAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Post, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PostAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PostAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PostAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task PatchAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Patch, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PatchAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Patch, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PatchAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PatchAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + HttpRequestMessage request = await CreateRequestAsync(HttpMethod.Post, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task PutAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Put, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task PutAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task PutAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task PutAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Put, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual Task DeleteAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + => SendAsync(HttpMethod.Delete, methodName, content, autoThrowUserFriendlyException, cancellationToken); + + public virtual async Task DeleteAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, autoThrowUserFriendlyException, cancellationToken); + } + + public virtual async Task DeleteAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, cancellationToken); + } + + public virtual async Task DeleteAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default) + { + var request = await CreateRequestAsync(HttpMethod.Delete, methodName, data); + return await SendAsync(request, cancellationToken); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs new file mode 100644 index 000000000..11d8d1a36 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/AddCallerExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class AddCallerExtensions +{ + public static void AddCaller(CallerOptions callerOptions, string name, bool isDefault, Func func) + { + if (callerOptions.Callers.Any(c => c.Name == name)) + throw new ArgumentException($"The caller name already exists, please change the name, the repeat name is {name}"); + + callerOptions.Callers.Add(new CallerRelations(name, isDefault, func)); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/CallerBase.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/CallerBase.cs new file mode 100644 index 000000000..d09453db8 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/CallerBase.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public abstract class CallerBase +{ + public virtual string Name { get; set; } = string.Empty; + + protected CallerOptions CallerOptions { get; private set; } = default!; + + private ICallerProvider? _callerProvider; + + protected ICallerProvider CallerProvider => _callerProvider ??= ServiceProvider.GetRequiredService().CreateClient(Name); + + private IServiceProvider ServiceProvider { get; } + + protected CallerBase(IServiceProvider serviceProvider) + { + ServiceProvider = serviceProvider; + } + + public abstract void UseCallerExtension(); + + public void SetCallerOptions(CallerOptions options, string name) + { + CallerOptions = options; + if (string.IsNullOrEmpty(Name)) + Name = name; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/CallerOptions.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/CallerOptions.cs new file mode 100644 index 000000000..61ccb5535 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/CallerOptions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class CallerOptions +{ + internal readonly List Callers = new(); + + public IServiceCollection Services { get; } + + private Assembly[] _assemblies = AppDomain.CurrentDomain.GetAssemblies(); + + public Assembly[] Assemblies + { + get => _assemblies; + set + { + ArgumentNullException.ThrowIfNull(value, nameof(Assemblies)); + + _assemblies = value; + } + } + + public ServiceLifetime CallerLifetime { get; set; } + + public JsonSerializerOptions? JsonSerializerOptions { get; set; } + + public string RequestIdKey { get; set; } = "Masa-Request-Id"; + + public CallerOptions(IServiceCollection services) + { + Services = services; + CallerLifetime = ServiceLifetime.Scoped; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs new file mode 100644 index 000000000..2f8c1a3c2 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultCallerFactory.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +internal class DefaultCallerFactory : ICallerFactory +{ + private readonly IServiceProvider _serviceProvider; + private readonly List _callers; + + public DefaultCallerFactory(IServiceProvider serviceProvider, CallerOptions options) + { + _serviceProvider = serviceProvider; + _callers = options.Callers; + } + + public ICallerProvider CreateClient() + { + var caller = _callers.SingleOrDefault(c => c.IsDefault) ?? _callers.FirstOrDefault()!; + return caller.Func.Invoke(_serviceProvider); + } + + public ICallerProvider CreateClient(string name) + { + var caller = _callers.SingleOrDefault(c => c.Name == name); + if (caller == null) + throw new NotSupportedException($"Please make sure you have used [{name}] Caller"); + + return caller.Func.Invoke(_serviceProvider); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs new file mode 100644 index 000000000..cc232ed08 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultRequestIdGenerator.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class DefaultRequestIdGenerator : IRequestIdGenerator +{ + public string NewId() => Guid.NewGuid().ToString(); +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs new file mode 100644 index 000000000..300462c30 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultRequestMessage.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public abstract class DefaultRequestMessage +{ + private readonly string _requestIdKey; + private readonly IRequestIdGenerator _requestIdGenerator; + private readonly IHttpContextAccessor? _httpContextAccessor; + + public DefaultRequestMessage(string requestIdKey, IRequestIdGenerator requestIdGenerator, + IHttpContextAccessor? httpContextAccessor = null) + { + _requestIdKey = requestIdKey; + _requestIdGenerator = requestIdGenerator; + _httpContextAccessor = httpContextAccessor; + } + + protected void TrySetRequestId(HttpRequestMessage requestMessage) + { + var httpContext = _httpContextAccessor?.HttpContext; + if (httpContext == null) + return; + + if (!httpContext.Request.Headers.TryGetValue(_requestIdKey, out var requestId)) + requestId = _requestIdGenerator.NewId(); + + if (requestMessage.Headers.All(h => h.Key != _requestIdKey)) + requestMessage.Headers.Add(_requestIdKey, requestId.ToString()); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs new file mode 100644 index 000000000..7f50faa39 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultResponseMessage.cs @@ -0,0 +1,92 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class DefaultResponseMessage : IResponseMessage +{ + private readonly ILogger? _logger; + private readonly CallerOptions _callerOptions; + + public DefaultResponseMessage(CallerOptions callerOptions, ILogger? logger = null) + { + _callerOptions = callerOptions; + _logger = logger; + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, + CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case HttpStatusCode.Accepted: + case HttpStatusCode.NoContent: + return default; + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + return (TResponse)Convert.ChangeType(content, typeof(TResponse)); + } + try + { + return await response.Content.ReadFromJsonAsync(_callerOptions.JsonSerializerOptions, cancellationToken) + ?? throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); + } + catch (Exception exception) + { + _logger?.LogWarning(exception, exception.Message); + ExceptionDispatchInfo.Capture(exception).Throw(); + return default; //This will never be executed, the previous line has already thrown an exception + } + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + return default; //never executed + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + return; + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + } + + public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.Content.Headers.ContentLength is > 0) + throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); + + throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs new file mode 100644 index 000000000..39a57bb2c --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/DefaultTypeConvertProvider.cs @@ -0,0 +1,98 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class DefaultTypeConvertProvider : ITypeConvertProvider +{ + private static readonly ConcurrentDictionary> Dictionary = new(); + + protected readonly List NotNeedSerializeTypes = new() + { + typeof(String), + typeof(Guid), + typeof(DateTime), + typeof(Decimal), + typeof(Guid?), + typeof(DateTime?), + typeof(Decimal?) + }; + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + [Obsolete("Use ConvertToKeyValuePairs instead")] + public Dictionary ConvertToDictionary(TRequest request) where TRequest : class + => new(ConvertToKeyValuePairs(request)); + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + public IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class + { + if (request.Equals(null)) + return Array.Empty>(); + + if (request is Dictionary response) + return response; + + if (request is IEnumerable> keyValuePairs) + return keyValuePairs; + + var requestType = request.GetType(); + if (!Dictionary.TryGetValue(requestType, out List? members)) + { + members = GetMembers(request.GetType().GetProperties()); + Dictionary.TryAdd(requestType, members); + } + List> data = new List>(); + foreach (var member in members) + { + if (member.TryGetValue(request, out string value)) + data.Add(new KeyValuePair(member.Name, value)); + } + return data; + } + + private List GetMembers(PropertyInfo[] properties) + { + List members = new(); + foreach (var property in properties) + { + if (IsSkip(property)) continue; + + string name = GetPropertyName(property); + + members.Add(new PropertyInfoMember(property, name, IsNeedSerialize(property))); + } + return members; + } + + protected bool IsSkip(PropertyInfo property) + => !property.CanRead || + !property.PropertyType.IsPublic || + property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonIgnoreAttribute)); + + protected string GetPropertyName(PropertyInfo property) + { + if (property.CustomAttributes.Any(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))) + { + var customAttributeData = + property.CustomAttributes.FirstOrDefault(attr => attr.AttributeType == typeof(JsonPropertyNameAttribute))!; + var customAttribute = customAttributeData.ConstructorArguments.FirstOrDefault(); + return customAttribute.Value?.ToString() ?? + throw new NotSupportedException( + $"Parameter name: {property.Name}, But the JsonPropertyNameAttribute assignment name is empty"); + } + return property.Name; + } + + protected bool IsNeedSerialize(PropertyInfo property) + => !property.PropertyType.IsPrimitive && !NotNeedSerializeTypes.Contains(property.PropertyType); +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs new file mode 100644 index 000000000..12013c0a1 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/ICallerFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface ICallerFactory +{ + ICallerProvider CreateClient(); + + ICallerProvider CreateClient(string name); +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs new file mode 100644 index 000000000..a77a3df09 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/ICallerProvider.cs @@ -0,0 +1,219 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface ICallerProvider +{ + Task SendAsync( + HttpRequestMessage request, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpRequestMessage request, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task SendAsync( + HttpMethod method, + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default); + + Task SendGrpcAsync( + string methodName, + CancellationToken cancellationToken = default) + where TResponse : IMessage, new(); + + Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage; + + Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + where TRequest : IMessage + where TResponse : IMessage, new(); + + Task GetStringAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStringAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetStringAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetByteArrayAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetByteArrayAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetByteArrayAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStreamAsync(string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetStreamAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default) where TRequest : class; + + Task GetStreamAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + Dictionary data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + CancellationToken cancellationToken = default); + + Task GetAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default) + where TRequest : class; + + Task GetAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task GetAsync(string? methodName, Dictionary data, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PostAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PatchAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + TRequest data, + CancellationToken cancellationToken = default); + + Task PutAsync( + string? methodName, + object data, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + string? methodName, + HttpContent? content, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task DeleteAsync( + string? methodName, + TRequest data, + bool autoThrowUserFriendlyException = true, + CancellationToken cancellationToken = default); + + Task DeleteAsync(string? methodName, TRequest data, CancellationToken cancellationToken = default); + + Task DeleteAsync(string? methodName, object data, CancellationToken cancellationToken = default); +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs new file mode 100644 index 000000000..d542a95b7 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/IRequestIdGenerator.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface IRequestIdGenerator +{ + string NewId(); +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs new file mode 100644 index 000000000..2686fef7d --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/IRequestMessage.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface IRequestMessage +{ + Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage); + + Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data); +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs new file mode 100644 index 000000000..183320451 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/IResponseMessage.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface IResponseMessage +{ + Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); + + Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default); +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs new file mode 100644 index 000000000..25fc03873 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/ITypeConvertProvider.cs @@ -0,0 +1,24 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public interface ITypeConvertProvider +{ + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + [Obsolete("Use ConvertToKeyValuePairs instead")] + Dictionary ConvertToDictionary(TRequest request) where TRequest : class; + + /// + /// Convert custom object to dictionary + /// + /// + /// Support classes, anonymous objects + /// + IEnumerable> ConvertToKeyValuePairs(TRequest request) where TRequest : class; +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs new file mode 100644 index 000000000..0e9c441c0 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/CallerDependExtensions.cs @@ -0,0 +1,89 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Internal; + +/// +/// Caller dependency orchestration +/// +internal static class CallerDependExtensions +{ + /// + /// Caller dependency orchestration + /// + /// All Callers that inherit CallerBase + /// + /// + public static List Arrangement(this List callerTypes) + { + List types = GetCallerByNotDependCaller(callerTypes); + if (types.Count == 0) + throw new UserFriendlyException(Const.CIRCULAR_DEPENDENCY); + + return callerTypes.CallersArrangement(types, 1); + } + + private static List CallersArrangement(this List allTypes, List existTypes, int executeTimes) + { + List types = existTypes; + var dependCallerTypes = allTypes.Except(existTypes); + foreach (var type in dependCallerTypes) + { + var constructorInfo = type.GetConstructors().MaxBy(con => con.GetParameters().Length)!; + bool isExist = true; + foreach (var parameter in constructorInfo.GetParameters()) + { + var parameterType = parameter.ParameterType; + if (typeof(CallerBase).IsAssignableFrom(parameterType) && !types.Contains(parameterType)) + { + isExist = false; + } + } + if (isExist) + types.Add(type); + } + + if (types.Count != allTypes.Count) + { + if (executeTimes >= allTypes.Count) + throw new UserFriendlyException(Const.CIRCULAR_DEPENDENCY); + + return CallersArrangement(allTypes, types, ++executeTimes); + } + return types; + } + + /// + /// Get a Caller object that does not depend on other Callers + /// + /// + /// + private static List GetCallerByNotDependCaller(this List callerTypes) + { + List types = new(); + callerTypes.ForEach(type => + { + if (!type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance).IsDependCaller()) + types.Add(type); + }); + return types; + } + + private static bool IsDependCaller(this ConstructorInfo[] constructorInfos) + { + var constructorInfo = constructorInfos.MaxBy(constructorInfo => constructorInfo.GetParameters().Length)!; + return constructorInfo.IsDependCaller(); + } + + private static bool IsDependCaller(this ConstructorInfo constructorInfo) + { + foreach (var parameter in constructorInfo.GetParameters()) + { + if (typeof(CallerBase).IsAssignableFrom(parameter.ParameterType)) + { + return true; + } + } + return false; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs new file mode 100644 index 000000000..1724865fe --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/CallerRelations.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Internal; + +internal class CallerRelations +{ + public string Name { get; } = default!; + + public bool IsDefault { get; } + + public Func Func { get; } = default!; + + public CallerRelations(string name, bool isDefault, Func func) + { + Name = name; + IsDefault = isDefault; + Func = func; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/Const.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/Const.cs new file mode 100644 index 000000000..191ba6c15 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/Const.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Internal; + +internal class Const +{ + public const string CIRCULAR_DEPENDENCY = "Caller has a circular dependency, please check the constructor of Caller"; +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs new file mode 100644 index 000000000..3958e6f4d --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/Internal/Options/PropertyInfoMember.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core.Internal.Options; + +internal class PropertyInfoMember +{ + public PropertyInfo Property { get; } + + public string Name { get; } + + public bool NeedSerialize { get; } + + public PropertyInfoMember(PropertyInfo property, string name, bool needSerialize) + { + Property = property; + Name = name; + NeedSerialize = needSerialize; + } + + public bool TryGetValue(TRequest data, out string value) where TRequest : class + { + value = string.Empty; + var propertyValue = Property.GetValue(data); + if (propertyValue == null || (!NeedSerialize && propertyValue.ToString() == null)) + return false; + + value = !NeedSerialize ? propertyValue.ToString()! : JsonSerializer.Serialize(propertyValue); + return true; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs new file mode 100644 index 000000000..004c4e081 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/JsonRequestMessage.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Core; + +public class JsonRequestMessage : DefaultRequestMessage, IRequestMessage +{ + private readonly JsonSerializerOptions? _jsonSerializerOptions; + + public JsonRequestMessage( + CallerOptions callerOptions, + IRequestIdGenerator requestIdGenerator, + IHttpContextAccessor? httpContextAccessor = null) + : base(callerOptions.RequestIdKey, requestIdGenerator, httpContextAccessor) + => _jsonSerializerOptions = callerOptions.JsonSerializerOptions; + + public virtual Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) + { + TrySetRequestId(requestMessage); + return Task.FromResult(requestMessage); + } + + public virtual async Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) + { + requestMessage = await ProcessHttpRequestMessageAsync(requestMessage); + requestMessage.Content = JsonContent.Create(data, options: _jsonSerializerOptions); + return requestMessage; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj b/src/Utils/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj new file mode 100644 index 000000000..9488b24bd --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/Masa.Utils.Caller.Core.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/README.md b/src/Utils/Caller/Masa.Utils.Caller.Core/README.md new file mode 100644 index 000000000..3b35bcdb2 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/README.md @@ -0,0 +1,36 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Caller.Core + +Masa.Utils.Caller.Core is the basic class library of Caller, which provides the abstraction of the following capabilities + +* `ICallerFactory`: Factory for creating `CallerProvider` (Singleton) +* `ICallerProvider`: Provides `Post`, `Delete`, `Patch`, `Put`, `Get`, `Send` capabilities (Scoped) +* `IRequestMessage`: Provides the ability to process request data (default implementation [`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) +* `IResponseMessage`: Provides the ability to handle response data (default implementation [`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) +* `ITypeConvertProvider`: Provides the ability to convert types, support for `Get` requests of `ICallerProvider` (Singleton) + +## Summarize + +`Masa.Utils.Caller.Core` is the basic class library of Caller, but it cannot be used alone. Currently, Caller supports two implementations: + +* Implementation based on HttpClient: [Masa.Utils.Caller.HttpClient](../Masa.Utils.Caller.HttpClient/README.md) +* Implementation based on DaprClient: [Masa.Utils.Caller.DaprClient](../Masa.Utils.Caller.DaprClient/README.md) + +> Q: What should I do if the callee uses xml instead of json? +> +> A: Rewrite IRequestMessage and add the custom RequestMessage to the IServiceCollection before calling AddCaller + + ```` C# + services.AddSingleton(); + services.AddCaller(); + ```` + +> Q: If you want to handle custom StatusCode and throw exception information +> +> A: Rewrite IResponseMessage, add custom ResponseMessage to IServiceCollection before calling AddCaller + + ```` C# + services.AddSingleton(); + services.AddCaller(); + ```` \ No newline at end of file diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/README.zh-CN.md b/src/Utils/Caller/Masa.Utils.Caller.Core/README.zh-CN.md new file mode 100644 index 000000000..e4148a140 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/README.zh-CN.md @@ -0,0 +1,36 @@ +中 | [EN](README.md) + +## Masa.Utils.Caller.Core + +Masa.Utils.Caller.Core是Caller的基础类库,提供了以下能力的抽象 + +* `ICallerFactory`: 工厂,用于创建`CallerProvider` (Singleton) +* `ICallerProvider`: 提供`Post`、`Delete`、`Patch`、`Put`、`Get`、`Send`的能力 (Scoped) +* `IRequestMessage`: 提供对请求数据处理的能力 (默认实现[`JsonRequestMessage`](./JsonRequestMessage.cs)) (Singleton) +* `IResponseMessage`: 提供对响应数据处理的能力 (默认实现[`DefaultResponseMessage`](./DefaultResponseMessage.cs)) (Singleton) +* `ITypeConvertProvider`: 提供类型转换的能力,为`ICallerProvider`的`Get`请求支撑 (Singleton) + +## 总结 + +`Masa.Utils.Caller.Core`是Caller的基础类库,但不能单独使用,目前Caller支持了两种实现方式: + +* 基于HttpClient的实现: [Masa.Utils.Caller.HttpClient](../Masa.Utils.Caller.HttpClient/README.zh-CN.md) +* 基于DaprClient的实现: [Masa.Utils.Caller.DaprClient](../Masa.Utils.Caller.DaprClient/README.zh-CN.md) + +> Q: 如果被调用方使用的是数据格式为xml,而不是json,我应该怎么做? +> +> A: 重写IRequestMessage,在调用AddCaller之前先将自定义的RequestMessage添加到IServiceCollection中 + + ``` C# + services.AddSingleton(); + services.AddCaller(); + ``` + +> Q: 如果希望处理自定义的StatusCode,并抛出异常信息 +> +> A: 重写IResponseMessage,在调用AddCaller之前先将自定义的ResponseMessage添加到IServiceCollection中 + + ``` C# + services.AddSingleton(); + services.AddCaller(); + ``` \ No newline at end of file diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..fa23ee27c --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/ServiceCollectionExtensions.cs @@ -0,0 +1,105 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddCaller(this IServiceCollection services) + => services.AddCaller(AppDomain.CurrentDomain.GetAssemblies()); + + public static IServiceCollection AddCaller(this IServiceCollection services, params Assembly[] assemblies) + => services.AddCaller(options => options.Assemblies = assemblies); + + private static IServiceCollection AddCaller(this IServiceCollection services, + ServiceLifetime lifetime = ServiceLifetime.Scoped, + params Assembly[] assemblies) + => services.AddCaller(options => + { + options.Assemblies = assemblies; + options.CallerLifetime = lifetime; + }); + + public static IServiceCollection AddCaller(this IServiceCollection services, Action options) + { + CallerOptions callerOption = new CallerOptions(services); + options.Invoke(callerOption); + + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + services.TryAddScoped(serviceProvider => serviceProvider.GetRequiredService().CreateClient()); + + services.TryAddSingleton(); + services.AddAutomaticCaller(callerOption); + TryOrUpdateCallerOptions(services, callerOption); + return services; + } + + private static IServiceCollection TryOrUpdateCallerOptions(this IServiceCollection services, CallerOptions options) + { + services.TryAddSingleton(new CallerOptions(options.Services)); + var serviceProvider = services.BuildServiceProvider(); + var callerOptions = serviceProvider.GetRequiredService(); + + options.Callers.ForEach(caller => + { + if (callerOptions.Callers.Any(relation => relation.Name == caller.Name)) + throw new ArgumentException( + $"The caller name already exists, please change the name, the repeat name is [{caller.Name}]"); + + if (callerOptions.Callers.Any(relation => relation.IsDefault && caller.IsDefault)) + { + string errorCallerNames = string.Join("、", callerOptions.Callers + .Where(relation => relation.IsDefault) + .Select(relation => relation.Name) + .Concat(options.Callers.Where(relation => relation.IsDefault).Select(relation => relation.Name)) + .Distinct()); + throw new ArgumentException( + $"There can only be at most one default Caller Provider, and now the following Caller Providers are found to be default: {errorCallerNames}"); + } + + callerOptions.Callers.Add(caller); + }); + + return services; + } + + private static void AddAutomaticCaller(this IServiceCollection services, CallerOptions callerOptions) + { + var callerTypes = callerOptions.Assemblies.SelectMany(x => x.GetTypes()) + .Where(type => typeof(CallerBase).IsAssignableFrom(type) && !type.IsAbstract).ToList(); + + callerTypes = callerTypes.Except(services.Select(d => d.ServiceType)).ToList(); + + if (callerTypes.Count == 0) + return; + + + callerTypes.Arrangement().ForEach(type => + { + ServiceDescriptor serviceDescriptor = new ServiceDescriptor(type, serviceProvider => + { + var constructorInfo = type.GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) + .MaxBy(constructor => constructor.GetParameters().Length)!; + List parameters = new(); + foreach (var parameter in constructorInfo.GetParameters()) + { + parameters.Add(serviceProvider.GetRequiredService(parameter.ParameterType)); + } + var callerBase = (constructorInfo.Invoke(parameters.ToArray()) as CallerBase)!; + callerBase.SetCallerOptions(callerOptions, type.FullName ?? type.Name); + return callerBase; + }, callerOptions.CallerLifetime); + services.TryAdd(serviceDescriptor); + }); + + var serviceProvider = services.BuildServiceProvider(); + callerTypes.ForEach(type => + { + var callerBase = (CallerBase)serviceProvider.GetRequiredService(type); + callerBase.UseCallerExtension(); + }); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/_Imports.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/_Imports.cs new file mode 100644 index 000000000..95fdf3d27 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/_Imports.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Google.Protobuf; +global using Masa.Utils.Caller.Core; +global using Masa.Utils.Caller.Core.Internal; +global using Masa.Utils.Caller.Core.Internal.Options; +global using Masa.Utils.Exceptions; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using System.Collections.Concurrent; +global using System.Net; +global using System.Net.Http.Json; +global using System.Reflection; +global using System.Runtime.ExceptionServices; +global using System.Text.Json; +global using System.Text.Json.Serialization; +global using Microsoft.AspNetCore.Http; diff --git a/src/Utils/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs new file mode 100644 index 000000000..561c8a73c --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/CallerOptionsExtensions.cs @@ -0,0 +1,40 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.DaprClient; + +public static class CallerOptionsExtensions +{ + public static CallerOptions UseDapr(this CallerOptions callerOptions, Func clientBuilder) + { + if (clientBuilder == null) + throw new ArgumentNullException(nameof(clientBuilder)); + + MasaDaprClientBuilder builder = clientBuilder.Invoke(); + if (clientBuilder == null) + throw new ArgumentNullException(nameof(clientBuilder)); + + callerOptions.Services.AddDaprClient(daprClientBuilder => + { + if (callerOptions.JsonSerializerOptions != null) + daprClientBuilder.UseJsonSerializationOptions(callerOptions.JsonSerializerOptions); + + builder.Configure?.Invoke(daprClientBuilder); + }); + + AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, + serviceProvider => new DaprCallerProvider(serviceProvider, builder.AppId)); + return callerOptions; + } + + public static CallerOptions UseDapr(this CallerOptions callerOptions, Action clientBuilder) + { + if (clientBuilder == null) + throw new ArgumentNullException(nameof(clientBuilder)); + + MasaDaprClientBuilder builder = new MasaDaprClientBuilder(); + clientBuilder.Invoke(builder); + + return callerOptions.UseDapr(() => builder); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs new file mode 100644 index 000000000..b882ec689 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/DaprCallerBase.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.DaprClient; + +public abstract class DaprCallerBase : CallerBase +{ + protected abstract string AppId { get; set; } + + public virtual Action? Configure { get; set; } = null; + + protected DaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public override void UseCallerExtension() => UseDapr(); + + protected virtual void UseDapr() + { + CallerOptions.UseDapr(opt => + { + opt.Name = Name; + opt.AppId = AppId; + if (Configure != null) + { + opt.Configure = Configure; + } + }); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs new file mode 100644 index 000000000..246ea8c8a --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/DaprCallerProvider.cs @@ -0,0 +1,46 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.DaprClient; + +public class DaprCallerProvider : AbstractCallerProvider +{ + private readonly string AppId; + private Dapr.Client.DaprClient? _daprClient; + private Dapr.Client.DaprClient DaprClient => _daprClient ??= ServiceProvider.GetRequiredService(); + + public DaprCallerProvider(IServiceProvider serviceProvider, string appId) + : base(serviceProvider) + => AppId = appId; + + public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + where TResponse : default + { + var response = await DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); + return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + } + + public override Task CreateRequestAsync(HttpMethod method, string? methodName) + => RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName)); + + public override Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) + => RequestMessage.ProcessHttpRequestMessageAsync(DaprClient.CreateInvokeMethodRequest(method, AppId, methodName), data); + + public override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodWithResponseAsync(request, cancellationToken); + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); + + public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, request, cancellationToken); + + public override Task SendGrpcAsync( + string methodName, + TRequest request, + CancellationToken cancellationToken = default) + => DaprClient.InvokeMethodGrpcAsync(AppId, methodName, cancellationToken); +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj new file mode 100644 index 000000000..a8e99bc03 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/Masa.Utils.Caller.DaprClient.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Utils/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs new file mode 100644 index 000000000..eeaf95d33 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/MasaDaprClientBuilder.cs @@ -0,0 +1,70 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.DaprClient; + +public class MasaDaprClientBuilder +{ + private string _appId = default!; + + public string AppId + { + get + { + return _appId; + } + set + { + if (string.IsNullOrEmpty(value)) + throw new ArgumentNullException(nameof(AppId)); + + _appId = value; + } + } + + private string _name = default!; + + public string Name + { + get + { + return _name; + } + set + { + if (value is null) + throw new ArgumentNullException(nameof(Name)); + + _name = value; + } + } + + public bool IsDefault { get; set; } = false; + + public Action? Configure { get; set; } + + internal MasaDaprClientBuilder() + { + this.Name = string.Empty; + } + + public MasaDaprClientBuilder(string appid) + : this(appid, "dapr") { } + + public MasaDaprClientBuilder(string appid, string name) + : this(appid, name, null) + { + } + + public MasaDaprClientBuilder(string appid, string name, Action? configure) : this(appid, name, configure, false) + { + } + + public MasaDaprClientBuilder(string appid, string name, Action? configure, bool isDefault) + { + AppId = appid; + Name = name; + Configure = configure; + IsDefault = isDefault; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.DaprClient/README.md b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/README.md new file mode 100644 index 000000000..0a4543e05 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/README.md @@ -0,0 +1,101 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Caller.DaprClient + +## Example: + +````c# +Install-Package Masa.Utils.Caller.DaprClient +```` + +### Basic usage: + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one Provider, you can not assign a value to Name + clientBuilder.AppId = "" ;//AppID of the callee dapr + }); + }); + ```` + +2. How to use: + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + ```` + + > The interface address of the complete request is: http://localhost:3500/v1.0/invoke//method/Hello?Name={name} + +3. When there are multiple DaprClients, modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller"; + clientBuilder.AppId = "" ;//AppID of the callee User service Dapr + }); + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "OrderCaller"; + clientBuilder.AppId = "" ;//AppID of the callee Order service Dapr + }); + }); + ```` + +4. How to use UserCaller or OrderCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var callerProvider = callerFactory.CreateClient("OrderCaller"); + return callerProvider.GetAsync($"/Hello", new { Name = name }); + }); + ```` + +> When multiple Callers are added, how to get the specified Caller? +>> Get the CallerProvider of the specified alias through the `CreateClient` method of `CallerFactory` +> +> Why doesn't `userCallerProvider` get the corresponding Caller through the `CreateClient` method of `CallerFactory`? +>> If no default ICallerProvider is specified, the default CallerProvider is the first one added in the `AddCaller` method + +### Recommended usage + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(); + ```` + +2. Add a new class `UserCaller` + + ```` C# + public class UserCaller: DaprCallerBase + { + protected override string AppId { get; set; } = ""; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); + } + ```` + +3. How to use UserCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ```` \ No newline at end of file diff --git a/src/Utils/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md new file mode 100644 index 000000000..4a0fd6ff8 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/README.zh-CN.md @@ -0,0 +1,101 @@ +中 | [EN](README.md) + +## Masa.Utils.Caller.DaprClient + +## 用例: + +```c# +Install-Package Masa.Utils.Caller.DaprClient +``` + +### 基本用法: + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个Provider时,可以不对Name赋值 + clientBuilder.AppId = "" ;//被调用方dapr的AppID + }); + }); + ``` + +2. 如何使用: + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + ``` + + > 完整请求的接口地址是:http://localhost:3500/v1.0/invoke//method/Hello?Name={name} + +3. 当存在多个DaprClient时,则修改`Program.cs`为 + + ``` C# + builder.Services.AddCaller(options => + { + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "UserCaller"; + clientBuilder.AppId = "" ;//被调用方User服务Dapr的AppID + }); + options.UseDapr(clientBuilder => + { + clientBuilder.Name = "OrderCaller"; + clientBuilder.AppId = "" ;//被调用方Order服务Dapr的AppID + }); + }); + ``` + +4. 如何使用UserCaller或OrderCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var callerProvider = callerFactory.CreateClient("OrderCaller"); + return callerProvider.GetAsync($"/Hello", new { Name = name }); + }); + ``` + +> 当多个Caller被添加时,如何获取指定的Caller? +>> 通过`CallerFactory`的`CreateClient`方法得到指定别名的CallerProvider +> +> 为什么`userCallerProvider`没有通过`CallerFactory`的`CreateClient`方法得到对应的Caller? +>> 如果未指定默认的ICallerProvider,则在`AddCaller`方法中第一个被添加的就是默认的CallerProvider + +### 推荐用法 + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(); + ``` + +2. 新增加类`UserCaller` + + ``` C# + public class UserCaller: DaprCallerBase + { + protected override string AppId { get; set; } = ""; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); + } + ``` + +3. 如何使用UserCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ``` \ No newline at end of file diff --git a/src/Utils/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs new file mode 100644 index 000000000..2290a94b0 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.DaprClient/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Dapr.Client; +global using Masa.Utils.Caller.Core; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs new file mode 100644 index 000000000..68e578d4b --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/CallerOptionsExtensions.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.HttpClient; + +public static class CallerOptionsExtensions +{ + public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Func? clientBuilder = null) + { + var builder = clientBuilder == null ? new MasaHttpClientBuilder() : clientBuilder.Invoke(); + var httpClientBuilder = callerOptions.Services.AddHttpClient(builder.Name, httpClient + => builder.ConfigureHttpClient(httpClient)); + + AddCallerExtensions.AddCaller(callerOptions, builder.Name, builder.IsDefault, serviceProvider + => new HttpClientCallerProvider(serviceProvider, builder.Name, builder.Prefix)); + return httpClientBuilder; + } + + public static IHttpClientBuilder UseHttpClient(this CallerOptions callerOptions, Action? clientBuilder) + { + MasaHttpClientBuilder builder = new MasaHttpClientBuilder(); + clientBuilder?.Invoke(builder); + + return callerOptions.UseHttpClient(() => builder); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs new file mode 100644 index 000000000..6666f9b9b --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerBase.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.HttpClient; + +public abstract class HttpClientCallerBase : CallerBase +{ + protected abstract string BaseAddress { get; set; } + + protected virtual string Prefix { get; set; } = string.Empty; + + protected HttpClientCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public override void UseCallerExtension() => UseHttpClient(); + + protected virtual IHttpClientBuilder UseHttpClient() + { + return CallerOptions.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = Name; + httpClientBuilder.Prefix = Prefix; + httpClientBuilder.BaseAddress = BaseAddress; + httpClientBuilder.Configure = ConfigureHttpClient; + }); + } + + protected virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs new file mode 100644 index 000000000..bd353c3b4 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/HttpClientCallerProvider.cs @@ -0,0 +1,72 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.HttpClient; + +public class HttpClientCallerProvider : AbstractCallerProvider +{ + private readonly System.Net.Http.HttpClient _httpClient; + private readonly string _prefix; + private readonly bool _prefixIsNullOrEmpty; + + public HttpClientCallerProvider(IServiceProvider serviceProvider, string name, string prefix) + : base(serviceProvider) + { + _httpClient = serviceProvider.GetRequiredService().CreateClient(name); + _prefix = prefix; + _prefixIsNullOrEmpty = string.IsNullOrEmpty(_prefix); + } + + public override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + where TResponse : default + { + var response = await _httpClient.SendAsync(request, cancellationToken); + return await ResponseMessage.ProcessResponseAsync(response, cancellationToken); + } + + public override Task CreateRequestAsync(HttpMethod method, string? methodName) + => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName))); + + public override Task CreateRequestAsync(HttpMethod method, string? methodName, TRequest data) + => RequestMessage.ProcessHttpRequestMessageAsync(new HttpRequestMessage(method, GetRequestUri(methodName)), data); + + public override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default) + { + return _httpClient.SendAsync(request, cancellationToken); + } + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SendGrpcAsync(string methodName, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SendGrpcAsync(string methodName, TRequest request, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + public override Task SendGrpcAsync(string methodName, TRequest request, + CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } + + protected virtual string GetRequestUri(string? methodName) + { + if (string.IsNullOrEmpty(methodName)) + return string.Empty; + + if (Uri.IsWellFormedUriString(methodName, UriKind.Absolute) || _prefixIsNullOrEmpty) + return methodName; + + if (_prefix.EndsWith("/")) + return $"{_prefix}{(methodName.StartsWith("/") ? methodName.Substring(1) : methodName)}"; + + return $"{_prefix}{(methodName.StartsWith("/") ? methodName : "/" + methodName)}"; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj new file mode 100644 index 000000000..40c6c2d3e --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + diff --git a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs new file mode 100644 index 000000000..8b7345dd0 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/MasaHttpClientBuilder.cs @@ -0,0 +1,62 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.HttpClient; + +public class MasaHttpClientBuilder +{ + private string _name = default!; + + public string Name + { + get => _name; + set + { + if (value is null) + throw new ArgumentNullException(Name); + + _name = value; + } + } + + [Obsolete($"recommended to use {nameof(BaseAddress)}, {nameof(BaseApi)} has expired")] + public string BaseApi { get => BaseAddress; set => BaseAddress = value; } + + public string BaseAddress { get; set; } + + public string Prefix { get; set; } + + public bool IsDefault { get; set; } = false; + + public Action? Configure { get; set; } + + public MasaHttpClientBuilder() : this("http", null) + { + } + + public MasaHttpClientBuilder(string name, Action? configure) + : this(name, string.Empty, configure) + { + } + + public MasaHttpClientBuilder(string name, string baseAddress, Action? configure) + : this(name, baseAddress, string.Empty, configure) + { + } + + public MasaHttpClientBuilder(string name, string baseAddress, string prefix, Action? configure) + { + Name = name; + BaseAddress = baseAddress; + Prefix = prefix; + Configure = configure; + } + + public virtual void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + if (!string.IsNullOrEmpty(BaseAddress)) + httpClient.BaseAddress = new Uri(BaseAddress); + + Configure?.Invoke(httpClient); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/README.md b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/README.md new file mode 100644 index 000000000..7ad9fe3f6 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/README.md @@ -0,0 +1,110 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Caller.HttpClient + +## Example: + +````c# +Install-Package Masa.Utils.Caller.HttpClient +```` + +### Basic usage: + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "UserCaller";// The alias of the current Caller, when there is only one HttpClient, you can not assign a value to Name + httpClientBuilder.BaseAddress = "http://localhost:5000" ; + }); + }); + ```` + +2. How to use: + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + ```` + + > The interface address of the complete request is: http://localhost:5000/Hello?Name={name} + +3. When there are multiple HttpClients, modify `Program.cs` + + ```` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "UserCaller"; + httpClientBuilder.BaseAddress = "http://localhost:5000" ; + }); + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "OrderCaller"; + httpClientBuilder.BaseAddress = "http://localhost:6000" ; + }); + }); + ```` + +4. How to use UserCaller or OrderCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var callerProvider = callerFactory.CreateClient("OrderCaller"); + return callerProvider.GetAsync($"/Hello", new { Name = name }); + }); + ```` + +> When multiple Callers are added, how to get the specified Caller? +>> Get the CallerProvider of the specified alias through the `CreateClient` method of `CallerFactory` +> +> Why doesn't `userCallerProvider` get the corresponding Caller through the `CreateClient` method of `CallerFactory`? +>> If no default ICallerProvider is specified, the default CallerProvider is the first one added in the `AddCaller` method + +### Recommended usage + +1. Modify `Program.cs` + + ```` C# + builder.Services.AddCaller(); + ```` + +2. Add a new class `UserCaller` + + ```` C# + public class UserCaller: HttpClientCallerBase + { + protected override string BaseAddress { get; set; } = "http://localhost:5000"; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); + + /// + /// There is no need to overload by default, and it can be overloaded when there are special requirements for httpClient + /// + /// + protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + httpClient.Timeout = TimeSpan.FromSeconds(5); + } + } + ```` + +3. How to use UserCaller + + ```` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ```` \ No newline at end of file diff --git a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md new file mode 100644 index 000000000..5b3fac3ab --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/README.zh-CN.md @@ -0,0 +1,110 @@ +中 | [EN](README.md) + +## Masa.Utils.Caller.HttpClient + +## 用例: + +```c# +Install-Package Masa.Utils.Caller.HttpClient +``` + +### 基本用法: + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "UserCaller";// 当前Caller的别名,仅存在一个HttpClient时,可以不对Name赋值 + httpClientBuilder.BaseAddress = "http://localhost:5000" ; + }); + }); + ``` + +2. 如何使用: + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + ``` + + > 完整请求的接口地址是:http://localhost:5000/Hello?Name={name} + +3. 当存在多个HttpClient时,则修改`Program.cs`为 + + ``` C# + builder.Services.AddCaller(options => + { + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "UserCaller"; + httpClientBuilder.BaseAddress = "http://localhost:5000" ; + }); + options.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Name = "OrderCaller"; + httpClientBuilder.BaseAddress = "http://localhost:6000" ; + }); + }); + ``` + +4. 如何使用UserCaller或OrderCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] ICallerProvider userCallerProvider, string name) + => userCallerProvider.GetAsync($"/Hello", new { Name = name })); + + + app.MapGet("/Test/Order/Hello", ([FromServices] ICallerFactory callerFactory, string name) => + { + var callerProvider = callerFactory.CreateClient("OrderCaller"); + return callerProvider.GetAsync($"/Hello", new { Name = name }); + }); + ``` + +> 当多个Caller被添加时,如何获取指定的Caller? +>> 通过`CallerFactory`的`CreateClient`方法得到指定别名的CallerProvider +> +> 为什么`userCallerProvider`没有通过`CallerFactory`的`CreateClient`方法得到对应的Caller? +>> 如果未指定默认的ICallerProvider,则在`AddCaller`方法中第一个被添加的就是默认的CallerProvider + +### 推荐用法 + +1. 修改`Program.cs` + + ``` C# + builder.Services.AddCaller(); + ``` + +2. 新增加类`UserCaller` + + ``` C# + public class UserCaller: HttpClientCallerBase + { + protected override string BaseAddress { get; set; } = "http://localhost:5000"; + + public HttpCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public Task HelloAsync(string name) => CallerProvider.GetStringAsync($"/Hello", new { Name = name }); + + /// + /// 默认不需要重载,对httpClient有特殊需求时可重载 + /// + /// + protected override void ConfigureHttpClient(System.Net.Http.HttpClient httpClient) + { + httpClient.Timeout = TimeSpan.FromSeconds(5); + } + } + ``` + +3. 如何使用UserCaller + + ``` C# + app.MapGet("/Test/User/Hello", ([FromServices] UserCaller caller, string name) + => caller.HelloAsync(name)); + ``` \ No newline at end of file diff --git a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs new file mode 100644 index 000000000..454fdb09c --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caller.Core; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs new file mode 100644 index 000000000..33f0fece9 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/CustomHttpClientCallerProvider.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Application; + +public class CustomHttpClientCallerProvider : HttpClientCallerProvider +{ + public CustomHttpClientCallerProvider(IServiceProvider serviceProvider, string name, string baseApi) + : base(serviceProvider, name, baseApi) + { + } + + public string GetResult(string? methodName) => base.GetRequestUri(methodName); +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs new file mode 100644 index 000000000..af0eb4647 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Queries/UserDetailQury.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Application.Queries; + +public class UserDetailQury +{ + public Guid? Id { get; set; } + + [JsonPropertyName("name")] + public string? Name { get; set; } + + [JsonIgnore] + public int Age { get; set; } + + public DateTime? DelTime { get; set; } + + public List? Tags { get; set; } + + public UserDetailQury() + { + this.Id = Guid.NewGuid(); + } + + public UserDetailQury(string name, params string[] tags) : this(name, tags.ToList()) + { + } + + public UserDetailQury(string name, List tags) + { + Name = name; + Tags = tags; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs new file mode 100644 index 000000000..c495925aa --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Queries/UserListQury.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Application.Queries; + +public class UserListQury +{ + [JsonPropertyName("name")] + public string Name { get; set; } + + [JsonIgnore] + public int Age { get; set; } + + public UserListQury(string name) + { + Name = name; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs new file mode 100644 index 000000000..e23908161 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Requesties/RegisterUser.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Application.Requesties; + +[XmlRoot] +public class RegisterUser +{ + [XmlElement] + public string Account { get; set; } = default!; + + [XmlElement] + public string Password { get; set; } = default!; + + public RegisterUser() { } + + public RegisterUser(string account, string password) : this() + { + Account = account; + Password = password; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs new file mode 100644 index 000000000..a0e7c009a --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Application/Response/BaseResponse.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Application.Response; + +[Serializable] +[XmlRoot] +public class BaseResponse +{ + [XmlElement] + public string Code { get; set; } = default!; + + public BaseResponse() { } + + public BaseResponse(string code) { Code = code; } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs new file mode 100644 index 000000000..034c60d20 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/AutomaticCallerTest.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests; + +[TestClass] +public class AutomaticCallerTest +{ + private WebApplicationBuilder _builder = default!; + + [TestInitialize] + public void EdgeDriverInitialize() + { + _builder = WebApplication.CreateBuilder(); + } + + [TestMethod] + public async Task TestGetAsync() + { + _builder.Services.AddCaller(); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var githubCaller = serviceProvider.GetRequiredService(); + Assert.IsTrue(await githubCaller.GetAsync()); + } + + [TestMethod] + public void TestDaprCallerReturnCallerProviderIsNotNull() + { + _builder.Services.AddCaller(); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var caller = serviceProvider.GetRequiredService(); + Assert.IsTrue(caller.CallerProviderIsNotNull()); + } + + [TestMethod] + public void TestCustomDaprBaseReturnAppIdIsEqualUserService() + { + _builder.Services.AddCaller(); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var roleCaller = serviceProvider.GetRequiredService(); + var userCaller = serviceProvider.GetRequiredService(); + Assert.IsTrue(roleCaller.GetAppId() == "User-Service" && userCaller.GetAppId() == "User-Service"); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/CallerTest.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/CallerTest.cs new file mode 100644 index 000000000..209a7e84d --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/CallerTest.cs @@ -0,0 +1,235 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests; + +[TestClass] +public class CallerTest +{ + private WebApplicationBuilder _builder = default!; + + [TestInitialize] + public void EdgeDriverInitialize() + { + _builder = WebApplication.CreateBuilder(); + } + + [TestMethod] + public async Task TestGetAsync() + { + _builder.Services.AddCaller(callerOptions => + { + callerOptions.UseHttpClient(httpClientBuilder => + { + httpClientBuilder.Configure = builder => builder.Timeout = TimeSpan.FromSeconds(3); + httpClientBuilder.BaseAddress = "https://github.com/masastack"; + }); + }); + _ = _builder.Build(); + var serviceProvider = _builder.Services.BuildServiceProvider(); + var githubCaller = serviceProvider.GetRequiredService(); + Assert.IsTrue(await GetAsync(githubCaller)); + } + + [TestMethod] + public void TestCallerProviderServiceLifetime() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "http"; + clientBuilder.IsDefault = true; + clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + var callerProvider1 = serviceProvider.GetRequiredService(); + var callerProvider2 = serviceProvider.GetRequiredService(); + Assert.IsTrue(callerProvider1 == callerProvider2); + } + + [TestMethod] + public void TestCaller() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(clientBuilder => + { + clientBuilder.Name = "http"; + clientBuilder.IsDefault = true; + clientBuilder.BaseAddress = "https://github.com/masastack/MASA.Contrib"; + }); + opt.UseDapr(clientBuilder => + { + clientBuilder.Name = "dapr"; + clientBuilder.IsDefault = false; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + var callerProvider = serviceProvider.GetRequiredService(); + Assert.IsNotNull(callerProvider); + + var caller = serviceProvider.GetRequiredService().CreateClient(); + var daprCaller = serviceProvider.GetRequiredService().CreateClient("dapr"); + var httpCaller = serviceProvider.GetRequiredService().CreateClient("http"); + + Assert.IsTrue(caller.GetType().FullName != daprCaller.GetType().FullName); + Assert.IsTrue(caller.GetType().FullName == httpCaller.GetType().FullName); + } + + [TestMethod] + public void TestMultiDefaultCaller() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + opt.UseHttpClient(builder => + { + builder.Name = "gitee"; + builder.BaseAddress = "https://gitee.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestMultiDefaultCaller2() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "gitee"; + builder.BaseAddress = "https://gitee.com/masastack"; + builder.IsDefault = true; + }); + }); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestRepeatCallerName() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestRepeatCallerName2() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "github"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestRepeatCallerName3() + { + IServiceCollection services = new ServiceCollection(); + Assert.ThrowsException(() => + { + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = typeof(GithubCaller).FullName!; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + }); + } + + [TestMethod] + public void TestAddMultiCaller() + { + IServiceCollection services = new ServiceCollection(); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "masastack"; + builder.BaseAddress = "https://github.com/masastack"; + builder.IsDefault = true; + }); + }); + services.AddCaller(opt => + { + opt.UseHttpClient(builder => + { + builder.Name = "masastack2"; + builder.BaseAddress = "https://github.com/masastack"; + }); + }); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack")); + Assert.IsNotNull(serviceProvider.GetRequiredService().CreateClient("masastack2")); + } + + private async Task GetAsync(ICallerProvider callerProvider) + { + var res = await callerProvider.GetAsync(""); + return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs new file mode 100644 index 000000000..b775e3adf --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/HttpClientCallerTest.cs @@ -0,0 +1,128 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests; + +[TestClass] +public class HttpClientCallerTest +{ + [DataTestMethod] + [DataRow("https://github.com/", "/check/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com", "/check/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com", "check/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check", "healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check/", "healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check/", "/healthy", "https://github.com/check/healthy")] + [DataRow("https://github.com/check/", "/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com/check/", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com/check", "healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("https://github.com", "", "")] + [DataRow("http://github.com", "", "")] + [DataRow("/v1/check", "healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "/healthy", "/v1/check/healthy")] + [DataRow("/v1/check/", "https://github.com/check/healthy?date=1650465417", "https://github.com/check/healthy?date=1650465417")] + [DataRow("", "healthy", "healthy")] + [DataRow("", "/healthy?id=1", "/healthy?id=1")] + public void TestGetRequestUri(string prefix, string methods, string result) + { + var services = new ServiceCollection(); + services.AddCaller(opt => opt.UseHttpClient()); + var serviceProvider = services.BuildServiceProvider(); + var provider = new CustomHttpClientCallerProvider(serviceProvider, string.Empty, prefix); + Assert.IsTrue(provider.GetResult(methods) == result); + } + + [TestMethod] + public async Task TestRequestDataIsXmlAsync() + { + var services = new ServiceCollection(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + Mock httpClientFactory = new(); + var handlerMock = new Mock(); + var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) + { + BaseAddress = new Uri("http://localhost:5000") + }; + var response = new BaseResponse("success"); + handlerMock + .Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny() + ) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent(XmlUtils.Serializer(response)) + }) + .Verifiable(); + + httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); + services.AddSingleton(httpClientFactory.Object); + var serviceProvider = services.BuildServiceProvider(); + string name = ""; + string prefix = ""; + var httpClientCallerProvider = new HttpClientCallerProvider(serviceProvider, name, prefix); + + var res = await httpClientCallerProvider.PostAsync("Hello", new RegisterUser("Jim", "123456")); + Assert.IsNotNull(res); + Assert.IsTrue(res.Code == response.Code); + } + + [TestMethod] + public async Task TestRequestMessageReturnOnceAsync() + { + var services = new ServiceCollection(); + RegisterUser registerUser = new RegisterUser("Jim", "123456"); + + services.AddSingleton(); + Mock requestMessage = new(); + requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny())) + .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello")).Verifiable(); + requestMessage.Setup(req => req.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny())) + .ReturnsAsync(new HttpRequestMessage(HttpMethod.Post, "Hello") + { + Content = JsonContent.Create(registerUser) + }).Verifiable(); + services.AddSingleton(_ => requestMessage.Object); + services.AddSingleton(); + Mock httpClientFactory = new(); + var handlerMock = new Mock(); + var magicHttpClient = new System.Net.Http.HttpClient(handlerMock.Object) + { + BaseAddress = new Uri("http://localhost:5000") + }; + var response = new BaseResponse("success"); + handlerMock + .Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny() + ) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent(XmlUtils.Serializer(response)) + }) + .Verifiable(); + + httpClientFactory.Setup(factory => factory.CreateClient(It.IsAny())).Returns(magicHttpClient); + services.AddSingleton(httpClientFactory.Object); + var serviceProvider = services.BuildServiceProvider(); + string name = ""; + string prefix = ""; + var httpClientCallerProvider = new HttpClientCallerProvider(serviceProvider, name, prefix); + + var res = await httpClientCallerProvider.PostAsync("Hello", registerUser); + Assert.IsNotNull(res); + Assert.IsTrue(res.Code == response.Code); + requestMessage.Verify(r => r.ProcessHttpRequestMessageAsync(It.IsAny(), It.IsAny()), Times.Once); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs new file mode 100644 index 000000000..ca9efb69c --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/DaprCaller.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; + +public class DaprCaller : DaprCallerBase +{ + protected override string AppId { get; set; } = "DaprCaller"; + + public DaprCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public bool CallerProviderIsNotNull() => CallerProvider != null; +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs new file mode 100644 index 000000000..b663f2d11 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/GithubCaller.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; + +public class GithubCaller : HttpClientCallerBase +{ + protected override string BaseAddress { get; set; } = "https://github.com/masastack"; + + public GithubCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public async Task GetAsync() + { + var res = await CallerProvider.GetAsync(""); + return res.IsSuccessStatusCode && res.StatusCode == HttpStatusCode.OK; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs new file mode 100644 index 000000000..e961ef0cf --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/RoleCaller.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; + +public class RoleCaller: UserDaprCallerBase +{ + public RoleCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs new file mode 100644 index 000000000..6186c323c --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserCaller.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; + +public class UserCaller : UserDaprCallerBase +{ + public UserCaller(IServiceProvider serviceProvider) : base(serviceProvider) + { + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs new file mode 100644 index 000000000..6f46b6f3a --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Callers/UserDaprCallerBase.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Infrastructure.Callers; + +public abstract class UserDaprCallerBase : DaprCallerBase +{ + protected override string AppId { get; set; }= "User-Service"; + + protected UserDaprCallerBase(IServiceProvider serviceProvider) : base(serviceProvider) + { + } + + public string GetAppId() => AppId; +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs new file mode 100644 index 000000000..b52af2eae --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/DefaultXmlResponseMessage.cs @@ -0,0 +1,93 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Caller.Tests.Infrastructure.Utils; + +namespace Masa.Utils.Caller.Tests.Infrastructure; + +public class DefaultXmlResponseMessage : IResponseMessage +{ + private readonly ILogger? _logger; + + public DefaultXmlResponseMessage(ILogger? logger = null) + { + _logger = logger; + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, + CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case HttpStatusCode.Accepted: + case HttpStatusCode.NoContent: + return default; + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + if (typeof(TResponse) == typeof(Guid) || typeof(TResponse) == typeof(Guid?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)Guid.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse) == typeof(DateTime) || typeof(TResponse) == typeof(DateTime?)) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + if (string.IsNullOrEmpty(content)) + return (TResponse)(object?)null!; + + return (TResponse?)(object)DateTime.Parse(content.Replace("\"", "")); + } + if (typeof(TResponse).GetInterfaces().Any(type => type == typeof(IConvertible))) + { + var content = await response.Content.ReadAsStringAsync(cancellationToken); + return (TResponse)Convert.ChangeType(content, typeof(TResponse)); + } + try + { + var res = await response.Content.ReadAsStringAsync(cancellationToken); + return XmlUtils.Deserialize(res) ?? + throw new ArgumentException("The response cannot be empty or there is an error in deserialization"); + } + catch (Exception exception) + { + _logger?.LogWarning(exception, exception.Message); + ExceptionDispatchInfo.Capture(exception).Throw(); + return default; //This will never be executed, the previous line has already thrown an exception + } + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + return default; //never executed + } + + public async Task ProcessResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.IsSuccessStatusCode) + { + switch (response.StatusCode) + { + case (HttpStatusCode)MasaHttpStatusCode.UserFriendlyException: + throw new UserFriendlyException(await response.Content.ReadAsStringAsync(cancellationToken)); + default: + return; + } + } + + await ProcessResponseExceptionAsync(response, cancellationToken); + } + + public async Task ProcessResponseExceptionAsync(HttpResponseMessage response, CancellationToken cancellationToken = default) + { + if (response.Content.Headers.ContentLength is > 0) + throw new Exception(await response.Content.ReadAsStringAsync(cancellationToken)); + + throw new MasaException($"ReasonPhrase: {response.ReasonPhrase ?? string.Empty}, StatusCode: {response.StatusCode}"); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs new file mode 100644 index 000000000..e277a9828 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/Utils/XmlUtils.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests.Infrastructure.Utils; + +public class XmlUtils +{ + public static string Serializer(object data) + { + MemoryStream ms = new MemoryStream(); + StreamWriter sw = new StreamWriter(ms, Encoding.UTF8); + XmlSerializer xz = new XmlSerializer(data.GetType()); + xz.Serialize(sw, data); + return Encoding.UTF8.GetString(ms.ToArray()); + } + + public static T Deserialize(string xml) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(T)); + using MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(xml.ToCharArray())); + return (T)xmlSerializer.Deserialize(stream)!; + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs new file mode 100644 index 000000000..04d178945 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Infrastructure/XmlRequestMessage.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Caller.Tests.Infrastructure.Utils; + +namespace Masa.Utils.Caller.Tests.Infrastructure; + +public class XmlRequestMessage : IRequestMessage +{ + public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage) + => Task.FromResult(requestMessage); + + public Task ProcessHttpRequestMessageAsync(HttpRequestMessage requestMessage, TRequest data) + { + var xmlContent = XmlUtils.Serializer(data!); + requestMessage.Content = new StringContent(xmlContent); + return Task.FromResult(requestMessage); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj b/src/Utils/Caller/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj new file mode 100644 index 000000000..84572a163 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/Masa.Utils.Caller.Tests.csproj @@ -0,0 +1,24 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + + + + diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/TypeConvertTest.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/TypeConvertTest.cs new file mode 100644 index 000000000..cf898eef8 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/TypeConvertTest.cs @@ -0,0 +1,129 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Caller.Tests; + +[TestClass] +public class TypeConvertTest +{ + [TestMethod] + public void TestConvertToKeyValuePairs() + { + var defaultTypeConvertProvider = new DefaultTypeConvertProvider(); + var result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new + { + id = 1, + name = "masa" + }).ToList(); + Assert.AreEqual(2, result.Count()); + Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "1")); + Assert.IsTrue(result.Any(x => x.Key == "name" && x.Value == "masa")); + + result = defaultTypeConvertProvider.ConvertToKeyValuePairs(new + { + id = 2, + text = "masa" + }).ToList(); + Assert.IsTrue(result.Any(x => x.Key == "id" && x.Value == "2")); + Assert.IsTrue(result.Any(x => x.Key == "text" && x.Value == "masa")); + } + + [TestMethod] + public void TestConvertToDictionaryByDynamic() + { + var provider = new DefaultTypeConvertProvider(); + var dictionary = new Dictionary + { + { "account", "jim" }, + { "age", "18" } + }; + var request = new + { + account = "jim", + age = 18 + }; + var result = provider.ConvertToDictionary(request); + Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + } + + [TestMethod] + public void TestConvertToDictionaryByObject() + { + var provider = new DefaultTypeConvertProvider(); + var query = new UserListQury("Jim"); + var dictionary = new Dictionary + { + { "name", query.Name } + }; + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(System.Text.Json.JsonSerializer.Serialize(result) == System.Text.Json.JsonSerializer.Serialize(dictionary)); + } + + [TestMethod] + public void TestConvertToDictionaryByObject2() + { + var provider = new DefaultTypeConvertProvider(); + var query = new UserDetailQury("Jim", "Music", "Game"); + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(result.Count == 2); + Assert.IsTrue(result["name"] == query.Name); + Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + { + "Music", + "Game" + })); + } + + [TestMethod] + public void TestConvertToDictionaryByObject3() + { + var provider = new DefaultTypeConvertProvider(); + + List tags = null!; + var query = new UserDetailQury("Jim", tags); + var result = provider.ConvertToDictionary(query); + + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["name"] == query.Name); + } + + [TestMethod] + public void TestConvertToDictionaryByObject4() + { + var provider = new DefaultTypeConvertProvider(); + var query = new UserDetailQury(null!, "Music", "Game"); + var result = provider.ConvertToDictionary(query); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Tags"] == System.Text.Json.JsonSerializer.Serialize(new List() + { + "Music", + "Game" + })); + } + + [TestMethod] + public void TestConvertToDictionaryByObject5() + { + var provider = new DefaultTypeConvertProvider(); + var dic = new Dictionary() + { + { "Account", "Jim" } + }; + var result = provider.ConvertToDictionary(dic); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Account"] == "Jim"); + } + + [TestMethod] + public void TestConvertToDictionaryByObject6() + { + var provider = new DefaultTypeConvertProvider(); + var dic = new List>() + { + new("Account", "Jim") + }; + var result = provider.ConvertToDictionary(dic); + Assert.IsTrue(result.Count == 1); + Assert.IsTrue(result["Account"] == "Jim"); + } +} diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/_Imports.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/_Imports.cs new file mode 100644 index 000000000..610dc2069 --- /dev/null +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/_Imports.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caller.Core; +global using Masa.Utils.Caller.HttpClient; +global using Masa.Utils.Exceptions; +global using Microsoft.AspNetCore.Builder; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using Moq.Protected; +global using System.Net; +global using System.Runtime.ExceptionServices; +global using System.Text; +global using System.Text.Json.Serialization; +global using System.Xml.Serialization; +global using System.Net.Http.Json; +global using Masa.Utils.Caller.Tests.Application; +global using Masa.Utils.Caller.Tests.Application.Requesties; +global using Masa.Utils.Caller.Tests.Application.Response; +global using Masa.Utils.Caller.Tests.Infrastructure; +global using Masa.Utils.Caller.Tests.Infrastructure.Utils; +global using Masa.Utils.Caller.Tests.Application.Queries; +global using Masa.Utils.Caller.DaprClient; +global using Masa.Utils.Caller.Tests.Infrastructure.Callers; diff --git a/src/Utils/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj b/src/Utils/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/Configuration/Masa.Utils.Configuration.Dcc/Masa.Utils.Configuration.Dcc.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs b/src/Utils/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs new file mode 100644 index 000000000..03e89ed37 --- /dev/null +++ b/src/Utils/Configuration/Masa.Utils.Configuration.Json/AppSettings.cs @@ -0,0 +1,102 @@ +using Microsoft.Extensions.Configuration; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Configuration.Json +{ + public class AppSettings + { + private static JsonConfiguration? _config; + + public static bool Initialized => _config != null; + + public static IConfiguration Configuration + { + get + { + InitializeIfNot(); + + return _config!.Configuration; + } + } + + private static void InitializeIfNot() + { + if (!Initialized) + { + var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); + Initialize(environment); + } + } + + /// + /// Initialize configuration with appsettings.json + /// + public static void Initialize() + { + Initialize(string.Empty); + } + + /// + /// Initialize configuration with appsettings.json & appsettings.{environmentName}.json + /// + /// + public static void Initialize(string? environmentName) + { + if (Initialized) + { + return; + } + + var optionsList = new List + { + new JsonFileOptions + { + FileName = "appsettings.json", + Optional = false, + ReloadOnChange = true + } + }; + + if (!string.IsNullOrEmpty(environmentName)) + { + optionsList.Add(new JsonFileOptions + { + FileName = $"appsettings.{environmentName}.json", + Optional = true, + ReloadOnChange = true + }); + } + + _config = new JsonConfiguration(optionsList); + } + + /// + /// Get configuration section + /// + /// + /// + /// + public static string Get(string key, Action? onChange = null) + { + InitializeIfNot(); + + return _config!.Get(key, onChange); + } + + /// + /// Bind a model with configuration section + /// + /// + /// + /// + /// + public static TModel GetModel(string key, Action? onChange = null) + { + InitializeIfNot(); + + return _config!.GetModel(key, onChange); + } + } +} diff --git a/src/Utils/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs b/src/Utils/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs new file mode 100644 index 000000000..125893fe1 --- /dev/null +++ b/src/Utils/Configuration/Masa.Utils.Configuration.Json/JsonConfiguration.cs @@ -0,0 +1,118 @@ +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Primitives; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Configuration.Json +{ + public class JsonConfiguration + { + public IConfiguration Configuration { get; } + + public JsonConfiguration(string fileName) + : this(Directory.GetCurrentDirectory(), fileName) + { + } + + public JsonConfiguration(string basePath, string fileName) + { + Configuration = new ConfigurationBuilder() + .SetBasePath(basePath) + .AddJsonFile(fileName, optional: false, reloadOnChange: true) + .Build(); + } + + public JsonConfiguration(JsonFileOptions options) + : this(Directory.GetCurrentDirectory(), options) + { + } + + public JsonConfiguration(string basePath, JsonFileOptions options) + { + Configuration = new ConfigurationBuilder() + .SetBasePath(basePath) + .AddJsonFile(options.FileName, options.Optional, options.ReloadOnChange) + .Build(); + } + + public JsonConfiguration(List optionsList) + : this(Directory.GetCurrentDirectory(), optionsList) + { + } + + public JsonConfiguration(string basePath, List optionsList) + { + var builder = new ConfigurationBuilder() + .SetBasePath(basePath); + + foreach (var options in optionsList) + { + builder.AddJsonFile(options.FileName, options.Optional, options.ReloadOnChange); + } + + Configuration = builder.Build(); + } + + /// + /// Get configuration section + /// + public string Get(string key, Action? onChange = null) + { + if (string.IsNullOrEmpty(key)) + { + throw new ArgumentNullException(nameof(key)); + } + + var model = Get(key); + + if (onChange != null) + { + ChangeToken.OnChange(() => Configuration.GetReloadToken(), () => + { + onChange(Get(key)); + }); + } + + return model; + } + + /// + /// Bind a model with configuration section + /// + public TModel GetModel(string key, Action? onChange = null) + { + if (string.IsNullOrEmpty(key)) + { + throw new ArgumentNullException(nameof(key)); + } + + var model = Get(key); + + if (onChange != null) + { + ChangeToken.OnChange(() => Configuration.GetReloadToken(), () => + { + onChange(Get(key)); + }); + } + + return model; + } + + private string Get(string key) + { + var options = Configuration.GetSection(key).Value; + return options; + } + + /// + /// Bind a model with configuration section + /// + private TModel Get(string key) + { + var options = Configuration.GetSection(key).Get(); + return options; + } + } +} diff --git a/src/Utils/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs b/src/Utils/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs new file mode 100644 index 000000000..72e54a3c1 --- /dev/null +++ b/src/Utils/Configuration/Masa.Utils.Configuration.Json/JsonFileOptions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Configuration.Json +{ + public class JsonFileOptions + { + /// + /// Path relative to the base path stored in Microsoft.Extensions.Configuration.IConfigurationBuilder.Properties of builder. + /// + public string FileName { get; set; } = null!; + + /// + /// Whether the file is optional. + /// + public bool Optional { get; set; } + + /// + /// Whether the configuration should be reloaded if the file changes. + /// + public bool ReloadOnChange { get; set; } + } +} diff --git a/src/Utils/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj b/src/Utils/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj new file mode 100644 index 000000000..0662243e5 --- /dev/null +++ b/src/Utils/Configuration/Masa.Utils.Configuration.Json/Masa.Utils.Configuration.Json.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Utils/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs b/src/Utils/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs new file mode 100644 index 000000000..870a18104 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/MinCountAttribute.cs @@ -0,0 +1,57 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System.ComponentModel.DataAnnotations; + +public class MinCountAttribute : ValidationAttribute +{ + private const string DEFAULT_ERROR_MESSAGE = "The field {0} must be a list type with a minimum count of '{1}'."; + + public MinCountAttribute(int count) : base(DEFAULT_ERROR_MESSAGE) + { + Count = count; + } + + public int Count { get; } + + public override bool IsValid(object? value) + { + // Check the lengths for legality + EnsureLegalLengths(); + + int count; + + if (value == null) + { + return true; + } + + if (value is IList list) + { + count = list.Count; + } + else + { + throw new InvalidCastException($"The field of type {value.GetType()} must be a list type."); + } + + return count >= Count; + } + + public override string FormatErrorMessage(string name) + { + return string.Format(ErrorMessageString, name, Count); + } + + /// + /// Checks that Length has a legal value. + /// + /// Length is less than zero. + private void EnsureLegalLengths() + { + if (Count < 0) + { + throw new InvalidOperationException($"{nameof(MinCountAttribute)} must have a Count value that is zero or greater."); + } + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs b/src/Utils/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs new file mode 100644 index 000000000..9043bce26 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.DataAnnotations/DataAnnotations/NonDefaultAttribute.cs @@ -0,0 +1,32 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System.ComponentModel.DataAnnotations +{ + public class NonDefaultAttribute : ValidationAttribute + { + private const string DEFAULT_ERROR_MESSAGE = "The field {0} must be a non-default value."; + + private static ConcurrentDictionary defaultInstancesCache = new(); + + public NonDefaultAttribute() : base(DEFAULT_ERROR_MESSAGE) + { + } + + public override bool IsValid(object? value) + { + if (value is null) + return true; + + var type = value.GetType(); + + if (!defaultInstancesCache.TryGetValue(type.FullName!, out var defaultInstance)) + { + defaultInstance = Activator.CreateInstance(Nullable.GetUnderlyingType(type) ?? type); + defaultInstancesCache[type.FullName!] = defaultInstance!; + } + + return !Equals(value, defaultInstance); + } + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj b/src/Utils/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.DataAnnotations/Masa.Utils.Data.DataAnnotations.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs b/src/Utils/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs new file mode 100644 index 000000000..24bbb34f0 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.DataAnnotations/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.Collections; +global using System.Collections.Concurrent; diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs new file mode 100644 index 000000000..26705a01b --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/IPinYinTokenFilter.cs @@ -0,0 +1,106 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Analysis.TokenFilters; + +public interface IPinYinTokenFilter : ITokenFilter +{ + /// + /// when this option enabled, eg: 刘德华>ldh + /// + [DataMember(Name = "keep_first_letter")] + bool KeepFirstLetter { get; set; } + + /// + /// when this option enabled, will keep first letters separately + /// eg: 刘德华>l,d,h, default: false + /// NOTE: query result maybe too fuzziness due to term too frequency + /// + [DataMember(Name = "keep_separate_first_letter")] + bool KeepSeparateFirstLetter { get; set; } + + /// + /// set max length of the first_letter result + /// + [DataMember(Name = "limit_first_letter_length")] + int LimitFirstLetterLength { get; set; } + + /// + /// when this option enabled, eg: 刘德华> [liu,de,hua] + /// + [DataMember(Name = "keep_full_pinyin")] + bool KeepFullPinyin { get; set; } + + /// + /// when this option enabled, eg: 刘德华> [liudehua] + /// + [DataMember(Name = "keep_joined_full_pinyin")] + bool KeepJoinedFullPinyin { get; set; } + + /// + /// keep non chinese letter or number in result + /// + [DataMember(Name = "keep_none_chinese")] + bool KeepNoneChinese { get; set; } + + /// + /// keep non chinese letter together + /// eg: DJ音乐家 -> DJ,yin,yue,jia + /// when set to false, eg: DJ音乐家 -> D,J,yin,yue,jia + /// NOTE: keep_none_chinese should be enabled first + /// + [DataMember(Name = "keep_none_chinese_together")] + bool KeepNoneChineseTogether { get; set; } + + /// + /// keep non Chinese letters in first letter, eg: 刘德华AT2016->ldhat2016 + /// + [DataMember(Name = "keep_none_chinese_in_first_letter")] + bool KeepNoneChineseInFirstLetter { get; set; } + + /// + /// keep non Chinese letters in joined full pinyin, eg: 刘德华2016->liudehua2016 + /// + [DataMember(Name = "keep_none_chinese_in_joined_full_pinyin")] + bool KeepNoneChineseInJoinedFullPinyin { get; set; } + + /// + /// break non chinese letters into separate pinyin term if they are pinyin + /// eg: liudehuaalibaba13zhuanghan -> liu,de,hua,a,li,ba,ba,13,zhuang,han + /// NOTE: keep_none_chinese and keep_none_chinese_together should be enabled first + /// + [DataMember(Name = "none_chinese_pinyin_tokenize")] + bool NoneChinesePinyinTokenize { get; set; } + + /// + /// when this option enabled, will keep original input as well + /// + [DataMember(Name = "keep_original")] + bool KeepOriginal { get; set; } + + /// + /// lowercase non Chinese letters + /// + [DataMember(Name = "lowercase")] + bool Lowercase { get; set; } + + [DataMember(Name = "trim_whitespace")] + bool TrimWhitespace { get; set; } + + /// + /// when this option enabled, duplicated term will be removed to save index, eg: de的>de + /// NOTE: position related query maybe influenced + /// + [DataMember(Name = "remove_duplicated_term")] + bool RemoveDuplicatedTerm { get; set; } + + /// + /// after 6.0, offset is strictly constrained, overlapped tokens are not allowed + /// with this parameter, overlapped token will allowed by ignore offset + /// please note, all position related query or highlight will become incorrect + /// you should use multi fields and specify different settings for different query purpose + /// if you need offset, please set it to false + /// + [DataMember(Name = "ignore_pinyin_offset")] + bool IgnorePinyinOffset { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs new file mode 100644 index 000000000..67d87fc23 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Analysis/TokenFilters/PinYinTokenFilterDescriptor.cs @@ -0,0 +1,125 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Analysis.TokenFilters; + +public class PinYinTokenFilterDescriptor + : TokenFilterDescriptorBase, IPinYinTokenFilter +{ + protected override string Type => "pinyin"; + + /// + /// when this option enabled, eg: 刘德华>ldh + /// + [DataMember(Name = "keep_first_letter")] + public bool KeepFirstLetter { get; set; } + + /// + /// when this option enabled, will keep first letters separately + /// eg: 刘德华>l,d,h, default: false + /// NOTE: query result maybe too fuzziness due to term too frequency + /// + [DataMember(Name = "keep_separate_first_letter")] + public bool KeepSeparateFirstLetter { get; set; } + + /// + /// set max length of the first_letter result + /// + [DataMember(Name = "limit_first_letter_length")] + public int LimitFirstLetterLength { get; set; } + + /// + /// when this option enabled, eg: 刘德华> [liu,de,hua] + /// + [DataMember(Name = "keep_full_pinyin")] + public bool KeepFullPinyin { get; set; } + + /// + /// when this option enabled, eg: 刘德华> [liudehua] + /// + [DataMember(Name = "keep_joined_full_pinyin")] + public bool KeepJoinedFullPinyin { get; set; } + + /// + /// keep non chinese letter or number in result + /// + [DataMember(Name = "keep_none_chinese")] + public bool KeepNoneChinese { get; set; } + + /// + /// keep non chinese letter together + /// eg: DJ音乐家 -> DJ,yin,yue,jia + /// when set to false, eg: DJ音乐家 -> D,J,yin,yue,jia + /// NOTE: keep_none_chinese should be enabled first + /// + [DataMember(Name = "keep_none_chinese_together")] + public bool KeepNoneChineseTogether { get; set; } + + /// + /// keep non Chinese letters in first letter, eg: 刘德华AT2016->ldhat2016 + /// + [DataMember(Name = "keep_none_chinese_in_first_letter")] + public bool KeepNoneChineseInFirstLetter { get; set; } + + /// + /// keep non Chinese letters in joined full pinyin, eg: 刘德华2016->liudehua2016 + /// + [DataMember(Name = "keep_none_chinese_in_joined_full_pinyin")] + public bool KeepNoneChineseInJoinedFullPinyin { get; set; } + + /// + /// break non chinese letters into separate pinyin term if they are pinyin + /// eg: liudehuaalibaba13zhuanghan -> liu,de,hua,a,li,ba,ba,13,zhuang,han + /// NOTE: keep_none_chinese and keep_none_chinese_together should be enabled first + /// + [DataMember(Name = "none_chinese_pinyin_tokenize")] + public bool NoneChinesePinyinTokenize { get; set; } + + /// + /// when this option enabled, will keep original input as well + /// + [DataMember(Name = "keep_original")] + public bool KeepOriginal { get; set; } + + /// + /// lowercase non Chinese letters + /// + [DataMember(Name = "lowercase")] + public bool Lowercase { get; set; } + + [DataMember(Name = "trim_whitespace")] + public bool TrimWhitespace { get; set; } + + /// + /// when this option enabled, duplicated term will be removed to save index, eg: de的>de + /// NOTE: position related query maybe influenced + /// + [DataMember(Name = "remove_duplicated_term")] + public bool RemoveDuplicatedTerm { get; set; } + + /// + /// after 6.0, offset is strictly constrained, overlapped tokens are not allowed + /// with this parameter, overlapped token will allowed by ignore offset + /// please note, all position related query or highlight will become incorrect + /// you should use multi fields and specify different settings for different query purpose + /// if you need offset, please set it to false + /// + [DataMember(Name = "ignore_pinyin_offset")] + public bool IgnorePinyinOffset { get; set; } + + public PinYinTokenFilterDescriptor() + { + KeepFirstLetter = true; + KeepFullPinyin = true; + KeepNoneChinese = true; + KeepNoneChineseInFirstLetter = true; + KeepNoneChineseTogether = true; + KeepJoinedFullPinyin = true; + NoneChinesePinyinTokenize = true; + KeepOriginal = true; + LimitFirstLetterLength = 50; + Lowercase = true; + RemoveDuplicatedTerm = true; + KeepNoneChineseInJoinedFullPinyin = true; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Const.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Const.cs new file mode 100644 index 000000000..ee01403a9 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Const.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class Const +{ + public const string DEFAULT_CLIENT_NAME = "es"; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs new file mode 100644 index 000000000..2423a175c --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/DefaultElasticsearchFactory.cs @@ -0,0 +1,84 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class DefaultElasticsearchFactory : IElasticsearchFactory +{ + private readonly Dictionary _relations; + private readonly ConcurrentDictionary _elasticClients; + + public DefaultElasticsearchFactory(ElasticsearchRelationsOptions options) + { + _relations = options.Relations; + _elasticClients = new(); + } + + public IMasaElasticClient CreateClient() + { + return new DefaultMasaElasticClient(CreateElasticClient()); + } + + public IMasaElasticClient CreateClient(string name) + { + return new DefaultMasaElasticClient(CreateElasticClient(name)); + } + + public IElasticClient CreateElasticClient() + { + var elasticsearchRelation = _relations.Values.SingleOrDefault(r => r.IsDefault) ?? _relations.Values.FirstOrDefault(); + + if (elasticsearchRelation == null) + throw new Exception("The default ElasticClient is not found, please check if Elasticsearch is added"); + + return GetOrAddElasticClient(elasticsearchRelation.Name); + } + + public IElasticClient CreateElasticClient(string name) + { + if (!_relations.ContainsKey(name)) + throw new NotSupportedException($"The ElasticClient whose name is {name} is not found"); + + return GetOrAddElasticClient(name); + } + + private IElasticClient GetOrAddElasticClient(string name) + => _elasticClients.GetOrAdd(name, name => Create(name)); + + private IElasticClient Create(string name) + { + var relation = _relations[name]; + + var settings = relation.UseConnectionPool + ? GetConnectionSettingsConnectionPool(relation) + : GetConnectionSettingsBySingleNode(relation); + + return new ElasticClient(settings); + } + + private ConnectionSettings GetConnectionSettingsBySingleNode(ElasticsearchRelations relation) + { + var connectionSetting = new ConnectionSettings(relation.Nodes[0]) + .EnableApiVersioningHeader(); + relation.Action?.Invoke(connectionSetting); + return connectionSetting; + } + + private ConnectionSettings GetConnectionSettingsConnectionPool(ElasticsearchRelations relation) + { + var pool = new StaticConnectionPool( + relation.Nodes, + relation.StaticConnectionPoolOptions?.Randomize ?? true, + relation.StaticConnectionPoolOptions?.DateTimeProvider); + + var settings = new ConnectionSettings( + pool, + relation.ConnectionSettingsOptions?.Connection, + relation.ConnectionSettingsOptions?.SourceSerializerFactory, + relation.ConnectionSettingsOptions?.PropertyMappingProvider) + .EnableApiVersioningHeader(); + + relation.Action?.Invoke(settings); + return settings; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs new file mode 100644 index 000000000..39cb3e471 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/DefaultMasaElasticClient.cs @@ -0,0 +1,391 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class DefaultMasaElasticClient : IMasaElasticClient +{ + private readonly IElasticClient _elasticClient; + + public DefaultMasaElasticClient(IElasticClient elasticClient) + => _elasticClient = elasticClient; + + #region index manage + + public async Task IndexExistAsync( + string indexName, + CancellationToken cancellationToken = default) + { + IIndexExistsRequest request = new IndexExistsRequest(indexName); + return new Response.ExistsResponse(await _elasticClient.Indices.ExistsAsync(request, cancellationToken)); + } + + public async Task CreateIndexAsync( + string indexName, + CreateIndexOptions? options = null, + CancellationToken cancellationToken = default) + { + ICreateIndexRequest request = new CreateIndexRequest(indexName); + if (options != null) + { + request.Settings = options.IndexSettings; + request.Aliases = options.Aliases; + request.Mappings = options.Mappings; + } + + return new Response.Index.CreateIndexResponse(await _elasticClient.Indices.CreateAsync(request, cancellationToken)); + } + + public async Task DeleteIndexAsync( + string indexName, + CancellationToken cancellationToken = default) + { + IDeleteIndexRequest request = new DeleteIndexRequest(indexName); + return new Response.Index.DeleteIndexResponse(await _elasticClient.Indices.DeleteAsync(request, cancellationToken)); + } + + public async Task DeleteMultiIndexAsync( + IEnumerable indexNames, + CancellationToken cancellationToken = default) + { + BulkAliasDescriptor request = new BulkAliasDescriptor(); + foreach (var indexName in indexNames) + request.RemoveIndex(opt => opt.Index(indexName)); + + return new Response.Index.DeleteIndexResponse(await _elasticClient.Indices.BulkAliasAsync(request, cancellationToken)); + } + + public async Task DeleteIndexByAliasAsync( + string alias, + CancellationToken cancellationToken = default) + { + var response = await GetIndexByAliasAsync(alias, cancellationToken); + if (response.IsValid) + return await DeleteMultiIndexAsync(response.IndexNames, cancellationToken); + + return new(response.Message); + } + + public async Task GetAllIndexAsync(CancellationToken cancellationToken = default) + { + ICatIndicesRequest request = new CatIndicesRequest(); + var response = await _elasticClient.Cat.IndicesAsync(request, cancellationToken); + return new Response.Index.GetIndexResponse(response); + } + + public async Task GetIndexByAliasAsync(string alias, CancellationToken cancellationToken = default) + { + ICatIndicesRequest request = new CatIndicesRequest(alias); + var response = await _elasticClient.Cat.IndicesAsync(request, cancellationToken); + return new Response.Index.GetIndexByAliasResponse(response); + } + + #endregion + + #region alias manage + + public async Task GetAllAliasAsync(CancellationToken cancellationToken = default) + { + Func? selector = null; + var response = await _elasticClient.Cat.AliasesAsync(selector, cancellationToken); + return new MASAGetAliasResponse(response); + } + + public async Task GetAliasByIndexAsync( + string indexName, + CancellationToken cancellationToken = default) + { + IGetAliasRequest request = new GetAliasRequest((Indices)indexName); + var response = await _elasticClient.Indices.GetAliasAsync(request, cancellationToken); + return new MASAGetAliasResponse(response); + } + + public async Task BindAliasAsync( + BindAliasIndexOptions options, + CancellationToken cancellationToken = default) + { + BulkAliasDescriptor request = new BulkAliasDescriptor(); + foreach (var indexName in options.IndexNames) + request.Add(opt => opt.Aliases(options.Alias).Index(indexName)); + + var response = await _elasticClient.Indices.BulkAliasAsync(request, cancellationToken); + return new MASABulkAliasResponse(response); + } + + public async Task UnBindAliasAsync( + UnBindAliasIndexOptions options, + CancellationToken cancellationToken = default) + { + BulkAliasDescriptor request = new BulkAliasDescriptor(); + foreach (var indexName in options.IndexNames) + request.Remove(opt => opt.Aliases(options.Alias).Index(indexName)); + + var response = await _elasticClient.Indices.BulkAliasAsync(request, cancellationToken); + return new MASABulkAliasResponse(response); + } + + #endregion + + #region document manage + + public async Task DocumentExistsAsync( + ExistDocumentRequest request, + CancellationToken cancellationToken = default) + { + var documentExistsRequest = new DocumentExistsRequest(request.IndexName, request.DocumentId); + return new Response.ExistsResponse(await _elasticClient.DocumentExistsAsync(documentExistsRequest, cancellationToken)); + } + + public async Task DocumentCountAsync(CountDocumentRequest request, CancellationToken cancellationToken = default) + { + var countRequest = new CountRequest(request.IndexName) + { + ExpandWildcards = ExpandWildcards.All + }; + return new CountDocumentResponse(await _elasticClient.CountAsync(countRequest, cancellationToken)); + } + + /// + /// Add a new document + /// only when the document does not exist + /// + /// + /// + /// + /// + public async Task CreateDocumentAsync( + CreateDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + ICreateRequest createRequest = new CreateRequest(request.IndexName, new Id(request.Request.DocumentId)); + createRequest.Document = request.Request.Document; + return new Response.CreateResponse(await _elasticClient.CreateAsync(createRequest, cancellationToken)); + } + + /// + /// Add new documents in batches + /// only when the documents do not exist + /// + /// + /// + /// + /// + public async Task CreateMultiDocumentAsync( + CreateMultiDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + BulkDescriptor descriptor = new BulkDescriptor(request.IndexName); + foreach (var item in request.Items) + { + descriptor + .Create(opt => opt.Document(item.Document) + .Index(request.IndexName) + .Id(item.DocumentId)); + } + + var response = await _elasticClient.BulkAsync(descriptor, cancellationToken); + return new CreateMultiResponse(response); + } + + /// + /// Update or insert document + /// Overwrite if it exists, add new if it does not exist + /// + /// + /// + /// + /// + public async Task SetDocumentAsync( + SetDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + BulkDescriptor descriptor = new BulkDescriptor(request.IndexName); + foreach (var item in request.Items) + { + descriptor + .Index(opt => opt.Document(item.Document) + .Index(request.IndexName) + .Id(item.DocumentId)); + } + + var response = await _elasticClient.BulkAsync(descriptor, cancellationToken); + return new SetResponse(response); + } + + public async Task DeleteDocumentAsync( + DeleteDocumentRequest request, + CancellationToken cancellationToken = default) + { + IDeleteRequest deleteRequest = new DeleteRequest(request.IndexName, new Id(request.DocumentId)); + return new Response.DeleteResponse(await _elasticClient.DeleteAsync(deleteRequest, cancellationToken)); + } + + public async Task DeleteMultiDocumentAsync( + DeleteMultiDocumentRequest request, + CancellationToken cancellationToken = default) + { + var response = await Internal.DeleteMultiExtensions.DeleteManyAsync(_elasticClient, request.DocumentIds, request.IndexName, cancellationToken); + return new DeleteMultiResponse(response); + } + + public async Task ClearDocumentAsync(string indexNameOrAlias, CancellationToken cancellationToken = default) + { + var deleteByQueryRequest = new DeleteByQueryRequest(indexNameOrAlias) + { + Query = new QueryContainer(new MatchAllQuery()) + }; + return new(await _elasticClient.DeleteByQueryAsync(deleteByQueryRequest, cancellationToken)); + } + + /// + /// Update the document + /// only if the document exists + /// + /// + /// + /// + /// + /// + public async Task UpdateDocumentAsync( + UpdateDocumentRequest request, + CancellationToken cancellationToken = default) + where TDocument : class + { + if (request.Request.Document != null) + { + var response = await _elasticClient.UpdateAsync( + request.Request.DocumentId, + opt => opt.Doc(request.Request.Document).Index(request.IndexName), + cancellationToken); + return new UpdateResponse(response); + } + + IUpdateRequest updateRequest = + new UpdateRequest(request.IndexName, request.Request.DocumentId) + { + Doc = request.Request.PartialDocument! + }; + return new UpdateResponse(await _elasticClient.UpdateAsync(updateRequest, cancellationToken)); + } + + /// + /// Update documents in batches + /// only when the documents exist + /// + /// + /// + /// + /// + public async Task UpdateMultiDocumentAsync( + UpdateMultiDocumentRequest request, + CancellationToken cancellationToken = default) + where TDocument : class + { + BulkDescriptor descriptor = new BulkDescriptor(request.IndexName); + foreach (var item in request.Items) + { + if (item.Document != null) + { + descriptor + .Update(opt => opt.Doc(item.Document) + .Index(request.IndexName) + .Id(item.DocumentId)); + } + else + { + descriptor + .Update(opt => opt.Doc(item.PartialDocument!) + .Index(request.IndexName) + .Id(item.DocumentId)); + } + } + + var response = await _elasticClient.BulkAsync(descriptor, cancellationToken); + return new UpdateMultiResponse(response); + } + + public async Task> GetAsync( + GetDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + IGetRequest getRequest = new GetRequest(request.IndexName, request.Id); + return new Response.GetResponse(await _elasticClient.GetAsync(getRequest, cancellationToken)); + } + + public async Task> GetMultiAsync( + GetMultiDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class + { + var response = (await + _elasticClient.GetManyAsync(request.Ids, request.IndexName, cancellationToken) + )?.ToList() ?? new List>(); + + if (response.Count == request.Ids.Count()) + return new GetMultiResponse(true, "success", response); + + return new GetMultiResponse(false, "Failed to get document"); + } + + public async Task> GetListAsync( + QueryOptions options, + CancellationToken cancellationToken = default) where TDocument : class + { + var response = await QueryString( + options.IndexName, + options.Skip, + options.Take, + options, + cancellationToken); + return new Response.SearchResponse(response); + } + + public async Task> GetPaginatedListAsync( + PaginatedOptions options, + CancellationToken cancellationToken = default) where TDocument : class + { + var response = await QueryString( + options.IndexName, + (options.Page - 1) * options.PageSize, + options.PageSize, + options, + cancellationToken); + return new SearchPaginatedResponse(options.PageSize, response); + } + + private Task> QueryString( + string? indexName, + int skip, + int take, + QueryBaseOptions queryBaseOptions, + CancellationToken cancellationToken = default) + where TDocument : class + { + return _elasticClient.SearchAsync(s => s + .Index(indexName) + .From(skip) + .Size(take) + .Query(q => q + .QueryString(qs => GetQueryDescriptor(qs, queryBaseOptions)) + ), cancellationToken); + } + + private static QueryStringQueryDescriptor GetQueryDescriptor( + QueryStringQueryDescriptor queryDescriptor, + QueryBaseOptions queryBaseOptions) + where TDocument : class + { + queryDescriptor = queryDescriptor.Query(queryBaseOptions.Query); + queryDescriptor = queryDescriptor.DefaultOperator(queryBaseOptions.Operator); + if (!string.IsNullOrEmpty(queryBaseOptions.DefaultField)) + queryDescriptor.DefaultField(queryBaseOptions.DefaultField); + + if (queryBaseOptions.Fields.Any()) + queryDescriptor.Fields(queryBaseOptions.Fields.ToArray()); + + queryBaseOptions.Action?.Invoke(queryDescriptor); + + return queryDescriptor; + } + + #endregion +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs new file mode 100644 index 000000000..b51e57a0a --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchOptions.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class ElasticsearchOptions +{ + public bool IsDefault { get; set; } + + public bool UseConnectionPool { get; private set; } + + internal string[] Nodes { get; private set; } + + internal StaticConnectionPoolOptions StaticConnectionPoolOptions { get; } + + internal ConnectionSettingsOptions ConnectionSettingsOptions { get; } + + internal Action? Action { get; private set; } + + public ElasticsearchOptions(params string[] nodes) + { + if (nodes.Length == 0) + throw new ArgumentException("Please specify the Elasticsearch node address"); + + IsDefault = false; + Nodes = nodes; + UseConnectionPool = nodes.Length > 1; + ConnectionSettingsOptions = new(); + StaticConnectionPoolOptions = new(); + Action = null; + } + + public ElasticsearchOptions UseDefault() + { + IsDefault = true; + return this; + } + + public ElasticsearchOptions UseNodes(params string[] nodes) + { + if (nodes == null || nodes.Length == 0) + throw new ArgumentException("Please enter the Elasticsearch node address"); + + Nodes = nodes; + UseConnectionPool = nodes.Length > 1; + return this; + } + + public ElasticsearchOptions UseRandomize(bool randomize) + { + StaticConnectionPoolOptions.UseRandomize(randomize); + return this; + } + + public ElasticsearchOptions UseDateTimeProvider(IDateTimeProvider dateTimeProvider) + { + StaticConnectionPoolOptions.UseDateTimeProvider(dateTimeProvider); + return this; + } + + public ElasticsearchOptions UseConnectionSettings(Action action) + { + Action = action; + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs new file mode 100644 index 000000000..8927fa4a1 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ElasticsearchRelations.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class ElasticsearchRelations +{ + public bool IsDefault { get; private set; } + + public string Name { get; } + + public Uri[] Nodes { get; } + + public bool UseConnectionPool { get; } + + internal StaticConnectionPoolOptions? StaticConnectionPoolOptions { get; private set; } + + internal ConnectionSettingsOptions? ConnectionSettingsOptions { get; private set; } + + internal Action? Action { get; private set; } + + public ElasticsearchRelations(string name, bool useConnectionPool, Uri[] nodes) + { + Name = name; + IsDefault = false; + UseConnectionPool = useConnectionPool; + Nodes = nodes; + Action = null; + StaticConnectionPoolOptions = null; + ConnectionSettingsOptions = null; + } + + public ElasticsearchRelations UseDefault() + { + IsDefault = true; + return this; + } + + public ElasticsearchRelations UseStaticConnectionPoolOptions(StaticConnectionPoolOptions staticConnectionPoolOptions) + { + StaticConnectionPoolOptions = staticConnectionPoolOptions; + return this; + } + + public ElasticsearchRelations UseConnectionSettingsOptions(ConnectionSettingsOptions connectionSettingsOptions) + { + ConnectionSettingsOptions = connectionSettingsOptions; + return this; + } + + public ElasticsearchRelations UseConnectionSettings(Action? action) + { + Action = action; + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs new file mode 100644 index 000000000..0ad3b3cdb --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/IElasticsearchFactory.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public interface IElasticsearchFactory +{ + IMasaElasticClient CreateClient(); + + IMasaElasticClient CreateClient(string name); + + IElasticClient CreateElasticClient(); + + IElasticClient CreateElasticClient(string name); +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs new file mode 100644 index 000000000..a418e5fcb --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/IMasaElasticClient.cs @@ -0,0 +1,153 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public interface IMasaElasticClient +{ + #region index manage + + Task IndexExistAsync( + string indexName, + CancellationToken cancellationToken = default); + + Task CreateIndexAsync( + string indexName, + CreateIndexOptions? options = null, + CancellationToken cancellationToken = default); + + Task DeleteIndexAsync(string indexName, + CancellationToken cancellationToken = default); + + Task DeleteMultiIndexAsync( + IEnumerable indexNames, + CancellationToken cancellationToken = default); + + Task DeleteIndexByAliasAsync( + string alias, + CancellationToken cancellationToken = default); + + Task GetAllIndexAsync(CancellationToken cancellationToken = default); + + Task GetIndexByAliasAsync( + string alias, + CancellationToken cancellationToken = default); + + #endregion + + #region alias manage + + Task GetAllAliasAsync(CancellationToken cancellationToken = default); + + Task GetAliasByIndexAsync( + string indexName, + CancellationToken cancellationToken = default); + + Task BindAliasAsync( + BindAliasIndexOptions options, + CancellationToken cancellationToken = default); + + Task UnBindAliasAsync( + UnBindAliasIndexOptions options, + CancellationToken cancellationToken = default); + + #endregion + + #region document manage + + Task DocumentExistsAsync( + ExistDocumentRequest request, + CancellationToken cancellationToken = default); + + Task DocumentCountAsync(CountDocumentRequest request, CancellationToken cancellationToken = default); + + /// + /// Add a new document + /// only when the document does not exist + /// + /// + /// + /// + /// + Task CreateDocumentAsync( + CreateDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + /// + /// Add new documents in batches + /// only when the documents do not exist + /// + /// + /// + /// + /// + Task CreateMultiDocumentAsync( + CreateMultiDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + /// + /// Update or insert document + /// Overwrite if it exists, add new if it does not exist + /// + /// + /// + /// + /// + Task SetDocumentAsync( + SetDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + Task DeleteDocumentAsync( + DeleteDocumentRequest request, + CancellationToken cancellationToken = default); + + Task DeleteMultiDocumentAsync( + DeleteMultiDocumentRequest request, + CancellationToken cancellationToken = default); + + Task ClearDocumentAsync(string indexNameOrAlias, CancellationToken cancellationToken = default); + + /// + /// Update the document + /// only if the document exists + /// + /// + /// + /// + /// + Task UpdateDocumentAsync( + UpdateDocumentRequest request, + CancellationToken cancellationToken = default) + where TDocument : class; + + /// + /// Update documents in batches + /// only when the documents exist + /// + /// + /// + /// + /// + Task UpdateMultiDocumentAsync( + UpdateMultiDocumentRequest request, + CancellationToken cancellationToken = default) + where TDocument : class; + + Task> GetAsync( + GetDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + Task> GetMultiAsync( + GetMultiDocumentRequest request, + CancellationToken cancellationToken = default) where TDocument : class; + + Task> GetListAsync( + QueryOptions options, + CancellationToken cancellationToken = default) where TDocument : class; + + Task> GetPaginatedListAsync( + PaginatedOptions options, + CancellationToken cancellationToken = default) where TDocument : class; + + #endregion +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs new file mode 100644 index 000000000..3c49a012d --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Internal/BulkOperation/BulkDeleteOperation.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Internal.BulkOperation; + +public class BulkDeleteOperation : BulkOperationBase +{ + public BulkDeleteOperation(Id id) => Id = id; + + protected override object GetBody() => null!; + + protected override Type ClrType { get; } = default!; + + protected override string Operation => "delete"; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs new file mode 100644 index 000000000..899427d51 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Internal/DeleteMultiExtensions.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Internal; + +internal static class DeleteMultiExtensions +{ + public static Task DeleteManyAsync( + this IElasticClient client, + IEnumerable documentIds, + IndexName index, + CancellationToken cancellationToken = default ) + { + var bulkRequest = CreateDeleteBulkRequest(documentIds, index); + return client.BulkAsync(bulkRequest, cancellationToken); + } + + private static BulkRequest CreateDeleteBulkRequest(IEnumerable documentIds, IndexName index) + { + ArgumentNullException.ThrowIfNull(documentIds, nameof(documentIds)); + var bulkRequest = new BulkRequest(index); + var deletes = documentIds + .Select(id => new BulkDeleteOperation(new Id(id))) + .Cast() + .ToList(); + + bulkRequest.Operations = new BulkOperationsCollection(deletes); + return bulkRequest; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj new file mode 100644 index 000000000..1ad8a42e0 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Masa.Utils.Data.Elasticsearch.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs new file mode 100644 index 000000000..63fc923bb --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/MasaElasticsearchBuilder.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch; + +public class MasaElasticsearchBuilder +{ + public IServiceCollection Services { get; } + + public IElasticClient ElasticClient { get; } + + public IMasaElasticClient Client { get; } + + public MasaElasticsearchBuilder(IServiceCollection services, IElasticClient elasticClient) + { + Services = services; + ElasticClient = elasticClient; + Client = new DefaultMasaElasticClient(elasticClient); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs new file mode 100644 index 000000000..a9385d3aa --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/BindAliasIndexOptions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Alias; + +public class BindAliasIndexOptions +{ + public IEnumerable IndexNames { get; } = default!; + + public string Alias { get; } + + private BindAliasIndexOptions(string alias) => Alias = alias; + + public BindAliasIndexOptions(string alias, string indexName) : this(alias) + { + if (string.IsNullOrEmpty(indexName)) + throw new ArgumentException("indexName cannot be empty", nameof(indexName)); + + IndexNames = new[] { indexName }; + } + + public BindAliasIndexOptions(string alias, IEnumerable indexNames) : this(alias) + { + ArgumentNullException.ThrowIfNull(nameof(indexNames)); + IndexNames = indexNames; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs new file mode 100644 index 000000000..ea787ffd4 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Alias/UnBindAliasIndexOptions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Alias; + +public class UnBindAliasIndexOptions +{ + public IEnumerable IndexNames { get; } = default!; + + public string Alias { get; } + + private UnBindAliasIndexOptions(string alias) => Alias = alias; + + public UnBindAliasIndexOptions(string alias, string indexName) : this(alias) + { + if (string.IsNullOrEmpty(indexName)) + throw new ArgumentException("indexName cannot be empty", nameof(indexName)); + + IndexNames = new[] { indexName }; + } + + public UnBindAliasIndexOptions(string alias, IEnumerable indexNames) : this(alias) + { + ArgumentNullException.ThrowIfNull(nameof(indexNames)); + IndexNames = indexNames; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs new file mode 100644 index 000000000..bf5909f09 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/ConnectionSettingsOptions.cs @@ -0,0 +1,38 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options; + +public class ConnectionSettingsOptions +{ + internal IConnection? Connection { get; set; } + + internal ConnectionSettings.SourceSerializerFactory? SourceSerializerFactory { get; set; } + + internal IPropertyMappingProvider? PropertyMappingProvider { get; set; } + + public ConnectionSettingsOptions() + { + Connection = null; + SourceSerializerFactory = null; + PropertyMappingProvider = null; + } + + public ConnectionSettingsOptions UseConnection(IConnection? connection) + { + Connection = connection; + return this; + } + + public ConnectionSettingsOptions UseSourceSerializerFactory(ConnectionSettings.SourceSerializerFactory? sourceSerializerFactory) + { + SourceSerializerFactory = sourceSerializerFactory; + return this; + } + + public ConnectionSettingsOptions UsePropertyMappingProvider(IPropertyMappingProvider? propertyMappingProvider) + { + PropertyMappingProvider = propertyMappingProvider; + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs new file mode 100644 index 000000000..200f1fcfa --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Count/CountDocumentRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Count; + +public class CountDocumentRequest : DocumentOptions +{ + public CountDocumentRequest(string indexNameOrAlias) : base(indexNameOrAlias) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs new file mode 100644 index 000000000..fe9ec9b91 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentItemRequest.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Create; + +public class CreateDocumentItemRequest : SingleDocumentBaseRequest + where TDocument : class +{ + public CreateDocumentItemRequest(TDocument document, string? documentId) : base(document, documentId) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs new file mode 100644 index 000000000..ba8ef25b0 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateDocumentRequest.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Create; + +public class CreateDocumentRequest : DocumentOptions where TDocument : class +{ + public SingleDocumentBaseRequest Request { get; } + + public CreateDocumentRequest(string indexName, TDocument document, string? documentId) : base(indexName) + => Request = new SingleDocumentBaseRequest(document, documentId); +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs new file mode 100644 index 000000000..a9bbca495 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Create/CreateMultiDocumentRequest.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Create; + +public class CreateMultiDocumentRequest : DocumentOptions where TDocument : class +{ + public List> Items { get; set; } + + public CreateMultiDocumentRequest(string indexName) : base(indexName) => Items = new(); + + public CreateMultiDocumentRequest(string indexName, TDocument document, string? documentId = null) : this(indexName) + => AddDocument(document, documentId); + + public CreateMultiDocumentRequest(string indexName, IEnumerable> datas) : this(indexName) + { + ArgumentNullException.ThrowIfNull(datas, nameof(datas)); + + foreach (var data in datas) AddDocument(data.Document, data.DocumentId); + } + + public CreateMultiDocumentRequest AddDocument(TDocument document, string? documentId = null) + => AddDocument(new SingleDocumentBaseRequest(document, documentId)); + + public CreateMultiDocumentRequest AddDocument(SingleDocumentBaseRequest item) + { + Items.Add(item); + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs new file mode 100644 index 000000000..eb7707b9d --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteDocumentRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Delete; + +public class DeleteDocumentRequest : DocumentOptions +{ + public string DocumentId { get; } + + public DeleteDocumentRequest(string indexName, string documentId) : base(indexName) => DocumentId = documentId; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs new file mode 100644 index 000000000..cb3bde72c --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Delete/DeleteMultiDocumentRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Delete; + +public class DeleteMultiDocumentRequest : DocumentOptions +{ + public IEnumerable DocumentIds { get; } + + public DeleteMultiDocumentRequest(string indexName, params string[] documentIds) : base(indexName) + => DocumentIds = documentIds; + + public DeleteMultiDocumentRequest(string indexName, IEnumerable documentIds) : base(indexName) + => DocumentIds = documentIds; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs new file mode 100644 index 000000000..9242b3303 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/DocumentOptions.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document; + +public class DocumentOptions +{ + public string IndexName { get; } + + public DocumentOptions(string indexName) + { + if (string.IsNullOrEmpty(indexName)) + throw new ArgumentException("indexName cannot be empty",nameof(indexName)); + + IndexName = indexName; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs new file mode 100644 index 000000000..6d55d93e2 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Exist/ExistDocumentRequest.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Exist; + +public class ExistDocumentRequest : DocumentOptions +{ + public string DocumentId { get; set; } + + public ExistDocumentRequest(string indexName, string documentId) : base(indexName) + => DocumentId = documentId; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs new file mode 100644 index 000000000..2c03ac347 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetDocumentRequest.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Get; + +public class GetDocumentRequest : DocumentOptions +{ + public string Id { get; } + + public GetDocumentRequest(string indexName, string id) : base(indexName) => Id = id; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs new file mode 100644 index 000000000..d175c5cab --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Get/GetMultiDocumentRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Get; + +public class GetMultiDocumentRequest : DocumentOptions +{ + public IEnumerable Ids { get; } + + public GetMultiDocumentRequest(string indexName,params string[] ids) : base(indexName) + => Ids = ids; + + public GetMultiDocumentRequest(string indexName, IEnumerable ids) : base(indexName) + => Ids = ids; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs new file mode 100644 index 000000000..ded6c7b3a --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/PaginatedOptions.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Query; + +public class PaginatedOptions : QueryBaseOptions + where TDocument : class +{ + public int Page { get; } + + public int PageSize { get; } + + public PaginatedOptions( + string indexName, + string query, + string defaultField, + int page, + int pageSize, + Operator @operator = Operator.Or) + : base(indexName, query, defaultField, @operator) + { + Page = page; + PageSize = pageSize; + } + + public PaginatedOptions( + string indexName, + string query, + IEnumerable fields, + int page, + int pageSize, + Operator @operator = Operator.Or) + : base(indexName, query, fields, @operator) + { + Page = page; + PageSize = pageSize; + } + + public new PaginatedOptions UseFields(params string[] fields) + { + base.UseFields(fields); + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs new file mode 100644 index 000000000..42e1cb00f --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryBaseOptions.cs @@ -0,0 +1,45 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Query; + +public class QueryBaseOptions : DocumentOptions + where TDocument : class +{ + public string? DefaultField { get; } + + public IEnumerable Fields { get; private set; } + + public string Query { get; } + + public Operator Operator { get; set; } + + public Action>? Action { get; set; } + + public QueryBaseOptions(string indexName, string query, string? defaultField = null, Operator @operator = Operator.Or) + : base(indexName) + { + DefaultField = defaultField; + Fields = Array.Empty(); + Query = query; + Operator = @operator; + } + + public QueryBaseOptions(string indexName, string query, IEnumerable? fields = null, Operator @operator = Operator.Or) + : base(indexName) + { + DefaultField = string.Empty; + Fields = fields ?? Array.Empty(); + Query = query; + Operator = @operator; + } + + public QueryBaseOptions UseFields(params string[] fields) + { + if (string.IsNullOrEmpty(DefaultField)) + throw new NotSupportedException("Does not support the assignment of DefaultField and Fields at the same time"); + + Fields = fields; + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs new file mode 100644 index 000000000..5817949a9 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Query/QueryOptions.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Query; + +public class QueryOptions : QueryBaseOptions + where TDocument : class +{ + public int Skip { get; } + + public int Take { get; } + + public QueryOptions(string indexName, string query, string defaultField, int skip, int take, Operator @operator = Operator.Or) + : base(indexName, query, defaultField, @operator) + { + Skip = skip; + Take = take; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs new file mode 100644 index 000000000..42c90e9a7 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentItemBaseRequest.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Set; + +public class SetDocumentItemBaseRequest : SingleDocumentBaseRequest + where TDocument : class +{ + public SetDocumentItemBaseRequest(TDocument document, string? documentId) : base(document, documentId) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs new file mode 100644 index 000000000..004723124 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Set/SetDocumentRequest.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Set; + +public class SetDocumentRequest : DocumentOptions where TDocument : class +{ + public List> Items { get; set; } + + public SetDocumentRequest(string indexName) : base(indexName) => Items = new(); + + public SetDocumentRequest(string indexName, TDocument document, string? documentId = null) : this(indexName) + => AddDocument(document, documentId); + + public SetDocumentRequest(string indexName, IEnumerable> datas) : this(indexName) + { + ArgumentNullException.ThrowIfNull(datas, nameof(datas)); + + foreach (var data in datas) AddDocument(data.Document, data.DocumentId); + } + + public SetDocumentRequest AddDocument(TDocument document, string? documentId = null) + => AddDocument(new SingleDocumentBaseRequest(document, documentId)); + + public SetDocumentRequest AddDocument(SingleDocumentBaseRequest item) + { + Items.Add(item); + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs new file mode 100644 index 000000000..7a3ee84a6 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/SingleDocumentBaseRequest.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document; + +public class SingleDocumentBaseRequest where TDocument : class +{ + public TDocument Document { get; } + + public string? DocumentId { get; } + + public SingleDocumentBaseRequest(TDocument document, string? documentId) + { + Document = document; + DocumentId = documentId ?? Guid.NewGuid().ToString(); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs new file mode 100644 index 000000000..ba6c060d5 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentBaseRequest.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Update; + +public class UpdateDocumentBaseRequest where TDocument : class +{ + public TDocument? Document { get; } + + public object? PartialDocument { get; } + + public string? DocumentId { get; } + + public UpdateDocumentBaseRequest(TDocument document, string? documentId = null) + { + Document = document; + DocumentId = documentId; + } + + public UpdateDocumentBaseRequest(object partialDocument, string? documentId = null) + { + PartialDocument = partialDocument; + DocumentId = documentId; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs new file mode 100644 index 000000000..ddaf95607 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateDocumentRequest.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Update; + +public class UpdateDocumentRequest : DocumentOptions where TDocument : class +{ + public UpdateDocumentBaseRequest Request { get; } + + public UpdateDocumentRequest(string indexName, TDocument document, string? documentId = null) : base(indexName) + => Request = new UpdateDocumentBaseRequest(document, documentId); + + public UpdateDocumentRequest(string indexName, object partialDocument, string? documentId = null) : base(indexName) + => Request = new UpdateDocumentBaseRequest(partialDocument, documentId); +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs new file mode 100644 index 000000000..bba9db635 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Document/Update/UpdateMultiDocumentRequest.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Document.Update; + +public class UpdateMultiDocumentRequest : DocumentOptions where TDocument : class +{ + public List> Items { get; set; } + + public UpdateMultiDocumentRequest(string indexName) : base(indexName) + => Items = new(); + + public UpdateMultiDocumentRequest AddDocument(UpdateDocumentBaseRequest item) + { + Items.Add(item); + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs new file mode 100644 index 000000000..6697a7975 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/ElasticsearchRelationsOptions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options; + +public class ElasticsearchRelationsOptions +{ + internal readonly Dictionary Relations = new(); + + public ElasticsearchRelationsOptions AddRelation(string name, ElasticsearchOptions options) + { + Uri[] nodes = options.Nodes.Select(uriString => new Uri(uriString)).ToArray(); + ElasticsearchRelations relation = new ElasticsearchRelations(name, options.UseConnectionPool, nodes) + .UseStaticConnectionPoolOptions(options.StaticConnectionPoolOptions) + .UseConnectionSettingsOptions(options.ConnectionSettingsOptions) + .UseConnectionSettings(options.Action); + Relations.Add(name, relation); + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs new file mode 100644 index 000000000..3fc7ffbd6 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Index/CreateIndexOptions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Index; + +public class CreateIndexOptions +{ + public IIndexSettings? IndexSettings { get; set; } = null; + + public IAliases? Aliases { get; set; } = null; + + public ITypeMapping? Mappings { get; set; } = null; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs new file mode 100644 index 000000000..520278d63 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/Index/DeleteIndexOptions.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options.Index; + +public class DeleteIndexOptions +{ + public string Alias { get; set; } = default!; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs new file mode 100644 index 000000000..f11083ec7 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Options/StaticConnectionPoolOptions.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Options; + +public class StaticConnectionPoolOptions +{ + internal bool Randomize { get; set; } + + internal IDateTimeProvider? DateTimeProvider { get; set; } + + public StaticConnectionPoolOptions() + { + Randomize = true; + DateTimeProvider = null; + } + + internal StaticConnectionPoolOptions UseRandomize(bool randomize) + { + Randomize = randomize; + return this; + } + + internal StaticConnectionPoolOptions UseDateTimeProvider(IDateTimeProvider dateTimeProvider) + { + DateTimeProvider = dateTimeProvider; + return this; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/README.md b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/README.md new file mode 100644 index 000000000..13b285e74 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/README.md @@ -0,0 +1,89 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Data.Elasticsearch + +## Example: + +```c# +Install-Package Masa.Utils.Data.Elasticsearch +``` + +#### Basic usage: + +Using Elasticsearch + +```` C# +builder.Services.AddElasticsearch("es", "http://localhost:9200"); // or builder.Services.AddElasticsearchClient("es", "http://localhost:9200"); +```` + +#### Create index: + +```` C# +public async Task CreateIndexAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + await client.CreateIndexAsync(indexName); +} +```` + +#### Delete index: + +```` C# +public async Task DeleteIndexAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + await client.DeleteIndexAsync(indexName); +} +```` + +#### Remove indexes based on aliases: + +```` C# +public async Task DeleteIndexByAliasAsync([FromServices] IMasaElasticClient client) +{ + string alias = "userIndex"; + await client.DeleteIndexByAliasAsync(alias); +} +```` + +### bind alias + +```` C# +public async Task BindAliasAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + string indexName2 = "user_index_2"; + string alias = "userIndex"; + await client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 }); +} +```` + +### Unbind aliases + +```` C# +public async Task BindAliasAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + string indexName2 = "user_index_2"; + string alias = "userIndex"; + await client.UnBindAliasAsync(new UnBindAliasIndexOptions(alias, new[] { indexName, indexName2 })); +} +```` + +> For more methods, please see [IMasaElasticClient](./IMasaElasticClient.cs) + +## FAQ + +1. The error message is: `"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` + + We enable the compatibility mode by default, namely `EnableApiVersioningHeader(true)`, which supports the 8.* version very well, but will cause errors in some 7.*, in this case, you need to manually turn off the compatibility mode, that is, `EnableApiVersioningHeader(false)`. + + ```` C# + service.AddElasticsearchClient("es", option => + { + option.UseNodes("http://localhost:9200") + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); + }); + ```` + +[Why turn on compatibility mode? ](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md new file mode 100644 index 000000000..18a101942 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/README.zh-CN.md @@ -0,0 +1,89 @@ +中 | [EN](README.md) + +## Masa.Utils.Data.Elasticsearch + +## 用例: + +```c# +Install-Package Masa.Utils.Data.Elasticsearch +``` + +#### 基本用法: + +使用Elasticsearch + +``` C# +builder.Services.AddElasticsearch("es", "http://localhost:9200"); // 或者builder.Services.AddElasticsearchClient("es", "http://localhost:9200"); +``` + +#### 创建索引: + +``` C# +public async Task CreateIndexAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + await client.CreateIndexAsync(indexName); +} +``` + +#### 删除索引: + +``` C# +public async Task DeleteIndexAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + await client.DeleteIndexAsync(indexName); +} +``` + +#### 根据别名删除索引: + +``` C# +public async Task DeleteIndexByAliasAsync([FromServices] IMasaElasticClient client) +{ + string alias = "userIndex"; + await client.DeleteIndexByAliasAsync(alias); +} +``` + +### 绑定别名 + +``` C# +public async Task BindAliasAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + string indexName2 = "user_index_2"; + string alias = "userIndex"; + await client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 }); +} +``` + +### 解除别名绑定 + +``` C# +public async Task BindAliasAsync([FromServices] IMasaElasticClient client) +{ + string indexName = "user_index_1"; + string indexName2 = "user_index_2"; + string alias = "userIndex"; + await client.UnBindAliasAsync(new UnBindAliasIndexOptions(alias, new[] { indexName, indexName2 })); +} +``` + +> 更多方法请查看[IMasaElasticClient](./IMasaElasticClient.cs) + +## 常见问题 + +1. 出错提示为:`"Content-Type header [application/vnd.elasticsearch+json; compatible-with=7] is not supported"` + + 我们默认启用兼容模式,即`EnableApiVersioningHeader(true)`,这样对8.*版本支持很好,但在部分7.*会导致错误,此时需要手动关闭兼容模式,即`EnableApiVersioningHeader(false)`。 + + ``` C# + service.AddElasticsearchClient("es", option => + { + option.UseNodes("http://localhost:9200") + .UseConnectionSettings(setting => setting.EnableApiVersioningHeader(false)); + }); + ``` + +[为何开启兼容模式?](https://github.com/elastic/elasticsearch-net/issues/6154) \ No newline at end of file diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs new file mode 100644 index 000000000..8e97da026 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/BulkAliasResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Alias; + +public class BulkAliasResponse : ResponseBase +{ + public BulkAliasResponse(Nest.BulkAliasResponse bulkAliasResponse) : base(bulkAliasResponse) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs new file mode 100644 index 000000000..28b5846b8 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Alias/GetAliasResponse.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Alias; + +public class GetAliasResponse : ResponseBase +{ + public IEnumerable Aliases { get; } + + public GetAliasResponse(CatResponse catResponse) : base(catResponse) + => Aliases = catResponse.IsValid ? catResponse.Records.Select(r => r.Alias).ToArray() : Array.Empty(); + + public GetAliasResponse(Nest.GetAliasResponse getAliasResponse) : base(getAliasResponse) + { + Aliases = getAliasResponse.IsValid + ? getAliasResponse.Indices + .Select(item => item.Value) + .SelectMany(indexAlias => indexAlias.Aliases) + .Select(alias => alias.Key).Distinct().ToArray() + : Array.Empty(); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs new file mode 100644 index 000000000..0a01a010f --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponse.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class BulkResponse : ResponseBase +{ + public List Items { get; set; } + + public BulkResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + Items = bulkResponse.Items.Select(item => new BulkResponseItems(item.Id, item.IsValid, item.Error?.ToString() ?? string.Empty)).ToList(); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs new file mode 100644 index 000000000..2fd7bacae --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/BulkResponseItems.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class BulkResponseItems +{ + /// + /// The id of the document for the bulk operation + /// + public string Id { get; } + + public bool IsValid { get; } + + public string Message { get; } + + public BulkResponseItems(string id, bool isValid, string message) + { + Id = id; + IsValid = isValid; + Message = message; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs new file mode 100644 index 000000000..b2f60e8d3 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/CreateMultiResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class CreateMultiResponse : BulkResponse +{ + public CreateMultiResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs new file mode 100644 index 000000000..ad50cf6f3 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/CreateResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class CreateResponse : ResponseBase +{ + public CreateResponse(Nest.CreateResponse createResponse) : base(createResponse) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs new file mode 100644 index 000000000..6fc2570e4 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteMultiResponse.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class DeleteMultiResponse : ResponseBase +{ + public List Data { get; set; } + + public DeleteMultiResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + Data = bulkResponse.Items.Select(item => + new DeleteRangeResponseItems(item.Id, + item.IsValid && item.Status == 200, + !string.IsNullOrEmpty(item.Result) ? item.Result : item.Error?.ToString() ?? string.Empty)).ToList(); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs new file mode 100644 index 000000000..785d24796 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteRangeResponseItems.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class DeleteRangeResponseItems +{ + public string Id { get; } + + public bool IsValid { get; } + + public string Message { get; } + + public DeleteRangeResponseItems(string id, bool isValid, string message) + { + Id = id; + IsValid = isValid; + Message = message; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs new file mode 100644 index 000000000..ab6a99db6 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/DeleteResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class DeleteResponse : ResponseBase +{ + public DeleteResponse(Nest.DeleteResponse deleteResponse) : base(deleteResponse) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs new file mode 100644 index 000000000..9b13a2fbd --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Document/ClearDocumentResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Document; + +public class ClearDocumentResponse : ResponseBase +{ + public ClearDocumentResponse(DeleteByQueryResponse response) : base(response) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs new file mode 100644 index 000000000..ef46ae530 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Document/CountDocumentResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Document; + +public class CountDocumentResponse : ResponseBase +{ + public long Count { get; } + + public CountDocumentResponse(CountResponse response) : base(response) => Count = response.Count; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs new file mode 100644 index 000000000..6436bf54f --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/ExistsResponse.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class ExistsResponse : ResponseBase +{ + public bool Exists { get; } + + public ExistsResponse(Nest.ExistsResponse existsResponse) : base( + existsResponse.IsValid || existsResponse.ApiCall.HttpStatusCode == 404, + existsResponse.IsValid || existsResponse.ApiCall.HttpStatusCode == 404 ? "success" : existsResponse.ServerError?.ToString() ?? string.Empty) + { + Exists = existsResponse.Exists; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs new file mode 100644 index 000000000..d22106c0e --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponse.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class GetMultiResponse : ResponseBase + where TDocument : class +{ + public List> Data { get; set; } + + public GetMultiResponse(bool isValid, string message, List>? multiGetHits = null) : base(isValid, message) + { + Data = multiGetHits?.Select(res => new GetMultiResponseItems(res.Id, res.Source)).ToList() ?? new(); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs new file mode 100644 index 000000000..2a023fbc9 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetMultiResponseItems.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class GetMultiResponseItems + where TDocument : class +{ + public string Id { get; } + + public TDocument Document { get; } + + public GetMultiResponseItems(string id, TDocument document) + { + Id = id; + Document = document; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs new file mode 100644 index 000000000..15333ce89 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/GetResponse.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class GetResponse : ResponseBase + where TDocument : class +{ + public TDocument Document { get; set; } + + public GetResponse(IGetResponse getResponse) : base(getResponse) + { + Document = getResponse.Source; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs new file mode 100644 index 000000000..dcf7915c4 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/CreateIndexResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Index; + +public class CreateIndexResponse : ResponseBase +{ + public CreateIndexResponse(Nest.CreateIndexResponse createIndexResponse) : base(createIndexResponse) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs new file mode 100644 index 000000000..4059fef64 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/DeleteIndexResponse.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Index; + +public class DeleteIndexResponse : ResponseBase +{ + public DeleteIndexResponse(Nest.DeleteIndexResponse deleteIndexResponse) : base(deleteIndexResponse) + { + } + + public DeleteIndexResponse(BulkAliasResponse bulkAliasResponse) : base(bulkAliasResponse) + { + } + + public DeleteIndexResponse(string message) : base(false, message) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs new file mode 100644 index 000000000..d045eb27b --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexByAliasResponse.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Index; + +public class GetIndexByAliasResponse : ResponseBase +{ + public string[] IndexNames { get; } + + public GetIndexByAliasResponse(CatResponse catResponse) : base(catResponse) + { + IndexNames = catResponse.IsValid ? catResponse.Records.Select(r => r.Index).ToArray() : Array.Empty(); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs new file mode 100644 index 000000000..d7a4feb05 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/Index/GetIndexResponse.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response.Index; + +public class GetIndexResponse : ResponseBase +{ + public string[] IndexNames { get; set; } + + public GetIndexResponse(CatResponse catResponse) : base(catResponse) + { + IndexNames = catResponse.IsValid ? catResponse.Records.Select(r => r.Index).ToArray() : Array.Empty(); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs new file mode 100644 index 000000000..1e7ea5b55 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/ResponseBase.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class ResponseBase +{ + public bool IsValid { get; } + + public string Message { get; } + + protected ResponseBase(bool isValid, string message) + { + IsValid = isValid; + Message = message; + } + + public ResponseBase(IResponse response) : this(response.IsValid, response.IsValid ? "success" : response.ServerError?.ToString() ?? string.Empty) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs new file mode 100644 index 000000000..da4843bb7 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SearchPaginatedResponse.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class SearchPaginatedResponse : SearchResponse + where TDocument : class +{ + public long Total { get; set; } + + public int TotalPages { get; set; } + + public SearchPaginatedResponse(ISearchResponse searchResponse) : base(searchResponse) + { + Total = searchResponse.Hits.Count; + } + + public SearchPaginatedResponse(int pageSize, ISearchResponse searchResponse) : this(searchResponse) + { + TotalPages = (int)Math.Ceiling(Total / (decimal)pageSize); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs new file mode 100644 index 000000000..309f8f424 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SearchResponse.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class SearchResponse : ResponseBase + where TDocument : class +{ + public List Data { get; } + + public SearchResponse(ISearchResponse searchResponse) : base(searchResponse) + { + Data = searchResponse.Hits.Select(hit => hit.Source).ToList(); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs new file mode 100644 index 000000000..76e03529e --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/SetResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class SetResponse : BulkResponse +{ + public SetResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs new file mode 100644 index 000000000..039be8e1e --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateMultiResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class UpdateMultiResponse : BulkResponse +{ + public UpdateMultiResponse(Nest.BulkResponse bulkResponse) : base(bulkResponse) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs new file mode 100644 index 000000000..75763fcaa --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/Response/UpdateResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Response; + +public class UpdateResponse : ResponseBase +{ + public UpdateResponse(IUpdateResponse updateResponse) : base(updateResponse) + { + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs new file mode 100644 index 000000000..0a3912065 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.Extensions.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static partial class ServiceCollectionExtensions +{ + private static MasaElasticsearchBuilder CreateElasticsearchClient(this IServiceCollection services, string name) + { + var elasticClient = services.BuildServiceProvider().GetRequiredService().CreateElasticClient(name); + return new MasaElasticsearchBuilder(services, elasticClient); + } + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services) + => services.AddElasticsearch().CreateElasticsearchClient(Const.DEFAULT_CLIENT_NAME); + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string[]? nodes) + => services + .AddElasticsearch(Const.DEFAULT_CLIENT_NAME, nodes == null || nodes.Length == 0 ? new[] {"http://localhost:9200"} : nodes) + .CreateElasticsearchClient(Const.DEFAULT_CLIENT_NAME); + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string name, params string[] nodes) + => services.AddElasticsearch(name, nodes).CreateElasticsearchClient(name); + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string name, Action action) + => services.AddElasticsearch(name, action).CreateElasticsearchClient(name); + + public static MasaElasticsearchBuilder AddElasticsearchClient(this IServiceCollection services, string name, Func func) + => services.AddElasticsearch(name, func).CreateElasticsearchClient(name); +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..feba8bd2c --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/ServiceCollectionExtensions.cs @@ -0,0 +1,75 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static partial class ServiceCollectionExtensions +{ + public static IServiceCollection AddElasticsearch(this IServiceCollection services, string[]? nodes = null) + { + if (nodes == null || nodes.Length == 0) + { + nodes = new[] {"http://localhost:9200"}; + } + + return services.AddElasticsearch(Const.DEFAULT_CLIENT_NAME, nodes); + } + + public static IServiceCollection AddElasticsearch(this IServiceCollection services, string name, params string[] nodes) + => services.AddElasticsearch(name, options => options.UseNodes(nodes)); + + public static IServiceCollection AddElasticsearch(this IServiceCollection services, string name, Action action) + { + return services.AddElasticsearch(name, () => + { + ElasticsearchOptions options = new("http://localhost:9200"); + action.Invoke(options); + return options; + }); + } + + public static IServiceCollection AddElasticsearch(this IServiceCollection services, string name, Func func) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentNullException(nameof(name)); + } + + AddElasticsearchCore(services); + + services.TryAddOrUpdateElasticsearchRelation(name, func.Invoke()); + + return services; + } + + private static IServiceCollection AddElasticsearchCore(this IServiceCollection services) + { + ArgumentNullException.ThrowIfNull(services); + + services.TryAddSingleton(); + + services.TryAddSingleton(serviceProvider => + serviceProvider.GetRequiredService().CreateElasticClient()); + + services.TryAddSingleton(serviceProvider => + new DefaultMasaElasticClient(serviceProvider.GetRequiredService())); + + services.TryAddSingleton(new ElasticsearchRelationsOptions()); + + return services; + } + + private static void TryAddOrUpdateElasticsearchRelation(this IServiceCollection services, string name, ElasticsearchOptions options) + { + var serviceProvider = services.BuildServiceProvider(); + var relationsOptions = serviceProvider.GetRequiredService(); + + if (relationsOptions.Relations.ContainsKey(name)) + throw new ArgumentException($"The ElasticClient whose name is {name} is exist"); + + if (options.IsDefault && relationsOptions.Relations.Values.Any(r => r.IsDefault)) + throw new ArgumentNullException(nameof(ElasticsearchRelations.IsDefault), "ElasticClient can only have one default"); + + relationsOptions.AddRelation(name, options); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs new file mode 100644 index 000000000..7a55080cd --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Elasticsearch/_Imports.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Elasticsearch.Net; +global using Masa.Utils.Data.Elasticsearch; +global using Masa.Utils.Data.Elasticsearch.Internal.BulkOperation; +global using Masa.Utils.Data.Elasticsearch.Options; +global using Masa.Utils.Data.Elasticsearch.Options.Alias; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Count; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Create; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Delete; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Exist; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Get; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Query; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Set; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Update; +global using Masa.Utils.Data.Elasticsearch.Options.Index; +global using Masa.Utils.Data.Elasticsearch.Response; +global using Masa.Utils.Data.Elasticsearch.Response.Document; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Nest; +global using System.Collections.Concurrent; +global using System.Runtime.Serialization; +global using MASABulkAliasResponse = Masa.Utils.Data.Elasticsearch.Response.Alias.BulkAliasResponse; +global using MASAGetAliasResponse = Masa.Utils.Data.Elasticsearch.Response.Alias.GetAliasResponse; diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs new file mode 100644 index 000000000..b4f33b1db --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Enums/ResultStatuses.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Enums; + +public enum ResultStatuses +{ + Success = 1, + Error +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs new file mode 100644 index 000000000..35391ffc0 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Enums/ResultTypes.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Enums; + +/// +/// reference https://prometheus.io/docs/prometheus/latest/querying/api/#expression-query-result-formats +/// +public enum ResultTypes +{ + Matrix = 1, + Vector, + Scalar, + String +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs new file mode 100644 index 000000000..32c446a66 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/CallerProviderExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +[assembly: InternalsVisibleTo("Masa.Utils.Data.Prometheus.Test")] +namespace Masa.Utils.Caller.Core; + +internal static class CallerProviderExtensions +{ + public static async Task GetAsync(this ICallerProvider caller, string url, object data) + { + var request = new HttpRequestMessage(HttpMethod.Get, $"{url}?{data.ToUrlParam()}"); + var response = await caller.SendAsync(request, autoThrowUserFriendlyException: false); + return await response.Content.ReadAsStringAsync(); + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs new file mode 100644 index 000000000..040a87648 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/ObjectExtensions.cs @@ -0,0 +1,142 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public static class ObjectExtensions +{ + /// + /// Currently supported types: class, struct and types implementing the IEnumerable interface, + /// struct and class use public get properties and fields by default, + /// The IEnumerable type is directly converted to: key[]=value1&key[]=value2 + /// enum uses strings by default. If you need to use numeric values, please set isEnumString=false + /// + /// + /// + /// + /// + /// + public static string? ToUrlParam(this object? obj, bool isEnumString = true, bool isCamelCase = true, bool isUrlEncode = true) + { + return GetValue(obj, string.Empty, isEnumString, isCamelCase, isUrlEncode); + } + + private static string? GetValue(object? obj, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) + { + if (obj == null) return null; + var type = obj.GetType(); + if (type == typeof(string)) + { + var str = (string)obj; + return AppendValue(preStr, str, "=", isUrlEncode); + } + + if (type.IsValueType) + { + if (type.IsEnum) + { + var str = isEnumString ? obj.ToString() : Convert.ToInt32(obj).ToString(); + return AppendValue(preStr, str, "=", isUrlEncode); + } + + //sample value + if (type.IsPrimitive) + { + var str = obj.ToString(); + return AppendValue(preStr, str, "=", isUrlEncode); + } + + //struct + return GetObjValue(type, obj, preStr, isEnumString, isCamelCase, isUrlEncode); + } + + if (type.IsArray || type.GetInterfaces().Any(t => t.Name.IndexOf("IEnumerable") == 0)) + return GetEnumerableValue(obj, preStr, isEnumString, isCamelCase, isUrlEncode); + + if (type.IsClass) + return GetObjValue(type, obj, preStr, isEnumString, isCamelCase, isUrlEncode); + + //current type not suport + return null; + } + + private static string GetObjValue(Type type, object obj, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) + { + var properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty); + var fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetField); + var list = new List(); + + foreach (var item in properties) + { + var str = GetMemerInfoValue(item, item.GetValue(obj), preStr, isEnumString, isCamelCase, isUrlEncode); + if (string.IsNullOrEmpty(str)) + continue; + list.Add(str); + } + + foreach (var item in fields) + { + var str = GetMemerInfoValue(item, item.GetValue(obj), preStr, isEnumString, isCamelCase, isUrlEncode); + if (string.IsNullOrEmpty(str)) + continue; + list.Add(str); + } + + if (!list.Any()) + return default!; + + list.Sort(); + return string.Join('&', list); + } + + private static string? GetMemerInfoValue(MemberInfo info, object? value, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) + { + if (value == null) + return null; + + var name = info.Name; + if (isCamelCase) + name = name.ToCamelCase(); + + return GetValue(value, AppendValue(preStr, name, ".", isUrlEncode) ?? default!, isEnumString, isCamelCase, isUrlEncode); + } + + private static string? GetEnumerableValue(object obj, string preStr, bool isEnumString = false, bool isCamelCase = true, bool isUrlEncode = true) + { + var list = new List(); + foreach (var item in (IEnumerable)obj) + { + if (item is KeyValuePair keyValue) + { + var name = keyValue.Key; + if (isCamelCase) + name = name.ToCamelCase(); + var str = GetValue(keyValue.Value, AppendValue(preStr, name, ".", isUrlEncode) ?? default!, isEnumString, isCamelCase, isUrlEncode); + if (!string.IsNullOrEmpty(str)) + list.Add(str); + } + else + { + var str = GetValue(item, $"{preStr}{(isUrlEncode ? HttpUtility.UrlEncode("[]", Encoding.UTF8) : "[]")}", isEnumString, isCamelCase, isUrlEncode); + if (!string.IsNullOrEmpty(str)) + list.Add(str); + } + } + if (!list.Any()) + return default!; + + list.Sort(); + return string.Join('&', list); + } + + private static string? AppendValue(string preStr, string? value, string splitChar, bool isUrlEncode) + { + if (string.IsNullOrEmpty(preStr) || string.IsNullOrEmpty(value)) + return value; + + if (isUrlEncode) + return $"{preStr}{splitChar}{HttpUtility.UrlEncode(value, Encoding.UTF8)}"; + else + return $"{preStr}{splitChar}{value}"; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs new file mode 100644 index 000000000..a484b7fb1 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Extensions/StringExtensions.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +internal static class StringExtensions +{ + public static string ToCamelCase(this string str) + { + if (string.IsNullOrEmpty(str)) + return default!; + + var span = new ReadOnlySpan(str.ToArray()); + var c = span[0]; + if (c - 'A' >= 0 && c - 'Z' <= 0) + return $"{(char)(c + 32)}{span[1..]}"; + + return str; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs new file mode 100644 index 000000000..cc8c5d508 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/IMasaPrometheusClient.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus; + +public interface IMasaPrometheusClient +{ + Task QueryAsync(QueryRequest query); + + Task QueryRangeAsync(QueryRangeRequest query); + + Task SeriesQueryAsync(MetaDataQueryRequest query); + + Task LabelsQueryAsync(MetaDataQueryRequest query); + + Task LabelValuesQueryAsync(LableValueQueryRequest query); + + Task ExemplarQueryAsync(QueryExemplarRequest query); +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj b/src/Utils/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj new file mode 100644 index 000000000..3424727af --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Masa.Utils.Data.Prometheus.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs new file mode 100644 index 000000000..e243e99a2 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/MasaPrometheusClient.cs @@ -0,0 +1,127 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +[assembly: InternalsVisibleTo("Masa.Utils.Data.Prometheus.Test")] +namespace Masa.Utils.Data.Prometheus; + +internal class MasaPrometheusClient : IMasaPrometheusClient +{ + private readonly ICallerProvider _caller; + private readonly JsonSerializerOptions _jsonSerializerOptions; + + public MasaPrometheusClient(ICallerProvider caller, JsonSerializerOptions jsonSerializerOptions) + { + _caller = caller; + _jsonSerializerOptions = jsonSerializerOptions; + } + + public async Task ExemplarQueryAsync(QueryExemplarRequest query) + { + return await QueryDataAsync("/api/v1/query_exemplars", query); + } + + public async Task LabelsQueryAsync(MetaDataQueryRequest query) + { + return await QueryDataAsync("/api/v1/labels", query); + } + + public async Task LabelValuesQueryAsync(LableValueQueryRequest query) + { + var name = query.Lable; + query.Lable = null; + return await QueryDataAsync($"/api/v1/label/{name}/values", query); + } + + public async Task QueryAsync(QueryRequest query) + { + return await QueryDataAsync("/api/v1/query", query); + } + + public async Task QueryRangeAsync(QueryRangeRequest query) + { + return await QueryDataAsync("/api/v1/query_range", query); + } + + public async Task SeriesQueryAsync(MetaDataQueryRequest query) + { + return await QueryDataAsync("/api/v1/series", query); + } + + private async Task QueryDataAsync(string url, object data) where T : ResultBaseResponse + { + var str = await _caller.GetAsync(url, data); + if (string.IsNullOrEmpty(str)) + return default!; + + var baseResult = JsonSerializer.Deserialize(str, _jsonSerializerOptions); + + if (baseResult == null || baseResult.Status != ResultStatuses.Success) + { + return baseResult ?? default!; + } + + if (typeof(T) == typeof(QueryResultCommonResponse)) + { + var result = baseResult as QueryResultCommonResponse; + if (result == null || result.Data == null) + return baseResult; + switch (result.Data.ResultType) + { + case ResultTypes.Matrix: + { + var temp = JsonSerializer.Serialize(result.Data.Result, _jsonSerializerOptions); + result.Data.Result = JsonSerializer.Deserialize(temp, _jsonSerializerOptions); + if (result.Data.Result != null && result.Data.Result.Any()) + { + foreach (QueryResultMatrixRangeResponse item in result.Data.Result) + { + if (item.Values == null || !item.Values.Any()) + continue; + var array = item.Values.ToArray(); + int i = 0, max = array.Length - 1; + do + { + array[i] = ConvertJsonToObjValue(array[i]); + i++; + } + while (max - i >= 0); + item.Values = array; + } + } + return result as T ?? default!; + } + case ResultTypes.Vector: + { + var temp = JsonSerializer.Serialize(result.Data.Result, _jsonSerializerOptions); + result.Data.Result = JsonSerializer.Deserialize(temp, _jsonSerializerOptions); + if (result.Data.Result != null && result.Data.Result.Any()) + { + foreach (QueryResultInstantVectorResponse item in result.Data.Result) + { + item.Value = ConvertJsonToObjValue(item.Value); + } + } + return result as T ?? default!; + } + default: + { + if (result.Data.Result != null && result.Data.Result.Any()) + { + result.Data.Result = ConvertJsonToObjValue(result.Data.Result); + } + } + break; + } + } + + return baseResult; + } + + private static object[] ConvertJsonToObjValue(object[]? values) + { + if (values == null || values.Length - 2 < 0) + return default!; + + return new object[] { ((JsonElement)values[0]).GetDouble(), ((JsonElement)values[1]).GetString() ?? default! }; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs new file mode 100644 index 000000000..2777b076a --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarDataModel.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class ExemplarModel +{ + public IDictionary? Labels { get; set; } + + public string? Value { get; set; } + + public float TimeStamp { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs new file mode 100644 index 000000000..84ff5c61e --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarModel.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class ExemplarDataModel +{ + public IDictionary? SeriesLabels { get; set; } + + public IEnumerable? Exemplars { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs new file mode 100644 index 000000000..c03e8eee1 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Exemplar/ExemplarResultResponse.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class ExemplarResultResponse : ResultBaseResponse +{ + public IEnumerable? Data { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs new file mode 100644 index 000000000..a20a25ca2 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/LabelResultResponse.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class LabelResultResponse : ResultBaseResponse +{ + public IEnumerable? Data { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs new file mode 100644 index 000000000..6422449c5 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/MetaData/SeriesResultResponse.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class SeriesResultResponse : ResultBaseResponse +{ + public IEnumerable>? Data { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs new file mode 100644 index 000000000..1859c35b5 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultCommonResponse.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryResultCommonResponse: ResultBaseResponse +{ + public QueryResultDataResponse? Data { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs new file mode 100644 index 000000000..209f6d573 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultDataResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryResultDataResponse +{ + public ResultTypes ResultType { get; set; } + + public object[]? Result { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs new file mode 100644 index 000000000..976986e28 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultInstantVectorResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryResultInstantVectorResponse +{ + public IDictionary? Metric { get; set; } + + public object[]? Value { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs new file mode 100644 index 000000000..810473d12 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/Query/QueryResultMatrixRangeResponse.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryResultMatrixRangeResponse +{ + public IDictionary? Metric { get; set; } + + public IEnumerable? Values { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs new file mode 100644 index 000000000..33381e613 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Reponse/ResultBaseResponse.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class ResultBaseResponse +{ + public ResultStatuses Status { get; set; } + + public string? Error { get; set; } + + public string? ErrorType { get; set; } + + public IEnumerable? Warnings { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs new file mode 100644 index 000000000..b1089a15d --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/LableValueQueryRequest.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class LableValueQueryRequest: MetaDataQueryRequest +{ + public string Lable { get; set; } = "__name__"; +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs new file mode 100644 index 000000000..00c3af561 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/MetaDataQueryRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class MetaDataQueryRequest +{ + public IEnumerable? Match { get; set; } + + public string? Start { get; set; } + + public string? End { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs new file mode 100644 index 000000000..b6b9a4be7 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryExemplarRequest.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryExemplarRequest +{ + public string? Query { get; set; } + + public string? Start { get; set; } + + public string? End { get; set; } +} + diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs new file mode 100644 index 000000000..9d4926191 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRangeRequest.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryRangeRequest +{ + public string? Query { get; set; } + + public string? Start { get; set; } + + public string? End { get; set; } + + public string? Step { get; set; } + + public string? TimeOut { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs new file mode 100644 index 000000000..b1779587c --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/Model/Request/QueryRequest.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Model; + +public class QueryRequest +{ + public string? Query { get; set; } + + public string? Time { get; set; } + + public string? TimeOut { get; set; } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/README.md b/src/Utils/Data/Masa.Utils.Data.Prometheus/README.md new file mode 100644 index 000000000..94ad400db --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/README.md @@ -0,0 +1,75 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Data.Prometheus + +[Prometheus Http Api](https://www.prometheus.io/docs/prometheus/latest/querying/api/) Client Library + +## Install: +```c# +Install-Package Masa.Utils.Data.Prometheus +``` + +### Example: + +1. Inject + +```` C# +builder.Services.AddPrometheusClient("http://127.0.0.1:9090"); +```` + +2. Query Example + +```C# +public class SampleService +{ + + private IMasaPrometheusClient _client; + + public SampleService(IMasaPrometheusClient client) + { + _client=client; + } + + public async Task QueryAsync() + { + var query= new QueryRequest { + Query = "up", //metric name + Time = "2022-06-01T09:00:00.000Z" //standard time format or unix timestamp, such as: 1654045200 or 1654045200.000 + }; + var result = await _client.QueryAsync(query); + if(result.Status == ResultStatuses.Success) + { + switch(result.Data.ResultType) + { + case ResultTypes.Vector: + { + var data=result.Data.Result as QueryResultInstantVectorResponse[]; + ... + } + break; + case ResultTypes.Matrix: + { + var data=result.Data.Result as QueryResultMatrixRangeResponse[]; + ... + } + break; + default: + { + var timeSpan=(double)result.Data.Result[0]; + var value=(string)result.Data.Result[1]; + } + break; + } + } + } +} +``` + +### Current suports: + +- [query](https://www.prometheus.io/docs/prometheus/latest/querying/api/#instant-queries) +- [query_range](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-queries) +- [series](https://www.prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers) +- [lables](https://www.prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names) +- [lable value](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values) +- [exemplars](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-exemplars) diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md b/src/Utils/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md new file mode 100644 index 000000000..b8c14ab1f --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/README.zh-CN.md @@ -0,0 +1,75 @@ +[EN](README.md) | 中 + +## Masa.Utils.Data.Prometheus + +[Prometheus Http Api](https://www.prometheus.io/docs/prometheus/latest/querying/api/) 客户端类库 + +## 安装: +```c# +Install-Package Masa.Utils.Data.Prometheus +``` + +### 示例: + +1. 注册 + +```` C# +builder.Services.AddPrometheusClient("http://127.0.0.1:9090"); +```` + +2. 查询样例 + +```C# +public class SampleService +{ + + private IMasaPrometheusClient _client; + + public SampleService(IMasaPrometheusClient client) + { + _client=client; + } + + public async Task QueryAsync() + { + var query= new QueryRequest { + Query = "up", //metric name + Time = "2022-06-01T09:00:00.000Z" //标准时间格式或unix时间戳,如:1654045200或1654045200.000 + }; + var result = await _client.QueryAsync(query); + if(result.Status == ResultStatuses.Success) + { + switch(result.Data.ResultType) + { + case ResultTypes.Vector: + { + var data=result.Data.Result as QueryResultInstantVectorResponse[]; + ... + } + break; + case ResultTypes.Matrix: + { + var data=result.Data.Result as QueryResultMatrixRangeResponse[]; + ... + } + break; + default: + { + var timeSpan=(double)result.Data.Result[0]; + var value=(string)result.Data.Result[1]; + } + break; + } + } + } +} +``` + +### 目前只支持以下api: + +- [query](https://www.prometheus.io/docs/prometheus/latest/querying/api/#instant-queries) +- [query_range](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-queries) +- [series](https://www.prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers) +- [lables](https://www.prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names) +- [lable value](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-label-values) +- [exemplars](https://www.prometheus.io/docs/prometheus/latest/querying/api/#querying-exemplars) diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..3b1ca0556 --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/ServiceCollectionExtensions.cs @@ -0,0 +1,39 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus; + +public static class ServiceCollectionExtensions +{ + private const string PROMETHEUS_HTTP_CLIENT_NAME = "prometheus_client_name"; + + public static IServiceCollection AddPrometheusClient(this IServiceCollection services, string url) + { + ArgumentNullException.ThrowIfNull(url, nameof(url)); + + if (services.Any(service => service.GetType() == typeof(IMasaPrometheusClient))) + return services; + + services.AddCaller(builder => + { + builder.UseHttpClient(options => + { + options.BaseAddress = url; + options.Name = PROMETHEUS_HTTP_CLIENT_NAME; + }); + }); + + var jsonOptions = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true + }; + jsonOptions.Converters.Add(new JsonStringEnumConverter()); + + services.AddScoped(ServiceProvider => + { + var caller = ServiceProvider.GetRequiredService().CreateClient(PROMETHEUS_HTTP_CLIENT_NAME); + return new MasaPrometheusClient(caller, jsonOptions); + }); + return services; + } +} diff --git a/src/Utils/Data/Masa.Utils.Data.Prometheus/_Imports.cs b/src/Utils/Data/Masa.Utils.Data.Prometheus/_Imports.cs new file mode 100644 index 000000000..0d8a7ec8a --- /dev/null +++ b/src/Utils/Data/Masa.Utils.Data.Prometheus/_Imports.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Caller.Core; +global using Masa.Utils.Caller.HttpClient; +global using Masa.Utils.Data.Prometheus.Enums; +global using Masa.Utils.Data.Prometheus.Model; +global using Microsoft.Extensions.DependencyInjection; +global using System.Collections; +global using System.Reflection; +global using System.Runtime.CompilerServices; +global using System.Text; +global using System.Text.Json; +global using System.Text.Json.Serialization; +global using System.Web; diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj b/src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj new file mode 100644 index 000000000..adb2ce006 --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/Masa.Utils.Data.DataAnnotations.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs b/src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs new file mode 100644 index 000000000..95c116d78 --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/MinCountAttributeTests.cs @@ -0,0 +1,84 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.ComponentModel.DataAnnotations; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.DataAnnotations.Tests +{ + [TestClass] + public class MinCountAttributeTests + { + [TestMethod] + public void EmptyListWithMinCount1Test() + { + var user = new User + { + Name = "name", + Favorites = new List() + }; + + var results = ValidateModel(user); + + Assert.IsTrue(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); + } + + [TestMethod] + public void NullValueWithMinCount1Test() + { + var user = new User + { + Name = "name", + }; + + var results = ValidateModel(user); + + Assert.IsFalse(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); + } + + [TestMethod] + public void Count1WithMinCount1Test() + { + var user = new User + { + Name = "name", + Favorites = new List() { "A" } + }; + + var results = ValidateModel(user); + + Assert.IsFalse(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); + } + + [TestMethod] + public void Count2WithMinCount1Test() + { + var user = new User + { + Name = "name", + Favorites = new List() { "A", "B" } + }; + + var results = ValidateModel(user); + + Assert.IsFalse(results.Any(u => u.MemberNames.Contains(nameof(User.Favorites)))); + } + + private IList ValidateModel(object model) + { + var validateResults = new List(); + var ctx = new ValidationContext(model); + Validator.TryValidateObject(model, ctx, validateResults, true); + return validateResults; + } + + public class User + { + [Required] + public string Name { get; set; } = default!; + + [MinCount(1)] + public List Favorites { get; set; } = default!; + } + } +} diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs b/src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs new file mode 100644 index 000000000..a229708dd --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.DataAnnotations.Tests/NonDefaultAttributeTests.cs @@ -0,0 +1,84 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.DataAnnotations.Tests +{ + [TestClass] + public class NonDefualtAttributeTests + { + [TestMethod] + public void DefaultTest() + { + var user = new User + { + Name = "name", + NullableId = Guid.Empty + }; + + var results = ValidateModel(user); + + var isIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Id))); + var isNullableIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.NullableId))); + var isAgeInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Age))); + var isFavroiteInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Favroite))); + + Assert.IsTrue(isIdInvalid && isNullableIdInvalid && isAgeInvalid && isFavroiteInvalid); + } + + [TestMethod] + public void NonDefaultTest() + { + var user = new User + { + Id = Guid.NewGuid(), + NullableId = Guid.NewGuid(), + Age = 20, + Favroite = Favorites.Basketball, + Name = "name" + }; + + var results = ValidateModel(user); + + var isIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Id))); + var isNullableIdInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.NullableId))); + var isAgeInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Age))); + var isFavroiteInvalid = results.Any(u => u.MemberNames.Contains(nameof(User.Favroite))); + + Assert.IsTrue(!isIdInvalid && !isNullableIdInvalid && !isAgeInvalid && !isFavroiteInvalid); + } + + private IList ValidateModel(object model) + { + var validateResults = new List(); + var ctx = new ValidationContext(model); + Validator.TryValidateObject(model, ctx, validateResults, true); + return validateResults; + } + + public class User + { + [NonDefault] + public Guid Id { get; set; } + + [NonDefault] + public Guid? NullableId { get; set; } + + [Required] + public string Name { get; set; } = default!; + + [NonDefault] + public int Age { get; set; } + + [NonDefault] + public Favorites Favroite { get; set; } + } + + public enum Favorites { None, Basketball, Football } + } +} diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs b/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs new file mode 100644 index 000000000..882ec3695 --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/DefaultMasaElasticClientTests.cs @@ -0,0 +1,571 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Tests; + +[TestClass] +public class DefaultMasaElasticClientTests +{ + private MasaElasticsearchBuilder _builder = default!; + + [TestInitialize] + public void Initialize() + { + IServiceCollection service = new ServiceCollection(); + _builder = service.AddElasticsearchClient("es", "http://localhost:9200"); + } + + [TestMethod] + public async Task TestCreateIndexAsyncReturnIndexIsExist() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + var indexResponse = await _builder.Client.CreateIndexAsync(indexName); + Assert.IsTrue(indexResponse.IsValid); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestIndexExistAsyncReturnIndexIsExist() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + await _builder.Client.CreateIndexAsync(indexName); + + var existResponse = await _builder.Client.IndexExistAsync(indexName); + Assert.IsTrue(existResponse.IsValid && existResponse.Exists); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestCreateDocumentAsyncReturnCountIs1() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(!countResponse.IsValid); + + var createResponse = await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + Assert.IsTrue(createResponse.IsValid); + + Thread.Sleep(1000); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDeleteMultiIndexAsyncReturnCountIs0() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + var indexResponse = await _builder.Client.CreateIndexAsync(userIndexName); + Assert.IsTrue(indexResponse.IsValid); + + string personIndexName = $"person_index_{Guid.NewGuid()}"; + indexResponse = await _builder.Client.CreateIndexAsync(personIndexName); + Assert.IsTrue(indexResponse.IsValid); + + var response = await _builder.Client.DeleteMultiIndexAsync(new[] { userIndexName, personIndexName }); + Assert.IsTrue(response.IsValid); + + Thread.Sleep(1000); + Assert.IsTrue(!(await _builder.Client.IndexExistAsync(userIndexName)).Exists && + !(await _builder.Client.IndexExistAsync(personIndexName)).Exists); + } + + [TestMethod] + public async Task TestIndexByAliasAsync() + { + string userIndex1Name = $"user_index_{Guid.NewGuid()}"; + string userIndex2Name = $"user_index_{Guid.NewGuid()}"; + string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; + + IAliases aliases = new Aliases(); + aliases.Add(aliasIndexName, new Alias()); + var indexResponse = await _builder.Client.CreateIndexAsync(userIndex1Name, new CreateIndexOptions() + { + Aliases = aliases + }); + indexResponse = await _builder.Client.CreateIndexAsync(userIndex2Name, new CreateIndexOptions() + { + Aliases = aliases + }); + + Thread.Sleep(1000); + + var getIndexResponse = await _builder.Client.GetAllIndexAsync(); + Assert.IsTrue(getIndexResponse.IsValid && getIndexResponse.IndexNames.Contains(userIndex1Name) && + getIndexResponse.IndexNames.Contains(userIndex2Name)); + + var getIndexByAliasResponse = await _builder.Client.GetIndexByAliasAsync(aliasIndexName); + Assert.IsTrue(getIndexByAliasResponse.IsValid && getIndexByAliasResponse.IndexNames.Length == 2 && + getIndexByAliasResponse.IndexNames.Contains(userIndex1Name) && + getIndexByAliasResponse.IndexNames.Contains(userIndex2Name)); + + var deleteIndexResponse = await _builder.Client.DeleteIndexByAliasAsync(aliasIndexName); + Assert.IsTrue(deleteIndexResponse.IsValid); + } + + [TestMethod] + public async Task TestGetAllAliasAsyncReturnAliasCountIs1() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; + + var aliasResponse = await _builder.Client.GetAllAliasAsync(); + Assert.IsTrue(aliasResponse.IsValid); + + var oldAliasesCount = aliasResponse.Aliases.Count(); + IAliases aliases = new Aliases(); + aliases.Add(aliasIndexName, new Alias()); + await _builder.Client.CreateIndexAsync(userIndexName, new CreateIndexOptions() + { + Aliases = aliases + }); + + Thread.Sleep(1000); + aliasResponse = await _builder.Client.GetAllAliasAsync(); + Assert.IsTrue(aliasResponse.IsValid && aliasResponse.Aliases.Count() == oldAliasesCount + 1); + + await _builder.Client.DeleteIndexByAliasAsync(aliasIndexName); + } + + [TestMethod] + public async Task TestGetAliasByIndexAsyncReturnAliasIsUserIndexAlias() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; + + IAliases aliases = new Aliases(); + aliases.Add(aliasIndexName, new Alias()); + await _builder.Client.CreateIndexAsync(userIndexName, new CreateIndexOptions() + { + Aliases = aliases + }); + + Thread.Sleep(1000); + var aliasResponse = await _builder.Client.GetAliasByIndexAsync(userIndexName); + Assert.IsTrue(aliasResponse.IsValid && aliasResponse.Aliases.Count() == 1 && aliasResponse.Aliases.Contains(aliasIndexName)); + + await _builder.Client.DeleteIndexByAliasAsync(aliasIndexName); + } + + [TestMethod] + public async Task TestUnBindAliasAsyncReturnIndexIsExist() + { + string userIndexName = $"user_index_{Guid.NewGuid()}"; + string aliasIndexName = $"user_index_alias_{Guid.NewGuid()}"; + + IAliases aliases = new Aliases(); + aliases.Add(aliasIndexName, new Alias()); + await _builder.Client.CreateIndexAsync(userIndexName, new CreateIndexOptions() + { + Aliases = aliases + }); + + Thread.Sleep(1000); + + var bulkAliasResponse = await _builder.Client.UnBindAliasAsync(new UnBindAliasIndexOptions(aliasIndexName, userIndexName)); + Assert.IsTrue(bulkAliasResponse.IsValid); + + Thread.Sleep(1000); + var existsResponse = await _builder.Client.IndexExistAsync(userIndexName); + Assert.IsTrue(existsResponse.IsValid && existsResponse.Exists); + } + + [TestMethod] + public async Task TestCreateMultiDocumentAsyncReturnCountIs2() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + await _builder.Client.DeleteIndexAsync(indexName); + + string id = Guid.NewGuid().ToString(); + string id2 = Guid.NewGuid().ToString(); + var createMultiResponse = await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = Guid.NewGuid() + }, id), + new(new + { + Id = Guid.NewGuid() + }, id2) + } + }); + Assert.IsTrue(createMultiResponse.IsValid && + createMultiResponse.Items.Count == 2 && + createMultiResponse.Items.Count(r => r.IsValid) == 2); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDocumentExistsAsyncReturnIsExist() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + var id = Guid.NewGuid(); + var createResponse = await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = id + }, id.ToString())); + Assert.IsTrue(createResponse.IsValid); + Thread.Sleep(1000); + + var existsResponse = await _builder.Client.DocumentExistsAsync(new ExistDocumentRequest(indexName, id.ToString())); + Assert.IsTrue(existsResponse.IsValid && existsResponse.Exists); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDeleteDocumentAsyncReturnCountIs0() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + var id = Guid.NewGuid(); + var createResponse = await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = id + }, id.ToString())); + Assert.IsTrue(createResponse.IsValid); + + var deleteResponse = await _builder.Client.DeleteDocumentAsync(new DeleteDocumentRequest(indexName, id.ToString())); + Assert.IsTrue(deleteResponse.IsValid); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 0); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDeleteMultiDocumentAsyncReturnDeleteCountIs2() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string id = Guid.NewGuid().ToString(); + string id2 = Guid.NewGuid().ToString(); + await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = Guid.NewGuid() + }, id), + new(new + { + Id = Guid.NewGuid() + }, id2) + } + }); + + var deleteResponse = + await _builder.Client.DeleteMultiDocumentAsync(new DeleteMultiDocumentRequest(indexName, id, id2)); + Assert.IsTrue(deleteResponse.IsValid && deleteResponse.Data.Count == 2 && deleteResponse.Data.Count(r => r.IsValid) == 2); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 0); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestDeleteMultiDocumentAsyncReturnDeleteCountSuccessIs2() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string id = Guid.NewGuid().ToString(); + string id2 = Guid.NewGuid().ToString(); + await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = Guid.NewGuid() + }, id), + new(new + { + Id = Guid.NewGuid() + }, id2) + } + }); + + var deleteResponse = + await _builder.Client.DeleteMultiDocumentAsync(new DeleteMultiDocumentRequest(indexName, id, id2, Guid.NewGuid().ToString())); + Assert.IsTrue(deleteResponse.IsValid && deleteResponse.Data.Count == 3 && deleteResponse.Data.Count(r => r.IsValid) == 2); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 0); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestSetDocumentAsyncReturnCountIs3() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + Guid id = Guid.NewGuid(); + Guid id2 = Guid.NewGuid(); + await _builder.Client.CreateMultiDocumentAsync(new CreateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = id + }, id.ToString()), + new(new + { + Id = id2 + }, id2.ToString()) + } + }); + Guid id3 = Guid.NewGuid(); + var setResponse = await _builder.Client.SetDocumentAsync(new SetDocumentRequest(indexName) + { + Items = new List>() + { + new(new + { + Id = Guid.NewGuid() + }, id.ToString()), + new(new + { + Id = id3 + }, id3.ToString()) + } + }); + Assert.IsTrue(setResponse.IsValid && setResponse.Items.Count == 2 && setResponse.Items.Count(item => item.IsValid) == 2); + + Thread.Sleep(1000); + + var multiResponse = await _builder.Client.GetMultiAsync( + new GetMultiDocumentRequest(indexName, id.ToString(), id2.ToString(), id3.ToString())); + Assert.IsTrue(multiResponse.IsValid && multiResponse.Data.Count == 3); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestUpdateDocumentAsyncReturnIdEqual1() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + dynamic expandoObject = new ExpandoObject(); + expandoObject.Id = Guid.NewGuid(); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, expandoObject, "1")); + + expandoObject.Id = "1"; + var updateDocumentResponse = + await _builder.Client.UpdateDocumentAsync(new UpdateDocumentRequest(indexName, expandoObject, "1")); + Assert.IsTrue(updateDocumentResponse.IsValid); + + Thread.Sleep(1000); + var response = await _builder.Client.GetAsync(new GetDocumentRequest(indexName, "1")); + Assert.IsTrue(response.IsValid && ((dynamic)(response.Document)).Id == "1"); + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestUpdateMultiDocumentAsyncReturnId1Equeal1AndId2Equal2() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + dynamic expandoObject = new ExpandoObject(); + dynamic expandoObject2 = new ExpandoObject(); + expandoObject.Id = Guid.NewGuid(); + expandoObject2.Id = Guid.NewGuid(); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, expandoObject, "1")); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, expandoObject2, "2")); + + expandoObject.Id = "1"; + expandoObject2.Id = "2"; + var updateDocumentResponse = + await _builder.Client.UpdateMultiDocumentAsync(new UpdateMultiDocumentRequest(indexName) + { + Items = new List>() + { + new UpdateDocumentBaseRequest(expandoObject, "1"), + new((object)expandoObject2, "2"), + } + }); + Assert.IsTrue(updateDocumentResponse.IsValid); + + Thread.Sleep(1000); + var response = await _builder.Client.GetAsync(new GetDocumentRequest(indexName, "1")); + Assert.IsTrue(response.IsValid && ((dynamic)(response.Document)).Id == "1"); + response = await _builder.Client.GetAsync(new GetDocumentRequest(indexName, "2")); + Assert.IsTrue(response.IsValid && ((dynamic)(response.Document)).Id == "2"); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestGetListAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new { name = "jim" }, "1")); + + Thread.Sleep(1000); + var response = await _builder.Client.GetListAsync(new QueryOptions(indexName, "jim", "name", 0, 10)); + Assert.IsTrue(response.IsValid && response.Data.Count == 1); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task TestGetPaginatedListAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new { id = "1", name = "jim" }, "1")); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new { id = "2", name = "tom" }, "2")); + + Thread.Sleep(1000); + var response = + await _builder.Client.GetPaginatedListAsync(new PaginatedOptions(indexName, "jim", "name", 1, 1)); + Assert.IsTrue(response.IsValid && response.Data.Count == 1); + response = await _builder.Client.GetPaginatedListAsync(new PaginatedOptions(indexName, "jim or 2", + new List { "id", "name" }, 1, 2)); + Assert.IsTrue(response.IsValid && response.Data.Count == 2); + + await _builder.Client.DeleteIndexAsync(indexName); + } + + [TestMethod] + public async Task BindAliasAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string indexName2 = $"user_index_{Guid.NewGuid()}"; + string alias = $"userIndex_{Guid.NewGuid()}"; + + await _builder.Client.CreateIndexAsync(indexName); + await _builder.Client.CreateIndexAsync(indexName2); + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName2, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName2)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + + await _builder.Client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 })); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); + + await _builder.Client.DeleteIndexAsync(indexName); + await _builder.Client.DeleteIndexAsync(indexName2); + } + + [TestMethod] + public async Task DeleteIndexByAliasAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string indexName2 = $"user_index_{Guid.NewGuid()}"; + string alias = $"user_index_{Guid.NewGuid()}"; + + await _builder.Client.CreateIndexAsync(indexName); + await _builder.Client.CreateIndexAsync(indexName2); + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName2, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName2)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + + await _builder.Client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 })); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); + + await _builder.Client.DeleteIndexByAliasAsync(alias); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(!countResponse.IsValid); + } + + [TestMethod] + public async Task ClearDocumentAsync() + { + string indexName = $"user_index_{Guid.NewGuid()}"; + string indexName2 = $"user_index_{Guid.NewGuid()}"; + string alias = $"user_index_{Guid.NewGuid()}"; + + await _builder.Client.CreateIndexAsync(indexName); + await _builder.Client.CreateIndexAsync(indexName2); + + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + await _builder.Client.CreateDocumentAsync(new CreateDocumentRequest(indexName2, new + { + id = Guid.NewGuid() + }, Guid.NewGuid().ToString())); + + Thread.Sleep(1000); + var countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(indexName2)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 1); + + await _builder.Client.BindAliasAsync(new BindAliasIndexOptions(alias, new[] { indexName, indexName2 })); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(countResponse.IsValid && countResponse.Count == 2); + + await _builder.Client.ClearDocumentAsync(alias); + countResponse = await _builder.Client.DocumentCountAsync(new CountDocumentRequest(alias)); + Assert.IsTrue(countResponse.IsValid); + + await _builder.Client.DeleteIndexByAliasAsync(alias); + } + + [TestMethod] + public async Task TestAsync() + { + string userIndexName = $"user_index"; + + IServiceCollection service = new ServiceCollection(); + var builder = service.AddElasticsearchClient("es", "http://localhost:9200"); + await builder.Client.DeleteIndexAsync(userIndexName); + var serviceProvider = builder.Services.BuildServiceProvider(); + var client = serviceProvider.GetRequiredService(); + + var list = new AutoCompleteDocument[] + { + new() + { + Text = "999999999@qq.com", + Value = 1 + } + }; + var request = new SetDocumentRequest>(userIndexName); + foreach (var document in list) + request.AddDocument(document, document.Id); + + var response = await client.SetDocumentAsync(request, default); + Assert.IsTrue(response.IsValid); + await builder.Client.DeleteIndexAsync(userIndexName); + } +} diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj b/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj new file mode 100644 index 000000000..9a65485a9 --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/Masa.Utils.Data.Elasticsearch.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs b/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs new file mode 100644 index 000000000..18c4209d6 --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/Models/AutoCompleteDocument.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Elasticsearch.Tests.Models; + +public class AutoCompleteDocument where TValue : notnull +{ + public string Id { get; set; } + + public string Text { get; set; } + + public TValue? Value { get; set; } + + public AutoCompleteDocument() + { + } + + public AutoCompleteDocument(string text, TValue? value) + : this(value?.ToString() ?? throw new ArgumentException($"{value} cannot be empty", nameof(value)), text, value) + { + } + + public AutoCompleteDocument(string id, string text, TValue? value) : this() + { + Id = id; + Text = text; + Value = value; + } +} + diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs b/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs new file mode 100644 index 000000000..4448cf478 --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Elasticsearch.Tests/_Imports.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Data.Elasticsearch.Options.Alias; +global using Masa.Utils.Data.Elasticsearch.Options.Document; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Count; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Create; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Delete; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Exist; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Get; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Query; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Set; +global using Masa.Utils.Data.Elasticsearch.Options.Document.Update; +global using Masa.Utils.Data.Elasticsearch.Options.Index; +global using Masa.Utils.Data.Elasticsearch.Tests.Models; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Nest; +global using System.Dynamic; diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs new file mode 100644 index 000000000..988a782e5 --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Extensions/ObjectExtensionsTests.cs @@ -0,0 +1,171 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Test; + +[TestClass] +public class ObjectExtensionsTests +{ + [TestMethod] + [DataRow(1)] + [DataRow((byte)1)] + [DataRow((char)2)] + [DataRow((uint)3)] + [DataRow((long)4)] + [DataRow((float)5.6789)] + [DataRow(5.6789)] + [DataRow("string")] + public void SampleValueTest(object value) + { + var result = value.ToUrlParam(); + var str = value.ToString(); + Assert.AreEqual(str, result); + } + + [TestMethod] + public void StructTest() + { + var user = new UserStruct + { + Name = "Bob", + Age = 30, + Gender = "Male" + }; + + var result = user.ToUrlParam(); + var str = $"age={user.Age}&gender={user.Gender}&name={user.Name}"; + Assert.AreEqual(str, result); + + user.Name = "王占山"; + str = $"age={user.Age}&gender={user.Gender}&name={System.Web.HttpUtility.UrlEncode(user.Name, Encoding.UTF8)}"; + result = user.ToUrlParam(); + Assert.AreEqual(str, result); + } + + [TestMethod] + public void ClassTest() + { + var obj = new + { + a = "test", + d = (float)34.56, + ch = "中文说明", + t = ResultTypes.Scalar + }; + + var result = obj.ToUrlParam(isEnumString: true); + var str = $"a={obj.a}&ch={System.Web.HttpUtility.UrlEncode(obj.ch, Encoding.UTF8)}&d={obj.d}&t={obj.t}"; + Assert.AreEqual(str, result); + + result = obj.ToUrlParam(isEnumString: false); + str = $"a={obj.a}&ch={System.Web.HttpUtility.UrlEncode(obj.ch, Encoding.UTF8)}&d={obj.d}&t={(int)obj.t}"; + Assert.AreEqual(str, result); + + result = obj.ToUrlParam(isEnumString: false, isUrlEncode: false); + str = $"a={obj.a}&ch={obj.ch}&d={obj.d}&t={(int)obj.t}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void ArrayTest() + { + var array = new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }; + var result = array.ToUrlParam(isUrlEncode: false); + var str = string.Join("&[]=", array); + str = $"[]={str}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void ObjArrayTest() + { + var array = new QueryRequest[] { + new QueryRequest{ + Query="where1", + Time="2021-01-02", + TimeOut="5s" + }, + new QueryRequest{ + Query="where2", + Time="2021-01-01", + TimeOut="5s" + } + }; + + var result = array.ToUrlParam(isUrlEncode: false); + var str = $"[].query={array[0].Query}&[].time={array[0].Time}&[].timeOut={array[0].TimeOut}"; + str += $"&[].query={array[1].Query}&[].time={array[1].Time}&[].timeOut={array[1].TimeOut}"; + Assert.AreEqual(str, result); + + var obj = new + { + Values = array + }; + result = obj.ToUrlParam(isUrlEncode: false); + str = $"values[].query={array[0].Query}&values[].time={array[0].Time}&values[].timeOut={array[0].TimeOut}"; + str += $"&values[].query={array[1].Query}&values[].time={array[1].Time}&values[].timeOut={array[1].TimeOut}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void IEnumberTest() + { + var list = new List { 1, 2, 3, 4, 5, 6, 7, 8 }; + var result = list.ToUrlParam(isUrlEncode: false); + var str = string.Join("&[]=", list); + str = $"[]={str}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void ObjListTest() + { + var array = new List { + new QueryRequest{ + Query="where1", + Time="2021-01-02", + TimeOut="5s" + }, + new QueryRequest{ + Query="where2", + Time="2021-01-01", + TimeOut="5s" + } + }; + + var result = array.ToUrlParam(isUrlEncode: false); + var str = $"[].query={array[0].Query}&[].time={array[0].Time}&[].timeOut={array[0].TimeOut}"; + str += $"&[].query={array[1].Query}&[].time={array[1].Time}&[].timeOut={array[1].TimeOut}"; + Assert.AreEqual(str, result); + + var obj = new + { + Values = array + }; + result = obj.ToUrlParam(isUrlEncode: false); + str = $"values[].query={array[0].Query}&values[].time={array[0].Time}&values[].timeOut={array[0].TimeOut}"; + str += $"&values[].query={array[1].Query}&values[].time={array[1].Time}&values[].timeOut={array[1].TimeOut}"; + Assert.AreEqual(str, result); + } + + [TestMethod] + public void KeyValueTest() + { + var dic = new Dictionary { + { "Name","David"}, + {"Age",30 }, + {"Sex","Male" } + }; + + var result = dic.ToUrlParam(); + var builder = new StringBuilder(); + var keys = dic.Keys.ToList(); + keys.Sort(); + foreach (var key in keys) + { + builder.Append($"&{key.ToCamelCase()}={dic[key]}"); + } + builder.Remove(0, 1); + Assert.AreEqual(builder.ToString(), result); + } +} diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs new file mode 100644 index 000000000..6c167dca3 --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Extensions/StringExtensionsTests.cs @@ -0,0 +1,30 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Test; + +[TestClass] +public class StringExtensionsTests +{ + [TestMethod] + [DataRow(null)] + [DataRow("")] + [DataRow("name")] + [DataRow("Name")] + [DataRow("N")] + [DataRow("FirstName")] + public void CamelCaseTest(string str) + { + var result = str.ToCamelCase(); + if (string.IsNullOrEmpty(str)) + { + Assert.IsNull(result); + } + else + { + var camelStr = $"{str[0].ToString().ToLower()}{(str.Length - 1 > 0 ? str[1..] : "")}"; + Assert.AreEqual(camelStr, result); + } + + } +} diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj new file mode 100644 index 000000000..462b4df3f --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/Masa.Utils.Data.Prometheus.Test.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + + false + + + + + + + + + + + + + + + diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs new file mode 100644 index 000000000..4dbea1025 --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/MasaPrometheusClientTests.cs @@ -0,0 +1,154 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Test; + +[TestClass] +public class MasaPrometheusClientTests +{ + private IMasaPrometheusClient _client; + + public MasaPrometheusClientTests() + { + IServiceCollection service = new ServiceCollection(); + service.AddPrometheusClient("http://localhost:9090"); + _client = service.BuildServiceProvider().GetService() ?? default!; + } + + [TestMethod] + [DataRow(null)] + [DataRow("up")] + [DataRow("not_exists")] + [DataRow("error data")] + public async Task TestQueryAsync(string query) + { + var result = await _client.QueryAsync(new QueryRequest + { + Query = query + }); + + Assert.IsNotNull(result); + if (string.IsNullOrEmpty(query) || query.Contains(' ')) + { + Assert.AreEqual(result.Status, ResultStatuses.Error); + } + else + { + if (query == "not_exists") + { + Assert.IsFalse(result.Data?.Result?.Any()); + } + else + { + Assert.IsTrue(result.Data?.Result?.Any()); + } + } + } + + [TestMethod] + public async Task TestQueryVectorAsync() + { + var result = await _client.QueryAsync(new QueryRequest + { + Query = "up" + }); + + if (result != null && result.Data != null && result.Data.Result != null) + { + var data = result.Data.Result as QueryResultInstantVectorResponse[]; + + Assert.IsNotNull(data); + Assert.IsNotNull(data[0].Metric); + Assert.IsNotNull(data[0].Value); + Assert.IsNotNull(data[0].Metric.Keys); + Assert.AreEqual(2, data[0].Value.Length); + } + } + + [TestMethod] + public async Task TestQueryRangeAsync() + { + var result = await _client.QueryRangeAsync(new QueryRangeRequest + { + Query = "up", + Start = "2022-06-17T02:00:00.000Z", + End = "2022-06-17T02:30:00.000Z", + Step = "300s", + }); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + Assert.IsNotNull(result.Data); + if (result.Data.ResultType == ResultTypes.Matrix) + { + var data = result.Data.Result as QueryResultMatrixRangeResponse[]; + Assert.IsNotNull(data); + Assert.IsNotNull(data[0].Metric); + Assert.IsNotNull(data[0].Values); + } + } + + [TestMethod] + public async Task TestSeriesQueryAsync() + { + var result = await _client.SeriesQueryAsync(new MetaDataQueryRequest + { + Match = new string[] { "up" }, + Start = "2022-06-17T02:00:00.000Z", + End = "2022-06-17T02:30:00.000Z" + }); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + } + + [TestMethod] + [DataRow(null)] + [DataRow(new string[] { "up" })] + [DataRow(new string[] { "not_exists" })] + [DataRow(new string[] { "error data" })] + public async Task TestLabelsQueryAsync(IEnumerable matches) + { + if (matches != null && matches.Any(s => s.Contains(' '))) + { + var result = await _client.LabelsQueryAsync(new MetaDataQueryRequest { Match = matches }); + Assert.AreEqual(result.Status, ResultStatuses.Error); + Assert.IsNotNull(result.Error); + } + else + { + var result = await _client.LabelsQueryAsync(default!); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + if (matches == null || matches.Any(s => s == "up")) + { + Assert.IsTrue(result.Data?.Any()); + } + else + { + Assert.IsFalse(result.Data?.Any()); + } + } + } + + [TestMethod] + public async Task TestLabelValuesQueryAsync() + { + var result = await _client.LabelValuesQueryAsync(new LableValueQueryRequest()); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + } + + [TestMethod] + [DataRow()] + public async Task TestExemplarQueryAsync() + { + var param = new QueryExemplarRequest + { + Query = "up", + Start = "2022-06-17T02:00:00.000Z", + End = "2022-06-17T02:30:00.000Z" + }; + var result = await _client.ExemplarQueryAsync(param); + Assert.IsNotNull(result); + Assert.AreEqual(result.Status, ResultStatuses.Success); + } +} diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/UserStruct.cs b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/UserStruct.cs new file mode 100644 index 000000000..a1ea1f6ea --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/UserStruct.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Data.Prometheus.Test; + +public struct UserStruct +{ + public string Name { get; set; } + + public int Age { get; set; } + + public string Gender { get; set; } +} diff --git a/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/_Imports.cs b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/_Imports.cs new file mode 100644 index 000000000..3b98df19e --- /dev/null +++ b/src/Utils/Data/Tests/Masa.Utils.Data.Prometheus.Test/_Imports.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Data.Prometheus.Enums; +global using Masa.Utils.Data.Prometheus.Model; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Text; +global using System.Threading.Tasks; diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs new file mode 100644 index 000000000..e29c63771 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/DaprBackgroundService.cs @@ -0,0 +1,66 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.AspNetCore; + +public class DaprBackgroundService : BackgroundService +{ + private readonly IAppPortProvider _appPortProvider; + private readonly IDaprProcess _daprProcess; + private readonly DaprOptions _options; + private readonly IHostApplicationLifetime _hostApplicationLifetime; + private readonly ILogger? _logger; + + public DaprBackgroundService( + IAppPortProvider appPortProvider, + IDaprProcess daprProcess, + IOptionsMonitor options, + IHostApplicationLifetime hostApplicationLifetime, + ILogger? logger) + { + _appPortProvider = appPortProvider; + _daprProcess = daprProcess; + _options = options.CurrentValue; + options.OnChange(daprOptions => + { + daprOptions.AppPort ??= _appPortProvider.GetAppPort(daprOptions.EnableSsl); + _daprProcess.Refresh(daprOptions); + }); + _hostApplicationLifetime = hostApplicationLifetime; + _logger = logger; + } + + protected override async Task ExecuteAsync(CancellationToken stoppingToken) + { + if (!await WaitForAppStartup(_hostApplicationLifetime, stoppingToken)) + return; + + // if cancellation was requested, stop + if (stoppingToken.IsCancellationRequested) + { + _logger?.LogInformation("{Name} is Stopping...", nameof(DaprBackgroundService)); + _daprProcess.Stop(stoppingToken); + } + else + { + _logger?.LogInformation("{Name} is Starting ...", nameof(DaprBackgroundService)); + _options.AppPort ??= _appPortProvider.GetAppPort(_options.EnableSsl); + _daprProcess.Start(_options, stoppingToken); + } + } + + static async Task WaitForAppStartup(IHostApplicationLifetime hostApplicationLifetime, CancellationToken stoppingToken) + { + var startedSource = new TaskCompletionSource(); + var cancelledSource = new TaskCompletionSource(); + + await using var startedCancellationTokenRegistration = + hostApplicationLifetime.ApplicationStarted.Register(() => startedSource.SetResult()); + await using var cancellationTokenRegistration = stoppingToken.Register(() => cancelledSource.SetResult()); + + Task completedTask = await Task.WhenAny(startedSource.Task, cancelledSource.Task).ConfigureAwait(false); + + // If the completed tasks was the "app started" task, return true, otherwise false + return completedTask == startedSource.Task; + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs new file mode 100644 index 000000000..fed607320 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/DefaultAppPortProvider.cs @@ -0,0 +1,42 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.AspNetCore; + +public class DefaultAppPortProvider : IAppPortProvider +{ + private readonly IServer _server; + + public DefaultAppPortProvider(IServer server) => _server = server; + + public ushort GetAppPort(bool? enableSsl) + { + var addresses = _server.Features.Get()?.Addresses; + if (addresses is { IsReadOnly: false, Count: 0 }) + throw new Exception("Failed to get the startup port, please specify the port manually"); + + var ports = addresses! + .Select(address => new Uri(address)) + .Where(address + => (enableSsl is true && address.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)) + || address.Scheme.Equals(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase)) + .Select(address => new + { + address.Scheme, + address.Port + }).ToList(); + + if (enableSsl is true) + { + return ports + .Where(p => p.Scheme.Equals(Uri.UriSchemeHttps, StringComparison.OrdinalIgnoreCase)) + .Select(p => (ushort)p.Port) + .FirstOrDefault(); + } + + return ports + .Where(p => p.Scheme.Equals(Uri.UriSchemeHttp, StringComparison.OrdinalIgnoreCase)) + .Select(p => (ushort)p.Port) + .FirstOrDefault(); + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs new file mode 100644 index 000000000..8dc3e765d --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/IAppPortProvider.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.AspNetCore; + +public interface IAppPortProvider +{ + ushort GetAppPort(bool? enableSsl); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj new file mode 100644 index 000000000..5774c7add --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/Masa.Utils.Development.Dapr.AspNetCore.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/README.md b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/README.md new file mode 100644 index 000000000..70baec004 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/README.md @@ -0,0 +1,59 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Development.Dapr.AspNetCore + +Responsibilities: + +Assist in managing the dapr process to reduce the dependency on docker compose during development + +### Basic usage: + +1. Install Masa.Utils.Development.Dapr.AspNetCore +``` C# +Install-Package Masa.Utils.Development.Dapr.AspNetCore +``` + +2. Add DaprStarter to assist in managing the dapr process (recommended to be used in the development environment) + +``` C# +builder.Services.AddDaprStarter(); +``` + +### Advanced usage: + +1. Specify the configuration in the code + +``` C# +builder.Services.AddDaprStarter(opt => +{ + opt.AppId = "masa-dapr-test"; + opt.AppPort = 5001; + opt.AppIdSuffix = ""; + opt.DaprHttpPort = 8080; + opt.DaprGrpcPort = 8081; +}); +``` + +2. The configuration file specifies the configuration + +First step: + +``` appsettings.json +{ + "DaprOptions": { + "AppId": "masa-dapr-test", + "AppPort": 5001, + "AppIdSuffix": "", + "DaprHttpPort": 8080, + "DaprGrpcPort": 8081 + } +} +``` + +Step 2: + +``` C# +builder.Services.AddDaprStarter(builder.Configuration.GetSection("DaprOptions"); +``` + +Advantages: After the configuration is changed, the dapr process is restarted and updated, and the project does not need to be restarted diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md new file mode 100644 index 000000000..0f87ee42c --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md @@ -0,0 +1,59 @@ +中 | [EN](README.md) + +## Masa.Utils.Development.Dapr.AspNetCore + +职责: + +协助管理dapr进程,用于开发时减少对docker compose的依赖 + +### 基本用法: + +1. 安装Masa.Utils.Development.Dapr.AspNetCore +```C# +Install-Package Masa.Utils.Development.Dapr.AspNetCore +``` + +2. 添加DaprStarter协助管理dapr进程(建议在开发环境使用) + +```C# +builder.Services.AddDaprStarter(); +``` + +### 高级用法: + +1. 代码中指定配置 + +```C# +builder.Services.AddDaprStarter(opt => +{ + opt.AppId = "masa-dapr-test"; + opt.AppPort = 5001; + opt.AppIdSuffix = ""; + opt.DaprHttpPort = 8080; + opt.DaprGrpcPort = 8081; +}); +``` + +2. 配置文件指定配置 + +第一步: + +``` appsettings.json +{ + "DaprOptions": { + "AppId": "masa-dapr-test", + "AppPort": 5001, + "AppIdSuffix": "", + "DaprHttpPort": 8080, + "DaprGrpcPort": 8081 + } +} +``` + +第二步: + +``` C# +builder.Services.AddDaprStarter(builder.Configuration.GetSection("DaprOptions")); +``` + +优势:支持配置变更后,dapr 进程重启更新,项目无需重新启动 diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..8c8cb20dc --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/ServiceCollectionExtensions.cs @@ -0,0 +1,76 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddDaprStarter(this IServiceCollection services) + => services.AddDaprStarter(_ => + { + }); + + public static IServiceCollection AddDaprStarter( + this IServiceCollection services, + Action daprOptionAction, + bool isDelay = true) + { + ArgumentNullException.ThrowIfNull(daprOptionAction, nameof(daprOptionAction)); + + return services.AddDaprStarter(() => + { + services.AddDaprStarterCore(daprOptionAction); + }, isDelay); + } + + public static IServiceCollection AddDaprStarter( + this IServiceCollection services, + IConfiguration configuration, + bool isDelay = true) + { + return services.AddDaprStarter(() => + { + services.AddDaprStarterCore(configuration); + }, isDelay); + } + + private static IServiceCollection AddDaprStarter(this IServiceCollection services, Action action, bool isDelay = true) + { + if (services.Any(service => service.ImplementationType == typeof(DaprService))) + return services; + + services.AddSingleton(); + + services.AddSingleton(); + action.Invoke(); + if (isDelay) + return services.AddHostedService(); + + var serviceProvider = services.BuildServiceProvider(); + var options = serviceProvider.GetRequiredService>(); + + ArgumentNullException.ThrowIfNull(options.CurrentValue.AppPort, nameof(options.CurrentValue.AppPort)); + var daprProcess = serviceProvider.GetRequiredService(); + options.OnChange(daprOptions => + { + daprProcess.Refresh(daprOptions); + }); + daprProcess.Start(options.CurrentValue); + CompleteDaprEnvironment(options.CurrentValue.DaprHttpPort, options.CurrentValue.DaprGrpcPort); + return services; + } + + private static void CompleteDaprEnvironment(ushort? daprHttpPort, ushort? daprGrpcPort) + { + if (daprHttpPort == null || daprGrpcPort == null) + return; + + EnvironmentExtensions.TryAdd("DAPR_GRPC_PORT", daprGrpcPort.ToString, out _); + EnvironmentExtensions.TryAdd("DAPR_HTTP_PORT", daprHttpPort.ToString, out _); + } + + private class DaprService + { + + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs new file mode 100644 index 000000000..5509a71e7 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr.AspNetCore/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Development.Dapr; +global using Masa.Utils.Development.Dapr.AspNetCore; +global using Microsoft.AspNetCore.Hosting.Server; +global using Microsoft.AspNetCore.Hosting.Server.Features; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.Hosting; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/CommandLineBuilder.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/CommandLineBuilder.cs new file mode 100644 index 000000000..f6eda87fe --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/CommandLineBuilder.cs @@ -0,0 +1,29 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public class CommandLineBuilder +{ + public string Prefix { get; } + + public List Arguments { get; set; } + + public CommandLineBuilder(string prefix) + { + Prefix = prefix; + Arguments = new(); + } + + public CommandLineBuilder Add(string name, string value, bool isSkip = false) + { + if (!isSkip) + { + Arguments.Add($"{Prefix}{name} {value}"); + } + + return this; + } + + public override string ToString() => string.Join(' ', Arguments); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs new file mode 100644 index 000000000..4eb49996d --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Configurations/DaprRuntimeOptions.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Configurations; + +public class DaprRuntimeOptions +{ + [JsonPropertyName("appId")] + public string AppId { get; set; } = default!; + + [JsonPropertyName("httpPort")] + public ushort HttpPort { get; set; } = default!; + + [JsonPropertyName("grpcPort")] + public ushort GrpcPort { get; set; } = default!; + + [JsonPropertyName("appPort")] + public ushort AppPort { get; set; } = default!; + + [JsonPropertyName("metricsEnabled")] + public bool MetricsEnabled { get; set; } = default!; + + [JsonPropertyName("command")] + public string Command { get; set; } = default!; + + [JsonPropertyName("pid")] + public int PId { get; set; } = default!; +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprExtensions.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprExtensions.cs new file mode 100644 index 000000000..248d977db --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprExtensions.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public static class DaprExtensions +{ + public static string DefaultAppId => ((Assembly.GetEntryAssembly() ?? Assembly.GetCallingAssembly()).GetName().Name ?? + throw new NotSupportedException("dapr appid is not empty")).Replace(".", Const.DEFAULT_APPID_DELIMITER); + + /// + /// Appid suffix, the default is the current MAC address + /// + public static readonly string DefaultAppidSuffix = NetworkUtils.GetPhysicalAddress(); + + /// + /// Get dapr AppId by appid and suffix + /// + /// custom appId + /// appid suffix, When appidSuffix is empty, Dapr appId is custom appId, When appidSuffix is null, appidSuffix is MAC address, default: null + /// separator used to splice custom appId and appIdSuffix, default: - + /// + /// + public static string GetAppId(string appId, string? appidSuffix = null, string appIdDelimiter = Const.DEFAULT_APPID_DELIMITER) + { + ArgumentNullException.ThrowIfNull(appIdDelimiter, nameof(appIdDelimiter)); + + if (appidSuffix == null) + appidSuffix = DefaultAppidSuffix; + else if (appidSuffix.Trim() == string.Empty) + return appId; + + return GetAppIdCore(appId, appidSuffix, appIdDelimiter); + } + + private static string GetAppIdCore(string appId, string appidSuffix, string appIdDelimiter) + { + if (appIdDelimiter == ".") + throw new NotSupportedException("AppIdDelimiter is not supported as ."); + + return $"{appId}{appIdDelimiter}{appidSuffix}"; + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprOptions.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprOptions.cs new file mode 100644 index 000000000..903ec4e5a --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprOptions.cs @@ -0,0 +1,283 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +/// +/// dapr startup configuration information +/// When the specified attribute is configured as null, the default value of the parameter is subject to the default value of dapr of the current version +/// +public class DaprOptions +{ + private string _appid = DaprExtensions.DefaultAppId; + + /// + /// The id for your application, used for service discovery + /// Required, no blanks allowed + /// + public string AppId + { + get => _appid; + set + { + ArgumentNullException.ThrowIfNull(value, nameof(AppId)); + + _appid = value; + } + } + + private string _appIdDelimiter = Const.DEFAULT_APPID_DELIMITER; + + /// + /// Separator used to splice AppId and AppIdSuffix + /// default:- , AppIdDelimiter not support . + /// + public string AppIdDelimiter + { + get => _appIdDelimiter; + set + { + if (value == ".") + { + throw new NotSupportedException("AppIdDelimiter is not supported as ."); + } + + _appIdDelimiter = value; + } + } + + private string _appIdSuffix = DaprExtensions.DefaultAppidSuffix; + + /// + /// Appid suffix + /// optional. the default is the current MAC address + /// + public string AppIdSuffix + { + get => _appIdSuffix; + set + { + if (value == ".") + { + throw new NotSupportedException("AppIdSuffix is not supported as ."); + } + + _appIdSuffix = value; + } + } + + private int? _maxConcurrency; + + /// + /// The concurrency level of the application, otherwise is unlimited + /// + public int? MaxConcurrency + { + get => _maxConcurrency; + set + { + if (value is <= 0) + { + throw new NotSupportedException($"{nameof(MaxConcurrency)} must be greater than 0 ."); + } + + _maxConcurrency = value; + } + } + + private ushort? _appPort; + + /// + /// The port your application is listening on + /// + public ushort? AppPort + { + get => _appPort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(AppPort)} must be greater than 0 ."); + + _appPort = value; + } + } + + /// + /// The protocol (gRPC or HTTP) Dapr uses to talk to the application. Valid values are: http or grpc + /// + public Protocol? AppProtocol { get; set; } + + /// + /// Enable https when Dapr invokes the application + /// + public bool? EnableSsl { get; set; } + + /// + /// Dapr configuration file + /// default: + /// Linux & Mac: $HOME/.dapr/config.yaml + /// Windows: %USERPROFILE%\.dapr\config.yaml + /// + public string? Config { get; set; } + + /// + /// The path for components directory + /// default: + /// Linux & Mac: $HOME/.dapr/components + /// Windows: %USERPROFILE%\.dapr\components + /// + public string? ComponentPath { get; set; } + + private ushort? _daprGrpcPort; + + /// + /// The gRPC port for Dapr to listen on + /// + public ushort? DaprGrpcPort + { + get => _daprGrpcPort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(DaprGrpcPort)} must be greater than 0 ."); + + _daprGrpcPort = value; + } + } + + private ushort? _daprHttpPort; + + /// + /// The HTTP port for Dapr to listen on + /// + public ushort? DaprHttpPort + { + get => _daprHttpPort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(DaprHttpPort)} must be greater than 0 ."); + + _daprHttpPort = value; + } + } + + /// + /// Enable pprof profiling via an HTTP endpoint + /// + public bool? EnableProfiling { get; set; } + + /// + /// The image to build the code in. Input is: repository/image + /// + public string? Image { get; set; } + + /// + /// The log verbosity. Valid values are: debug, info, warn, error, fatal, or panic + /// default: info + /// + public LogLevel? LogLevel { get; set; } + + /// + /// default: localhost + /// + public string? PlacementHostAddress { get; set; } + + /// + /// Address for the Sentry CA service + /// + public string? SentryAddress { get; set; } + + private ushort? _metricsPort; + + /// + /// The port that Dapr sends its metrics information to + /// + public ushort? MetricsPort + { + get => _metricsPort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(MetricsPort)} must be greater than 0 ."); + + _metricsPort = value; + } + } + + private ushort? _profilePort; + + /// + /// The port for the profile server to listen on + /// + public ushort? ProfilePort + { + get => _profilePort; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(ProfilePort)} must be greater than 0 ."); + + _profilePort = value; + } + } + + /// + /// Path to a unix domain socket dir mount. If specified + /// communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports + /// Not available on Windows OS + /// + public string? UnixDomainSocket { get; set; } + + private int? _daprMaxRequestSize; + + /// + /// Max size of request body in MB. + /// + public int? DaprMaxRequestSize + { + get => _daprMaxRequestSize; + set + { + if (value is <= 0) + throw new NotSupportedException($"{nameof(DaprMaxRequestSize)} must be greater than 0 ."); + + _daprMaxRequestSize = value; + } + } + + private int _heartBeatInterval = Const.DEFAULT_HEARTBEAT_INTERVAL; + + /// + /// Heartbeat detection interval, used to detect dapr status + /// default: 5000 ms + /// + public int? HeartBeatInterval + { + get => _heartBeatInterval; + set + { + if (value < 0) + throw new NotSupportedException($"{nameof(DaprMaxRequestSize)} must be greater than or equal to 0 ."); + + _heartBeatInterval = value ?? Const.DEFAULT_HEARTBEAT_INTERVAL; + } + } + + /// + /// Start the heartbeat check to ensure that the dapr program is active. + /// When the heartbeat check is turned off, dapr will not start automatically after it exits abnormally. + /// + public bool EnableHeartBeat { get; set; } = true; + + public bool CreateNoWindow { get; set; } = true; + + public string GetAppId() => DaprExtensions.GetAppId(AppId, AppIdSuffix, AppIdDelimiter); + + public ushort GetAppPort() => + AppPort ?? throw new ArgumentNullException(nameof(AppPort)); + + public event DaprEventHandler? OutputDataReceived; + + public void Output(string type, string data) => OutputDataReceived?.Invoke(type, data); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprProcess.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprProcess.cs new file mode 100644 index 000000000..7545b752b --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprProcess.cs @@ -0,0 +1,351 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public class DaprProcess : IDaprProcess +{ + private readonly object _lock = new(); + + private readonly IDaprProvider _daprProvider; + private readonly IProcessProvider _processProvider; + private readonly ILoggerFactory? _loggerFactory; + private readonly ILogger? _logger; + private IProcess? _process; + private DaprProcessStatus Status { get; set; } + private System.Timers.Timer? _heartBeatTimer; + private DaprCoreOptions? _successDaprOptions; + private int _retryTime; + + /// + /// record whether dapr is initialized for the first time + /// + private bool _isFirst = true; + + public DaprProcess(IDaprProvider daprProvider, IProcessProvider processProvider, ILoggerFactory? loggerFactory) + { + _daprProvider = daprProvider; + _processProvider = processProvider; + _loggerFactory = loggerFactory; + _logger = _loggerFactory?.CreateLogger(); + } + + public void Start(DaprOptions options, CancellationToken cancellationToken = default) + { + lock (_lock) + { + StartCore(GetDaprOptions(options), cancellationToken); + } + } + + private void StartCore(DaprCoreOptions options, CancellationToken cancellationToken = default) + { + UpdateStatus(DaprProcessStatus.Starting); + var commandLineBuilder = Initialize(options, cancellationToken); + StopCore(_successDaprOptions, cancellationToken); + + var utils = new ProcessUtils(_loggerFactory); + + utils.OutputDataReceived += delegate(object? sender, DataReceivedEventArgs args) + { + if (_isFirst) + { + CompleteDaprOptions(options, () => _isFirst = false); + } + DaprProcess_OutputDataReceived(sender, args); + }; + utils.ErrorDataReceived += DaprProcess_ErrorDataReceived; + utils.Exit += delegate + { + UpdateStatus(DaprProcessStatus.Stopped); + _logger?.LogDebug("{Name} process has exited", Const.DEFAULT_FILE_NAME); + }; + _retryTime = 0; + var process = utils.Run(Const.DEFAULT_FILE_NAME, $"run {commandLineBuilder}", options.CreateNoWindow); + _process = new SystemProcess(process); + if (_heartBeatTimer == null && options.EnableHeartBeat) + { + _heartBeatTimer = new System.Timers.Timer + { + AutoReset = true, + Interval = options.HeartBeatInterval + }; + _heartBeatTimer.Elapsed += (sender, args) => HeartBeat(cancellationToken); + _heartBeatTimer.Start(); + } + } + + private static void DaprProcess_OutputDataReceived(object? sender, DataReceivedEventArgs e) + { + if (e.Data == null) return; + + var dataSpan = e.Data.AsSpan(); + var levelStartIndex = e.Data.IndexOf("level=", StringComparison.Ordinal) + 6; + var level = "information"; + if (levelStartIndex > 5) + { + var levelLength = dataSpan.Slice(levelStartIndex).IndexOf(' '); + level = dataSpan.Slice(levelStartIndex, levelLength).ToString(); + } + + var color = Console.ForegroundColor; + switch (level) + { + case "warning": + Console.ForegroundColor = ConsoleColor.Yellow; + break; + case "error": + case "critical": + case "fatal": + Console.ForegroundColor = ConsoleColor.Red; + break; + default: + break; + } + + Console.WriteLine(e.Data); + Console.ForegroundColor = color; + } + + private static void DaprProcess_ErrorDataReceived(object? sender, DataReceivedEventArgs e) + { + if (e.Data == null) return; + + var color = Console.ForegroundColor; + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine(e.Data); + Console.ForegroundColor = color; + } + + public void Stop(CancellationToken cancellationToken = default) + { + lock (_lock) + { + StopCore(_successDaprOptions, cancellationToken); + } + } + + private void StopCore(DaprCoreOptions? options, CancellationToken cancellationToken = default) + { + _process?.Kill(); + if (options != null) + { + List daprList = _daprProvider.GetDaprList(options.AppId); + if (daprList.Any()) + { + foreach (var dapr in daprList) + { + _process = _processProvider.GetProcess(dapr.PId); + _process.Kill(); + } + } + if (options.DaprHttpPort != null) + CheckPortAndKill(options.DaprHttpPort.Value); + if (options.DaprGrpcPort != null) + CheckPortAndKill(options.DaprGrpcPort.Value); + } + } + + /// + /// Refresh the dapr configuration, the source dapr process will be killed and the new dapr process will be restarted + /// todo: At present, there are no restrictions on HttpPort and GrpcPort, but if the configuration update changes HttpPort and GrpcPort, the port obtained by DaprClient will be inconsistent with the actual operation, which needs to be adjusted later. + /// + /// + /// + public void Refresh(DaprOptions options, CancellationToken cancellationToken = default) + { + lock (_lock) + { + _logger?.LogDebug("Dapr configuration refresh, appid is {appid}, please wait...", _successDaprOptions!.AppId); + + if (_successDaprOptions != null) + { + UpdateStatus(DaprProcessStatus.Restarting); + _logger?.LogDebug("Dapr configuration refresh, appid is {appid}, closing dapr, please wait...", + _successDaprOptions!.AppId); + StopCore(_successDaprOptions, cancellationToken); + } + + _isFirst = true; + _successDaprOptions = null; + _process = null; + _logger?.LogDebug("Dapr configuration refresh, appid is {appid}, restarting dapr, please wait...", options.AppId); + StartCore(GetDaprOptions(options), cancellationToken); + } + } + + private void CheckPortAndKill(ushort port) + { + if (!_processProvider.IsAvailablePorts(port)) + { + var pIdList = _processProvider.GetPidByPort(port); + foreach (var pId in pIdList) + { + var process = _processProvider.GetProcess(pId); + _logger?.LogWarning("Port {Port} is used, PId: {PId}, PName: {PName} , Process has been killed by {Name}", + port, + pId, + process.Name, + nameof(Dapr)); + process.Kill(); + } + } + } + + private void HeartBeat(CancellationToken cancellationToken) + { + lock (_lock) + { + if (!_daprProvider.IsExist(_successDaprOptions!.AppId)) + { + if (Status == DaprProcessStatus.Started || Status == DaprProcessStatus.Stopped) + { + _logger?.LogWarning("Dapr stopped, restarting, please wait..."); + StartCore(_successDaprOptions, cancellationToken); + } + else if (Status == DaprProcessStatus.Starting) + { + if (_retryTime < Const.DEFAULT_RETRY_TIME) + { + _retryTime++; + _logger?.LogDebug("Dapr is not started: The {retries}th heartbeat check. AppId is {AppId}", + _retryTime, + _successDaprOptions.AppId); + } + else + { + _logger?.LogWarning( + "Dapr is not started: The {retries}th heartbeat check. Dapr stopped, restarting, please wait...", + _retryTime + 1); + StartCore(_successDaprOptions, cancellationToken); + } + } + else + { + _logger?.LogWarning("Dapr is restarting, the current state is {State}, please wait...", Status); + } + } + else + { + _retryTime = 0; + UpdateStatus(DaprProcessStatus.Started); + } + } + } + + private DaprCoreOptions GetDaprOptions(DaprOptions options) + { + string appId = options.GetAppId(); + ushort appPort = options.GetAppPort(); + DaprCoreOptions dataOptions = new( + appId, + appPort, + options.AppProtocol, + options.EnableSsl, + options.DaprGrpcPort, + options.DaprHttpPort, + options.EnableHeartBeat, + options.HeartBeatInterval!.Value, + options.CreateNoWindow) + { + MaxConcurrency = options.MaxConcurrency, + Config = options.Config, + ComponentPath = options.ComponentPath, + EnableProfiling = options.EnableProfiling, + Image = options.Image, + LogLevel = options.LogLevel, + PlacementHostAddress = options.PlacementHostAddress, + SentryAddress = options.PlacementHostAddress, + MetricsPort = options.MetricsPort, + ProfilePort = options.ProfilePort, + UnixDomainSocket = options.UnixDomainSocket, + DaprMaxRequestSize = options.DaprMaxRequestSize + }; + dataOptions.OutputDataReceived += options.Output; + return dataOptions; + } + + private CommandLineBuilder Initialize(DaprCoreOptions options, CancellationToken cancellationToken) + { + var commandLineBuilder = new CommandLineBuilder(Const.DEFAULT_ARGUMENT_PREFIX); + commandLineBuilder + .Add("app-id", options.AppId) + .Add("app-port", options.AppPort.ToString()) + .Add("app-protocol", options.AppProtocol?.ToString().ToLower() ?? string.Empty, options.AppProtocol == null) + .Add("app-ssl", options.EnableSsl?.ToString().ToLower() ?? "", options.EnableSsl == null) + .Add("components-path", options.ComponentPath ?? string.Empty, options.ComponentPath == null) + .Add("app-max-concurrency", options.MaxConcurrency?.ToString() ?? string.Empty, options.MaxConcurrency == null) + .Add("config", options.Config ?? string.Empty, options.Config == null) + .Add("dapr-grpc-port", options.DaprGrpcPort?.ToString() ?? string.Empty, options.DaprGrpcPort == null) + .Add("dapr-http-port", options.DaprHttpPort?.ToString() ?? string.Empty, options.DaprHttpPort == null) + .Add("enable-profiling", options.EnableProfiling?.ToString().ToLower() ?? string.Empty, options.EnableProfiling == null) + .Add("image", options.Image ?? string.Empty, options.Image == null) + .Add("log-level", options.LogLevel?.ToString().ToLower() ?? string.Empty, options.LogLevel == null) + .Add("placement-host-address", options.PlacementHostAddress ?? string.Empty, options.PlacementHostAddress == null) + .Add("sentry-address", options.SentryAddress ?? string.Empty, options.SentryAddress == null) + .Add("metrics-port", options.MetricsPort?.ToString() ?? string.Empty, options.MetricsPort == null) + .Add("profile-port", options.ProfilePort?.ToString() ?? string.Empty, options.ProfilePort == null) + .Add("unix-domain-socket", options.UnixDomainSocket ?? string.Empty, options.UnixDomainSocket == null) + .Add("dapr-http-max-request-size", options.DaprMaxRequestSize?.ToString() ?? string.Empty, options.DaprMaxRequestSize == null); + + _successDaprOptions ??= options; + return commandLineBuilder; + } + + /// + /// Improve the information of HttpPort and GrpcPort successfully configured. + /// When Port is specified or Dapr is closed for other reasons after startup, the HttpPort and GrpcPort are the same as the Port assigned at the first startup. + /// + private void CompleteDaprOptions(DaprCoreOptions options, Action action) + { + int retry = 0; + if (_successDaprOptions!.DaprHttpPort == null || _successDaprOptions.DaprGrpcPort == null) + { + again: + var daprList = _daprProvider.GetDaprList(_successDaprOptions.AppId); + if (daprList.Any()) + { + var currentDapr = daprList.FirstOrDefault()!; + _successDaprOptions.SetPort(currentDapr.HttpPort, currentDapr.GrpcPort); + } + else + { + if (retry < 3) + { + retry++; + goto again; + } + _logger?.LogWarning("Dapr failed to start, appid is {Appid}", _successDaprOptions!.AppId); + return; + } + } + + string daprHttpPort = _successDaprOptions.DaprHttpPort.ToString()!; + string daprGrpcPort = _successDaprOptions.DaprGrpcPort.ToString()!; + CompleteDaprEnvironment(daprHttpPort, daprGrpcPort, out bool isChange); + action.Invoke(); + if (isChange) + { + options.Output(Const.CHANGE_DAPR_ENVIRONMENT_VARIABLE, + $"update environment variables, DaprHttpPort: {daprHttpPort}, DAPR_GRPC_PORT: {daprGrpcPort}"); + } + } + + private void UpdateStatus(DaprProcessStatus status) + { + if (status != Status) + { + _logger?.LogDebug($"Dapr Process Status Change: {Status} -> {status}"); + Status = status; + } + } + + private static void CompleteDaprEnvironment(string daprHttpPort, string daprGrpcPort, out bool isChange) + { + EnvironmentExtensions.TryAdd("DAPR_GRPC_PORT", () => daprGrpcPort, out bool gRpcPortIsExist); + EnvironmentExtensions.TryAdd("DAPR_HTTP_PORT", () => daprHttpPort, out bool httpPortIsExist); + isChange = !gRpcPortIsExist || !httpPortIsExist; + } + + public void Dispose() => Stop(); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprProvider.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprProvider.cs new file mode 100644 index 000000000..dffa9f5ce --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/DaprProvider.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public class DaprProvider : IDaprProvider +{ + private readonly ILogger? _logger; + private ProcessUtils _processUtils; + + public DaprProvider(ILoggerFactory? loggerFactory) + { + _logger = loggerFactory?.CreateLogger(); + _processUtils = new ProcessUtils(loggerFactory); + } + + public List GetDaprList(string appId) + { + _processUtils.Exit += delegate + { + _logger?.LogDebug("{Name} process has exited", Const.DEFAULT_FILE_NAME); + }; + _processUtils.Run(Const.DEFAULT_FILE_NAME, "list -o json", out string response, true, true); + List daprList = new(); + try + { + if (response.StartsWith("[")) + { + daprList = System.Text.Json.JsonSerializer.Deserialize>(response) ?? new(); + } + else if (response.StartsWith("{")) + { + var option = System.Text.Json.JsonSerializer.Deserialize(response); + if (option != null) + { + daprList.Add(option); + } + } + else + { + _logger?.LogWarning("----- Failed to get currently running dapr"); + } + } + catch (Exception exception) + { + _logger?.LogWarning(exception, "----- Error getting list of running dapr, response message is {response}", response); + return new List(); + } + return daprList.Where(dapr => dapr.AppId == appId).ToList(); + } + + public bool IsExist(string appId) + { + return GetDaprList(appId).Any(); + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs new file mode 100644 index 000000000..80b10cccf --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/EnvironmentExtensions.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public static class EnvironmentExtensions +{ + public static void TryAdd(string environment, Func func, out bool isExist) + { + var value = Environment.GetEnvironmentVariable(environment); + isExist = value == null; + if (isExist) + { + Environment.SetEnvironmentVariable(environment, func.Invoke()); + } + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/IDaprProcess.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/IDaprProcess.cs new file mode 100644 index 000000000..8f54fe5b2 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/IDaprProcess.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public interface IDaprProcess : IDisposable +{ + void Start(DaprOptions options, CancellationToken cancellationToken = default); + + void Stop(CancellationToken cancellationToken = default); + + /// + /// Refresh the dapr configuration, the source dapr process will be killed and the new dapr process will be restarted + /// + /// + /// + void Refresh(DaprOptions options, CancellationToken cancellationToken = default); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/IDaprProvider.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/IDaprProvider.cs new file mode 100644 index 000000000..e7d2a1e2f --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/IDaprProvider.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public interface IDaprProvider +{ + List GetDaprList(string appId); + + bool IsExist(string appId); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs new file mode 100644 index 000000000..5ce5e4294 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/CommandArgumentBuilder.cs @@ -0,0 +1,55 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +public class CommandArgumentBuilder +{ + private const string DEFAULT_ARGUMENT_SEPARATOR = " "; + private const string DEFAULT_ARGUMENT_PREFIX = "--"; + + private Dictionary _arguments = new(); + + public string ArgumemtPrefix { get; } + + private string _argumentSeparator = default!; + + public string ArgumentSeparator + { + get => _argumentSeparator; + set => _argumentSeparator = string.IsNullOrEmpty(value) ? DEFAULT_ARGUMENT_SEPARATOR : value; + } + + public CommandArgumentBuilder(string? argumentPrefix = null) + { + ArgumemtPrefix = string.IsNullOrEmpty(argumentPrefix) ? DEFAULT_ARGUMENT_PREFIX : argumentPrefix; + ArgumentSeparator = DEFAULT_ARGUMENT_SEPARATOR; + } + + public CommandArgumentBuilder Add(string name, object? value = null) + { + if (value == null || string.IsNullOrEmpty(name)) + { + return this; + } + + if (_arguments.ContainsKey(name)) + { + _arguments.Remove(name); + } + + _arguments.Add(name, value.ToString() ?? ""); + return this; + } + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + foreach (var item in _arguments) + { + stringBuilder.Append($"{ArgumentSeparator}{ArgumemtPrefix}{item.Key}{ArgumentSeparator}{item.Value}"); + } + + return stringBuilder.ToString(); + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/Const.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/Const.cs new file mode 100644 index 000000000..f6c7e5376 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/Const.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +internal class Const +{ + public const string DEFAULT_APPID_DELIMITER = "-"; + + public const string DEFAULT_FILE_NAME = "dapr"; + + public const string DEFAULT_ARGUMENT_PREFIX = "--"; + + /// + /// Heartbeat detection interval, used to detect dapr status + /// + public const int DEFAULT_HEARTBEAT_INTERVAL = 5000; + + /// + /// Default number of retries + /// + public const int DEFAULT_RETRY_TIME = 10; + + /// + /// Change the dapr environment variable + /// + public const string CHANGE_DAPR_ENVIRONMENT_VARIABLE = "DAPR_CHANGE_ENVIRONMENT_VARIABLE"; +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs new file mode 100644 index 000000000..74e9fcc83 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/DaprCoreOptions.cs @@ -0,0 +1,145 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +internal class DaprCoreOptions +{ + /// + /// The id for your application, used for service discovery + /// Required, no blanks allowed + /// + public string AppId { get; } + + /// + /// The port your application is listening on + /// + public ushort AppPort { get; } + + /// + /// The protocol (gRPC or HTTP) Dapr uses to talk to the application. Valid values are: http or grpc + /// + public Protocol? AppProtocol { get; } + + /// + /// Enable https when Dapr invokes the application + /// + public bool? EnableSsl { get; } + + /// + /// The gRPC port for Dapr to listen on + /// + public ushort? DaprGrpcPort { get; private set; } + + /// + /// The HTTP port for Dapr to listen on + /// + public ushort? DaprHttpPort { get; private set; } + + public bool EnableHeartBeat { get; private set; } + + public int HeartBeatInterval { get; } + + public bool CreateNoWindow { get; } = true; + + /// + /// The concurrency level of the application, otherwise is unlimited + /// + public int? MaxConcurrency { get; set; } + + /// + /// Dapr configuration file + /// default: + /// Linux & Mac: $HOME/.dapr/config.yaml + /// Windows: %USERPROFILE%\.dapr\config.yaml + /// + public string? Config { get; set; } + + /// + /// The path for components directory + /// default: + /// Linux & Mac: $HOME/.dapr/components + /// Windows: %USERPROFILE%\.dapr\components + /// + public string? ComponentPath { get; set; } + + /// + /// Enable pprof profiling via an HTTP endpoint + /// + public bool? EnableProfiling { get; set; } + + /// + /// The image to build the code in. Input is: repository/image + /// + public string? Image { get; set; } + + /// + /// The log verbosity. Valid values are: debug, info, warn, error, fatal, or panic + /// default: info + /// + public LogLevel? LogLevel { get; set; } + + /// + /// default: localhost + /// + public string? PlacementHostAddress { get; set; } + + /// + /// Address for the Sentry CA service + /// + public string? SentryAddress { get; set; } + + /// + /// The port that Dapr sends its metrics information to + /// + public ushort? MetricsPort { get; set; } + + /// + /// The port for the profile server to listen on + /// + public ushort? ProfilePort { get; set; } + + /// + /// Path to a unix domain socket dir mount. If specified + /// communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports + /// Not available on Windows OS + /// + public string? UnixDomainSocket { get; set; } + + /// + /// Max size of request body in MB. + /// + public int? DaprMaxRequestSize { get; set; } + + public event DaprEventHandler? OutputDataReceived; + + public DaprCoreOptions( + string appId, + ushort appPort, + Protocol? appProtocol, + bool? enableSsl, + ushort? daprGrpcPort, + ushort? daprHttpPort, + bool enableHeartBeat, + int heartBeatInterval, + bool createNoWindow) + { + AppId = appId; + AppPort = appPort; + AppProtocol = appProtocol; + EnableSsl = enableSsl; + DaprGrpcPort = daprGrpcPort; + DaprHttpPort = daprHttpPort; + EnableHeartBeat = enableHeartBeat; + HeartBeatInterval = heartBeatInterval; + CreateNoWindow = createNoWindow; + } + + public void SetPort(ushort httpPort, ushort rpcPort) + { + DaprHttpPort ??= httpPort; + DaprGrpcPort ??= rpcPort; + } + + public void Output(string type, string data) => OutputDataReceived?.Invoke(type, data); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs new file mode 100644 index 000000000..c4f29c0d0 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/DaprProcessStatus.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +public enum DaprProcessStatus +{ + Starting = 1, + Started, + Stopping, + Stopped, + Restarting +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs new file mode 100644 index 000000000..0442234cd --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/NetworkUtils.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +internal class NetworkUtils +{ + public static string GetPhysicalAddress() + { + var firstMacAddress = NetworkInterface + .GetAllNetworkInterfaces() + .Where(nic => nic.OperationalStatus == OperationalStatus.Up && nic.NetworkInterfaceType != NetworkInterfaceType.Loopback) + .Select(nic => nic.GetPhysicalAddress().ToString()) + .FirstOrDefault(); + + return firstMacAddress ?? string.Empty; + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs new file mode 100644 index 000000000..200341906 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Internal/ProcessUtils.cs @@ -0,0 +1,107 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Internal; + +internal class ProcessUtils +{ + private readonly ILogger? _logger; + + public ProcessUtils(ILoggerFactory? loggerFactory = null) + { + _logger = loggerFactory?.CreateLogger(); + } + + public System.Diagnostics.Process Run( + string fileName, + string arguments, + bool createNoWindow = true, + bool isWait = false) + => Run(fileName, arguments, out string _, createNoWindow, isWait); + + public System.Diagnostics.Process Run( + string fileName, + string arguments, + out string response, + bool createNoWindow = true, + bool isWait = false) + { + _logger?.LogDebug("FileName: {FileName}, Arguments: {Arguments}", fileName, arguments); + var processStartInfo = new ProcessStartInfo + { + FileName = fileName, + Arguments = arguments, + UseShellExecute = !createNoWindow, + CreateNoWindow = createNoWindow + }; + var daprProcess = new System.Diagnostics.Process() + { + StartInfo = processStartInfo, + }; + if (createNoWindow) + { + processStartInfo.RedirectStandardInput = true; + processStartInfo.RedirectStandardError = true; + processStartInfo.RedirectStandardOutput = true; + + if (!isWait) + { + daprProcess.OutputDataReceived += (_, args) => OnOutputDataReceived(args); + daprProcess.ErrorDataReceived += (_, args) => OnErrorDataReceived(args); + } + } + daprProcess.Start(); + if (createNoWindow && !isWait) + { + daprProcess.BeginOutputReadLine(); + daprProcess.BeginErrorReadLine(); + } + daprProcess.Exited += (_, _) => OnExited(); + string command = $"{fileName} {arguments}"; + _logger?.LogDebug("Process: {ProcessName}, Command: {Command}, PID: {ProcessId} executed successfully", fileName, + command, daprProcess.Id); + + if (isWait) + { + response = daprProcess.StandardOutput.ReadToEnd(); + daprProcess.WaitForExit(); + } + else + { + response = string.Empty; + } + return daprProcess; + } + + public event EventHandler OutputDataReceived = default!; + + public event EventHandler? ErrorDataReceived; + + public event EventHandler Exit = default!; + + protected virtual void OnOutputDataReceived(DataReceivedEventArgs args) + { + try + { + OutputDataReceived(this, args); + } + catch (Exception ex) + { + _logger?.LogError("ProcessUtils: error in output information ", ex); + } + } + + protected virtual void OnErrorDataReceived(DataReceivedEventArgs args) + { + try + { + ErrorDataReceived?.Invoke(this, args); + } + catch (Exception ex) + { + _logger?.LogError("execution error", ex); + } + } + + protected virtual void OnExited() => Exit(this, EventArgs.Empty); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/LogLevel.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/LogLevel.cs new file mode 100644 index 000000000..a47b5c2e0 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/LogLevel.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public enum LogLevel +{ + Debug = 1, + Info, + Warn, + Error, + Fatal, + Panic +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj new file mode 100644 index 000000000..4fd57bf4d --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Masa.Utils.Development.Dapr.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/IProcess.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/IProcess.cs new file mode 100644 index 000000000..b0ace3f57 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/IProcess.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Process; + +public interface IProcess +{ + int PId { get; } + + public string Name { get; } + + void Kill(); + + bool Start(); + + void WaitForExit(int? milliseconds = null); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs new file mode 100644 index 000000000..779ba3995 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/IProcessProvider.cs @@ -0,0 +1,33 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Process; + +public interface IProcessProvider +{ + /// + /// Get process collection based on process name + /// + /// + /// Process collection + IEnumerable GetProcesses(string processName); + + IProcess GetProcess(int pId); + + /// + /// get available ports + /// + /// Minimum port (includes minimum port), default: 0 + /// Maximum ports (including maximum ports), default: 65535 + /// + int GetAvailablePorts(ushort? minPort = null, ushort? maxPort = null); + + /// + /// Is the port available + /// + /// + /// + bool IsAvailablePorts(ushort port); + + List GetPidByPort(ushort port); +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs new file mode 100644 index 000000000..8acca69f4 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/ProcessProvider.cs @@ -0,0 +1,181 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Process; + +public class ProcessProvider : IProcessProvider +{ + private readonly ILogger? _logger; + + public ProcessProvider(ILoggerFactory loggerFactory) + { + _logger = loggerFactory.CreateLogger(); + } + + /// + /// Get process collection based on process name + /// + /// + /// + public IEnumerable GetProcesses(string processName) + => System.Diagnostics.Process.GetProcessesByName(processName).Select(process => new SystemProcess(process)); + + public IProcess GetProcess(int pId) + => new SystemProcess(System.Diagnostics.Process.GetProcessById(pId)); + + /// + /// get available ports + /// + /// Minimum port (includes minimum port), default: 0 + /// Maximum ports (including maximum ports), default: 65535 + /// + public int GetAvailablePorts(ushort? minPort = null, ushort? maxPort = null) + { + minPort ??= ushort.MinValue; + maxPort ??= ushort.MaxValue; + var usePorts = GetPortsByUsed(); + + var effectivePorts = Enumerable.Range(minPort.Value, maxPort.Value).Except(usePorts).ToList(); + if (effectivePorts.Count == 0) + throw new Exception("... No port available exception"); + + return effectivePorts.FirstOrDefault(); + } + + /// + /// Is the port available + /// + /// + /// + public bool IsAvailablePorts(ushort port) + => !GetPortsByUsed().Contains(port); + + public List GetPidByPort(ushort port) + { + List pIdList = new(); + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + List output = GetResponse("netstat", $"-a -n -o", "\r\n"); + + foreach (var line in output) + { + if (line.Trim().StartsWith("Proto") || line.Trim().StartsWith("协议")) + continue; + + var parts = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + var len = parts.Length; + if (len > 2) + { + var pId = int.Parse(parts[len - 1].Split('/')[0]); + if (int.Parse(parts[1].Split(':').Last()) == port && !pIdList.Contains(pId)) + { + pIdList.Add(pId); + } + } + } + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + List output = GetResponse("netstat", $"-tunlp", "\n"); + + Console.WriteLine("result: " + output.Count); + Console.WriteLine("result2: " + System.Text.Json.JsonSerializer.Serialize(output)); + foreach (var line in output) + { + Console.WriteLine("line: " + line); + if (!line.Trim().StartsWith("tcp", StringComparison.OrdinalIgnoreCase) && + !line.Trim().StartsWith("udp", StringComparison.OrdinalIgnoreCase)) + continue; + + var parts = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + var len = parts.Length; + if (len > 2) + { + var pId = int.Parse(parts[GetIndex(parts, "LISTEN") + 1].Split('/')[0]); + if (int.Parse(parts[3].Split(':').Last()) == port && !pIdList.Contains(pId)) + { + pIdList.Add(pId); + } + } + } + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + List output = GetResponse("lsof", $"-nP -iTCP -sTCP:LISTEN", "\n"); + + Console.WriteLine("result: " + output.Count); + Console.WriteLine("result2: " + System.Text.Json.JsonSerializer.Serialize(output)); + foreach (var line in output) + { + Console.WriteLine("line: " + line); + if (line.Trim().StartsWith("COMMAND", StringComparison.OrdinalIgnoreCase)) + continue; + + var parts = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + var len = parts.Length; + if (len > 2) + { + var pId = int.Parse(parts[1]); + if (int.Parse(parts[parts.Length - 2].Split(':').Last()) == port && !pIdList.Contains(pId)) + { + pIdList.Add(pId); + } + } + } + } + else + { + _logger?.LogError("unsupported operating system"); + } + return pIdList.Where(pid => pid > 0).ToList(); + } + + private int GetIndex(string[] array, string content) + { + for (var index = 0; index < array.Length; index++) + { + if (array[index].Equals(content, StringComparison.OrdinalIgnoreCase)) + return index; + } + return 0; + } + + private List GetResponse(string fileName, string arguments, string pattern) + { + var process = new System.Diagnostics.Process() + { + StartInfo = new ProcessStartInfo + { + FileName = fileName, + Arguments = arguments, + UseShellExecute = false, + RedirectStandardInput = true, + RedirectStandardOutput = true, + RedirectStandardError = true + } + }; + process.Start(); + + var output = process.StandardOutput.ReadToEnd(); + return Regex.Split(output, pattern).ToList(); + } + + /// + /// get the currently used port + /// + /// Port set that has been used + private IEnumerable GetPortsByUsed() + { + var ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); + var connectionEndPoints = ipGlobalProperties.GetActiveTcpConnections().Select(information => information.LocalEndPoint); + var tcpListenerEndPoints = ipGlobalProperties.GetActiveTcpListeners(); + var udpListenerEndPoints = ipGlobalProperties.GetActiveUdpListeners(); + return connectionEndPoints + .Concat(tcpListenerEndPoints) + .Concat(udpListenerEndPoints) + .Select(endPoint => endPoint.Port); + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/SystemProcess.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/SystemProcess.cs new file mode 100644 index 000000000..afea10ba9 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Process/SystemProcess.cs @@ -0,0 +1,39 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr.Process; + +public class SystemProcess : IProcess +{ + private readonly System.Diagnostics.Process _process; + + public SystemProcess(System.Diagnostics.Process process) + { + _process = process; + } + + public int PId => IsRun ? _process.Id : 0; + + public string Name => IsRun ? _process.ProcessName : string.Empty; + + public bool IsRun => !_process.HasExited; + + public void Kill() + { + if (IsRun) _process.Kill(); + } + + public bool Start() => _process.Start(); + + public void WaitForExit(int? milliseconds = null) + { + if (milliseconds is > 0) + { + _process.WaitForExit(milliseconds.Value); + } + else if (IsRun) + { + _process.Kill(); + } + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Protocol.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Protocol.cs new file mode 100644 index 000000000..7c4cba425 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/Protocol.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Development.Dapr; + +public enum Protocol +{ + Http = 1, + GRpc +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/README.md b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/README.md new file mode 100644 index 000000000..630e687a5 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/README.md @@ -0,0 +1,95 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Development.Dapr + +Dapr Starter Core Library + +Responsibilities: + +Provide core support for Masa.Utils.Development.Dapr.AspNetCore + +The start, stop, refresh, and dapr daemon of the dapr process are provided by such libraries + +### Usage: + +1. Install Masa.Utils.Development.Dapr.AspNetCore +``` C# +Install-Package Masa.Utils.Development.Dapr.AspNetCore +``` + +2. Add DaprStarter to assist in managing the dapr process (recommended to be used in the development environment) + +``` C# +builder.Services.AddDaprStarterCore(); +``` + +3. Inject IDaprProcess at the specified location as needed, and then call the Start method to start the dapr process or hand it over to Masa.Utils.Development.Dapr.AspNetCore to manage the dapr process. Related documents can be found at [View](../Masa.Utils.Development.Dapr.AspNetCore/README.md) + +Example: + +New DaprController + +``` C# DaprController.cs +public class DaprController : ControllerBase +{ + private readonly IDaprProcess _daprProcess; + + private readonly DaprOptions _options; + + public DaprController(IDaprProcess daprProcess, IOptions options) + { + _daprProcess = daprProcess; + _options = options.Value; + } + + [HttpGet(Name = "Start")] + public string Start() + { + _daprProcess.Start(_options); + return "start success"; + } + + [HttpGet(Name = "Stop")] + public string Stop() + { + _daprProcess.Stop(); + return "stop success"; + } +} +``` + +## Notice + +1. The netstat command is used in the library, please make sure the netstat command is available + +> Windows system supports netstat command by default without special installation +> +> Linux and OSX need to confirm by themselves whether netstat is installed on the computer + +Open a terminal and enter the following command to confirm that the computer supports the netstat command: + +```` +netstat -h +```` + +Example: ubuntu: + +```` +apt-get install net-tools +```` + +2. AppId, AppIdSuffix strongly recommend not to enter a string containing ., otherwise it will cause problems with the dapr call. It is recommended to use - + 1. Dapr AppID follows the FQDN format, which includes the target namespace + 2. FQDN is spliced with the symbol . + +### Rule + +dapr AppId naming rules default: + +AppId + "-" + AppIdSuffix + +AppId default: Appid.Replace(".","-") + +AppIdSuffix default: network card address + +When AppIdSuffix is empty, the appid of dapr is equal to AppId diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/README.zh-CN.md b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/README.zh-CN.md new file mode 100644 index 000000000..022edfaf8 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/README.zh-CN.md @@ -0,0 +1,95 @@ +中 | [EN](README.md) + +## Masa.Utils.Development.Dapr + +Dapr Starter核心库 + +职责: + +为Masa.Utils.Development.Dapr.AspNetCore 提供核心支撑,支持windows、linux、OSX + +dapr进程的启动、停止、刷新、dapr守护进程均由此类库提供 + +### 用法: + +1. 安装Masa.Utils.Development.Dapr.AspNetCore +```C# +Install-Package Masa.Utils.Development.Dapr.AspNetCore +``` + +2. 添加DaprStarter协助管理dapr进程(建议在开发环境使用) + +```C# +builder.Services.AddDaprStarterCore(); +``` + +3. 根据需要在指定位置注入IDaprProcess, 之后调用Start方法即可启动dapr进程或者交由Masa.Utils.Development.Dapr.AspNetCore管理dapr进程,相关文档可[查看](../Masa.Utils.Development.Dapr.AspNetCore/README.zh-CN.md) + +例如: + +新建DaprController + +``` C# DaprController.cs +public class DaprController : ControllerBase +{ + private readonly IDaprProcess _daprProcess; + + private readonly DaprOptions _options; + + public DaprController(IDaprProcess daprProcess, IOptions options) + { + _daprProcess = daprProcess; + _options = options.Value; + } + + [HttpGet(Name = "Start")] + public string Start() + { + _daprProcess.Start(_options); + return "start success"; + } + + [HttpGet(Name = "Stop")] + public string Stop() + { + _daprProcess.Stop(); + return "stop success"; + } +} +``` + +## 注意 + +1. 库中有使用到netstat命令,请确保netstat命令是可用的 + +> Windows系统默认支持netstat命令无需特殊安装 +> +> Linux与OSX需要自行确认确认电脑是否安装netstat + +打开终端输入以下命令确认电脑支持netstat命令: + +``` +netstat -h +``` + +例:ubuntu: + +``` +apt-get install net-tools +``` + +2. AppId、AppIdSuffix强烈建议不要输入含.的字符串,否则会导致dapr调用出现问题,推荐使用- + 1. Dapr AppID遵循FQDN格式,其中包括目标命名空间 + 2. FQDN是通过符号.来拼接域名的 + +### 规则 + +dapr AppId命名规则默认: + +AppId + "-" + AppIdSuffix + +AppId默认:Appid.Replace(".","-") + +AppIdSuffix默认:网卡地址 + +当AppIdSuffix为空时,dapr的appid等于AppId \ No newline at end of file diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..cc4ba23a5 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/ServiceCollectionExtensions.cs @@ -0,0 +1,44 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public delegate void DaprEventHandler(string type, string data); + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddDaprStarterCore(this IServiceCollection services, Action? action = null) + { + if (action != null) + services.Configure(action); + else + services.Configure(_ => + { + }); + return services.AddDaprStarter(); + } + + public static IServiceCollection AddDaprStarterCore(this IServiceCollection services, IConfiguration configuration) + { + services.Configure(configuration); + return services.AddDaprStarter(); + } + + private static IServiceCollection AddDaprStarter(this IServiceCollection services) + { + if (services.Any(service => service.ImplementationType == typeof(DaprService))) + return services; + + services.AddSingleton(); + + services.TryAddSingleton(typeof(IDaprProcess), typeof(DaprProcess)); + services.TryAddSingleton(typeof(IDaprProvider), typeof(DaprProvider)); + services.TryAddSingleton(typeof(IProcessProvider), typeof(ProcessProvider)); + return services; + } + + private class DaprService + { + + } +} diff --git a/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/_Imports.cs b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/_Imports.cs new file mode 100644 index 000000000..c666c7d32 --- /dev/null +++ b/src/Utils/Development/Dapr/Masa.Utils.Development.Dapr/_Imports.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Development.Dapr; +global using Masa.Utils.Development.Dapr.Configurations; +global using Masa.Utils.Development.Dapr.Internal; +global using Masa.Utils.Development.Dapr.Process; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using System.Diagnostics; +global using System.Net.NetworkInformation; +global using System.Reflection; +global using System.Runtime.InteropServices; +global using System.Text; +global using System.Text.Json.Serialization; +global using System.Text.RegularExpressions; diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs new file mode 100644 index 000000000..def4eca3c --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/BaseTypeProvider.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public abstract class BaseTypeProvider : ITypeProvider +{ + public virtual bool IsAssignableFrom(Type type, Type targetType) + { + if (type.IsGenericType && + type.GetTypeInfo().GenericTypeParameters.Length > 0 && + targetType.IsGenericType && + targetType.GetTypeInfo().GenericTypeParameters.Length > 0) + return targetType.GetInterfaces().Any(t => t.IsGenericType && t.GetGenericTypeDefinition() == type); + + return type.IsAssignableFrom(targetType); + } + + public virtual bool IsAssignableTo(Type type, Type targetType) + => IsAssignableFrom(targetType, type); + + public virtual List GetAllTypes() => GetAllTypes(AppDomain.CurrentDomain.GetAssemblies()); + + public virtual List GetAllTypes(IEnumerable assemblies) + => assemblies.SelectMany(assembly => assembly.GetTypes()).ToList(); + + public abstract List GetServiceDescriptors(List types); +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs new file mode 100644 index 000000000..87974ab8b --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultServiceRegister.cs @@ -0,0 +1,41 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public class DefaultServiceRegister : IServiceRegister +{ + public void Add(IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime) + { + var dependency = implementationType.GetCustomAttribute(); + var descriptor = services.FirstOrDefault(d => d.ServiceType == serviceType); + if (dependency != null) + { + if (descriptor != null) + { + var preDependency = descriptor.ImplementationType?.GetCustomAttribute(); + if (preDependency is { ReplaceServices: true }) + return; + + if (dependency.ReplaceServices || preDependency is { TryRegister: true }) + services.Remove(descriptor); + else if (dependency.TryRegister) + return; + } + } + else + { + if (descriptor != null) + { + var preDependency = descriptor.ImplementationType?.GetCustomAttribute(); + if (preDependency is { ReplaceServices: true }) + return; + + if (preDependency is { TryRegister: true }) + services.Remove(descriptor); + } + } + + services.Add(new ServiceDescriptor(serviceType, implementationType, lifetime)); + } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs new file mode 100644 index 000000000..a715c77cf --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DefaultTypeProvider.cs @@ -0,0 +1,73 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public class DefaultTypeProvider : BaseTypeProvider +{ + public override List GetServiceDescriptors(List types) + => GetServiceDescriptorCore(types, typeof(ISingletonDependency), ServiceLifetime.Singleton) + .Concat(GetServiceDescriptorCore(types, typeof(IScopedDependency), ServiceLifetime.Scoped)) + .Concat(GetServiceDescriptorCore(types, typeof(ITransientDependency), ServiceLifetime.Transient)).ToList(); + + public virtual List GetServiceDescriptorCore(List types, Type type, ServiceLifetime lifetime) + { + List descriptors = new(); + var serviceTypes = GetServiceTypes(types, type); + foreach (var serviceType in serviceTypes) + { + var implementationTypes = GetImplementationTypes(types, serviceType); + foreach (var implementationType in implementationTypes) + { + if (serviceType.IsGenericType && + implementationType.IsGenericType && + serviceType.GetTypeInfo().GenericTypeParameters.Length != implementationType.GetTypeInfo().GenericTypeParameters.Length) + continue; + + descriptors.Add(new ServiceDescriptorOptions(serviceType, implementationType, lifetime, AutoFire(serviceType))); + } + } + + return descriptors; + } + + public virtual bool AutoFire(Type serviceType) + => IsAssignableFrom(typeof(IAutoFireDependency), serviceType); + + public virtual List GetImplementationTypes(List types, Type serviceType) + { + if (serviceType.IsInterface) + return types.Where(t => !t.IsAbstract && t.IsClass && IsAssignableFrom(serviceType, t)).ToList(); + + return new List + { + serviceType + }; + } + + public virtual List GetServiceTypes(List types, Type interfaceType) + { + var interfaceServiceTypes = types.Where(t => t.IsInterface && t != interfaceType && interfaceType.IsAssignableFrom(t)); + return types.Where(type + => IsAssignableFrom(interfaceType, type) && !type.GetInterfaces().Any(t => interfaceServiceTypes.Contains(t)) && + !IsSkip(type)) + .Concat(interfaceServiceTypes) + .ToList(); + } + + public virtual bool IsSkip(Type type) + { + if (type.IsAbstract) + return true; + + var ignoreInjection = type.GetCustomAttribute(); + if (ignoreInjection == null) + return false; + + var inheritIgnoreInjection = type.GetCustomAttribute(false); + if (inheritIgnoreInjection != null) + return true; + + return ignoreInjection.Cascade; + } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs new file mode 100644 index 000000000..422fae267 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/DependencyAttribute.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +[AttributeUsage(AttributeTargets.Class)] +public class DependencyAttribute : Attribute +{ + /// + /// Attempt to register only if not registered + /// + public virtual bool TryRegister { get; set; } = false; + + /// + /// If the original service is already registered, replace the service registration, if not, register the service to DI + /// + public virtual bool ReplaceServices { get; set; } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs new file mode 100644 index 000000000..b55247fcb --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IAutoFireDependency.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +/// +/// Automatic trigger injection, After the service is added, it will be obtained once +/// Need to be used with ISingletonDependency, IScopedDependency, ISingletonDependency +/// +public interface IAutoFireDependency +{ +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs new file mode 100644 index 000000000..75d0c6b21 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IScopedDependency.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface IScopedDependency +{ +} + + +public interface ITestService : IScopedDependency + where T : class +{ + +} + +public class TestSerice : ITestService + where T : class +{ + +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs new file mode 100644 index 000000000..0161f094d --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IServiceRegister.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface IServiceRegister +{ + void Add(IServiceCollection services, Type serviceType, Type implementationType, ServiceLifetime lifetime); +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs new file mode 100644 index 000000000..a995b1f6c --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ISingletonDependency.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface ISingletonDependency +{ +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs new file mode 100644 index 000000000..8d894bd06 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ITransientDependency.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface ITransientDependency +{ +} + diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs new file mode 100644 index 000000000..4aa29c856 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ITypeProvider.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public interface ITypeProvider +{ + bool IsAssignableFrom(Type type, Type targetType); + + bool IsAssignableTo(Type type, Type targetType); + + List GetAllTypes(); + + List GetAllTypes(IEnumerable assemblies); + + List GetServiceDescriptors(List types); +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs new file mode 100644 index 000000000..ab6df6e3b --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/IgnoreInjectionAttribute.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] +public class IgnoreInjectionAttribute : Attribute +{ + public bool Cascade { get; set; } + + public IgnoreInjectionAttribute(bool cascade = false) + { + Cascade = cascade; + } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj new file mode 100644 index 000000000..63130ab81 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/Masa.Utils.Extensions.DependencyInjection.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + Microsoft.Extensions.DependencyInjection + + + + + + + diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs new file mode 100644 index 000000000..59d4b6f8a --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/Options/ServiceDescriptorOptions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection.Options; + +public class ServiceDescriptorOptions +{ + public Type ServiceType { get; } + + public Type ImplementationType { get; } + + public ServiceLifetime Lifetime { get; } + + public bool AutoFire { get; } + + public ServiceDescriptorOptions(Type serviceType, Type implementationType, ServiceLifetime lifetime, bool autoFire) + { + ServiceType = serviceType; + ImplementationType = implementationType; + Lifetime = lifetime; + AutoFire = autoFire; + } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md new file mode 100644 index 000000000..6ce88603a --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/README.md @@ -0,0 +1,117 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Extensions.DependencyInjection + +### Reference package: + +````c# +Install-Package Masa.Utils.Extensions.DependencyInjection +```` +### Usage: + +````C# +services.AddAutoInject(); +```` + +## Dependent interface: + +* ISingletonDependency: registers a service whose lifecycle is Singleton +* IScopedDependency: registers a service whose lifecycle is Scoped +* ITransientDependency: registers services whose lifecycle is Transient +* IAutoFireDependency: is automatically triggered (used in combination with ISingletonDependency, IScopedDependency, and ITransientDependency to trigger a service acquisition operation after the service is automatically registered, only inheriting IAutoFireDependency does not work) + +Example: + +````c# +public interface IRepository : IScopedDependency + where TEntity : class +{ + +} +```` + +> Because IRepository inherits IScopedDependency, the life cycle of IRepository will be Scoped + +## Rule: + +Scan the interfaces and classes that inherit ISingletonDependency, IScopedDependency, and ITransientDependency in the assembly, and automatically register services for them + +* When inheriting an interface, its ServiceType is the current interface, and its ImplementationType is the implementation class of the current interface + * If the current interface has multiple implementation classes, it will be added multiple times + + ```` C# + public interface IUserService : IScopedDependency + { + + } + + public class UserService : IUserService + { + + } + ```` + > Equivalent to service.AddScoped(); + + * If you want the interface to have only one implementation class, add [Dependency(ReplaceServices = true)] above the implementation class + + ```` C# + public interface IUserService : IScopedDependency + { + + } + + public class UserService : IUserService + { + + } + + [Dependency(ReplaceServices = true)] + public class UserService2 : IUserService + { + + } + ```` + > Equivalent to service.AddScoped(); + +* When the inherited class is not an interface, its ServiceType is the current class, and its ImplementationType is also the current class + * By default, the cascade scan registration service is supported, and subclasses of the current class will also be registered + + ```` C# + public class BaseRepository : ISingletonDependency + { + + } + + /// + /// Abstract classes are not automatically registered + /// + public abstract class CustomizeBaseRepository : ISingletonDependency + { + + } + + public class UserRepository : BaseRepository + { + + } + ```` + + > Equivalent to: `service.AddSingleton();service.AddSingleton();` + +## Features: + +* IgnoreInjection: Ignore injection, used to exclude not being injected automatically +* Dependency: + * TryRegister: Set true to be registered only when the service is not registered, similar to TryAdd of IServiceCollection... extension method + * ReplaceServices: Set true to replace previously registered services, similar to the Replace... extension method of IServiceCollection. + +## Methods: + +* Extend IServiceCollection +* GetInstance(): Get the instance of service T + * Any(): Whether there is a service TService, does not support generic services + * Any(): Whether there is a service whose interface is TService and whose implementation class is TImplementation + * Any(ServiceLifetime.Singleton): Whether there is a service TService with a life cycle of Singleton (generic services are not supported) + * Any(ServiceLifetime.Singleton): Is there an interface whose life cycle is Singleton as TService and is implemented as a TImplementation service (generic services are not supported) + * Replace(typeof(TImplementation), ServiceLifetime.Singleton): Remove the first service with the same service type in the service collection, and add typeof(TImplementation) to the collection, the life cycle is a singleton + * ReplaceAll(typeof(TImplementation), ServiceLifetime.Singleton): Remove all services with the same service type in the service collection, and add typeof(TImplementation) to the collection, the life cycle is a singleton \ No newline at end of file diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md new file mode 100644 index 000000000..e8a324b02 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/README.zh-CN.md @@ -0,0 +1,117 @@ +中 | [EN](README.md) + +## Masa.Utils.Extensions.DependencyInjection + +### 引用包: + +```c# +Install-Package Masa.Utils.Extensions.DependencyInjection +``` +### 用法: + +```C# +services.AddAutoInject(); +``` + +## 依赖接口: + +* ISingletonDependency: 注册生命周期为Singleton的服务 +* IScopedDependency: 注册生命周期为Scoped的服务 +* ITransientDependency: 注册生命周期为Transient的服务 +* IAutoFireDependency: 自动触发(与ISingletonDependency、IScopedDependency、ITransientDependency结合使用,在服务自动注册结束后触发一次获取服务操作,仅继承IAutoFireDependency不起作用) + +示例: + +```c# +public interface IRepository : IScopedDependency + where TEntity : class +{ + +} +``` + +> 因IRepository继承IScopedDependency,所以会将IRepository的生命周期为Scoped + +## 规则: + +扫描程序集中继承ISingletonDependency、IScopedDependency、ITransientDependency的接口以及类,并为其自动注册服务 + +* 当继承的是接口时,其ServiceType是当前接口,其ImplementationType是当前接口的实现类 + * 如果当前接口有多个实现类,会被多次添加 + + ``` C# + public interface IUserService : IScopedDependency + { + + } + + public class UserService : IUserService + { + + } + ``` + > 等价于 service.AddScoped(); + + * 如果希望接口只有一个实现类,则在实现类上方增加[Dependency(ReplaceServices = true)]即可 + + ``` C# + public interface IUserService : IScopedDependency + { + + } + + public class UserService : IUserService + { + + } + + [Dependency(ReplaceServices = true)] + public class UserService2 : IUserService + { + + } + ``` + > 等价于 service.AddScoped(); + +* 当继承的类不是接口时,其ServiceType是当前类,其ImplementationType也是当前类 + * 默认支持级联扫描注册服务,当前类的子类也会被注册 + + ``` C# + public class BaseRepository : ISingletonDependency + { + + } + + /// + /// 抽象类不会被自动注册 + /// + public abstract class CustomizeBaseRepository : ISingletonDependency + { + + } + + public class UserRepository : BaseRepository + { + + } + ``` + + > 等价于: `service.AddSingleton();service.AddSingleton();` + +## 特性: + +* IgnoreInjection: 忽略注入,用于排除不被自动注入 +* Dependency: + * TryRegister: 设置true则仅当服务未注册时才会被注册,类似IServiceCollection的TryAdd ... 扩展方法 + * ReplaceServices: 设置true则替换之前已经注册过的服务,类似IServiceCollection的Replace ... 扩展方法. + +## 方法: + +* 扩展IServiceCollection + * GetInstance(): 获取服务T的实例 + * Any(): 是否存在服务TService,不支持泛型服务 + * Any(): 是否存在接口为TService、且实现类为TImplementation的服务 + * Any(ServiceLifetime.Singleton): 是否存在一个生命周期为Singleton的服务TService(不支持泛型服务) + * Any(ServiceLifetime.Singleton): 是否存在一个生命周期为Singleton的接口为TService,实现为TImplementation的服务(不支持泛型服务) + * Replace(typeof(TImplementation), ServiceLifetime.Singleton): 移除服务集合中具有相同服务类型的第一个服务,并将 typeof(TImplementation) 添加到集合中,生命周期为单例 + * ReplaceAll(typeof(TImplementation), ServiceLifetime.Singleton): 移除服务集合中具有相同服务类型的所有服务,并将 typeof(TImplementation) 添加到集合中,生命周期为单例 \ No newline at end of file diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs new file mode 100644 index 000000000..54f88a654 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionDescriptorExtensions.cs @@ -0,0 +1,122 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionDescriptorExtensions +{ + public static TService GetInstance(this IServiceCollection services, bool isCreateScope = false) + where TService : class + { + if (isCreateScope) + { + using var scope = services.BuildServiceProvider().CreateScope(); + return scope.ServiceProvider.GetInstance(); + } + + return services.BuildServiceProvider().GetInstance(); + } + + private static TService GetInstance(this IServiceProvider serviceProvider) + where TService : class + { + if (typeof(TService) == typeof(IServiceProvider)) + return (TService)serviceProvider; + + return serviceProvider.GetRequiredService(); + } + + /// + /// Returns whether the specified ServiceType exists in the service collection + /// + /// + /// + /// + public static bool Any(this IServiceCollection services) + => services.Any(d => d.ServiceType == typeof(TService)); + + /// + /// Returns whether the specified ServiceType and ImplementationType exist in the service collection + /// + /// + /// + /// + /// + public static bool Any(this IServiceCollection services) + => services.Any(d => d.ServiceType == typeof(TService) && d.ImplementationType == typeof(TImplementation)); + + /// + /// Returns whether the specified ServiceType exists in the service collection, and the life cycle is the life cycle. + /// + /// + /// + /// + /// + public static bool Any(this IServiceCollection services, ServiceLifetime lifetime) + => services.Any(d => d.ServiceType == typeof(TService) && d.Lifetime == lifetime); + + /// + /// Returns the specified ServiceType, ImplementationType, and whether the life cycle is lifetime exists in the service collection + /// + /// + /// + /// + /// + /// + public static bool Any(this IServiceCollection services, ServiceLifetime lifetime) + => services.Any(d => d.ServiceType == typeof(TService) && d.ImplementationType == typeof(TImplementation) && d.Lifetime == lifetime); + + /// + /// Remove the first service in the service collection with the same service type and add the implementationType to the collection. + /// + /// + /// + /// + /// + /// + public static IServiceCollection Replace(this IServiceCollection services, Type implementationType, ServiceLifetime lifetime) + { + if (services.Any()) + { + int count = services.Count; + for (int i = 0; i < count; i++) + { + if (services[i].ServiceType == typeof(TService)) + { + services.RemoveAt(i); + break; + } + } + } + + services.Add(new ServiceDescriptor(typeof(TService), implementationType, lifetime)); + return services; + } + + /// + /// Removes all services with the same service type in the services collection and adds implementationType to the collection. + /// + /// + /// + /// + /// + /// + public static IServiceCollection ReplaceAll(this IServiceCollection services, Type implementationType, ServiceLifetime lifetime) + { + if (services.Any()) + { + int count = services.Count; + for (int i = 0; i < count; i++) + { + if (services[i].ServiceType == typeof(TService)) + { + services.RemoveAt(i); + break; + } + } + } + + services.Add(new ServiceDescriptor(typeof(TService), implementationType, lifetime)); + return services; + } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..fd2b8ae39 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/ServiceCollectionExtensions.cs @@ -0,0 +1,135 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddAutoInject(this IServiceCollection services) + => services.AddAutoInject(AppDomain.CurrentDomain.GetAssemblies()); + + public static IServiceCollection AddAutoInject(this IServiceCollection services, IEnumerable assemblies) + => services.AddAutoInjectCore(assemblies); + + public static IServiceCollection AddAutoInject(this IServiceCollection services, params Assembly[] assemblies) + => services.AddAutoInjectCore(assemblies); + + /// + /// Automatic registration from an assembly containing the specified type + /// + /// + /// + /// + public static IServiceCollection AddAutoInject(this IServiceCollection services, IEnumerable handlerAssemblyMarkerTypes) + => services.AddAutoInjectCore(handlerAssemblyMarkerTypes.Select(t => t.GetTypeInfo().Assembly).Distinct().ToArray()); + + /// + /// Automatic registration from an assembly containing the specified type + /// + /// + /// + /// + public static IServiceCollection AddAutoInject(this IServiceCollection services, params Type[] handlerAssemblyMarkerTypes) + => services.AddAutoInjectCore(handlerAssemblyMarkerTypes.Select(t => t.GetTypeInfo().Assembly).Distinct().ToArray()); + + private static IServiceCollection AddAutoInjectCore(this IServiceCollection services, IEnumerable assemblies) + { + if (services.Any()) + return services; + + services.AddSingleton(); + services.TryAddSingleton(); + services.TryAddSingleton(); + var typeProvider = services.GetInstance(); + var serviceDescriptors = typeProvider.GetServiceDescriptors(typeProvider.GetAllTypes(assemblies)); + + var registrar = services.GetInstance(); + foreach (var descriptor in serviceDescriptors) + registrar.Add(services, descriptor.ServiceType, descriptor.ImplementationType, descriptor.Lifetime); + + if (!serviceDescriptors.Any(d => d.AutoFire)) + return services; + + var serviceProvider = services.BuildServiceProvider(); + foreach (var descriptor in serviceDescriptors.Where(d => d.AutoFire)) + serviceProvider.GetService(descriptor.ServiceType); + + return services; + } + + /// + /// Auto add all service to IoC, lifecycle is scoped + /// + /// + /// default is Service + /// + public static IServiceCollection AddServices(this IServiceCollection services, string suffix, bool autoFire) + => services.AddServices(suffix, autoFire, Assembly.GetEntryAssembly()!); + + /// + /// Auto add all service to IoC, lifecycle is scoped + /// + /// + /// default is Service + /// + /// + /// + public static IServiceCollection AddServices(this IServiceCollection services, string suffix, bool autoFire, + params Assembly[] assemblies) + => (from type in assemblies.SelectMany(assembly => assembly.GetTypes()) + where !type.IsAbstract && type.Name.EndsWith(suffix) + select type).AddScoped(services, autoFire); + + /// + /// Auto add all service to IoC, lifecycle is scoped + /// + /// + /// + /// + /// + public static IServiceCollection AddServices(this IServiceCollection services, bool autoFire) + => services.AddServices(autoFire, Assembly.GetEntryAssembly()!); + + /// + /// Auto add all service to IoC, lifecycle is scoped + /// + /// + /// + /// + /// + /// + public static IServiceCollection AddServices(this IServiceCollection services, bool autoFire, params Assembly[] assemblies) + => (from type in assemblies.SelectMany(assembly => assembly.GetTypes()) + where !type.IsAbstract && BaseOf(type) + select type).AddScoped(services, autoFire); + + private static IServiceCollection AddScoped(this IEnumerable serviceTypes, IServiceCollection services, bool autoFire) + { + foreach (var serviceType in serviceTypes) + { + services.AddScoped(serviceType); + } + + if (autoFire) + { + foreach (var serviceType in serviceTypes) + { + services.BuildServiceProvider().GetService(serviceType); + } + } + + return services; + } + + private static bool BaseOf(Type type) + { + if (type.BaseType == typeof(T)) return true; + + return type.BaseType != null && BaseOf(type.BaseType); + } + + private class DependencyInjectionService + { + + } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs new file mode 100644 index 000000000..7e42c75d0 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DependencyInjection/_Imports.cs @@ -0,0 +1,6 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.DependencyInjection.Options; +global using System.Reflection; diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj b/src/Utils/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DotNet/Masa.Utils.Extensions.DotNet.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs b/src/Utils/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs new file mode 100644 index 000000000..6d6373546 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.DotNet/TypeExtensions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public static class TypeExtensions +{ + public static string GetGenericTypeName(this Type type) + { + string typeName; + + if (type.IsGenericType) + { + var genericTypes = string.Join(",", type.GetGenericArguments().Select(t => t.Name).ToArray()); + typeName = $"{type.Name.Remove(type.Name.IndexOf('`'))}<{genericTypes}>"; + } + else + { + typeName = type.Name; + } + + return typeName; + } + + public static string GetGenericTypeName(this object @object) + => @object.GetType().GetGenericTypeName(); +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs new file mode 100644 index 000000000..21882d7ae --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/EnumExtensions.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public static class EnumExtensions +{ + public static DescriptionAttribute GetDescription(this Enum enumSubitem) + { + string value = enumSubitem.ToString(); + + var fieldInfo = enumSubitem.GetType().GetField(value); + + if (fieldInfo != null) + { + var attributes = fieldInfo.GetCustomAttributes(typeof(DescriptionAttribute), false); + + if (attributes == null || attributes.Length == 0) + { + return new DescriptionAttribute(value); + } + else + { + return (DescriptionAttribute)attributes[0]; + } + } + else + { + return new DescriptionAttribute(); + } + } + + public static T? GetAttribute(this Enum enumSubitem) + where T : Attribute, new() + => EnumUtil.GetSubitemAttribute(enumSubitem); +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs new file mode 100644 index 000000000..fd2004b22 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/EnumUtil.cs @@ -0,0 +1,36 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class EnumUtil +{ + public static T? GetSubitemAttribute(object enumSubitem) + where T : Attribute, new() + { + if (enumSubitem == null) + return null; + + string value = enumSubitem.ToString() ?? ""; + + var fieldInfo = enumSubitem.GetType().GetField(value); + + if (fieldInfo != null) + { + var attributes = fieldInfo.GetCustomAttributes(typeof(T), false); + + if (attributes == null || attributes.Length == 0) + { + return new T(); + } + else + { + return attributes[0] as T; + } + } + else + { + return new T(); + } + } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/Masa.Utils.Extensions.Enums.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs new file mode 100644 index 000000000..88ae47fe1 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/Model/EnumObject.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class EnumObject +{ + public string Name { get; set; } = default!; + + public TValue Value { get; set; } = default!; +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs new file mode 100644 index 000000000..c25637d33 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/_Enum.cs @@ -0,0 +1,116 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class Enum + where TEnum : Enum +{ + public static List GetAttributes() + where TAttribute : Attribute, new() + { + var enumType = typeof(TEnum); + var names = Enum.GetNames(enumType); + var result = names.Select(name => EnumUtil.GetSubitemAttribute(Enum.Parse(enumType, name))!).ToList(); + + return result; + } + + public static Dictionary GetDictionary() + where TAttribute : Attribute, new() + { + var enumType = typeof(TEnum); + + return Enum.GetNames(enumType) + .Select(name => (TEnum)Enum.Parse(enumType, name)) + .ToDictionary(@enum => @enum, @enum => EnumUtil.GetSubitemAttribute(@enum)!); + } + + public static List GetItems() + { + var enumType = typeof(TEnum); + + return Enum.GetNames(enumType) + .Select(name => (TEnum)Enum.Parse(enumType, name)).ToList(); + } + + public static List> GetEnumObjectList(bool withAll = false, string allName = "所有", int allValue = 0) + => GetEnumObjectList(withAll, allName, allValue); + + public static List> GetEnumObjectList(bool withAll = false, string allName = "所有", TValue? allValue = default) + { + var enumType = typeof(TEnum); + + var lstResult = Enum.GetNames(enumType).Select(name => + { + var fieldInfo = enumType.GetField(name); + if (fieldInfo != null) + { + var attribute = fieldInfo.GetCustomAttribute(false); + if (attribute == null) + { + return new EnumObject() + { + Name = name, + Value = (TValue)Enum.Parse(enumType, name) + }; + } + else + { + return new EnumObject() + { + Name = attribute.Description, + Value = (TValue)Enum.Parse(enumType, name) + }; + } + } + else + { + return new EnumObject() + { + Name = name, + Value = (TValue)Enum.Parse(enumType, name) + }; + } + }).Where(p => p != null).ToList(); + + if (withAll) + { + lstResult.Insert(0, new EnumObject + { + Name = allName, + Value = (TValue)Enum.Parse(enumType, allValue?.ToString() ?? string.Empty) + }); + } + + return lstResult; + } + + public static Dictionary GetEnumObjectDictionary(bool withAll = false, string allName = "所有", int allValue = 0) + { + return GetEnumObjectDictionary(withAll, allName, allValue); + } + + public static Dictionary GetEnumObjectDictionary(bool withAll = false, string allName = "所有", TValue allValue = default!) + where TValue : notnull + { + Dictionary keyValues = new Dictionary(); + var enumType = typeof(TEnum); + + if (withAll) + { + keyValues.Add(allValue, allName); + } + + foreach (var value in Enum.GetValues(enumType)) + { + string val = value?.ToString() ?? string.Empty; + var fieldInfo = enumType.GetField(val); + var attribute = fieldInfo!.GetCustomAttribute(false); + + keyValues.Add((TValue)Enum.Parse(enumType, val), attribute?.Description ?? val); + } + + return keyValues; + } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs new file mode 100644 index 000000000..f0a35bd38 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.Enums/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.ComponentModel; +global using System.Reflection; diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs b/src/Utils/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs new file mode 100644 index 000000000..f7d0c888d --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.Expressions/ExpressionExtensions.cs @@ -0,0 +1,117 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System.Linq.Expressions; + +public static class ExpressionExtensions +{ + public static Expression> And(this Expression> first, Expression> second) + { + return first.Compose(second, Expression.And); + } + + public static Expression> And(this Expression> first, bool isCompose, Expression>? second) + { + if (isCompose && second != null) + return first.Compose(second, Expression.And); + + return first; + } + + public static Expression> Or(this Expression> first, Expression> second) + { + return first.Compose(second, Expression.Or); + } + + public static Expression> Or(this Expression> first, bool isCompose, Expression>? second) + { + if (isCompose && second != null) + return first.Compose(second, Expression.Or); + + return first; + } + + public static Expression Compose(this Expression first, Expression second, Func merge) + { + var parameterMap = first.Parameters.Select((f, i) => new { f, s = second.Parameters[i] }).ToDictionary(p => p.s, p => p.f); + + var secondBody = ParameterRebinder.ReplaceParameters(parameterMap, second.Body); + + return Expression.Lambda(merge(first.Body, secondBody), first.Parameters); + } + + #region GetMemberName + + public static List GetMemberName(this Expression expression) + where T : BinaryExpression + { + var result = new List(); + var expressionBody = expression.Body; + if (expressionBody is BinaryExpression) + { + result.AddRange(ParseBinaryExpression(expressionBody)); + } + + return result; + } + + private static List ParseBinaryExpression(Expression expression) + { + var result = new List(); + var binaryExpression = expression as BinaryExpression; + + if (binaryExpression!.Left != null) + result.AddRange(ParseUnitExpression(binaryExpression.Left)); + + if (binaryExpression.Right != null) + result.AddRange(ParseUnitExpression(binaryExpression.Right)); + + return result; + } + + private static List ParseUnitExpression(Expression unitExpression) + { + var result = new List(); + + if (unitExpression is BinaryExpression) + { + result.AddRange(ParseBinaryExpression((unitExpression as BinaryExpression)!)); + } + else if (unitExpression is MemberExpression) + { + var memberExpression = unitExpression as MemberExpression; + var pi = memberExpression!.Member as PropertyInfo; + result.Add(pi!.Name); + } + + return result; + } + + #endregion + +} + +public class ParameterRebinder : ExpressionVisitor +{ + private readonly Dictionary map; + + public ParameterRebinder(Dictionary map) + { + this.map = map ?? new Dictionary(); + } + + public static Expression ReplaceParameters(Dictionary map, Expression exp) + { + return new ParameterRebinder(map).Visit(exp); + } + + protected override Expression VisitParameter(ParameterExpression p) + { + ParameterExpression replacement; + if (map.TryGetValue(p, out replacement!)) + { + p = replacement; + } + return base.VisitParameter(p); + } +} diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj b/src/Utils/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj new file mode 100644 index 000000000..ea64c3225 --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.Expressions/Masa.Utils.Extensions.Expressions.csproj @@ -0,0 +1,10 @@ + + + + net6.0 + enable + enable + System.Linq.Expressions + + + diff --git a/src/Utils/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs b/src/Utils/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs new file mode 100644 index 000000000..da9630c2d --- /dev/null +++ b/src/Utils/Extensions/Masa.Utils.Extensions.Expressions/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.Reflection; diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs new file mode 100644 index 000000000..b5a8f6f04 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/DependencyInjectionTest.cs @@ -0,0 +1,190 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Models; + +namespace Masa.Utils.Extensions.DependencyInjection.Tests; + +[TestClass] +public class DependencyInjectionTest +{ + private DefaultTypeProvider _typeProvider = default!; + private IEnumerable _allTypes = default!; + + [TestInitialize] + public void Initialize() + { + _typeProvider = new DefaultTypeProvider(); + _allTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(assembly => assembly.GetTypes()); + } + + [TestMethod] + public void TestSkip() + { + Assert.IsFalse(_typeProvider.IsSkip(typeof(BaseService))); + Assert.IsTrue(_typeProvider.IsSkip(typeof(GoodsBaseService))); + Assert.IsFalse(_typeProvider.IsSkip(typeof(GoodsService))); + Assert.IsFalse(_typeProvider.IsSkip(typeof(NullCalculateProviderService))); + Assert.IsTrue(_typeProvider.IsSkip(typeof(OrderBaseService))); + Assert.IsTrue(_typeProvider.IsSkip(typeof(OrderService))); + Assert.IsTrue(_typeProvider.IsSkip(typeof(UserBaseService))); + Assert.IsFalse(_typeProvider.IsSkip(typeof(UserService))); + } + + [TestMethod] + public void TestGetServiceTypesReturnCountIs5() + { + var serviceTypes = _typeProvider.GetServiceTypes(_allTypes.ToList(), typeof(ISingletonDependency)); + Assert.IsTrue(serviceTypes.Count == 5); + } + + [TestMethod] + public void TestGetImplementationTypesReturnCountIs1() + { + var implementationTypes = _typeProvider.GetImplementationTypes(_allTypes.ToList(), typeof(ICalculateProviderService)); + Assert.IsTrue(implementationTypes.Count == 1); + + implementationTypes = _typeProvider.GetImplementationTypes(_allTypes.ToList(), typeof(BaseService)); + Assert.IsTrue(implementationTypes.Count == 1); + } + + [TestMethod] + public void TestAssignableFrom() + { + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(ICalculateProviderService), typeof(NullCalculateProviderService))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(ISingletonDependency), typeof(ICalculateProviderService))); + + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(NullCalculateProviderService), typeof(ICalculateProviderService))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(ICalculateProviderService), typeof(ISingletonDependency))); + + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(BaseService), typeof(UserBaseService))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(BaseService), typeof(UserService))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(UserBaseService), typeof(UserService))); + + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserBaseService), typeof(BaseService))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserService), typeof(BaseService))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserService), typeof(UserBaseService))); + + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository<>), typeof(BaseRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(IRepository<>), typeof(BaseRepository))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository), typeof(BaseRepository))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(BaseRepository<>), typeof(IRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(BaseRepository), typeof(IRepository))); + + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository<,>), typeof(UserRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(IRepository), typeof(UserRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableFrom(typeof(UserRepository<>), typeof(IRepository<,>))); + Assert.IsTrue(_typeProvider.IsAssignableFrom(typeof(IRepository), typeof(UserRepository))); + } + + [TestMethod] + public void TestAssignableTo() + { + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(ICalculateProviderService), typeof(NullCalculateProviderService))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(ISingletonDependency), typeof(ICalculateProviderService))); + + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(NullCalculateProviderService), typeof(ICalculateProviderService))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(ICalculateProviderService), typeof(ISingletonDependency))); + + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(BaseService), typeof(UserBaseService))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(BaseService), typeof(UserService))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(UserBaseService), typeof(UserService))); + + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserBaseService), typeof(BaseService))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserService), typeof(BaseService))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserService), typeof(UserBaseService))); + + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository<>), typeof(BaseRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository<>), typeof(BaseRepository))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository), typeof(BaseRepository))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(BaseRepository<>), typeof(IRepository<>))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(BaseRepository), typeof(IRepository))); + + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository<,>), typeof(UserRepository<>))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository), typeof(UserRepository<>))); + Assert.IsTrue(_typeProvider.IsAssignableTo(typeof(UserRepository<>), typeof(IRepository<,>))); + Assert.IsFalse(_typeProvider.IsAssignableTo(typeof(IRepository), typeof(UserRepository))); + } + + [TestMethod] + public void TestAddAutoInject() + { + var services = new ServiceCollection(); + services.AddAutoInject(); + var serviceProvider = services.BuildServiceProvider(); + var calculateProviderService = serviceProvider.GetService(); + Assert.IsNotNull(calculateProviderService); + Assert.IsNull(serviceProvider.GetService()); + + Assert.IsTrue(BaseService.Count == 1); + var serviceBase = serviceProvider.GetService(); + Assert.IsNotNull(serviceBase); + + var userBaseService = serviceProvider.GetService(); + Assert.IsNull(userBaseService); + + Assert.IsTrue(UserService.UserCount == 1); + var userService = serviceProvider.GetService(); + Assert.IsNotNull(userService); + + var goodsBaseService = serviceProvider.GetService(); + Assert.IsNull(goodsBaseService); + + Assert.IsTrue(GoodsService.GoodsCount == 1); + var goodsService = serviceProvider.GetService(); + Assert.IsNotNull(goodsService); + + var orderBaseService = serviceProvider.GetService(); + Assert.IsNull(orderBaseService); + + var orderService = serviceProvider.GetService(); + Assert.IsNull(orderService); + } + + [TestMethod] + public void TestAddAutoInjectAndEmptyAssemblyReturnServiceIsNull() + { + var services = new ServiceCollection(); + services.AddAutoInject(Array.Empty()); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNull(serviceProvider.GetService>()); + Assert.IsNull(serviceProvider.GetService()); + } + + [TestMethod] + public void TestAddAutoInjectMultiReturnCountIs1() + { + var services = new ServiceCollection(); + services + .AddAutoInject(typeof(IRepository<>).Assembly) + .AddAutoInject(typeof(IRepository<>).Assembly); + var serviceProvider = services.BuildServiceProvider(); + Assert.IsNotNull(serviceProvider.GetService>()); + Assert.IsTrue(serviceProvider.GetServices>().Count() == 1); + } + + [TestMethod] + public void TestAny() + { + var services = new ServiceCollection(); + Assert.IsFalse(services.Any()); + Assert.IsFalse(services.Any(ServiceLifetime.Singleton)); + services.AddScoped(); + Assert.IsTrue(services.Any()); + Assert.IsFalse(services.Any(ServiceLifetime.Singleton)); + Assert.IsTrue(services.Any(ServiceLifetime.Scoped)); + Assert.IsFalse(services.Any(ServiceLifetime.Transient)); + } + + [TestMethod] + public void TestDependencyReturnProviderServiceIs1() + { + var services = new ServiceCollection(); + services.AddAutoInject(); + var serviceProvider = services.BuildServiceProvider(); + var factories = serviceProvider.GetServices().ToList(); + Assert.IsTrue(factories.Count == 1); + + Assert.IsTrue(factories[0].GetClientName() == nameof(CustomizeClientFactory)); + } +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs new file mode 100644 index 000000000..4af51dc42 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Models/User.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Models; + +public class User +{ + public Guid Id { get; set; } + + public string Name { get; set; } = default!; +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs new file mode 100644 index 000000000..d363a2f37 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Repositories/IRepository.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Repositories; + +public interface IRepository : IScopedDependency + where TEntity : class +{ + +} + +public interface IRepository : IScopedDependency + where TEntity : class + where TDbContext : class +{ + +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs new file mode 100644 index 000000000..ddac42e82 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/ICalculateProviderService.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; + +public interface ICalculateProviderService : ISingletonDependency +{ + string Name { get; } +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs new file mode 100644 index 000000000..1838c2b90 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Domain/Services/IClientFactory.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; + +public interface IClientFactory : ISingletonDependency +{ + string GetClientName(); +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs new file mode 100644 index 000000000..71e1049fb --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Repositories/BaseRepository.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Repositories; + +public abstract class BaseRepository : IRepository + where TEntity : class +{ + +} + +public class Repository : BaseRepository + where TEntity : class +{ + +} + +public class UserRepository : IRepository + where TEntity : class +{ + +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs new file mode 100644 index 000000000..6970d36a4 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/BaseService.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +public class BaseService : ISingletonDependency, IAutoFireDependency +{ + public static int Count { get; set; } = 0; + + public BaseService() + { + Count++; + } + + public BaseService(bool isChildren) + { + + } +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs new file mode 100644 index 000000000..3cafaac57 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/CustomizeClientFactory.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +[Dependency(ReplaceServices = true)] +public class CustomizeClientFactory : IClientFactory +{ + public string GetClientName() => nameof(CustomizeClientFactory); +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs new file mode 100644 index 000000000..71f985d86 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/EmptyClientFactory.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +public class EmptyClientFactory : IClientFactory +{ + public string GetClientName() => nameof(EmptyClientFactory); +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs new file mode 100644 index 000000000..12bc32ea4 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsBaseService.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +[IgnoreInjection] +public class GoodsBaseService : BaseService +{ + public GoodsBaseService() : base(true) + { + } +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs new file mode 100644 index 000000000..7e37ed57a --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/GoodsService.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +public class GoodsService : GoodsBaseService +{ + public static int GoodsCount { get; set; } = 0; + + public GoodsService() + { + GoodsCount++; + } +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs new file mode 100644 index 000000000..969a46ac6 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/NullCalculateProviderService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +public class NullCalculateProviderService : ICalculateProviderService +{ + public string Name => string.Empty; +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs new file mode 100644 index 000000000..3122560e1 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderBaseService.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +[IgnoreInjection(true)] +public class OrderBaseService : BaseService +{ + public OrderBaseService() : base(true) + { + } +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs new file mode 100644 index 000000000..3c36039d8 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/OrderService.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +public class OrderService : OrderBaseService +{ +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs new file mode 100644 index 000000000..d6bf617fc --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserBaseService.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +public abstract class UserBaseService : BaseService +{ + public UserBaseService() : base(true) + { + } +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs new file mode 100644 index 000000000..ae22aec6c --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/Services/UserService.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; + +public class UserService : UserBaseService +{ + public static int UserCount { get; set; } = 0; + + public UserService() + { + UserCount++; + } +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs new file mode 100644 index 000000000..bbd222358 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Infrastructure/UserDbContext.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure; + +public class UserDbContext +{ + +} diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj new file mode 100644 index 000000000..a317ed783 --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/Masa.Utils.Extensions.DependencyInjection.Tests.csproj @@ -0,0 +1,21 @@ + + + + net6.0 + enable + enable + false + + + + + + + + + + + + + + diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs new file mode 100644 index 000000000..15641777d --- /dev/null +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Repositories; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System.Reflection; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Repositories; +global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; diff --git a/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs b/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs new file mode 100644 index 000000000..7a3c4fe5f --- /dev/null +++ b/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/FluentValidationExtensions.cs @@ -0,0 +1,104 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace FluentValidation; + +public static class FluentValidationExtensions +{ + public static IRuleBuilderOptions Chinese(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.CHINESE) + .WithMessage("Can only input chinese of {PropertyName}"); + } + + public static IRuleBuilderOptions Number(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.NUMBER) + .WithMessage("Can only input number of {PropertyName}"); + } + + public static IRuleBuilderOptions Letter(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.LETTER) + .WithMessage("Can only input letter of {PropertyName}"); + } + + public static IRuleBuilderOptions LowerLetter(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.LOWER_LETTER) + .WithMessage("Can only input lower letter of {PropertyName}"); + } + + public static IRuleBuilderOptions UpperLetter(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.UPPER_LETTER) + .WithMessage("Can only input upper letter of {PropertyName}"); + } + + public static IRuleBuilderOptions LetterNumber(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.LETTER_NUMBER) + .WithMessage("Can only input upper letter and number of {PropertyName}"); + } + + public static IRuleBuilderOptions ChineseLetter(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.CHINESE_LETTER) + .WithMessage("Can only input upper chinese and letter of {PropertyName}"); + } + + public static IRuleBuilderOptions ChineseLetterNumber(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.CHINESE_LETTER_NUMBER) + .WithMessage("Can only input upper chinese and letter and number of {PropertyName}"); + } + + public static IRuleBuilderOptions Phone(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.PHONE) + .WithMessage("{PropertyName} format is incorrect"); + } + + public static IRuleBuilderOptions Email(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.EMAIL) + .WithMessage("{PropertyName} format is incorrect"); + } + + public static IRuleBuilderOptions IdCard(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.IDCARD) + .WithMessage("{PropertyName} format is incorrect"); + } + + public static IRuleBuilderOptions Url(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.URL) + .WithMessage("{PropertyName} format is incorrect"); + } + + public static IRuleBuilderOptions MinLength(this IRuleBuilder ruleBuilder, int minimumLength) + { + return ruleBuilder.MinimumLength(minimumLength) + .WithMessage("Please enter a number greater than {MinLength} of {PropertyName}"); + } + + public static IRuleBuilderOptions MaxLength(this IRuleBuilder ruleBuilder, int maximumLength) + { + return ruleBuilder.MaximumLength(maximumLength) + .WithMessage("Please enter a number less than {MaxLength} of {PropertyName}"); + } + + public static IRuleBuilderOptions Port(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.Matches(RegularHelper.PORT) + .WithMessage("Is not a valid port {PropertyName}"); + } + + public static IRuleBuilderOptions Required(this IRuleBuilder ruleBuilder) + { + return ruleBuilder.NotNull() + .NotEmpty() + .WithMessage("{PropertyName} is required"); + } +} diff --git a/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj b/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj new file mode 100644 index 000000000..acea0bb77 --- /dev/null +++ b/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/Masa.Utils.Extensions.Validations.FluentValidation.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + diff --git a/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs b/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs new file mode 100644 index 000000000..ccfcbe16e --- /dev/null +++ b/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/RegularHelper.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Extensions.Validations.FluentValidation; + +internal static class RegularHelper +{ + internal const string CHINESE = "^\\s{0}$|^[\u4e00-\u9fa5]+$"; + internal const string NUMBER = "^\\s{0}$|^[0-9]+$"; + internal const string LETTER = "^\\s{0}$|^[a-zA-Z]+$"; + internal const string LOWER_LETTER = "^\\s{0}$|^[a-z]+$"; + internal const string UPPER_LETTER = "^\\s{0}$|^[A-Z]+$"; + internal const string LETTER_NUMBER = "^\\s{0}$|^[a-zA-Z0-9]+$"; + internal const string CHINESE_LETTER_NUMBER = "^\\s{0}$|^[\u4e00-\u9fa5_a-zA-Z0-9]+$"; + internal const string CHINESE_LETTER = "^\\s{0}$|^[\u4e00-\u9fa5_a-zA-Z]+$"; + internal const string PHONE = @"^\s{0}$|^((\+86)|(86))?(1[3-9][0-9])\d{8}$"; + internal const string IDCARD = "^\\s{0}$|(^\\d{15}$)|(^\\d{17}([0-9]|X|x)$)"; + internal const string EMAIL = @"^\s{0}$|^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"; + internal const string URL = "^\\s{0}$|[a-zA-z]+://[^s]*"; + internal const string PORT = "^\\s{0}$|^([1-9]|[1-9]\\d|[1-9]\\d{2}|[1-9]\\d{3}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])$"; +} diff --git a/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs b/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs new file mode 100644 index 000000000..53b8299c9 --- /dev/null +++ b/src/Utils/Extensions/Validations/Masa.Utils.Extensions.Validations.FluentValidation/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Extensions.Validations.FluentValidation; diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs new file mode 100644 index 000000000..246974047 --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapAddress.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell.Entries; + +public class LdapAddress +{ + public string Street { get; set; } = string.Empty; + + public string PostalCode { get; set; } = string.Empty; + + public string City { get; set; } = string.Empty; + + public string StateName { get; set; } = string.Empty; + + public string CountryName { get; set; } = string.Empty; + + public string CountryCode { get; set; } = string.Empty; +} diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs new file mode 100644 index 000000000..39657d1ef --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Entries/LdapUser.cs @@ -0,0 +1,53 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell.Entries; + +public class LdapUser +{ + /// + /// ObjectSID contains the value for the Security Identifier (SID) of the entry. + /// + public string ObjectSid { get; set; } = string.Empty; + + /// + /// ObjectGUID is an Attribute-Names which represents a Universally Unique Identifier as used in Microsoft Active Directory. + /// + public string ObjectGuid { get; set; } = string.Empty; + + public string ObjectCategory { get; set; } = string.Empty; + + public string ObjectClass { get; set; } = string.Empty; + + public string Name { get; set; } = string.Empty; + + public string CommonName { get; set; } = string.Empty; + + public string DistinguishedName { get; set; } = string.Empty; + + public string SamAccountName { get; set; } = string.Empty; + + public int SamAccountType { get; set; } + + public string[] MemberOf { get; set; } = Array.Empty(); + + public bool IsDomainAdmin { get; set; } + + public string UserPrincipalName { get; set; } = string.Empty; + + public string DisplayName { get; set; } = string.Empty; + + public string FirstName { get; set; } = string.Empty; + + public string LastName { get; set; } = string.Empty; + + public string FullName => $"{FirstName} {LastName}"; + + public string EmailAddress { get; set; } = string.Empty; + + public string Description { get; set; } = string.Empty; + + public string Phone { get; set; } = string.Empty; + + public LdapAddress Address { get; set; } = new(); +} diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs new file mode 100644 index 000000000..ca6c1fb47 --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Extensions/LdapAttributeSetExtensions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell.Extensions; + +public static class LdapAttributeSetExtensions +{ + public static void AddAttribute(this LdapAttributeSet ldapAttributes, string name, string value) + { + if (!string.IsNullOrEmpty(value)) + { + ldapAttributes.Add(new LdapAttribute(name, value)); + } + } + + public static string GetString(this LdapAttributeSet ldapAttributes, string name) + { + ldapAttributes.TryGetValue(name, out var value); + return value?.StringValue ?? ""; + } + + public static string[] GetStringArray(this LdapAttributeSet ldapAttributes, string name) + { + ldapAttributes.TryGetValue(name, out var value); + return value?.StringValueArray ?? new string[] { }; + } +} diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..0e5efa08f --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + private static IServiceCollection AddLadpContext(this IServiceCollection services, Action optionsAction) + { + services.Configure(optionsAction); + services.AddSingleton(typeof(ILdapProvider), typeof(LdapProvider)); + return services; + } + + public static IServiceCollection AddLadpContext(this IServiceCollection services, IConfiguration configuration) + { + services.Configure(configuration); + services.AddSingleton(typeof(ILdapProvider), typeof(LdapProvider)); + return services; + } + + public static IServiceCollection AddLadpContext(this IServiceCollection services) + { + services.AddSingleton(typeof(ILdapFactory), typeof(LdapFactory)); + return services; + } +} diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs new file mode 100644 index 000000000..a3e0963ba --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/ILdapFactory.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public interface ILdapFactory +{ + ILdapProvider CreateProvider(LdapOptions ldapOptions); +} diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs new file mode 100644 index 000000000..b85bbca1a --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/ILdapProvider.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public interface ILdapProvider +{ + Task GetGroupAsync(string groupName); + + IAsyncEnumerable GetUsersInGroupAsync(string groupName); + + Task GetUsersByEmailAddressAsync(string emailAddress); + + Task GetUserByUserNameAsync(string userName); + + IAsyncEnumerable GetAllUserAsync(); + + Task> GetPagingUserAsync(int pageSize); + + Task AddUserAsync(LdapUser user, string password); + + Task DeleteUserAsync(string distinguishedName); + + Task AuthenticateAsync(string distinguishedName, string password); +} diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs new file mode 100644 index 000000000..679bd4e14 --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapFactory.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public class LdapFactory : ILdapFactory +{ + public ILdapProvider CreateProvider(LdapOptions ldapOptions) + { + return new LdapProvider(ldapOptions); + } +} diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs new file mode 100644 index 000000000..93b255cc9 --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapOptions.cs @@ -0,0 +1,49 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public class LdapOptions +{ + public string ServerAddress { get; set; } = null!; + + public int ServerPort { get; set; } + + public int ServerPortSsl { get; set; } + + public string BaseDn { get; set; } = null!; + + private string _userSearchBaseDn = string.Empty; + + public string UserSearchBaseDn + { + get + { + if (string.IsNullOrEmpty(_userSearchBaseDn)) + { + return BaseDn; + } + return _userSearchBaseDn; + } + set { _userSearchBaseDn = value; } + } + + private string _groupSearchBaseDn = string.Empty; + + public string GroupSearchBaseDn + { + get + { + if (string.IsNullOrEmpty(_groupSearchBaseDn)) + { + return BaseDn; + } + return _groupSearchBaseDn; + } + set { _groupSearchBaseDn = value; } + } + + public string RootUserDn { get; set; } = null!; + + public string RootUserPassword { get; set; } = null!; +} diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs new file mode 100644 index 000000000..40231b016 --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/LdapProvider.cs @@ -0,0 +1,294 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell; + +public class LdapProvider : ILdapProvider, IDisposable +{ + ILdapConnection ldapConnection = null!; + LdapOptions _ldapOptions; + + private readonly string[] _attributes = + { + "objectSid", "objectGUID", "objectCategory", "objectClass", "memberOf", "name", "cn", "distinguishedName", + "sAMAccountName", "userPrincipalName", "displayName", "givenName", "sn", "description", + "telephoneNumber", "mail", "streetAddress", "postalCode", "l", "st", "co", "c" + }; + + internal LdapProvider(LdapOptions options) + { + _ldapOptions = options; + } + + public LdapProvider(IOptionsSnapshot options) + { + _ldapOptions = options.Value; + } + + private async Task GetConnectionAsync() + { + if (ldapConnection != null && ldapConnection.Connected) + { + return ldapConnection; + } + ldapConnection = new LdapConnection() { SecureSocketLayer = _ldapOptions.ServerPortSsl != 0 }; + //Connect function will create a socket connection to the server - Port 389 for insecure and 3269 for secure + await ldapConnection.ConnectAsync(_ldapOptions.ServerAddress, + _ldapOptions.ServerPortSsl != 0 ? _ldapOptions.ServerPortSsl : _ldapOptions.ServerPort); + //Bind function with null user dn and password value will perform anonymous bind to LDAP server + await ldapConnection.BindAsync(_ldapOptions.RootUserDn, _ldapOptions.RootUserPassword); + + return ldapConnection; + } + + public async Task AuthenticateAsync(string distinguishedName, string password) + { + using var ldapConnection = new LdapConnection() { SecureSocketLayer = _ldapOptions.ServerPortSsl != 0 }; + await ldapConnection.ConnectAsync(_ldapOptions.ServerAddress, + ldapConnection.SecureSocketLayer ? _ldapOptions.ServerPortSsl : _ldapOptions.ServerPort); + try + { + await ldapConnection.BindAsync(distinguishedName, password); + return true; + } + catch (Exception) + { + return false; + } + } + + public async Task DeleteUserAsync(string distinguishedName) + { + using (var ldapConnection = await GetConnectionAsync()) + { + await ldapConnection.DeleteAsync(distinguishedName); + } + } + + public async Task AddUserAsync(LdapUser user, string password) + { + var dn = $"CN={user.FirstName} {user.LastName},{_ldapOptions.UserSearchBaseDn}"; + + var attributeSet = new LdapAttributeSet + { + new LdapAttribute("instanceType", "4"), + new LdapAttribute("objectCategory", $"CN=Users,{_ldapOptions.UserSearchBaseDn}"), + new LdapAttribute("objectClass", new[] {"top", "person", "organizationalPerson", "user"}), + new LdapAttribute("name", user.Name), + new LdapAttribute("cn", $"{user.FirstName} {user.LastName}"), + new LdapAttribute("sAMAccountName", user.SamAccountName), + new LdapAttribute("userPrincipalName", user.UserPrincipalName), + new LdapAttribute("unicodePwd", Convert.ToBase64String(Encoding.Unicode.GetBytes($"\"{password}\""))), + new LdapAttribute("userAccountControl", "512"), + new LdapAttribute("givenName", user.FirstName), + new LdapAttribute("sn", user.LastName), + new LdapAttribute("mail", user.EmailAddress) + }; + + attributeSet.AddAttribute("displayName", user.DisplayName); + attributeSet.AddAttribute("description", user.Description); + attributeSet.AddAttribute("telephoneNumber", user.Phone); + attributeSet.AddAttribute("streetAddress", user.Address.Street); + attributeSet.AddAttribute("l", user.Address.City); + attributeSet.AddAttribute("postalCode", user.Address.PostalCode); + attributeSet.AddAttribute("st", user.Address.StateName); + attributeSet.AddAttribute("co", user.Address.CountryName); + attributeSet.AddAttribute("c", user.Address.CountryCode); + + var newEntry = new LdapEntry(dn, attributeSet); + + using var ldapConnection = await GetConnectionAsync(); + await ldapConnection.AddAsync(newEntry); + } + + public async IAsyncEnumerable GetAllUserAsync() + { + var filter = $"(&(objectCategory=person)(objectClass=user))"; + var users = GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter); + await foreach (var user in users) + { + yield return CreateUser(user.Dn, user.GetAttributeSet()); + } + } + + public async Task> GetPagingUserAsync(int pageSize) + { + using var ldapConnection = await GetConnectionAsync(); + return await ldapConnection.SearchUsingSimplePagingAsync(new SearchOptions( + _ldapOptions.UserSearchBaseDn, + LdapConnection.ScopeSub, + "(&(objectCategory=person)(objectClass=user))", + _attributes), + pageSize); + } + + public async Task GetUserByUserNameAsync(string userName) + { + var filter = $"(&(objectClass=user)(sAMAccountName={userName}))"; + var user = await GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter).FirstOrDefaultAsync(); + return user == null ? null : CreateUser(user.Dn, user.GetAttributeSet()); + } + + public async Task GetUsersByEmailAddressAsync(string emailAddress) + { + var filter = $"(&(objectClass=user)(mail={emailAddress}))"; + var user = await GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter).FirstOrDefaultAsync(); + return user == null ? null : CreateUser(user.Dn, user.GetAttributeSet()); + } + + private async IAsyncEnumerable GetFilterLdapEntryAsync(string baseDn, string filter) + { + using var ldapConnection = await GetConnectionAsync(); + var searchResults = await ldapConnection.SearchAsync( + baseDn, + LdapConnection.ScopeSub, + filter, + _attributes, + false); + await foreach (var searchResult in searchResults) + { + yield return searchResult; + } + } + + public async IAsyncEnumerable GetUsersInGroupAsync(string groupName) + { + var group = await GetGroupAsync(groupName); + if (group == null) + { + yield break; + } + var filter = $"(&(objectCategory=person)(objectClass=user)(memberOf={group.Dn}))"; + var users = GetFilterLdapEntryAsync(_ldapOptions.UserSearchBaseDn, filter); + + await foreach (var user in users) + { + yield return CreateUser(user.Dn, user.GetAttributeSet()); + } + } + + public async Task GetGroupAsync(string groupName) + { + var filter = $"(&(objectCategory=group)(objectClass=group)(cn={groupName}))"; + return await GetFilterLdapEntryAsync(_ldapOptions.GroupSearchBaseDn, filter) + .FirstOrDefaultAsync(); + } + + public void Dispose() + { + if (ldapConnection.Connected) + { + ldapConnection.Disconnect(); + } + if (ldapConnection != null) + { + ldapConnection.Dispose(); + } + } + + private LdapUser CreateUser(string distinguishedName, LdapAttributeSet attributeSet) + { + var ldapUser = new LdapUser(); + + ldapUser.ObjectSid = ObjectSidToString(attributeSet.GetAttribute("objectSid").ByteValue); + ldapUser.ObjectGuid = ObjectGuidToString(attributeSet.GetAttribute("objectGUID").ByteValue); + ldapUser.ObjectCategory = attributeSet.GetString("objectCategory"); + ldapUser.ObjectClass = attributeSet.GetString("objectClass"); + ldapUser.MemberOf = attributeSet.GetStringArray("memberOf"); + ldapUser.CommonName = attributeSet.GetString("cn"); + ldapUser.SamAccountName = attributeSet.GetString("sAMAccountName"); + ldapUser.UserPrincipalName = attributeSet.GetString("userPrincipalName"); + ldapUser.Name = attributeSet.GetString("name"); + ldapUser.DistinguishedName = attributeSet.GetString("distinguishedName"); + ldapUser.DisplayName = attributeSet.GetString("displayName"); + ldapUser.FirstName = attributeSet.GetString("givenName"); + ldapUser.LastName = attributeSet.GetString("sn"); + ldapUser.Description = attributeSet.GetString("description"); + ldapUser.Phone = attributeSet.GetString("telephoneNumber"); + ldapUser.EmailAddress = attributeSet.GetString("mail"); + ldapUser.Address = new LdapAddress + { + Street = attributeSet.GetString("streetAddress"), + City = attributeSet.GetString("l"), + PostalCode = attributeSet.GetString("postalCode"), + StateName = attributeSet.GetString("st"), + CountryName = attributeSet.GetString("co"), + CountryCode = attributeSet.GetString("c") + }; + attributeSet.TryGetValue("sAMAccountType", out var sAMAccountType); + ldapUser.SamAccountType = int.Parse(sAMAccountType?.StringValue ?? "0"); + + ldapUser.IsDomainAdmin = ldapUser.MemberOf.Contains("CN=Domain Admins," + _ldapOptions.BaseDn); + + return ldapUser; + } + + private string ObjectGuidToString(byte[] bytes) + { + var strGUID = ""; + strGUID += AddLeadingZero(bytes[3] & 0xFF); + strGUID += AddLeadingZero(bytes[2] & 0xFF); + strGUID += AddLeadingZero(bytes[1] & 0xFF); + strGUID += AddLeadingZero(bytes[0] & 0xFF); + strGUID += "-"; + strGUID += AddLeadingZero(bytes[5] & 0xFF); + strGUID += AddLeadingZero(bytes[4] & 0xFF); + strGUID += "-"; + strGUID += AddLeadingZero(bytes[7] & 0xFF); + strGUID += AddLeadingZero(bytes[6] & 0xFF); + strGUID += "-"; + strGUID += AddLeadingZero(bytes[8] & 0xFF); + strGUID += AddLeadingZero(bytes[9] & 0xFF); + strGUID += "-"; + strGUID += AddLeadingZero(bytes[10] & 0xFF); + strGUID += AddLeadingZero(bytes[11] & 0xFF); + strGUID += AddLeadingZero(bytes[12] & 0xFF); + strGUID += AddLeadingZero(bytes[13] & 0xFF); + strGUID += AddLeadingZero(bytes[14] & 0xFF); + strGUID += AddLeadingZero(bytes[15] & 0xFF); + + return strGUID; + } + + private string ObjectSidToString(byte[] bytes) + { + StringBuilder strSID = new StringBuilder("S-"); + strSID.Append(bytes[0]).Append('-'); + // bytes[2..7] : + StringBuilder tmpBuff = new StringBuilder(); + for (int t = 2; t <= 7; t++) + { + //var hexString = (bytes[t] & 0xFF).ToString("X"); + //tmpBuff.Append(hexString); + tmpBuff.Append(AddLeadingZero((int)bytes[t] & 0xFF)); + } + strSID.Append(Convert.ToInt64(tmpBuff.ToString(), 16)); + // bytes[1] : the sub authorities count + int count = bytes[1]; + for (int i = 0; i < count; i++) + { + int currSubAuthOffset = i * 4; + tmpBuff.Length = 0; + tmpBuff.Append(string.Format("{0:X2}{1:X2}{2:X2}{3:X2}", + (bytes[11 + currSubAuthOffset] & 0xFF), + (bytes[10 + currSubAuthOffset] & 0xFF), + (bytes[9 + currSubAuthOffset] & 0xFF), + (bytes[8 + currSubAuthOffset] & 0xFF))); + + strSID.Append('-').Append(Convert.ToInt64(tmpBuff.ToString(), 16)); + } + return strSID.ToString(); + } + + string AddLeadingZero(int k) + { + return (k <= 0xF) ? "0" + Int2String(k) : Int2String(k); + } + + string Int2String(int kb) + { + byte[] bytes = new byte[1]; + bytes[0] = (byte)(kb & 0xFF); + return Convert.ToHexString(bytes); + } +} diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj new file mode 100644 index 000000000..895ce1cf9 --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/Masa.Utils.Ldap.Novell.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/src/Utils/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs new file mode 100644 index 000000000..a8f040a3f --- /dev/null +++ b/src/Utils/Ldap/Masa.Utils.Ldap.Novell/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Ldap.Novell; +global using Masa.Utils.Ldap.Novell.Entries; +global using Masa.Utils.Ldap.Novell.Extensions; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.Options; +global using Novell.Directory.Ldap; +global using System.Text; diff --git a/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs new file mode 100644 index 000000000..993db77aa --- /dev/null +++ b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/LdapTest.cs @@ -0,0 +1,85 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Ldap.Novell.Tests; + +[TestClass] +public class LdapTest +{ + readonly IServiceCollection Services; + readonly ILdapProvider ldapProvider; + readonly ILdapFactory ldapFactory; + + public LdapTest() + { + Services = new ServiceCollection(); + var mockLdapOptions = new Mock(); + + var configurationBuilder = new ConfigurationBuilder().AddJsonFile("appsettings.json"); + var configuration = configurationBuilder.Build(); + var ldapConfigurationSection = configuration.GetSection(nameof(LdapOptions)); + Services.AddLadpContext(ldapConfigurationSection); + Services.AddLadpContext(); + var serviceProvider = Services.BuildServiceProvider(); + ldapProvider = serviceProvider.GetRequiredService(); + ldapFactory = serviceProvider.GetRequiredService(); + } + + [TestInitialize] + public void EdgeDriverInitialize() + { + + } + + [TestMethod] + public void CreateLdapProvider() + { + var ldapProvider = ldapFactory.CreateProvider(new LdapOptions + { + + }); + Assert.IsNotNull(ldapProvider); + } + + [TestMethod] + public async Task GetAllUser() + { + var allUsers = await ldapProvider.GetAllUserAsync().ToListAsync(); ; + Assert.IsTrue(allUsers.Count > 0); + } + + [TestMethod] + public async Task GetPagingUser() + { + var pagingUsers = await ldapProvider.GetPagingUserAsync(1); + Assert.IsTrue(pagingUsers.Count > 0); + } + + [TestMethod] + public async Task GetUserByUserName() + { + var user = await ldapProvider.GetUserByUserNameAsync("mayue"); + Assert.IsNotNull(user); + } + + [TestMethod] + public async Task GetUserByUserEmail() + { + var user = await ldapProvider.GetUsersByEmailAddressAsync("mayue@masastack.com"); + Assert.IsNotNull(user); + } + + [TestMethod] + public async Task GetGroupAsync() + { + var group = await ldapProvider.GetGroupAsync("杭州产品研发部"); + Assert.IsNotNull(group); + } + + [TestMethod] + public async Task GetUsersInGroupAsync() + { + var users = await ldapProvider.GetUsersInGroupAsync("杭州产品研发部").ToListAsync(); + Assert.IsTrue(users.Count > 0); + } +} diff --git a/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj new file mode 100644 index 000000000..0a4d8029e --- /dev/null +++ b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/Masa.Utils.Ldap.Novell.Tests.csproj @@ -0,0 +1,30 @@ + + + + net6.0 + enable + + false + + + + + + + + + + + + + + + + + + + Always + + + + diff --git a/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs new file mode 100644 index 000000000..30674ecea --- /dev/null +++ b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Ldap.Novell.Extensions; +global using Microsoft.Extensions.Configuration; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System.Linq; +global using System.Threading.Tasks; diff --git a/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json new file mode 100644 index 000000000..5a64f707c --- /dev/null +++ b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/appsettings.json @@ -0,0 +1,12 @@ +{ + "LdapOptions": { + "ServerAddress": "localhost", + "ServerPort": 5389, + "ServerPortSsl": 5636, + "BaseDn": "dc=example,dc=com", + "UserSearchBaseDn": "OU=XXXX,dc=example,dc=com", + "GroupSearchBaseDn": "", + "RootUserDn": "cn=admin,dc=example,dc=com", + "RootUserPassword": "password" + } +} \ No newline at end of file diff --git a/src/Utils/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs b/src/Utils/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs new file mode 100644 index 000000000..54e78d887 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Extensions/ApplicationBuilderExtensions.cs @@ -0,0 +1,81 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Exceptions.Handlers; + +namespace Microsoft.AspNetCore.Builder; + +public static class ApplicationBuilderExtensions +{ + /// + /// Use localizable + /// + /// + /// + /// + [Obsolete("UseMasaExceptionHandler is recommended to use instead.")] + public static IApplicationBuilder UseMasaExceptionHandling( + this IApplicationBuilder app, + Action? exceptionHandlingOptions = null) + { + return app.UseMasaExceptionHandling(_ => + { + }, exceptionHandlingOptions); + } + + /// + /// Use localizable + /// + /// + /// + /// + /// + [Obsolete("UseMasaExceptionHandler is recommended to use instead.")] + public static IApplicationBuilder UseMasaExceptionHandling( + this IApplicationBuilder app, + Action action, + Action? exceptionHandlingOptions) + { + var option = new MasaExceptionHandlingOptions(); + exceptionHandlingOptions?.Invoke(option); + + app.UseMiddleware(Options.Create(option)); + app.UseRequestLocalization(action); + return app; + } + + /// + /// Use localizable + /// + /// + /// + /// + public static IApplicationBuilder UseMasaExceptionHandler( + this IApplicationBuilder app, + Action? exceptionHandlingOptions = null) + { + return app.UseMasaExceptionHandler(_ => + { + }, exceptionHandlingOptions); + } + + /// + /// Use localizable + /// + /// + /// + /// + /// + public static IApplicationBuilder UseMasaExceptionHandler( + this IApplicationBuilder app, + Action action, + Action? exceptionHandlingOptions) + { + var option = new MasaExceptionHandlerOptions(); + exceptionHandlingOptions?.Invoke(option); + + app.UseMiddleware(Options.Create(option)); + app.UseRequestLocalization(action); + return app; + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs b/src/Utils/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs new file mode 100644 index 000000000..98ad0fcb1 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Extensions/MvcBuilderExtensions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MvcBuilderExtensions +{ + public static IMvcBuilder AddMasaExceptionHandler(this IMvcBuilder builder) + { + return builder.AddMasaExceptionHandler(_ => { }); + } + + public static IMvcBuilder AddMasaExceptionHandler(this IMvcBuilder builder, Action action) + { + builder.Services.AddLocalization(); + + builder.Services.Configure(options => { options.Filters.Add(); }); + + builder.Services.Configure(action); + + return builder; + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs b/src/Utils/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs new file mode 100644 index 000000000..14a133503 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Handlers/ExceptionHandlerMiddleware.cs @@ -0,0 +1,80 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Handlers; + +public class ExceptionHandlerMiddleware +{ + private readonly RequestDelegate _next; + private readonly IMasaExceptionHandler? _masaExceptionHandler; + private readonly MasaExceptionHandlerOptions _options; + private readonly MasaExceptionLogRelationOptions _logRelationOptions; + private readonly ILogger? _logger; + + public ExceptionHandlerMiddleware( + RequestDelegate next, + IServiceProvider serviceProvider, + IOptions options, + IOptions logRelationOptions, + ILogger? logger = null) + { + _next = next; + _options = options.Value; + _masaExceptionHandler = ExceptionHandlerExtensions.GetMasaExceptionHandler(serviceProvider, _options.MasaExceptionHandlerType); + _logRelationOptions = logRelationOptions.Value; + _logger = logger; + } + + public async Task InvokeAsync(HttpContext httpContext) + { + try + { + await _next(httpContext); + } + catch (Exception exception) + { + var masaExceptionContext = new MasaExceptionContext(exception, httpContext); + if (_options.ExceptionHandler != null) + { + _options.ExceptionHandler.Invoke(masaExceptionContext); + } + else if (_masaExceptionHandler != null) + { + _masaExceptionHandler.OnException(masaExceptionContext); + } + + if (httpContext.Response.HasStarted) + return; + + if (masaExceptionContext.ExceptionHandled) + { + await httpContext.Response.WriteTextAsync( + masaExceptionContext.StatusCode, + masaExceptionContext.Message ?? masaExceptionContext.Exception.Message, + masaExceptionContext.ContentType); + return; + } + + _logger?.WriteLog(masaExceptionContext.Exception, + masaExceptionContext.Exception is UserFriendlyException ? LogLevel.Information : LogLevel.Error, + _logRelationOptions); + + if (masaExceptionContext.Exception is UserFriendlyException) + { + await httpContext.Response.WriteTextAsync((int)MasaHttpStatusCode.UserFriendlyException, + masaExceptionContext.Exception.Message); + } + else if (masaExceptionContext.Exception is MasaException || _options.CatchAllException) + { + var message = Constant.DEFAULT_EXCEPTION_MESSAGE; + await httpContext.Response.WriteTextAsync((int)HttpStatusCode.InternalServerError, message); + } + else + { + throw; + } + } + } + + +} diff --git a/src/Utils/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs b/src/Utils/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs new file mode 100644 index 000000000..d5ef315a7 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Handlers/ExceptionHandlingMiddleware.cs @@ -0,0 +1,56 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Handlers; + +public class ExceptionHandlingMiddleware +{ + private readonly RequestDelegate _next; + private readonly ILogger _logger; + private readonly MasaExceptionHandlingOptions _options; + + public ExceptionHandlingMiddleware( + RequestDelegate next, + ILogger logger, + IOptions options) + { + _next = next; + _logger = logger; + _options = options.Value; + } + + public async Task InvokeAsync(HttpContext httpContext) + { + try + { + await _next(httpContext); + } + catch (Exception exception) + { + if (_options.CustomExceptionHandler is not null) + { + var handlerResult = _options.CustomExceptionHandler.Invoke(exception); + + if (handlerResult.ExceptionHandled) return; + + if (handlerResult.OverrideException is not null) exception = handlerResult.OverrideException; + } + if (exception is UserFriendlyException) + { + var message = exception.Message; + _logger.LogError(exception, message); + await httpContext.Response.WriteTextAsync((int)MasaHttpStatusCode.UserFriendlyException, message); + } + else if (exception is MasaException || _options.CatchAllException) + { + var message = Constant.DEFAULT_EXCEPTION_MESSAGE; + _logger.LogError(exception, message); + await httpContext.Response.WriteTextAsync((int)HttpStatusCode.InternalServerError, message); + } + else + { + throw; + } + } + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs b/src/Utils/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs new file mode 100644 index 000000000..c24e03139 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Handlers/GlobalExceptionFilter.cs @@ -0,0 +1,69 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Handlers; + +/// +/// Mvc pipeline exception filter to catch global exception +/// +public class MvcGlobalExcetionFilter : IExceptionFilter +{ + private readonly IMasaExceptionHandler? _masaExceptionHandler; + private readonly MasaExceptionHandlerOptions _options; + private readonly MasaExceptionLogRelationOptions _logRelationOptions; + private readonly ILogger? _logger; + + public MvcGlobalExcetionFilter(IServiceProvider serviceProvider, + IOptions options, + IOptions logRelationOptions, + ILogger? logger = null) + { + _options = options.Value; + _masaExceptionHandler = ExceptionHandlerExtensions.GetMasaExceptionHandler(serviceProvider, _options.MasaExceptionHandlerType); + _logRelationOptions = logRelationOptions.Value; + _logger = logger; + } + + public void OnException(ExceptionContext context) + { + var masaExceptionContext = new MasaExceptionContext(context.Exception, context.HttpContext); + if (_options.ExceptionHandler != null) + { + _options.ExceptionHandler.Invoke(masaExceptionContext); + } + else + { + _masaExceptionHandler?.OnException(masaExceptionContext); + } + + if (masaExceptionContext.HttpContext.Response.HasStarted) + return; + + if (masaExceptionContext.ExceptionHandled) + { + context.ExceptionHandled = true; + context.Result = new DefaultExceptionResult( + masaExceptionContext.Message, + masaExceptionContext.StatusCode, + masaExceptionContext.ContentType); + return; + } + + _logger?.WriteLog(masaExceptionContext.Exception, + masaExceptionContext.Exception is UserFriendlyException ? LogLevel.Information : LogLevel.Error, + _logRelationOptions); + + if (masaExceptionContext.Exception is UserFriendlyException userFriendlyException) + { + context.ExceptionHandled = true; + context.Result = new UserFriendlyExceptionResult(userFriendlyException.Message); + return; + } + if (masaExceptionContext.Exception is MasaException || _options.CatchAllException) + { + context.ExceptionHandled = true; + context.Result = new InternalServerErrorObjectResult(Constant.DEFAULT_EXCEPTION_MESSAGE); + return; + } + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/IMasaExceptionHandler.cs b/src/Utils/Masa.Utils.Exceptions/IMasaExceptionHandler.cs new file mode 100644 index 000000000..0b9d57ebc --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/IMasaExceptionHandler.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions; + +public interface IMasaExceptionHandler +{ + void OnException(MasaExceptionContext context); +} diff --git a/src/Utils/Masa.Utils.Exceptions/Internal/Constant.cs b/src/Utils/Masa.Utils.Exceptions/Internal/Constant.cs new file mode 100644 index 000000000..e6c59bcf6 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Internal/Constant.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Internal; + +internal class Constant +{ + public const string DEFAULT_HTTP_CONTENT_TYPE = "text/plain; charset=utf-8"; + + public const string DEFAULT_EXCEPTION_MESSAGE = "An error occur in masa framework."; +} diff --git a/src/Utils/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs b/src/Utils/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs new file mode 100644 index 000000000..ff05ff2a7 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Internal/ExceptionExtensions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +internal static class ExceptionExtensions +{ + public static void WriteLog( + this ILogger logger, + Exception exception, + LogLevel defaultLogLevel, + MasaExceptionLogRelationOptions logRelationOptions, + string? message = null) + { + var logLevel = logRelationOptions.GetLogLevel(exception, defaultLogLevel); + logger.Log(logLevel, exception, message ?? exception.Message); + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs b/src/Utils/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs new file mode 100644 index 000000000..7d409a73f --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Internal/ExceptionHandlerExtensions.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Internal; + +internal static class ExceptionHandlerExtensions +{ + public static IMasaExceptionHandler? GetMasaExceptionHandler(IServiceProvider serviceProvider, Type? masaExceptionHandlerType) + { + var exceptionHandler = serviceProvider.GetService(); + if (exceptionHandler != null) + return exceptionHandler; + + if (masaExceptionHandlerType == null) + return null; + + var constructor = masaExceptionHandlerType.GetConstructors(BindingFlags.Instance | BindingFlags.Public) + .MaxBy(c => c.GetParameters().Length); + List parameters = new(); + if (constructor != null) + { + foreach (var parameterInfo in constructor.GetParameters()) + parameters.Add(serviceProvider.GetService(parameterInfo.ParameterType)); + } + var instance = Activator.CreateInstance(masaExceptionHandlerType, parameters.ToArray()); + if (instance != null) + return instance as IMasaExceptionHandler; + + return null; + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs b/src/Utils/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs new file mode 100644 index 000000000..8909aab1c --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Internal/HttpResponseExtensions.cs @@ -0,0 +1,26 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions.Internal; + +internal static class HttpResponseExtensions +{ + /// + /// Write response with text/plain + /// + /// + /// + /// + /// + /// + public static async Task WriteTextAsync( + this HttpResponse httpResponse, + int statusCode, + string text, + string contentType = "text/plain; charset=utf-8") + { + httpResponse.StatusCode = statusCode; + httpResponse.ContentType = contentType; + await httpResponse.WriteAsync(text, Encoding.UTF8); + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj b/src/Utils/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj new file mode 100644 index 000000000..b73295abb --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Masa.Utils.Exceptions.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + \ No newline at end of file diff --git a/src/Utils/Masa.Utils.Exceptions/MasaException.cs b/src/Utils/Masa.Utils.Exceptions/MasaException.cs new file mode 100644 index 000000000..c7f0135c1 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/MasaException.cs @@ -0,0 +1,28 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class MasaException : Exception +{ + public string? ErrorCode { get; set; } + + public MasaException() + { + } + + public MasaException(string message) + : base(message) + { + } + + public MasaException(string message, Exception innerException) + : base(message, innerException) + { + } + + public MasaException(SerializationInfo serializationInfo, StreamingContext context) + : base(serializationInfo, context) + { + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/MasaExceptionContext.cs b/src/Utils/Masa.Utils.Exceptions/MasaExceptionContext.cs new file mode 100644 index 000000000..fd08374ea --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/MasaExceptionContext.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class MasaExceptionContext +{ + public Exception Exception { get; set; } + + public HttpContext HttpContext { get; } + + public bool ExceptionHandled { get; set; } + + /// + /// Http status code + /// + public int StatusCode { get; set; } + + /// + /// Error code to provide support for subsequent I18n + /// + public string? ErrorCode { get; set; } + + public string? Message { get; set; } + + public string ContentType { get; set; } + + internal MasaExceptionContext(Exception exception, HttpContext httpContext) + { + Exception = exception; + HttpContext = httpContext; + StatusCode = (int)MasaHttpStatusCode.UserFriendlyException; + ExceptionHandled = false; + ContentType = Constant.DEFAULT_HTTP_CONTENT_TYPE; + } + + public void ToResult( + string message, + int statusCode = (int)MasaHttpStatusCode.UserFriendlyException, + string contentType = Constant.DEFAULT_HTTP_CONTENT_TYPE) + { + Message = message; + StatusCode = statusCode; + ExceptionHandled = true; + ContentType = contentType; + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/MasaHttpStatusCode.cs b/src/Utils/Masa.Utils.Exceptions/MasaHttpStatusCode.cs new file mode 100644 index 000000000..9570e1afc --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/MasaHttpStatusCode.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions; + +public enum MasaHttpStatusCode +{ + UserFriendlyException = 299 +} diff --git a/src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs b/src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs new file mode 100644 index 000000000..33179c4ec --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionHandlerOptions.cs @@ -0,0 +1,18 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions; + +public class MasaExceptionHandlerOptions +{ + public bool CatchAllException { get; set; } = true; + + public Action? ExceptionHandler { get; set; } + + internal Type? MasaExceptionHandlerType { get; private set; } + + public void UseExceptionHanlder() where TExceptionHanlder : IMasaExceptionHandler + { + MasaExceptionHandlerType = typeof(TExceptionHanlder); + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs b/src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs new file mode 100644 index 000000000..aab8c08cc --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionHandlingOptions.cs @@ -0,0 +1,11 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Exceptions; + +public class MasaExceptionHandlingOptions +{ + public bool CatchAllException { get; set; } = true; + + public Func? CustomExceptionHandler { get; set; } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs b/src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs new file mode 100644 index 000000000..06b7d4d1f --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Options/MasaExceptionLogRelationOptions.cs @@ -0,0 +1,23 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class MasaExceptionLogRelationOptions +{ + internal Dictionary Mappings { get; } = new(); + + public MasaExceptionLogRelationOptions MapLogLevel(LogLevel logLevel) where TException : Exception + { + Mappings[typeof(TException)] = logLevel; + return this; + } + + internal LogLevel GetLogLevel(Exception exception, LogLevel defaultLogLevel) + { + if (!Mappings.TryGetValue(exception.GetType(), out var logLevel)) + logLevel = defaultLogLevel; + + return logLevel; + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/README.md b/src/Utils/Masa.Utils.Exceptions/README.md new file mode 100644 index 000000000..69fe60819 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/README.md @@ -0,0 +1,130 @@ +[中](README.zh-CN.md) | EN + +## Masa.Utils.Exceptions + +Provides a model for handling web application exceptions + +* Support custom handling exceptions for handling exceptions not provided by Masa +* Take over the `UserFriendlyException` exception and respond with a status code of 299 and return a friendly error message +* Handle all exceptions by default, and output `An error occur in masa framework` externally + +## Example: + +``` C# +Install-Package Masa.Utils.Exceptions +``` + +1. Modify `Program.cs` + +``` C# +app.UseMasaExceptionHandler(); +``` + +2. How to use? + +``` C# +app.MapGet("/Test", () +{ + throw new UserFriendlyException("This method is deprecated"); +} +``` + +3. Error response message, where Http status code is 299 + +``` js +axios + .get('/Test') + .then(response => { + if (response.status === 299) { + alert(response.data); + } + }) +``` + +## How to customize exception handling? + +1. By specifying `ExceptionHandler` + + ```` C# + app.UseMasaExceptionHandler(option => + { + option.CatchAllException = true;//Whether to catch all exceptions, the default is true, the default output of caught exceptions: An error occur in masa framework + + // Custom handling exceptions, similar to ExceptionFilter, can handle exception information according to the exception type, and output the response result through the ToResult method + option.ExceptionHandler = context => + { + if (context.Exception is ArgumentNullException argumentNullException) + { + context.ExceptionHandled = true; + context.Message = "Parameter cannot be empty"; + // or abbreviated as: context.ToResult("Parameter cannot be empty"); + } + }; + }); + ```` + +2. Implement the `IExceptionHandler` interface and register it with the service + + ```` C# + public class ExceptionHandler : IMasaExceptionHandler + { + private readonly ILogger _logger; + + public ExceptionHandler(ILogger logger) + { + _logger = logger; + } + + public void OnException(MasaExceptionContext context) + { + if (context.Exception is ArgumentNullException) + { + _logger.LogWarning(context.Message); + context.ToResult(context.Exception.Message); + } + } + } + builder.Services.AddSingleton(); + + app.UseMasaExceptionHandler(); + ```` + +3. Implement the `IExceptionHandler` interface and specify the use of Handler + + ```` C# + public class ExceptionHandler : IMasaExceptionHandler + { + private readonly ILogger _logger; + + public ExceptionHandler(ILogger logger) + { + _logger = logger; + } + + public void OnException(MasaExceptionContext context) + { + if (context.Exception is ArgumentNullException) + { + _logger.LogWarning(context.Message); + context.ToResult(context.Exception.Message); + } + } + } + app.UseMasaExceptionHandler(option => + { + option.UseExceptionHanlder(); + }); + ```` + +## Common problem + +The default log level of `UserFriendlyException` is `Information`, other types of exceptions are `Error` + +1. How to modify the log level of UserFriendlyException? + + ```` C# + builder.Services.Configure(options => + { + options.MapLogLevel(LogLevel.None); + }); + ```` \ No newline at end of file diff --git a/src/Utils/Masa.Utils.Exceptions/README.zh-CN.md b/src/Utils/Masa.Utils.Exceptions/README.zh-CN.md new file mode 100644 index 000000000..2c1364aa3 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/README.zh-CN.md @@ -0,0 +1,130 @@ +中 | [EN](README.md) + +## Masa.Utils.Exceptions + +提供了用于处理Web应用程序异常的模型 + +* 支持自定义处理异常,用于处理非Masa提供的异常 +* 接管`UserFriendlyException`异常,并响应状态码为299,返回友好的错误信息 +* 默认处理所有异常,并对外输出`An error occur in masa framework` + +## 用例: + +``` C# +Install-Package Masa.Utils.Exceptions +``` + +1. 修改`Program.cs` + +``` C# +app.UseMasaExceptionHandler(); +``` + +2. 如何使用? + +``` C# +app.MapGet("/Test", () +{ + throw new UserFriendlyException("This method is deprecated"); +} +``` + +3. 错误响应消息,其中Http状态码为299 + +``` js +axios + .get('/Test') + .then(response => { + if (response.status === 299) { + alert(response.data); + } + }) +``` + +## 如何自定义异常处理? + +1. 通过指定`ExceptionHandler` + + ``` C# + app.UseMasaExceptionHandler(option => + { + option.CatchAllException = true;//是否捕获所有异常,默认为true,捕获到的异常默认输出:An error occur in masa framework + + // 自定义处理异常,与ExceptionFilter类似,可根据异常类型处理异常信息,并通过ToResult方法输出响应结果 + option.ExceptionHandler = context => + { + if (context.Exception is ArgumentNullException argumentNullException) + { + context.ExceptionHandled = true; + context.Message = "参数不能为空"; + // 或者简写为context.ToResult("参数不能为空"); + } + }; + }); + ``` + +2. 实现`IExceptionHandler`接口,并注册到服务中 + + ``` C# + public class ExceptionHandler : IMasaExceptionHandler + { + private readonly ILogger _logger; + + public ExceptionHandler(ILogger logger) + { + _logger = logger; + } + + public void OnException(MasaExceptionContext context) + { + if (context.Exception is ArgumentNullException) + { + _logger.LogWarning(context.Message); + context.ToResult(context.Exception.Message); + } + } + } + builder.Services.AddSingleton(); + + app.UseMasaExceptionHandler(); + ``` + +3. 实现`IExceptionHandler`接口,并指定使用Handler + + ``` C# + public class ExceptionHandler : IMasaExceptionHandler + { + private readonly ILogger _logger; + + public ExceptionHandler(ILogger logger) + { + _logger = logger; + } + + public void OnException(MasaExceptionContext context) + { + if (context.Exception is ArgumentNullException) + { + _logger.LogWarning(context.Message); + context.ToResult(context.Exception.Message); + } + } + } + app.UseMasaExceptionHandler(option => + { + option.UseExceptionHanlder(); + }); + ``` + +## 常见问题 + +默认`UserFriendlyException`的日志等级为`Information`, 其它类型异常为`Error` + +1. 如何修改UserFriendlyException的日志等级? + +``` C# +builder.Services.Configure(options => +{ + options.MapLogLevel(LogLevel.None); +}); +``` \ No newline at end of file diff --git a/src/Utils/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs b/src/Utils/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs new file mode 100644 index 000000000..06999a1eb --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Results/DefaultExceptionResult.cs @@ -0,0 +1,25 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Mvc; + +public class DefaultExceptionResult : IActionResult +{ + public string? Message { get; set; } + + public int StatusCode { get; set; } + + public string ContentType { get; set; } + + public DefaultExceptionResult(string? message, int statusCode, string contentType) + { + Message = message; + StatusCode = statusCode; + ContentType = contentType; + } + + public async Task ExecuteResultAsync(ActionContext context) + { + await context.HttpContext.Response.WriteTextAsync(StatusCode, Message ?? Constant.DEFAULT_EXCEPTION_MESSAGE, ContentType); + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs b/src/Utils/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs new file mode 100644 index 000000000..3540a1ef0 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Results/InternalServerErrorObjectResult.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Mvc; + +public class InternalServerErrorObjectResult : ObjectResult +{ + public InternalServerErrorObjectResult(object obj) + : base(obj) + { + StatusCode = (int)HttpStatusCode.InternalServerError; + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs b/src/Utils/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs new file mode 100644 index 000000000..20429d2ab --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/Results/UserFriendlyExceptionResult.cs @@ -0,0 +1,19 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Mvc; + +public class UserFriendlyExceptionResult : IActionResult +{ + public string Message { get; set; } + + public UserFriendlyExceptionResult(string message) + { + Message = message; + } + + public async Task ExecuteResultAsync(ActionContext context) + { + await context.HttpContext.Response.WriteTextAsync((int)MasaHttpStatusCode.UserFriendlyException, Message); + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/UserFriendlyException.cs b/src/Utils/Masa.Utils.Exceptions/UserFriendlyException.cs new file mode 100644 index 000000000..5c2ba7787 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/UserFriendlyException.cs @@ -0,0 +1,12 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace System; + +public class UserFriendlyException : MasaException +{ + public UserFriendlyException(string message) + : base(message) + { + } +} diff --git a/src/Utils/Masa.Utils.Exceptions/_Imports.cs b/src/Utils/Masa.Utils.Exceptions/_Imports.cs new file mode 100644 index 000000000..0f98ed432 --- /dev/null +++ b/src/Utils/Masa.Utils.Exceptions/_Imports.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Exceptions; +global using Masa.Utils.Exceptions.Handlers; +global using Masa.Utils.Exceptions.Internal; +global using Microsoft.AspNetCore.Http; +global using Microsoft.AspNetCore.Mvc; +global using Microsoft.AspNetCore.Mvc.Filters; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using System.Net; +global using System.Reflection; +global using System.Runtime.Serialization; +global using System.Text; diff --git a/src/Utils/Models/Masa.Utils.Models.Config/AppConfig.cs b/src/Utils/Models/Masa.Utils.Models.Config/AppConfig.cs new file mode 100644 index 000000000..c5443c2eb --- /dev/null +++ b/src/Utils/Models/Masa.Utils.Models.Config/AppConfig.cs @@ -0,0 +1,9 @@ + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Models.Config; +public class AppConfig +{ + public string AppId { get; set; } = string.Empty; +} diff --git a/src/Utils/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj b/src/Utils/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/Models/Masa.Utils.Models.Config/Masa.Utils.Models.Config.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj new file mode 100644 index 000000000..80809863a --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/Masa.Utils.Security.Authentication.OpenIdConnect.csproj @@ -0,0 +1,15 @@ + + + + net6.0 + enable + enable + + + + + + + + + diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs new file mode 100644 index 000000000..a215f9a9e --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/MasaOpenIdConnectOptions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication.OpenIdConnect; + +public class MasaOpenIdConnectOptions +{ + public string Authority { get; set; } = string.Empty; + + public string ClientId { get; set; } = string.Empty; + + public string ClientSecret { get; set; } = string.Empty; + + public List Scopes { get; set; } = new List(); +} diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..d85f09d98 --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication.OpenIdConnect/ServiceCollectionExtensions.cs @@ -0,0 +1,96 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +using Masa.Utils.Security.Authentication.OpenIdConnect; +using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.AspNetCore.Authentication.OpenIdConnect; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; +using Microsoft.IdentityModel.Protocols.OpenIdConnect; +using System.IdentityModel.Tokens.Jwt; + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddMasaOpenIdConnect( + this IServiceCollection services, + IConfiguration configuration) + { + return services.AddMasaOpenIdConnect(configuration.GetSection("oidc").Get()); + } + + public static IServiceCollection AddMasaOpenIdConnect( + this IServiceCollection services, + MasaOpenIdConnectOptions masaOpenIdConnectOptions) + { + return services.AddMasaOpenIdConnect(masaOpenIdConnectOptions.Authority, masaOpenIdConnectOptions.ClientId, + masaOpenIdConnectOptions.ClientSecret, masaOpenIdConnectOptions.Scopes.ToArray()); + } + + public static IServiceCollection AddMasaOpenIdConnect( + this IServiceCollection services, + string authority, + string clinetId, + string clientSecret, + params string[] scopes) + { + services.AddHttpContextAccessor(); + + JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); + services.AddAuthentication(options => + { + options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme; + options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; + }) + .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, options => + { + options.ExpireTimeSpan = TimeSpan.FromSeconds(3600); + }) + .AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, options => + { + options.Authority = authority; + options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; + options.SignOutScheme = OpenIdConnectDefaults.AuthenticationScheme; + options.RequireHttpsMetadata = false; + options.ClientId = clinetId; + options.ClientSecret = clientSecret; + options.ResponseType = OpenIdConnectResponseType.Code; + + foreach (var scope in scopes) + { + options.Scope.Add(scope); + } + + options.SaveTokens = true; + options.GetClaimsFromUserInfoEndpoint = true; + options.UseTokenLifetime = true; + + options.TokenValidationParameters.RequireExpirationTime = true; + options.TokenValidationParameters.ValidateLifetime = true; + + options.NonceCookie.SameSite = SameSiteMode.Unspecified; + options.CorrelationCookie.SameSite = SameSiteMode.Unspecified; + + options.Events = new OpenIdConnectEvents + { + OnAccessDenied = context => + { + context.HandleResponse(); + context.Response.Redirect("/"); + return Task.CompletedTask; + } + }; + }); + + services.AddAuthorization(options => + { + // By default, all incoming requests will be authorized according to the default policy + options.FallbackPolicy = options.DefaultPolicy; + }); + + return services; + } +} + diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs new file mode 100644 index 000000000..3ddbea269 --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Attributes/MasaAuthorizeAttribute.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication.Attributes; + +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] +public class MasaAuthorizeAttribute : AuthorizeAttribute +{ + public string[] Permissions { get; set; } + + public MasaAuthorizeAttribute(params string[] permissions) + { + Permissions = permissions; + } +} diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs new file mode 100644 index 000000000..8aa79822b --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Constants/MasaClaimTypes.cs @@ -0,0 +1,27 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication.Constants; + +public struct MasaClaimTypes +{ + public const string USER_NAME = ClaimTypes.Name; + + public const string NAME = ClaimTypes.GivenName; + + public const string USER_ID = ClaimTypes.NameIdentifier; + + public const string ROLE = ClaimTypes.Role; + + public const string EMAIL = ClaimTypes.Email; + + public const string PHONE_NUMBER = ClaimTypes.MobilePhone; + + public const string EMAIL_VERIFIED = "https://masastack.com/security/authentication/email_verified"; + + public const string PHONE_NUMBER_VERIFIED = "https://masastack.com/security/authentication/phone_number_verified"; + + public const string ENVIRONMENT = "https://masastack.com/security/authentication/environment"; + + public const string TENANT = "https://masastack.com/security/authentication/tenant"; +} diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs new file mode 100644 index 000000000..a5d0e186a --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Extensions/ClaimsIdentityExtensions.cs @@ -0,0 +1,53 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication.Extensions; + +public static class ClaimsIdentityExtensions +{ + public static string? FindClaimValue(this ClaimsPrincipal claimsPrincipal, string claimType) + => claimsPrincipal.Claims.FirstOrDefault(c => c.Type == claimType)?.Value; + + public static Guid? FindUserId(this ClaimsPrincipal principal) + { + var userIdOrNull = principal.Claims?.FirstOrDefault(c => c.Type == MasaClaimTypes.USER_ID); + if (userIdOrNull == null || string.IsNullOrWhiteSpace(userIdOrNull.Value)) + { + return null; + } + + if (Guid.TryParse(userIdOrNull.Value, out Guid guid)) + { + return guid; + } + + return null; + } + + public static Guid? FindTenantId(this ClaimsPrincipal principal) + { + var tenantIdOrNull = principal.Claims?.FirstOrDefault(c => c.Type == MasaClaimTypes.TENANT); + if (tenantIdOrNull == null || string.IsNullOrWhiteSpace(tenantIdOrNull.Value)) + { + return null; + } + + if (Guid.TryParse(tenantIdOrNull.Value, out var guid)) + { + return guid; + } + + return null; + } + + public static string FindEnvironment(this ClaimsPrincipal principal) + { + var evironmentOrNull = principal.Claims?.FirstOrDefault(c => c.Type == MasaClaimTypes.ENVIRONMENT); + if (evironmentOrNull == null || string.IsNullOrWhiteSpace(evironmentOrNull.Value)) + { + return string.Empty; + } + + return evironmentOrNull.Value; + } +} diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs new file mode 100644 index 000000000..810bf600f --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/ICurrentPrincipalAccessor.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication; + +public interface ICurrentPrincipalAccessor +{ + ClaimsPrincipal? Principal { get; } +} diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj new file mode 100644 index 000000000..81500c971 --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/Masa.Utils.Security.Authentication.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/MasaUser.cs b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/MasaUser.cs new file mode 100644 index 000000000..5a33e302c --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/MasaUser.cs @@ -0,0 +1,47 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication; + +public class MasaUser +{ + readonly ICurrentPrincipalAccessor _principalAccessor; + + public MasaUser(ICurrentPrincipalAccessor principalAccessor) + { + _principalAccessor = principalAccessor; + } + + public virtual Claim? FindClaim(string claimType) + { + return _principalAccessor.Principal?.Claims.FirstOrDefault(c => c.Type == claimType); + } + + public virtual Claim[] FindClaims(string claimType) + { + return _principalAccessor.Principal?.Claims.Where(c => c.Type == claimType).ToArray() ?? new Claim[0]; + } + + public virtual Claim[] GetAllClaims() + { + return _principalAccessor.Principal?.Claims.ToArray() ?? new Claim[0]; + } + + public Guid? UserId => _principalAccessor.Principal?.FindUserId(); + + public string UserName => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.USER_NAME) ?? ""; + + public string Name => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.NAME) ?? ""; + + public string PhoneNumber => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.PHONE_NUMBER) ?? ""; + + public bool PhoneNumberVerified => string.Equals(_principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.PHONE_NUMBER_VERIFIED), "true", StringComparison.InvariantCultureIgnoreCase); + + public string Email => _principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.EMAIL) ?? ""; + + public bool EmailVerified => string.Equals(_principalAccessor.Principal?.FindClaimValue(MasaClaimTypes.EMAIL_VERIFIED), "true", StringComparison.InvariantCultureIgnoreCase); + + public Guid? TenantId => _principalAccessor.Principal?.FindTenantId(); + + public string Environment => _principalAccessor.Principal?.FindEnvironment() ?? string.Empty; +} diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs new file mode 100644 index 000000000..5d9526d37 --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/ThreadCurrentPrincipalAccessor.cs @@ -0,0 +1,9 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Authentication; + +internal class ThreadCurrentPrincipalAccessor : ICurrentPrincipalAccessor, ISingletonDependency +{ + public ClaimsPrincipal? Principal => Thread.CurrentPrincipal as ClaimsPrincipal; +} diff --git a/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/_Imports.cs b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/_Imports.cs new file mode 100644 index 000000000..acf0cb66f --- /dev/null +++ b/src/Utils/Security/Authentication/Masa.Utils.Security.Authentication/_Imports.cs @@ -0,0 +1,8 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Security.Authentication.Constants; +global using Masa.Utils.Security.Authentication.Extensions; +global using Microsoft.AspNetCore.Authorization; +global using Microsoft.Extensions.DependencyInjection; +global using System.Security.Claims; diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/AesUtils.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/AesUtils.cs new file mode 100644 index 000000000..8a23e7d78 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/AesUtils.cs @@ -0,0 +1,529 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public class AesUtils : EncryptBase +{ + private static readonly byte[] DefaultIv = + { + 0x41, + 0x72, + 0x65, + 0x79, + 0x6F, + 0x75, + 0x6D, + 0x79, + 0x53, + 0x6E, + 0x6F, + 0x77, + 0x6D, + 0x61, + 0x6E, + 0x3F + }; + + /// + /// Generate a key that complies with AES encryption rules + /// + /// + /// + public static string GenerateKey(int length) + { + var crypto = Aes.Create(); + crypto.KeySize = length; + crypto.BlockSize = 128; + crypto.GenerateKey(); + return Convert.ToBase64String(crypto.Key); + } + + /// + /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) + /// + /// String to be encrypted + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(content, GlobalConfigurationUtils.DefaultEncryKey, FillType.Right, fillCharacter, encoding); + + /// + /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) + /// + /// String to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(content, key, DefaultIv, fillType, fillCharacter, encoding); + + /// + /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) + /// + /// String to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length key or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var ivBuffer = GetSafeEncoding(encoding).GetBytes(GetSpecifiedLengthString( + iv, + 16, + () => throw new ArgumentException(nameof(key), + $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + return Encrypt(content, + key, + ivBuffer, + fillType, + fillCharacter, + encoding); + } + + /// + /// Symmetric encryption algorithm AES RijndaelManaged encryption (RijndaelManaged (AES) algorithm is a block encryption algorithm) + /// + /// String to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + key = GetSpecifiedLengthString( + key, + 32, + () => throw new ArgumentException(nameof(key), + $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter); + using var aes = Aes.Create(); + aes.Key = currentEncoding.GetBytes(key); + aes.IV = iv; + using ICryptoTransform cryptoTransform = aes.CreateEncryptor(); + byte[] buffers = currentEncoding.GetBytes(content); + byte[] encryptedData = cryptoTransform.TransformFinalBlock(buffers, 0, buffers.Length); + return Convert.ToBase64String(encryptedData); + } + + /// + /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string + /// + /// String to be decrypted + /// character for complement + /// Encoding format, default UTF-8 + /// If the decryption succeeds, the decrypted string will be returned, and if it fails, the source string will be returned. + public static string Decrypt( + string content, + char fillCharacter = ' ', + Encoding? encoding = null) + => Decrypt(content, GlobalConfigurationUtils.DefaultEncryKey, FillType.Right, fillCharacter, encoding); + + /// + /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string + /// + /// String to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decryption success returns the decrypted string, failure returns empty + public static string Decrypt( + string content, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Decrypt(content, key, DefaultIv, fillType, fillCharacter, encoding); + + /// + /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string + /// + /// String to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decryption success returns the decrypted string, failure returns empty + public static string Decrypt( + string content, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var ivBuffer = GetSafeEncoding(encoding).GetBytes(GetSpecifiedLengthString( + iv, + 16, + () => throw new ArgumentException(nameof(key), + $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + return Decrypt(content, + key, + ivBuffer, + fillType, + fillCharacter, + encoding); + } + + /// + /// Symmetric encryption algorithm AES RijndaelManaged decrypts the string + /// + /// String to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length. 16-bit length key or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decryption success returns the decrypted string, failure returns empty + public static string Decrypt( + string content, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + key = GetSpecifiedLengthString( + key, + 32, + () => throw new ArgumentException(nameof(key), + $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter); + using var aes = Aes.Create(); + aes.Key = currentEncoding.GetBytes(key); + aes.IV = iv; + using ICryptoTransform rijndaelDecrypt = aes.CreateDecryptor(); + byte[] buffers = Convert.FromBase64String(content); + byte[] decryptedData = rijndaelDecrypt.TransformFinalBlock(buffers, 0, buffers.Length); + return currentEncoding.GetString(decryptedData); + } + + /// + /// encrypted file stream + /// + /// File streams that require encryption + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted stream result + public static CryptoStream Encrypt( + FileStream fileStream, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(fileStream, key, key, fillType, fillCharacter, encoding); + + /// + /// encrypted file stream + /// + /// File streams that require encryption + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length. 16-bit length key or complement by fillType to calculate an 16-bit string + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted stream result + public static CryptoStream Encrypt( + FileStream fileStream, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + + var ivBuffer = currentEncoding.GetBytes(GetSpecifiedLengthString(iv, + 16, + () => throw new ArgumentException(nameof(iv), + $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + return Encrypt(fileStream, key, ivBuffer, fillType, fillCharacter, encoding); + } + + /// + /// encrypted file stream + /// + /// File streams that require encryption + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted stream result + public static CryptoStream Encrypt( + FileStream fileStream, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + if (iv.Length != 16) + { + throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 16 bits!"); + } + + var currentEncoding = GetSafeEncoding(encoding); + key = GetSpecifiedLengthString(key, + 32, + () => throw new ArgumentException(nameof(key), + $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter); + + using var aes = Aes.Create(); + aes.Key = currentEncoding.GetBytes(key); + aes.IV = iv; + using var cryptoTransform = aes.CreateEncryptor(); + return new CryptoStream(fileStream, cryptoTransform, CryptoStreamMode.Write); + } + + /// + /// Decrypt the file stream + /// + /// file stream to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decrypt the stream result + public static CryptoStream Decrypt( + FileStream fileStream, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + + var ivBuffer = currentEncoding.GetBytes(GetSpecifiedLengthString(iv, + 16, + () => throw new ArgumentException(nameof(iv), + $"Please enter a 16-bit iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + return Decrypt(fileStream, key, ivBuffer, fillType, fillCharacter, encoding); + } + + /// + /// Decrypt the file stream + /// + /// file stream to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length + /// Whether to complement the key? default: no fill(Only supports 32-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// Decrypt the stream result + public static CryptoStream Decrypt( + FileStream fileStream, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + if (iv.Length != 16) + { + throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 16 bits!"); + } + + key = GetSpecifiedLengthString(key, + 32, + () => throw new ArgumentException(nameof(key), + $"Please enter a 32-bit AES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter); + + var currentEncoding = GetSafeEncoding(encoding); + using var aes = Aes.Create(); + aes.Key = currentEncoding.GetBytes(key); + aes.IV = iv; + using var cryptoTransform = aes.CreateDecryptor(); + return new CryptoStream(fileStream, cryptoTransform, CryptoStreamMode.Read); + } + + /// + /// Encrypt the specified stream with AES and output a file + /// + /// file stream to be encrypted + /// output file path + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string outputPath, + char fillCharacter = ' ', + Encoding? encoding = null) + => EncryptFile(fileStream, + GlobalConfigurationUtils.DefaultEncryKey, + outputPath, + FillType.Right, + fillCharacter, + encoding); + + /// + /// Encrypt the specified stream with AES and output a file + /// + /// file stream to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string key, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => EncryptFile(fileStream, key, key, outputPath, fillType, fillCharacter, encoding); + + /// + /// Encrypt the specified stream with AES and output a file + /// + /// file stream to be encrypted + /// Encryption key, must have half-width characters. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length or complement by fillType to calculate an 16-bit string + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string key, + string iv, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + using var fileStreamOut = new FileStream(outputPath, FileMode.Create); + using var cryptoStream = Encrypt(fileStream, key, iv, fillType, fillCharacter, encoding); + byte[] buffers = new byte[1024]; + while (true) + { + var count = cryptoStream.Read(buffers, 0, buffers.Length); + fileStreamOut.Write(buffers, 0, count); + if (count < buffers.Length) + { + break; + } + } + } + + /// + /// AES decrypt the specified file stream and output the file + /// + /// file stream to be decrypted + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => DecryptFile(fileStream, GlobalConfigurationUtils.DefaultEncryKey, outputPath, fillType, fillCharacter, encoding); + + /// + /// AES decrypt the specified file stream and output the file + /// + /// file stream to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string key, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => DecryptFile(fileStream, key, key, outputPath, fillType, fillCharacter, encoding); + + /// + /// AES decrypt the specified file stream and output the file + /// + /// file stream to be decrypted + /// Decryption key, same as encryption key. 32-bit length key or complement by fillType to calculate an 32-bit string + /// 16-bit length or complement by fillType to calculate an 16-bit string + /// output file path + /// Whether to complement the key? default: no fill(Only supports 32-bit keys or 16-bit iv) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string key, + string iv, + string outputPath, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + using FileStream fileStreamOut = new(outputPath, FileMode.Create); + using CryptoStream cryptoStream = Decrypt(fileStream, key, iv, fillType, fillCharacter, encoding); + byte[] buffers = new byte[1024]; + while (true) + { + var count = cryptoStream.Read(buffers, 0, buffers.Length); + fileStreamOut.Write(buffers, 0, count); + if (count < buffers.Length) + { + break; + } + } + } +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs new file mode 100644 index 000000000..5db13331a --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/Base64Utils.cs @@ -0,0 +1,34 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Base64 encryption and decryption +/// +public class Base64Utils : EncryptBase +{ + /// + /// Base64 encryption + /// + /// String to be encrypted + /// Encoding format, default UTF-8 + /// encrypted data + public static string Encrypt(string content, Encoding? encoding = null) + { + byte[] buffers = GetSafeEncoding(encoding).GetBytes(content); + return Convert.ToBase64String(buffers); + } + + /// + /// Base64 decryption + /// + /// String to decrypt + /// Encoding format, default UTF-8 + /// decrypted data + public static string Decrypt(string content, Encoding? encoding = null) + { + byte[] buffers = Convert.FromBase64String(content); + return GetSafeEncoding(encoding).GetString(buffers); + } +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs new file mode 100644 index 000000000..2890c91a9 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/DESEncryType.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public enum DESEncryType +{ + /// + /// original DES encryption + /// + Normal, + + /// + /// Easy to transfer in browser + /// + Improved +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/DesUtils.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/DesUtils.cs new file mode 100644 index 000000000..17e80496f --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/DesUtils.cs @@ -0,0 +1,415 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// DES symmetric encryption and decryption +/// +public class DesUtils : EncryptBase +{ + /// + /// Default encryption key + /// + private static readonly string DefaultEncryptKey = MD5Utils.EncryptRepeat(GlobalConfigurationUtils.DefaultEncryKey, 2); + + /// + /// 使用默认加密 + /// + /// 被加密的字符串 + /// Des encryption method, default: improved (easy to transmit) + /// Whether to convert the encrypted string to lowercase + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + DESEncryType desEncryType = DESEncryType.Improved, + bool isToLower = true, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(content, DefaultEncryptKey, desEncryType, isToLower, FillType.Right, fillCharacter, encoding); + + /// + /// Des encrypted string + /// + /// String to be encrypted + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Des encryption method, default: improved (easy to transmit) + /// Whether to convert the encrypted string to lowercase + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + DESEncryType desEncryType = DESEncryType.Improved, + bool isToLower = true, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Encrypt(content, key, key, desEncryType, isToLower, fillType, fillCharacter, encoding); + + /// + /// Des encrypted string + /// + /// String to be encrypted + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Des encryption method, default: improved (easy to transmit) + /// Whether to convert the encrypted string to lowercase + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string key, + string iv, + DESEncryType desEncryType = DESEncryType.Improved, + bool isToLower = true, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + var des = DES.Create(); + des.Key = currentEncoding.GetBytes( + GetSpecifiedLengthString(key, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + des.IV = currentEncoding.GetBytes( + GetSpecifiedLengthString(iv, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + using MemoryStream memoryStream = new MemoryStream(); + byte[] buffer = currentEncoding.GetBytes(content); + using CryptoStream cs = new CryptoStream(memoryStream, des.CreateEncryptor(), CryptoStreamMode.Write); + cs.Write(buffer, 0, buffer.Length); + cs.FlushFinalBlock(); + if (desEncryType == DESEncryType.Normal) + return Convert.ToBase64String(memoryStream.ToArray()); + + StringBuilder stringBuilder = new(); + foreach (byte b in memoryStream.ToArray()) + { + stringBuilder.AppendFormat(isToLower ? $"{b:x2}" : $"{b:X2}"); + } + + return stringBuilder.ToString(); + } + + /// + /// DES decryption with default key + /// + /// String to be decrypted + /// Des encryption method, default: improved (easy to transmit) + /// character for complement + /// Encoding format, default UTF-8 + /// decrypted result + public static string Decrypt(string content, + DESEncryType desEncryType = DESEncryType.Improved, + char fillCharacter = ' ', + Encoding? encoding = null) + => Decrypt(content, DefaultEncryptKey, desEncryType, FillType.Right, fillCharacter, encoding); + + /// + /// DES decryption + /// + /// String to be decrypted + /// 8-bit length key + /// Des encryption method, default: improved (easy to transmit) + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// decrypted result + public static string Decrypt( + string content, + string key, + DESEncryType desEncryType = DESEncryType.Improved, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + => Decrypt(content, key, key, desEncryType, fillType, fillCharacter, encoding); + + /// + /// DES decryption + /// + /// String to be decrypted + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Des encryption method, default: improved (easy to transmit) + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + /// decrypted result + public static string Decrypt( + string content, + string key, + string iv, + DESEncryType desEncryType = DESEncryType.Improved, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + using var memoryStream = new MemoryStream(); + using var des = DES.Create(); + var currentEncoding = GetSafeEncoding(encoding); + des.Key = currentEncoding.GetBytes( + GetSpecifiedLengthString(key, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + des.IV = currentEncoding.GetBytes( + GetSpecifiedLengthString(iv, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + using (MemoryStream ms = new MemoryStream()) + { + byte[] buffers = desEncryType == DESEncryType.Improved ? new byte[content.Length / 2] : Convert.FromBase64String(content); + if (desEncryType == DESEncryType.Improved) + { + for (int x = 0; x < content.Length / 2; x++) + { + int i = Convert.ToInt32(content.Substring(x * 2, 2), 16); + buffers[x] = (byte) i; + } + } + + using (CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write)) + { + cs.Write(buffers, 0, buffers.Length); + cs.FlushFinalBlock(); + } + + return currentEncoding.GetString(ms.ToArray()); + } + } + + /// + /// DES encrypts the file stream and outputs the encrypted file + /// + /// file input stream + /// file output path + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string outFilePath, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + byte[] iv = + { + 0x12, + 0x34, + 0x56, + 0x78, + 0x90, + 0xAB, + 0xCD, + 0xEF + }; + EncryptFile(fileStream, outFilePath, key, iv, fillType, fillCharacter, encoding); + } + + /// + /// DES encrypts the file stream and outputs the encrypted file + /// + /// file input stream + /// file output path + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string outFilePath, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + var ivBuffer = currentEncoding.GetBytes( + GetSpecifiedLengthString(iv, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + EncryptFile(fileStream, outFilePath, key, ivBuffer, fillType, fillCharacter, encoding); + } + + /// + /// DES encrypts the file stream and outputs the encrypted file + /// + /// file input stream + /// file output path + /// 8-bit length key + /// 8-bit length key + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void EncryptFile( + FileStream fileStream, + string outFilePath, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + if (iv.Length != 8) + { + throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 8 bits!"); + } + + var currentEncoding = GetSafeEncoding(encoding); + using var fileStreamOut = new FileStream(outFilePath, FileMode.OpenOrCreate, FileAccess.Write); + fileStreamOut.SetLength(0); + byte[] buffers = new byte[100]; + long readLength = 0; + using var des = DES.Create(); + des.Key = currentEncoding.GetBytes( + GetSpecifiedLengthString(key, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + des.IV = iv; + + using var cryptoStream = new CryptoStream(fileStreamOut, des.CreateEncryptor(), + CryptoStreamMode.Write); + while (readLength < fileStream.Length) + { + var length = fileStream.Read(buffers, 0, 100); + cryptoStream.Write(buffers, 0, length); + readLength += length; + } + } + + /// + /// DES decrypts the file stream and outputs the source file + /// + /// input file stream to be decrypted + /// file output path + /// decryption key or complement by fillType to calculate an 8-bit string + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string outFilePath, + string key, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + byte[] iv = + { + 0x12, + 0x34, + 0x56, + 0x78, + 0x90, + 0xAB, + 0xCD, + 0xEF + }; + DecryptFile(fileStream, outFilePath, key, iv, fillType, fillCharacter, encoding); + } + + /// + /// DES decrypts the file stream and outputs the source file + /// + /// input file stream to be decrypted + /// file output path + /// decryption key or complement by fillType to calculate an 8-bit string + /// 8-bit length key or complement by fillType to calculate an 8-bit string + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string outFilePath, + string key, + string iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + var currentEncoding = GetSafeEncoding(encoding); + + var ivBuffer = currentEncoding.GetBytes( + GetSpecifiedLengthString(iv, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES iv or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + + DecryptFile(fileStream, outFilePath, key, ivBuffer, fillType, fillCharacter, currentEncoding); + } + + /// + /// DES decrypts the file stream and outputs the source file + /// + /// input file stream to be decrypted + /// file output path + /// decryption key or complement by fillType to calculate an 8-bit string + /// + /// Do you supplement key and iv? default: no fill(Only supports 8-bit keys) + /// character for complement + /// Encoding format, default UTF-8 + public static void DecryptFile( + FileStream fileStream, + string outFilePath, + string key, + byte[] iv, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ', + Encoding? encoding = null) + { + if (iv.Length != 8) + { + throw new Exception($"The {nameof(iv)} length is invalid. The {nameof(iv)} iv length needs 8 bits!"); + } + + var currentEncoding = GetSafeEncoding(encoding); + using var fileStreamOut = new FileStream(outFilePath, FileMode.OpenOrCreate, FileAccess.Write); + fileStreamOut.SetLength(0); + byte[] buffers = new byte[100]; + long readLength = 0; + using var des = DES.Create(); + des.Key = currentEncoding.GetBytes( + GetSpecifiedLengthString(key, + 8, + () => throw new ArgumentException($"Please enter a 8-bit DES key or allow {nameof(fillType)} to Left or Right"), + fillType, + fillCharacter)); + des.IV = iv; + using var cryptoStream = new CryptoStream(fileStreamOut, des.CreateDecryptor(), + CryptoStreamMode.Write); + while (readLength < fileStream.Length) + { + var length = fileStream.Read(buffers, 0, 100); + cryptoStream.Write(buffers, 0, length); + readLength += length; + } + } +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs new file mode 100644 index 000000000..e64c337d6 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/EncryptBase.cs @@ -0,0 +1,43 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public class EncryptBase +{ + protected static string GetSpecifiedLengthString( + string key, + int length, + Func func, + FillType fillType = FillType.NoFile, + char fillCharacter = ' ') + { + if (fillType == FillType.NoFile && key.Length < length) + { + throw func.Invoke(); + } + + if (key.Length >= length) + { + return key.Substring(0, length); + } + + if (fillType == FillType.Left) + { + return key.PadLeft(length, fillCharacter); + } + + if (fillType == FillType.Right) + { + return key.PadRight(length, fillCharacter); + } + + throw new NotSupportedException($"... Unsupported {nameof(fillType)}"); + } + + protected static Encoding GetSafeEncoding(Encoding? encoding = null) + => GetSafeEncoding(() => Encoding.UTF8, encoding); + + protected static Encoding GetSafeEncoding(Func func, Encoding? encoding = null) + => encoding ?? func.Invoke(); +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/EncryptType.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/EncryptType.cs new file mode 100644 index 000000000..30658e7e2 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/EncryptType.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public enum EncryptType +{ + Md5, + Sha1, + Sha256, + Sha384, + Sha512 +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/FillType.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/FillType.cs new file mode 100644 index 000000000..2709d93ce --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/FillType.cs @@ -0,0 +1,17 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public enum FillType +{ + NoFile = 1, + /// + /// left fill + /// + Left = 2, + /// + /// right fill + /// + Right = 3 +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs new file mode 100644 index 000000000..ffc41192b --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/GlobalConfigurationUtils.cs @@ -0,0 +1,21 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public class GlobalConfigurationUtils +{ + private static string _defaultEncryKey = "masastack.com"; + + public static string DefaultEncryKey + { + get => _defaultEncryKey; + set + { + if (string.IsNullOrWhiteSpace(value)) + throw new ArgumentException($"{nameof(DefaultEncryKey)} cannot be empty", nameof(DefaultEncryKey)); + + _defaultEncryKey = value; + } + } +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs new file mode 100644 index 000000000..7ce6d52fe --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/HashAlgorithmBase.cs @@ -0,0 +1,48 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +public class HashAlgorithmBase : EncryptBase +{ + /// + /// encryption + /// + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// + /// + public static string Encrypt(EncryptType encryptType, string content, bool isToLower = false, Encoding? encoding = null) + { + using (var hashAlgorithm = HashAlgorithm.Create(encryptType.ToString())) + { + if (hashAlgorithm == null) + throw new NotSupportedException("Unsupported encryptType"); + + byte[] buffer = GetSafeEncoding(encoding).GetBytes(content); + buffer = hashAlgorithm.ComputeHash(buffer); + return Encrypt(encryptType, buffer, hashAlgorithm, isToLower); + } + } + + protected static string Encrypt(EncryptType encryptType, byte[] buffer, HashAlgorithm? hashAlgorithm = null, bool isToLower = false) + { + using (hashAlgorithm ??= HashAlgorithm.Create(encryptType.ToString())) + { + if (hashAlgorithm == null) + throw new NotSupportedException("Unsupported encryptType"); + + hashAlgorithm.Clear(); + + StringBuilder stringBuilder = new StringBuilder(); + foreach (byte b in buffer) + { + stringBuilder.AppendFormat("{0:x2}", b); + } + + var result = BitConverter.ToString(buffer).Replace("-", ""); + return isToLower ? result.ToLower() : result; + } + } +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs new file mode 100644 index 000000000..5a771a70d --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/MD5Utils.cs @@ -0,0 +1,117 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// MD5加密算法 +/// +public class MD5Utils : HashAlgorithmBase +{ + /// + /// MD5 encryption of string + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// + private static string Encrypt( + string content, + bool isToLower = true, + Encoding? encoding = null) + => Encrypt(content, string.Empty, isToLower, encoding); + + /// + /// MD5 multiple encryption + /// + /// String to be encrypted + /// Encryption times,default: 1 + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string EncryptRepeat( + string content, + int encryptTimes = 1, + bool isToLower = true, + Encoding? encoding = null) + => EncryptRepeat(content, string.Empty, encryptTimes, false, isToLower, encoding); + + /// + /// MD5 salt-encrypted string + /// + /// String to be encrypted + /// + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt( + string content, + string salt, + bool isToLower = true, + Encoding? encoding = null) + => Encrypt(EncryptType.Md5, content + salt, isToLower, encoding); + + /// + /// MD5 multiple encryption + /// + /// String to be encrypted + /// + /// + /// When the number of executions is greater than 1, is it necessary to add salt and then encrypt after the second time? default: false (Salt encryption only for the first time) + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string EncryptRepeat( + string content, + string salt, + int encryptTimes, + bool isNeedSalt = false, + bool isToLower = true, + Encoding? encoding = null) + { + if (encryptTimes < 1) + throw new ArgumentException($"{nameof(encryptTimes)} must be greater than or equal to 1", nameof(encryptTimes)); + + int times = 1; + string result = Encrypt(content + salt, isToLower, encoding); + while (times < encryptTimes) + { + result = isNeedSalt ? result + salt : result; + result = Encrypt(result, isToLower, encoding); + times++; + } + + return result; + } + + /// + /// Get the MD5 value of the file + /// + /// absolute path to the file + /// Whether to convert the encrypted string to lowercase + /// encrypted result + public static string EncryptFile(string fileName, bool isToLower = true) + { + using var fileStream = File.Open(fileName, FileMode.Open, FileAccess.Read); + return EncryptStream(fileStream, isToLower); + } + + /// + /// Get the MD5 value of the data stream + /// + /// + /// Whether to convert the encrypted string to lowercase + /// encrypted result + public static string EncryptStream(Stream stream, bool isToLower = true) + { + stream.Position = 0; + byte[] buffers = new byte[stream.Length]; + stream.Read(buffers, 0, buffers.Length); + stream.Seek(0, SeekOrigin.Begin); + using var md5 = MD5.Create(); + byte[] bytes = md5.ComputeHash(buffers); + var encryptedContent = Encrypt(EncryptType.Md5, bytes, null, isToLower); + stream.Position = 0; + return encryptedContent; + } +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj b/src/Utils/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj new file mode 100644 index 000000000..132c02c59 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/Masa.Utils.Security.Cryptography.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs new file mode 100644 index 000000000..b71f70354 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA1Utils.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Hash algorithm encryption SHA1 +/// +public class SHA1Utils : HashAlgorithmBase +{ + /// + /// Encrypt string with SHA1 + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) + => Encrypt(EncryptType.Sha1, content, isToLower, encoding); +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs new file mode 100644 index 000000000..d3567d057 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA256Utils.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Hash algorithm encryption SHA256 +/// +public class SHA256Utils : HashAlgorithmBase +{ + /// + /// Encrypt string with SHA256 + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) + => Encrypt(EncryptType.Sha256, content, isToLower, encoding); +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs new file mode 100644 index 000000000..fb4bdfe4a --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA384Utils.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Hash algorithm encryption SHA384 +/// +public class SHA384Utils : HashAlgorithmBase +{ + /// + /// Encrypt string with SHA384 + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) + => Encrypt(EncryptType.Sha384, content, isToLower, encoding); +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs new file mode 100644 index 000000000..383547368 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/SHA512Utils.cs @@ -0,0 +1,20 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography; + +/// +/// Hash algorithm encryption SHA512 +/// +public class SHA512Utils : HashAlgorithmBase +{ + /// + /// Encrypt string with SHA512 + /// + /// String to be encrypted + /// Whether to convert the encrypted string to lowercase + /// Encoding format, default UTF-8 + /// encrypted result + public static string Encrypt(string content, bool isToLower = false, Encoding? encoding = null) + => Encrypt(EncryptType.Sha512, content, isToLower, encoding); +} diff --git a/src/Utils/Security/Masa.Utils.Security.Cryptography/_Imports.cs b/src/Utils/Security/Masa.Utils.Security.Cryptography/_Imports.cs new file mode 100644 index 000000000..c813f8c2c --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Cryptography/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using System.Security.Cryptography; +global using System.Text; diff --git a/src/Utils/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs b/src/Utils/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs new file mode 100644 index 000000000..a8a18c930 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Token/DefaultJwtProvider.cs @@ -0,0 +1,85 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Token; + +public class DefaultJwtProvider : IJwtProvider +{ + private readonly JwtConfigurationOptions _options; + private readonly ILogger? _logger; + + public DefaultJwtProvider(IOptionsSnapshot options, ILogger? logger = null) + { + _options = options.Value; + _logger = logger; + } + + public string CreateToken(string value, TimeSpan timeout) + => CreateToken(new[] + { + new Claim(ClaimTypes.Sid, value), + }, timeout); + + public string CreateToken(Claim[] claims, TimeSpan timeout) + { + DateTime notBefore = DateTime.UtcNow; + DateTime expires = notBefore.Add(timeout); + var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_options.SecurityKey)); + var credentials = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); + var token = new JwtSecurityToken( + _options.Issuer, + _options.Audience, + claims, + notBefore, + expires, + credentials); + var tokenHandler = new JwtSecurityTokenHandler(); + return tokenHandler.WriteToken(token); + } + + public bool IsValid(string token, string value, Action? action = null) + { + var isValid = IsValid(token, out _, + out ClaimsPrincipal? claimsPrincipal, action); + + return isValid && claimsPrincipal != null && claimsPrincipal.HasClaim(ClaimTypes.Sid, value); + } + + public bool IsValid( + string token, + out SecurityToken? securityToken, + out ClaimsPrincipal? claimsPrincipal, + Action? action = null) + { + securityToken = null; + claimsPrincipal = null; + + try + { + var handler = new JwtSecurityTokenHandler(); + var validationParameters = new TokenValidationParameters() + { + ValidateIssuer = true, + ValidateAudience = true, + ValidateLifetime = true, + ValidateIssuerSigningKey = true, + ValidIssuer = _options.Issuer, + ValidAudience = _options.Audience, + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_options.SecurityKey)), + }; + action?.Invoke(validationParameters); + claimsPrincipal = handler.ValidateToken(token, validationParameters, out securityToken); + return securityToken != null; + } + catch (SecurityTokenException ex) + { + _logger?.LogError("... IsValid Failed on SecurityTokenException", ex); + return false; + } + catch (Exception ex) + { + _logger?.LogError("... IsValid Failed", ex); + return false; + } + } +} diff --git a/src/Utils/Security/Masa.Utils.Security.Token/IJwtProvider.cs b/src/Utils/Security/Masa.Utils.Security.Token/IJwtProvider.cs new file mode 100644 index 000000000..80e9b41e2 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Token/IJwtProvider.cs @@ -0,0 +1,22 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Token; + +public interface IJwtProvider +{ + string CreateToken(string value, TimeSpan timeout); + + string CreateToken(Claim[] claims, TimeSpan timeout); + + bool IsValid( + string token, + string value, + Action? action = null); + + bool IsValid( + string token, + out SecurityToken? securityToken, + out ClaimsPrincipal? claimsPrincipal, + Action? action = null); +} diff --git a/src/Utils/Security/Masa.Utils.Security.Token/JwtUtils.cs b/src/Utils/Security/Masa.Utils.Security.Token/JwtUtils.cs new file mode 100644 index 000000000..0868b912e --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Token/JwtUtils.cs @@ -0,0 +1,31 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Token; + +public class JwtUtils +{ + private static IServiceProvider? _serviceProvider; + + public JwtUtils(IServiceCollection services) + { + _serviceProvider ??= services.BuildServiceProvider(); + } + + private static IServiceProvider GetServiceProvider() => _serviceProvider!.CreateScope().ServiceProvider; + + private static IJwtProvider GetJwtProvider() => GetServiceProvider().GetRequiredService(); + + + public static string CreateToken(string value, TimeSpan timeout) + => GetJwtProvider().CreateToken(value, timeout); + + public static string CreateToken(Claim[] claims, TimeSpan timeout) + => GetJwtProvider().CreateToken(claims, timeout); + + public static bool IsValid(string token, string value) + => GetJwtProvider().IsValid(token, value); + + public static bool IsValid(string token, out SecurityToken? securityToken, out ClaimsPrincipal? claimsPrincipal) + => GetJwtProvider().IsValid(token, out securityToken, out claimsPrincipal); +} diff --git a/src/Utils/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj b/src/Utils/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj new file mode 100644 index 000000000..55615dc4e --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Token/Masa.Utils.Security.Token.csproj @@ -0,0 +1,20 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + + + + diff --git a/src/Utils/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs b/src/Utils/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs new file mode 100644 index 000000000..eedfd42bb --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Token/Model/JwtConfigurationOptions.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Token.Model; + +public class JwtConfigurationOptions +{ + public string Issuer { get; set; } = default!; + + public string Audience { get; set; } = default!; + + public string SecurityKey { get; set; } = default!; +} diff --git a/src/Utils/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs b/src/Utils/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs new file mode 100644 index 000000000..972fb39f0 --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Token/ServiceCollectionExtensions.cs @@ -0,0 +1,15 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Microsoft.Extensions.DependencyInjection; + +public static class ServiceCollectionExtensions +{ + public static IServiceCollection AddJwt(this IServiceCollection services, Action options) + { + services.Configure(options); + services.TryAddScoped(); + new JwtUtils(services); + return services; + } +} diff --git a/src/Utils/Security/Masa.Utils.Security.Token/_Imports.cs b/src/Utils/Security/Masa.Utils.Security.Token/_Imports.cs new file mode 100644 index 000000000..418c9db5c --- /dev/null +++ b/src/Utils/Security/Masa.Utils.Security.Token/_Imports.cs @@ -0,0 +1,13 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.Utils.Security.Token; +global using Masa.Utils.Security.Token.Model; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.Extensions.Logging; +global using Microsoft.Extensions.Options; +global using Microsoft.IdentityModel.Tokens; +global using System.IdentityModel.Tokens.Jwt; +global using System.Security.Claims; +global using System.Text; diff --git a/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/AesTest.cs b/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/AesTest.cs new file mode 100644 index 000000000..dc39e8e7f --- /dev/null +++ b/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/AesTest.cs @@ -0,0 +1,30 @@ +using System; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography.Tests; + +[TestClass] +public class AesTest +{ + [TestMethod] + public void EncryptAndDecrypt() + { + string str = "Hello MASA Stack"; + string key = "12345678901234567890123456789021"; + var source = AesUtils.Decrypt(AesUtils.Encrypt(str, key), key); + Assert.IsTrue(str == source); + + var source2 = AesUtils.Decrypt(AesUtils.Encrypt(str)); + Assert.IsTrue(str == source2); + + var source3 = AesUtils.Decrypt(AesUtils.Encrypt(str, key, "123", FillType.Right), key, "123", FillType.Right); + Assert.IsTrue(str == source3); + + Assert.ThrowsException(() => AesUtils.Encrypt(str, key, "123", FillType.NoFile)); + + string encryptResult = AesUtils.Encrypt(str, key, "123", FillType.Right); + Assert.ThrowsException(() => AesUtils.Decrypt(encryptResult, key, "123", FillType.NoFile)); + } +} diff --git a/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/DesTest.cs b/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/DesTest.cs new file mode 100644 index 000000000..a33c2bc5b --- /dev/null +++ b/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/DesTest.cs @@ -0,0 +1,30 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; + +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +namespace Masa.Utils.Security.Cryptography.Tests +{ + [TestClass] + public class DesTest + { + [TestMethod] + public void EncryptAndDecrypt() + { + for (int i = 0; i < 10000; i++) + { + string str = new Random().Next(0, 1000000000).ToString(); + string key = "masastac"; + string iv = "masastack"; + var source = DesUtils.Decrypt(DesUtils.Encrypt(str, key), key); + var source2 = DesUtils.Decrypt(DesUtils.Encrypt(str, key, iv), key, iv); + var source3 = DesUtils.Decrypt(DesUtils.Encrypt(str, DESEncryType.Normal), DESEncryType.Normal); + + Assert.IsTrue(str == source); + Assert.IsTrue(str == source2); + Assert.IsTrue(str == source3); + } + } + } +} diff --git a/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj b/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj new file mode 100644 index 000000000..575b61e6a --- /dev/null +++ b/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/Masa.Utils.Security.Cryptography.Tests.csproj @@ -0,0 +1,22 @@ + + + + net6.0 + enable + + false + + + + + + + + + + + + + + + diff --git a/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/_Imports.cs b/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/_Imports.cs new file mode 100644 index 000000000..1109a8e81 --- /dev/null +++ b/src/Utils/Security/Tests/Masa.Utils.Security.Cryptography.Tests/_Imports.cs @@ -0,0 +1,4 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Microsoft.VisualStudio.TestTools.UnitTesting; From ced2544f13f3615a4223166da0258e3e454849c1 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 17:37:16 +0800 Subject: [PATCH 14/29] rename: Oidc rename to OpenIdConnect --- Masa.Framework.sln | 36 +++++++++---------- .../_Imports.cs | 5 --- .../Caches/IApiResourceCache.cs | 2 +- .../Caches/IApiScopeCache.cs | 2 +- .../Caches/IClientCache.cs | 2 +- .../Caches/IIdentityResourceCache.cs | 2 +- ...Authentication.OpenIdConnect.Cache.csproj} | 4 +-- .../_Imports.cs | 5 +++ .../Constants/GrantTypeConsts.cs | 2 +- .../Constants/GrantTypes.cs | 2 +- .../Entities/Abstract/Property.cs | 2 +- .../Entities/Abstract/Secret.cs | 2 +- .../Entities/ApiResource.cs | 2 +- .../Entities/ApiResourceClaim.cs | 2 +- .../Entities/ApiResourceProperty.cs | 2 +- .../Entities/ApiResourceScope.cs | 2 +- .../Entities/ApiResourceSecret.cs | 2 +- .../Entities/ApiScope.cs | 2 +- .../Entities/ApiScopeClaim.cs | 2 +- .../Entities/ApiScopeProperty.cs | 2 +- .../Entities/Client.cs | 2 +- .../Entities/ClientClaim.cs | 2 +- .../Entities/ClientCorsOrigin.cs | 2 +- .../Entities/ClientGrantType.cs | 2 +- .../Entities/ClientIdPRestriction.cs | 2 +- .../Entities/ClientPostLogoutRedirectUri.cs | 2 +- .../Entities/ClientProperty.cs | 2 +- .../Entities/ClientRedirectUri.cs | 2 +- .../Entities/ClientScope.cs | 2 +- .../Entities/ClientSecret.cs | 2 +- .../Entities/DeviceFlowCodes.cs | 2 +- .../Entities/IdentityResource.cs | 2 +- .../Entities/IdentityResourceClaim.cs | 2 +- .../Entities/IdentityResourceProperty.cs | 2 +- .../Entities/PersistedGrant.cs | 2 +- .../Entities/UserClaim.cs | 2 +- .../Enums/ClientTypes.cs | 2 +- .../Enums/TokenExpiration.cs | 2 +- .../Enums/TokenUsage.cs | 2 +- ...uthentication.OpenIdConnect.Domain.csproj} | 1 - .../Repositories/IApiResourceRepository.cs | 2 +- .../Repositories/IApiScopeRepository.cs | 2 +- .../Repositories/IClientRepository.cs | 2 +- .../IIdentityResourceRepository.cs | 2 +- .../Repositories/IRepositoryBase.cs | 2 +- .../Repositories/IUserClaimRepository.cs | 2 +- .../_Imports.cs | 8 ++--- .../Constans/GrantType.cs | 2 +- .../Constans/GrantTypes.cs | 2 +- .../Constans/StandardIdentityResources.cs | 2 +- .../Constans/StandardUserClaims.cs | 2 +- .../Enums/AccessTokenType.cs | 2 +- .../Enums/TokenExpiration.cs | 2 +- .../Enums/TokenUsage.cs | 2 +- ...uthentication.OpenIdConnect.Models.csproj} | 0 .../Models/ApiResourceModel.cs | 2 +- .../Models/ApiScopeModel.cs | 2 +- .../Models/ClientClaimModel.cs | 2 +- .../Models/ClientModel.cs | 2 +- .../Models/DeviceCodeModel.cs | 2 +- .../Models/GrantType.cs | 2 +- .../Models/IdentityResourceModel.cs | 2 +- .../Models/PersistedGrantFilter.cs | 4 +-- .../Models/PersistedGrantModel.cs | 2 +- .../Models/ResourceModel.cs | 2 +- .../Models/ResourcesModel.cs | 2 +- .../Models/SecretModel.cs | 2 +- .../_Imports.cs | 4 +-- ...thentication.OpenIdConnect.Storage.csproj} | 2 +- .../Stores/IClientStore.cs | 2 +- .../Stores/IDeviceFlowStore.cs | 2 +- .../Stores/IPersistedGrantStore.cs | 2 +- .../Stores/IResourceStore.cs | 2 +- .../_Imports.cs | 2 +- .../_Imports.cs | 9 ----- .../_Imports.cs | 14 -------- .../_Imports.cs | 16 --------- ...cation.OpenIdConnect.Cache.Storage.csproj} | 4 +-- .../README.md | 6 ++-- .../README.zh-CN.md | 6 ++-- .../ServiceCollectionExtensions.cs | 2 +- .../Stores/ClientStore.cs | 2 +- .../Stores/DeviceFlowStore.cs | 2 +- .../Stores/PersistedGrantStore.cs | 2 +- .../Stores/ResourceStore.cs | 2 +- .../_Imports.cs | 10 ++++++ .../Caches/ApiResourceCache.cs | 2 +- .../Caches/ApiScopeCache.cs | 2 +- .../Caches/ClientCache.cs | 2 +- .../Caches/IdentityResourceCache.cs | 4 +-- ...Authentication.OpenIdConnect.Cache.csproj} | 2 +- .../Models/CacheKeyConstants.cs | 2 +- .../Models/Mapper.cs | 2 +- .../README.md | 6 ++-- .../README.zh-CN.md | 6 ++-- .../ServiceCollectionExtensions.cs | 0 .../Utils/CollectionExtensions.cs | 2 +- .../_Imports.cs | 14 ++++++++ .../Caches/SyncCache.cs | 2 +- .../DbContexts/OidcDbContext.cs | 2 +- ...ApiResourceClaimEntityTypeConfiguration.cs | 2 +- .../ApiResourceEntityTypeConfiguration.cs | 2 +- ...ResourcePropertyEntityTypeConfiguration.cs | 2 +- ...ApiResourceScopeEntityTypeConfiguration.cs | 2 +- ...piResourceSecretEntityTypeConfiguration.cs | 2 +- .../ApiScopeClaimEntityTypeConfiguration.cs | 2 +- .../ApiScopeEntityTypeConfiguration.cs | 2 +- ...ApiScopePropertyEntityTypeConfiguration.cs | 2 +- .../ClientClaimEntityTypeConfiguration.cs | 2 +- ...ClientCorsOriginEntityTypeConfiguration.cs | 2 +- .../ClientEntityTypeConfiguration.cs | 2 +- .../ClientGrantTypeEntityTypeConfiguration.cs | 2 +- ...ntIdPRestrictionEntityTypeConfiguration.cs | 2 +- ...ogoutRedirectUriEntityTypeConfiguration.cs | 2 +- .../ClientPropertyEntityTypeConfiguration.cs | 2 +- ...lientRedirectUriEntityTypeConfiguration.cs | 2 +- .../ClientScopeEntityTypeConfiguration.cs | 2 +- .../ClientSecretEntityTypeConfiguration.cs | 2 +- .../DeviceFlowCodesEntityTypeConfiguration.cs | 2 +- ...ityResourceClaimEntityTypeConfiguration.cs | 2 +- ...IdentityResourceEntityTypeConfiguration.cs | 2 +- ...ResourcePropertyEntityTypeConfiguration.cs | 2 +- .../PersistedGrantEntityTypeConfiguration.cs | 2 +- .../UserClaimEntityTypeConfiguration.cs | 2 +- ....OpenIdConnect.EntityFrameworkCore.csproj} | 2 +- .../Options/OidcDbContextOptions.cs | 2 +- .../README.md | 6 ++-- .../README.zh-CN.md | 6 ++-- .../Repositories/ApiResourceRepository.cs | 2 +- .../Repositories/ApiScopeRepository.cs | 2 +- .../Repositories/ClientRepository.cs | 2 +- .../IdentityResourceRepository.cs | 2 +- .../Repositories/UserClaimRepository.cs | 2 +- .../ServiceCollectionExtensions.cs | 6 ++-- .../_Imports.cs | 16 +++++++++ 135 files changed, 208 insertions(+), 208 deletions(-) delete mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Cache => Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache}/Caches/IApiResourceCache.cs (87%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Cache => Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache}/Caches/IApiScopeCache.cs (87%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Cache => Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache}/Caches/IClientCache.cs (86%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Cache => Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache}/Caches/IIdentityResourceCache.cs (88%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj => Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.csproj} (66%) create mode 100644 src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/_Imports.cs rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Constants/GrantTypeConsts.cs (94%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Constants/GrantTypes.cs (87%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/Abstract/Property.cs (78%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/Abstract/Secret.cs (84%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ApiResource.cs (97%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ApiResourceClaim.cs (87%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ApiResourceProperty.cs (84%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ApiResourceScope.cs (87%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ApiResourceSecret.cs (80%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ApiScope.cs (96%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ApiScopeClaim.cs (87%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ApiScopeProperty.cs (84%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/Client.cs (98%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ClientClaim.cs (84%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ClientCorsOrigin.cs (82%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ClientGrantType.cs (85%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ClientIdPRestriction.cs (82%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ClientPostLogoutRedirectUri.cs (87%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ClientProperty.cs (84%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ClientRedirectUri.cs (85%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ClientScope.cs (84%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/ClientSecret.cs (79%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/DeviceFlowCodes.cs (96%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/IdentityResource.cs (96%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/IdentityResourceClaim.cs (87%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/IdentityResourceProperty.cs (86%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/PersistedGrant.cs (90%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Entities/UserClaim.cs (87%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Enums/ClientTypes.cs (77%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Enums/TokenExpiration.cs (84%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Enums/TokenUsage.cs (85%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.csproj} (79%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Repositories/IApiResourceRepository.cs (73%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Repositories/IApiScopeRepository.cs (72%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Repositories/IClientRepository.cs (72%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Repositories/IIdentityResourceRepository.cs (77%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Repositories/IRepositoryBase.cs (90%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/Repositories/IUserClaimRepository.cs (76%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Domain => Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain}/_Imports.cs (52%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Constans/GrantType.cs (88%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Constans/GrantTypes.cs (94%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Constans/StandardIdentityResources.cs (97%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Constans/StandardUserClaims.cs (97%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Enums/AccessTokenType.cs (79%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Enums/TokenExpiration.cs (80%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Enums/TokenUsage.cs (81%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.csproj} (100%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/ApiResourceModel.cs (95%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/ApiScopeModel.cs (93%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/ClientClaimModel.cs (95%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/ClientModel.cs (99%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/DeviceCodeModel.cs (97%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/GrantType.cs (90%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/IdentityResourceModel.cs (94%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/PersistedGrantFilter.cs (93%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/PersistedGrantModel.cs (97%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/ResourceModel.cs (89%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/ResourcesModel.cs (95%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/Models/SecretModel.cs (93%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Models => Masa.BuildingBlocks.Authentication.OpenIdConnect.Models}/_Imports.cs (66%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj => Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.csproj} (83%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Storage => Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage}/Stores/IClientStore.cs (84%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Storage => Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage}/Stores/IDeviceFlowStore.cs (95%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Storage => Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage}/Stores/IPersistedGrantStore.cs (94%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Storage => Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage}/Stores/IResourceStore.cs (94%) rename src/BuildingBlocks/Authentication/OpenIdConnect/{Masa.BuildingBlocks.Authentication.Oidc.Storage => Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage}/_Imports.cs (65%) delete mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs delete mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs delete mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj => Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj} (62%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache.Storage => Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage}/README.md (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache.Storage => Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage}/README.zh-CN.md (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache.Storage => Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage}/ServiceCollectionExtensions.cs (90%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache.Storage => Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage}/Stores/ClientStore.cs (88%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache.Storage => Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage}/Stores/DeviceFlowStore.cs (92%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache.Storage => Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage}/Stores/PersistedGrantStore.cs (91%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache.Storage => Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage}/Stores/ResourceStore.cs (96%) create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/_Imports.cs rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/Caches/ApiResourceCache.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/Caches/ApiScopeCache.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/Caches/ClientCache.cs (96%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/Caches/IdentityResourceCache.cs (96%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj => Masa.Contrib.Authentication.OpenIdConnect.Cache/Masa.Contrib.Authentication.OpenIdConnect.Cache.csproj} (79%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/Models/CacheKeyConstants.cs (86%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/Models/Mapper.cs (98%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/README.md (85%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/README.zh-CN.md (85%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/ServiceCollectionExtensions.cs (100%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.Cache => Masa.Contrib.Authentication.OpenIdConnect.Cache}/Utils/CollectionExtensions.cs (96%) create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/_Imports.cs rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/Caches/SyncCache.cs (98%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/DbContexts/OidcDbContext.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs (79%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs (93%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs (80%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs (85%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs (80%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs (89%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientEntityTypeConfiguration.cs (95%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs (80%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs (84%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs (93%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs (90%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs (84%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs (93%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/EntityConfigurations/UserClaimEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj} (82%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/Options/OidcDbContextOptions.cs (94%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/README.md (79%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/README.zh-CN.md (78%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/Repositories/ApiResourceRepository.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/Repositories/ApiScopeRepository.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/Repositories/ClientRepository.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/Repositories/IdentityResourceRepository.cs (98%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/Repositories/UserClaimRepository.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.Oidc.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore}/ServiceCollectionExtensions.cs (94%) create mode 100644 src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/_Imports.cs diff --git a/Masa.Framework.sln b/Masa.Framework.sln index ce00f48ab..8f3c66990 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -83,11 +83,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1987405B EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests", "src\BuildingBlocks\SearchEngine\Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests\Masa.BuildingBlocks.SearchEngine.AutoComplete.Tests.csproj", "{412A5797-7D42-4F7C-96AB-4F784872ED08}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Cache", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Cache\Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj", "{2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache\Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.csproj", "{2730D483-5E03-43EA-B8AA-D9EB1BAC77C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Domain", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Domain\Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj", "{E50AD1BC-69B0-4E51-94CB-72AB10761710}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain\Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.csproj", "{E50AD1BC-69B0-4E51-94CB-72AB10761710}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Storage", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Storage\Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj", "{0D395B3E-D603-49C3-AD80-B53979EDF9E1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage\Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.csproj", "{0D395B3E-D603-49C3-AD80-B53979EDF9E1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\Authentication\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{249E8BD4-C358-4358-93FA-78320D335014}" EndProject @@ -247,11 +247,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{62E8 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenIdConnect", "OpenIdConnect", "{41769FBF-91A8-48D1-B3BB-CAE4C814E7CD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.Oidc.Cache\Masa.Contrib.Authentication.Oidc.Cache.csproj", "{B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.OpenIdConnect.Cache", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.Cache\Masa.Contrib.Authentication.OpenIdConnect.Cache.csproj", "{B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.Cache.Storage", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.Oidc.Cache.Storage\Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj", "{4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Oidc.EntityFrameworkCore", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore\Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj", "{3532E374-C922-4B79-93CA-2B0E4CC14FB9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore\Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj", "{3532E374-C922-4B79-93CA-2B0E4CC14FB9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel", "src\Contrib\Authentication\Masa.Contrib.Identity.IdentityModel\Masa.Contrib.Identity.IdentityModel.csproj", "{DF784809-63B1-44EF-802E-CCCB1FFAA557}" EndProject @@ -531,9 +529,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{4231AB12 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests", "src\Contrib\Storage\ObjectStorage\Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests\Masa.Contrib.Storage.ObjectStorage.Aliyun.Tests.csproj", "{C65638DC-2418-4453-917F-9FA8D068594E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Oidc.Models", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.Oidc.Models\Masa.BuildingBlocks.Authentication.Oidc.Models.csproj", "{9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.OpenIdConnect.Models", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.OpenIdConnect.Models\Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.csproj", "{9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj", "{1E82EC06-25F3-49E2-BAB6-978CE2896ACC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1079,14 +1079,6 @@ Global {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Release|Any CPU.Build.0 = Release|Any CPU {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Release|x64.ActiveCfg = Release|Any CPU {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}.Release|x64.Build.0 = Release|Any CPU - {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Debug|x64.ActiveCfg = Debug|Any CPU - {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Debug|x64.Build.0 = Debug|Any CPU - {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Release|Any CPU.Build.0 = Release|Any CPU - {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Release|x64.ActiveCfg = Release|Any CPU - {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4}.Release|x64.Build.0 = Release|Any CPU {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Debug|Any CPU.Build.0 = Debug|Any CPU {3532E374-C922-4B79-93CA-2B0E4CC14FB9}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1887,6 +1879,14 @@ Global {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|Any CPU.Build.0 = Release|Any CPU {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|x64.ActiveCfg = Release|Any CPU {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|x64.Build.0 = Release|Any CPU + {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Debug|x64.ActiveCfg = Debug|Any CPU + {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Debug|x64.Build.0 = Debug|Any CPU + {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Release|Any CPU.Build.0 = Release|Any CPU + {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Release|x64.ActiveCfg = Release|Any CPU + {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2007,7 +2007,6 @@ Global {62E888C1-9FCD-413D-91CB-1F2DD3D356E3} = {950DA7D0-48C1-42BA-8E8F-F72C0DCE41C4} {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} = {3198630F-C09B-40AE-B9A1-E79249296E48} {B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} - {4E8F809F-BF45-4E61-AFEA-2027EE74BFF4} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} {3532E374-C922-4B79-93CA-2B0E4CC14FB9} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} {DF784809-63B1-44EF-802E-CCCB1FFAA557} = {3198630F-C09B-40AE-B9A1-E79249296E48} {94D15C26-7204-4299-BC23-B89F5A0B0BF9} = {3198630F-C09B-40AE-B9A1-E79249296E48} @@ -2150,6 +2149,7 @@ Global {C65638DC-2418-4453-917F-9FA8D068594E} = {4231AB12-3FB7-408E-B7C2-9CC0FFB710B1} {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} + {1E82EC06-25F3-49E2-BAB6-978CE2896ACC} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs deleted file mode 100644 index f9859df48..000000000 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/_Imports.cs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IApiResourceCache.cs similarity index 87% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IApiResourceCache.cs index 92c5a5390..420a61292 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiResourceCache.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IApiResourceCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.Caches; public interface IApiResourceCache { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IApiScopeCache.cs similarity index 87% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IApiScopeCache.cs index 07002b1ac..7c29c1854 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IApiScopeCache.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IApiScopeCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.Caches; public interface IApiScopeCache { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IClientCache.cs similarity index 86% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IClientCache.cs index f0e2ac840..5b2fd64a7 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IClientCache.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IClientCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.Caches; public interface IClientCache { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IIdentityResourceCache.cs similarity index 88% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IIdentityResourceCache.cs index 7c0ef59c1..25ca60ac6 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Caches/IIdentityResourceCache.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Caches/IIdentityResourceCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.Caches; public interface IIdentityResourceCache { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.csproj similarity index 66% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.csproj index 060949ec2..08f6e6fb2 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Cache/Masa.BuildingBlocks.Authentication.Oidc.Cache.csproj +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/_Imports.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/_Imports.cs new file mode 100644 index 000000000..1e6e55b96 --- /dev/null +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache/_Imports.cs @@ -0,0 +1,5 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Constants/GrantTypeConsts.cs similarity index 94% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Constants/GrantTypeConsts.cs index 962779103..453ffb5c0 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypeConsts.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Constants/GrantTypeConsts.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Constants; public class GrantTypeConsts { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Constants/GrantTypes.cs similarity index 87% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Constants/GrantTypes.cs index d6e49be2d..c8b7a72ea 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Constants/GrantTypes.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Constants/GrantTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Constants; public static class GrantTypes { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/Abstract/Property.cs similarity index 78% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/Abstract/Property.cs index a76ab6f88..21e0fc4ee 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Property.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/Abstract/Property.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities.Abstract; public abstract class Property : Entity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/Abstract/Secret.cs similarity index 84% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/Abstract/Secret.cs index d317f503b..79fc71903 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Abstract/Secret.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/Abstract/Secret.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities.Abstract; public abstract class Secret : FullEntity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResource.cs similarity index 97% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResource.cs index c953e82d5..5c48d1687 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResource.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResource.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ApiResource : FullAggregateRoot { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceClaim.cs similarity index 87% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceClaim.cs index 0188babe4..d9c30f5d3 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceClaim.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceClaim.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ApiResourceClaim : FullEntity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceProperty.cs similarity index 84% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceProperty.cs index 8dde202ac..16cd0f738 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceProperty.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceProperty.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ApiResourceProperty : Property { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceScope.cs similarity index 87% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceScope.cs index 745deb01a..a56c231fb 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceScope.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceScope.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ApiResourceScope : FullEntity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceSecret.cs similarity index 80% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceSecret.cs index aef627684..1770eca2f 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiResourceSecret.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiResourceSecret.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ApiResourceSecret : Secret { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiScope.cs similarity index 96% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiScope.cs index b2d6c400f..dc15eaac8 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScope.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiScope.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ApiScope : FullAggregateRoot { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiScopeClaim.cs similarity index 87% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiScopeClaim.cs index 613e08be7..25a0fa2f8 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeClaim.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiScopeClaim.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ApiScopeClaim : FullEntity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiScopeProperty.cs similarity index 84% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiScopeProperty.cs index 9b49e1e00..753d018ad 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ApiScopeProperty.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ApiScopeProperty.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ApiScopeProperty : Property { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/Client.cs similarity index 98% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/Client.cs index 535e3a8ee..00b800432 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/Client.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/Client.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class Client : FullAggregateRoot { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientClaim.cs similarity index 84% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientClaim.cs index a95e140f4..372a27aca 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientClaim.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientClaim.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ClientClaim : Entity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientCorsOrigin.cs similarity index 82% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientCorsOrigin.cs index 942460995..bc1f4f1b0 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientCorsOrigin.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientCorsOrigin.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ClientCorsOrigin : Entity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientGrantType.cs similarity index 85% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientGrantType.cs index aa6124fc9..254514724 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientGrantType.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientGrantType.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ClientGrantType : Entity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientIdPRestriction.cs similarity index 82% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientIdPRestriction.cs index 61ed181a8..6f8d702ec 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientIdPRestriction.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientIdPRestriction.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ClientIdPRestriction : Entity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientPostLogoutRedirectUri.cs similarity index 87% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientPostLogoutRedirectUri.cs index b50256c26..8ffe44796 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientPostLogoutRedirectUri.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientPostLogoutRedirectUri.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ClientPostLogoutRedirectUri : Entity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientProperty.cs similarity index 84% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientProperty.cs index 8d78e460b..22957d6af 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientProperty.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientProperty.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ClientProperty : Property { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientRedirectUri.cs similarity index 85% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientRedirectUri.cs index 7d0016b87..efdab8389 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientRedirectUri.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientRedirectUri.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ClientRedirectUri : Entity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientScope.cs similarity index 84% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientScope.cs index 051e242b1..e8660691a 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientScope.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientScope.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ClientScope : Entity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientSecret.cs similarity index 79% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientSecret.cs index 415646d32..64af8ba75 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/ClientSecret.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/ClientSecret.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class ClientSecret : Secret { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/DeviceFlowCodes.cs similarity index 96% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/DeviceFlowCodes.cs index 5607d7399..4695cb64c 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/DeviceFlowCodes.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/DeviceFlowCodes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class DeviceFlowCodes : FullAggregateRoot { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/IdentityResource.cs similarity index 96% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/IdentityResource.cs index e947153b2..7ec13eb02 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResource.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/IdentityResource.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class IdentityResource : FullAggregateRoot { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/IdentityResourceClaim.cs similarity index 87% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/IdentityResourceClaim.cs index d8f4fa9f6..f28d34e73 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceClaim.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/IdentityResourceClaim.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class IdentityResourceClaim : FullEntity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/IdentityResourceProperty.cs similarity index 86% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/IdentityResourceProperty.cs index 88b21d15c..09f813999 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/IdentityResourceProperty.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/IdentityResourceProperty.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities { public class IdentityResourceProperty : Property { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/PersistedGrant.cs similarity index 90% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/PersistedGrant.cs index 2ceeced09..826508c22 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/PersistedGrant.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/PersistedGrant.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class PersistedGrant : FullAggregateRoot { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/UserClaim.cs similarity index 87% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/UserClaim.cs index 669417c56..a98d86e12 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Entities/UserClaim.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Entities/UserClaim.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; public class UserClaim : FullAggregateRoot { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Enums/ClientTypes.cs similarity index 77% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Enums/ClientTypes.cs index d4882f57d..e53327c85 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/ClientTypes.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Enums/ClientTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Enums; public enum ClientTypes { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Enums/TokenExpiration.cs similarity index 84% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Enums/TokenExpiration.cs index 410ac838f..5bf84ccf8 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenExpiration.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Enums/TokenExpiration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Enums; /// /// Token expiration types. diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Enums/TokenUsage.cs similarity index 85% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Enums/TokenUsage.cs index 67eaa8040..40fc5b455 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Enums/TokenUsage.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Enums/TokenUsage.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Enums; /// /// Token usage types. diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.csproj similarity index 79% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.csproj index 26768b3ee..5bb160f5a 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Masa.BuildingBlocks.Authentication.Oidc.Domain.csproj +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.csproj @@ -4,7 +4,6 @@ net6.0 enable enable - Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IApiResourceRepository.cs similarity index 73% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IApiResourceRepository.cs index c7118c570..8c7c25f2e 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiResourceRepository.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IApiResourceRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Repositories; public interface IApiResourceRepository : IRepositoryBase { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IApiScopeRepository.cs similarity index 72% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IApiScopeRepository.cs index 6d5822e83..4be1b099c 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IApiScopeRepository.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IApiScopeRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Repositories; public interface IApiScopeRepository : IRepositoryBase { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IClientRepository.cs similarity index 72% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IClientRepository.cs index 31c686ff4..815bb7e26 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IClientRepository.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IClientRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Repositories; public interface IClientRepository : IRepositoryBase { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IIdentityResourceRepository.cs similarity index 77% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IIdentityResourceRepository.cs index f70b7ab4d..4c70e12d3 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IIdentityResourceRepository.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IIdentityResourceRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Repositories; public interface IIdentityResourceRepository : IRepositoryBase { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IRepositoryBase.cs similarity index 90% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IRepositoryBase.cs index a15fceae5..33906f8e2 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IRepositoryBase.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IRepositoryBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Repositories; public interface IRepositoryBase where TEntity : class, IEntity { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IUserClaimRepository.cs similarity index 76% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IUserClaimRepository.cs index 2a884f1fb..d1b3bf773 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/Repositories/IUserClaimRepository.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/Repositories/IUserClaimRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Repositories; public interface IUserClaimRepository : IRepositoryBase { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/_Imports.cs similarity index 52% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/_Imports.cs index 623152bd2..a7f381493 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Domain/_Imports.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain/_Imports.cs @@ -1,10 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Constants; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities.Abstract; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Enums; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Constants; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities.Abstract; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Enums; global using Masa.BuildingBlocks.Ddd.Domain.Entities; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Full; global using Masa.BuildingBlocks.Ddd.Domain.Repositories; diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/GrantType.cs similarity index 88% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/GrantType.cs index 900f0e698..bf352ee2b 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantType.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/GrantType.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Constans; public static class GrantType { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/GrantTypes.cs similarity index 94% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/GrantTypes.cs index dbcd5e530..fa8bcb62b 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/GrantTypes.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/GrantTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Constans; public class GrantTypes { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/StandardIdentityResources.cs similarity index 97% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/StandardIdentityResources.cs index b1dc32a84..e0bd52a9f 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardIdentityResources.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/StandardIdentityResources.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Constans; public class StandardIdentityResources { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/StandardUserClaims.cs similarity index 97% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/StandardUserClaims.cs index f6b2d8ed9..a9dc46b3d 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Constans/StandardUserClaims.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Constans/StandardUserClaims.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Constans; public static class StandardUserClaims { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Enums/AccessTokenType.cs similarity index 79% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Enums/AccessTokenType.cs index f49e96f2b..c7d0da0d5 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/AccessTokenType.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Enums/AccessTokenType.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Enums; public enum AccessTokenType { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Enums/TokenExpiration.cs similarity index 80% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Enums/TokenExpiration.cs index 8a3e0dd6f..dc21867cc 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenExpiration.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Enums/TokenExpiration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Enums; public enum TokenExpiration { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Enums/TokenUsage.cs similarity index 81% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Enums/TokenUsage.cs index 52ffd7eff..e27ab5419 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Enums/TokenUsage.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Enums/TokenUsage.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Enums; public enum TokenUsage { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.csproj similarity index 100% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Masa.BuildingBlocks.Authentication.Oidc.Models.csproj rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.csproj diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ApiResourceModel.cs similarity index 95% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ApiResourceModel.cs index 7e27dd894..484bbf608 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiResourceModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ApiResourceModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; public class ApiResourceModel : ResourceModel { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ApiScopeModel.cs similarity index 93% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ApiScopeModel.cs index 584292172..28562aaca 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ApiScopeModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ApiScopeModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; public class ApiScopeModel : ResourceModel { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ClientClaimModel.cs similarity index 95% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ClientClaimModel.cs index 7b37e0dba..6ef78f6ca 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientClaimModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ClientClaimModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; public class ClientClaimModel { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ClientModel.cs similarity index 99% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ClientModel.cs index d9522b574..5509c75a6 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ClientModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ClientModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; public class ClientModel { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/DeviceCodeModel.cs similarity index 97% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/DeviceCodeModel.cs index a8762ad57..3807bb650 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/DeviceCodeModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/DeviceCodeModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; /// /// Represents data needed for device flow. diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/GrantType.cs similarity index 90% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/GrantType.cs index 5e74f68c7..d5db09b60 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/GrantType.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/GrantType.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; public class GrantType { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/IdentityResourceModel.cs similarity index 94% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/IdentityResourceModel.cs index 523a33b30..49e960efb 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/IdentityResourceModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/IdentityResourceModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; public class IdentityResourceModel : ResourceModel { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/PersistedGrantFilter.cs similarity index 93% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/PersistedGrantFilter.cs index b59ec207f..729bc4a7f 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantFilter.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/PersistedGrantFilter.cs @@ -1,10 +1,10 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; /// -/// Represents a filter used when accessing the persisted grants store. +/// Represents a filter used when accessing the persisted grants store. /// Setting multiple properties is interpreted as a logical 'AND' to further filter the query. /// At least one value must be supplied. /// diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/PersistedGrantModel.cs similarity index 97% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/PersistedGrantModel.cs index 8616114a4..9d5daa646 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/PersistedGrantModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/PersistedGrantModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; /// /// A model for a persisted grant diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ResourceModel.cs similarity index 89% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ResourceModel.cs index a9da1fd8d..9ac0440b8 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourceModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ResourceModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; public abstract class ResourceModel { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ResourcesModel.cs similarity index 95% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ResourcesModel.cs index 44df9f5bf..b956d4066 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/ResourcesModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/ResourcesModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; public class ResourcesModel { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/SecretModel.cs similarity index 93% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/SecretModel.cs index 77406b319..54fb9d9a8 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/Models/SecretModel.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/Models/SecretModel.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; public class SecretModel { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/_Imports.cs similarity index 66% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/_Imports.cs index e5b433234..3a1a2c45c 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Models/_Imports.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Models/_Imports.cs @@ -1,8 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Enums; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; global using System.ComponentModel; global using System.Diagnostics.CodeAnalysis; global using System.Reflection; diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.csproj similarity index 83% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.csproj index ed98caad6..3b99bb1f9 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Masa.BuildingBlocks.Authentication.Oidc.Storage.csproj +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IClientStore.cs similarity index 84% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IClientStore.cs index 976845a60..e47b1617a 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IClientStore.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IClientStore.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.Stores; public interface IClientStore { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IDeviceFlowStore.cs similarity index 95% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IDeviceFlowStore.cs index 4875f3ea4..a24891fdb 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IDeviceFlowStore.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IDeviceFlowStore.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.Stores; /// /// Interface for the device flow store diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IPersistedGrantStore.cs similarity index 94% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IPersistedGrantStore.cs index b08e71f14..c7fa16e44 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IPersistedGrantStore.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IPersistedGrantStore.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.Stores; /// /// Interface for persisting any type of grant. diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IResourceStore.cs similarity index 94% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IResourceStore.cs index 45aebca13..8460914b0 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/Stores/IResourceStore.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/Stores/IResourceStore.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; +namespace Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.Stores; public interface IResourceStore { diff --git a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/_Imports.cs similarity index 65% rename from src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs rename to src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/_Imports.cs index c045e84b7..acd7ca0e9 100644 --- a/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.Oidc.Storage/_Imports.cs +++ b/src/BuildingBlocks/Authentication/OpenIdConnect/Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage/_Imports.cs @@ -1,4 +1,4 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs deleted file mode 100644 index 111ca2413..000000000 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/_Imports.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; -global using Masa.BuildingBlocks.Authentication.Oidc.Storage.Stores; -global using Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; -global using Microsoft.Extensions.DependencyInjection; -global using Masa.Utils.Caching.Redis.Models; diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs deleted file mode 100644 index bf854463c..000000000 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/_Imports.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Enums; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Models; -global using Masa.Contrib.Authentication.Oidc.Cache.Caches; -global using Masa.Contrib.Authentication.Oidc.Cache.Models; -global using Masa.Contrib.Authentication.Oidc.Cache.Utils; -global using Masa.Utils.Caching.DistributedMemory.DependencyInjection; -global using Masa.Utils.Caching.DistributedMemory.Interfaces; -global using Masa.Utils.Caching.Redis.Models; -global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs deleted file mode 100644 index 905a8f086..000000000 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/_Imports.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) MASA Stack All rights reserved. -// Licensed under the MIT License. See LICENSE.txt in the project root for license information. - -global using Masa.BuildingBlocks.Authentication.Oidc.Cache.Caches; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Entities; -global using Masa.BuildingBlocks.Authentication.Oidc.Domain.Repositories; -global using Masa.BuildingBlocks.Authentication.Oidc.Models.Constans; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Caches; -global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.DbContexts; -global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Options; -global using Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Metadata.Builders; -global using Microsoft.Extensions.DependencyInjection; -global using System.Linq.Expressions; diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj similarity index 62% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj index d71eab6fd..2cfd9b300 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Masa.Contrib.Authentication.Oidc.Cache.Storage.csproj +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/README.md similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/README.md index 7c54883d0..38483552f 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.md +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/README.md @@ -1,6 +1,6 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Authentication.Oidc.Cache.Storage +## Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage Effect: @@ -14,7 +14,7 @@ Use IClientStore and IResourceStore get oidc resources and client data. Example: ```C# -Install-Package Masa.Contrib.Authentication.Oidc.Cache.Storage +Install-Package Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage ``` ```C# @@ -38,7 +38,7 @@ How to use: ```c# var app = builder.Build(); -app.MapGet("/GetClient", async ([FromServices] IClientStore store) => +app.MapGet("/GetClient", async ([FromServices] IClientStore store) => { return await store.FindClientByIdAsync("clientId"); }); diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/README.zh-CN.md similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/README.zh-CN.md index 7d050dabb..3022cffb2 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/README.zh-CN.md +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/README.zh-CN.md @@ -1,6 +1,6 @@ 中 | [EN](README.md) -## Masa.Contrib.Authentication.Oidc.Cache.Storag +## Masa.Contrib.Authentication.OpenIdConnect.Cache.Storag 作用: @@ -14,7 +14,7 @@ 用例: ```C# -Install-Package Masa.Contrib.Authentication.Oidc.Cache.Storag +Install-Package Masa.Contrib.Authentication.OpenIdConnect.Cache.Storag ``` ```C# @@ -38,7 +38,7 @@ builder.Services.AddOidcCacheStorage(nnew RedisConfigurationOptions ```c# var app = builder.Build(); -app.MapGet("/GetClient", async ([FromServices] IClientStore store) => +app.MapGet("/GetClient", async ([FromServices] IClientStore store) => { return await store.FindClientByIdAsync("clientId"); }); diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/ServiceCollectionExtensions.cs similarity index 90% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/ServiceCollectionExtensions.cs index 850232a68..9a75292f3 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/ServiceCollectionExtensions.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/ServiceCollectionExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage; public static class ServiceCollectionExtensions { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/ClientStore.cs similarity index 88% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/ClientStore.cs index bd2ad9e71..1a3798842 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ClientStore.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/ClientStore.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.Stores; public class ClientStore : IClientStore { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/DeviceFlowStore.cs similarity index 92% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/DeviceFlowStore.cs index 2e6f65101..17dd998c2 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/DeviceFlowStore.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/DeviceFlowStore.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.Stores; public class DeviceFlowStore : IDeviceFlowStore { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/PersistedGrantStore.cs similarity index 91% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/PersistedGrantStore.cs index ebab3a890..0c2ff3dcc 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/PersistedGrantStore.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/PersistedGrantStore.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.Stores; public class PersistedGrantStore : IPersistedGrantStore { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/ResourceStore.cs similarity index 96% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/ResourceStore.cs index 856805159..81518d2ae 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache.Storage/Stores/ResourceStore.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/Stores/ResourceStore.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Storage.Stores; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.Stores; public class ResourceStore : IResourceStore { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/_Imports.cs new file mode 100644 index 000000000..e713fbafe --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage/_Imports.cs @@ -0,0 +1,10 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.Caches; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.Stores; +global using Masa.Contrib.Authentication.Oidc.Cache; +global using Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.Stores; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/ApiResourceCache.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/ApiResourceCache.cs index 1a5afadc8..6c363d4af 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiResourceCache.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/ApiResourceCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Caches; public class ApiResourceCache : IApiResourceCache { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/ApiScopeCache.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/ApiScopeCache.cs index 7ffdab3f5..a87684aea 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ApiScopeCache.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/ApiScopeCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Caches; public class ApiScopeCache : IApiScopeCache { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/ClientCache.cs similarity index 96% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/ClientCache.cs index 3cb9e950a..4371247ba 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/ClientCache.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/ClientCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Caches; public class ClientCache : IClientCache { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/IdentityResourceCache.cs similarity index 96% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/IdentityResourceCache.cs index ad250936c..6bc994cae 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Caches/IdentityResourceCache.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Caches/IdentityResourceCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Caches; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Caches; public class IdentityResourceCache : IIdentityResourceCache { @@ -57,7 +57,7 @@ public async Task RemoveAsync(IdentityResource identityResource) public async Task ResetAsync(IEnumerable identityResources) { var map = identityResources.ToDictionary(identityResource => FormatKey(identityResource), identityResource => identityResource.ToModel()); - await _memoryCacheClient.SetListAsync(map); + await _memoryCacheClient.SetListAsync(map); await UpdateListAsync(map.Values); } diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Masa.Contrib.Authentication.OpenIdConnect.Cache.csproj similarity index 79% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Masa.Contrib.Authentication.OpenIdConnect.Cache.csproj index 49037dd72..9cb492083 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Masa.Contrib.Authentication.Oidc.Cache.csproj +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Masa.Contrib.Authentication.OpenIdConnect.Cache.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Models/CacheKeyConstants.cs similarity index 86% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Models/CacheKeyConstants.cs index c5d9e6a1e..a6751551b 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/CacheKeyConstants.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Models/CacheKeyConstants.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Models; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Models; public static class CacheKeyConstants { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Models/Mapper.cs similarity index 98% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Models/Mapper.cs index 7945f9ab1..e4e21c48b 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Models/Mapper.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Models/Mapper.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Models; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Models; public static class Mapper { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/README.md similarity index 85% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.md rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/README.md index 888728030..42f3d5a7c 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.md +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/README.md @@ -1,6 +1,6 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Authentication.Oidc.Cache +## Masa.Contrib.Authentication.OpenIdConnect.Cache Effect: @@ -16,7 +16,7 @@ Use the second level cache to operate resources and client data. Example: ```C# -Install-Package Masa.Contrib.Authentication.Oidc.Cache +Install-Package Masa.Contrib.Authentication.OpenIdConnect.Cache ``` ```C# @@ -40,7 +40,7 @@ How to use: ```c# var app = builder.Build(); -app.MapGet("/GetClient", async ([FromServices] IClientCache cache) => +app.MapGet("/GetClient", async ([FromServices] IClientCache cache) => { return await cache.GetAsync("clientId"); }); diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/README.zh-CN.md similarity index 85% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/README.zh-CN.md index 6e29ffc4c..212e2e481 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/README.zh-CN.md +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/README.zh-CN.md @@ -1,6 +1,6 @@ 中 | [EN](README.md) -## Masa.Contrib.Authentication.Oidc.Cache +## Masa.Contrib.Authentication.OpenIdConnect.Cache 作用: @@ -16,7 +16,7 @@ 用例: ```C# -Install-Package Masa.Contrib.Authentication.Oidc.Cache +Install-Package Masa.Contrib.Authentication.OpenIdConnect.Cache ``` ```C# @@ -40,7 +40,7 @@ builder.Services.AddOidcCache(nnew RedisConfigurationOptions ```c# var app = builder.Build(); -app.MapGet("/GetClient", async ([FromServices] IClientCache cache) => +app.MapGet("/GetClient", async ([FromServices] IClientCache cache) => { return await cache.GetAsync("clientId"); }); diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/ServiceCollectionExtensions.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/ServiceCollectionExtensions.cs diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Utils/CollectionExtensions.cs similarity index 96% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Utils/CollectionExtensions.cs index b52bd7fb3..345adca10 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.Cache/Utils/CollectionExtensions.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/Utils/CollectionExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.Cache.Utils; +namespace Masa.Contrib.Authentication.OpenIdConnect.Cache.Utils; public static class CollectionExtensions { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/_Imports.cs new file mode 100644 index 000000000..533380c45 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.Cache/_Imports.cs @@ -0,0 +1,14 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.Caches; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Enums; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Models; +global using Masa.Contrib.Authentication.OpenIdConnect.Cache.Caches; +global using Masa.Contrib.Authentication.OpenIdConnect.Cache.Models; +global using Masa.Contrib.Authentication.OpenIdConnect.Cache.Utils; +global using Masa.Utils.Caching.DistributedMemory.DependencyInjection; +global using Masa.Utils.Caching.DistributedMemory.Interfaces; +global using Masa.Utils.Caching.Redis.Models; +global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Caches/SyncCache.cs similarity index 98% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Caches/SyncCache.cs index cb67b22ef..cab174498 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Caches/SyncCache.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Caches/SyncCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Caches; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Caches; public class SyncCache { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/DbContexts/OidcDbContext.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/DbContexts/OidcDbContext.cs index 7d39a137c..964f53d38 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/DbContexts/OidcDbContext.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/DbContexts/OidcDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.DbContexts; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.DbContexts; public class OidcDbContext { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs similarity index 79% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs index 1b1e4ee88..d775e8042 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ApiResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs similarity index 93% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs index f4acbda1c..2f4d7a938 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ApiResourceEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs index 6348fd9de..b9de93ca0 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ApiResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs similarity index 80% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs index 0bb2487fc..f82cdad49 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ApiResourceScopeEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs similarity index 85% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs index a147bb209..8c25b700a 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ApiResourceSecretEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs similarity index 80% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs index 75f9f67a5..c23856ed1 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ApiScopeClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs similarity index 89% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs index e896c2544..0c4fb6437 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ApiScopeEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs index d1e77c39c..ee513337e 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ApiScopePropertyEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs index f820fb239..0188de092 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs index b7d305fd0..6d866c9fe 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientCorsOriginEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs similarity index 95% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs index 6dfbec804..726d5cfee 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs index 078f6bee9..e6a4b1fc7 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientGrantTypeEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs index 020d4b47a..977e8b35d 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientIdPRestrictionEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs index 9ec42b572..031a6de86 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientPostLogoutRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs index 2dfc932b7..903488602 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientPropertyEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs index 4bd36f03a..b4108a0d4 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs similarity index 80% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs index e1341c78f..a28e488ea 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientScopeEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs similarity index 84% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs index 63cff7b2a..0b838100e 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class ClientSecretEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs similarity index 93% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs index 8d0acd9d9..2f0cafe8b 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class DeviceFlowCodesEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs index 1f96fd9bc..036e44634 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class IdentityResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs similarity index 90% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs index efe5181bc..8d227f29f 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class IdentityResourceEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs similarity index 84% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs index 0ac7d865f..7726fee94 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class IdentityResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs similarity index 93% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs index d01df6089..4e64e2707 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class PersistedGrantEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs index 1230b761d..b6a88f14c 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; public class UserClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj similarity index 82% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj index 8ba99a929..fd6dac2ce 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.csproj +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Options/OidcDbContextOptions.cs similarity index 94% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Options/OidcDbContextOptions.cs index fcf01b693..8ff14d683 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Options/OidcDbContextOptions.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Options/OidcDbContextOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Options; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Options; public class OidcDbContextOptions { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.md similarity index 79% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.md index cfa90b183..cd20a47bd 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.md +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.md @@ -1,6 +1,6 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Authentication.Oidc.EntityFrameworkCore +## Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore Effect: @@ -17,7 +17,7 @@ Use the Repository to operate the Oidc database Example: ```C# -Install-Package Masa.Contrib.Authentication.Oidc.EntityFrameworkCore +Install-Package Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore ``` ```C# @@ -30,7 +30,7 @@ How to use: ```c# var app = builder.Build(); -app.MapGet("/GetClients", async ([FromServices] IClientRepository repository) => +app.MapGet("/GetClients", async ([FromServices] IClientRepository repository) => { return await repository.GetListAsync(); }); diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.zh-CN.md similarity index 78% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.zh-CN.md index 20c85efa3..9dee08bd8 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/README.zh-CN.md +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.zh-CN.md @@ -1,6 +1,6 @@ 中 | [EN](README.md) -## Masa.Contrib.Authentication.Oidc.EntityFrameworkCore +## Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore 作用: @@ -17,7 +17,7 @@ 用例: ```C# -Install-Package Masa.Contrib.Authentication.Oidc.EntityFrameworkCore +Install-Package Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore ``` ```C# @@ -30,7 +30,7 @@ builder.Services.AddOidcDbContext(option => option.UseSqlServer("ConnectionStrin ```c# var app = builder.Build(); -app.MapGet("/GetClients", async ([FromServices] IClientRepository repository) => +app.MapGet("/GetClients", async ([FromServices] IClientRepository repository) => { return await repository.GetListAsync(); }); diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiResourceRepository.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiResourceRepository.cs index 846f2e75d..99ed43477 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiResourceRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiResourceRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; public class ApiResourceRepository : IApiResourceRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiScopeRepository.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiScopeRepository.cs index c85a850ee..f0471a6bc 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ApiScopeRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiScopeRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; public class ApiScopeRepository : IApiScopeRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ClientRepository.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ClientRepository.cs index 7705f911f..50bb57153 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/ClientRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ClientRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; public class ClientRepository : IClientRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs similarity index 98% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs index 48621f5d0..6b7427b3d 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; public class IdentityResourceRepository : IIdentityResourceRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/UserClaimRepository.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/UserClaimRepository.cs index d876dc5b8..35a30fe60 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/Repositories/UserClaimRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/UserClaimRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; public class UserClaimRepository : IUserClaimRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/ServiceCollectionExtensions.cs similarity index 94% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/ServiceCollectionExtensions.cs index 9eaea907a..a0ef492e3 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.Oidc.EntityFrameworkCore/ServiceCollectionExtensions.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/ServiceCollectionExtensions.cs @@ -4,7 +4,7 @@ using Masa.BuildingBlocks.Data; using Masa.BuildingBlocks.Data.UoW; -namespace Masa.Contrib.Authentication.Oidc.EntityFrameworkCore; +namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore; public static class ServiceCollectionExtensions { @@ -24,13 +24,13 @@ public static IServiceCollection AddOidcDbContext(this IServiceCollection ser public static async Task AddOidcDbContext(this IServiceCollection services, Func options) where T : DbContext, IMasaDbContext { services.AddOidcDbContext(); - using var scope = services.BuildServiceProvider().CreateScope(); + using var scope = services.BuildServiceProvider().CreateScope(); var oidcDbContextOptions = new OidcDbContextOptions(scope.ServiceProvider); await options.Invoke(oidcDbContextOptions); var unitOfWork = scope.ServiceProvider.GetService(); if(unitOfWork is not null) { await unitOfWork.CommitAsync(); - } + } } } diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/_Imports.cs new file mode 100644 index 000000000..4cc41df72 --- /dev/null +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/_Imports.cs @@ -0,0 +1,16 @@ +// Copyright (c) MASA Stack All rights reserved. +// Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Cache.Caches; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Entities; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Repositories; +global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Constans; +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; +global using Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Caches; +global using Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.DbContexts; +global using Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Options; +global using Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using Microsoft.Extensions.DependencyInjection; +global using System.Linq.Expressions; From c19d0a70e7998f9658f340d315de35a07fbff39a Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 17:42:16 +0800 Subject: [PATCH 15/29] rename: Identity.IdentityModel rename to Authentication.Identity --- Masa.Framework.sln | 26 +++++++++---------- .../DefaultTypeConvertProvider.cs | 2 +- .../Entities/IIdentityUser.cs | 2 +- .../Entities/IdentityRole.cs | 2 +- .../Entities/IdentityUser.cs | 2 +- .../Isolation/IIsolatedIdentityUser.cs | 2 +- .../IMultiEnvironmentIdentityUser.cs | 2 +- .../Isolation/IMultiTenantIdentityUser.cs | 2 +- .../Isolation/IsolatedIdentityUser.cs | 2 +- .../Isolation/MultiEnvironmentIdentityUser.cs | 2 +- .../Isolation/MultiTenantIdentityUser.cs | 2 +- .../Enum/IdentityType.cs | 2 +- .../IIsolatedUserContext.cs | 2 +- .../IMultiEnvironmentUserContext.cs | 2 +- .../IMultiTenantUserContext.cs | 2 +- .../ITypeConvertProvider.cs | 2 +- .../IUserContext.cs | 2 +- .../IUserSetter.cs | 2 +- .../Internal/DisposeAction.cs | 2 +- ...dingBlocks.Authentication.Identity.csproj} | 0 .../UserContext.cs | 2 +- .../_Imports.cs | 2 +- .../ClaimExtensions.cs | 2 +- .../Const/ClaimType.cs | 2 +- .../DefaultIsolatedUserContext.cs | 2 +- .../DefaultMultiEnvironmentUserContext.cs | 2 +- .../DefaultMultiTenantUserContext.cs | 2 +- .../DefaultUserContext.cs | 2 +- .../HttpContextCurrentPrincipalAccessor.cs | 2 +- .../ICurrentPrincipalAccessor.cs | 2 +- .../IdentityClaimOptions.cs | 2 +- ...sa.Contrib.Authentication.Identity.csproj} | 2 +- .../README.md | 2 +- .../README.zh-CN.md | 2 +- .../ServiceCollectionExtensions.cs | 0 .../ThreadCurrentPrincipalAccessor.cs | 2 +- .../_Imports.cs | 6 ++--- ...trib.Authentication.Identity.Tests.csproj} | 2 +- .../TestIdentity.cs | 2 +- .../_Imports.cs | 4 +-- .../_Imports.cs | 2 +- ...sa.Contrib.Data.EntityFrameworkCore.csproj | 2 +- .../_Imports.cs | 2 +- ....Contrib.Isolation.MultiEnvironment.csproj | 2 +- .../_Imports.cs | 2 +- .../Masa.Contrib.Isolation.MultiTenant.csproj | 2 +- .../_Imports.cs | 2 +- .../Masa.Contrib.StackSdks.Auth.csproj | 2 +- .../Masa.Contrib.StackSdks.Auth/README.md | 2 +- .../README.zh-CN.md | 2 +- .../Masa.Contrib.StackSdks.Auth/_Imports.cs | 2 +- .../Masa.Contrib.StackSdks.Scheduler.csproj | 2 +- .../Masa.Contrib.StackSdks.Auth.Tests.csproj | 2 +- .../_Imports.cs | 2 +- 54 files changed, 67 insertions(+), 67 deletions(-) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/DefaultTypeConvertProvider.cs (89%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Entities/IIdentityUser.cs (84%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Entities/IdentityRole.cs (81%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Entities/IdentityUser.cs (87%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Entities/Isolation/IIsolatedIdentityUser.cs (82%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Entities/Isolation/IMultiEnvironmentIdentityUser.cs (82%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Entities/Isolation/IMultiTenantIdentityUser.cs (81%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Entities/Isolation/IsolatedIdentityUser.cs (82%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Entities/Isolation/MultiEnvironmentIdentityUser.cs (82%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Entities/Isolation/MultiTenantIdentityUser.cs (83%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Enum/IdentityType.cs (89%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/IIsolatedUserContext.cs (82%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/IMultiEnvironmentUserContext.cs (81%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/IMultiTenantUserContext.cs (83%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/ITypeConvertProvider.cs (80%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/IUserContext.cs (89%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/IUserSetter.cs (83%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/Internal/DisposeAction.cs (86%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj => Masa.BuildingBlocks.Authentication.Identity/Masa.BuildingBlocks.Authentication.Identity.csproj} (100%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/UserContext.cs (97%) rename src/BuildingBlocks/Authentication/{Masa.BuildingBlocks.Identity.IdentityModel => Masa.BuildingBlocks.Authentication.Identity}/_Imports.cs (73%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/ClaimExtensions.cs (88%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/Const/ClaimType.cs (91%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/DefaultIsolatedUserContext.cs (97%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/DefaultMultiEnvironmentUserContext.cs (96%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/DefaultMultiTenantUserContext.cs (96%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/DefaultUserContext.cs (97%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/HttpContextCurrentPrincipalAccessor.cs (92%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/ICurrentPrincipalAccessor.cs (83%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/IdentityClaimOptions.cs (93%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj => Masa.Contrib.Authentication.Identity/Masa.Contrib.Authentication.Identity.csproj} (84%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/README.md (94%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/README.zh-CN.md (94%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/ServiceCollectionExtensions.cs (100%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/ThreadCurrentPrincipalAccessor.cs (87%) rename src/Contrib/Authentication/{Masa.Contrib.Identity.IdentityModel => Masa.Contrib.Authentication.Identity}/_Imports.cs (70%) rename src/Contrib/Authentication/Tests/{Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj => Masa.Contrib.Authentication.Identity.Tests/Masa.Contrib.Authentication.Identity.Tests.csproj} (91%) rename src/Contrib/Authentication/Tests/{Masa.Contrib.Identity.IdentityModel.Tests => Masa.Contrib.Authentication.Identity.Tests}/TestIdentity.cs (99%) rename src/Contrib/Authentication/Tests/{Masa.Contrib.Identity.IdentityModel.Tests => Masa.Contrib.Authentication.Identity.Tests}/_Imports.cs (76%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 8f3c66990..7e2273c8b 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -89,7 +89,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authent EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage\Masa.BuildingBlocks.Authentication.OpenIdConnect.Storage.csproj", "{0D395B3E-D603-49C3-AD80-B53979EDF9E1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Identity.IdentityModel", "src\BuildingBlocks\Authentication\Masa.BuildingBlocks.Identity.IdentityModel\Masa.BuildingBlocks.Identity.IdentityModel.csproj", "{249E8BD4-C358-4358-93FA-78320D335014}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.Identity", "src\BuildingBlocks\Authentication\Masa.BuildingBlocks.Authentication.Identity\Masa.BuildingBlocks.Authentication.Identity.csproj", "{249E8BD4-C358-4358-93FA-78320D335014}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Configuration", "src\BuildingBlocks\Configuration\Masa.BuildingBlocks.Configuration\Masa.BuildingBlocks.Configuration.csproj", "{BB008555-DDF4-4A1F-B784-F3B7F34CDFDC}" EndProject @@ -251,12 +251,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore\Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj", "{3532E374-C922-4B79-93CA-2B0E4CC14FB9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel", "src\Contrib\Authentication\Masa.Contrib.Identity.IdentityModel\Masa.Contrib.Identity.IdentityModel.csproj", "{DF784809-63B1-44EF-802E-CCCB1FFAA557}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Identity", "src\Contrib\Authentication\Masa.Contrib.Authentication.Identity\Masa.Contrib.Authentication.Identity.csproj", "{DF784809-63B1-44EF-802E-CCCB1FFAA557}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{94D15C26-7204-4299-BC23-B89F5A0B0BF9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Identity.IdentityModel.Tests", "src\Contrib\Authentication\Tests\Masa.Contrib.Identity.IdentityModel.Tests\Masa.Contrib.Identity.IdentityModel.Tests.csproj", "{06381F61-2C55-4322-9417-EA14F5F0E467}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration", "src\Contrib\Configuration\Masa.Contrib.Configuration\Masa.Contrib.Configuration.csproj", "{A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8C5FBB10-CFAE-482C-93E8-7E03303D7825}" @@ -535,6 +533,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerat EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj", "{1E82EC06-25F3-49E2-BAB6-978CE2896ACC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Authentication.Identity.Tests", "src\Contrib\Authentication\Tests\Masa.Contrib.Authentication.Identity.Tests\Masa.Contrib.Authentication.Identity.Tests.csproj", "{1527C989-514E-4066-9FE0-BF4289D31CB3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1095,14 +1095,6 @@ Global {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Release|Any CPU.Build.0 = Release|Any CPU {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Release|x64.ActiveCfg = Release|Any CPU {DF784809-63B1-44EF-802E-CCCB1FFAA557}.Release|x64.Build.0 = Release|Any CPU - {06381F61-2C55-4322-9417-EA14F5F0E467}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {06381F61-2C55-4322-9417-EA14F5F0E467}.Debug|Any CPU.Build.0 = Debug|Any CPU - {06381F61-2C55-4322-9417-EA14F5F0E467}.Debug|x64.ActiveCfg = Debug|Any CPU - {06381F61-2C55-4322-9417-EA14F5F0E467}.Debug|x64.Build.0 = Debug|Any CPU - {06381F61-2C55-4322-9417-EA14F5F0E467}.Release|Any CPU.ActiveCfg = Release|Any CPU - {06381F61-2C55-4322-9417-EA14F5F0E467}.Release|Any CPU.Build.0 = Release|Any CPU - {06381F61-2C55-4322-9417-EA14F5F0E467}.Release|x64.ActiveCfg = Release|Any CPU - {06381F61-2C55-4322-9417-EA14F5F0E467}.Release|x64.Build.0 = Release|Any CPU {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Debug|Any CPU.Build.0 = Debug|Any CPU {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1887,6 +1879,14 @@ Global {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Release|Any CPU.Build.0 = Release|Any CPU {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Release|x64.ActiveCfg = Release|Any CPU {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Release|x64.Build.0 = Release|Any CPU + {1527C989-514E-4066-9FE0-BF4289D31CB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1527C989-514E-4066-9FE0-BF4289D31CB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1527C989-514E-4066-9FE0-BF4289D31CB3}.Debug|x64.ActiveCfg = Debug|Any CPU + {1527C989-514E-4066-9FE0-BF4289D31CB3}.Debug|x64.Build.0 = Debug|Any CPU + {1527C989-514E-4066-9FE0-BF4289D31CB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1527C989-514E-4066-9FE0-BF4289D31CB3}.Release|Any CPU.Build.0 = Release|Any CPU + {1527C989-514E-4066-9FE0-BF4289D31CB3}.Release|x64.ActiveCfg = Release|Any CPU + {1527C989-514E-4066-9FE0-BF4289D31CB3}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2010,7 +2010,6 @@ Global {3532E374-C922-4B79-93CA-2B0E4CC14FB9} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} {DF784809-63B1-44EF-802E-CCCB1FFAA557} = {3198630F-C09B-40AE-B9A1-E79249296E48} {94D15C26-7204-4299-BC23-B89F5A0B0BF9} = {3198630F-C09B-40AE-B9A1-E79249296E48} - {06381F61-2C55-4322-9417-EA14F5F0E467} = {94D15C26-7204-4299-BC23-B89F5A0B0BF9} {A59E1EA1-9F5D-486E-9D2D-A2DD0DF7CD79} = {191588CC-BDCB-4C23-AD8E-76391F8BD7B9} {8C5FBB10-CFAE-482C-93E8-7E03303D7825} = {191588CC-BDCB-4C23-AD8E-76391F8BD7B9} {0B6512C6-64F0-4403-B074-67F3B95341D7} = {8C5FBB10-CFAE-482C-93E8-7E03303D7825} @@ -2150,6 +2149,7 @@ Global {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} {1E82EC06-25F3-49E2-BAB6-978CE2896ACC} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} + {1527C989-514E-4066-9FE0-BF4289D31CB3} = {94D15C26-7204-4299-BC23-B89F5A0B0BF9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/DefaultTypeConvertProvider.cs similarity index 89% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/DefaultTypeConvertProvider.cs index 087259862..0ec0aca6d 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/DefaultTypeConvertProvider.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/DefaultTypeConvertProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public class DefaultTypeConvertProvider : ITypeConvertProvider { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/IIdentityUser.cs similarity index 84% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/IIdentityUser.cs index b116f32bb..c63e0a71c 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IIdentityUser.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/IIdentityUser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface IIdentityUser { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/IdentityRole.cs similarity index 81% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/IdentityRole.cs index 2ecacfe4a..8ebd24d81 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityRole.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/IdentityRole.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public class IdentityRole { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/IdentityUser.cs similarity index 87% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/IdentityUser.cs index 31213d8d5..29fcec014 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/IdentityUser.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/IdentityUser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public class IdentityUser : IIdentityUser { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IIsolatedIdentityUser.cs similarity index 82% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IIsolatedIdentityUser.cs index 656188c3f..64280eb9f 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IIsolatedIdentityUser.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IIsolatedIdentityUser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface IIsolatedIdentityUser : IMultiTenantIdentityUser, IMultiEnvironmentIdentityUser { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IMultiEnvironmentIdentityUser.cs similarity index 82% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IMultiEnvironmentIdentityUser.cs index 72d89fdf0..59430b919 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiEnvironmentIdentityUser.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IMultiEnvironmentIdentityUser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface IMultiEnvironmentIdentityUser : IIdentityUser { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IMultiTenantIdentityUser.cs similarity index 81% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IMultiTenantIdentityUser.cs index d57e54ee9..58e847106 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IMultiTenantIdentityUser.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IMultiTenantIdentityUser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface IMultiTenantIdentityUser : IIdentityUser { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IsolatedIdentityUser.cs similarity index 82% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IsolatedIdentityUser.cs index 1121b1b03..f177eecb6 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/IsolatedIdentityUser.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/IsolatedIdentityUser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public class IsolatedIdentityUser : MultiTenantIdentityUser { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/MultiEnvironmentIdentityUser.cs similarity index 82% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/MultiEnvironmentIdentityUser.cs index fc3e54447..a43452663 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiEnvironmentIdentityUser.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/MultiEnvironmentIdentityUser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public class MultiEnvironmentIdentityUser : IdentityUser { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/MultiTenantIdentityUser.cs similarity index 83% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/MultiTenantIdentityUser.cs index da9be1540..ef2e6d2f5 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Entities/Isolation/MultiTenantIdentityUser.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Entities/Isolation/MultiTenantIdentityUser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public class MultiTenantIdentityUser : IdentityUser, IMultiTenantIdentityUser { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Enum/IdentityType.cs similarity index 89% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Enum/IdentityType.cs index bce77db68..4b3bf50c0 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Enum/IdentityType.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Enum/IdentityType.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; [Flags] public enum IdentityType diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IIsolatedUserContext.cs similarity index 82% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IIsolatedUserContext.cs index a5c9b3505..8323a0c90 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IIsolatedUserContext.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IIsolatedUserContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface IIsolatedUserContext : IMultiTenantUserContext, IMultiEnvironmentUserContext diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IMultiEnvironmentUserContext.cs similarity index 81% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IMultiEnvironmentUserContext.cs index 62c3f97e8..65e1ad8b5 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiEnvironmentUserContext.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IMultiEnvironmentUserContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface IMultiEnvironmentUserContext : IUserContext { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IMultiTenantUserContext.cs similarity index 83% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IMultiTenantUserContext.cs index a4b517917..6c97c648f 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IMultiTenantUserContext.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IMultiTenantUserContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface IMultiTenantUserContext : IUserContext { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/ITypeConvertProvider.cs similarity index 80% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/ITypeConvertProvider.cs index 2862d2bae..947573c9d 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/ITypeConvertProvider.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/ITypeConvertProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface ITypeConvertProvider { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IUserContext.cs similarity index 89% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IUserContext.cs index 32a7302ea..006a34544 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserContext.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IUserContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface IUserContext { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IUserSetter.cs similarity index 83% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IUserSetter.cs index 5ac2d328e..66b5580db 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/IUserSetter.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/IUserSetter.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public interface IUserSetter { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Internal/DisposeAction.cs similarity index 86% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Internal/DisposeAction.cs index 2a2408616..ca63bb881 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Internal/DisposeAction.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Internal/DisposeAction.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel.Internal; +namespace Masa.BuildingBlocks.Authentication.Identity.Internal; internal class DisposeAction : IDisposable { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Masa.BuildingBlocks.Authentication.Identity.csproj similarity index 100% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/Masa.BuildingBlocks.Identity.IdentityModel.csproj rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/Masa.BuildingBlocks.Authentication.Identity.csproj diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/UserContext.cs similarity index 97% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/UserContext.cs index 004c5e44a..8b12ce728 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/UserContext.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/UserContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.BuildingBlocks.Identity.IdentityModel; +namespace Masa.BuildingBlocks.Authentication.Identity; public abstract class UserContext : IUserSetter, IUserContext { diff --git a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/_Imports.cs similarity index 73% rename from src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs rename to src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/_Imports.cs index 15e5b13bc..d37b21c00 100644 --- a/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Identity.IdentityModel/_Imports.cs +++ b/src/BuildingBlocks/Authentication/Masa.BuildingBlocks.Authentication.Identity/_Imports.cs @@ -1,5 +1,5 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Identity.IdentityModel.Internal; +global using Masa.BuildingBlocks.Authentication.Identity.Internal; global using System.ComponentModel; diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ClaimExtensions.cs similarity index 88% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ClaimExtensions.cs index 7ec98fcb8..b34c0dd6a 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ClaimExtensions.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ClaimExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel; +namespace Masa.Contrib.Authentication.Identity; public static class ClaimExtensions { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/Const/ClaimType.cs similarity index 91% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/Const/ClaimType.cs index 45ec16a17..c10d715ae 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Const/ClaimType.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/Const/ClaimType.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel.Const; +namespace Masa.Contrib.Authentication.Identity.Const; public class ClaimType { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultIsolatedUserContext.cs similarity index 97% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultIsolatedUserContext.cs index 23013421c..167888959 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultIsolatedUserContext.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultIsolatedUserContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel; +namespace Masa.Contrib.Authentication.Identity; internal class DefaultIsolatedUserContext : DefaultUserContext, IIsolatedUserContext { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultMultiEnvironmentUserContext.cs similarity index 96% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultMultiEnvironmentUserContext.cs index 3c1d8cd3d..1a1030c07 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiEnvironmentUserContext.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultMultiEnvironmentUserContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel; +namespace Masa.Contrib.Authentication.Identity; internal class DefaultMultiEnvironmentUserContext : DefaultUserContext, IMultiEnvironmentUserContext { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultMultiTenantUserContext.cs similarity index 96% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultMultiTenantUserContext.cs index 1ff28c5bd..9e78782e2 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultMultiTenantUserContext.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultMultiTenantUserContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel; +namespace Masa.Contrib.Authentication.Identity; internal class DefaultMultiTenantUserContext : DefaultUserContext, IMultiTenantUserContext { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultUserContext.cs similarity index 97% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultUserContext.cs index 64e0ad129..d10768830 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/DefaultUserContext.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/DefaultUserContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel; +namespace Masa.Contrib.Authentication.Identity; internal class DefaultUserContext : UserContext { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/HttpContextCurrentPrincipalAccessor.cs similarity index 92% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/HttpContextCurrentPrincipalAccessor.cs index 98d647299..2e03b91d6 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/HttpContextCurrentPrincipalAccessor.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/HttpContextCurrentPrincipalAccessor.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel; +namespace Masa.Contrib.Authentication.Identity; public class HttpContextCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ICurrentPrincipalAccessor.cs similarity index 83% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ICurrentPrincipalAccessor.cs index 056376d42..c3f86f502 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ICurrentPrincipalAccessor.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ICurrentPrincipalAccessor.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel; +namespace Masa.Contrib.Authentication.Identity; public interface ICurrentPrincipalAccessor { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/IdentityClaimOptions.cs similarity index 93% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/IdentityClaimOptions.cs index 4f64d1aa5..c47610133 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/IdentityClaimOptions.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/IdentityClaimOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel; +namespace Masa.Contrib.Authentication.Identity; public class IdentityClaimOptions { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/Masa.Contrib.Authentication.Identity.csproj similarity index 84% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/Masa.Contrib.Authentication.Identity.csproj index 2192d0a54..b5c7ceab2 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/Masa.Contrib.Identity.IdentityModel.csproj +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/Masa.Contrib.Authentication.Identity.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.md b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/README.md similarity index 94% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.md rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/README.md index 8f704f771..dbc872347 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.md +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/README.md @@ -5,7 +5,7 @@ Example: ```` C# -Install-Package Masa.Contrib.Identity.IdentityModel +Install-Package Masa.Contrib.Authentication.Identity ```` 1. Modify `Program.cs` diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/README.zh-CN.md similarity index 94% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/README.zh-CN.md index 916fba22b..b55737b77 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/README.zh-CN.md +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/README.zh-CN.md @@ -5,7 +5,7 @@ 用例: ``` C# -Install-Package Masa.Contrib.Identity.IdentityModel +Install-Package Masa.Contrib.Authentication.Identity ``` 1. 修改`Program.cs` diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ServiceCollectionExtensions.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ServiceCollectionExtensions.cs diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ThreadCurrentPrincipalAccessor.cs similarity index 87% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ThreadCurrentPrincipalAccessor.cs index f6aaae84d..9d273da25 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/ThreadCurrentPrincipalAccessor.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/ThreadCurrentPrincipalAccessor.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel; +namespace Masa.Contrib.Authentication.Identity; public class ThreadCurrentPrincipalAccessor : ICurrentPrincipalAccessor { diff --git a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/_Imports.cs b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/_Imports.cs similarity index 70% rename from src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/_Imports.cs rename to src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/_Imports.cs index 287fe982b..83f8ab964 100644 --- a/src/Contrib/Authentication/Masa.Contrib.Identity.IdentityModel/_Imports.cs +++ b/src/Contrib/Authentication/Masa.Contrib.Authentication.Identity/_Imports.cs @@ -1,9 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.Contrib.Identity.IdentityModel; -global using Masa.Contrib.Identity.IdentityModel.Const; +global using Masa.BuildingBlocks.Authentication.Identity; +global using Masa.Contrib.Authentication.Identity; +global using Masa.Contrib.Authentication.Identity.Const; global using Microsoft.AspNetCore.Http; global using Microsoft.Extensions.DependencyInjection.Extensions; global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj b/src/Contrib/Authentication/Tests/Masa.Contrib.Authentication.Identity.Tests/Masa.Contrib.Authentication.Identity.Tests.csproj similarity index 91% rename from src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj rename to src/Contrib/Authentication/Tests/Masa.Contrib.Authentication.Identity.Tests/Masa.Contrib.Authentication.Identity.Tests.csproj index d4a73183a..3f3b8a9cc 100644 --- a/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/Masa.Contrib.Identity.IdentityModel.Tests.csproj +++ b/src/Contrib/Authentication/Tests/Masa.Contrib.Authentication.Identity.Tests/Masa.Contrib.Authentication.Identity.Tests.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs b/src/Contrib/Authentication/Tests/Masa.Contrib.Authentication.Identity.Tests/TestIdentity.cs similarity index 99% rename from src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs rename to src/Contrib/Authentication/Tests/Masa.Contrib.Authentication.Identity.Tests/TestIdentity.cs index b7c42cea6..fedb5151d 100644 --- a/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/TestIdentity.cs +++ b/src/Contrib/Authentication/Tests/Masa.Contrib.Authentication.Identity.Tests/TestIdentity.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Identity.IdentityModel.Tests; +namespace Masa.Contrib.Authentication.Identity.Tests; [TestClass] public class TestIdentity diff --git a/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs b/src/Contrib/Authentication/Tests/Masa.Contrib.Authentication.Identity.Tests/_Imports.cs similarity index 76% rename from src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs rename to src/Contrib/Authentication/Tests/Masa.Contrib.Authentication.Identity.Tests/_Imports.cs index 0e455e7f8..65bc733e4 100644 --- a/src/Contrib/Authentication/Tests/Masa.Contrib.Identity.IdentityModel.Tests/_Imports.cs +++ b/src/Contrib/Authentication/Tests/Masa.Contrib.Authentication.Identity.Tests/_Imports.cs @@ -1,8 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Identity.IdentityModel; -global using Masa.Contrib.Identity.IdentityModel.Const; +global using Masa.BuildingBlocks.Authentication.Identity; +global using Masa.Contrib.Authentication.Identity.Const; global using Microsoft.AspNetCore.Http; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.Options; diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs index 9b7d93fac..5c9e30baf 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs @@ -3,7 +3,7 @@ global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; -global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.Contrib.Data.Contracts.EF.DataFiltering; global using Masa.Contrib.Data.Contracts.EF.Internal; global using Masa.Contrib.Data.Contracts.EF.Options; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj index f1d673564..ae71001b3 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs index be8768eeb..f6ea7ad41 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs @@ -8,7 +8,7 @@ global using Masa.BuildingBlocks.Ddd.Domain.Entities; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.Contrib.Data.EntityFrameworkCore; global using Masa.Contrib.Data.EntityFrameworkCore.Filters; global using Microsoft.EntityFrameworkCore; diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj index d4ac1dd9a..f5dad26b2 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/Masa.Contrib.Isolation.MultiEnvironment.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs index b185df42d..5ff9aaa34 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/_Imports.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.BuildingBlocks.Isolation; global using Masa.BuildingBlocks.Isolation.Environment; global using Masa.BuildingBlocks.Isolation.Middleware; diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj index d4ac1dd9a..f5dad26b2 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/Masa.Contrib.Isolation.MultiTenant.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs index d6e1c98f6..f00d4e79a 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/_Imports.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.BuildingBlocks.Isolation; global using Masa.BuildingBlocks.Isolation.Middleware; global using Masa.BuildingBlocks.Isolation.MultiTenant; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj index 8dce63758..6e06f8a34 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/Masa.Contrib.StackSdks.Auth.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.md index 1002e93ed..6076c77a0 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.md +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.md @@ -3,7 +3,7 @@ ## Masa.Contrib.StackSdks.Auth Injecting IAuthClient interface,cal the service to obtain the capabilities provided by the auth SDK. -SDK need to get current user ID dependency Masa.Contrib.Identity.IdentityModel(../../Identity/Masa.Contrib.Identity.IdentityModel/README.zh,Therefore,the identitymodel service needs to be added before use. +SDK need to get current user ID dependency Masa.Contrib.Authentication.Identity(../../Identity/Masa.Contrib.Authentication.Identity/README.zh,Therefore,the identitymodel service needs to be added before use. ### Service Introduction diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md index c96527330..1fd4e39b0 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/README.zh-CN.md @@ -3,7 +3,7 @@ ## Masa.Contrib.StackSdks.Auth 通过注入IAuthClient接口,调用对应Service获取Auth SDK 提供的能力。 -SDK获取当前用户ID依赖Masa.Contrib.Identity.IdentityModel(../../Identity/Masa.Contrib.Identity.IdentityModel/README.zh-CN.zh,所以使用前需添加IdentityModel服务。 +SDK获取当前用户ID依赖Masa.Contrib.Identity.IdentityModel(../../Identity/Masa.Contrib.Authentication.Identity/README.zh-CN.zh,所以使用前需添加IdentityModel服务。 ### 服务介绍 ```c# diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs index 20f702dd3..cd48f1240 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs @@ -4,7 +4,7 @@ global using Masa.BuildingBlocks.StackSdks.Auth; global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; global using Masa.BuildingBlocks.StackSdks.Auth.Service; -global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.Service.Caller.Options; global using Masa.Contrib.Service.Caller; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj index 6c325cfb1..1fad8a4aa 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/Masa.Contrib.StackSdks.Scheduler.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj index 25dc4fe25..bbdd90c9c 100644 --- a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/Masa.Contrib.StackSdks.Auth.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs index 76252fde4..c187915a5 100644 --- a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs @@ -4,7 +4,7 @@ global using Masa.BuildingBlocks.StackSdks.Auth; global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; -global using Masa.BuildingBlocks.Identity.IdentityModel; +global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.BuildingBlocks.Service.Caller; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; From fe1358cae919d48c932d939027be20310d845cb9 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 17:52:44 +0800 Subject: [PATCH 16/29] rename: EF rename to EntityFrameworkCore --- Masa.Framework.sln | 18 +++++++++--------- README.md | 10 +++++----- README.zh-CN.md | 8 ++++---- .../DataFiltering/DataFilter.cs | 2 +- .../SoftDeleteSaveChangesFilter.cs | 2 +- .../Internal/DataFilterState.cs | 2 +- .../Internal/DisposeAction.cs | 2 +- .../Internal/InstanceBuilder.cs | 2 +- .../Internal/NullDisposable.cs | 2 +- ....Data.Contracts.EntityFrameworkCore.csproj} | 0 .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../Options/FilterOptions.cs | 2 +- .../_Imports.cs | 6 +++--- .../DataFilterTest.cs | 2 +- ...Contracts.EntityFrameworkCore.Tests.csproj} | 2 +- .../_Imports.cs | 2 +- ...ntrib.Data.EntityFrameworkCore.Tests.csproj | 2 +- .../_Imports.cs | 2 +- .../README.zh-CN.md | 2 +- .../DispatcherOptionsExtensions.cs | 2 +- .../Internal/LinqExtensions.cs | 2 +- .../ServiceCollectionRepositoryExtensions.cs | 2 +- .../Internal/TypeExtensions.cs | 2 +- ...main.Repository.EntityFrameworkCore.csproj} | 0 .../README.md | 4 ++-- .../README.zh-CN.md | 4 ++-- .../Repository.cs | 2 +- .../_Imports.cs | 2 +- .../Domain/Masa.Contrib.Ddd.Domain/README.md | 4 ++-- .../Masa.Contrib.Ddd.Domain/README.zh-CN.md | 4 ++-- .../Domain/Entities/Address.cs | 2 +- .../Domain/Entities/OrderItem.cs | 2 +- .../Domain/Entities/Orders.cs | 2 +- ...epository.EntityFrameworkCore.Tests.csproj} | 2 +- .../RepositoryTest.cs | 2 +- .../_Imports.cs | 2 +- .../README.md | 2 +- .../README.zh-CN.md | 2 +- .../DispatcherOptionsExtensions.cs | 2 +- .../IntegrationEventLogContext.cs | 2 +- ...tegrationEventLogEntityTypeConfiguration.cs | 2 +- ...IntegrationEventLogModelCreatingProvider.cs | 2 +- .../IntegrationEventLogService.cs | 2 +- ...vents.EventLogs.EntityFrameworkCore.csproj} | 0 .../README.md | 4 ++-- .../README.zh-CN.md | 4 ++-- .../_Imports.cs | 0 .../README.md | 4 ++-- .../README.zh-CN.md | 4 ++-- .../Domain/Entities/User.cs | 2 +- .../Events/IntegrationEvent.cs | 2 +- .../OrderPaymentSucceededIntegrationEvent.cs | 2 +- .../Infrastructure/CustomDbContext.cs | 2 +- .../IntegrationEventLogContextTest.cs | 2 +- .../IntegrationEventLogServiceTest.cs | 2 +- ...EventLogs.EntityFrameworkCore.Tests.csproj} | 2 +- .../TestBase.cs | 2 +- .../_Imports.cs | 6 +++--- .../Masa.Contrib.Dispatcher.Events/README.md | 4 ++-- .../README.md | 2 +- .../README.zh-CN.md | 2 +- .../README.md | 2 +- .../README.zh-CN.md | 2 +- .../Isolation/Masa.Contrib.Isolation/README.md | 2 +- .../Masa.Contrib.Isolation/README.zh-CN.md | 2 +- .../DispatcherOptionsExtensions.cs | 2 +- .../Internal/TypeExtensions.cs | 2 +- .../IsolationDbContext.cs | 2 +- .../IsolationSaveChangesFilter.cs | 2 +- ...b.Isolation.UoW.EntityFrameworkCore.csproj} | 0 .../README.md | 6 +++--- .../README.zh-CN.md | 6 +++--- .../_Imports.cs | 2 +- .../CustomDbContext.cs | 2 +- ...ation.UoW.EntityFrameworkCore.Tests.csproj} | 4 ++-- .../TestBase.cs | 2 +- .../TestIsolation.cs | 2 +- .../_Imports.cs | 2 +- .../appsettings.json | 0 .../CustomDbContext.cs | 2 +- .../EdgeDriverTest.cs | 2 +- .../EventHandlers/AddRoleEventHandler.cs | 2 +- .../EventHandlers/RegisterUserEventHandler.cs | 2 +- .../Events/AddRoleEvent.cs | 2 +- .../Events/RegisterUserEvent.cs | 2 +- ...n.UoW.EntityFrameworkCore.Web.Tests.csproj} | 4 ++-- .../TestBase.cs | 2 +- .../_Imports.cs | 4 ++-- .../appsettings.json | 0 .../Masa.EventBus.IntegrationTests.csproj | 6 +++--- .../Masa.EventBus.IntegrationTests/_Imports.cs | 6 +++--- 91 files changed, 123 insertions(+), 123 deletions(-) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF => Masa.Contrib.Data.Contracts.EntityFrameworkCore}/DataFiltering/DataFilter.cs (96%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF => Masa.Contrib.Data.Contracts.EntityFrameworkCore}/DataFiltering/SoftDeleteSaveChangesFilter.cs (97%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF => Masa.Contrib.Data.Contracts.EntityFrameworkCore}/Internal/DataFilterState.cs (81%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF => Masa.Contrib.Data.Contracts.EntityFrameworkCore}/Internal/DisposeAction.cs (83%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF => Masa.Contrib.Data.Contracts.EntityFrameworkCore}/Internal/InstanceBuilder.cs (94%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF => Masa.Contrib.Data.Contracts.EntityFrameworkCore}/Internal/NullDisposable.cs (81%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj => Masa.Contrib.Data.Contracts.EntityFrameworkCore/Masa.Contrib.Data.Contracts.EntityFrameworkCore.csproj} (100%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF => Masa.Contrib.Data.Contracts.EntityFrameworkCore}/MasaDbContextOptionsBuilderExtensions.cs (97%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF => Masa.Contrib.Data.Contracts.EntityFrameworkCore}/Options/FilterOptions.cs (88%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EF => Masa.Contrib.Data.Contracts.EntityFrameworkCore}/_Imports.cs (79%) rename src/Contrib/Data/Contracts/Tests/{Masa.Contrib.Data.Contracts.EF.Tests => Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests}/DataFilterTest.cs (95%) rename src/Contrib/Data/Contracts/Tests/{Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj => Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj} (93%) rename src/Contrib/Data/Contracts/Tests/{Masa.Contrib.Data.Contracts.EF.Tests => Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests}/_Imports.cs (80%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EF => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore}/DispatcherOptionsExtensions.cs (93%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EF => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore}/Internal/LinqExtensions.cs (98%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EF => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore}/Internal/ServiceCollectionRepositoryExtensions.cs (97%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EF => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore}/Internal/TypeExtensions.cs (88%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.csproj} (100%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EF => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore}/README.md (91%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EF => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore}/README.zh-CN.md (91%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EF => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore}/Repository.cs (99%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EF => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore}/_Imports.cs (90%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EF.Tests => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests}/Domain/Entities/Address.cs (87%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EF.Tests => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests}/Domain/Entities/OrderItem.cs (83%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EF.Tests => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests}/Domain/Entities/Orders.cs (91%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj} (91%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EF.Tests => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests}/RepositoryTest.cs (99%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EF.Tests => Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests}/_Imports.cs (88%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore}/DispatcherOptionsExtensions.cs (94%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore}/IntegrationEventLogContext.cs (83%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore}/IntegrationEventLogEntityTypeConfiguration.cs (94%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore}/IntegrationEventLogModelCreatingProvider.cs (85%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore}/IntegrationEventLogService.cs (98%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.csproj} (100%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore}/README.md (78%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore}/README.zh-CN.md (77%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore}/_Imports.cs (100%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests}/Domain/Entities/User.cs (69%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests}/Events/IntegrationEvent.cs (89%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests}/Events/OrderPaymentSucceededIntegrationEvent.cs (80%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests}/Infrastructure/CustomDbContext.cs (77%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests}/IntegrationEventLogContextTest.cs (97%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests}/IntegrationEventLogServiceTest.cs (99%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj} (92%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests}/TestBase.cs (91%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests}/_Imports.cs (89%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EF => Masa.Contrib.Isolation.UoW.EntityFrameworkCore}/DispatcherOptionsExtensions.cs (98%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EF => Masa.Contrib.Isolation.UoW.EntityFrameworkCore}/Internal/TypeExtensions.cs (88%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EF => Masa.Contrib.Isolation.UoW.EntityFrameworkCore}/IsolationDbContext.cs (98%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EF => Masa.Contrib.Isolation.UoW.EntityFrameworkCore}/IsolationSaveChangesFilter.cs (97%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj => Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.csproj} (100%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EF => Masa.Contrib.Isolation.UoW.EntityFrameworkCore}/README.md (95%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EF => Masa.Contrib.Isolation.UoW.EntityFrameworkCore}/README.zh-CN.md (94%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EF => Masa.Contrib.Isolation.UoW.EntityFrameworkCore}/_Imports.cs (92%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests}/CustomDbContext.cs (95%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj} (90%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests}/TestBase.cs (88%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests}/TestIsolation.cs (99%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests}/_Imports.cs (94%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests}/appsettings.json (100%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests}/CustomDbContext.cs (96%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests}/EdgeDriverTest.cs (97%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests}/EventHandlers/AddRoleEventHandler.cs (96%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests}/EventHandlers/RegisterUserEventHandler.cs (96%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests}/Events/AddRoleEvent.cs (73%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests}/Events/RegisterUserEvent.cs (75%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj} (90%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests}/TestBase.cs (88%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests}/_Imports.cs (88%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EF.Web.Tests => Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests}/appsettings.json (100%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 7e2273c8b..1401b6956 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -287,11 +287,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Orm", "Orm", "{343A61CC-45B EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{E8B3FB42-C450-4B12-9C2C-7B9A02B616BB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF", "src\Contrib\Data\Contracts\Masa.Contrib.Data.Contracts.EF\Masa.Contrib.Data.Contracts.EF.csproj", "{8353A1CE-B6F0-42A2-B7F1-BC87707719AD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EntityFrameworkCore", "src\Contrib\Data\Contracts\Masa.Contrib.Data.Contracts.EntityFrameworkCore\Masa.Contrib.Data.Contracts.EntityFrameworkCore.csproj", "{8353A1CE-B6F0-42A2-B7F1-BC87707719AD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{83E5A183-56D6-4CAC-95A6-FB280AA7AE3D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EF.Tests", "src\Contrib\Data\Contracts\Tests\Masa.Contrib.Data.Contracts.EF.Tests\Masa.Contrib.Data.Contracts.EF.Tests.csproj", "{905DB539-092C-4365-ACA1-531D3F2A6665}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests", "src\Contrib\Data\Contracts\Tests\Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests\Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj", "{905DB539-092C-4365-ACA1-531D3F2A6665}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local", "src\Contrib\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Local\Masa.Contrib.Data.DistributedLock.Local.csproj", "{51A22652-A76D-4BB6-92B3-269E7628F4AA}" EndProject @@ -385,11 +385,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain", " EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF", "src\Contrib\Ddd\Domain\Masa.Contrib.Ddd.Domain.Repository.EF\Masa.Contrib.Ddd.Domain.Repository.EF.csproj", "{88B7B81E-1F86-4CB2-AB48-A301D2A67A40}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore", "src\Contrib\Ddd\Domain\Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore\Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.csproj", "{88B7B81E-1F86-4CB2-AB48-A301D2A67A40}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F83E3E53-2DFE-4B1F-B988-204CA4A42572}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EF.Tests", "src\Contrib\Ddd\Domain\Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests\Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj", "{6DB001ED-4652-41C7-8C4A-07FF1C03266B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests", "src\Contrib\Ddd\Domain\Tests\Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests\Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj", "{6DB001ED-4652-41C7-8C4A-07FF1C03266B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events", "src\Contrib\Dispatcher\Masa.Contrib.Dispatcher.Events\Masa.Contrib.Dispatcher.Events.csproj", "{7E0946DF-53F5-45A9-97BE-779A42E34DB6}" EndProject @@ -423,13 +423,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IntegrationEvents", "Integr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj", "{4A0491D9-F548-4367-8B96-B046A6783743}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj", "{F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.csproj", "{F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{11B7C7BA-AF7E-4695-B244-19C8B1C23E1C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj", "{16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj", "{1FC195D0-E126-4740-8720-09144C61EDD6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj", "{1FC195D0-E126-4740-8720-09144C61EDD6}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj", "{5F1F2A46-5C4C-4D0A-8C89-73785EE41340}" EndProject @@ -443,13 +443,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{174693E7-0B9 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{60C0BD3E-3A4B-4C06-9AC4-07C909FCDC2D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF", "src\Contrib\Isolation\UoW\Masa.Contrib.Isolation.UoW.EF\Masa.Contrib.Isolation.UoW.EF.csproj", "{F7801358-1D38-4697-A185-FF9DF52F3F83}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EntityFrameworkCore", "src\Contrib\Isolation\UoW\Masa.Contrib.Isolation.UoW.EntityFrameworkCore\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.csproj", "{F7801358-1D38-4697-A185-FF9DF52F3F83}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{BB77344E-0EE7-40BC-8EB8-47C1E41C9250}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EF.Tests\Masa.Contrib.Isolation.UoW.EF.Tests.csproj", "{60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj", "{60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EF.Web.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EF.Web.Tests\Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj", "{F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj", "{F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment.Tests", "src\Contrib\Isolation\Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj", "{405EDD78-48E8-490B-AE2A-713AB89AA73E}" EndProject diff --git a/README.md b/README.md index 2ca4fdd4c..5ea3401e5 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The purpose of MASA.Contrib is based on [MASA.BuildingBlocks](https://github.com * [InMemory](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md) * [Oracle](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md) * [PostgreSql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md) - * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EF/): data protocol + * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EntityFrameworkCore/): data protocol * UoW: unit of work * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EF/README.md) * IdGenerator: Unique ID generator @@ -43,16 +43,16 @@ The purpose of MASA.Contrib is based on [MASA.BuildingBlocks](https://github.com * Mapping: object mapping * [Mapster](./src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md) * [DDD](./src/Ddd/Masa.Contrib.Ddd.Domain/README.md) - * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.md): Provide warehousing services + * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.md): Provide warehousing services * Dispatcher * [EventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md): In-process events * [IntegrationEventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md): Cross-process events - * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md): Provides message management services for cross-process events + * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.md): Provides message management services for cross-process events * Isolation: Support physical isolation, logical isolation - * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.md) + * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md) * [MultiEnvironment](./src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md): MultiEnvironment * [MultiTenant](./src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md): Multi-tenancy -* [MinimalAPI](./src/Service/Masa.Contrib.Service.MinimalAPIs/README.md): Support API classification aggregation similar to Controller +* [MinimalAPI](./src/Service/Masa.Contrib.Service.Mini~~~~malAPIs/README.md): Support API classification aggregation similar to Controller * Storage: cloud storage * [Aliyun Storage](./src/Storage/Masa.Contrib.Storage.ObjectStorage.Aliyun/README.md) * Operational capacity diff --git a/README.zh-CN.md b/README.zh-CN.md index a70304ddd..24f49cb94 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -32,7 +32,7 @@ MASA.Contrib是基于[MASA.BuildingBlocks](https://github.com/masastack/MASA.Bui * [InMemory](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md) * [Oracle](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md) * [PostgreSql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md) - * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EF/): 数据规约 + * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EntityFrameworkCore/): 数据规约 * UoW: 工作单元 * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md) * IdGenerator: 唯一ID生成器 @@ -43,13 +43,13 @@ MASA.Contrib是基于[MASA.BuildingBlocks](https://github.com/masastack/MASA.Bui * Mapping: 对象映射 * [Mapster](./src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md) * [DDD](./src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md) - * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md): 提供仓储服务 + * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.zh-CN.md): 提供仓储服务 * Dispatcher * [EventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md): 进程内事件 * [IntegrationEventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md): 跨进程事件 - * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md): 为跨进程事件提供消息管理服务 + * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.zh-CN.md): 为跨进程事件提供消息管理服务 * Isolation: 支持物理隔离、逻辑隔离 - * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md) + * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md) * [MultiEnvironment](./src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md): 多环境 * [MultiTenant](./src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md): 多租户 * [MinimalAPI](./src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md): 支持类似Controller的API分类聚合 diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/DataFilter.cs similarity index 96% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/DataFilter.cs index 1e365be22..5108ddc6b 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/DataFilter.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/DataFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EF.DataFiltering; +namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.DataFiltering; public class DataFilter : IDataFilter { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/SoftDeleteSaveChangesFilter.cs similarity index 97% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/SoftDeleteSaveChangesFilter.cs index 4f406e70a..a048d8acc 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/DataFiltering/SoftDeleteSaveChangesFilter.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/SoftDeleteSaveChangesFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EF.DataFiltering; +namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.DataFiltering; public class SoftDeleteSaveChangesFilter : ISaveChangesFilter where TDbContext : DbContext diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DataFilterState.cs similarity index 81% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DataFilterState.cs index 85364dfa7..0065d7922 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DataFilterState.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DataFilterState.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EF.Internal; +namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; internal class DataFilterState { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DisposeAction.cs similarity index 83% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DisposeAction.cs index 2c179575d..cb87dcb53 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/DisposeAction.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DisposeAction.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EF.Internal; +namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; internal class DisposeAction : IDisposable { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/InstanceBuilder.cs similarity index 94% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/InstanceBuilder.cs index 09a1e0e7c..0f7286504 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/InstanceBuilder.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/InstanceBuilder.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EF.Internal; +namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; internal class InstanceBuilder { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/NullDisposable.cs similarity index 81% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/NullDisposable.cs index ad67a3355..90ec32739 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Internal/NullDisposable.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/NullDisposable.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EF.Internal; +namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; internal class NullDisposable : IDisposable { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Masa.Contrib.Data.Contracts.EntityFrameworkCore.csproj similarity index 100% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Masa.Contrib.Data.Contracts.EF.csproj rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Masa.Contrib.Data.Contracts.EntityFrameworkCore.csproj diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/MasaDbContextOptionsBuilderExtensions.cs similarity index 97% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/MasaDbContextOptionsBuilderExtensions.cs index 7584bb2ce..8c8f58b37 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EF; +namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Options/FilterOptions.cs similarity index 88% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Options/FilterOptions.cs index d9d92f32d..56efc1dde 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/Options/FilterOptions.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Options/FilterOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EF.Options; +namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Options; public class FilterOptions { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs similarity index 79% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs index 5c9e30baf..878949623 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EF/_Imports.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs @@ -4,9 +4,9 @@ global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; global using Masa.BuildingBlocks.Authentication.Identity; -global using Masa.Contrib.Data.Contracts.EF.DataFiltering; -global using Masa.Contrib.Data.Contracts.EF.Internal; -global using Masa.Contrib.Data.Contracts.EF.Options; +global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.DataFiltering; +global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; +global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.Options; global using Masa.Contrib.Data.EntityFrameworkCore; global using Masa.Contrib.Data.EntityFrameworkCore.Filters; global using Masa.Utils.Caching.Memory; diff --git a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/DataFilterTest.cs similarity index 95% rename from src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs rename to src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/DataFilterTest.cs index afc0310fe..b0251251d 100644 --- a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/DataFilterTest.cs +++ b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/DataFilterTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EF.Tests; +namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests; [TestClass] public class DataFilterTest diff --git a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj similarity index 93% rename from src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj rename to src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj index 33b5b3d0b..8abf78cee 100644 --- a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/Masa.Contrib.Data.Contracts.EF.Tests.csproj +++ b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/_Imports.cs similarity index 80% rename from src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs rename to src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/_Imports.cs index 05c2ff359..fbfb6c97e 100644 --- a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EF.Tests/_Imports.cs +++ b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/_Imports.cs @@ -2,6 +2,6 @@ // Licensed under the MIT License. See LICENSE.txt in the project root for license information. global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; -global using Masa.Contrib.Data.Contracts.EF.DataFiltering; +global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.DataFiltering; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj index 9eda3cadc..e9f43c804 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj @@ -18,7 +18,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs index ad5bdcf50..55a06cf61 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs @@ -4,7 +4,7 @@ global using Masa.BuildingBlocks.Data; global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; global using Masa.BuildingBlocks.Data.Contracts.Paginated; -global using Masa.Contrib.Data.Contracts.EF; +global using Masa.Contrib.Data.Contracts.EntityFrameworkCore; global using Masa.Contrib.Data.EntityFrameworkCore.Filters; global using Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; global using Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md index 1f2182399..06a481cfd 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md @@ -6,7 +6,7 @@ ```c# Install-Package Masa.Contrib.Data.EntityFrameworkCore -Install-Package Masa.Contrib.Data.Contracts.EF +Install-Package Masa.Contrib.Data.Contracts.EntityFrameworkCore Install-Package Microsoft.EntityFrameworkCore.SqlServer//这里以SqlServer举例 ``` diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/DispatcherOptionsExtensions.cs similarity index 93% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/DispatcherOptionsExtensions.cs index bb6151953..11407494d 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/DispatcherOptionsExtensions.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/DispatcherOptionsExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EF; +namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore; public static class DispatcherOptionsExtensions { diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/LinqExtensions.cs similarity index 98% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/LinqExtensions.cs index 262255fc0..2042bdc78 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/LinqExtensions.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/LinqExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Internal; +namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Internal; internal static class LinqExtensions { diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/ServiceCollectionRepositoryExtensions.cs similarity index 97% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/ServiceCollectionRepositoryExtensions.cs index 2dae71cb8..086174de9 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/ServiceCollectionRepositoryExtensions.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/ServiceCollectionRepositoryExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Internal; +namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Internal; internal static class ServiceCollectionRepositoryExtensions { diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/TypeExtensions.cs similarity index 88% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/TypeExtensions.cs index 50746c304..af1d20750 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Internal/TypeExtensions.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/TypeExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Internal; +namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Internal; internal static class TypeExtensions { diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.csproj similarity index 100% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Masa.Contrib.Ddd.Domain.Repository.EF.csproj rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.csproj diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.md similarity index 91% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.md rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.md index 08c0f8c37..4aff6c76b 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.md +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Ddd.Domain.Repository.EF +## Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore Example: ```c# -Install-Package Masa.Contrib.Ddd.Domain.Repository.EF +Install-Package Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore ``` > Advantages: The EF version of IRepository provides basic CRUD diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.zh-CN.md similarity index 91% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.zh-CN.md index 4770e9e1c..12ccf06ce 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/README.zh-CN.md +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Ddd.Domain.Repository.EF +## Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore 用例: ```c# -Install-Package Masa.Contrib.Ddd.Domain.Repository.EF +Install-Package Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore ``` > 优势:IRepository的EF版实现,提供了基础的CRUD diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Repository.cs similarity index 99% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Repository.cs index 08d615825..22fa24045 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/Repository.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Repository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EF; +namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore; public class Repository : BaseRepository diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs similarity index 90% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs index 5fea19f73..496da870c 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EF/_Imports.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs @@ -5,7 +5,7 @@ global using Masa.BuildingBlocks.Ddd.Domain.Entities; global using Masa.BuildingBlocks.Ddd.Domain.Repositories; global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Ddd.Domain.Repository.EF.Internal; +global using Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Internal; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Storage; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md index 673abbee7..2eea9359d 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md @@ -6,12 +6,12 @@ Example: ```c# Install-Package Masa.Contrib.Ddd.Domain -Install-Package Masa.Contrib.Ddd.Domain.Repository.EF +Install-Package Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore Install-Package Masa.Contrib.Dispatcher.Events Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore Install-Package Masa.Contrib.Data.UoW.EF Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer ``` diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md index f8af90b57..02ea5c25f 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md @@ -6,12 +6,12 @@ ```c# Install-Package Masa.Contrib.Ddd.Domain -Install-Package Masa.Contrib.Ddd.Domain.Repository.EF +Install-Package Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore Install-Package Masa.Contrib.Dispatcher.Events Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore Install-Package Masa.Contrib.Data.UoW.EF Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer ``` diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Address.cs similarity index 87% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Address.cs index 174a0114d..7277ae71e 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Address.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Address.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; +namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.Domain.Entities; public class Address : ValueObject { diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/OrderItem.cs similarity index 83% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/OrderItem.cs index 0ce6f25bd..34ccd939f 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/OrderItem.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/OrderItem.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; +namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.Domain.Entities; public class OrderItem : Entity { diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Orders.cs similarity index 91% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Orders.cs index 9660fdbe6..03077cd02 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Domain/Entities/Orders.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Orders.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; +namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.Domain.Entities; public class Orders : AuditAggregateRoot { diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj similarity index 91% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj index 7eb4970a0..bf47f9c5d 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests.csproj +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/RepositoryTest.cs similarity index 99% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/RepositoryTest.cs index 5c71a7669..89f46a119 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/RepositoryTest.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/RepositoryTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EF.Tests; +namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests; [TestClass] public class RepositoryTest diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs similarity index 88% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs index 74b5a26bc..d5f19f519 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EF.Tests/_Imports.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs @@ -11,6 +11,6 @@ global using Masa.BuildingBlocks.Ddd.Domain.Entities; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; global using Masa.BuildingBlocks.Ddd.Domain.Values; -global using Masa.Contrib.Ddd.Domain.Repository.EF.Tests.Domain.Entities; global using Masa.BuildingBlocks.Data.UoW; global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; +global using Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.Domain.Entities; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md index 89e48253f..69370523b 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md @@ -7,7 +7,7 @@ Example: ```C# Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //Use cross-process Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //Send cross-process messages -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //Record cross-process message logs +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore //Record cross-process message logs Install-Package Masa.Contrib.Data.UoW.EF //Use UnitOfWork Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // Use SqlServer ``` diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md index d99cdfc64..b891e82ae 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md @@ -7,7 +7,7 @@ ```C# Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //使用跨进程事件 Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //通过dapr完成跨进程事件 -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //记录跨进程消息日志 +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore //记录跨进程消息日志 Install-Package Masa.Contrib.Data.UoW.EF //使用工作单元 Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // 使用SqlServer ``` diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/DispatcherOptionsExtensions.cs similarity index 94% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/DispatcherOptionsExtensions.cs index ed85e1da8..88c990bce 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/DispatcherOptionsExtensions.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/DispatcherOptionsExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; public static class DispatcherOptionsExtensions { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogContext.cs similarity index 83% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogContext.cs index b9321e39d..8e4ad4ba0 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogContext.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; public class IntegrationEventLogContext { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogEntityTypeConfiguration.cs similarity index 94% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogEntityTypeConfiguration.cs index 118d0936c..48c7c422d 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogEntityTypeConfiguration.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; public class IntegrationEventLogEntityTypeConfiguration: IEntityTypeConfiguration { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogModelCreatingProvider.cs similarity index 85% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogModelCreatingProvider.cs index ab4d49be3..aa98dd7ab 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogModelCreatingProvider.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogModelCreatingProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; public class IntegrationEventLogModelCreatingProvider : IModelCreatingProvider { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogService.cs similarity index 98% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogService.cs index f8c21ddfd..7bd7ba26b 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/IntegrationEventLogService.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; public class IntegrationEventLogService : IIntegrationEventLogService { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.csproj similarity index 100% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.csproj rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.csproj diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.md similarity index 78% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.md index 2b144ed68..2505c112f 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.md @@ -1,13 +1,13 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore > Provide support for sending IntegrationEvent Example: ```C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore ``` 1. Add EventLogs.EF diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.zh-CN.md similarity index 77% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.zh-CN.md index e994ab67f..8767d875a 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/README.zh-CN.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.zh-CN.md @@ -1,13 +1,13 @@ 中 | [EN](README.md) -## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore > 为发送IntegrationEvent提供支持 用例: ```C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore ``` 1. 使用EventLogs.EF diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/_Imports.cs similarity index 100% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/_Imports.cs diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md index fd7da4bf1..1ced535f3 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md @@ -28,10 +28,10 @@ builder.Services 1.2 Use the provided EF version of the local message service -Install `Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF` +Install `Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore` ``` C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //Record cross-process message log +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore //Record cross-process message log ``` ``` C# diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md index f5f1810b2..35d782a4b 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md @@ -28,10 +28,10 @@ builder.Services 1.2 使用提供的EF版的本地消息服务 -安装`Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF` +安装`Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore` ``` C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF //记录跨进程消息日志 +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore //记录跨进程消息日志 ``` ```C# diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Domain/Entities/User.cs similarity index 69% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Domain/Entities/User.cs index b83c9b1fe..7ff5b8608 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Domain/Entities/User.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Domain/Entities/User.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Domain.Entities; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Domain.Entities; public class User { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/IntegrationEvent.cs similarity index 89% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/IntegrationEvent.cs index f7403095a..de96a6714 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/IntegrationEvent.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/IntegrationEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Events; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Events; public abstract record IntegrationEvent : IIntegrationEvent { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs similarity index 80% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs index 93ff694be..bd1006d2d 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Events; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Events; internal record OrderPaymentSucceededIntegrationEvent : IntegrationEvent { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Infrastructure/CustomDbContext.cs similarity index 77% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Infrastructure/CustomDbContext.cs index b76ea0101..f6b059e0f 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Infrastructure/CustomDbContext.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Infrastructure/CustomDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Infrastructure; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Infrastructure; internal class CustomDbContext : MasaDbContext { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogContextTest.cs similarity index 97% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogContextTest.cs index f19970b41..5f374a4e4 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogContextTest.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogContextTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests; [TestClass] public class IntegrationEventLogContextTest : TestBase diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogServiceTest.cs similarity index 99% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogServiceTest.cs index 71c610d92..dc8e8f2bf 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/IntegrationEventLogServiceTest.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogServiceTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests; [TestClass] public class IntegrationEventLogServiceTest : TestBase diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj similarity index 92% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj index 1f2a52fee..89ee0ef49 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.csproj +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj @@ -25,7 +25,7 @@ - + diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/TestBase.cs similarity index 91% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/TestBase.cs index 1808bb4e2..b741c724f 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/TestBase.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/TestBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests; public class TestBase : IDisposable { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/_Imports.cs similarity index 89% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/_Imports.cs index ee23b3b12..cdd8dd262 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/_Imports.cs @@ -6,9 +6,9 @@ global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Domain.Entities; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Events; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests.Infrastructure; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Domain.Entities; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Events; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Infrastructure; global using Microsoft.Data.Sqlite; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Storage; diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md index f34381cfc..a1cbd2589 100644 --- a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md @@ -192,7 +192,7 @@ Runtime=.NET 6.0 IterationCount=100 RunStrategy=ColdStart ##### Summarize -IEventBus is the core of the event bus. It can be used with Cqrs, Uow, Masa.Contrib.Ddd.Domain.Repository.EF to automatically execute SaveChange (enable UoW) and Commit (enable UoW without closing transaction) operations after sending Command, And support to roll back the transaction after an exception occurs +IEventBus is the core of the event bus. It can be used with Cqrs, Uow, Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore to automatically execute SaveChange (enable UoW) and Commit (enable UoW without closing transaction) operations after sending Command, And support to roll back the transaction after an exception occurs > Question 1. Publishing events through eventBus, Handler error -> and handler throw exception @@ -203,7 +203,7 @@ IEventBus is the core of the event bus. It can be used with Cqrs, Uow, Masa.Cont > Question 2. Under what circumstances will SaveChange be automatically saved -> When auto call SaveChange? - > Use UoW and Masa.Contrib.Ddd.Domain.Repository.EF, and use the Add, Update, Delete operations provided by IRepository, publish events through EventBus, and automatically execute SaveChange after executing EventHandler + > Use UoW and Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore, and use the Add, Update, Delete operations provided by IRepository, publish events through EventBus, and automatically execute SaveChange after executing EventHandler > Question 3. If the SaveChange method of UoW is manually called in EventHandler to save, will the framework also save automatically? diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md index e4a5dd061..aa6ed2482 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md @@ -5,7 +5,7 @@ Example: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore Install-Package Masa.Contrib.Isolation.MultiEnvironment Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer ``` diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md index 4aa69480c..5441414d4 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md @@ -5,7 +5,7 @@ 用例: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore Install-Package Masa.Contrib.Isolation.MultiEnvironment Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer ``` diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md index b5c366fd9..0cdfbcea4 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md @@ -5,7 +5,7 @@ Example: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore Install-Package Masa.Contrib.Isolation.MultiTenant Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer ``` diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md index 65a69b8fb..84b4b2ddc 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md @@ -5,7 +5,7 @@ 用例: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EF +Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore Install-Package Masa.Contrib.Isolation.MultiTenant Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer ``` diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md index 01ddc5466..b80ff6dd8 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md @@ -2,4 +2,4 @@ ## Masa.Contrib.Isolation -The core library of Masa.Contrib.Isolation provides database address selection and parser for Isolation. It does not support stand-alone use yet. It needs to be used through Masa.Contrib.Isolation.UoW.EF. [View usage](../Masa.Contrib.Isolation.UoW.EF/README.md) \ No newline at end of file +The core library of Masa.Contrib.Isolation provides database address selection and parser for Isolation. It does not support stand-alone use yet. It needs to be used through Masa.Contrib.Isolation.UoW.EntityFrameworkCore. [View usage](../Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md) \ No newline at end of file diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md index cee55a777..70e23cfd8 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md @@ -2,4 +2,4 @@ ## Masa.Contrib.Isolation -Masa.Contrib.Isolation核心库,为Isolation提供数据库地址选择以及解析器,暂不支持单独使用,需要通过Masa.Contrib.Isolation.UoW.EF来使用,[查看用法](../Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md) \ No newline at end of file +Masa.Contrib.Isolation核心库,为Isolation提供数据库地址选择以及解析器,暂不支持单独使用,需要通过Masa.Contrib.Isolation.UoW.EF来使用,[查看用法](../Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md) \ No newline at end of file diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/DispatcherOptionsExtensions.cs similarity index 98% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/DispatcherOptionsExtensions.cs index 73bb2f01a..f51e78c41 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/DispatcherOptionsExtensions.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/DispatcherOptionsExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore; public static class DispatcherOptionsExtensions { diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Internal/TypeExtensions.cs similarity index 88% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Internal/TypeExtensions.cs index 6a2bbec3b..7b134746c 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Internal/TypeExtensions.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Internal/TypeExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Internal; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Internal; internal static class TypeExtensions { diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationDbContext.cs similarity index 98% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationDbContext.cs index bc054d6b1..7f3a5ad30 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationDbContext.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore; /// /// DbContext providing isolation diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationSaveChangesFilter.cs similarity index 97% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationSaveChangesFilter.cs index 43be7b9a1..d493deded 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/IsolationSaveChangesFilter.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationSaveChangesFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore; public class IsolationSaveChangesFilter : ISaveChangesFilter where TTenantId : IComparable { diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.csproj similarity index 100% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/Masa.Contrib.Isolation.UoW.EF.csproj rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.csproj diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.md b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md similarity index 95% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.md rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md index 2ec875fb9..3ba9f9eed 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.md +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md @@ -1,12 +1,12 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Isolation.UoW.EF +## Masa.Contrib.Isolation.UoW.EntityFrameworkCore Example: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EF -Install-Package Masa.Contrib.Data.Contracts.EF +Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore +Install-Package Masa.Contrib.Data.Contracts.EntityFrameworkCore Install-Package Masa.Contrib.Isolation.MultiEnvironment // Environmental isolation Quote on demand Install-Package Masa.Contrib.Isolation.MultiTenant // Multi-tenant isolation On-demand reference Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md similarity index 94% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md index 4eb2bc41b..e66cfc0a4 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/README.zh-CN.md +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md @@ -1,12 +1,12 @@ 中 | [EN](README.md) -## Masa.Contrib.Isolation.UoW.EF +## Masa.Contrib.Isolation.UoW.EntityFrameworkCore 用例: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EF -Install-Package Masa.Contrib.Data.Contracts.EF +Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore +Install-Package Masa.Contrib.Data.Contracts.EntityFrameworkCore Install-Package Masa.Contrib.Isolation.MultiEnvironment // 环境隔离 按需引用 Install-Package Masa.Contrib.Isolation.MultiTenant // 多租户隔离 按需引用 Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/_Imports.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/_Imports.cs similarity index 92% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/_Imports.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/_Imports.cs index 0c716833b..b48f8ab2c 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EF/_Imports.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/_Imports.cs @@ -9,7 +9,7 @@ global using Masa.Contrib.Data.EntityFrameworkCore; global using Masa.Contrib.Data.EntityFrameworkCore.Filters; global using Masa.Contrib.Data.UoW.EF; -global using Masa.Contrib.Isolation.UoW.EF.Internal; +global using Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Internal; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.ChangeTracking; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/CustomDbContext.cs similarity index 95% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/CustomDbContext.cs index c0e8e0624..e56851018 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/CustomDbContext.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/CustomDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Tests; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests; public class CustomDbContext : MasaDbContext { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj similarity index 90% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj index d4f60e986..0f04e3f44 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/Masa.Contrib.Isolation.UoW.EF.Tests.csproj +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj @@ -30,11 +30,11 @@ - + - + diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestBase.cs similarity index 88% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestBase.cs index 8e2d90ed5..9ccec49a6 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/TestBase.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests; public class TestBase : IDisposable { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestIsolation.cs similarity index 99% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestIsolation.cs index 16e21e12a..73178085d 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestIsolation.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestIsolation.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Tests; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests; [TestClass] public class TestIsolation : TestBase diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/_Imports.cs similarity index 94% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/_Imports.cs index 39f2e841b..142587b26 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/_Imports.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/_Imports.cs @@ -8,7 +8,7 @@ global using Masa.BuildingBlocks.Isolation.Environment; global using Masa.BuildingBlocks.Isolation.MultiTenant; global using Masa.BuildingBlocks.Isolation.Options; -global using Masa.Contrib.Data.Contracts.EF; +global using Masa.Contrib.Data.Contracts.EntityFrameworkCore; global using Masa.Contrib.Data.EntityFrameworkCore; global using Masa.Contrib.Isolation.MultiEnvironment; global using Masa.Contrib.Isolation.MultiTenant; diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/appsettings.json similarity index 100% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/appsettings.json rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/appsettings.json diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/CustomDbContext.cs similarity index 96% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/CustomDbContext.cs index 645ea5c6a..c88ab3d95 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/CustomDbContext.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/CustomDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests; public class CustomDbContext : IsolationDbContext { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EdgeDriverTest.cs similarity index 97% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EdgeDriverTest.cs index 1e4407e15..dd2e9f65b 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EdgeDriverTest.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EdgeDriverTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests; [TestClass] public class EdgeDriverTest diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/AddRoleEventHandler.cs similarity index 96% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/AddRoleEventHandler.cs index 9f3922a82..9260102ab 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/AddRoleEventHandler.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/AddRoleEventHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.EventHandlers; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.EventHandlers; public class AddRoleEventHandler { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/RegisterUserEventHandler.cs similarity index 96% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/RegisterUserEventHandler.cs index d8ecd5d51..e0d23c464 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/EventHandlers/RegisterUserEventHandler.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/RegisterUserEventHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.EventHandlers; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.EventHandlers; public class RegisterUserEventHandler { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/AddRoleEvent.cs similarity index 73% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/AddRoleEvent.cs index c52982224..fcef7e0df 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/AddRoleEvent.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/AddRoleEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.Events; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.Events; public record AddRoleEvent(string Name,int Quantity) : Event { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/RegisterUserEvent.cs similarity index 75% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/RegisterUserEvent.cs index 5e8aca201..bd7881053 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Events/RegisterUserEvent.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/RegisterUserEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Web.Tests.Events; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.Events; public record RegisterUserEvent(string Account,string Password) : Event { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj similarity index 90% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj index 3a012fca1..58de48059 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests.csproj +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj @@ -24,12 +24,12 @@ - + - + diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/TestBase.cs similarity index 88% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/TestBase.cs index 2a37498ed..ce7e74fa3 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Tests/TestBase.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/TestBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EF.Tests; +namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests; public class TestBase : IDisposable { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/_Imports.cs similarity index 88% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/_Imports.cs index 1b483b585..47b197a75 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/_Imports.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/_Imports.cs @@ -5,12 +5,12 @@ global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.BuildingBlocks.Isolation; global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.Contrib.Data.Contracts.EF; +global using Masa.Contrib.Data.Contracts.EntityFrameworkCore; global using Masa.Contrib.Data.EntityFrameworkCore; global using Masa.Contrib.Dispatcher.Events; global using Masa.Contrib.Isolation.MultiEnvironment; global using Masa.Contrib.Isolation.MultiTenant; -global using Masa.Contrib.Isolation.UoW.EF.Web.Tests.Events; +global using Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.Events; global using Masa.Utils.Security.Cryptography; global using Microsoft.AspNetCore.Http; global using Microsoft.Data.Sqlite; diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/appsettings.json similarity index 100% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EF.Web.Tests/appsettings.json rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/appsettings.json diff --git a/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj index aded19b0e..0c3301750 100644 --- a/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj +++ b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj @@ -20,12 +20,12 @@ - + - + - + diff --git a/test/Masa.EventBus.IntegrationTests/_Imports.cs b/test/Masa.EventBus.IntegrationTests/_Imports.cs index a4005053d..9ad7336f7 100644 --- a/test/Masa.EventBus.IntegrationTests/_Imports.cs +++ b/test/Masa.EventBus.IntegrationTests/_Imports.cs @@ -9,13 +9,13 @@ global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; -global using Masa.Contrib.Data.Contracts.EF; +global using Masa.Contrib.Data.Contracts.EntityFrameworkCore; global using Masa.Contrib.Data.EntityFrameworkCore; global using Masa.Contrib.Data.UoW.EF; -global using Masa.Contrib.Ddd.Domain.Repository.EF; +global using Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore; global using Masa.Contrib.Dispatcher.Events; global using Masa.Contrib.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.DependencyInjection.Extensions; From 83692a88ce454a22e58f147188a4d8a790cd4d47 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 17:55:47 +0800 Subject: [PATCH 17/29] rename: Benchmark rename to Tests.Benchmark --- Masa.Framework.sln | 6 +++--- .../DistributedBenchmarks.cs | 2 +- ...tor.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj} | 0 .../Program.cs | 2 +- .../_Imports.cs | 0 .../Benchmarks.cs | 2 +- ...trib.Data.IdGenerator.Snowflake.Tests.Benchmarks.csproj} | 0 .../Program.cs | 2 +- .../_Imports.cs | 0 .../Benchmarks.cs | 2 +- .../Extensions/EventHandlers/AddShoppingCartEventHandler.cs | 4 +--- .../Extensions/EventHandlers/CouponHandler.cs | 4 +--- .../Extensions/Events/AddShoppingCartEvent.cs | 2 +- .../Extensions/Events/RegisterUserEvent.cs | 2 +- .../Extensions/Middleware/LoggingMiddleware.cs | 2 +- .../Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj} | 0 .../Program.cs | 2 +- .../_Imports.cs | 4 ++-- 18 files changed, 16 insertions(+), 20 deletions(-) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/{Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks => Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks}/DistributedBenchmarks.cs (98%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/{Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj => Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj} (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/{Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks => Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks}/Program.cs (96%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/{Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks => Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks}/_Imports.cs (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/{Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks => Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks}/Benchmarks.cs (97%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/{Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj => Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks.csproj} (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/{Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks => Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks}/Program.cs (87%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/{Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks => Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks}/_Imports.cs (100%) rename src/Contrib/Dispatcher/Tests/Benchmarks/{Masa.Contrib.Dispatcher.Events.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Benchmarks}/Benchmarks.cs (97%) rename src/Contrib/Dispatcher/Tests/Benchmarks/{Masa.Contrib.Dispatcher.Events.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Benchmarks}/Extensions/EventHandlers/AddShoppingCartEventHandler.cs (76%) rename src/Contrib/Dispatcher/Tests/Benchmarks/{Masa.Contrib.Dispatcher.Events.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Benchmarks}/Extensions/EventHandlers/CouponHandler.cs (91%) rename src/Contrib/Dispatcher/Tests/Benchmarks/{Masa.Contrib.Dispatcher.Events.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Benchmarks}/Extensions/Events/AddShoppingCartEvent.cs (78%) rename src/Contrib/Dispatcher/Tests/Benchmarks/{Masa.Contrib.Dispatcher.Events.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Benchmarks}/Extensions/Events/RegisterUserEvent.cs (78%) rename src/Contrib/Dispatcher/Tests/Benchmarks/{Masa.Contrib.Dispatcher.Events.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Benchmarks}/Extensions/Middleware/LoggingMiddleware.cs (89%) rename src/Contrib/Dispatcher/Tests/Benchmarks/{Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj => Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj} (100%) rename src/Contrib/Dispatcher/Tests/Benchmarks/{Masa.Contrib.Dispatcher.Events.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Benchmarks}/Program.cs (89%) rename src/Contrib/Dispatcher/Tests/Benchmarks/{Masa.Contrib.Dispatcher.Events.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Benchmarks}/_Imports.cs (79%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 1401b6956..c77d0a267 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -345,7 +345,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerat EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{55DCA34D-48CE-4D32-8515-B6583FA548AE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj", "{5957E2B1-A517-4225-8517-71D3B0B29B90}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks.csproj", "{5957E2B1-A517-4225-8517-71D3B0B29B90}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster", "src\Contrib\Data\Mapping\Masa.Contrib.Data.Mapping.Mapster\Masa.Contrib.Data.Mapping.Mapster.csproj", "{11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}" EndProject @@ -413,7 +413,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Eve EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj", "{45A38571-F3B7-4F82-AD83-1BD9D74D27C2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Benchmarks", "src\Contrib\Dispatcher\Tests\Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks\Masa.Contrib.Dispatcher.Events.Benchmarks.csproj", "{32767187-B7F0-4A67-909D-C1FB6F940FCC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Benchmarks", "src\Contrib\Dispatcher\Tests\Benchmarks\Masa.Contrib.Dispatcher.Events.Tests.Benchmarks\Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj", "{32767187-B7F0-4A67-909D-C1FB6F940FCC}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{08FC046F-D74F-43A6-8755-25BFC443DA96}" EndProject @@ -529,7 +529,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.Object EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.OpenIdConnect.Models", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.OpenIdConnect.Models\Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.csproj", "{9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj", "{7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj", "{7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj", "{1E82EC06-25F3-49E2-BAB6-978CE2896ACC}" EndProject diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/DistributedBenchmarks.cs similarity index 98% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/DistributedBenchmarks.cs index f3a67128f..00ab34915 100644 --- a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/DistributedBenchmarks.cs +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/DistributedBenchmarks.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks; /// /// Only supports the use of Redis environment diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks.csproj rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Program.cs similarity index 96% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Program.cs index d8860fe0a..777c4ed2c 100644 --- a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/Program.cs +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks; class Program { diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/_Imports.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Benchmarks/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/_Imports.cs diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Benchmarks.cs similarity index 97% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Benchmarks.cs index f9899456b..1e8200c39 100644 --- a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Benchmarks.cs +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Benchmarks.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks; [MarkdownExporter, AsciiDocExporter, HtmlExporter] [SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 1000)] diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks.csproj similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks.csproj rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks.csproj diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Program.cs similarity index 87% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Program.cs index 422680280..568f3dd45 100644 --- a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/Program.cs +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks; class Program { diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/_Imports.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Benchmarks/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/_Imports.cs diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs similarity index 97% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs rename to src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs index b09f5a7cd..7e79f3056 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Benchmarks.cs +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Benchmarks; +namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks; [MarkdownExporter, AsciiDocExporter, HtmlExporter] [SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100)] diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs similarity index 76% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs rename to src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs index b788ac541..ae2b38deb 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs @@ -1,9 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; - -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; +namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.EventHandlers; public class AddShoppingCartEventHandler : IRequestHandler { diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs similarity index 91% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs rename to src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs index 87c019e6e..91af4a72c 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/EventHandlers/CouponHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs @@ -1,9 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; - -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; +namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.EventHandlers; public class CouponHandler { diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs similarity index 78% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs rename to src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs index 4b92d5b9d..49769fc8b 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Events; public record AddShoppingCartEvent : Event, IRequest { diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs similarity index 78% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs rename to src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs index c3c720563..ed65561c2 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Events/RegisterUserEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Events; public record RegisterUserEvent : Event { diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs similarity index 89% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs rename to src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs index 9aed0a5bf..ee32f7890 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Middleware; +namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Middleware; public class LoggingMiddleware : Middleware where TEvent : notnull, IEvent { diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks.csproj rename to src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs similarity index 89% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs rename to src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs index e1b4af502..fe7b79603 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/Program.cs +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Benchmarks; +namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks; class Program { diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs similarity index 79% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs index cb2ba6dbc..9bcf23a91 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Benchmarks/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs @@ -8,11 +8,11 @@ global using BenchmarkDotNet.Running; global using BenchmarkDotNet.Validators; global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.EventHandlers; -global using Masa.Contrib.Dispatcher.Events.Benchmarks.Extensions.Events; global using Masa.Contrib.Dispatcher.Events.Enums; global using MediatR; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.Logging; global using System; global using System.Threading.Tasks; +global using Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.EventHandlers; +global using Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Events; From d948c429995ecbd5be76707ab2e48886fa827891 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 18:06:46 +0800 Subject: [PATCH 18/29] chore: global using sort --- .../_Imports.cs | 2 -- .../Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs | 2 +- .../_Imports.cs | 1 - .../Masa.Contrib.Configuration/_Imports.cs | 1 - .../EsOptions.cs | 2 +- .../_Imports.cs | 2 +- .../_Imports.cs | 2 -- .../_Imports.cs | 2 -- .../_Imports.cs | 2 +- .../_Imports.cs | 3 --- .../_Imports.cs | 16 +++++++--------- .../_Imports.cs | 4 ++-- .../Masa.Contrib.Service.Caller/_Imports.cs | 2 +- .../Masa.Contrib.StackSdks.Auth/_Imports.cs | 6 +++--- .../Masa.Contrib.StackSdks.Mc/_Imports.cs | 4 ++-- .../Masa.Contrib.StackSdks.Scheduler/_Imports.cs | 4 ++-- .../Masa.Contrib.StackSdks.Tsc/_Imports.cs | 5 ++--- .../_Imports.cs | 4 ++-- .../Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs | 2 +- .../Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs | 2 +- .../Caller/Masa.Utils.Caller.Core/_Imports.cs | 2 +- .../_Imports.cs | 6 +++--- .../Masa.Utils.Ldap.Novell.Tests/_Imports.cs | 1 - test/Masa.EventBus.IntegrationTests/_Imports.cs | 8 ++++---- 24 files changed, 35 insertions(+), 50 deletions(-) diff --git a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs index b6f0781ac..f5c8cbc4c 100644 --- a/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs +++ b/src/BuildingBlocks/Data/Masa.BuildingBlocks.Data.Contracts/_Imports.cs @@ -1,5 +1,3 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Microsoft.Extensions.DependencyInjection; -global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs index e2152a3c0..a8e8f37a7 100644 --- a/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs +++ b/src/BuildingBlocks/StackSdks/Masa.BuildingBlocks.StackSdks.Mc/_Imports.cs @@ -1,8 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +global using Masa.BuildingBlocks.Ddd.Domain.Repositories; global using Masa.BuildingBlocks.StackSdks.Mc.Enum; global using Masa.BuildingBlocks.StackSdks.Mc.Model; global using Masa.BuildingBlocks.StackSdks.Mc.Service; -global using Masa.BuildingBlocks.Ddd.Domain.Repositories; global using System.Collections.Concurrent; diff --git a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs index 16a47c504..ecc3e19bb 100644 --- a/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs +++ b/src/BuildingBlocks/Storage/Masa.BuildingBlocks.Storage.ObjectStorage/_Imports.cs @@ -2,5 +2,4 @@ // Licensed under the MIT License. See LICENSE.txt in the project root for license information. global using Masa.BuildingBlocks.Storage.ObjectStorage.Response; -global using Microsoft.Extensions.Options; global using System.Reflection; diff --git a/src/Contrib/Configuration/Masa.Contrib.Configuration/_Imports.cs b/src/Contrib/Configuration/Masa.Contrib.Configuration/_Imports.cs index 9d41a9afa..02f1a9c44 100644 --- a/src/Contrib/Configuration/Masa.Contrib.Configuration/_Imports.cs +++ b/src/Contrib/Configuration/Masa.Contrib.Configuration/_Imports.cs @@ -5,7 +5,6 @@ global using Masa.BuildingBlocks.Configuration.Options; global using Masa.Contrib.Configuration; global using Masa.Contrib.Configuration.Internal; -global using Microsoft.AspNetCore.Builder; global using Microsoft.Extensions.Configuration; global using Microsoft.Extensions.Configuration.CommandLine; global using Microsoft.Extensions.Configuration.EnvironmentVariables; diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs index 3d06cf9d2..046344fa5 100644 --- a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs +++ b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests; diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs index 878949623..9df7da147 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs @@ -1,9 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; -global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.DataFiltering; global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.Options; diff --git a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs index 7c77986d2..1109a8e81 100644 --- a/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs +++ b/src/Contrib/Data/DistributedLock/Medallion/Masa.Contrib.Data.DistributedLock.Medallion.Tests/_Imports.cs @@ -1,6 +1,4 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.Data; -global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/_Imports.cs index d9175cc2d..0ae5f9403 100644 --- a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/_Imports.cs +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/_Imports.cs @@ -5,9 +5,7 @@ global using BenchmarkDotNet.Configs; global using BenchmarkDotNet.Engines; global using BenchmarkDotNet.Jobs; -global using BenchmarkDotNet.Running; global using BenchmarkDotNet.Validators; global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis; global using Masa.Utils.Caching.Redis.Models; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs index f6ea7ad41..19c261ac6 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs @@ -1,6 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.BuildingBlocks.Configuration; global using Masa.BuildingBlocks.Data; global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; @@ -8,7 +9,6 @@ global using Masa.BuildingBlocks.Ddd.Domain.Entities; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.Contrib.Data.EntityFrameworkCore; global using Masa.Contrib.Data.EntityFrameworkCore.Filters; global using Microsoft.EntityFrameworkCore; diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs index 496da870c..9bfc8b910 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs @@ -7,11 +7,8 @@ global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Internal; global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Storage; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.DependencyInjection.Extensions; -global using System.Data.Common; global using System.Linq.Expressions; global using System.Reflection; global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; -global using System.Runtime.CompilerServices; diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs index d5f19f519..11bec7090 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs @@ -1,16 +1,14 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System; -global using System.Collections.Generic; -global using System.Linq; -global using System.Reflection; -global using Microsoft.EntityFrameworkCore; -global using Moq; +global using Masa.BuildingBlocks.Data.UoW; global using Masa.BuildingBlocks.Ddd.Domain.Entities; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; global using Masa.BuildingBlocks.Ddd.Domain.Values; -global using Masa.BuildingBlocks.Data.UoW; -global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; global using Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.Domain.Entities; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using Moq; +global using System; +global using System.Collections.Generic; +global using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs index 9bcf23a91..2ef29116f 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs @@ -9,10 +9,10 @@ global using BenchmarkDotNet.Validators; global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.Contrib.Dispatcher.Events.Enums; +global using Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.EventHandlers; +global using Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Events; global using MediatR; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.Logging; global using System; global using System.Threading.Tasks; -global using Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.EventHandlers; -global using Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Events; diff --git a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs index 8b5980904..4af042b46 100644 --- a/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs +++ b/src/Contrib/Service/Caller/Masa.Contrib.Service.Caller/_Imports.cs @@ -16,7 +16,7 @@ global using System.Net.Http.Json; global using System.Reflection; global using System.Runtime.ExceptionServices; +global using System.Text; global using System.Text.Json; global using System.Text.Json.Serialization; -global using System.Text; global using System.Xml.Serialization; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs index cd48f1240..cfb8f43c3 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Auth/_Imports.cs @@ -1,12 +1,12 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.BuildingBlocks.StackSdks.Auth; -global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; -global using Masa.BuildingBlocks.StackSdks.Auth.Service; global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.Service.Caller.Options; +global using Masa.BuildingBlocks.StackSdks.Auth; +global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; +global using Masa.BuildingBlocks.StackSdks.Auth.Service; global using Masa.Contrib.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; global using Masa.Contrib.StackSdks.Auth; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs index 5d3a074ce..3f185237d 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Mc/_Imports.cs @@ -1,11 +1,11 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +global using Masa.BuildingBlocks.Service.Caller; +global using Masa.BuildingBlocks.Service.Caller.Options; global using Masa.BuildingBlocks.StackSdks.Mc; global using Masa.BuildingBlocks.StackSdks.Mc.Model; global using Masa.BuildingBlocks.StackSdks.Mc.Service; -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.BuildingBlocks.Service.Caller.Options; global using Masa.Contrib.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; global using Masa.Contrib.StackSdks.Mc; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs index 57d942dd5..68c03e4ee 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Scheduler/_Imports.cs @@ -3,10 +3,10 @@ global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.Service.Caller.Options; -global using Masa.Contrib.StackSdks.Scheduler; -global using Masa.Contrib.StackSdks.Scheduler.Services; global using Masa.Contrib.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Contrib.StackSdks.Scheduler; +global using Masa.Contrib.StackSdks.Scheduler.Services; global using Microsoft.AspNetCore.Authentication; global using Microsoft.AspNetCore.Http; global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs index c98d95f23..5c3d57f9d 100644 --- a/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs +++ b/src/Contrib/StackSdks/Masa.Contrib.StackSdks.Tsc/_Imports.cs @@ -1,15 +1,14 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.StackSdks.Tsc; global using Masa.BuildingBlocks.StackSdks.Tsc.Model; global using Masa.BuildingBlocks.StackSdks.Tsc.Service; -global using Masa.BuildingBlocks.Service.Caller; -global using Masa.Contrib.StackSdks.Tsc; global using Masa.Contrib.Service.Caller; global using Masa.Contrib.Service.Caller.HttpClient; +global using Masa.Contrib.StackSdks.Tsc; global using Microsoft.AspNetCore.Http; -global using Microsoft.Extensions.DependencyInjection; global using OpenTelemetry.Contrib.Instrumentation.ElasticsearchClient; global using OpenTelemetry.Contrib.Instrumentation.EntityFrameworkCore; global using OpenTelemetry.Instrumentation.AspNetCore; diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs index c187915a5..9b94452ef 100644 --- a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Auth.Tests/_Imports.cs @@ -1,11 +1,11 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +global using Masa.BuildingBlocks.Authentication.Identity; +global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.StackSdks.Auth; global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Enum; global using Masa.BuildingBlocks.StackSdks.Auth.Contracts.Model; -global using Masa.BuildingBlocks.Authentication.Identity; -global using Masa.BuildingBlocks.Service.Caller; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; global using Moq; diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs index d8723b800..8acdae0c9 100644 --- a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Mc.Tests/_Imports.cs @@ -1,9 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.StackSdks.Mc; global using Masa.BuildingBlocks.StackSdks.Mc.Model; -global using Masa.BuildingBlocks.Service.Caller; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; global using Moq; diff --git a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs index fc66f44d2..beea6af39 100644 --- a/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs +++ b/src/Contrib/StackSdks/Tests/Masa.Contrib.StackSdks.Tsc.Test/_Imports.cs @@ -1,9 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +global using Masa.BuildingBlocks.Service.Caller; global using Masa.BuildingBlocks.StackSdks.Tsc.Enums; global using Masa.BuildingBlocks.StackSdks.Tsc.Model; -global using Masa.BuildingBlocks.Service.Caller; global using Masa.Contrib.Service.Caller; global using Microsoft.VisualStudio.TestTools.UnitTesting; global using Moq; diff --git a/src/Utils/Caller/Masa.Utils.Caller.Core/_Imports.cs b/src/Utils/Caller/Masa.Utils.Caller.Core/_Imports.cs index 95fdf3d27..fb75e67b4 100644 --- a/src/Utils/Caller/Masa.Utils.Caller.Core/_Imports.cs +++ b/src/Utils/Caller/Masa.Utils.Caller.Core/_Imports.cs @@ -6,6 +6,7 @@ global using Masa.Utils.Caller.Core.Internal; global using Masa.Utils.Caller.Core.Internal.Options; global using Masa.Utils.Exceptions; +global using Microsoft.AspNetCore.Http; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.DependencyInjection.Extensions; global using Microsoft.Extensions.Logging; @@ -16,4 +17,3 @@ global using System.Runtime.ExceptionServices; global using System.Text.Json; global using System.Text.Json.Serialization; -global using Microsoft.AspNetCore.Http; diff --git a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs index 15641777d..695649bde 100644 --- a/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs +++ b/src/Utils/Extensions/Tests/Masa.Utils.Extensions.DependencyInjection.Tests/_Imports.cs @@ -2,10 +2,10 @@ // Licensed under the MIT License. See LICENSE.txt in the project root for license information. global using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Repositories; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.VisualStudio.TestTools.UnitTesting; -global using System.Reflection; global using Masa.Utils.Extensions.DependencyInjection.Tests.Domain.Services; global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure; global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Repositories; global using Masa.Utils.Extensions.DependencyInjection.Tests.Infrastructure.Services; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using System.Reflection; diff --git a/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs index 30674ecea..4cab54a89 100644 --- a/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs +++ b/src/Utils/Ldap/Tests/Masa.Utils.Ldap.Novell.Tests/_Imports.cs @@ -1,7 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.Utils.Ldap.Novell.Extensions; global using Microsoft.Extensions.Configuration; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/test/Masa.EventBus.IntegrationTests/_Imports.cs b/test/Masa.EventBus.IntegrationTests/_Imports.cs index 9ad7336f7..8e730b7d7 100644 --- a/test/Masa.EventBus.IntegrationTests/_Imports.cs +++ b/test/Masa.EventBus.IntegrationTests/_Imports.cs @@ -16,11 +16,11 @@ global using Masa.Contrib.Dispatcher.Events; global using Masa.Contrib.Dispatcher.IntegrationEvents; global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.DependencyInjection.Extensions; -global using Microsoft.VisualStudio.TestTools.UnitTesting; global using Masa.EventBus.IntegrationTests.Domain.Aggregate; global using Masa.EventBus.IntegrationTests.Infrastructure; global using Masa.EventBus.IntegrationTests.Infrastructure.Extensions; global using Masa.EventBus.IntegrationTests.Infrastructure.Middleware; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.Extensions.DependencyInjection.Extensions; +global using Microsoft.VisualStudio.TestTools.UnitTesting; From f93be12d8f9918f00e63e92f789c06b6cb59bef1 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 18:51:31 +0800 Subject: [PATCH 19/29] refactor: remove invalid references --- .../Masa.Utils.Caller.HttpClient.csproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj index 40c6c2d3e..f47098d47 100644 --- a/src/Utils/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj +++ b/src/Utils/Caller/Masa.Utils.Caller.HttpClient/Masa.Utils.Caller.HttpClient.csproj @@ -7,9 +7,7 @@ - - From eeb4c76091ae287febbfa2118e0c407e166562da Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 19:04:59 +0800 Subject: [PATCH 20/29] chore: Ignore deprecation warnings --- .../ServiceCollectionExtensions.cs | 1 + .../DispatcherOptionTest.cs | 3 ++- .../IntegrationEventBusTest.cs | 1 + .../ProcessorTest.cs | 1 + .../AutoCompleteTest.cs | 1 + .../Tests/Masa.Contrib.Service.Caller.Tests/CallerTest.cs | 1 + src/Utils/Caller/Masa.Utils.Caller.Tests/TypeConvertTest.cs | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs index ecda874d4..aa5d01330 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/ServiceCollectionExtensions.cs @@ -1,6 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +#pragma warning disable CS0618 namespace Microsoft.Extensions.DependencyInjection; public static class ServiceCollectionExtensions diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs index 3fd775ccc..1a416c7bc 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/DispatcherOptionTest.cs @@ -1,6 +1,7 @@ -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +#pragma warning disable CS0618 namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests; [TestClass] diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs index 71376914e..acaedac05 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/IntegrationEventBusTest.cs @@ -1,6 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +#pragma warning disable CS0618 namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests; [TestClass] diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs index 6a3920cf1..c087135da 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests/ProcessorTest.cs @@ -1,6 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +#pragma warning disable CS0618 namespace Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests; [TestClass] diff --git a/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs index 2844fe306..db338ee2a 100644 --- a/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs +++ b/src/Contrib/SearchEngine/AutoComplete/Tests/Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests/AutoCompleteTest.cs @@ -1,6 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +#pragma warning disable CS0618 namespace Masa.Contrib.SearchEngine.AutoComplete.ElasticSearch.Tests; [TestClass] diff --git a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CallerTest.cs b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CallerTest.cs index 17a01e538..f768eef0f 100644 --- a/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CallerTest.cs +++ b/src/Contrib/Service/Caller/Tests/Masa.Contrib.Service.Caller.Tests/CallerTest.cs @@ -1,6 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +#pragma warning disable CS0618 namespace Masa.Contrib.Service.Caller.Tests; [TestClass] diff --git a/src/Utils/Caller/Masa.Utils.Caller.Tests/TypeConvertTest.cs b/src/Utils/Caller/Masa.Utils.Caller.Tests/TypeConvertTest.cs index cf898eef8..c8786ef2f 100644 --- a/src/Utils/Caller/Masa.Utils.Caller.Tests/TypeConvertTest.cs +++ b/src/Utils/Caller/Masa.Utils.Caller.Tests/TypeConvertTest.cs @@ -1,6 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +#pragma warning disable CS0618 namespace Masa.Utils.Caller.Tests; [TestClass] From bb507a311e23b436320a11ad37d61ff9aed19be7 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 19:08:42 +0800 Subject: [PATCH 21/29] chore: use global using --- .../Commands/CreateProductionCommand.cs | 2 -- .../Queries/ProductionItemQuery.cs | 2 +- .../Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs index 15c7908f5..44ca45c3b 100644 --- a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Commands/CreateProductionCommand.cs @@ -1,8 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; - namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Commands; public record CreateProductionCommand : Command diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs index 491ddb173..ba32fe531 100644 --- a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/Queries/ProductionItemQuery.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; + namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Tests.Queries; diff --git a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs index 0ec013682..1f87f0b77 100644 --- a/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs +++ b/src/Contrib/ReadWriteSpliting/Tests/Masa.Contrib.ReadWriteSpliting.Cqrs.Tests/_Imports.cs @@ -2,6 +2,8 @@ // Licensed under the MIT License. See LICENSE.txt in the project root for license information. global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Commands; +global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; global using Masa.Contrib.Dispatcher.Events; global using Masa.Contrib.ReadWriteSpliting.Cqrs.Commands; global using Masa.Contrib.ReadWriteSpliting.Cqrs.Queries; From 4dbb95de87b132d67c99e40fd147a0c4e8b0e0bb Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Wed, 3 Aug 2022 19:10:01 +0800 Subject: [PATCH 22/29] refactor: Remove the restriction that the Query response value cannot be empty --- .../Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs | 1 - .../Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs | 1 - .../Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs | 1 - .../Queries/IQuery.cs | 1 - .../Queries/IQueryHandler.cs | 2 +- .../Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs index 577dc6a0b..945314b56 100644 --- a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/DomainQuery.cs @@ -4,7 +4,6 @@ namespace Masa.BuildingBlocks.Ddd.Domain.Events; public abstract record DomainQuery : IDomainQuery - where TResult : notnull { private Guid _eventId; private DateTime _creationTime; diff --git a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs index b265889fd..07cc838d1 100644 --- a/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs +++ b/src/BuildingBlocks/Ddd/Domain/Masa.BuildingBlocks.Ddd.Domain/Events/IDomainQuery.cs @@ -4,7 +4,6 @@ namespace Masa.BuildingBlocks.Ddd.Domain.Events; public interface IDomainQuery : IDomainEvent, IQuery - where TResult : notnull { } diff --git a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs index f3893912d..d3e3f4b1c 100644 --- a/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs +++ b/src/BuildingBlocks/Dispatcher/Masa.BuildingBlocks.Dispatcher.Events/IEvent.cs @@ -15,7 +15,6 @@ public interface IEvent } public interface IEvent : IEvent - where TResult : notnull { TResult Result { get; set; } } diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs index c32c90b5b..b60550ebb 100644 --- a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQuery.cs @@ -4,6 +4,5 @@ namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; public interface IQuery : IEvent - where TResult : notnull { } diff --git a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs index 2bcdb7e68..c8a08f63b 100644 --- a/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs +++ b/src/BuildingBlocks/ReadWriteSpliting/Masa.BuildingBlocks.ReadWriteSpliting.Cqrs/Queries/IQueryHandler.cs @@ -4,6 +4,6 @@ namespace Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; public interface IQueryHandler : IEventHandler - where TCommand : IQuery where TResult : notnull + where TCommand : IQuery { } diff --git a/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs index df6cd1861..697abced5 100644 --- a/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs +++ b/src/Contrib/ReadWriteSpliting/Masa.Contrib.ReadWriteSpliting.Cqrs/Queries/QueryHandler.cs @@ -5,7 +5,6 @@ namespace Masa.Contrib.ReadWriteSpliting.Cqrs.Queries; public abstract class QueryHandler : IQueryHandler where TQuery : IQuery - where TResult : notnull { public abstract Task HandleAsync(TQuery @event); } From 356fe1b1b1d678e551b0bd361d78d47fc089a83d Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Thu, 4 Aug 2022 11:17:12 +0800 Subject: [PATCH 23/29] refactor: Refactor repo structure --- Masa.Framework.sln | 87 +++++++++---------- ...guration.ConfigurationApi.Dcc.Tests.csproj | 4 +- .../ConfigurationTest.cs | 3 +- .../Masa.Contrib.Configuration.Tests.csproj | 4 +- .../_Imports.cs | 1 - .../EsOptions.cs | 2 +- ...enes.AutoMap.NoArgumentConstructor.csproj} | 0 .../KafkaOptions.cs | 2 +- ...Configuration.Tests.Scenes.AutoMap.csproj} | 1 - .../Benchmarks.cs | 0 .../AddShoppingCartEventHandler.cs | 0 .../Extensions/EventHandlers/CouponHandler.cs | 0 .../Extensions/Events/AddShoppingCartEvent.cs | 0 .../Extensions/Events/RegisterUserEvent.cs | 0 .../Middleware/LoggingMiddleware.cs | 0 ....Dispatcher.Events.Tests.Benchmarks.csproj | 2 +- .../Program.cs | 0 .../_Imports.cs | 0 .../FeaturesTest.cs | 8 +- ...asa.Contrib.Dispatcher.Events.Tests.csproj | 14 +-- .../SagaTest.cs | 2 + .../_Imports.cs | 5 -- .../EventHandlers/AddGoodsHandler.cs | 2 +- .../Events/AddGoodsEvent.cs | 4 +- ...Tests.Scenes.CheckMethodsParameter.csproj} | 0 .../_Imports.cs | 3 +- .../EventHandlers/DeleteGoodsHandler.cs | 2 +- .../Events/DeleteGoodsEvent.cs | 4 +- ...cenes.CheckMethodsParameterNotNull.csproj} | 0 .../_Imports.cs | 2 + .../EventHandlers/AddCatalogHandler.cs | 2 +- .../Events/AddCatalogEvent.cs | 2 +- ...s.Scenes.CheckMethodsParameterType.csproj} | 0 .../_Imports.cs | 2 +- .../EventHandlers/AddBasketHandler.cs | 2 +- .../Events/AddBasketEvent.cs | 2 +- ...ents.Tests.Scenes.CheckMethodsType.csproj} | 0 .../_Imports.cs | 2 +- .../EventHandlers/Handler.cs | 4 +- .../Events/CalculateEvent.cs | 2 - ...r.Events.Tests.Scenes.HandlerOrder.csproj} | 1 + .../_Imports.cs | 2 + .../EventHandlers/UserEventHandler.cs | 2 +- .../Events/BindPhoneNumberEvent.cs | 4 +- ...nts.Tests.Scenes.OnlyCancelHandler.csproj} | 0 .../_Imports.cs | 3 +- .../EventHandlers/EditCategoryHandler.cs | 2 +- .../Events/EditCategoryEvent.cs | 2 +- ...ents.Tests.Scenes.OrderEqualBySaga.csproj} | 0 .../_Imports.cs | 2 +- 50 files changed, 92 insertions(+), 96 deletions(-) rename src/Contrib/Configuration/Tests/Scenes/{Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests => Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor}/EsOptions.cs (78%) rename src/Contrib/Configuration/Tests/Scenes/{Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj => Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor.csproj} (100%) rename src/Contrib/Configuration/Tests/Scenes/{Masa.Contrib.Configuration.AutoMap.Tests => Masa.Contrib.Configuration.Tests.Scenes.AutoMap}/KafkaOptions.cs (83%) rename src/Contrib/Configuration/Tests/Scenes/{Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj => Masa.Contrib.Configuration.Tests.Scenes.AutoMap/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.csproj} (77%) rename src/Contrib/Dispatcher/Tests/{Benchmarks => }/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs (100%) rename src/Contrib/Dispatcher/Tests/{Benchmarks => }/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs (100%) rename src/Contrib/Dispatcher/Tests/{Benchmarks => }/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs (100%) rename src/Contrib/Dispatcher/Tests/{Benchmarks => }/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs (100%) rename src/Contrib/Dispatcher/Tests/{Benchmarks => }/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs (100%) rename src/Contrib/Dispatcher/Tests/{Benchmarks => }/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs (100%) rename src/Contrib/Dispatcher/Tests/{Benchmarks => }/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj (86%) rename src/Contrib/Dispatcher/Tests/{Benchmarks => }/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs (100%) rename src/Contrib/Dispatcher/Tests/{Benchmarks => }/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter}/EventHandlers/AddGoodsHandler.cs (82%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter}/Events/AddGoodsEvent.cs (71%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj} (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter}/_Imports.cs (57%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull}/EventHandlers/DeleteGoodsHandler.cs (71%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull}/Events/DeleteGoodsEvent.cs (64%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj} (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull}/_Imports.cs (73%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType}/EventHandlers/AddCatalogHandler.cs (85%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType}/Events/AddCatalogEvent.cs (74%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj} (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType}/_Imports.cs (61%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType}/EventHandlers/AddBasketHandler.cs (86%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType}/Events/AddBasketEvent.cs (76%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj} (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType}/_Imports.cs (74%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder}/EventHandlers/Handler.cs (93%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder}/Events/CalculateEvent.cs (89%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj => Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj} (81%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder}/_Imports.cs (67%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler}/EventHandlers/UserEventHandler.cs (76%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler}/Events/BindPhoneNumberEvent.cs (70%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj => Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj} (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler}/_Imports.cs (51%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga}/EventHandlers/EditCategoryHandler.cs (90%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga}/Events/EditCategoryEvent.cs (78%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj => Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj} (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests => Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga}/_Imports.cs (74%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index c77d0a267..d5f0aebe1 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -263,9 +263,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration. EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{258E4702-B414-4629-BD37-CAEE20BE052B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests", "src\Contrib\Configuration\Tests\Scenes\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests\Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj", "{D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor", "src\Contrib\Configuration\Tests\Scenes\Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor\Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor.csproj", "{D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.AutoMap.Tests", "src\Contrib\Configuration\Tests\Scenes\Masa.Contrib.Configuration.AutoMap.Tests\Masa.Contrib.Configuration.AutoMap.Tests.csproj", "{A3637D23-8548-4665-B61B-A8F5B94837E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests.Scenes.AutoMap", "src\Contrib\Configuration\Tests\Scenes\Masa.Contrib.Configuration.Tests.Scenes.AutoMap\Masa.Contrib.Configuration.Tests.Scenes.AutoMap.csproj", "{A3637D23-8548-4665-B61B-A8F5B94837E0}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ConfigurationApi", "ConfigurationApi", "{7A4D9DEE-7024-47E5-8A55-154F4987CF80}" EndProject @@ -397,25 +397,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{DAF45769 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests", "src\Contrib\Dispatcher\Tests\Masa.Contrib.Dispatcher.Events.Tests\Masa.Contrib.Dispatcher.Events.Tests.csproj", "{CEA786A1-676C-42C3-9664-A73EF58256F2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj", "{95FE678E-2530-4785-B553-817B80743322}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj", "{95FE678E-2530-4785-B553-817B80743322}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{08B138B5-2599-4F42-9584-6AE736673882}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj", "{C7861897-8205-43F9-B1D0-5697FB3B070E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj", "{C7861897-8205-43F9-B1D0-5697FB3B070E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj", "{60C4C8A7-2F80-42B2-8797-B9984B2DB23B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj", "{60C4C8A7-2F80-42B2-8797-B9984B2DB23B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests\Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj", "{531528B9-4EC2-4637-AC35-E7C4092E8779}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj", "{531528B9-4EC2-4637-AC35-E7C4092E8779}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests\Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj", "{AC869382-6C88-4099-84EC-6D9639CA3682}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests\Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj", "{6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests\Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj", "{45A38571-F3B7-4F82-AD83-1BD9D74D27C2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Benchmarks", "src\Contrib\Dispatcher\Tests\Benchmarks\Masa.Contrib.Dispatcher.Events.Tests.Benchmarks\Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj", "{32767187-B7F0-4A67-909D-C1FB6F940FCC}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{08FC046F-D74F-43A6-8755-25BFC443DA96}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj", "{45A38571-F3B7-4F82-AD83-1BD9D74D27C2}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.csproj", "{232D7F31-D44B-4333-AD95-3E48ECECF9ED}" EndProject @@ -531,9 +523,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authent EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj", "{7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj", "{1E82EC06-25F3-49E2-BAB6-978CE2896ACC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj", "{1E82EC06-25F3-49E2-BAB6-978CE2896ACC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Identity.Tests", "src\Contrib\Authentication\Tests\Masa.Contrib.Authentication.Identity.Tests\Masa.Contrib.Authentication.Identity.Tests.csproj", "{1527C989-514E-4066-9FE0-BF4289D31CB3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Benchmarks", "src\Contrib\Dispatcher\Tests\Masa.Contrib.Dispatcher.Events.Tests.Benchmarks\Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj", "{A0B995F8-8C73-4885-8C9E-BAFD071B0A58}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj", "{7BEC0D57-4881-41FC-9E8B-39B618E736D8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Authentication.Identity.Tests", "src\Contrib\Authentication\Tests\Masa.Contrib.Authentication.Identity.Tests\Masa.Contrib.Authentication.Identity.Tests.csproj", "{1527C989-514E-4066-9FE0-BF4289D31CB3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder\Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj", "{1E45F9CE-A6BB-4E54-B058-E165B77D2762}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1503,22 +1501,6 @@ Global {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|Any CPU.Build.0 = Release|Any CPU {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|x64.ActiveCfg = Release|Any CPU {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|x64.Build.0 = Release|Any CPU - {AC869382-6C88-4099-84EC-6D9639CA3682}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC869382-6C88-4099-84EC-6D9639CA3682}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC869382-6C88-4099-84EC-6D9639CA3682}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC869382-6C88-4099-84EC-6D9639CA3682}.Debug|x64.Build.0 = Debug|Any CPU - {AC869382-6C88-4099-84EC-6D9639CA3682}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC869382-6C88-4099-84EC-6D9639CA3682}.Release|Any CPU.Build.0 = Release|Any CPU - {AC869382-6C88-4099-84EC-6D9639CA3682}.Release|x64.ActiveCfg = Release|Any CPU - {AC869382-6C88-4099-84EC-6D9639CA3682}.Release|x64.Build.0 = Release|Any CPU - {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Debug|x64.ActiveCfg = Debug|Any CPU - {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Debug|x64.Build.0 = Debug|Any CPU - {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Release|Any CPU.Build.0 = Release|Any CPU - {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Release|x64.ActiveCfg = Release|Any CPU - {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A}.Release|x64.Build.0 = Release|Any CPU {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|Any CPU.Build.0 = Debug|Any CPU {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1527,14 +1509,6 @@ Global {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|Any CPU.Build.0 = Release|Any CPU {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|x64.ActiveCfg = Release|Any CPU {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|x64.Build.0 = Release|Any CPU - {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Debug|x64.ActiveCfg = Debug|Any CPU - {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Debug|x64.Build.0 = Debug|Any CPU - {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Release|Any CPU.Build.0 = Release|Any CPU - {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Release|x64.ActiveCfg = Release|Any CPU - {32767187-B7F0-4A67-909D-C1FB6F940FCC}.Release|x64.Build.0 = Release|Any CPU {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|Any CPU.Build.0 = Debug|Any CPU {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1887,6 +1861,30 @@ Global {1527C989-514E-4066-9FE0-BF4289D31CB3}.Release|Any CPU.Build.0 = Release|Any CPU {1527C989-514E-4066-9FE0-BF4289D31CB3}.Release|x64.ActiveCfg = Release|Any CPU {1527C989-514E-4066-9FE0-BF4289D31CB3}.Release|x64.Build.0 = Release|Any CPU + {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Debug|x64.ActiveCfg = Debug|Any CPU + {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Debug|x64.Build.0 = Debug|Any CPU + {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|Any CPU.Build.0 = Release|Any CPU + {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|x64.ActiveCfg = Release|Any CPU + {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|x64.Build.0 = Release|Any CPU + {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Debug|x64.ActiveCfg = Debug|Any CPU + {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Debug|x64.Build.0 = Debug|Any CPU + {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Release|Any CPU.Build.0 = Release|Any CPU + {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Release|x64.ActiveCfg = Release|Any CPU + {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Release|x64.Build.0 = Release|Any CPU + {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Debug|x64.ActiveCfg = Debug|Any CPU + {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Debug|x64.Build.0 = Debug|Any CPU + {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|Any CPU.Build.0 = Release|Any CPU + {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|x64.ActiveCfg = Release|Any CPU + {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2086,11 +2084,7 @@ Global {C7861897-8205-43F9-B1D0-5697FB3B070E} = {08B138B5-2599-4F42-9584-6AE736673882} {60C4C8A7-2F80-42B2-8797-B9984B2DB23B} = {08B138B5-2599-4F42-9584-6AE736673882} {531528B9-4EC2-4637-AC35-E7C4092E8779} = {08B138B5-2599-4F42-9584-6AE736673882} - {AC869382-6C88-4099-84EC-6D9639CA3682} = {08B138B5-2599-4F42-9584-6AE736673882} - {6EC264C7-DCD2-4B18-98A8-C0209BDFF88A} = {08B138B5-2599-4F42-9584-6AE736673882} {45A38571-F3B7-4F82-AD83-1BD9D74D27C2} = {08B138B5-2599-4F42-9584-6AE736673882} - {32767187-B7F0-4A67-909D-C1FB6F940FCC} = {08FC046F-D74F-43A6-8755-25BFC443DA96} - {08FC046F-D74F-43A6-8755-25BFC443DA96} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} {232D7F31-D44B-4333-AD95-3E48ECECF9ED} = {7526E587-5886-4681-A80A-9E34AC4312CD} {7526E587-5886-4681-A80A-9E34AC4312CD} = {5BE84027-D1B4-4264-A7EC-E84658350CA7} {4A0491D9-F548-4367-8B96-B046A6783743} = {7526E587-5886-4681-A80A-9E34AC4312CD} @@ -2150,6 +2144,9 @@ Global {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} {1E82EC06-25F3-49E2-BAB6-978CE2896ACC} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} {1527C989-514E-4066-9FE0-BF4289D31CB3} = {94D15C26-7204-4299-BC23-B89F5A0B0BF9} + {A0B995F8-8C73-4885-8C9E-BAFD071B0A58} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} + {7BEC0D57-4881-41FC-9E8B-39B618E736D8} = {08B138B5-2599-4F42-9584-6AE736673882} + {1E45F9CE-A6BB-4E54-B058-E165B77D2762} = {08B138B5-2599-4F42-9584-6AE736673882} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj index a2b47fcee..b7e08bc79 100644 --- a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj @@ -33,8 +33,8 @@ - - + + diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs index 8c3d6da3a..b2dd77ce7 100644 --- a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs @@ -1,7 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.Contrib.Configuration.AutoMap.Tests; +using Masa.Contrib.Configuration.Tests.Scenes.AutoMap; +using Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor; namespace Masa.Contrib.Configuration.Tests; diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj index b426fc405..9c7d9f4c6 100644 --- a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj @@ -43,8 +43,8 @@ - - + + diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs index 6cfdf19bb..b752f6fe3 100644 --- a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. See LICENSE.txt in the project root for license information. global using Masa.BuildingBlocks.Configuration; -global using Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests; global using Masa.Contrib.Configuration.Tests.Config; global using Microsoft.AspNetCore.Builder; global using Microsoft.Extensions.Configuration; diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/EsOptions.cs similarity index 78% rename from src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs rename to src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/EsOptions.cs index 046344fa5..3e7b052f3 100644 --- a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/EsOptions.cs +++ b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/EsOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests; +namespace Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor; public class EsOptions : LocalMasaConfigurationOptions { diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor.csproj similarity index 100% rename from src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/Masa.Contrib.Configuration.AutoMap.Tests.csproj rename to src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor.csproj diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap/KafkaOptions.cs similarity index 83% rename from src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs rename to src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap/KafkaOptions.cs index 376df7c4a..55469e259 100644 --- a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.Tests/KafkaOptions.cs +++ b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap/KafkaOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Configuration.AutoMap.Tests; +namespace Masa.Contrib.Configuration.Tests.Scenes.AutoMap; public class KafkaOptions : LocalMasaConfigurationOptions { diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.csproj similarity index 77% rename from src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj rename to src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.csproj index c8416fbae..034b4300d 100644 --- a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests/Masa.Contrib.Configuration.AutoMap.NoArgumentConstructor.Tests.csproj +++ b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.csproj @@ -5,7 +5,6 @@ enable false enable - Masa.Contrib.Configuration.ErrorSectionAutoMap.NoArgumentConstructor.Tests diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj similarity index 86% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj index 4b7f85420..78bddd2d1 100644 --- a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs diff --git a/src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs index 4f804f982..481ac50ec 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs @@ -1,6 +1,12 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.Events; +using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.Events; +using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.Events; +using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.Events; +using Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.Events; + namespace Masa.Contrib.Dispatcher.Events.Tests; [TestClass] @@ -124,7 +130,7 @@ public Task TestOnlyCancelHandler() { try { - ResetMemoryEventBus(typeof(OnlyCancelHandler.Tests.Events.BindPhoneNumberEvent).Assembly); + ResetMemoryEventBus(typeof(BindPhoneNumberEvent).Assembly); } catch (NotSupportedException) { diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj index 01241149b..5297571f9 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj @@ -27,13 +27,13 @@ - - - - - - - + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs index b2ffcc365..6c3d39a8c 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/SagaTest.cs @@ -1,6 +1,8 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +using Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.Events; + namespace Masa.Contrib.Dispatcher.Events.Tests; [TestClass] diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs index 85935366e..4278b2af4 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs @@ -4,13 +4,8 @@ global using Masa.BuildingBlocks.Data.UoW; global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.Events; global using Masa.Contrib.Dispatcher.Events.Enums; global using Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; -global using Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.Events; global using Masa.Contrib.Dispatcher.Events.Tests.Events; global using Masa.Contrib.Dispatcher.Events.Tests.Middleware; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/EventHandlers/AddGoodsHandler.cs similarity index 82% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/EventHandlers/AddGoodsHandler.cs index 09709123a..496bc0da0 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/EventHandlers/AddGoodsHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/EventHandlers/AddGoodsHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.EventHandlers; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.EventHandlers; public class AddGoodsHandler { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Events/AddGoodsEvent.cs similarity index 71% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Events/AddGoodsEvent.cs index ae2a19a2e..2e0d2f65d 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Events/AddGoodsEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Events/AddGoodsEvent.cs @@ -1,9 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.BuildingBlocks.Dispatcher.Events; - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.Events; public record AddGoodsEvent : Event { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/_Imports.cs similarity index 57% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/_Imports.cs index 9ec9d05db..38a7412b3 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/_Imports.cs @@ -1,5 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests.Events; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.Events; global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/EventHandlers/DeleteGoodsHandler.cs similarity index 71% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/EventHandlers/DeleteGoodsHandler.cs index a3dcbeb12..a7fc345d4 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/EventHandlers/DeleteGoodsHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/EventHandlers/DeleteGoodsHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.EventHandlers; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.EventHandlers; public class DeleteGoodsHandler { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Events/DeleteGoodsEvent.cs similarity index 64% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Events/DeleteGoodsEvent.cs index c13bf9475..44990b30d 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Events/DeleteGoodsEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Events/DeleteGoodsEvent.cs @@ -1,9 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.BuildingBlocks.Dispatcher.Events; - -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.Events; public record DeleteGoodsEvent : Event { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/_Imports.cs similarity index 73% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/_Imports.cs index 2b37cc14c..7c8296a41 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/_Imports.cs @@ -1,2 +1,4 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. + +global using Masa.BuildingBlocks.Dispatcher.Events; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/EventHandlers/AddCatalogHandler.cs similarity index 85% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/EventHandlers/AddCatalogHandler.cs index 23b84d3d9..9e10c7962 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/EventHandlers/AddCatalogHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/EventHandlers/AddCatalogHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.EventHandlers; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.EventHandlers; public class AddCatalogHandler { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Events/AddCatalogEvent.cs similarity index 74% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Events/AddCatalogEvent.cs index 58bf51f55..5dd44bf96 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Events/AddCatalogEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Events/AddCatalogEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.Events; public class AddCatalogEvent { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/_Imports.cs similarity index 61% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/_Imports.cs index f456f264e..526151688 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/_Imports.cs @@ -1,4 +1,4 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.Events; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/EventHandlers/AddBasketHandler.cs similarity index 86% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/EventHandlers/AddBasketHandler.cs index a815ac47b..7a6771895 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/EventHandlers/AddBasketHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/EventHandlers/AddBasketHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.EventHandlers; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.EventHandlers; public class AddBasketHandler { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Events/AddBasketEvent.cs similarity index 76% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Events/AddBasketEvent.cs index c865aba59..d076cb6ea 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Events/AddBasketEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Events/AddBasketEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.Events; public record AddBasketEvent : Event { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/_Imports.cs similarity index 74% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/_Imports.cs index 753bdd870..3bf9a4910 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/_Imports.cs @@ -2,5 +2,5 @@ // Licensed under the MIT License. See LICENSE.txt in the project root for license information. global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.Events; global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/EventHandlers/Handler.cs similarity index 93% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/EventHandlers/Handler.cs index 0191f09c5..f781b60ec 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/EventHandlers/Handler.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/EventHandlers/Handler.cs @@ -1,6 +1,4 @@ -using Masa.Contrib.Dispatcher.Events.Enums; - -// Copyright (c) MASA Stack All rights reserved. +// Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. namespace Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.EventHandlers; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Events/CalculateEvent.cs similarity index 89% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Events/CalculateEvent.cs index 3e3a17fc4..4950f8324 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Events/CalculateEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Events/CalculateEvent.cs @@ -1,8 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.BuildingBlocks.Dispatcher.Events; - namespace Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; public record CalculateEvent : Event diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj similarity index 81% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj index 72169caea..37073aabb 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.csproj +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj @@ -5,6 +5,7 @@ enable enable false + Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/_Imports.cs similarity index 67% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/_Imports.cs index 2cca0d35a..758919ca3 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/_Imports.cs @@ -1,4 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Dispatcher.Events.Enums; global using Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/EventHandlers/UserEventHandler.cs similarity index 76% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/EventHandlers/UserEventHandler.cs index d464a50e6..15aea0b31 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/EventHandlers/UserEventHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/EventHandlers/UserEventHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.EventHandlers; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.EventHandlers; public class UserEventHandler { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Events/BindPhoneNumberEvent.cs similarity index 70% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Events/BindPhoneNumberEvent.cs index dc27c12ae..be3ec323b 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Events/BindPhoneNumberEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Events/BindPhoneNumberEvent.cs @@ -1,9 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.BuildingBlocks.Dispatcher.Events; - -namespace Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.Events; public record BindPhoneNumberEvent : Event { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests/Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/_Imports.cs similarity index 51% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/_Imports.cs index 1b7958315..4c2581415 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/_Imports.cs @@ -1,4 +1,5 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -global using Masa.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests.Events; +global using Masa.BuildingBlocks.Dispatcher.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.Events; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/EventHandlers/EditCategoryHandler.cs similarity index 90% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/EventHandlers/EditCategoryHandler.cs index 0fe1cf865..b5e2f654f 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/EventHandlers/EditCategoryHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/EventHandlers/EditCategoryHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.EventHandlers; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.EventHandlers; public class EditCategoryHandler : ISagaEventHandler { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Events/EditCategoryEvent.cs similarity index 78% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Events/EditCategoryEvent.cs index 42a82b0c5..9f73e50ed 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests/Events/EditCategoryEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Events/EditCategoryEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.OrderEqualBySaga.Tests.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.Events; public record EditCategoryEvent : Event { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests/Masa.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/_Imports.cs similarity index 74% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/_Imports.cs index 26c080239..aab990354 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/_Imports.cs @@ -2,5 +2,5 @@ // Licensed under the MIT License. See LICENSE.txt in the project root for license information. global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Dispatcher.Events.CheckMethodsType.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.Events; global using Microsoft.Extensions.Logging; From 928c21678acc2dd0268093135c1048323fcbb1ff Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Thu, 4 Aug 2022 11:44:20 +0800 Subject: [PATCH 24/29] chore: Modify unit test name --- Masa.Framework.sln | 2 +- ...asa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj | 2 +- .../Masa.Contrib.Configuration.Tests/ConfigurationTest.cs | 3 --- .../Masa.Contrib.Configuration.Tests.csproj | 2 +- .../Tests/Masa.Contrib.Configuration.Tests/_Imports.cs | 2 ++ .../EsOptions.cs | 2 +- ...ontrib.Configuration.Tests.Scenes.NoLessConstructor.csproj} | 0 7 files changed, 6 insertions(+), 7 deletions(-) rename src/Contrib/Configuration/Tests/Scenes/{Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor => Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor}/EsOptions.cs (79%) rename src/Contrib/Configuration/Tests/Scenes/{Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor.csproj => Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor/Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor.csproj} (100%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index d5f0aebe1..eb010820c 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -263,7 +263,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration. EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{258E4702-B414-4629-BD37-CAEE20BE052B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor", "src\Contrib\Configuration\Tests\Scenes\Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor\Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor.csproj", "{D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor", "src\Contrib\Configuration\Tests\Scenes\Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor\Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor.csproj", "{D901BE09-397A-4FEC-AF5F-2EF9C2EB2FF7}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Configuration.Tests.Scenes.AutoMap", "src\Contrib\Configuration\Tests\Scenes\Masa.Contrib.Configuration.Tests.Scenes.AutoMap\Masa.Contrib.Configuration.Tests.Scenes.AutoMap.csproj", "{A3637D23-8548-4665-B61B-A8F5B94837E0}" EndProject diff --git a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj index b7e08bc79..40670f929 100644 --- a/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj +++ b/src/Contrib/Configuration/ConfigurationApi/Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests/Masa.Contrib.Configuration.ConfigurationApi.Dcc.Tests.csproj @@ -33,7 +33,7 @@ - + diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs index b2dd77ce7..e998efef2 100644 --- a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/ConfigurationTest.cs @@ -1,9 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.Contrib.Configuration.Tests.Scenes.AutoMap; -using Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor; - namespace Masa.Contrib.Configuration.Tests; [TestClass] diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj index 9c7d9f4c6..e37942ce5 100644 --- a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/Masa.Contrib.Configuration.Tests.csproj @@ -43,7 +43,7 @@ - + diff --git a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs index b752f6fe3..a1380098e 100644 --- a/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs +++ b/src/Contrib/Configuration/Tests/Masa.Contrib.Configuration.Tests/_Imports.cs @@ -3,6 +3,8 @@ global using Masa.BuildingBlocks.Configuration; global using Masa.Contrib.Configuration.Tests.Config; +global using Masa.Contrib.Configuration.Tests.Scenes.AutoMap; +global using Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor; global using Microsoft.AspNetCore.Builder; global using Microsoft.Extensions.Configuration; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/EsOptions.cs b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor/EsOptions.cs similarity index 79% rename from src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/EsOptions.cs rename to src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor/EsOptions.cs index 3e7b052f3..65b99e091 100644 --- a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/EsOptions.cs +++ b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor/EsOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor; +namespace Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor; public class EsOptions : LocalMasaConfigurationOptions { diff --git a/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor.csproj b/src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor/Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor.csproj similarity index 100% rename from src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor/Masa.Contrib.Configuration.Tests.Scenes.AutoMap.NoArgumentConstructor.csproj rename to src/Contrib/Configuration/Tests/Scenes/Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor/Masa.Contrib.Configuration.Tests.Scenes.NoLessConstructor.csproj From ff2c5fc51a75fcbb136653d6c1f438b1622bd8f5 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Thu, 4 Aug 2022 12:11:07 +0800 Subject: [PATCH 25/29] rename: Benchmark rename to Perf --- Masa.Framework.sln | 48 +++++++++---------- .../DistributedBenchmarks.cs | 2 +- ...lake.Distributed.Redis.Tests.Perfs.csproj} | 0 .../Program.cs | 2 +- .../_Imports.cs | 0 .../Benchmarks.cs | 2 +- ....IdGenerator.Snowflake.Tests.Perfs.csproj} | 0 .../Program.cs | 2 +- .../_Imports.cs | 0 .../Benchmarks.cs | 2 +- .../AddShoppingCartEventHandler.cs | 4 +- .../Extensions/EventHandlers/CouponHandler.cs | 4 +- .../Extensions/Events/AddShoppingCartEvent.cs | 2 +- .../Extensions/Events/RegisterUserEvent.cs | 2 +- .../Middleware/LoggingMiddleware.cs | 2 +- ...trib.Dispatcher.Events.Tests.Perfs.csproj} | 0 .../Program.cs | 2 +- .../_Imports.cs | 4 +- 18 files changed, 41 insertions(+), 37 deletions(-) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/{Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks => Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs}/DistributedBenchmarks.cs (98%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/{Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj => Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj} (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/{Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks => Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs}/Program.cs (96%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/{Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks => Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs}/_Imports.cs (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/{Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks => Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs}/Benchmarks.cs (97%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/{Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks.csproj => Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj} (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/{Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks => Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs}/Program.cs (87%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/{Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks => Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs}/_Imports.cs (100%) rename src/Contrib/Dispatcher/Tests/{Masa.Contrib.Dispatcher.Events.Tests.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Perfs}/Benchmarks.cs (97%) rename src/Contrib/Dispatcher/Tests/{Masa.Contrib.Dispatcher.Events.Tests.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Perfs}/Extensions/EventHandlers/AddShoppingCartEventHandler.cs (76%) rename src/Contrib/Dispatcher/Tests/{Masa.Contrib.Dispatcher.Events.Tests.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Perfs}/Extensions/EventHandlers/CouponHandler.cs (91%) rename src/Contrib/Dispatcher/Tests/{Masa.Contrib.Dispatcher.Events.Tests.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Perfs}/Extensions/Events/AddShoppingCartEvent.cs (78%) rename src/Contrib/Dispatcher/Tests/{Masa.Contrib.Dispatcher.Events.Tests.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Perfs}/Extensions/Events/RegisterUserEvent.cs (78%) rename src/Contrib/Dispatcher/Tests/{Masa.Contrib.Dispatcher.Events.Tests.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Perfs}/Extensions/Middleware/LoggingMiddleware.cs (89%) rename src/Contrib/Dispatcher/Tests/{Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj => Masa.Contrib.Dispatcher.Events.Tests.Perfs/Masa.Contrib.Dispatcher.Events.Tests.Perfs.csproj} (100%) rename src/Contrib/Dispatcher/Tests/{Masa.Contrib.Dispatcher.Events.Tests.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Perfs}/Program.cs (89%) rename src/Contrib/Dispatcher/Tests/{Masa.Contrib.Dispatcher.Events.Tests.Benchmarks => Masa.Contrib.Dispatcher.Events.Tests.Perfs}/_Imports.cs (79%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index eb010820c..74ba9faaa 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -343,9 +343,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{17B751BF EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.csproj", "{0457B5A1-02D7-44FF-8FE6-468A456E2909}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Benchmarks", "Benchmarks", "{55DCA34D-48CE-4D32-8515-B6583FA548AE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks.csproj", "{5957E2B1-A517-4225-8517-71D3B0B29B90}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Perfs", "Perfs", "{55DCA34D-48CE-4D32-8515-B6583FA548AE}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster", "src\Contrib\Data\Mapping\Masa.Contrib.Data.Mapping.Mapster\Masa.Contrib.Data.Mapping.Mapster.csproj", "{11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}" EndProject @@ -521,18 +519,20 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Storage.Object EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.BuildingBlocks.Authentication.OpenIdConnect.Models", "src\BuildingBlocks\Authentication\OpenIdConnect\Masa.BuildingBlocks.Authentication.OpenIdConnect.Models\Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.csproj", "{9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj", "{7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage\Masa.Contrib.Authentication.OpenIdConnect.Cache.Storage.csproj", "{1E82EC06-25F3-49E2-BAB6-978CE2896ACC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Identity.Tests", "src\Contrib\Authentication\Tests\Masa.Contrib.Authentication.Identity.Tests\Masa.Contrib.Authentication.Identity.Tests.csproj", "{1527C989-514E-4066-9FE0-BF4289D31CB3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Benchmarks", "src\Contrib\Dispatcher\Tests\Masa.Contrib.Dispatcher.Events.Tests.Benchmarks\Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj", "{A0B995F8-8C73-4885-8C9E-BAFD071B0A58}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Perfs", "src\Contrib\Dispatcher\Tests\Masa.Contrib.Dispatcher.Events.Tests.Perfs\Masa.Contrib.Dispatcher.Events.Tests.Perfs.csproj", "{A0B995F8-8C73-4885-8C9E-BAFD071B0A58}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj", "{7BEC0D57-4881-41FC-9E8B-39B618E736D8}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder\Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj", "{1E45F9CE-A6BB-4E54-B058-E165B77D2762}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj", "{2C964008-C8C5-4C80-8387-48B3B2CA84D3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj", "{E350B685-5625-4985-8D79-B637D44DBCEF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1309,14 +1309,6 @@ Global {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Release|Any CPU.Build.0 = Release|Any CPU {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Release|x64.ActiveCfg = Release|Any CPU {0457B5A1-02D7-44FF-8FE6-468A456E2909}.Release|x64.Build.0 = Release|Any CPU - {5957E2B1-A517-4225-8517-71D3B0B29B90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5957E2B1-A517-4225-8517-71D3B0B29B90}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5957E2B1-A517-4225-8517-71D3B0B29B90}.Debug|x64.ActiveCfg = Debug|Any CPU - {5957E2B1-A517-4225-8517-71D3B0B29B90}.Debug|x64.Build.0 = Debug|Any CPU - {5957E2B1-A517-4225-8517-71D3B0B29B90}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5957E2B1-A517-4225-8517-71D3B0B29B90}.Release|Any CPU.Build.0 = Release|Any CPU - {5957E2B1-A517-4225-8517-71D3B0B29B90}.Release|x64.ActiveCfg = Release|Any CPU - {5957E2B1-A517-4225-8517-71D3B0B29B90}.Release|x64.Build.0 = Release|Any CPU {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Debug|Any CPU.Build.0 = Debug|Any CPU {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1837,14 +1829,6 @@ Global {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Release|Any CPU.Build.0 = Release|Any CPU {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Release|x64.ActiveCfg = Release|Any CPU {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D}.Release|x64.Build.0 = Release|Any CPU - {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Debug|x64.ActiveCfg = Debug|Any CPU - {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Debug|x64.Build.0 = Debug|Any CPU - {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|Any CPU.Build.0 = Release|Any CPU - {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|x64.ActiveCfg = Release|Any CPU - {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B}.Release|x64.Build.0 = Release|Any CPU {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Debug|Any CPU.Build.0 = Debug|Any CPU {1E82EC06-25F3-49E2-BAB6-978CE2896ACC}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1885,6 +1869,22 @@ Global {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|Any CPU.Build.0 = Release|Any CPU {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|x64.ActiveCfg = Release|Any CPU {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|x64.Build.0 = Release|Any CPU + {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|x64.ActiveCfg = Debug|Any CPU + {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|x64.Build.0 = Debug|Any CPU + {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Release|Any CPU.Build.0 = Release|Any CPU + {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Release|x64.ActiveCfg = Release|Any CPU + {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Release|x64.Build.0 = Release|Any CPU + {E350B685-5625-4985-8D79-B637D44DBCEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E350B685-5625-4985-8D79-B637D44DBCEF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E350B685-5625-4985-8D79-B637D44DBCEF}.Debug|x64.ActiveCfg = Debug|Any CPU + {E350B685-5625-4985-8D79-B637D44DBCEF}.Debug|x64.Build.0 = Debug|Any CPU + {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|Any CPU.Build.0 = Release|Any CPU + {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|x64.ActiveCfg = Release|Any CPU + {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2053,7 +2053,6 @@ Global {17B751BF-DB79-46B0-A61E-BB8A52919AC9} = {FFEF958B-DA21-4552-86B6-87D9592A3668} {0457B5A1-02D7-44FF-8FE6-468A456E2909} = {17B751BF-DB79-46B0-A61E-BB8A52919AC9} {55DCA34D-48CE-4D32-8515-B6583FA548AE} = {17B751BF-DB79-46B0-A61E-BB8A52919AC9} - {5957E2B1-A517-4225-8517-71D3B0B29B90} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} {11038FB8-C0D1-4E98-8D5C-3F3CC7836C96} = {46FAD690-6764-41EA-B4C4-D9D5020C23CF} {874CD160-F058-41A2-B99F-D3A0FEC78312} = {46FAD690-6764-41EA-B4C4-D9D5020C23CF} {8E33F77D-E636-4965-87E4-00FC3823F44B} = {874CD160-F058-41A2-B99F-D3A0FEC78312} @@ -2141,12 +2140,13 @@ Global {4231AB12-3FB7-408E-B7C2-9CC0FFB710B1} = {1B2FF31A-187A-4D36-AD81-1ABD9BCF9044} {C65638DC-2418-4453-917F-9FA8D068594E} = {4231AB12-3FB7-408E-B7C2-9CC0FFB710B1} {9A4E38CC-7B7E-4F7B-904A-B0933F3CC22D} = {CFC8DE12-A06F-46E2-890A-6EC9400F17DA} - {7C20D657-DBAB-4CD7-931A-40FF0BC11D3B} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} {1E82EC06-25F3-49E2-BAB6-978CE2896ACC} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} {1527C989-514E-4066-9FE0-BF4289D31CB3} = {94D15C26-7204-4299-BC23-B89F5A0B0BF9} {A0B995F8-8C73-4885-8C9E-BAFD071B0A58} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} {7BEC0D57-4881-41FC-9E8B-39B618E736D8} = {08B138B5-2599-4F42-9584-6AE736673882} {1E45F9CE-A6BB-4E54-B058-E165B77D2762} = {08B138B5-2599-4F42-9584-6AE736673882} + {2C964008-C8C5-4C80-8387-48B3B2CA84D3} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} + {E350B685-5625-4985-8D79-B637D44DBCEF} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/DistributedBenchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/DistributedBenchmarks.cs similarity index 98% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/DistributedBenchmarks.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/DistributedBenchmarks.cs index 00ab34915..3c36ff614 100644 --- a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/DistributedBenchmarks.cs +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/DistributedBenchmarks.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs; /// /// Only supports the use of Redis environment diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks.csproj rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Program.cs similarity index 96% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Program.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Program.cs index 777c4ed2c..8e46d6bc3 100644 --- a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/Program.cs +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs; class Program { diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/_Imports.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Benchmarks/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/_Imports.cs diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Benchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Benchmarks.cs similarity index 97% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Benchmarks.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Benchmarks.cs index 1e8200c39..ab6d0935d 100644 --- a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Benchmarks.cs +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Benchmarks.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs; [MarkdownExporter, AsciiDocExporter, HtmlExporter] [SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 1000)] diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks.csproj rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Program.cs similarity index 87% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Program.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Program.cs index 568f3dd45..296f0591a 100644 --- a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/Program.cs +++ b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks; +namespace Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs; class Program { diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/_Imports.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Benchmarks/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Benchmarks/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/_Imports.cs diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Benchmarks.cs similarity index 97% rename from src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Benchmarks.cs index 7e79f3056..be84df46b 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Benchmarks.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Benchmarks.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks; +namespace Masa.Contrib.Dispatcher.Events.Tests.Perfs; [MarkdownExporter, AsciiDocExporter, HtmlExporter] [SimpleJob(RunStrategy.ColdStart, RuntimeMoniker.Net60, targetCount: 100)] diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/EventHandlers/AddShoppingCartEventHandler.cs similarity index 76% rename from src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/EventHandlers/AddShoppingCartEventHandler.cs index ae2b38deb..831061a64 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/AddShoppingCartEventHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/EventHandlers/AddShoppingCartEventHandler.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.EventHandlers; +using Masa.Contrib.Dispatcher.Events.Tests.Perfs.Extensions.Events; + +namespace Masa.Contrib.Dispatcher.Events.Tests.Perfs.Extensions.EventHandlers; public class AddShoppingCartEventHandler : IRequestHandler { diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/EventHandlers/CouponHandler.cs similarity index 91% rename from src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/EventHandlers/CouponHandler.cs index 91af4a72c..044386853 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/EventHandlers/CouponHandler.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/EventHandlers/CouponHandler.cs @@ -1,7 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.EventHandlers; +using Masa.Contrib.Dispatcher.Events.Tests.Perfs.Extensions.Events; + +namespace Masa.Contrib.Dispatcher.Events.Tests.Perfs.Extensions.EventHandlers; public class CouponHandler { diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/Events/AddShoppingCartEvent.cs similarity index 78% rename from src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/Events/AddShoppingCartEvent.cs index 49769fc8b..c1040ddb0 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/AddShoppingCartEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/Events/AddShoppingCartEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Perfs.Extensions.Events; public record AddShoppingCartEvent : Event, IRequest { diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/Events/RegisterUserEvent.cs similarity index 78% rename from src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/Events/RegisterUserEvent.cs index ed65561c2..2a58eeee4 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Events/RegisterUserEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/Events/RegisterUserEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Perfs.Extensions.Events; public record RegisterUserEvent : Event { diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/Middleware/LoggingMiddleware.cs similarity index 89% rename from src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/Middleware/LoggingMiddleware.cs index ee32f7890..8f05e7ff5 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Extensions/Middleware/LoggingMiddleware.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Extensions/Middleware/LoggingMiddleware.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Middleware; +namespace Masa.Contrib.Dispatcher.Events.Tests.Perfs.Extensions.Middleware; public class LoggingMiddleware : Middleware where TEvent : notnull, IEvent { diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Masa.Contrib.Dispatcher.Events.Tests.Perfs.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.csproj rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Masa.Contrib.Dispatcher.Events.Tests.Perfs.csproj diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Program.cs similarity index 89% rename from src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Program.cs index fe7b79603..264adfa13 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/Program.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.Tests.Benchmarks; +namespace Masa.Contrib.Dispatcher.Events.Tests.Perfs; class Program { diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/_Imports.cs similarity index 79% rename from src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/_Imports.cs index 2ef29116f..9cf0dc87f 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Benchmarks/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests.Perfs/_Imports.cs @@ -9,8 +9,8 @@ global using BenchmarkDotNet.Validators; global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.Contrib.Dispatcher.Events.Enums; -global using Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.EventHandlers; -global using Masa.Contrib.Dispatcher.Events.Tests.Benchmarks.Extensions.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Perfs.Extensions.EventHandlers; +global using Masa.Contrib.Dispatcher.Events.Tests.Perfs.Extensions.Events; global using MediatR; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.Logging; From 50cb68ca32c3346909fcc24dbaf3bec205e5b4f0 Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Thu, 4 Aug 2022 13:21:28 +0800 Subject: [PATCH 26/29] chore: Adjust the directory structure --- Masa.Framework.sln | 154 +++++++++--------- .../FeaturesTest.cs | 6 - ...asa.Contrib.Dispatcher.Events.Tests.csproj | 14 +- .../_Imports.cs | 7 +- .../EventHandlers/AddGoodsHandler.cs | 0 .../Events/AddGoodsEvent.cs | 0 ....Tests.Scenes.CheckMethodsParameter.csproj | 0 .../_Imports.cs | 0 .../EventHandlers/DeleteGoodsHandler.cs | 0 .../Events/DeleteGoodsEvent.cs | 0 ...Scenes.CheckMethodsParameterNotNull.csproj | 0 .../_Imports.cs | 0 .../EventHandlers/AddCatalogHandler.cs | 0 .../Events/AddCatalogEvent.cs | 0 ...ts.Scenes.CheckMethodsParameterType.csproj | 0 .../_Imports.cs | 0 .../EventHandlers/AddBasketHandler.cs | 0 .../Events/AddBasketEvent.cs | 0 ...vents.Tests.Scenes.CheckMethodsType.csproj | 0 .../_Imports.cs | 0 .../EventHandlers/Handler.cs | 2 +- .../Events/CalculateEvent.cs | 2 +- ...r.Events.Tests.Scenes.HandlerOrder.csproj} | 0 .../_Imports.cs | 2 +- .../EventHandlers/UserEventHandler.cs | 0 .../Events/BindPhoneNumberEvent.cs | 0 ...nts.Tests.Scenes.OnlyCancelHandler.csproj} | 0 .../_Imports.cs | 0 .../EventHandlers/EditCategoryHandler.cs | 0 .../Events/EditCategoryEvent.cs | 0 ...ents.Tests.Scenes.OrderEqualBySaga.csproj} | 1 - .../_Imports.cs | 0 32 files changed, 93 insertions(+), 95 deletions(-) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter => CheckMethodsParameter}/EventHandlers/AddGoodsHandler.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter => CheckMethodsParameter}/Events/AddGoodsEvent.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter => CheckMethodsParameter}/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter => CheckMethodsParameter}/_Imports.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull => CheckMethodsParameterNotNull}/EventHandlers/DeleteGoodsHandler.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull => CheckMethodsParameterNotNull}/Events/DeleteGoodsEvent.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull => CheckMethodsParameterNotNull}/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull => CheckMethodsParameterNotNull}/_Imports.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType => CheckMethodsParameterType}/EventHandlers/AddCatalogHandler.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType => CheckMethodsParameterType}/Events/AddCatalogEvent.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType => CheckMethodsParameterType}/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType => CheckMethodsParameterType}/_Imports.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType => CheckMethodsType}/EventHandlers/AddBasketHandler.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType => CheckMethodsType}/Events/AddBasketEvent.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType => CheckMethodsType}/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType => CheckMethodsType}/_Imports.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder => HandlerOrder}/EventHandlers/Handler.cs (94%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder => HandlerOrder}/Events/CalculateEvent.cs (80%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj => HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj} (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder => HandlerOrder}/_Imports.cs (76%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler => OnlyCancelHandler}/EventHandlers/UserEventHandler.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler => OnlyCancelHandler}/Events/BindPhoneNumberEvent.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj => OnlyCancelHandler/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj} (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler => OnlyCancelHandler}/_Imports.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga => OrderEqualBySaga}/EventHandlers/EditCategoryHandler.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga => OrderEqualBySaga}/Events/EditCategoryEvent.cs (100%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj => OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj} (81%) rename src/Contrib/Dispatcher/Tests/Scenes/{Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga => OrderEqualBySaga}/_Imports.cs (100%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 74ba9faaa..4d5d06e6d 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -395,18 +395,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{DAF45769 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests", "src\Contrib\Dispatcher\Tests\Masa.Contrib.Dispatcher.Events.Tests\Masa.Contrib.Dispatcher.Events.Tests.csproj", "{CEA786A1-676C-42C3-9664-A73EF58256F2}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj", "{95FE678E-2530-4785-B553-817B80743322}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenes", "Scenes", "{08B138B5-2599-4F42-9584-6AE736673882}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj", "{C7861897-8205-43F9-B1D0-5697FB3B070E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj", "{60C4C8A7-2F80-42B2-8797-B9984B2DB23B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj", "{531528B9-4EC2-4637-AC35-E7C4092E8779}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj", "{45A38571-F3B7-4F82-AD83-1BD9D74D27C2}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.csproj", "{232D7F31-D44B-4333-AD95-3E48ECECF9ED}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IntegrationEvents", "IntegrationEvents", "{7526E587-5886-4681-A80A-9E34AC4312CD}" @@ -525,13 +515,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Perfs", "src\Contrib\Dispatcher\Tests\Masa.Contrib.Dispatcher.Events.Tests.Perfs\Masa.Contrib.Dispatcher.Events.Tests.Perfs.csproj", "{A0B995F8-8C73-4885-8C9E-BAFD071B0A58}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj", "{7BEC0D57-4881-41FC-9E8B-39B618E736D8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj", "{2C964008-C8C5-4C80-8387-48B3B2CA84D3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj", "{E350B685-5625-4985-8D79-B637D44DBCEF}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder", "src\Contrib\Dispatcher\Tests\Scenes\Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder\Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj", "{1E45F9CE-A6BB-4E54-B058-E165B77D2762}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter", "src\Contrib\Dispatcher\Tests\Scenes\CheckMethodsParameter\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj", "{BA239716-3B66-4A7D-A68E-2372C9DB07E1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj", "{2C964008-C8C5-4C80-8387-48B3B2CA84D3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull", "src\Contrib\Dispatcher\Tests\Scenes\CheckMethodsParameterNotNull\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj", "{44B0463B-8F56-49A6-8373-0141B66461BE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType", "src\Contrib\Dispatcher\Tests\Scenes\CheckMethodsParameterType\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj", "{41E12E1D-CC99-48D1-B7D2-928BE23EC3DD}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType", "src\Contrib\Dispatcher\Tests\Scenes\CheckMethodsType\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj", "{2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder", "src\Contrib\Dispatcher\Tests\Scenes\HandlerOrder\Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj", "{5CD85A3F-428B-44B8-830C-05A97BA7610B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler", "src\Contrib\Dispatcher\Tests\Scenes\OnlyCancelHandler\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj", "{A6DEC75B-B7FB-43C8-815E-F4F4689326C3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj", "{E350B685-5625-4985-8D79-B637D44DBCEF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga", "src\Contrib\Dispatcher\Tests\Scenes\OrderEqualBySaga\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj", "{F1FD125A-9795-4533-86CA-37274EAAD540}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1461,46 +1461,6 @@ Global {CEA786A1-676C-42C3-9664-A73EF58256F2}.Release|Any CPU.Build.0 = Release|Any CPU {CEA786A1-676C-42C3-9664-A73EF58256F2}.Release|x64.ActiveCfg = Release|Any CPU {CEA786A1-676C-42C3-9664-A73EF58256F2}.Release|x64.Build.0 = Release|Any CPU - {95FE678E-2530-4785-B553-817B80743322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95FE678E-2530-4785-B553-817B80743322}.Debug|Any CPU.Build.0 = Debug|Any CPU - {95FE678E-2530-4785-B553-817B80743322}.Debug|x64.ActiveCfg = Debug|Any CPU - {95FE678E-2530-4785-B553-817B80743322}.Debug|x64.Build.0 = Debug|Any CPU - {95FE678E-2530-4785-B553-817B80743322}.Release|Any CPU.ActiveCfg = Release|Any CPU - {95FE678E-2530-4785-B553-817B80743322}.Release|Any CPU.Build.0 = Release|Any CPU - {95FE678E-2530-4785-B553-817B80743322}.Release|x64.ActiveCfg = Release|Any CPU - {95FE678E-2530-4785-B553-817B80743322}.Release|x64.Build.0 = Release|Any CPU - {C7861897-8205-43F9-B1D0-5697FB3B070E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7861897-8205-43F9-B1D0-5697FB3B070E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7861897-8205-43F9-B1D0-5697FB3B070E}.Debug|x64.ActiveCfg = Debug|Any CPU - {C7861897-8205-43F9-B1D0-5697FB3B070E}.Debug|x64.Build.0 = Debug|Any CPU - {C7861897-8205-43F9-B1D0-5697FB3B070E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7861897-8205-43F9-B1D0-5697FB3B070E}.Release|Any CPU.Build.0 = Release|Any CPU - {C7861897-8205-43F9-B1D0-5697FB3B070E}.Release|x64.ActiveCfg = Release|Any CPU - {C7861897-8205-43F9-B1D0-5697FB3B070E}.Release|x64.Build.0 = Release|Any CPU - {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Debug|x64.ActiveCfg = Debug|Any CPU - {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Debug|x64.Build.0 = Debug|Any CPU - {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Release|Any CPU.Build.0 = Release|Any CPU - {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Release|x64.ActiveCfg = Release|Any CPU - {60C4C8A7-2F80-42B2-8797-B9984B2DB23B}.Release|x64.Build.0 = Release|Any CPU - {531528B9-4EC2-4637-AC35-E7C4092E8779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {531528B9-4EC2-4637-AC35-E7C4092E8779}.Debug|Any CPU.Build.0 = Debug|Any CPU - {531528B9-4EC2-4637-AC35-E7C4092E8779}.Debug|x64.ActiveCfg = Debug|Any CPU - {531528B9-4EC2-4637-AC35-E7C4092E8779}.Debug|x64.Build.0 = Debug|Any CPU - {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|Any CPU.ActiveCfg = Release|Any CPU - {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|Any CPU.Build.0 = Release|Any CPU - {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|x64.ActiveCfg = Release|Any CPU - {531528B9-4EC2-4637-AC35-E7C4092E8779}.Release|x64.Build.0 = Release|Any CPU - {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|x64.ActiveCfg = Debug|Any CPU - {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Debug|x64.Build.0 = Debug|Any CPU - {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|Any CPU.Build.0 = Release|Any CPU - {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|x64.ActiveCfg = Release|Any CPU - {45A38571-F3B7-4F82-AD83-1BD9D74D27C2}.Release|x64.Build.0 = Release|Any CPU {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|Any CPU.Build.0 = Debug|Any CPU {232D7F31-D44B-4333-AD95-3E48ECECF9ED}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1853,22 +1813,6 @@ Global {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|Any CPU.Build.0 = Release|Any CPU {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|x64.ActiveCfg = Release|Any CPU {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|x64.Build.0 = Release|Any CPU - {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Debug|x64.ActiveCfg = Debug|Any CPU - {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Debug|x64.Build.0 = Debug|Any CPU - {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Release|Any CPU.Build.0 = Release|Any CPU - {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Release|x64.ActiveCfg = Release|Any CPU - {7BEC0D57-4881-41FC-9E8B-39B618E736D8}.Release|x64.Build.0 = Release|Any CPU - {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Debug|x64.ActiveCfg = Debug|Any CPU - {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Debug|x64.Build.0 = Debug|Any CPU - {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|Any CPU.Build.0 = Release|Any CPU - {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|x64.ActiveCfg = Release|Any CPU - {1E45F9CE-A6BB-4E54-B058-E165B77D2762}.Release|x64.Build.0 = Release|Any CPU {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|Any CPU.Build.0 = Debug|Any CPU {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1885,6 +1829,62 @@ Global {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|Any CPU.Build.0 = Release|Any CPU {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|x64.ActiveCfg = Release|Any CPU {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|x64.Build.0 = Release|Any CPU + {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Debug|x64.ActiveCfg = Debug|Any CPU + {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Debug|x64.Build.0 = Debug|Any CPU + {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Release|Any CPU.Build.0 = Release|Any CPU + {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Release|x64.ActiveCfg = Release|Any CPU + {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Release|x64.Build.0 = Release|Any CPU + {44B0463B-8F56-49A6-8373-0141B66461BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44B0463B-8F56-49A6-8373-0141B66461BE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44B0463B-8F56-49A6-8373-0141B66461BE}.Debug|x64.ActiveCfg = Debug|Any CPU + {44B0463B-8F56-49A6-8373-0141B66461BE}.Debug|x64.Build.0 = Debug|Any CPU + {44B0463B-8F56-49A6-8373-0141B66461BE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44B0463B-8F56-49A6-8373-0141B66461BE}.Release|Any CPU.Build.0 = Release|Any CPU + {44B0463B-8F56-49A6-8373-0141B66461BE}.Release|x64.ActiveCfg = Release|Any CPU + {44B0463B-8F56-49A6-8373-0141B66461BE}.Release|x64.Build.0 = Release|Any CPU + {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD}.Debug|x64.ActiveCfg = Debug|Any CPU + {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD}.Debug|x64.Build.0 = Debug|Any CPU + {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD}.Release|Any CPU.Build.0 = Release|Any CPU + {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD}.Release|x64.ActiveCfg = Release|Any CPU + {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD}.Release|x64.Build.0 = Release|Any CPU + {2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45}.Debug|x64.ActiveCfg = Debug|Any CPU + {2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45}.Debug|x64.Build.0 = Debug|Any CPU + {2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45}.Release|Any CPU.Build.0 = Release|Any CPU + {2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45}.Release|x64.ActiveCfg = Release|Any CPU + {2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45}.Release|x64.Build.0 = Release|Any CPU + {5CD85A3F-428B-44B8-830C-05A97BA7610B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5CD85A3F-428B-44B8-830C-05A97BA7610B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5CD85A3F-428B-44B8-830C-05A97BA7610B}.Debug|x64.ActiveCfg = Debug|Any CPU + {5CD85A3F-428B-44B8-830C-05A97BA7610B}.Debug|x64.Build.0 = Debug|Any CPU + {5CD85A3F-428B-44B8-830C-05A97BA7610B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5CD85A3F-428B-44B8-830C-05A97BA7610B}.Release|Any CPU.Build.0 = Release|Any CPU + {5CD85A3F-428B-44B8-830C-05A97BA7610B}.Release|x64.ActiveCfg = Release|Any CPU + {5CD85A3F-428B-44B8-830C-05A97BA7610B}.Release|x64.Build.0 = Release|Any CPU + {A6DEC75B-B7FB-43C8-815E-F4F4689326C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A6DEC75B-B7FB-43C8-815E-F4F4689326C3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A6DEC75B-B7FB-43C8-815E-F4F4689326C3}.Debug|x64.ActiveCfg = Debug|Any CPU + {A6DEC75B-B7FB-43C8-815E-F4F4689326C3}.Debug|x64.Build.0 = Debug|Any CPU + {A6DEC75B-B7FB-43C8-815E-F4F4689326C3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A6DEC75B-B7FB-43C8-815E-F4F4689326C3}.Release|Any CPU.Build.0 = Release|Any CPU + {A6DEC75B-B7FB-43C8-815E-F4F4689326C3}.Release|x64.ActiveCfg = Release|Any CPU + {A6DEC75B-B7FB-43C8-815E-F4F4689326C3}.Release|x64.Build.0 = Release|Any CPU + {F1FD125A-9795-4533-86CA-37274EAAD540}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1FD125A-9795-4533-86CA-37274EAAD540}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1FD125A-9795-4533-86CA-37274EAAD540}.Debug|x64.ActiveCfg = Debug|Any CPU + {F1FD125A-9795-4533-86CA-37274EAAD540}.Debug|x64.Build.0 = Debug|Any CPU + {F1FD125A-9795-4533-86CA-37274EAAD540}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1FD125A-9795-4533-86CA-37274EAAD540}.Release|Any CPU.Build.0 = Release|Any CPU + {F1FD125A-9795-4533-86CA-37274EAAD540}.Release|x64.ActiveCfg = Release|Any CPU + {F1FD125A-9795-4533-86CA-37274EAAD540}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2078,12 +2078,7 @@ Global {7E0946DF-53F5-45A9-97BE-779A42E34DB6} = {5BE84027-D1B4-4264-A7EC-E84658350CA7} {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} = {5BE84027-D1B4-4264-A7EC-E84658350CA7} {CEA786A1-676C-42C3-9664-A73EF58256F2} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} - {95FE678E-2530-4785-B553-817B80743322} = {08B138B5-2599-4F42-9584-6AE736673882} {08B138B5-2599-4F42-9584-6AE736673882} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} - {C7861897-8205-43F9-B1D0-5697FB3B070E} = {08B138B5-2599-4F42-9584-6AE736673882} - {60C4C8A7-2F80-42B2-8797-B9984B2DB23B} = {08B138B5-2599-4F42-9584-6AE736673882} - {531528B9-4EC2-4637-AC35-E7C4092E8779} = {08B138B5-2599-4F42-9584-6AE736673882} - {45A38571-F3B7-4F82-AD83-1BD9D74D27C2} = {08B138B5-2599-4F42-9584-6AE736673882} {232D7F31-D44B-4333-AD95-3E48ECECF9ED} = {7526E587-5886-4681-A80A-9E34AC4312CD} {7526E587-5886-4681-A80A-9E34AC4312CD} = {5BE84027-D1B4-4264-A7EC-E84658350CA7} {4A0491D9-F548-4367-8B96-B046A6783743} = {7526E587-5886-4681-A80A-9E34AC4312CD} @@ -2143,10 +2138,15 @@ Global {1E82EC06-25F3-49E2-BAB6-978CE2896ACC} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} {1527C989-514E-4066-9FE0-BF4289D31CB3} = {94D15C26-7204-4299-BC23-B89F5A0B0BF9} {A0B995F8-8C73-4885-8C9E-BAFD071B0A58} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} - {7BEC0D57-4881-41FC-9E8B-39B618E736D8} = {08B138B5-2599-4F42-9584-6AE736673882} - {1E45F9CE-A6BB-4E54-B058-E165B77D2762} = {08B138B5-2599-4F42-9584-6AE736673882} {2C964008-C8C5-4C80-8387-48B3B2CA84D3} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} {E350B685-5625-4985-8D79-B637D44DBCEF} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} + {BA239716-3B66-4A7D-A68E-2372C9DB07E1} = {08B138B5-2599-4F42-9584-6AE736673882} + {44B0463B-8F56-49A6-8373-0141B66461BE} = {08B138B5-2599-4F42-9584-6AE736673882} + {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD} = {08B138B5-2599-4F42-9584-6AE736673882} + {2355FDB2-ACC3-44F3-9D2E-DCFFCC82DB45} = {08B138B5-2599-4F42-9584-6AE736673882} + {5CD85A3F-428B-44B8-830C-05A97BA7610B} = {08B138B5-2599-4F42-9584-6AE736673882} + {A6DEC75B-B7FB-43C8-815E-F4F4689326C3} = {08B138B5-2599-4F42-9584-6AE736673882} + {F1FD125A-9795-4533-86CA-37274EAAD540} = {08B138B5-2599-4F42-9584-6AE736673882} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs index 481ac50ec..652303989 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/FeaturesTest.cs @@ -1,12 +1,6 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.Events; -using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.Events; -using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.Events; -using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.Events; -using Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.Events; - namespace Masa.Contrib.Dispatcher.Events.Tests; [TestClass] diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj index 5297571f9..338b3696c 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/Masa.Contrib.Dispatcher.Events.Tests.csproj @@ -27,13 +27,13 @@ - - - - - - - + + + + + + + diff --git a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs index 4278b2af4..c53b007ec 100644 --- a/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Masa.Contrib.Dispatcher.Events.Tests/_Imports.cs @@ -5,9 +5,14 @@ global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; global using Masa.Contrib.Dispatcher.Events.Enums; -global using Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; global using Masa.Contrib.Dispatcher.Events.Tests.Events; global using Masa.Contrib.Dispatcher.Events.Tests.Middleware; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.Events; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.DependencyInjection.Extensions; global using Microsoft.Extensions.Logging; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/EventHandlers/AddGoodsHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameter/EventHandlers/AddGoodsHandler.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/EventHandlers/AddGoodsHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameter/EventHandlers/AddGoodsHandler.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Events/AddGoodsEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameter/Events/AddGoodsEvent.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Events/AddGoodsEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameter/Events/AddGoodsEvent.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameter/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameter/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameter/_Imports.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameter/_Imports.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/EventHandlers/DeleteGoodsHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterNotNull/EventHandlers/DeleteGoodsHandler.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/EventHandlers/DeleteGoodsHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterNotNull/EventHandlers/DeleteGoodsHandler.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Events/DeleteGoodsEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterNotNull/Events/DeleteGoodsEvent.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Events/DeleteGoodsEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterNotNull/Events/DeleteGoodsEvent.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterNotNull/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterNotNull/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterNotNull/_Imports.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterNotNull/_Imports.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/EventHandlers/AddCatalogHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterType/EventHandlers/AddCatalogHandler.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/EventHandlers/AddCatalogHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterType/EventHandlers/AddCatalogHandler.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Events/AddCatalogEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterType/Events/AddCatalogEvent.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Events/AddCatalogEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterType/Events/AddCatalogEvent.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterType/_Imports.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterType/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsParameterType/_Imports.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/EventHandlers/AddBasketHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsType/EventHandlers/AddBasketHandler.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/EventHandlers/AddBasketHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsType/EventHandlers/AddBasketHandler.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Events/AddBasketEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsType/Events/AddBasketEvent.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Events/AddBasketEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsType/Events/AddBasketEvent.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsType/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsType/_Imports.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsType/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/CheckMethodsType/_Imports.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/EventHandlers/Handler.cs b/src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/EventHandlers/Handler.cs similarity index 94% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/EventHandlers/Handler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/EventHandlers/Handler.cs index f781b60ec..0bfb4c3fa 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/EventHandlers/Handler.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/EventHandlers/Handler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.EventHandlers; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.EventHandlers; public class Handler { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Events/CalculateEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/Events/CalculateEvent.cs similarity index 80% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Events/CalculateEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/Events/CalculateEvent.cs index 4950f8324..458812bfd 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Events/CalculateEvent.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/Events/CalculateEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; +namespace Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.Events; public record CalculateEvent : Event { diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj b/src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/_Imports.cs similarity index 76% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/_Imports.cs index 758919ca3..cba9c942a 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/_Imports.cs +++ b/src/Contrib/Dispatcher/Tests/Scenes/HandlerOrder/_Imports.cs @@ -3,4 +3,4 @@ global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.Contrib.Dispatcher.Events.Enums; -global using Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests.Events; +global using Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.Events; diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/EventHandlers/UserEventHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/OnlyCancelHandler/EventHandlers/UserEventHandler.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/EventHandlers/UserEventHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/OnlyCancelHandler/EventHandlers/UserEventHandler.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Events/BindPhoneNumberEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/OnlyCancelHandler/Events/BindPhoneNumberEvent.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/Events/BindPhoneNumberEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/OnlyCancelHandler/Events/BindPhoneNumberEvent.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj b/src/Contrib/Dispatcher/Tests/Scenes/OnlyCancelHandler/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/OnlyCancelHandler/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler.csproj diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/OnlyCancelHandler/_Imports.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OnlyCancelHandler/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/OnlyCancelHandler/_Imports.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/EventHandlers/EditCategoryHandler.cs b/src/Contrib/Dispatcher/Tests/Scenes/OrderEqualBySaga/EventHandlers/EditCategoryHandler.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/EventHandlers/EditCategoryHandler.cs rename to src/Contrib/Dispatcher/Tests/Scenes/OrderEqualBySaga/EventHandlers/EditCategoryHandler.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Events/EditCategoryEvent.cs b/src/Contrib/Dispatcher/Tests/Scenes/OrderEqualBySaga/Events/EditCategoryEvent.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/Events/EditCategoryEvent.cs rename to src/Contrib/Dispatcher/Tests/Scenes/OrderEqualBySaga/Events/EditCategoryEvent.cs diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj b/src/Contrib/Dispatcher/Tests/Scenes/OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj similarity index 81% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj rename to src/Contrib/Dispatcher/Tests/Scenes/OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj index 37073aabb..72169caea 100644 --- a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder/Masa.Contrib.Dispatcher.Events.Tests.Scenes.HandlerOrder.csproj +++ b/src/Contrib/Dispatcher/Tests/Scenes/OrderEqualBySaga/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj @@ -5,7 +5,6 @@ enable enable false - Masa.Contrib.Dispatcher.Events.HandlerOrder.Tests diff --git a/src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/_Imports.cs b/src/Contrib/Dispatcher/Tests/Scenes/OrderEqualBySaga/_Imports.cs similarity index 100% rename from src/Contrib/Dispatcher/Tests/Scenes/Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga/_Imports.cs rename to src/Contrib/Dispatcher/Tests/Scenes/OrderEqualBySaga/_Imports.cs From 6bdb51492acd3547ecb42d7c580545db44bd8a1a Mon Sep 17 00:00:00 2001 From: zhenlei520 Date: Thu, 4 Aug 2022 15:08:23 +0800 Subject: [PATCH 27/29] refactor: Refactor repo structure --- Masa.Framework.sln | 172 +++++++++--------- README.md | 28 +-- README.zh-CN.md | 28 +-- .../Caches/SyncCache.cs | 2 +- .../DbContexts/OidcDbContext.cs | 2 +- ...ApiResourceClaimEntityTypeConfiguration.cs | 2 +- .../ApiResourceEntityTypeConfiguration.cs | 2 +- ...ResourcePropertyEntityTypeConfiguration.cs | 2 +- ...ApiResourceScopeEntityTypeConfiguration.cs | 2 +- ...piResourceSecretEntityTypeConfiguration.cs | 2 +- .../ApiScopeClaimEntityTypeConfiguration.cs | 2 +- .../ApiScopeEntityTypeConfiguration.cs | 2 +- ...ApiScopePropertyEntityTypeConfiguration.cs | 2 +- .../ClientClaimEntityTypeConfiguration.cs | 2 +- ...ClientCorsOriginEntityTypeConfiguration.cs | 2 +- .../ClientEntityTypeConfiguration.cs | 2 +- .../ClientGrantTypeEntityTypeConfiguration.cs | 2 +- ...ntIdPRestrictionEntityTypeConfiguration.cs | 2 +- ...ogoutRedirectUriEntityTypeConfiguration.cs | 2 +- .../ClientPropertyEntityTypeConfiguration.cs | 2 +- ...lientRedirectUriEntityTypeConfiguration.cs | 2 +- .../ClientScopeEntityTypeConfiguration.cs | 2 +- .../ClientSecretEntityTypeConfiguration.cs | 2 +- .../DeviceFlowCodesEntityTypeConfiguration.cs | 2 +- ...ityResourceClaimEntityTypeConfiguration.cs | 2 +- ...IdentityResourceEntityTypeConfiguration.cs | 2 +- ...ResourcePropertyEntityTypeConfiguration.cs | 2 +- .../PersistedGrantEntityTypeConfiguration.cs | 2 +- .../UserClaimEntityTypeConfiguration.cs | 2 +- ...uthentication.OpenIdConnect.EFCore.csproj} | 0 .../Options/OidcDbContextOptions.cs | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../Repositories/ApiResourceRepository.cs | 2 +- .../Repositories/ApiScopeRepository.cs | 2 +- .../Repositories/ClientRepository.cs | 2 +- .../IdentityResourceRepository.cs | 2 +- .../Repositories/UserClaimRepository.cs | 2 +- .../ServiceCollectionExtensions.cs | 2 +- .../_Imports.cs | 8 +- .../DataFiltering/DataFilter.cs | 2 +- .../SoftDeleteSaveChangesFilter.cs | 2 +- .../Internal/DataFilterState.cs | 2 +- .../Internal/DisposeAction.cs | 2 +- .../Internal/InstanceBuilder.cs | 2 +- .../Internal/NullDisposable.cs | 2 +- ...Masa.Contrib.Data.Contracts.EFCore.csproj} | 2 +- .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../Options/FilterOptions.cs | 2 +- .../_Imports.cs | 10 +- .../DataFilterTest.cs | 2 +- ...ontrib.Data.Contracts.EFCore.Tests.csproj} | 2 +- .../_Imports.cs | 2 +- .../DistributedBenchmarks.cs | 0 ...flake.Distributed.Redis.Tests.Perfs.csproj | 0 .../Program.cs | 0 .../_Imports.cs | 0 .../Benchmarks.cs | 0 ...a.IdGenerator.Snowflake.Tests.Perfs.csproj | 0 .../Program.cs | 0 .../_Imports.cs | 0 .../Internal/Parser.cs | 2 +- .../Masa.Contrib.Data.EFCore.Cosmos.csproj} | 2 +- .../MasaDbContextBuilderExtensions.cs | 2 +- .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../_Imports.cs | 2 +- .../Masa.Contrib.Data.EFCore.InMemory.csproj} | 3 +- .../MasaDbContextBuilderExtensions.cs | 2 +- .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../_Imports.cs | 0 .../Masa.Contrib.Data.EFCore.MySql.csproj} | 2 +- .../MasaDbContextBuilderExtensions.cs | 2 +- .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../Masa.Contrib.Data.EFCore.MySql}/README.md | 4 +- .../README.zh-CN.md | 4 +- .../_Imports.cs | 0 .../Masa.Contrib.Data.EFCore.Oracle.csproj} | 2 +- .../MasaDbContextBuilderExtensions.cs | 2 +- .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../_Imports.cs | 0 ...a.Contrib.Data.EFCore.Pomelo.MySql.csproj} | 2 +- .../MasaDbContextBuilderExtensions.cs | 2 +- .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../_Imports.cs | 0 ...asa.Contrib.Data.EFCore.PostgreSql.csproj} | 2 +- .../MasaDbContextBuilderExtensions.cs | 2 +- .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../_Imports.cs | 0 ...Masa.Contrib.Data.EFCore.SqlServer.csproj} | 2 +- .../MasaDbContextBuilderExtensions.cs | 2 +- .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../_Imports.cs | 0 .../Masa.Contrib.Data.EFCore.Sqlite.csproj} | 2 +- .../MasaDbContextBuilderExtensions.cs | 2 +- .../MasaDbContextOptionsBuilderExtensions.cs | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../_Imports.cs | 0 .../CustomDbContext.cs | 2 +- .../DbContextTest.cs | 2 +- .../DefaultConnectionStringProviderTest.cs | 2 +- .../Internal/PaginatedOptions.cs | 2 +- .../Internal/Repository.cs | 2 +- .../Masa.Contrib.Data.EFCore.Tests.csproj} | 4 +- .../Models/Address.cs | 2 +- .../Models/Hobby.cs | 2 +- .../Models/Student.cs | 2 +- .../TestBase.cs | 2 +- .../_Imports.cs | 8 +- .../DbConnectionStringProvider.cs | 2 +- .../DefaultConnectionStringProvider.cs | 2 +- .../EntityTypeBuilderExtensions.cs | 2 +- .../Filters/ISaveChangesFilter.cs | 2 +- .../Filters/SaveChangeFilter.cs | 2 +- .../IModelCreatingProvider.cs | 2 +- .../Masa.Contrib.Data.EFCore.csproj} | 1 + .../MasaDbContext.cs | 2 +- .../MasaDbContextBuilder.cs | 2 +- .../MasaDbContextOptions.cs | 2 +- .../MasaDbContextOptionsBuilder.cs | 2 +- .../MasaDbContextOptionsBuilder`.cs | 2 +- .../MasaDbContextOptions`.cs | 2 +- .../Masa.Contrib.Data.EFCore}/README.md | 20 +- .../Masa.Contrib.Data.EFCore}/README.zh-CN.md | 22 +-- .../ServiceCollectionExtensions.cs | 0 .../Masa.Contrib.Data.EFCore}/_Imports.cs | 4 +- .../DefaultConnectionStringProvider.cs | 2 +- .../DispatcherOptionsExtensions.cs | 2 +- .../Internal/Const.cs | 2 +- .../Masa.Contrib.Data.UoW.EFCore.csproj} | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../Transaction.cs | 2 +- .../UnitOfWork.cs | 2 +- .../UnitOfWorkAccessor.cs | 2 +- .../UnitOfWorkManager.cs | 2 +- .../_Imports.cs | 2 +- .../CustomDbContext.cs | 2 +- ...Masa.Contrib.Data.UoW.EFCore.Tests.csproj} | 4 +- .../TestBase.cs | 4 +- .../TestUnitOfWork.cs | 2 +- .../_Imports.cs | 2 +- .../appsettings.json | 0 .../DispatcherOptionsExtensions.cs | 2 +- .../Internal/LinqExtensions.cs | 2 +- .../ServiceCollectionRepositoryExtensions.cs | 2 +- .../Internal/TypeExtensions.cs | 2 +- ...ntrib.Ddd.Domain.Repository.EFCore.csproj} | 0 .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../Repository.cs | 2 +- .../_Imports.cs | 2 +- .../Domain/Masa.Contrib.Ddd.Domain/README.md | 8 +- .../Masa.Contrib.Ddd.Domain/README.zh-CN.md | 8 +- .../Domain/Entities/Address.cs | 2 +- .../Domain/Entities/OrderItem.cs | 2 +- .../Domain/Entities/Orders.cs | 2 +- ...Ddd.Domain.Repository.EFCore.Tests.csproj} | 2 +- .../RepositoryTest.cs | 2 +- .../_Imports.cs | 2 +- .../README.md | 6 +- .../README.zh-CN.md | 6 +- .../DispatcherOptionsExtensions.cs | 2 +- .../IntegrationEventLogContext.cs | 2 +- ...egrationEventLogEntityTypeConfiguration.cs | 2 +- ...ntegrationEventLogModelCreatingProvider.cs | 2 +- .../IntegrationEventLogService.cs | 2 +- ...IntegrationEvents.EventLogs.EFCore.csproj} | 2 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../_Imports.cs | 2 +- .../README.md | 8 +- .../README.zh-CN.md | 8 +- .../Domain/Entities/User.cs | 2 +- .../Events/IntegrationEvent.cs | 2 +- .../OrderPaymentSucceededIntegrationEvent.cs | 2 +- .../Infrastructure/CustomDbContext.cs | 2 +- .../IntegrationEventLogContextTest.cs | 2 +- .../IntegrationEventLogServiceTest.cs | 2 +- ...ationEvents.EventLogs.EFCore.Tests.csproj} | 4 +- .../TestBase.cs | 2 +- .../_Imports.cs | 8 +- .../Masa.Contrib.Dispatcher.Events/README.md | 4 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../README.md | 4 +- .../README.zh-CN.md | 4 +- .../Masa.Contrib.Isolation/README.md | 2 +- .../Masa.Contrib.Isolation/README.zh-CN.md | 2 +- .../DispatcherOptionsExtensions.cs | 2 +- .../Internal/TypeExtensions.cs | 2 +- .../IsolationDbContext.cs | 2 +- .../IsolationSaveChangesFilter.cs | 2 +- .../Masa.Contrib.Isolation.UoW.EFCore.csproj} | 2 +- .../README.md | 8 +- .../README.zh-CN.md | 8 +- .../_Imports.cs | 8 +- .../CustomDbContext.cs | 2 +- ...Contrib.Isolation.UoW.EFCore.Tests.csproj} | 6 +- .../TestBase.cs | 2 +- .../TestIsolation.cs | 2 +- .../_Imports.cs | 4 +- .../appsettings.json | 0 .../CustomDbContext.cs | 2 +- .../EdgeDriverTest.cs | 2 +- .../EventHandlers/AddRoleEventHandler.cs | 2 +- .../EventHandlers/RegisterUserEventHandler.cs | 2 +- .../Events/AddRoleEvent.cs | 2 +- .../Events/RegisterUserEvent.cs | 2 +- ...rib.Isolation.UoW.EFCore.Web.Tests.csproj} | 6 +- .../TestBase.cs | 2 +- .../_Imports.cs | 6 +- .../appsettings.json | 0 .../Masa.EventBus.IntegrationTests.csproj | 10 +- .../_Imports.cs | 10 +- 227 files changed, 424 insertions(+), 422 deletions(-) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/Caches/SyncCache.cs (98%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/DbContexts/OidcDbContext.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs (79%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs (93%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs (80%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs (85%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs (80%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs (89%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientEntityTypeConfiguration.cs (95%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs (80%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs (84%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs (93%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs (90%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs (84%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs (93%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/EntityConfigurations/UserClaimEntityTypeConfiguration.cs (83%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj => Masa.Contrib.Authentication.OpenIdConnect.EFCore/Masa.Contrib.Authentication.OpenIdConnect.EFCore.csproj} (100%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/Options/OidcDbContextOptions.cs (94%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/README.md (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/README.zh-CN.md (81%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/Repositories/ApiResourceRepository.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/Repositories/ApiScopeRepository.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/Repositories/ClientRepository.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/Repositories/IdentityResourceRepository.cs (98%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/Repositories/UserClaimRepository.cs (97%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/ServiceCollectionExtensions.cs (95%) rename src/Contrib/Authentication/OpenIdConnect/{Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore => Masa.Contrib.Authentication.OpenIdConnect.EFCore}/_Imports.cs (67%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore => Masa.Contrib.Data.Contracts.EFCore}/DataFiltering/DataFilter.cs (96%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore => Masa.Contrib.Data.Contracts.EFCore}/DataFiltering/SoftDeleteSaveChangesFilter.cs (97%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore => Masa.Contrib.Data.Contracts.EFCore}/Internal/DataFilterState.cs (81%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore => Masa.Contrib.Data.Contracts.EFCore}/Internal/DisposeAction.cs (83%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore => Masa.Contrib.Data.Contracts.EFCore}/Internal/InstanceBuilder.cs (94%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore => Masa.Contrib.Data.Contracts.EFCore}/Internal/NullDisposable.cs (81%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore/Masa.Contrib.Data.Contracts.EntityFrameworkCore.csproj => Masa.Contrib.Data.Contracts.EFCore/Masa.Contrib.Data.Contracts.EFCore.csproj} (77%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore => Masa.Contrib.Data.Contracts.EFCore}/MasaDbContextOptionsBuilderExtensions.cs (97%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore => Masa.Contrib.Data.Contracts.EFCore}/Options/FilterOptions.cs (88%) rename src/Contrib/Data/Contracts/{Masa.Contrib.Data.Contracts.EntityFrameworkCore => Masa.Contrib.Data.Contracts.EFCore}/_Imports.cs (68%) rename src/Contrib/Data/Contracts/Tests/{Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests => Masa.Contrib.Data.Contracts.EFCore.Tests}/DataFilterTest.cs (95%) rename src/Contrib/Data/Contracts/Tests/{Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj => Masa.Contrib.Data.Contracts.EFCore.Tests/Masa.Contrib.Data.Contracts.EFCore.Tests.csproj} (93%) rename src/Contrib/Data/Contracts/Tests/{Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests => Masa.Contrib.Data.Contracts.EFCore.Tests}/_Imports.cs (80%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/{Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs => Distributed.Redis.Tests.Perfs}/DistributedBenchmarks.cs (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/{Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs => Distributed.Redis.Tests.Perfs}/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/{Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs => Distributed.Redis.Tests.Perfs}/Program.cs (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/{Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs => Distributed.Redis.Tests.Perfs}/_Imports.cs (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/{Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs => Tests.Perfs}/Benchmarks.cs (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/{Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs => Tests.Perfs}/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/{Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs => Tests.Perfs}/Program.cs (100%) rename src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/{Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs => Tests.Perfs}/_Imports.cs (100%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos => EFCore/Masa.Contrib.Data.EFCore.Cosmos}/Internal/Parser.cs (93%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj => EFCore/Masa.Contrib.Data.EFCore.Cosmos/Masa.Contrib.Data.EFCore.Cosmos.csproj} (75%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos => EFCore/Masa.Contrib.Data.EFCore.Cosmos}/MasaDbContextBuilderExtensions.cs (99%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos => EFCore/Masa.Contrib.Data.EFCore.Cosmos}/MasaDbContextOptionsBuilderExtensions.cs (95%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos => EFCore/Masa.Contrib.Data.EFCore.Cosmos}/README.md (88%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos => EFCore/Masa.Contrib.Data.EFCore.Cosmos}/README.zh-CN.md (87%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos => EFCore/Masa.Contrib.Data.EFCore.Cosmos}/_Imports.cs (85%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj => EFCore/Masa.Contrib.Data.EFCore.InMemory/Masa.Contrib.Data.EFCore.InMemory.csproj} (69%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory => EFCore/Masa.Contrib.Data.EFCore.InMemory}/MasaDbContextBuilderExtensions.cs (98%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory => EFCore/Masa.Contrib.Data.EFCore.InMemory}/MasaDbContextOptionsBuilderExtensions.cs (92%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory => EFCore/Masa.Contrib.Data.EFCore.InMemory}/README.md (81%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory => EFCore/Masa.Contrib.Data.EFCore.InMemory}/README.zh-CN.md (81%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory => EFCore/Masa.Contrib.Data.EFCore.InMemory}/_Imports.cs (100%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj => EFCore/Masa.Contrib.Data.EFCore.MySql/Masa.Contrib.Data.EFCore.MySql.csproj} (75%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql => EFCore/Masa.Contrib.Data.EFCore.MySql}/MasaDbContextBuilderExtensions.cs (98%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql => EFCore/Masa.Contrib.Data.EFCore.MySql}/MasaDbContextOptionsBuilderExtensions.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql => EFCore/Masa.Contrib.Data.EFCore.MySql}/README.md (84%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql => EFCore/Masa.Contrib.Data.EFCore.MySql}/README.zh-CN.md (84%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql => EFCore/Masa.Contrib.Data.EFCore.MySql}/_Imports.cs (100%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj => EFCore/Masa.Contrib.Data.EFCore.Oracle/Masa.Contrib.Data.EFCore.Oracle.csproj} (74%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle => EFCore/Masa.Contrib.Data.EFCore.Oracle}/MasaDbContextBuilderExtensions.cs (98%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle => EFCore/Masa.Contrib.Data.EFCore.Oracle}/MasaDbContextOptionsBuilderExtensions.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle => EFCore/Masa.Contrib.Data.EFCore.Oracle}/README.md (83%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle => EFCore/Masa.Contrib.Data.EFCore.Oracle}/README.zh-CN.md (83%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle => EFCore/Masa.Contrib.Data.EFCore.Oracle}/_Imports.cs (100%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj => EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/Masa.Contrib.Data.EFCore.Pomelo.MySql.csproj} (74%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql => EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql}/MasaDbContextBuilderExtensions.cs (98%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql => EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql}/MasaDbContextOptionsBuilderExtensions.cs (95%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql => EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql}/README.md (85%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql => EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql}/README.zh-CN.md (85%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql => EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql}/_Imports.cs (100%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj => EFCore/Masa.Contrib.Data.EFCore.PostgreSql/Masa.Contrib.Data.EFCore.PostgreSql.csproj} (74%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql => EFCore/Masa.Contrib.Data.EFCore.PostgreSql}/MasaDbContextBuilderExtensions.cs (98%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql => EFCore/Masa.Contrib.Data.EFCore.PostgreSql}/MasaDbContextOptionsBuilderExtensions.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql => EFCore/Masa.Contrib.Data.EFCore.PostgreSql}/README.md (83%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql => EFCore/Masa.Contrib.Data.EFCore.PostgreSql}/README.zh-CN.md (83%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql => EFCore/Masa.Contrib.Data.EFCore.PostgreSql}/_Imports.cs (100%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj => EFCore/Masa.Contrib.Data.EFCore.SqlServer/Masa.Contrib.Data.EFCore.SqlServer.csproj} (75%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer => EFCore/Masa.Contrib.Data.EFCore.SqlServer}/MasaDbContextBuilderExtensions.cs (98%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer => EFCore/Masa.Contrib.Data.EFCore.SqlServer}/MasaDbContextOptionsBuilderExtensions.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer => EFCore/Masa.Contrib.Data.EFCore.SqlServer}/README.md (83%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer => EFCore/Masa.Contrib.Data.EFCore.SqlServer}/README.zh-CN.md (83%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer => EFCore/Masa.Contrib.Data.EFCore.SqlServer}/_Imports.cs (100%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj => EFCore/Masa.Contrib.Data.EFCore.Sqlite/Masa.Contrib.Data.EFCore.Sqlite.csproj} (75%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite => EFCore/Masa.Contrib.Data.EFCore.Sqlite}/MasaDbContextBuilderExtensions.cs (98%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite => EFCore/Masa.Contrib.Data.EFCore.Sqlite}/MasaDbContextOptionsBuilderExtensions.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite => EFCore/Masa.Contrib.Data.EFCore.Sqlite}/README.md (84%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite => EFCore/Masa.Contrib.Data.EFCore.Sqlite}/README.zh-CN.md (83%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite => EFCore/Masa.Contrib.Data.EFCore.Sqlite}/_Imports.cs (100%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/CustomDbContext.cs (91%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/DbContextTest.cs (99%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/DefaultConnectionStringProviderTest.cs (97%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/Internal/PaginatedOptions.cs (80%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/Internal/Repository.cs (95%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj => EFCore/Masa.Contrib.Data.EFCore.Tests/Masa.Contrib.Data.EFCore.Tests.csproj} (82%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/Models/Address.cs (81%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/Models/Hobby.cs (85%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/Models/Student.cs (88%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/TestBase.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests => EFCore/Masa.Contrib.Data.EFCore.Tests}/_Imports.cs (66%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/DbConnectionStringProvider.cs (92%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/DefaultConnectionStringProvider.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/EntityTypeBuilderExtensions.cs (95%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/Filters/ISaveChangesFilter.cs (80%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/Filters/SaveChangeFilter.cs (97%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/IModelCreatingProvider.cs (88%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj => EFCore/Masa.Contrib.Data.EFCore/Masa.Contrib.Data.EFCore.csproj} (96%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/MasaDbContext.cs (99%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/MasaDbContextBuilder.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/MasaDbContextOptions.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/MasaDbContextOptionsBuilder.cs (93%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/MasaDbContextOptionsBuilder`.cs (94%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/MasaDbContextOptions`.cs (98%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/README.md (54%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/README.zh-CN.md (50%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/ServiceCollectionExtensions.cs (100%) rename src/Contrib/Data/Orm/{EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore => EFCore/Masa.Contrib.Data.EFCore}/_Imports.cs (90%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/DefaultConnectionStringProvider.cs (97%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/DispatcherOptionsExtensions.cs (98%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/Internal/Const.cs (82%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj => Masa.Contrib.Data.UoW.EFCore/Masa.Contrib.Data.UoW.EFCore.csproj} (83%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/README.md (80%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/README.zh-CN.md (80%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/Transaction.cs (89%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/UnitOfWork.cs (98%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/UnitOfWorkAccessor.cs (87%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/UnitOfWorkManager.cs (97%) rename src/Contrib/Data/UoW/{Masa.Contrib.Data.UoW.EF => Masa.Contrib.Data.UoW.EFCore}/_Imports.cs (94%) rename src/Contrib/Data/UoW/Tests/{Masa.Contrib.Data.UoW.EF.Tests => Masa.Contrib.Data.UoW.EFCore.Tests}/CustomDbContext.cs (95%) rename src/Contrib/Data/UoW/Tests/{Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj => Masa.Contrib.Data.UoW.EFCore.Tests/Masa.Contrib.Data.UoW.EFCore.Tests.csproj} (88%) rename src/Contrib/Data/UoW/Tests/{Masa.Contrib.Data.UoW.EF.Tests => Masa.Contrib.Data.UoW.EFCore.Tests}/TestBase.cs (87%) rename src/Contrib/Data/UoW/Tests/{Masa.Contrib.Data.UoW.EF.Tests => Masa.Contrib.Data.UoW.EFCore.Tests}/TestUnitOfWork.cs (99%) rename src/Contrib/Data/UoW/Tests/{Masa.Contrib.Data.UoW.EF.Tests => Masa.Contrib.Data.UoW.EFCore.Tests}/_Imports.cs (93%) rename src/Contrib/Data/UoW/Tests/{Masa.Contrib.Data.UoW.EF.Tests => Masa.Contrib.Data.UoW.EFCore.Tests}/appsettings.json (100%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore => Masa.Contrib.Ddd.Domain.Repository.EFCore}/DispatcherOptionsExtensions.cs (93%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore => Masa.Contrib.Ddd.Domain.Repository.EFCore}/Internal/LinqExtensions.cs (98%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore => Masa.Contrib.Ddd.Domain.Repository.EFCore}/Internal/ServiceCollectionRepositoryExtensions.cs (97%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore => Masa.Contrib.Ddd.Domain.Repository.EFCore}/Internal/TypeExtensions.cs (88%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.csproj => Masa.Contrib.Ddd.Domain.Repository.EFCore/Masa.Contrib.Ddd.Domain.Repository.EFCore.csproj} (100%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore => Masa.Contrib.Ddd.Domain.Repository.EFCore}/README.md (91%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore => Masa.Contrib.Ddd.Domain.Repository.EFCore}/README.zh-CN.md (91%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore => Masa.Contrib.Ddd.Domain.Repository.EFCore}/Repository.cs (99%) rename src/Contrib/Ddd/Domain/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore => Masa.Contrib.Ddd.Domain.Repository.EFCore}/_Imports.cs (89%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests => Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests}/Domain/Entities/Address.cs (87%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests => Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests}/Domain/Entities/OrderItem.cs (83%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests => Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests}/Domain/Entities/Orders.cs (91%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj => Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests.csproj} (91%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests => Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests}/RepositoryTest.cs (99%) rename src/Contrib/Ddd/Domain/Tests/{Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests => Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests}/_Imports.cs (87%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore}/DispatcherOptionsExtensions.cs (94%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore}/IntegrationEventLogContext.cs (83%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore}/IntegrationEventLogEntityTypeConfiguration.cs (94%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore}/IntegrationEventLogModelCreatingProvider.cs (85%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore}/IntegrationEventLogService.cs (98%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.csproj => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.csproj} (83%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore}/README.md (78%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore}/README.zh-CN.md (77%) rename src/Contrib/Dispatcher/IntegrationEvents/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore}/_Imports.cs (93%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests}/Domain/Entities/User.cs (69%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests}/Events/IntegrationEvent.cs (89%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests}/Events/OrderPaymentSucceededIntegrationEvent.cs (80%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests}/Infrastructure/CustomDbContext.cs (77%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests}/IntegrationEventLogContextTest.cs (97%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests}/IntegrationEventLogServiceTest.cs (99%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.csproj} (81%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests}/TestBase.cs (91%) rename src/Contrib/Dispatcher/IntegrationEvents/Tests/{Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests => Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests}/_Imports.cs (84%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore => Masa.Contrib.Isolation.UoW.EFCore}/DispatcherOptionsExtensions.cs (98%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore => Masa.Contrib.Isolation.UoW.EFCore}/Internal/TypeExtensions.cs (88%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore => Masa.Contrib.Isolation.UoW.EFCore}/IsolationDbContext.cs (98%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore => Masa.Contrib.Isolation.UoW.EFCore}/IsolationSaveChangesFilter.cs (97%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.csproj => Masa.Contrib.Isolation.UoW.EFCore/Masa.Contrib.Isolation.UoW.EFCore.csproj} (92%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore => Masa.Contrib.Isolation.UoW.EFCore}/README.md (93%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore => Masa.Contrib.Isolation.UoW.EFCore}/README.zh-CN.md (92%) rename src/Contrib/Isolation/UoW/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore => Masa.Contrib.Isolation.UoW.EFCore}/_Imports.cs (75%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests => Masa.Contrib.Isolation.UoW.EFCore.Tests}/CustomDbContext.cs (95%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj => Masa.Contrib.Isolation.UoW.EFCore.Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests.csproj} (83%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests => Masa.Contrib.Isolation.UoW.EFCore.Tests}/TestBase.cs (88%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests => Masa.Contrib.Isolation.UoW.EFCore.Tests}/TestIsolation.cs (99%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests => Masa.Contrib.Isolation.UoW.EFCore.Tests}/_Imports.cs (90%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests => Masa.Contrib.Isolation.UoW.EFCore.Tests}/appsettings.json (100%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests}/CustomDbContext.cs (96%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests}/EdgeDriverTest.cs (97%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests}/EventHandlers/AddRoleEventHandler.cs (96%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests}/EventHandlers/RegisterUserEventHandler.cs (96%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests}/Events/AddRoleEvent.cs (73%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests}/Events/RegisterUserEvent.cs (75%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.csproj} (80%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests}/TestBase.cs (88%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests}/_Imports.cs (84%) rename src/Contrib/Isolation/UoW/Tests/{Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests => Masa.Contrib.Isolation.UoW.EFCore.Web.Tests}/appsettings.json (100%) diff --git a/Masa.Framework.sln b/Masa.Framework.sln index 4d5d06e6d..9a658aae2 100644 --- a/Masa.Framework.sln +++ b/Masa.Framework.sln @@ -249,7 +249,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OpenIdConnect", "OpenIdConn EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.OpenIdConnect.Cache", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.Cache\Masa.Contrib.Authentication.OpenIdConnect.Cache.csproj", "{B92E29C1-4C44-4C5D-B3B2-22AAF07A62A0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore\Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj", "{3532E374-C922-4B79-93CA-2B0E4CC14FB9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.OpenIdConnect.EFCore", "src\Contrib\Authentication\OpenIdConnect\Masa.Contrib.Authentication.OpenIdConnect.EFCore\Masa.Contrib.Authentication.OpenIdConnect.EFCore.csproj", "{3532E374-C922-4B79-93CA-2B0E4CC14FB9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication.Identity", "src\Contrib\Authentication\Masa.Contrib.Authentication.Identity\Masa.Contrib.Authentication.Identity.csproj", "{DF784809-63B1-44EF-802E-CCCB1FFAA557}" EndProject @@ -287,12 +287,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Orm", "Orm", "{343A61CC-45B EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{E8B3FB42-C450-4B12-9C2C-7B9A02B616BB}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EntityFrameworkCore", "src\Contrib\Data\Contracts\Masa.Contrib.Data.Contracts.EntityFrameworkCore\Masa.Contrib.Data.Contracts.EntityFrameworkCore.csproj", "{8353A1CE-B6F0-42A2-B7F1-BC87707719AD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EFCore", "src\Contrib\Data\Contracts\Masa.Contrib.Data.Contracts.EFCore\Masa.Contrib.Data.Contracts.EFCore.csproj", "{8353A1CE-B6F0-42A2-B7F1-BC87707719AD}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{83E5A183-56D6-4CAC-95A6-FB280AA7AE3D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests", "src\Contrib\Data\Contracts\Tests\Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests\Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj", "{905DB539-092C-4365-ACA1-531D3F2A6665}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.DistributedLock.Local", "src\Contrib\Data\DistributedLock\Masa.Contrib.Data.DistributedLock.Local\Masa.Contrib.Data.DistributedLock.Local.csproj", "{51A22652-A76D-4BB6-92B3-269E7628F4AA}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{74CFB66E-1984-4DE7-8970-BB5EF0755C92}" @@ -351,43 +349,37 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{874CD160 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Mapping.Mapster.Tests", "src\Contrib\Data\Mapping\Tests\Masa.Contrib.Data.Mapping.Mapster.Tests\Masa.Contrib.Data.Mapping.Mapster.Tests.csproj", "{8E33F77D-E636-4965-87E4-00FC3823F44B}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EntityFrameworkCore", "EntityFrameworkCore", "{48853497-9C2D-4ADA-AED3-61280AF1418D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.csproj", "{12B05214-0AF0-45DB-B222-0AD07BC1246B}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EFCore", "EFCore", "{48853497-9C2D-4ADA-AED3-61280AF1418D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Cosmos", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Cosmos\Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj", "{3755B3E7-2230-4E99-B2AC-16631ACA504A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore\Masa.Contrib.Data.EFCore.csproj", "{12B05214-0AF0-45DB-B222-0AD07BC1246B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.InMemory", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.InMemory\Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj", "{C91168D6-6508-42DC-BE02-94518B6FD4FA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore.Cosmos", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore.Cosmos\Masa.Contrib.Data.EFCore.Cosmos.csproj", "{3755B3E7-2230-4E99-B2AC-16631ACA504A}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.MySql", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.MySql\Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj", "{1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore.InMemory", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore.InMemory\Masa.Contrib.Data.EFCore.InMemory.csproj", "{C91168D6-6508-42DC-BE02-94518B6FD4FA}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Oracle", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Oracle\Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj", "{8109B615-5328-44C1-BCA2-75C65CDD714B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore.MySql", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore.MySql\Masa.Contrib.Data.EFCore.MySql.csproj", "{1C0FBF5E-32CB-4EEE-923F-7BB60746ED55}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql\Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj", "{A1D1F4AA-C896-481B-84F1-413A9C75AD30}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore.Oracle", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore.Oracle\Masa.Contrib.Data.EFCore.Oracle.csproj", "{8109B615-5328-44C1-BCA2-75C65CDD714B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.PostgreSql", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql\Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj", "{3C360F76-87BE-46DC-BFC8-5D4E312BA854}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore.Pomelo.MySql", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore.Pomelo.MySql\Masa.Contrib.Data.EFCore.Pomelo.MySql.csproj", "{A1D1F4AA-C896-481B-84F1-413A9C75AD30}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Sqlite", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Sqlite\Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj", "{17DEB82C-64B8-440E-9156-52638005FE3E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore.Sqlite", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore.Sqlite\Masa.Contrib.Data.EFCore.Sqlite.csproj", "{17DEB82C-64B8-440E-9156-52638005FE3E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.SqlServer", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.SqlServer\Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj", "{4E49D00C-B324-44DF-B40D-61BF751EB199}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore.SqlServer", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore.SqlServer\Masa.Contrib.Data.EFCore.SqlServer.csproj", "{4E49D00C-B324-44DF-B40D-61BF751EB199}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EntityFrameworkCore.Tests", "src\Contrib\Data\Orm\EntityFrameworkCore\Masa.Contrib.Data.EntityFrameworkCore.Tests\Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj", "{4DA0502D-7408-48D4-A94B-0A295ECDEF9A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF", "src\Contrib\Data\UoW\Masa.Contrib.Data.UoW.EF\Masa.Contrib.Data.UoW.EF.csproj", "{95986BED-2D99-42C9-A1E1-EC5551864426}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore.Tests", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore.Tests\Masa.Contrib.Data.EFCore.Tests.csproj", "{4DA0502D-7408-48D4-A94B-0A295ECDEF9A}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{627DAA58-5882-4C65-B7A1-AE16AA91E1DE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EF.Tests", "src\Contrib\Data\UoW\Tests\Masa.Contrib.Data.UoW.EF.Tests\Masa.Contrib.Data.UoW.EF.Tests.csproj", "{D40C8B63-A637-43C4-82DA-DF993597A91C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain", "src\Contrib\Ddd\Domain\Masa.Contrib.Ddd.Domain\Masa.Contrib.Ddd.Domain.csproj", "{A7938858-B979-4B79-8505-FC9998832198}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore", "src\Contrib\Ddd\Domain\Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore\Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.csproj", "{88B7B81E-1F86-4CB2-AB48-A301D2A67A40}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EFCore", "src\Contrib\Ddd\Domain\Masa.Contrib.Ddd.Domain.Repository.EFCore\Masa.Contrib.Ddd.Domain.Repository.EFCore.csproj", "{88B7B81E-1F86-4CB2-AB48-A301D2A67A40}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F83E3E53-2DFE-4B1F-B988-204CA4A42572}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests", "src\Contrib\Ddd\Domain\Tests\Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests\Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj", "{6DB001ED-4652-41C7-8C4A-07FF1C03266B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests", "src\Contrib\Ddd\Domain\Tests\Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests\Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests.csproj", "{6DB001ED-4652-41C7-8C4A-07FF1C03266B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events", "src\Contrib\Dispatcher\Masa.Contrib.Dispatcher.Events\Masa.Contrib.Dispatcher.Events.csproj", "{7E0946DF-53F5-45A9-97BE-779A42E34DB6}" EndProject @@ -403,13 +395,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IntegrationEvents", "Integr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.csproj", "{4A0491D9-F548-4367-8B96-B046A6783743}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.csproj", "{F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore", "src\Contrib\Dispatcher\IntegrationEvents\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.csproj", "{F9E3D84A-C5C4-4797-A5E6-B7FE4F288225}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{11B7C7BA-AF7E-4695-B244-19C8B1C23E1C}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Dapr.Tests.csproj", "{16D0B9F5-6FFB-4F2D-AB14-0E0811DAC1D9}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj", "{1FC195D0-E126-4740-8720-09144C61EDD6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.csproj", "{1FC195D0-E126-4740-8720-09144C61EDD6}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.IntegrationEvents.Tests", "src\Contrib\Dispatcher\IntegrationEvents\Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests\Masa.Contrib.Dispatcher.IntegrationEvents.Tests.csproj", "{5F1F2A46-5C4C-4D0A-8C89-73785EE41340}" EndProject @@ -423,13 +415,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UoW", "UoW", "{174693E7-0B9 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{60C0BD3E-3A4B-4C06-9AC4-07C909FCDC2D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EntityFrameworkCore", "src\Contrib\Isolation\UoW\Masa.Contrib.Isolation.UoW.EntityFrameworkCore\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.csproj", "{F7801358-1D38-4697-A185-FF9DF52F3F83}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EFCore", "src\Contrib\Isolation\UoW\Masa.Contrib.Isolation.UoW.EFCore\Masa.Contrib.Isolation.UoW.EFCore.csproj", "{F7801358-1D38-4697-A185-FF9DF52F3F83}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{BB77344E-0EE7-40BC-8EB8-47C1E41C9250}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj", "{60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EFCore.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EFCore.Tests\Masa.Contrib.Isolation.UoW.EFCore.Tests.csproj", "{60196CF3-CC20-4ACA-AC59-8FACA9B3AD6B}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests\Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj", "{F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.UoW.EFCore.Web.Tests", "src\Contrib\Isolation\UoW\Tests\Masa.Contrib.Isolation.UoW.EFCore.Web.Tests\Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.csproj", "{F928EBF3-2527-4B9A-816B-3D6CFA35A9CA}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Isolation.MultiEnvironment.Tests", "src\Contrib\Isolation\Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests\Masa.Contrib.Isolation.MultiEnvironment.Tests.csproj", "{405EDD78-48E8-490B-AE2A-713AB89AA73E}" EndProject @@ -515,10 +507,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Authentication EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Perfs", "src\Contrib\Dispatcher\Tests\Masa.Contrib.Dispatcher.Events.Tests.Perfs\Masa.Contrib.Dispatcher.Events.Tests.Perfs.csproj", "{A0B995F8-8C73-4885-8C9E-BAFD071B0A58}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj", "{2C964008-C8C5-4C80-8387-48B3B2CA84D3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj", "{E350B685-5625-4985-8D79-B637D44DBCEF}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter", "src\Contrib\Dispatcher\Tests\Scenes\CheckMethodsParameter\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameter.csproj", "{BA239716-3B66-4A7D-A68E-2372C9DB07E1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull", "src\Contrib\Dispatcher\Tests\Scenes\CheckMethodsParameterNotNull\Masa.Contrib.Dispatcher.Events.Tests.Scenes.CheckMethodsParameterNotNull.csproj", "{44B0463B-8F56-49A6-8373-0141B66461BE}" @@ -533,6 +521,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Eve EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga", "src\Contrib\Dispatcher\Tests\Scenes\OrderEqualBySaga\Masa.Contrib.Dispatcher.Events.Tests.Scenes.OrderEqualBySaga.csproj", "{F1FD125A-9795-4533-86CA-37274EAAD540}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.EFCore.PostgreSql", "src\Contrib\Data\Orm\EFCore\Masa.Contrib.Data.EFCore.PostgreSql\Masa.Contrib.Data.EFCore.PostgreSql.csproj", "{6616A9E2-66F3-4AEB-BE0D-77346B3F3B06}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.Contracts.EFCore.Tests", "src\Contrib\Data\Contracts\Tests\Masa.Contrib.Data.Contracts.EFCore.Tests\Masa.Contrib.Data.Contracts.EFCore.Tests.csproj", "{979FBAA7-EC54-4183-B2A7-3C5BE5510F16}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EFCore", "src\Contrib\Data\UoW\Masa.Contrib.Data.UoW.EFCore\Masa.Contrib.Data.UoW.EFCore.csproj", "{44DB6ED1-71DC-487B-8DD7-3F872CB23254}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Masa.Contrib.Data.UoW.EFCore.Tests", "src\Contrib\Data\UoW\Tests\Masa.Contrib.Data.UoW.EFCore.Tests\Masa.Contrib.Data.UoW.EFCore.Tests.csproj", "{8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj", "{B37640C5-3F96-4363-915C-0C2848004A05}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs", "src\Contrib\Data\IdGenerator\Snowflake\Tests\Perfs\Distributed.Redis.Tests.Perfs\Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj", "{9EA05A47-B28A-4CD1-8058-00A2098ED0C2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1149,14 +1149,6 @@ Global {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Release|Any CPU.Build.0 = Release|Any CPU {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Release|x64.ActiveCfg = Release|Any CPU {8353A1CE-B6F0-42A2-B7F1-BC87707719AD}.Release|x64.Build.0 = Release|Any CPU - {905DB539-092C-4365-ACA1-531D3F2A6665}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {905DB539-092C-4365-ACA1-531D3F2A6665}.Debug|Any CPU.Build.0 = Debug|Any CPU - {905DB539-092C-4365-ACA1-531D3F2A6665}.Debug|x64.ActiveCfg = Debug|Any CPU - {905DB539-092C-4365-ACA1-531D3F2A6665}.Debug|x64.Build.0 = Debug|Any CPU - {905DB539-092C-4365-ACA1-531D3F2A6665}.Release|Any CPU.ActiveCfg = Release|Any CPU - {905DB539-092C-4365-ACA1-531D3F2A6665}.Release|Any CPU.Build.0 = Release|Any CPU - {905DB539-092C-4365-ACA1-531D3F2A6665}.Release|x64.ActiveCfg = Release|Any CPU - {905DB539-092C-4365-ACA1-531D3F2A6665}.Release|x64.Build.0 = Release|Any CPU {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Debug|Any CPU.Build.0 = Debug|Any CPU {51A22652-A76D-4BB6-92B3-269E7628F4AA}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1373,14 +1365,6 @@ Global {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Release|Any CPU.Build.0 = Release|Any CPU {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Release|x64.ActiveCfg = Release|Any CPU {A1D1F4AA-C896-481B-84F1-413A9C75AD30}.Release|x64.Build.0 = Release|Any CPU - {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Debug|x64.ActiveCfg = Debug|Any CPU - {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Debug|x64.Build.0 = Debug|Any CPU - {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Release|Any CPU.Build.0 = Release|Any CPU - {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Release|x64.ActiveCfg = Release|Any CPU - {3C360F76-87BE-46DC-BFC8-5D4E312BA854}.Release|x64.Build.0 = Release|Any CPU {17DEB82C-64B8-440E-9156-52638005FE3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {17DEB82C-64B8-440E-9156-52638005FE3E}.Debug|Any CPU.Build.0 = Debug|Any CPU {17DEB82C-64B8-440E-9156-52638005FE3E}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1405,22 +1389,6 @@ Global {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Release|Any CPU.Build.0 = Release|Any CPU {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Release|x64.ActiveCfg = Release|Any CPU {4DA0502D-7408-48D4-A94B-0A295ECDEF9A}.Release|x64.Build.0 = Release|Any CPU - {95986BED-2D99-42C9-A1E1-EC5551864426}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95986BED-2D99-42C9-A1E1-EC5551864426}.Debug|Any CPU.Build.0 = Debug|Any CPU - {95986BED-2D99-42C9-A1E1-EC5551864426}.Debug|x64.ActiveCfg = Debug|Any CPU - {95986BED-2D99-42C9-A1E1-EC5551864426}.Debug|x64.Build.0 = Debug|Any CPU - {95986BED-2D99-42C9-A1E1-EC5551864426}.Release|Any CPU.ActiveCfg = Release|Any CPU - {95986BED-2D99-42C9-A1E1-EC5551864426}.Release|Any CPU.Build.0 = Release|Any CPU - {95986BED-2D99-42C9-A1E1-EC5551864426}.Release|x64.ActiveCfg = Release|Any CPU - {95986BED-2D99-42C9-A1E1-EC5551864426}.Release|x64.Build.0 = Release|Any CPU - {D40C8B63-A637-43C4-82DA-DF993597A91C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D40C8B63-A637-43C4-82DA-DF993597A91C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D40C8B63-A637-43C4-82DA-DF993597A91C}.Debug|x64.ActiveCfg = Debug|Any CPU - {D40C8B63-A637-43C4-82DA-DF993597A91C}.Debug|x64.Build.0 = Debug|Any CPU - {D40C8B63-A637-43C4-82DA-DF993597A91C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D40C8B63-A637-43C4-82DA-DF993597A91C}.Release|Any CPU.Build.0 = Release|Any CPU - {D40C8B63-A637-43C4-82DA-DF993597A91C}.Release|x64.ActiveCfg = Release|Any CPU - {D40C8B63-A637-43C4-82DA-DF993597A91C}.Release|x64.Build.0 = Release|Any CPU {A7938858-B979-4B79-8505-FC9998832198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A7938858-B979-4B79-8505-FC9998832198}.Debug|Any CPU.Build.0 = Debug|Any CPU {A7938858-B979-4B79-8505-FC9998832198}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1813,22 +1781,6 @@ Global {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|Any CPU.Build.0 = Release|Any CPU {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|x64.ActiveCfg = Release|Any CPU {A0B995F8-8C73-4885-8C9E-BAFD071B0A58}.Release|x64.Build.0 = Release|Any CPU - {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|x64.ActiveCfg = Debug|Any CPU - {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Debug|x64.Build.0 = Debug|Any CPU - {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Release|Any CPU.Build.0 = Release|Any CPU - {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Release|x64.ActiveCfg = Release|Any CPU - {2C964008-C8C5-4C80-8387-48B3B2CA84D3}.Release|x64.Build.0 = Release|Any CPU - {E350B685-5625-4985-8D79-B637D44DBCEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E350B685-5625-4985-8D79-B637D44DBCEF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E350B685-5625-4985-8D79-B637D44DBCEF}.Debug|x64.ActiveCfg = Debug|Any CPU - {E350B685-5625-4985-8D79-B637D44DBCEF}.Debug|x64.Build.0 = Debug|Any CPU - {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|Any CPU.Build.0 = Release|Any CPU - {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|x64.ActiveCfg = Release|Any CPU - {E350B685-5625-4985-8D79-B637D44DBCEF}.Release|x64.Build.0 = Release|Any CPU {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Debug|Any CPU.Build.0 = Debug|Any CPU {BA239716-3B66-4A7D-A68E-2372C9DB07E1}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -1885,6 +1837,54 @@ Global {F1FD125A-9795-4533-86CA-37274EAAD540}.Release|Any CPU.Build.0 = Release|Any CPU {F1FD125A-9795-4533-86CA-37274EAAD540}.Release|x64.ActiveCfg = Release|Any CPU {F1FD125A-9795-4533-86CA-37274EAAD540}.Release|x64.Build.0 = Release|Any CPU + {6616A9E2-66F3-4AEB-BE0D-77346B3F3B06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6616A9E2-66F3-4AEB-BE0D-77346B3F3B06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6616A9E2-66F3-4AEB-BE0D-77346B3F3B06}.Debug|x64.ActiveCfg = Debug|Any CPU + {6616A9E2-66F3-4AEB-BE0D-77346B3F3B06}.Debug|x64.Build.0 = Debug|Any CPU + {6616A9E2-66F3-4AEB-BE0D-77346B3F3B06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6616A9E2-66F3-4AEB-BE0D-77346B3F3B06}.Release|Any CPU.Build.0 = Release|Any CPU + {6616A9E2-66F3-4AEB-BE0D-77346B3F3B06}.Release|x64.ActiveCfg = Release|Any CPU + {6616A9E2-66F3-4AEB-BE0D-77346B3F3B06}.Release|x64.Build.0 = Release|Any CPU + {979FBAA7-EC54-4183-B2A7-3C5BE5510F16}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {979FBAA7-EC54-4183-B2A7-3C5BE5510F16}.Debug|Any CPU.Build.0 = Debug|Any CPU + {979FBAA7-EC54-4183-B2A7-3C5BE5510F16}.Debug|x64.ActiveCfg = Debug|Any CPU + {979FBAA7-EC54-4183-B2A7-3C5BE5510F16}.Debug|x64.Build.0 = Debug|Any CPU + {979FBAA7-EC54-4183-B2A7-3C5BE5510F16}.Release|Any CPU.ActiveCfg = Release|Any CPU + {979FBAA7-EC54-4183-B2A7-3C5BE5510F16}.Release|Any CPU.Build.0 = Release|Any CPU + {979FBAA7-EC54-4183-B2A7-3C5BE5510F16}.Release|x64.ActiveCfg = Release|Any CPU + {979FBAA7-EC54-4183-B2A7-3C5BE5510F16}.Release|x64.Build.0 = Release|Any CPU + {44DB6ED1-71DC-487B-8DD7-3F872CB23254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44DB6ED1-71DC-487B-8DD7-3F872CB23254}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44DB6ED1-71DC-487B-8DD7-3F872CB23254}.Debug|x64.ActiveCfg = Debug|Any CPU + {44DB6ED1-71DC-487B-8DD7-3F872CB23254}.Debug|x64.Build.0 = Debug|Any CPU + {44DB6ED1-71DC-487B-8DD7-3F872CB23254}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44DB6ED1-71DC-487B-8DD7-3F872CB23254}.Release|Any CPU.Build.0 = Release|Any CPU + {44DB6ED1-71DC-487B-8DD7-3F872CB23254}.Release|x64.ActiveCfg = Release|Any CPU + {44DB6ED1-71DC-487B-8DD7-3F872CB23254}.Release|x64.Build.0 = Release|Any CPU + {8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9}.Debug|x64.ActiveCfg = Debug|Any CPU + {8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9}.Debug|x64.Build.0 = Debug|Any CPU + {8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9}.Release|Any CPU.Build.0 = Release|Any CPU + {8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9}.Release|x64.ActiveCfg = Release|Any CPU + {8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9}.Release|x64.Build.0 = Release|Any CPU + {B37640C5-3F96-4363-915C-0C2848004A05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B37640C5-3F96-4363-915C-0C2848004A05}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B37640C5-3F96-4363-915C-0C2848004A05}.Debug|x64.ActiveCfg = Debug|Any CPU + {B37640C5-3F96-4363-915C-0C2848004A05}.Debug|x64.Build.0 = Debug|Any CPU + {B37640C5-3F96-4363-915C-0C2848004A05}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B37640C5-3F96-4363-915C-0C2848004A05}.Release|Any CPU.Build.0 = Release|Any CPU + {B37640C5-3F96-4363-915C-0C2848004A05}.Release|x64.ActiveCfg = Release|Any CPU + {B37640C5-3F96-4363-915C-0C2848004A05}.Release|x64.Build.0 = Release|Any CPU + {9EA05A47-B28A-4CD1-8058-00A2098ED0C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9EA05A47-B28A-4CD1-8058-00A2098ED0C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9EA05A47-B28A-4CD1-8058-00A2098ED0C2}.Debug|x64.ActiveCfg = Debug|Any CPU + {9EA05A47-B28A-4CD1-8058-00A2098ED0C2}.Debug|x64.Build.0 = Debug|Any CPU + {9EA05A47-B28A-4CD1-8058-00A2098ED0C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9EA05A47-B28A-4CD1-8058-00A2098ED0C2}.Release|Any CPU.Build.0 = Release|Any CPU + {9EA05A47-B28A-4CD1-8058-00A2098ED0C2}.Release|x64.ActiveCfg = Release|Any CPU + {9EA05A47-B28A-4CD1-8058-00A2098ED0C2}.Release|x64.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -2026,7 +2026,6 @@ Global {E8B3FB42-C450-4B12-9C2C-7B9A02B616BB} = {BE980C6D-3277-44C4-8203-959239F81F67} {8353A1CE-B6F0-42A2-B7F1-BC87707719AD} = {C6AE282C-70B6-483D-A17A-FD7F8BC56D61} {83E5A183-56D6-4CAC-95A6-FB280AA7AE3D} = {C6AE282C-70B6-483D-A17A-FD7F8BC56D61} - {905DB539-092C-4365-ACA1-531D3F2A6665} = {83E5A183-56D6-4CAC-95A6-FB280AA7AE3D} {51A22652-A76D-4BB6-92B3-269E7628F4AA} = {806DC3FC-6C27-4FEC-B007-0DDD17C7D9E1} {74CFB66E-1984-4DE7-8970-BB5EF0755C92} = {806DC3FC-6C27-4FEC-B007-0DDD17C7D9E1} {2C9A7196-56A5-480F-BAF9-4A8C7AA9DDE6} = {74CFB66E-1984-4DE7-8970-BB5EF0755C92} @@ -2049,7 +2048,6 @@ Global {11B1DF36-97DC-4928-BED2-A51BDDFE0AEF} = {E676BB35-7888-4FCD-9AFA-E46848639074} {D77D8E17-6D1C-4E44-AF18-D572F12745BA} = {E676BB35-7888-4FCD-9AFA-E46848639074} {3167F949-F6F4-4440-97CD-2EC7B785D9E8} = {FFEF958B-DA21-4552-86B6-87D9592A3668} - {A00D752B-65C8-404A-8397-82DB5613884E} = {FFEF958B-DA21-4552-86B6-87D9592A3668} {17B751BF-DB79-46B0-A61E-BB8A52919AC9} = {FFEF958B-DA21-4552-86B6-87D9592A3668} {0457B5A1-02D7-44FF-8FE6-468A456E2909} = {17B751BF-DB79-46B0-A61E-BB8A52919AC9} {55DCA34D-48CE-4D32-8515-B6583FA548AE} = {17B751BF-DB79-46B0-A61E-BB8A52919AC9} @@ -2063,13 +2061,10 @@ Global {1C0FBF5E-32CB-4EEE-923F-7BB60746ED55} = {48853497-9C2D-4ADA-AED3-61280AF1418D} {8109B615-5328-44C1-BCA2-75C65CDD714B} = {48853497-9C2D-4ADA-AED3-61280AF1418D} {A1D1F4AA-C896-481B-84F1-413A9C75AD30} = {48853497-9C2D-4ADA-AED3-61280AF1418D} - {3C360F76-87BE-46DC-BFC8-5D4E312BA854} = {48853497-9C2D-4ADA-AED3-61280AF1418D} {17DEB82C-64B8-440E-9156-52638005FE3E} = {48853497-9C2D-4ADA-AED3-61280AF1418D} {4E49D00C-B324-44DF-B40D-61BF751EB199} = {48853497-9C2D-4ADA-AED3-61280AF1418D} {4DA0502D-7408-48D4-A94B-0A295ECDEF9A} = {48853497-9C2D-4ADA-AED3-61280AF1418D} - {95986BED-2D99-42C9-A1E1-EC5551864426} = {E8B3FB42-C450-4B12-9C2C-7B9A02B616BB} {627DAA58-5882-4C65-B7A1-AE16AA91E1DE} = {E8B3FB42-C450-4B12-9C2C-7B9A02B616BB} - {D40C8B63-A637-43C4-82DA-DF993597A91C} = {627DAA58-5882-4C65-B7A1-AE16AA91E1DE} {A7938858-B979-4B79-8505-FC9998832198} = {B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD} {B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD} = {62D61C4E-B78B-429A-A5F4-345E3A290EAE} {88B7B81E-1F86-4CB2-AB48-A301D2A67A40} = {B5C55192-FF3D-4F9D-B78A-C9E73D56BBFD} @@ -2138,8 +2133,6 @@ Global {1E82EC06-25F3-49E2-BAB6-978CE2896ACC} = {41769FBF-91A8-48D1-B3BB-CAE4C814E7CD} {1527C989-514E-4066-9FE0-BF4289D31CB3} = {94D15C26-7204-4299-BC23-B89F5A0B0BF9} {A0B995F8-8C73-4885-8C9E-BAFD071B0A58} = {DAF45769-BCA5-43D6-8F04-DE7B2B98DB25} - {2C964008-C8C5-4C80-8387-48B3B2CA84D3} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} - {E350B685-5625-4985-8D79-B637D44DBCEF} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} {BA239716-3B66-4A7D-A68E-2372C9DB07E1} = {08B138B5-2599-4F42-9584-6AE736673882} {44B0463B-8F56-49A6-8373-0141B66461BE} = {08B138B5-2599-4F42-9584-6AE736673882} {41E12E1D-CC99-48D1-B7D2-928BE23EC3DD} = {08B138B5-2599-4F42-9584-6AE736673882} @@ -2147,6 +2140,13 @@ Global {5CD85A3F-428B-44B8-830C-05A97BA7610B} = {08B138B5-2599-4F42-9584-6AE736673882} {A6DEC75B-B7FB-43C8-815E-F4F4689326C3} = {08B138B5-2599-4F42-9584-6AE736673882} {F1FD125A-9795-4533-86CA-37274EAAD540} = {08B138B5-2599-4F42-9584-6AE736673882} + {6616A9E2-66F3-4AEB-BE0D-77346B3F3B06} = {48853497-9C2D-4ADA-AED3-61280AF1418D} + {979FBAA7-EC54-4183-B2A7-3C5BE5510F16} = {83E5A183-56D6-4CAC-95A6-FB280AA7AE3D} + {44DB6ED1-71DC-487B-8DD7-3F872CB23254} = {E8B3FB42-C450-4B12-9C2C-7B9A02B616BB} + {8B19C9E6-002B-4DD4-8D80-9D092C3EA6E9} = {627DAA58-5882-4C65-B7A1-AE16AA91E1DE} + {A00D752B-65C8-404A-8397-82DB5613884E} = {FFEF958B-DA21-4552-86B6-87D9592A3668} + {B37640C5-3F96-4363-915C-0C2848004A05} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} + {9EA05A47-B28A-4CD1-8058-00A2098ED0C2} = {55DCA34D-48CE-4D32-8515-B6583FA548AE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {40383055-CC50-4600-AD9A-53C14F620D03} diff --git a/README.md b/README.md index 5ea3401e5..5263076c3 100644 --- a/README.md +++ b/README.md @@ -23,18 +23,18 @@ The purpose of MASA.Contrib is based on [MASA.BuildingBlocks](https://github.com * [Dcc](./src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.md) * [CQRS](./src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.md) * Data: - * [EntityFrameworkCore](./src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.md) - * [SqlServer](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md) - * [Pomelo.MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md): Recommend - * [MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md) - * [Sqlite](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md) - * [Cosmos](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md) - * [InMemory](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md) - * [Oracle](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md) - * [PostgreSql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md) - * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EntityFrameworkCore/): data protocol + * [EntityFrameworkCore](./src/Data/Masa.Contrib.Data.EFCore/README.md) + * [SqlServer](./src/Data/Masa.Contrib.Data.EFCore.SqlServer/README.md) + * [Pomelo.MySql](./src/Data/Masa.Contrib.Data.EFCore.Pomelo.MySql/README.md): Recommend + * [MySql](./src/Data/Masa.Contrib.Data.EFCore.MySql/README.md) + * [Sqlite](./src/Data/Masa.Contrib.Data.EFCore.Sqlite/README.md) + * [Cosmos](./src/Data/Masa.Contrib.Data.EFCore.Cosmos/README.md) + * [InMemory](./src/Data/Masa.Contrib.Data.EFCore.InMemory/README.md) + * [Oracle](./src/Data/Masa.Contrib.Data.EFCore.Oracle/README.md) + * [PostgreSql](./src/Data/Masa.Contrib.Data.EFCore.PostgreSql/README.md) + * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EFCore/): data protocol * UoW: unit of work - * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EF/README.md) + * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EFCore/README.md) * IdGenerator: Unique ID generator * [NormalGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.md): Normal Guid * [SequentialGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.md): Sequential Guid @@ -43,13 +43,13 @@ The purpose of MASA.Contrib is based on [MASA.BuildingBlocks](https://github.com * Mapping: object mapping * [Mapster](./src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.md) * [DDD](./src/Ddd/Masa.Contrib.Ddd.Domain/README.md) - * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.md): Provide warehousing services + * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EFCore/README.md): Provide warehousing services * Dispatcher * [EventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md): In-process events * [IntegrationEventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md): Cross-process events - * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.md): Provides message management services for cross-process events + * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/README.md): Provides message management services for cross-process events * Isolation: Support physical isolation, logical isolation - * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md) + * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EFCore/README.md) * [MultiEnvironment](./src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md): MultiEnvironment * [MultiTenant](./src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md): Multi-tenancy * [MinimalAPI](./src/Service/Masa.Contrib.Service.Mini~~~~malAPIs/README.md): Support API classification aggregation similar to Controller diff --git a/README.zh-CN.md b/README.zh-CN.md index 24f49cb94..706b8d60c 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -23,18 +23,18 @@ MASA.Contrib是基于[MASA.BuildingBlocks](https://github.com/masastack/MASA.Bui * [Dcc](./src/Configuration/Masa.Contrib.Configuration.ConfigurationApi.Dcc/README.zh-CN.md) * [CQRS](./src/ReadWriteSpliting/Cqrs/Masa.Contrib.ReadWriteSpliting.Cqrs/README.zh-CN.md) * Data: - * [EntityFrameworkCore](./src/Data/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md) - * [SqlServer](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md) - * [Pomelo.MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md): 推荐 - * [MySql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md) - * [Sqlite](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md) - * [Cosmos](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md) - * [InMemory](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md) - * [Oracle](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md) - * [PostgreSql](./src/Data/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md) - * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EntityFrameworkCore/): 数据规约 + * [EntityFrameworkCore](./src/Data/Masa.Contrib.Data.EFCore/README.zh-CN.md) + * [SqlServer](./src/Data/Masa.Contrib.Data.EFCore.SqlServer/README.zh-CN.md) + * [Pomelo.MySql](./src/Data/Masa.Contrib.Data.EFCore.Pomelo.MySql/README.zh-CN.md): 推荐 + * [MySql](./src/Data/Masa.Contrib.Data.EFCore.MySql/README.zh-CN.md) + * [Sqlite](./src/Data/Masa.Contrib.Data.EFCore.Sqlite/README.zh-CN.md) + * [Cosmos](./src/Data/Masa.Contrib.Data.EFCore.Cosmos/README.zh-CN.md) + * [InMemory](./src/Data/Masa.Contrib.Data.EFCore.InMemory/README.zh-CN.md) + * [Oracle](./src/Data/Masa.Contrib.Data.EFCore.Oracle/README.zh-CN.md) + * [PostgreSql](./src/Data/Masa.Contrib.Data.EFCore.PostgreSql/README.zh-CN.md) + * [Data.Contracts.EF](./src/Data/Masa.Contrib.Data.Contracts.EFCore/): 数据规约 * UoW: 工作单元 - * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EF/README.zh-CN.md) + * [EFCore](./src/Data/Masa.Contrib.Data.UoW.EFCore/README.zh-CN.md) * IdGenerator: 唯一ID生成器 * [NormalGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.NormalGuid/README.zh-CN.md): 普通的Guid * [SequentialGuid](./src/Data/IdGenerator/Masa.Contrib.Data.IdGenerator.SequentialGuid/README.zh-CN.md): 有序的Guid @@ -43,13 +43,13 @@ MASA.Contrib是基于[MASA.BuildingBlocks](https://github.com/masastack/MASA.Bui * Mapping: 对象映射 * [Mapster](./src/Data/Mapping/Masa.Contrib.Data.Mapping.Mapster/README.zh-CN.md) * [DDD](./src/Ddd/Masa.Contrib.Ddd.Domain/README.zh-CN.md) - * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.zh-CN.md): 提供仓储服务 + * [Ddd.Domain.Repository.EF](./src/Ddd/Masa.Contrib.Ddd.Domain.Repository.EFCore/README.zh-CN.md): 提供仓储服务 * Dispatcher * [EventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.Events/README.zh-CN.md): 进程内事件 * [IntegrationEventBus](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md): 跨进程事件 - * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.zh-CN.md): 为跨进程事件提供消息管理服务 + * [IntegrationEvents.EventLogs.EF](./src/Dispatcher/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/README.zh-CN.md): 为跨进程事件提供消息管理服务 * Isolation: 支持物理隔离、逻辑隔离 - * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md) + * [UoW.EF](./src/Isolation/Masa.Contrib.Isolation.UoW.EFCore/README.zh-CN.md) * [MultiEnvironment](./src/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md): 多环境 * [MultiTenant](./src/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md): 多租户 * [MinimalAPI](./src/Service/Masa.Contrib.Service.MinimalAPIs/README.zh-CN.md): 支持类似Controller的API分类聚合 diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Caches/SyncCache.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Caches/SyncCache.cs similarity index 98% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Caches/SyncCache.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Caches/SyncCache.cs index cab174498..b59296718 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Caches/SyncCache.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Caches/SyncCache.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Caches; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.Caches; public class SyncCache { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/DbContexts/OidcDbContext.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/DbContexts/OidcDbContext.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/DbContexts/OidcDbContext.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/DbContexts/OidcDbContext.cs index 964f53d38..55ded4973 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/DbContexts/OidcDbContext.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/DbContexts/OidcDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.DbContexts; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.DbContexts; public class OidcDbContext { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs similarity index 79% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs index d775e8042..7032c64f2 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ApiResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs similarity index 93% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs index 2f4d7a938..e19663e1c 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ApiResourceEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs index b9de93ca0..ed3552a0c 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourcePropertyEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ApiResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs similarity index 80% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs index f82cdad49..493f8f4e1 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceScopeEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ApiResourceScopeEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs similarity index 85% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs index 8c25b700a..bbfde5896 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiResourceSecretEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ApiResourceSecretEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs similarity index 80% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs index c23856ed1..5a7e57080 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiScopeClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ApiScopeClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs similarity index 89% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs index 0c4fb6437..4baec8fd8 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiScopeEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ApiScopeEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs index ee513337e..e8a8a2571 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ApiScopePropertyEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ApiScopePropertyEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs index 0188de092..66fad07cd 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs index 6d866c9fe..db6d155b7 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientCorsOriginEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientCorsOriginEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientEntityTypeConfiguration.cs similarity index 95% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientEntityTypeConfiguration.cs index 726d5cfee..e5a89488f 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs index e6a4b1fc7..6c8d1eb2b 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientGrantTypeEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientGrantTypeEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs index 977e8b35d..f7d530fa8 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientIdPRestrictionEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientIdPRestrictionEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs index 031a6de86..8d060e643 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientPostLogoutRedirectUriEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientPostLogoutRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs index 903488602..7018a33bd 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientPropertyEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientPropertyEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs index b4108a0d4..99668ae4a 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientRedirectUriEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientRedirectUriEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs similarity index 80% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs index a28e488ea..cd67128f4 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientScopeEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientScopeEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs similarity index 84% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs index 0b838100e..72a672c66 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/ClientSecretEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class ClientSecretEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs similarity index 93% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs index 2f0cafe8b..719ca42ed 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/DeviceFlowCodesEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class DeviceFlowCodesEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs index 036e44634..b027e6cfc 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/IdentityResourceClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class IdentityResourceClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs similarity index 90% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs index 8d227f29f..e84fd2b89 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/IdentityResourceEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class IdentityResourceEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs similarity index 84% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs index 7726fee94..c4d43d643 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/IdentityResourcePropertyEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class IdentityResourcePropertyEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs similarity index 93% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs index 4e64e2707..3bf7724c7 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/PersistedGrantEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class PersistedGrantEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs similarity index 83% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs index b6a88f14c..ef2474a42 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/EntityConfigurations/UserClaimEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.EntityConfigurations; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.EntityConfigurations; public class UserClaimEntityTypeConfiguration : IEntityTypeConfiguration { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Masa.Contrib.Authentication.OpenIdConnect.EFCore.csproj similarity index 100% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.csproj rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Masa.Contrib.Authentication.OpenIdConnect.EFCore.csproj diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Options/OidcDbContextOptions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Options/OidcDbContextOptions.cs similarity index 94% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Options/OidcDbContextOptions.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Options/OidcDbContextOptions.cs index 8ff14d683..1f22a7d68 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Options/OidcDbContextOptions.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Options/OidcDbContextOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Options; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.Options; public class OidcDbContextOptions { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/README.md similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.md rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/README.md index cd20a47bd..181d6a948 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.md +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/README.md @@ -1,6 +1,6 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore +## Masa.Contrib.Authentication.OpenIdConnect.EFCore Effect: @@ -17,7 +17,7 @@ Use the Repository to operate the Oidc database Example: ```C# -Install-Package Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore +Install-Package Masa.Contrib.Authentication.OpenIdConnect.EFCore ``` ```C# diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/README.zh-CN.md similarity index 81% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/README.zh-CN.md index 9dee08bd8..b0e41c456 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/README.zh-CN.md +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/README.zh-CN.md @@ -1,6 +1,6 @@ 中 | [EN](README.md) -## Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore +## Masa.Contrib.Authentication.OpenIdConnect.EFCore 作用: @@ -17,7 +17,7 @@ 用例: ```C# -Install-Package Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore +Install-Package Masa.Contrib.Authentication.OpenIdConnect.EFCore ``` ```C# diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiResourceRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/ApiResourceRepository.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiResourceRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/ApiResourceRepository.cs index 99ed43477..5e9787c18 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiResourceRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/ApiResourceRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.Repositories; public class ApiResourceRepository : IApiResourceRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiScopeRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/ApiScopeRepository.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiScopeRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/ApiScopeRepository.cs index f0471a6bc..70477f620 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ApiScopeRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/ApiScopeRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.Repositories; public class ApiScopeRepository : IApiScopeRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ClientRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/ClientRepository.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ClientRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/ClientRepository.cs index 50bb57153..01d7ed561 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/ClientRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/ClientRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.Repositories; public class ClientRepository : IClientRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/IdentityResourceRepository.cs similarity index 98% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/IdentityResourceRepository.cs index 6b7427b3d..d2d9309a8 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/IdentityResourceRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/IdentityResourceRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.Repositories; public class IdentityResourceRepository : IIdentityResourceRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/UserClaimRepository.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/UserClaimRepository.cs similarity index 97% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/UserClaimRepository.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/UserClaimRepository.cs index 35a30fe60..3efc72f96 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/Repositories/UserClaimRepository.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/Repositories/UserClaimRepository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore.Repositories; public class UserClaimRepository : IUserClaimRepository { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/ServiceCollectionExtensions.cs similarity index 95% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/ServiceCollectionExtensions.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/ServiceCollectionExtensions.cs index a0ef492e3..db76d23f4 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/ServiceCollectionExtensions.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/ServiceCollectionExtensions.cs @@ -4,7 +4,7 @@ using Masa.BuildingBlocks.Data; using Masa.BuildingBlocks.Data.UoW; -namespace Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore; +namespace Masa.Contrib.Authentication.OpenIdConnect.EFCore; public static class ServiceCollectionExtensions { diff --git a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/_Imports.cs b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/_Imports.cs similarity index 67% rename from src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/_Imports.cs rename to src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/_Imports.cs index 4cc41df72..2e9596e67 100644 --- a/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Authentication/OpenIdConnect/Masa.Contrib.Authentication.OpenIdConnect.EFCore/_Imports.cs @@ -6,10 +6,10 @@ global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Domain.Repositories; global using Masa.BuildingBlocks.Authentication.OpenIdConnect.Models.Constans; global using Masa.BuildingBlocks.Ddd.Domain.Repositories; -global using Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Caches; -global using Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.DbContexts; -global using Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Options; -global using Masa.Contrib.Authentication.OpenIdConnect.EntityFrameworkCore.Repositories; +global using Masa.Contrib.Authentication.OpenIdConnect.EFCore.Caches; +global using Masa.Contrib.Authentication.OpenIdConnect.EFCore.DbContexts; +global using Masa.Contrib.Authentication.OpenIdConnect.EFCore.Options; +global using Masa.Contrib.Authentication.OpenIdConnect.EFCore.Repositories; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Metadata.Builders; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/DataFilter.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/DataFiltering/DataFilter.cs similarity index 96% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/DataFilter.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/DataFiltering/DataFilter.cs index 5108ddc6b..2cdc40b37 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/DataFilter.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/DataFiltering/DataFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.DataFiltering; +namespace Masa.Contrib.Data.Contracts.EFCore.DataFiltering; public class DataFilter : IDataFilter { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/SoftDeleteSaveChangesFilter.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/DataFiltering/SoftDeleteSaveChangesFilter.cs similarity index 97% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/SoftDeleteSaveChangesFilter.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/DataFiltering/SoftDeleteSaveChangesFilter.cs index a048d8acc..c7530c9ed 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/DataFiltering/SoftDeleteSaveChangesFilter.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/DataFiltering/SoftDeleteSaveChangesFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.DataFiltering; +namespace Masa.Contrib.Data.Contracts.EFCore.DataFiltering; public class SoftDeleteSaveChangesFilter : ISaveChangesFilter where TDbContext : DbContext diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DataFilterState.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/DataFilterState.cs similarity index 81% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DataFilterState.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/DataFilterState.cs index 0065d7922..f59f7055e 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DataFilterState.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/DataFilterState.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; +namespace Masa.Contrib.Data.Contracts.EFCore.Internal; internal class DataFilterState { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DisposeAction.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/DisposeAction.cs similarity index 83% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DisposeAction.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/DisposeAction.cs index cb87dcb53..1446754d2 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/DisposeAction.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/DisposeAction.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; +namespace Masa.Contrib.Data.Contracts.EFCore.Internal; internal class DisposeAction : IDisposable { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/InstanceBuilder.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/InstanceBuilder.cs similarity index 94% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/InstanceBuilder.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/InstanceBuilder.cs index 0f7286504..647ff9c35 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/InstanceBuilder.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/InstanceBuilder.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; +namespace Masa.Contrib.Data.Contracts.EFCore.Internal; internal class InstanceBuilder { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/NullDisposable.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/NullDisposable.cs similarity index 81% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/NullDisposable.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/NullDisposable.cs index 90ec32739..8ceb56442 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Internal/NullDisposable.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Internal/NullDisposable.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; +namespace Masa.Contrib.Data.Contracts.EFCore.Internal; internal class NullDisposable : IDisposable { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Masa.Contrib.Data.Contracts.EntityFrameworkCore.csproj b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Masa.Contrib.Data.Contracts.EFCore.csproj similarity index 77% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Masa.Contrib.Data.Contracts.EntityFrameworkCore.csproj rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Masa.Contrib.Data.Contracts.EFCore.csproj index 632632a94..3f067124f 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Masa.Contrib.Data.Contracts.EntityFrameworkCore.csproj +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Masa.Contrib.Data.Contracts.EFCore.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/MasaDbContextOptionsBuilderExtensions.cs similarity index 97% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/MasaDbContextOptionsBuilderExtensions.cs index 8c8f58b37..288d983c3 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore; +namespace Masa.Contrib.Data.Contracts.EFCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Options/FilterOptions.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Options/FilterOptions.cs similarity index 88% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Options/FilterOptions.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Options/FilterOptions.cs index 56efc1dde..62d1fd4c1 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/Options/FilterOptions.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/Options/FilterOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Options; +namespace Masa.Contrib.Data.Contracts.EFCore.Options; public class FilterOptions { diff --git a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/_Imports.cs similarity index 68% rename from src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs rename to src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/_Imports.cs index 9df7da147..f66a4cf56 100644 --- a/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Data/Contracts/Masa.Contrib.Data.Contracts.EFCore/_Imports.cs @@ -4,11 +4,11 @@ global using Masa.BuildingBlocks.Authentication.Identity; global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; -global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.DataFiltering; -global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.Internal; -global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.Options; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore.Filters; +global using Masa.Contrib.Data.Contracts.EFCore.DataFiltering; +global using Masa.Contrib.Data.Contracts.EFCore.Internal; +global using Masa.Contrib.Data.Contracts.EFCore.Options; +global using Masa.Contrib.Data.EFCore; +global using Masa.Contrib.Data.EFCore.Filters; global using Masa.Utils.Caching.Memory; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.ChangeTracking; diff --git a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/DataFilterTest.cs b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EFCore.Tests/DataFilterTest.cs similarity index 95% rename from src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/DataFilterTest.cs rename to src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EFCore.Tests/DataFilterTest.cs index b0251251d..aa25e9dca 100644 --- a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/DataFilterTest.cs +++ b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EFCore.Tests/DataFilterTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Data.Contracts.EFCore.Tests; [TestClass] public class DataFilterTest diff --git a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EFCore.Tests/Masa.Contrib.Data.Contracts.EFCore.Tests.csproj similarity index 93% rename from src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj rename to src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EFCore.Tests/Masa.Contrib.Data.Contracts.EFCore.Tests.csproj index 8abf78cee..b302c184b 100644 --- a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests.csproj +++ b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EFCore.Tests/Masa.Contrib.Data.Contracts.EFCore.Tests.csproj @@ -23,7 +23,7 @@ - + diff --git a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EFCore.Tests/_Imports.cs similarity index 80% rename from src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/_Imports.cs rename to src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EFCore.Tests/_Imports.cs index fbfb6c97e..8ccba637b 100644 --- a/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EntityFrameworkCore.Tests/_Imports.cs +++ b/src/Contrib/Data/Contracts/Tests/Masa.Contrib.Data.Contracts.EFCore.Tests/_Imports.cs @@ -2,6 +2,6 @@ // Licensed under the MIT License. See LICENSE.txt in the project root for license information. global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; -global using Masa.Contrib.Data.Contracts.EntityFrameworkCore.DataFiltering; +global using Masa.Contrib.Data.Contracts.EFCore.DataFiltering; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/DistributedBenchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Distributed.Redis.Tests.Perfs/DistributedBenchmarks.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/DistributedBenchmarks.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Distributed.Redis.Tests.Perfs/DistributedBenchmarks.cs diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Distributed.Redis.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Distributed.Redis.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs.csproj diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Distributed.Redis.Tests.Perfs/Program.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/Program.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Distributed.Redis.Tests.Perfs/Program.cs diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Distributed.Redis.Tests.Perfs/_Imports.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Distributed.Redis.Tests.Perfs/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Distributed.Redis.Tests.Perfs/_Imports.cs diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Benchmarks.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Tests.Perfs/Benchmarks.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Benchmarks.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Tests.Perfs/Benchmarks.cs diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Tests.Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs.csproj diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Program.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Tests.Perfs/Program.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/Program.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Tests.Perfs/Program.cs diff --git a/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/_Imports.cs b/src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Tests.Perfs/_Imports.cs similarity index 100% rename from src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Masa.Contrib.Data.IdGenerator.Snowflake.Tests.Perfs/_Imports.cs rename to src/Contrib/Data/IdGenerator/Snowflake/Tests/Perfs/Tests.Perfs/_Imports.cs diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/Internal/Parser.cs similarity index 93% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/Internal/Parser.cs index f734442a5..b89277bca 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Internal/Parser.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/Internal/Parser.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Cosmos.Internal; +namespace Masa.Contrib.Data.EFCore.Cosmos.Internal; internal static class Parser { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/Masa.Contrib.Data.EFCore.Cosmos.csproj similarity index 75% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/Masa.Contrib.Data.EFCore.Cosmos.csproj index b9232abc8..c27dc0b36 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/Masa.Contrib.Data.EntityFrameworkCore.Cosmos.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/Masa.Contrib.Data.EFCore.Cosmos.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/MasaDbContextBuilderExtensions.cs similarity index 99% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/MasaDbContextBuilderExtensions.cs index 38730fe8b..5a54d8dca 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/MasaDbContextBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs similarity index 95% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs index 5b5b97b55..0a3919045 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/README.md similarity index 88% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/README.md index de4021a5f..144bc63aa 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Data.EntityFrameworkCore.Cosmos +## Masa.Contrib.Data.EFCore.Cosmos ## Example: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Cosmos +Install-Package Masa.Contrib.Data.EFCore.Cosmos ``` ##### Usage 1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/README.zh-CN.md similarity index 87% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/README.zh-CN.md index fba9c83bf..e1c31c8c0 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Data.EntityFrameworkCore.Cosmos +## Masa.Contrib.Data.EFCore.Cosmos ## 用例: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Cosmos +Install-Package Masa.Contrib.Data.EFCore.Cosmos ``` #### 用法1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/_Imports.cs similarity index 85% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/_Imports.cs index aab4fdb17..0a3b17c8f 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Cosmos/_Imports.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Cosmos/_Imports.cs @@ -2,7 +2,7 @@ // Licensed under the MIT License. See LICENSE.txt in the project root for license information. global using Masa.BuildingBlocks.Data; -global using Masa.Contrib.Data.EntityFrameworkCore.Cosmos.Internal; +global using Masa.Contrib.Data.EFCore.Cosmos.Internal; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Infrastructure; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/Masa.Contrib.Data.EFCore.InMemory.csproj similarity index 69% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/Masa.Contrib.Data.EFCore.InMemory.csproj index 3edf550bc..28d9ff291 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/Masa.Contrib.Data.EntityFrameworkCore.InMemory.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/Masa.Contrib.Data.EFCore.InMemory.csproj @@ -4,6 +4,7 @@ net6.0 enable enable + Masa.Contrib.Data.EFCore.InMemory @@ -11,7 +12,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/MasaDbContextBuilderExtensions.cs similarity index 98% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/MasaDbContextBuilderExtensions.cs index 4eddf1d3b..0f6705958 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/MasaDbContextBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs similarity index 92% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs index 7d8293971..6b6e8cba5 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/README.md similarity index 81% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/README.md index b4293b730..217c14429 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Data.EntityFrameworkCore.InMemory +## Masa.Contrib.Data.EFCore.InMemory ## Example: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.InMemory +Install-Package Masa.Contrib.Data.EFCore.InMemory ``` ##### Usage 1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/README.zh-CN.md similarity index 81% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/README.zh-CN.md index e28c40a0e..87b815e31 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Data.EntityFrameworkCore.InMemory +## Masa.Contrib.Data.EFCore.InMemory ## 用例: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.InMemory +Install-Package Masa.Contrib.Data.EFCore.InMemory ``` #### 用法1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/_Imports.cs similarity index 100% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.InMemory/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.InMemory/_Imports.cs diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/Masa.Contrib.Data.EFCore.MySql.csproj similarity index 75% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/Masa.Contrib.Data.EFCore.MySql.csproj index 77df81d87..e06862443 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/Masa.Contrib.Data.EntityFrameworkCore.MySql.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/Masa.Contrib.Data.EFCore.MySql.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/MasaDbContextBuilderExtensions.cs similarity index 98% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/MasaDbContextBuilderExtensions.cs index 7ae2bbe24..2f5f55421 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/MasaDbContextBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/MasaDbContextOptionsBuilderExtensions.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/MasaDbContextOptionsBuilderExtensions.cs index d83be809a..ce4136fb3 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/README.md similarity index 84% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/README.md index 967a2674f..1b1a6df31 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Data.EntityFrameworkCore.MySql +## Masa.Contrib.Data.EFCore.MySql ## Example: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.MySql +Install-Package Masa.Contrib.Data.EFCore.MySql ``` ##### Usage 1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/README.zh-CN.md similarity index 84% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/README.zh-CN.md index f19a31586..89fa2be73 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Data.EntityFrameworkCore.MySql +## Masa.Contrib.Data.EFCore.MySql ## 用例: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.MySql +Install-Package Masa.Contrib.Data.EFCore.MySql ``` #### 用法1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/_Imports.cs similarity index 100% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.MySql/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.MySql/_Imports.cs diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/Masa.Contrib.Data.EFCore.Oracle.csproj similarity index 74% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/Masa.Contrib.Data.EFCore.Oracle.csproj index ef7797dc1..7466a4ae5 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/Masa.Contrib.Data.EntityFrameworkCore.Oracle.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/Masa.Contrib.Data.EFCore.Oracle.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/MasaDbContextBuilderExtensions.cs similarity index 98% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/MasaDbContextBuilderExtensions.cs index d9fe02baa..c7b788e57 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/MasaDbContextBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs index 50591cd78..936ccdff5 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/README.md similarity index 83% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/README.md index 97f1a32b5..095afca84 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Data.EntityFrameworkCore.Oracle +## Masa.Contrib.Data.EFCore.Oracle ## Example: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Oracle +Install-Package Masa.Contrib.Data.EFCore.Oracle ``` ##### Usage 1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/README.zh-CN.md similarity index 83% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/README.zh-CN.md index fd3328d07..fb27d6002 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Data.EntityFrameworkCore.Oracle +## Masa.Contrib.Data.EFCore.Oracle ## 用例: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Oracle +Install-Package Masa.Contrib.Data.EFCore.Oracle ``` #### 用法1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/_Imports.cs similarity index 100% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Oracle/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Oracle/_Imports.cs diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/Masa.Contrib.Data.EFCore.Pomelo.MySql.csproj similarity index 74% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/Masa.Contrib.Data.EFCore.Pomelo.MySql.csproj index 5abc63273..50f2f48fa 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/Masa.Contrib.Data.EFCore.Pomelo.MySql.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs similarity index 98% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs index 9edc1bf94..7a7303508 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/MasaDbContextBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs similarity index 95% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs index 485b3f63e..3b1a63e88 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/README.md similarity index 85% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/README.md index 5d170c32a..004c47efc 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql +## Masa.Contrib.Data.EFCore.Pomelo.MySql ## Example: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql +Install-Package Masa.Contrib.Data.EFCore.Pomelo.MySql ``` ##### Usage 1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/README.zh-CN.md similarity index 85% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/README.zh-CN.md index 9113e1bb1..7d2bb1c5a 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql +## Masa.Contrib.Data.EFCore.Pomelo.MySql ## 用例: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql +Install-Package Masa.Contrib.Data.EFCore.Pomelo.MySql ``` #### 用法1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/_Imports.cs similarity index 100% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Pomelo.MySql/_Imports.cs diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/Masa.Contrib.Data.EFCore.PostgreSql.csproj similarity index 74% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/Masa.Contrib.Data.EFCore.PostgreSql.csproj index 699e24cd3..18a076cc3 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/Masa.Contrib.Data.EFCore.PostgreSql.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/MasaDbContextBuilderExtensions.cs similarity index 98% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/MasaDbContextBuilderExtensions.cs index 1ffcf34e0..e090ee4e3 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/MasaDbContextBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs index 17624e597..df2ea44b4 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/README.md similarity index 83% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/README.md index 88af3796e..5bb914fc9 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Data.EntityFrameworkCore.PostgreSql +## Masa.Contrib.Data.EFCore.PostgreSql ## Example: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.PostgreSql +Install-Package Masa.Contrib.Data.EFCore.PostgreSql ``` ##### Usage 1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/README.zh-CN.md similarity index 83% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/README.zh-CN.md index 99af59623..8fd1162ca 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Data.EntityFrameworkCore.PostgreSql +## Masa.Contrib.Data.EFCore.PostgreSql ## 用例: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.PostgreSql +Install-Package Masa.Contrib.Data.EFCore.PostgreSql ``` #### 用法1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/_Imports.cs similarity index 100% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.PostgreSql/_Imports.cs diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/Masa.Contrib.Data.EFCore.SqlServer.csproj similarity index 75% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/Masa.Contrib.Data.EFCore.SqlServer.csproj index ee9aca007..24598e8a1 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/Masa.Contrib.Data.EntityFrameworkCore.SqlServer.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/Masa.Contrib.Data.EFCore.SqlServer.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/MasaDbContextBuilderExtensions.cs similarity index 98% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/MasaDbContextBuilderExtensions.cs index 25939987a..b00ae8238 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/MasaDbContextBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs index dcd110898..91b5fc7cf 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/README.md similarity index 83% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/README.md index 3bb2223f2..170beddb1 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Data.EntityFrameworkCore.SqlServer +## Masa.Contrib.Data.EFCore.SqlServer ## Example: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` ##### Usage 1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/README.zh-CN.md similarity index 83% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/README.zh-CN.md index baca04f2f..4012c4de8 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Data.EntityFrameworkCore.SqlServer +## Masa.Contrib.Data.EFCore.SqlServer ## 用例: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` #### 用法1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/_Imports.cs similarity index 100% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.SqlServer/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.SqlServer/_Imports.cs diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/Masa.Contrib.Data.EFCore.Sqlite.csproj similarity index 75% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/Masa.Contrib.Data.EFCore.Sqlite.csproj index 6ddda3d22..7203a3919 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/Masa.Contrib.Data.EntityFrameworkCore.Sqlite.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/Masa.Contrib.Data.EFCore.Sqlite.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/MasaDbContextBuilderExtensions.cs similarity index 98% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/MasaDbContextBuilderExtensions.cs index 6d3ada22d..ba1eefeee 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/MasaDbContextBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs index c8bc12f72..62f507d69 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/MasaDbContextOptionsBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class MasaDbContextOptionsBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/README.md similarity index 84% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/README.md index f67058740..22afd7b4c 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Data.EntityFrameworkCore.Sqlite +## Masa.Contrib.Data.EFCore.Sqlite ## Example: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Sqlite +Install-Package Masa.Contrib.Data.EFCore.Sqlite ``` ##### Usage 1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/README.zh-CN.md similarity index 83% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/README.zh-CN.md index bcef8183c..82430f190 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Data.EntityFrameworkCore.Sqlite +## Masa.Contrib.Data.EFCore.Sqlite ## 用例: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore.Sqlite +Install-Package Masa.Contrib.Data.EFCore.Sqlite ``` #### 用法1: diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/_Imports.cs similarity index 100% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Sqlite/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Sqlite/_Imports.cs diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/CustomDbContext.cs similarity index 91% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/CustomDbContext.cs index 9538e0227..c70cafedd 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/CustomDbContext.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/CustomDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Data.EFCore.Tests; public class CustomDbContext : MasaDbContext { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/DbContextTest.cs similarity index 99% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/DbContextTest.cs index e72d3336d..6e634d3a7 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DbContextTest.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/DbContextTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Data.EFCore.Tests; [TestClass] public class DbContextTest : TestBase diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/DefaultConnectionStringProviderTest.cs similarity index 97% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/DefaultConnectionStringProviderTest.cs index b14e73e0e..473723e2d 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/DefaultConnectionStringProviderTest.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/DefaultConnectionStringProviderTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Data.EFCore.Tests; [TestClass] public class DefaultConnectionStringProviderTest diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Internal/PaginatedOptions.cs similarity index 80% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Internal/PaginatedOptions.cs index 14a21d266..f011e4df1 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/PaginatedOptions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Internal/PaginatedOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; +namespace Masa.Contrib.Data.EFCore.Tests.Internal; internal class PaginatedOptions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Internal/Repository.cs similarity index 95% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Internal/Repository.cs index 8977dee53..a13735bfa 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Internal/Repository.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Internal/Repository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; +namespace Masa.Contrib.Data.EFCore.Tests.Internal; internal class Repository { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Masa.Contrib.Data.EFCore.Tests.csproj similarity index 82% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Masa.Contrib.Data.EFCore.Tests.csproj index e9f43c804..930e7ef66 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Masa.Contrib.Data.EntityFrameworkCore.Tests.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Masa.Contrib.Data.EFCore.Tests.csproj @@ -18,8 +18,8 @@ - - + + diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Models/Address.cs similarity index 81% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Models/Address.cs index 2909884f3..3f6bcab16 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Address.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Models/Address.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; +namespace Masa.Contrib.Data.EFCore.Tests.Models; public class Address { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Models/Hobby.cs similarity index 85% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Models/Hobby.cs index 366e9a9b9..b8850acab 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Hobby.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Models/Hobby.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; +namespace Masa.Contrib.Data.EFCore.Tests.Models; public class Hobby { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Models/Student.cs similarity index 88% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Models/Student.cs index 9850f1531..a942be271 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/Models/Student.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/Models/Student.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; +namespace Masa.Contrib.Data.EFCore.Tests.Models; public class Student : ISoftDelete { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/TestBase.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/TestBase.cs index 1f6585563..430c6c545 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/TestBase.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/TestBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Data.EFCore.Tests; public class TestBase { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/_Imports.cs similarity index 66% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/_Imports.cs index 55a06cf61..ab9f390b1 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.Tests/_Imports.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore.Tests/_Imports.cs @@ -4,10 +4,10 @@ global using Masa.BuildingBlocks.Data; global using Masa.BuildingBlocks.Data.Contracts.DataFiltering; global using Masa.BuildingBlocks.Data.Contracts.Paginated; -global using Masa.Contrib.Data.Contracts.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore.Filters; -global using Masa.Contrib.Data.EntityFrameworkCore.Tests.Internal; -global using Masa.Contrib.Data.EntityFrameworkCore.Tests.Models; +global using Masa.Contrib.Data.Contracts.EFCore; +global using Masa.Contrib.Data.EFCore.Filters; +global using Masa.Contrib.Data.EFCore.Tests.Internal; +global using Masa.Contrib.Data.EFCore.Tests.Models; global using Microsoft.EntityFrameworkCore; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.Options; diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DbConnectionStringProvider.cs similarity index 92% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DbConnectionStringProvider.cs index 243a36930..9eab65a47 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DbConnectionStringProvider.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DbConnectionStringProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public class DbConnectionStringProvider : BaseDbConnectionStringProvider { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultConnectionStringProvider.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultConnectionStringProvider.cs index d351e6dce..bd9110af8 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/DefaultConnectionStringProvider.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/DefaultConnectionStringProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public class DefaultConnectionStringProvider : IConnectionStringProvider { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/EntityTypeBuilderExtensions.cs similarity index 95% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/EntityTypeBuilderExtensions.cs index 505fc7ff0..db85ccd81 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/EntityTypeBuilderExtensions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/EntityTypeBuilderExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public static class EntityTypeBuilderExtensions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/Filters/ISaveChangesFilter.cs similarity index 80% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/Filters/ISaveChangesFilter.cs index ac9e73fc4..5ae1d5cbd 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/ISaveChangesFilter.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/Filters/ISaveChangesFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Filters; +namespace Masa.Contrib.Data.EFCore.Filters; public interface ISaveChangesFilter { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/Filters/SaveChangeFilter.cs similarity index 97% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/Filters/SaveChangeFilter.cs index f9daadfe5..86eba40d7 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Filters/SaveChangeFilter.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/Filters/SaveChangeFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore.Filters; +namespace Masa.Contrib.Data.EFCore.Filters; public class SaveChangeFilter : ISaveChangesFilter where TDbContext : DbContext diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/IModelCreatingProvider.cs similarity index 88% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/IModelCreatingProvider.cs index 0fa3ebcb5..b28250150 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/IModelCreatingProvider.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/IModelCreatingProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public interface IModelCreatingProvider { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/Masa.Contrib.Data.EFCore.csproj similarity index 96% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/Masa.Contrib.Data.EFCore.csproj index ae71001b3..19c00c054 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore.csproj +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/Masa.Contrib.Data.EFCore.csproj @@ -4,6 +4,7 @@ net6.0 enable enable + Masa.Contrib.Data.EFCore diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContext.cs similarity index 99% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContext.cs index 5d3a0d14e..81a807fee 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContext.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public abstract class MasaDbContext : DbContext, IMasaDbContext { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextBuilder.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextBuilder.cs index 2877a57f0..74d26c797 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextBuilder.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextBuilder.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public class MasaDbContextBuilder { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptions.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptions.cs index 68af024e7..17c7a2e34 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public abstract class MasaDbContextOptions : DbContextOptions { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptionsBuilder.cs similarity index 93% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptionsBuilder.cs index eef2f8263..3a6e904b8 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptionsBuilder.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public abstract class MasaDbContextOptionsBuilder { diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptionsBuilder`.cs similarity index 94% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptionsBuilder`.cs index dbfe6a65a..f3082cd9e 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptionsBuilder`.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptionsBuilder`.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public class MasaDbContextOptionsBuilder : MasaDbContextOptionsBuilder where TDbContext : MasaDbContext, IMasaDbContext diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptions`.cs similarity index 98% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptions`.cs index a00b7ad08..b33af9276 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/MasaDbContextOptions`.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/MasaDbContextOptions`.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.EntityFrameworkCore; +namespace Masa.Contrib.Data.EFCore; public class MasaDbContextOptions : MasaDbContextOptions where TContext : DbContext diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/README.md similarity index 54% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/README.md index 6d3f9645d..60beb9bc1 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Data.EntityFrameworkCore +## Masa.Contrib.Data.EFCore ## Example: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore +Install-Package Masa.Contrib.Data.EFCore Install-Package Microsoft.EntityFrameworkCore.SqlServer ``` @@ -23,14 +23,14 @@ builder.Services.AddMasaDbContext(optionsBuilder => Recommended usage: -- [SqlServer](../Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.md) -- [MySql](../Masa.Contrib.Data.EntityFrameworkCore.MySql/README.md) -- [Pomelo.MySql](../Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.md) -- [Sqlite](../Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.md) -- [Cosmos](../Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.md) -- [InMemory](../Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.md) -- [Oracle](../Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.md) -- [PostgreSql](../Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.md) +- [SqlServer](../Masa.Contrib.Data.EFCore.SqlServer/README.md) +- [MySql](../Masa.Contrib.Data.EFCore.MySql/README.md) +- [Pomelo.MySql](../Masa.Contrib.Data.EFCore.Pomelo.MySql/README.md) +- [Sqlite](../Masa.Contrib.Data.EFCore.Sqlite/README.md) +- [Cosmos](../Masa.Contrib.Data.EFCore.Cosmos/README.md) +- [InMemory](../Masa.Contrib.Data.EFCore.InMemory/README.md) +- [Oracle](../Masa.Contrib.Data.EFCore.Oracle/README.md) +- [PostgreSql](../Masa.Contrib.Data.EFCore.PostgreSql/README.md) #### data filter diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/README.zh-CN.md similarity index 50% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/README.zh-CN.md index 06a481cfd..2c5a75671 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/README.zh-CN.md +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/README.zh-CN.md @@ -1,12 +1,12 @@ 中 | [EN](README.md) -## Masa.Contrib.Data.EntityFrameworkCore +## Masa.Contrib.Data.EFCore ## 用例: ```c# -Install-Package Masa.Contrib.Data.EntityFrameworkCore -Install-Package Masa.Contrib.Data.Contracts.EntityFrameworkCore +Install-Package Masa.Contrib.Data.EFCore +Install-Package Masa.Contrib.Data.Contracts.EFCore Install-Package Microsoft.EntityFrameworkCore.SqlServer//这里以SqlServer举例 ``` @@ -24,14 +24,14 @@ builder.Services.AddMasaDbContext(optionsBuilder => 推荐用法: -- [SqlServer](../Masa.Contrib.Data.EntityFrameworkCore.SqlServer/README.zh-CN.md) -- [MySql](../Masa.Contrib.Data.EntityFrameworkCore.MySql/README.zh-CN.md) -- [Pomelo.MySql](../Masa.Contrib.Data.EntityFrameworkCore.Pomelo.MySql/README.zh-CN.md) -- [Sqlite](../Masa.Contrib.Data.EntityFrameworkCore.Sqlite/README.zh-CN.md) -- [Cosmos](../Masa.Contrib.Data.EntityFrameworkCore.Cosmos/README.zh-CN.md) -- [InMemory](../Masa.Contrib.Data.EntityFrameworkCore.InMemory/README.zh-CN.md) -- [Oracle](../Masa.Contrib.Data.EntityFrameworkCore.Oracle/README.zh-CN.md) -- [PostgreSql](../Masa.Contrib.Data.EntityFrameworkCore.PostgreSql/README.zh-CN.md) +- [SqlServer](../Masa.Contrib.Data.EFCore.SqlServer/README.zh-CN.md) +- [MySql](../Masa.Contrib.Data.EFCore.MySql/README.zh-CN.md) +- [Pomelo.MySql](../Masa.Contrib.Data.EFCore.Pomelo.MySql/README.zh-CN.md) +- [Sqlite](../Masa.Contrib.Data.EFCore.Sqlite/README.zh-CN.md) +- [Cosmos](../Masa.Contrib.Data.EFCore.Cosmos/README.zh-CN.md) +- [InMemory](../Masa.Contrib.Data.EFCore.InMemory/README.zh-CN.md) +- [Oracle](../Masa.Contrib.Data.EFCore.Oracle/README.zh-CN.md) +- [PostgreSql](../Masa.Contrib.Data.EFCore.PostgreSql/README.zh-CN.md) #### 数据过滤器 diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/ServiceCollectionExtensions.cs similarity index 100% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/ServiceCollectionExtensions.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/ServiceCollectionExtensions.cs diff --git a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/_Imports.cs similarity index 90% rename from src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs rename to src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/_Imports.cs index 19c261ac6..c74483086 100644 --- a/src/Contrib/Data/Orm/EntityFrameworkCore/Masa.Contrib.Data.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Data/Orm/EFCore/Masa.Contrib.Data.EFCore/_Imports.cs @@ -9,8 +9,8 @@ global using Masa.BuildingBlocks.Ddd.Domain.Entities; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; global using Masa.BuildingBlocks.Ddd.Domain.Events; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore.Filters; +global using Masa.Contrib.Data.EFCore; +global using Masa.Contrib.Data.EFCore.Filters; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.ChangeTracking; global using Microsoft.EntityFrameworkCore.Infrastructure; diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/DefaultConnectionStringProvider.cs similarity index 97% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/DefaultConnectionStringProvider.cs index b6d21ebc7..3a1728624 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DefaultConnectionStringProvider.cs +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/DefaultConnectionStringProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.UoW.EF; +namespace Masa.Contrib.Data.UoW.EFCore; public class DefaultConnectionStringProvider : IConnectionStringProvider { diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/DispatcherOptionsExtensions.cs similarity index 98% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/DispatcherOptionsExtensions.cs index dfd338586..e42624d9b 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/DispatcherOptionsExtensions.cs +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/DispatcherOptionsExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.UoW.EF; +namespace Masa.Contrib.Data.UoW.EFCore; public static class DispatcherOptionsExtensions { diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Internal/Const.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/Internal/Const.cs similarity index 82% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Internal/Const.cs rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/Internal/Const.cs index 7c0b9d177..dfb8a1a32 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Internal/Const.cs +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/Internal/Const.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.UoW.EF.Internal; +namespace Masa.Contrib.Data.UoW.EFCore.Internal; internal class Const { diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/Masa.Contrib.Data.UoW.EFCore.csproj similarity index 83% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/Masa.Contrib.Data.UoW.EFCore.csproj index 30305bdae..5c46d77bb 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Masa.Contrib.Data.UoW.EF.csproj +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/Masa.Contrib.Data.UoW.EFCore.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.md b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/README.md similarity index 80% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.md rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/README.md index 002778c9a..198f1bd44 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.md +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/README.md @@ -6,8 +6,8 @@ Example: ```C# Install-Package Masa.Contrib.Dispatcher.Events -Install-Package Masa.Contrib.Data.UoW.EF -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.UoW.EFCore +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. Configure appsettings.json diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.zh-CN.md b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/README.zh-CN.md similarity index 80% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.zh-CN.md rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/README.zh-CN.md index d2af8dc5c..15bedabd5 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/README.zh-CN.md +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/README.zh-CN.md @@ -6,8 +6,8 @@ ```C# Install-Package Masa.Contrib.Dispatcher.Events -Install-Package Masa.Contrib.Data.UoW.EF -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.UoW.EFCore +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. 配置appsettings.json diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Transaction.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/Transaction.cs similarity index 89% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Transaction.cs rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/Transaction.cs index 664d8c2e7..bbb479062 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/Transaction.cs +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/Transaction.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.UoW.EF; +namespace Masa.Contrib.Data.UoW.EFCore; public class Transaction : ITransaction { diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/UnitOfWork.cs similarity index 98% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/UnitOfWork.cs index bba189c70..0a8739bf2 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWork.cs +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/UnitOfWork.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.UoW.EF; +namespace Masa.Contrib.Data.UoW.EFCore; public class UnitOfWork : IUnitOfWork where TDbContext : MasaDbContext, IMasaDbContext { diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/UnitOfWorkAccessor.cs similarity index 87% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/UnitOfWorkAccessor.cs index 9f25b6e13..3730a046e 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkAccessor.cs +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/UnitOfWorkAccessor.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.UoW.EF; +namespace Masa.Contrib.Data.UoW.EFCore; public class UnitOfWorkAccessor : IUnitOfWorkAccessor { diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/UnitOfWorkManager.cs similarity index 97% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/UnitOfWorkManager.cs index 39b9a2ad0..71e0eee35 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/UnitOfWorkManager.cs +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/UnitOfWorkManager.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.UoW.EF; +namespace Masa.Contrib.Data.UoW.EFCore; public class UnitOfWorkManager : IUnitOfWorkManager where TDbContext : MasaDbContext, IMasaDbContext { diff --git a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/_Imports.cs b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/_Imports.cs similarity index 94% rename from src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/_Imports.cs rename to src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/_Imports.cs index 87fb70f0c..47cc95067 100644 --- a/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EF/_Imports.cs +++ b/src/Contrib/Data/UoW/Masa.Contrib.Data.UoW.EFCore/_Imports.cs @@ -6,7 +6,7 @@ global using Masa.BuildingBlocks.Data.UoW; global using Masa.BuildingBlocks.Ddd.Domain.Events; global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Data.EFCore; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Storage; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/CustomDbContext.cs similarity index 95% rename from src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs rename to src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/CustomDbContext.cs index 380088173..3210672b2 100644 --- a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/CustomDbContext.cs +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/CustomDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.UoW.EF.Tests; +namespace Masa.Contrib.Data.UoW.EFCore.Tests; public class CustomDbContext : MasaDbContext { diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/Masa.Contrib.Data.UoW.EFCore.Tests.csproj similarity index 88% rename from src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj rename to src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/Masa.Contrib.Data.UoW.EFCore.Tests.csproj index f44ea2b43..444ba1bea 100644 --- a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/Masa.Contrib.Data.UoW.EF.Tests.csproj +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/Masa.Contrib.Data.UoW.EFCore.Tests.csproj @@ -38,8 +38,8 @@ - - + + diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/TestBase.cs similarity index 87% rename from src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs rename to src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/TestBase.cs index 8b06e74be..be990074c 100644 --- a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestBase.cs +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/TestBase.cs @@ -1,9 +1,9 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Data.UoW.EF.Tests; +namespace Masa.Contrib.Data.UoW.EFCore.Tests; -public class TestBase +public class TestBase { protected readonly string _connectionString = "DataSource=:memory:"; protected readonly SqliteConnection Connection; diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/TestUnitOfWork.cs similarity index 99% rename from src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs rename to src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/TestUnitOfWork.cs index f3400d93b..d2b3a32f1 100644 --- a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/TestUnitOfWork.cs +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/TestUnitOfWork.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Options; using EntityState = Masa.BuildingBlocks.Data.UoW.EntityState; -namespace Masa.Contrib.Data.UoW.EF.Tests; +namespace Masa.Contrib.Data.UoW.EFCore.Tests; [TestClass] public class TestUnitOfWork : TestBase diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/_Imports.cs similarity index 93% rename from src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs rename to src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/_Imports.cs index 0640ec664..33b87445a 100644 --- a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/_Imports.cs +++ b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/_Imports.cs @@ -6,7 +6,7 @@ global using Masa.BuildingBlocks.Data.Options; global using Masa.BuildingBlocks.Data.UoW; global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Data.EFCore; global using Microsoft.AspNetCore.Builder; global using Microsoft.Data.Sqlite; global using Microsoft.EntityFrameworkCore; diff --git a/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json b/src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/appsettings.json similarity index 100% rename from src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EF.Tests/appsettings.json rename to src/Contrib/Data/UoW/Tests/Masa.Contrib.Data.UoW.EFCore.Tests/appsettings.json diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/DispatcherOptionsExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/DispatcherOptionsExtensions.cs similarity index 93% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/DispatcherOptionsExtensions.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/DispatcherOptionsExtensions.cs index 11407494d..8e46280be 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/DispatcherOptionsExtensions.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/DispatcherOptionsExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore; +namespace Masa.Contrib.Ddd.Domain.Repository.EFCore; public static class DispatcherOptionsExtensions { diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/LinqExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Internal/LinqExtensions.cs similarity index 98% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/LinqExtensions.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Internal/LinqExtensions.cs index 2042bdc78..7de30907f 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/LinqExtensions.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Internal/LinqExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Internal; +namespace Masa.Contrib.Ddd.Domain.Repository.EFCore.Internal; internal static class LinqExtensions { diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/ServiceCollectionRepositoryExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Internal/ServiceCollectionRepositoryExtensions.cs similarity index 97% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/ServiceCollectionRepositoryExtensions.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Internal/ServiceCollectionRepositoryExtensions.cs index 086174de9..ac9fff57f 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/ServiceCollectionRepositoryExtensions.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Internal/ServiceCollectionRepositoryExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Internal; +namespace Masa.Contrib.Ddd.Domain.Repository.EFCore.Internal; internal static class ServiceCollectionRepositoryExtensions { diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/TypeExtensions.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Internal/TypeExtensions.cs similarity index 88% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/TypeExtensions.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Internal/TypeExtensions.cs index af1d20750..8e16a06a9 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Internal/TypeExtensions.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Internal/TypeExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Internal; +namespace Masa.Contrib.Ddd.Domain.Repository.EFCore.Internal; internal static class TypeExtensions { diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.csproj b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Masa.Contrib.Ddd.Domain.Repository.EFCore.csproj similarity index 100% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.csproj rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Masa.Contrib.Ddd.Domain.Repository.EFCore.csproj diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/README.md similarity index 91% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.md rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/README.md index 4aff6c76b..328dd2687 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.md +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/README.md @@ -1,11 +1,11 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore +## Masa.Contrib.Ddd.Domain.Repository.EFCore Example: ```c# -Install-Package Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore +Install-Package Masa.Contrib.Ddd.Domain.Repository.EFCore ``` > Advantages: The EF version of IRepository provides basic CRUD diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/README.zh-CN.md similarity index 91% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/README.zh-CN.md index 12ccf06ce..7f20ab519 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/README.zh-CN.md +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/README.zh-CN.md @@ -1,11 +1,11 @@ 中 | [EN](README.md) -## Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore +## Masa.Contrib.Ddd.Domain.Repository.EFCore 用例: ```c# -Install-Package Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore +Install-Package Masa.Contrib.Ddd.Domain.Repository.EFCore ``` > 优势:IRepository的EF版实现,提供了基础的CRUD diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Repository.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Repository.cs similarity index 99% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Repository.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Repository.cs index 22fa24045..97591eb65 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/Repository.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/Repository.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore; +namespace Masa.Contrib.Ddd.Domain.Repository.EFCore; public class Repository : BaseRepository diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/_Imports.cs similarity index 89% rename from src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs rename to src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/_Imports.cs index 9bfc8b910..e8333dd82 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain.Repository.EFCore/_Imports.cs @@ -5,7 +5,7 @@ global using Masa.BuildingBlocks.Ddd.Domain.Entities; global using Masa.BuildingBlocks.Ddd.Domain.Repositories; global using Masa.BuildingBlocks.Dispatcher.Events; -global using Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Internal; +global using Masa.Contrib.Ddd.Domain.Repository.EFCore.Internal; global using Microsoft.EntityFrameworkCore; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.DependencyInjection.Extensions; diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md index 2eea9359d..181218ad0 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.md @@ -6,14 +6,14 @@ Example: ```c# Install-Package Masa.Contrib.Ddd.Domain -Install-Package Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore +Install-Package Masa.Contrib.Ddd.Domain.Repository.EFCore Install-Package Masa.Contrib.Dispatcher.Events Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore -Install-Package Masa.Contrib.Data.UoW.EF -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore +Install-Package Masa.Contrib.Data.UoW.EFCore +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. Add DomainEventBus diff --git a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md index 02ea5c25f..0ca8debed 100644 --- a/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md +++ b/src/Contrib/Ddd/Domain/Masa.Contrib.Ddd.Domain/README.zh-CN.md @@ -6,14 +6,14 @@ ```c# Install-Package Masa.Contrib.Ddd.Domain -Install-Package Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore +Install-Package Masa.Contrib.Ddd.Domain.Repository.EFCore Install-Package Masa.Contrib.Dispatcher.Events Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore -Install-Package Masa.Contrib.Data.UoW.EF -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore +Install-Package Masa.Contrib.Data.UoW.EFCore +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. 添加DomainEventBus diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Address.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Domain/Entities/Address.cs similarity index 87% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Address.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Domain/Entities/Address.cs index 7277ae71e..7b10fa0b8 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Address.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Domain/Entities/Address.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.Domain.Entities; +namespace Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests.Domain.Entities; public class Address : ValueObject { diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/OrderItem.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Domain/Entities/OrderItem.cs similarity index 83% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/OrderItem.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Domain/Entities/OrderItem.cs index 34ccd939f..23bf5509e 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/OrderItem.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Domain/Entities/OrderItem.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.Domain.Entities; +namespace Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests.Domain.Entities; public class OrderItem : Entity { diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Orders.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Domain/Entities/Orders.cs similarity index 91% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Orders.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Domain/Entities/Orders.cs index 03077cd02..cb59e3b25 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Domain/Entities/Orders.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Domain/Entities/Orders.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.Domain.Entities; +namespace Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests.Domain.Entities; public class Orders : AuditAggregateRoot { diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests.csproj similarity index 91% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests.csproj index bf47f9c5d..7d166a35b 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.csproj +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests.csproj @@ -19,7 +19,7 @@ - + diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/RepositoryTest.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/RepositoryTest.cs similarity index 99% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/RepositoryTest.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/RepositoryTest.cs index 89f46a119..40cf25334 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/RepositoryTest.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/RepositoryTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests; [TestClass] public class RepositoryTest diff --git a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/_Imports.cs similarity index 87% rename from src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs rename to src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/_Imports.cs index 11bec7090..acdc30e13 100644 --- a/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests/_Imports.cs +++ b/src/Contrib/Ddd/Domain/Tests/Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests/_Imports.cs @@ -5,7 +5,7 @@ global using Masa.BuildingBlocks.Ddd.Domain.Entities; global using Masa.BuildingBlocks.Ddd.Domain.Entities.Auditing; global using Masa.BuildingBlocks.Ddd.Domain.Values; -global using Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore.Tests.Domain.Entities; +global using Masa.Contrib.Ddd.Domain.Repository.EFCore.Tests.Domain.Entities; global using Microsoft.EntityFrameworkCore; global using Microsoft.VisualStudio.TestTools.UnitTesting; global using Moq; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md index 69370523b..e3167c1fd 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md @@ -7,9 +7,9 @@ Example: ```C# Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //Use cross-process Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //Send cross-process messages -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore //Record cross-process message logs -Install-Package Masa.Contrib.Data.UoW.EF //Use UnitOfWork -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // Use SqlServer +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore //Record cross-process message logs +Install-Package Masa.Contrib.Data.UoW.EFCore //Use UnitOfWork +Install-Package Masa.Contrib.Data.EFCore.SqlServer // Use SqlServer ``` 1. Add IIntegrationEventBus diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md index b891e82ae..59215c73a 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.Dapr/README.zh-CN.md @@ -7,9 +7,9 @@ ```C# Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //使用跨进程事件 Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //通过dapr完成跨进程事件 -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore //记录跨进程消息日志 -Install-Package Masa.Contrib.Data.UoW.EF //使用工作单元 -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // 使用SqlServer +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore //记录跨进程消息日志 +Install-Package Masa.Contrib.Data.UoW.EFCore //使用工作单元 +Install-Package Masa.Contrib.Data.EFCore.SqlServer // 使用SqlServer ``` 1. 添加IIntegrationEventBus diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/DispatcherOptionsExtensions.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/DispatcherOptionsExtensions.cs similarity index 94% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/DispatcherOptionsExtensions.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/DispatcherOptionsExtensions.cs index 88c990bce..6b02a085a 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/DispatcherOptionsExtensions.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/DispatcherOptionsExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore; public static class DispatcherOptionsExtensions { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogContext.cs similarity index 83% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogContext.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogContext.cs index 8e4ad4ba0..9da5800fd 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogContext.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore; public class IntegrationEventLogContext { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogEntityTypeConfiguration.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogEntityTypeConfiguration.cs similarity index 94% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogEntityTypeConfiguration.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogEntityTypeConfiguration.cs index 48c7c422d..b776f9d2a 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogEntityTypeConfiguration.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogEntityTypeConfiguration.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore; public class IntegrationEventLogEntityTypeConfiguration: IEntityTypeConfiguration { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogModelCreatingProvider.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogModelCreatingProvider.cs similarity index 85% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogModelCreatingProvider.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogModelCreatingProvider.cs index aa98dd7ab..3ddcc8a06 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogModelCreatingProvider.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogModelCreatingProvider.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore; public class IntegrationEventLogModelCreatingProvider : IModelCreatingProvider { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogService.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs similarity index 98% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogService.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs index 7bd7ba26b..b93fe71b3 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/IntegrationEventLogService.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/IntegrationEventLogService.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore; public class IntegrationEventLogService : IIntegrationEventLogService { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.csproj similarity index 83% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.csproj rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.csproj index 65352bc9e..aff15520a 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.csproj +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/README.md similarity index 78% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.md rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/README.md index 2505c112f..abcf55609 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/README.md @@ -1,13 +1,13 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore +## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore > Provide support for sending IntegrationEvent Example: ```C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore ``` 1. Add EventLogs.EF diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/README.zh-CN.md similarity index 77% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/README.zh-CN.md index 8767d875a..b05f1e223 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/README.zh-CN.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/README.zh-CN.md @@ -1,13 +1,13 @@ 中 | [EN](README.md) -## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore +## Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore > 为发送IntegrationEvent提供支持 用例: ```C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore ``` 1. 使用EventLogs.EF diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/_Imports.cs similarity index 93% rename from src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/_Imports.cs index 745ce1fb5..88dbea6f2 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore/_Imports.cs @@ -5,7 +5,7 @@ global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Data.EFCore; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Metadata.Builders; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md index 1ced535f3..d5c1cfb9a 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.md @@ -7,8 +7,8 @@ Example: ``` C# Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //Use cross-process Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //For example, use dapr to provide pub and sub capabilities, or you can choose other implementations by yourself -Install-Package Masa.Contrib.Data.UoW.EF //Use UnitOfWork -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // Use SqlServer +Install-Package Masa.Contrib.Data.UoW.EFCore //Use UnitOfWork +Install-Package Masa.Contrib.Data.EFCore.SqlServer // Use SqlServer ``` 1. Add IIntegrationEventBus @@ -28,10 +28,10 @@ builder.Services 1.2 Use the provided EF version of the local message service -Install `Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore` +Install `Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore` ``` C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore //Record cross-process message log +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore //Record cross-process message log ``` ``` C# diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md index 35d782a4b..7431a8324 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md +++ b/src/Contrib/Dispatcher/IntegrationEvents/Masa.Contrib.Dispatcher.IntegrationEvents/README.zh-CN.md @@ -7,8 +7,8 @@ ```C# Install-Package Masa.Contrib.Dispatcher.IntegrationEvents //使用跨进程事件 Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.Dapr //例如使用dapr提供pub、sub能力,也可自行选择其他实现 -Install-Package Masa.Contrib.Data.UoW.EF //使用工作单元 -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer // 使用SqlServer +Install-Package Masa.Contrib.Data.UoW.EFCore //使用工作单元 +Install-Package Masa.Contrib.Data.EFCore.SqlServer // 使用SqlServer ``` 1. 添加IIntegrationEventBus @@ -28,10 +28,10 @@ builder.Services 1.2 使用提供的EF版的本地消息服务 -安装`Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore` +安装`Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore` ``` C# -Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore //记录跨进程消息日志 +Install-Package Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore //记录跨进程消息日志 ``` ```C# diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Domain/Entities/User.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Domain/Entities/User.cs similarity index 69% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Domain/Entities/User.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Domain/Entities/User.cs index 7ff5b8608..7e45ec8d7 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Domain/Entities/User.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Domain/Entities/User.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Domain.Entities; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.Domain.Entities; public class User { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/IntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Events/IntegrationEvent.cs similarity index 89% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/IntegrationEvent.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Events/IntegrationEvent.cs index de96a6714..d8e75e6ac 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/IntegrationEvent.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Events/IntegrationEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Events; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.Events; public abstract record IntegrationEvent : IIntegrationEvent { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs similarity index 80% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs index bd1006d2d..0c8e1a8b1 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Events/OrderPaymentSucceededIntegrationEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Events; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.Events; internal record OrderPaymentSucceededIntegrationEvent : IntegrationEvent { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Infrastructure/CustomDbContext.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Infrastructure/CustomDbContext.cs similarity index 77% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Infrastructure/CustomDbContext.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Infrastructure/CustomDbContext.cs index f6b059e0f..d4cec04a0 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Infrastructure/CustomDbContext.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Infrastructure/CustomDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Infrastructure; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.Infrastructure; internal class CustomDbContext : MasaDbContext { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogContextTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/IntegrationEventLogContextTest.cs similarity index 97% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogContextTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/IntegrationEventLogContextTest.cs index 5f374a4e4..813413fb2 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogContextTest.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/IntegrationEventLogContextTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests; [TestClass] public class IntegrationEventLogContextTest : TestBase diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogServiceTest.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/IntegrationEventLogServiceTest.cs similarity index 99% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogServiceTest.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/IntegrationEventLogServiceTest.cs index dc8e8f2bf..8b932b2ec 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/IntegrationEventLogServiceTest.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/IntegrationEventLogServiceTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests; [TestClass] public class IntegrationEventLogServiceTest : TestBase diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.csproj similarity index 81% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.csproj index 89ee0ef49..5b3b4495a 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.csproj +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.csproj @@ -24,8 +24,8 @@ - - + + diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/TestBase.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/TestBase.cs similarity index 91% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/TestBase.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/TestBase.cs index b741c724f..ac2230394 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/TestBase.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/TestBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests; public class TestBase : IDisposable { diff --git a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/_Imports.cs similarity index 84% rename from src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/_Imports.cs rename to src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/_Imports.cs index cdd8dd262..c26f2762f 100644 --- a/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests/_Imports.cs +++ b/src/Contrib/Dispatcher/IntegrationEvents/Tests/Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests/_Imports.cs @@ -5,10 +5,10 @@ global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents.Logs; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Domain.Entities; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Events; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore.Tests.Infrastructure; +global using Masa.Contrib.Data.EFCore; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.Domain.Entities; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.Events; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore.Tests.Infrastructure; global using Microsoft.Data.Sqlite; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Storage; diff --git a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md index a1cbd2589..ba9f6d44a 100644 --- a/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md +++ b/src/Contrib/Dispatcher/Masa.Contrib.Dispatcher.Events/README.md @@ -192,7 +192,7 @@ Runtime=.NET 6.0 IterationCount=100 RunStrategy=ColdStart ##### Summarize -IEventBus is the core of the event bus. It can be used with Cqrs, Uow, Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore to automatically execute SaveChange (enable UoW) and Commit (enable UoW without closing transaction) operations after sending Command, And support to roll back the transaction after an exception occurs +IEventBus is the core of the event bus. It can be used with Cqrs, Uow, Masa.Contrib.Ddd.Domain.Repository.EFCore to automatically execute SaveChange (enable UoW) and Commit (enable UoW without closing transaction) operations after sending Command, And support to roll back the transaction after an exception occurs > Question 1. Publishing events through eventBus, Handler error -> and handler throw exception @@ -203,7 +203,7 @@ IEventBus is the core of the event bus. It can be used with Cqrs, Uow, Masa.Cont > Question 2. Under what circumstances will SaveChange be automatically saved -> When auto call SaveChange? - > Use UoW and Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore, and use the Add, Update, Delete operations provided by IRepository, publish events through EventBus, and automatically execute SaveChange after executing EventHandler + > Use UoW and Masa.Contrib.Ddd.Domain.Repository.EFCore, and use the Add, Update, Delete operations provided by IRepository, publish events through EventBus, and automatically execute SaveChange after executing EventHandler > Question 3. If the SaveChange method of UoW is manually called in EventHandler to save, will the framework also save automatically? diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md index aa6ed2482..0613e366d 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.md @@ -5,9 +5,9 @@ Example: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore +Install-Package Masa.Contrib.Isolation.UoW.EFCore Install-Package Masa.Contrib.Isolation.MultiEnvironment -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. Configure `appsettings.json` diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md index 5441414d4..ef476ddb6 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiEnvironment/README.zh-CN.md @@ -5,9 +5,9 @@ 用例: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore +Install-Package Masa.Contrib.Isolation.UoW.EFCore Install-Package Masa.Contrib.Isolation.MultiEnvironment -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. 配置`appsettings.json` diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md index 0cdfbcea4..ff4e9bca6 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.md @@ -5,9 +5,9 @@ Example: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore +Install-Package Masa.Contrib.Isolation.UoW.EFCore Install-Package Masa.Contrib.Isolation.MultiTenant -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. Configure `appsettings.json` diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md index 84b4b2ddc..5cb23935d 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation.MultiTenant/README.zh-CN.md @@ -5,9 +5,9 @@ 用例: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore +Install-Package Masa.Contrib.Isolation.UoW.EFCore Install-Package Masa.Contrib.Isolation.MultiTenant -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. 配置`appsettings.json` diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md index b80ff6dd8..150c55e69 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.md @@ -2,4 +2,4 @@ ## Masa.Contrib.Isolation -The core library of Masa.Contrib.Isolation provides database address selection and parser for Isolation. It does not support stand-alone use yet. It needs to be used through Masa.Contrib.Isolation.UoW.EntityFrameworkCore. [View usage](../Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md) \ No newline at end of file +The core library of Masa.Contrib.Isolation provides database address selection and parser for Isolation. It does not support stand-alone use yet. It needs to be used through Masa.Contrib.Isolation.UoW.EFCore. [View usage](../Masa.Contrib.Isolation.UoW.EFCore/README.md) \ No newline at end of file diff --git a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md index 70e23cfd8..9acdec802 100644 --- a/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md +++ b/src/Contrib/Isolation/Masa.Contrib.Isolation/README.zh-CN.md @@ -2,4 +2,4 @@ ## Masa.Contrib.Isolation -Masa.Contrib.Isolation核心库,为Isolation提供数据库地址选择以及解析器,暂不支持单独使用,需要通过Masa.Contrib.Isolation.UoW.EF来使用,[查看用法](../Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md) \ No newline at end of file +Masa.Contrib.Isolation核心库,为Isolation提供数据库地址选择以及解析器,暂不支持单独使用,需要通过Masa.Contrib.Isolation.UoW.EF来使用,[查看用法](../Masa.Contrib.Isolation.UoW.EFCore/README.zh-CN.md) \ No newline at end of file diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/DispatcherOptionsExtensions.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/DispatcherOptionsExtensions.cs similarity index 98% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/DispatcherOptionsExtensions.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/DispatcherOptionsExtensions.cs index f51e78c41..e5a2e9340 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/DispatcherOptionsExtensions.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/DispatcherOptionsExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore; +namespace Masa.Contrib.Isolation.UoW.EFCore; public static class DispatcherOptionsExtensions { diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Internal/TypeExtensions.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/Internal/TypeExtensions.cs similarity index 88% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Internal/TypeExtensions.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/Internal/TypeExtensions.cs index 7b134746c..aff1ade19 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Internal/TypeExtensions.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/Internal/TypeExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Internal; +namespace Masa.Contrib.Isolation.UoW.EFCore.Internal; internal static class TypeExtensions { diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationDbContext.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/IsolationDbContext.cs similarity index 98% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationDbContext.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/IsolationDbContext.cs index 7f3a5ad30..b556f83d1 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationDbContext.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/IsolationDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore; +namespace Masa.Contrib.Isolation.UoW.EFCore; /// /// DbContext providing isolation diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationSaveChangesFilter.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/IsolationSaveChangesFilter.cs similarity index 97% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationSaveChangesFilter.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/IsolationSaveChangesFilter.cs index d493deded..67d9069b8 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/IsolationSaveChangesFilter.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/IsolationSaveChangesFilter.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore; +namespace Masa.Contrib.Isolation.UoW.EFCore; public class IsolationSaveChangesFilter : ISaveChangesFilter where TTenantId : IComparable { diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.csproj b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/Masa.Contrib.Isolation.UoW.EFCore.csproj similarity index 92% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.csproj rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/Masa.Contrib.Isolation.UoW.EFCore.csproj index 062853028..39dd36d3e 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.csproj +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/Masa.Contrib.Isolation.UoW.EFCore.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/README.md similarity index 93% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/README.md index 3ba9f9eed..8ad3db3b1 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.md +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/README.md @@ -1,15 +1,15 @@ [中](README.zh-CN.md) | EN -## Masa.Contrib.Isolation.UoW.EntityFrameworkCore +## Masa.Contrib.Isolation.UoW.EFCore Example: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore -Install-Package Masa.Contrib.Data.Contracts.EntityFrameworkCore +Install-Package Masa.Contrib.Isolation.UoW.EFCore +Install-Package Masa.Contrib.Data.Contracts.EFCore Install-Package Masa.Contrib.Isolation.MultiEnvironment // Environmental isolation Quote on demand Install-Package Masa.Contrib.Isolation.MultiTenant // Multi-tenant isolation On-demand reference -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. Configure `appsettings.json` diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/README.zh-CN.md similarity index 92% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/README.zh-CN.md index e66cfc0a4..35ed86c3b 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/README.zh-CN.md +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/README.zh-CN.md @@ -1,15 +1,15 @@ 中 | [EN](README.md) -## Masa.Contrib.Isolation.UoW.EntityFrameworkCore +## Masa.Contrib.Isolation.UoW.EFCore 用例: ```C# -Install-Package Masa.Contrib.Isolation.UoW.EntityFrameworkCore -Install-Package Masa.Contrib.Data.Contracts.EntityFrameworkCore +Install-Package Masa.Contrib.Isolation.UoW.EFCore +Install-Package Masa.Contrib.Data.Contracts.EFCore Install-Package Masa.Contrib.Isolation.MultiEnvironment // 环境隔离 按需引用 Install-Package Masa.Contrib.Isolation.MultiTenant // 多租户隔离 按需引用 -Install-Package Masa.Contrib.Data.EntityFrameworkCore.SqlServer +Install-Package Masa.Contrib.Data.EFCore.SqlServer ``` 1. 配置`appsettings.json` diff --git a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/_Imports.cs b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/_Imports.cs similarity index 75% rename from src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/_Imports.cs rename to src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/_Imports.cs index b48f8ab2c..de8c40a6a 100644 --- a/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EntityFrameworkCore/_Imports.cs +++ b/src/Contrib/Isolation/UoW/Masa.Contrib.Isolation.UoW.EFCore/_Imports.cs @@ -6,10 +6,10 @@ global using Masa.BuildingBlocks.Isolation; global using Masa.BuildingBlocks.Isolation.Environment; global using Masa.BuildingBlocks.Isolation.MultiTenant; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore.Filters; -global using Masa.Contrib.Data.UoW.EF; -global using Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Internal; +global using Masa.Contrib.Data.EFCore; +global using Masa.Contrib.Data.EFCore.Filters; +global using Masa.Contrib.Data.UoW.EFCore; +global using Masa.Contrib.Isolation.UoW.EFCore.Internal; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.ChangeTracking; global using Microsoft.Extensions.DependencyInjection; diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/CustomDbContext.cs similarity index 95% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/CustomDbContext.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/CustomDbContext.cs index e56851018..c382ae253 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/CustomDbContext.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/CustomDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Isolation.UoW.EFCore.Tests; public class CustomDbContext : MasaDbContext { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests.csproj similarity index 83% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests.csproj index 0f04e3f44..26b3712e2 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests.csproj +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests.csproj @@ -30,11 +30,11 @@ - - + + - + diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/TestBase.cs similarity index 88% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestBase.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/TestBase.cs index 9ccec49a6..62beeecac 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestBase.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/TestBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Isolation.UoW.EFCore.Tests; public class TestBase : IDisposable { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestIsolation.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/TestIsolation.cs similarity index 99% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestIsolation.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/TestIsolation.cs index 73178085d..32d11b9a5 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/TestIsolation.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/TestIsolation.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests; +namespace Masa.Contrib.Isolation.UoW.EFCore.Tests; [TestClass] public class TestIsolation : TestBase diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/_Imports.cs similarity index 90% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/_Imports.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/_Imports.cs index 142587b26..0222dcf96 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/_Imports.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/_Imports.cs @@ -8,8 +8,8 @@ global using Masa.BuildingBlocks.Isolation.Environment; global using Masa.BuildingBlocks.Isolation.MultiTenant; global using Masa.BuildingBlocks.Isolation.Options; -global using Masa.Contrib.Data.Contracts.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Data.Contracts.EFCore; +global using Masa.Contrib.Data.EFCore; global using Masa.Contrib.Isolation.MultiEnvironment; global using Masa.Contrib.Isolation.MultiTenant; global using Microsoft.AspNetCore.Builder; diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/appsettings.json b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/appsettings.json similarity index 100% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Tests/appsettings.json rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Tests/appsettings.json diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/CustomDbContext.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/CustomDbContext.cs similarity index 96% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/CustomDbContext.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/CustomDbContext.cs index c88ab3d95..3407f8b4a 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/CustomDbContext.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/CustomDbContext.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests; +namespace Masa.Contrib.Isolation.UoW.EFCore.Web.Tests; public class CustomDbContext : IsolationDbContext { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EdgeDriverTest.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/EdgeDriverTest.cs similarity index 97% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EdgeDriverTest.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/EdgeDriverTest.cs index dd2e9f65b..9233dcc1e 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EdgeDriverTest.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/EdgeDriverTest.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests; +namespace Masa.Contrib.Isolation.UoW.EFCore.Web.Tests; [TestClass] public class EdgeDriverTest diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/AddRoleEventHandler.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/EventHandlers/AddRoleEventHandler.cs similarity index 96% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/AddRoleEventHandler.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/EventHandlers/AddRoleEventHandler.cs index 9260102ab..8aacd4be0 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/AddRoleEventHandler.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/EventHandlers/AddRoleEventHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.EventHandlers; +namespace Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.EventHandlers; public class AddRoleEventHandler { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/RegisterUserEventHandler.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/EventHandlers/RegisterUserEventHandler.cs similarity index 96% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/RegisterUserEventHandler.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/EventHandlers/RegisterUserEventHandler.cs index e0d23c464..025217ceb 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/EventHandlers/RegisterUserEventHandler.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/EventHandlers/RegisterUserEventHandler.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.EventHandlers; +namespace Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.EventHandlers; public class RegisterUserEventHandler { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/AddRoleEvent.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Events/AddRoleEvent.cs similarity index 73% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/AddRoleEvent.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Events/AddRoleEvent.cs index fcef7e0df..7b790de8d 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/AddRoleEvent.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Events/AddRoleEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.Events; +namespace Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.Events; public record AddRoleEvent(string Name,int Quantity) : Event { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/RegisterUserEvent.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Events/RegisterUserEvent.cs similarity index 75% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/RegisterUserEvent.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Events/RegisterUserEvent.cs index bd7881053..12446aebc 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Events/RegisterUserEvent.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Events/RegisterUserEvent.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.Events; +namespace Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.Events; public record RegisterUserEvent(string Account,string Password) : Event { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.csproj similarity index 80% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.csproj index 58de48059..37ef58473 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.csproj +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.csproj @@ -24,12 +24,12 @@ - - + + - + diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/TestBase.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/TestBase.cs similarity index 88% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/TestBase.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/TestBase.cs index ce7e74fa3..6471454b0 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/TestBase.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/TestBase.cs @@ -1,7 +1,7 @@ // Copyright (c) MASA Stack All rights reserved. // Licensed under the MIT License. See LICENSE.txt in the project root for license information. -namespace Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests; +namespace Masa.Contrib.Isolation.UoW.EFCore.Web.Tests; public class TestBase : IDisposable { diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/_Imports.cs b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/_Imports.cs similarity index 84% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/_Imports.cs rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/_Imports.cs index 47b197a75..7cb423e8e 100644 --- a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/_Imports.cs +++ b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/_Imports.cs @@ -5,12 +5,12 @@ global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.BuildingBlocks.Isolation; global using Masa.BuildingBlocks.Isolation.Environment; -global using Masa.Contrib.Data.Contracts.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore; +global using Masa.Contrib.Data.Contracts.EFCore; +global using Masa.Contrib.Data.EFCore; global using Masa.Contrib.Dispatcher.Events; global using Masa.Contrib.Isolation.MultiEnvironment; global using Masa.Contrib.Isolation.MultiTenant; -global using Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests.Events; +global using Masa.Contrib.Isolation.UoW.EFCore.Web.Tests.Events; global using Masa.Utils.Security.Cryptography; global using Microsoft.AspNetCore.Http; global using Microsoft.Data.Sqlite; diff --git a/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/appsettings.json b/src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/appsettings.json similarity index 100% rename from src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EntityFrameworkCore.Web.Tests/appsettings.json rename to src/Contrib/Isolation/UoW/Tests/Masa.Contrib.Isolation.UoW.EFCore.Web.Tests/appsettings.json diff --git a/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj index 0c3301750..faee1783d 100644 --- a/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj +++ b/test/Masa.EventBus.IntegrationTests/Masa.EventBus.IntegrationTests.csproj @@ -20,12 +20,12 @@ - - - - + + + + - + diff --git a/test/Masa.EventBus.IntegrationTests/_Imports.cs b/test/Masa.EventBus.IntegrationTests/_Imports.cs index 8e730b7d7..3cc1ea8d5 100644 --- a/test/Masa.EventBus.IntegrationTests/_Imports.cs +++ b/test/Masa.EventBus.IntegrationTests/_Imports.cs @@ -9,13 +9,13 @@ global using Masa.BuildingBlocks.Dispatcher.Events; global using Masa.BuildingBlocks.Dispatcher.IntegrationEvents; global using Masa.BuildingBlocks.ReadWriteSpliting.Cqrs.Queries; -global using Masa.Contrib.Data.Contracts.EntityFrameworkCore; -global using Masa.Contrib.Data.EntityFrameworkCore; -global using Masa.Contrib.Data.UoW.EF; -global using Masa.Contrib.Ddd.Domain.Repository.EntityFrameworkCore; +global using Masa.Contrib.Data.Contracts.EFCore; +global using Masa.Contrib.Data.EFCore; +global using Masa.Contrib.Data.UoW.EFCore; +global using Masa.Contrib.Ddd.Domain.Repository.EFCore; global using Masa.Contrib.Dispatcher.Events; global using Masa.Contrib.Dispatcher.IntegrationEvents; -global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EntityFrameworkCore; +global using Masa.Contrib.Dispatcher.IntegrationEvents.EventLogs.EFCore; global using Masa.EventBus.IntegrationTests.Domain.Aggregate; global using Masa.EventBus.IntegrationTests.Infrastructure; global using Masa.EventBus.IntegrationTests.Infrastructure.Extensions; From 59c9805968dceb7700ad54dbac667b0b09008386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AC=BC=E8=B0=B7=E5=AD=90?= <358683537@qq.com> Date: Thu, 4 Aug 2022 17:02:25 +0800 Subject: [PATCH 28/29] Update pr_run_test_ci.yml --- .github/workflows/pr_run_test_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_run_test_ci.yml b/.github/workflows/pr_run_test_ci.yml index 1e49ece11..bbd686e0b 100644 --- a/.github/workflows/pr_run_test_ci.yml +++ b/.github/workflows/pr_run_test_ci.yml @@ -47,6 +47,6 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: test - run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*" + run: dotnet test --filter FullyQualifiedName~Masa.Utils --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*" From ed93d62ff4c05a9d5767620d89f694bf257d57bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AC=BC=E8=B0=B7=E5=AD=90?= <358683537@qq.com> Date: Thu, 4 Aug 2022 17:08:57 +0800 Subject: [PATCH 29/29] Update pr_run_test_ci.yml --- .github/workflows/pr_run_test_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_run_test_ci.yml b/.github/workflows/pr_run_test_ci.yml index bbd686e0b..ddb2f7f34 100644 --- a/.github/workflows/pr_run_test_ci.yml +++ b/.github/workflows/pr_run_test_ci.yml @@ -47,6 +47,6 @@ jobs: run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true - name: test - run: dotnet test --filter FullyQualifiedName~Masa.Utils --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*" + run: dotnet test --filter FullyQualifiedName!~Masa.Utils --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*"